@modelcontextprotocol/server-system-monitor 1.5.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +72 -4
- package/dist/mcp-app.html +33 -32
- package/dist/server.js +40082 -39342
- package/package.json +1 -1
package/dist/mcp-app.html
CHANGED
|
@@ -5,51 +5,52 @@
|
|
|
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>System Monitor</title>
|
|
8
|
-
<script type="module" crossorigin>var cl=Object.defineProperty;var ll=(e,t,n)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var P=(e,t,n)=>ll(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&s(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function k(e,t,n){function s(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:r,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);const l=r.prototype,u=Object.keys(l);for(let h=0;h<u.length;h++){const d=u[h];d in a||(a[d]=l[d].bind(a))}}const i=(n==null?void 0:n.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:e});function r(a){var c;const l=n!=null&&n.Parent?new o:this;s(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(r,"init",{value:s}),Object.defineProperty(r,Symbol.hasInstance,{value:a=>{var c,l;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(l=(c=a==null?void 0:a._zod)==null?void 0:c.traits)==null?void 0:l.has(e)}}),Object.defineProperty(r,"name",{value:e}),r}class Ie extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class oa extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ra={};function ne(e){return ra}function aa(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,i])=>t.indexOf(+s)===-1).map(([s,i])=>i)}function Qs(e,t){return typeof t=="bigint"?t.toString():t}function vs(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xi(e){return e==null}function vi(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ul(e,t){const n=(e.toString().split(".")[1]||"").length,s=t.toString();let i=(s.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(s)){const c=s.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const o=n>i?n:i,r=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return r%a/10**o}const ho=Symbol("evaluating");function V(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==ho)return s===void 0&&(s=ho,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Se(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function re(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function fo(e){return JSON.stringify(e)}function hl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const ca="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ln(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const dl=vs(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ae(e){if(ln(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ln(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function la(e){return Ae(e)?{...e}:Array.isArray(e)?[...e]:e}const fl=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ae(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(s._zod.parent=e),s}function R(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function pl(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const gl={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 ml(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=re(e._zod.def,{get shape(){const r={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(r[a]=n.shape[a])}return Se(this,"shape",r),r},checks:[]});return ae(e,o)}function bl(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=re(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete r[a]}return Se(this,"shape",r),r},checks:[]});return ae(e,o)}function _l(e,t){if(!Ae(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const o=e._zod.def.shape;for(const r in t)if(Object.getOwnPropertyDescriptor(o,r)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=re(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Se(this,"shape",o),o}});return ae(e,i)}function yl(e,t){if(!Ae(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=re(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Se(this,"shape",s),s}});return ae(e,n)}function xl(e,t){const n=re(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return Se(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return ae(e,n)}function vl(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=re(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(n)for(const l in n){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);n[l]&&(c[l]=e?new e({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=e?new e({type:"optional",innerType:a[l]}):a[l];return Se(this,"shape",c),c},checks:[]});return ae(t,r)}function wl(e,t,n){const s=re(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(n)for(const r in n){if(!(r in o))throw new Error(`Unrecognized key: "${r}"`);n[r]&&(o[r]=new e({type:"nonoptional",innerType:i[r]}))}else for(const r in i)o[r]=new e({type:"nonoptional",innerType:i[r]});return Se(this,"shape",o),o}});return ae(t,s)}function ze(e,t=0){var n;if(e.aborted===!0)return!0;for(let s=t;s<e.issues.length;s++)if(((n=e.issues[s])==null?void 0:n.continue)!==!0)return!0;return!1}function Re(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function In(e){return typeof e=="string"?e:e==null?void 0:e.message}function se(e,t,n){var i,o,r,a,c,l;const s={...e,path:e.path??[]};if(!e.message){const u=In((r=(o=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:r.call(o,e))??In((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??In((c=n.customError)==null?void 0:c.call(n,e))??In((l=n.localeError)==null?void 0:l.call(n,e))??"Invalid input";s.message=u}return delete s.inst,delete s.continue,t!=null&&t.reportInput||delete s.input,s}function wi(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function un(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const ua=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Qs,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},ha=k("$ZodError",ua),da=k("$ZodError",ua,{Parent:Error});function kl(e,t=n=>n.message){const n={},s=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:n}}function Sl(e,t=n=>n.message){const n={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(r=>s({issues:r}));else if(o.code==="invalid_key")s({issues:o.issues});else if(o.code==="invalid_element")s({issues:o.issues});else if(o.path.length===0)n._errors.push(t(o));else{let r=n,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(r[c]=r[c]||{_errors:[]},r[c]._errors.push(t(o))):r[c]=r[c]||{_errors:[]},r=r[c],a++}}};return s(e),n}const ki=e=>(t,n,s,i)=>{const o=s?Object.assign(s,{async:!1}):{async:!1},r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise)throw new Ie;if(r.issues.length){const a=new((i==null?void 0:i.Err)??e)(r.issues.map(c=>se(c,o,ne())));throw ca(a,i==null?void 0:i.callee),a}return r.value},Si=e=>async(t,n,s,i)=>{const o=s?Object.assign(s,{async:!0}):{async:!0};let r=t._zod.run({value:n,issues:[]},o);if(r instanceof Promise&&(r=await r),r.issues.length){const a=new((i==null?void 0:i.Err)??e)(r.issues.map(c=>se(c,o,ne())));throw ca(a,i==null?void 0:i.callee),a}return r.value},ws=e=>(t,n,s)=>{const i=s?{...s,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},i);if(o instanceof Promise)throw new Ie;return o.issues.length?{success:!1,error:new(e??ha)(o.issues.map(r=>se(r,i,ne())))}:{success:!0,data:o.value}},fa=ws(da),ks=e=>async(t,n,s)=>{const i=s?Object.assign(s,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(r=>se(r,i,ne())))}:{success:!0,data:o.value}},Ml=ks(da),Pl=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ki(e)(t,n,i)},Tl=e=>(t,n,s)=>ki(e)(t,n,s),Cl=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Si(e)(t,n,i)},Ol=e=>async(t,n,s)=>Si(e)(t,n,s),zl=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ws(e)(t,n,i)},Rl=e=>(t,n,s)=>ws(e)(t,n,s),Il=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return ks(e)(t,n,i)},El=e=>async(t,n,s)=>ks(e)(t,n,s),Al=/^[cC][^\s-]{8,}$/,Dl=/^[0-9a-z]+$/,Ll=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Nl=/^[0-9a-vA-V]{20}$/,$l=/^[A-Za-z0-9]{27}$/,Fl=/^[a-zA-Z0-9_-]{21}$/,Hl=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,jl=/^([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})$/,po=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)$/,Bl=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Zl="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Vl(){return new RegExp(Zl,"u")}const Wl=/^(?:(?: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])$/,ql=/^(([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}|:))$/,Ul=/^((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])$/,Yl=/^(([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])$/,Jl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pa=/^[A-Za-z0-9_-]*$/,Kl=/^\+[1-9]\d{6,14}$/,ga="(?:(?:\\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])))",Xl=new RegExp(`^${ga}$`);function ma(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Gl(e){return new RegExp(`^${ma(e)}$`)}function Ql(e){const t=ma({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${ga}T(?:${s})$`)}const tu=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eu=/^-?\d+$/,ba=/^-?\d+(?:\.\d+)?$/,nu=/^(?:true|false)$/i,su=/^null$/i,iu=/^undefined$/i,ou=/^[^A-Z]*$/,ru=/^[^a-z]*$/,Pt=k("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),_a={number:"number",bigint:"bigint",object:"date"},ya=k("$ZodCheckLessThan",(e,t)=>{Pt.init(e,t);const n=_a[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),xa=k("$ZodCheckGreaterThan",(e,t)=>{Pt.init(e,t);const n=_a[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),au=k("$ZodCheckMultipleOf",(e,t)=>{Pt.init(e,t),e._zod.onattach.push(n=>{var s;(s=n._zod.bag).multipleOf??(s.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):ul(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),cu=k("$ZodCheckNumberFormat",(e,t)=>{var r;Pt.init(e,t),t.format=t.format||"float64";const n=(r=t.format)==null?void 0:r.includes("int"),s=n?"int":"number",[i,o]=gl[t.format];e._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=i,c.maximum=o,n&&(c.pattern=eu)}),e._zod.check=a=>{const c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}c<i&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>o&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),lu=k("$ZodCheckMaxLength",(e,t)=>{var n;Pt.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xi(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const i=s.value;if(i.length<=t.maximum)return;const r=wi(i);s.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),uu=k("$ZodCheckMinLength",(e,t)=>{var n;Pt.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xi(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const i=s.value;if(i.length>=t.minimum)return;const r=wi(i);s.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),hu=k("$ZodCheckLengthEquals",(e,t)=>{var n;Pt.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!xi(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=s=>{const i=s.value,o=i.length;if(o===t.length)return;const r=wi(i),a=o>t.length;s.issues.push({origin:r,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),Ss=k("$ZodCheckStringFormat",(e,t)=>{var n,s;Pt.init(e,t),e._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),du=k("$ZodCheckRegex",(e,t)=>{Ss.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),fu=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ou),Ss.init(e,t)}),pu=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ru),Ss.init(e,t)}),gu=k("$ZodCheckIncludes",(e,t)=>{Pt.init(e,t);const n=De(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(s)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),mu=k("$ZodCheckStartsWith",(e,t)=>{Pt.init(e,t);const n=new RegExp(`^${De(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),bu=k("$ZodCheckEndsWith",(e,t)=>{Pt.init(e,t);const n=new RegExp(`.*${De(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),_u=k("$ZodCheckOverwrite",(e,t)=>{Pt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class yu{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
|
|
9
|
-
`).filter(r=>r),i=Math.min(...s.map(r=>r.length-r.trimStart().length)),o=s.map(r=>r.slice(i)).map(r=>" ".repeat(this.indent*2)+r);for(const r of o)this.content.push(r)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...n,i.join(`
|
|
10
|
-
`))}}const xu={major:4,minor:3,patch:5},Q=k("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=xu;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const o of s)for(const r of o._zod.onattach)r(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,c,l)=>{let u=ze(a),h;for(const d of c){if(d._zod.def.when){if(!d._zod.def.when(a))continue}else if(u)continue;const f=a.issues.length,p=d._zod.check(a);if(p instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Ie;if(h||p instanceof Promise)h=(h??Promise.resolve()).then(async()=>{await p,a.issues.length!==f&&(u||(u=ze(a,f)))});else{if(a.issues.length===f)continue;u||(u=ze(a,f))}}return h?h.then(()=>a):a},r=(a,c,l)=>{if(ze(a))return a.aborted=!0,a;const u=o(c,s,l);if(u instanceof Promise){if(l.async===!1)throw new Ie;return u.then(h=>e._zod.parse(h,l))}return e._zod.parse(u,l)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){const u=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(h=>r(h,a,c)):r(u,a,c)}const l=e._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Ie;return l.then(u=>o(u,s,c))}return o(l,s,c)}}V(e,"~standard",()=>({validate:o=>{var r;try{const a=fa(e,o);return a.success?{value:a.data}:{issues:(r=a.error)==null?void 0:r.issues}}catch{return Ml(e,o).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),Mi=k("$ZodString",(e,t)=>{var n;Q.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??tu(e._zod.bag),e._zod.parse=(s,i)=>{if(t.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),it=k("$ZodStringFormat",(e,t)=>{Ss.init(e,t),Mi.init(e,t)}),vu=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=jl),it.init(e,t)}),wu=k("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=po(s))}else t.pattern??(t.pattern=po());it.init(e,t)}),ku=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Bl),it.init(e,t)}),Su=k("$ZodURL",(e,t)=>{it.init(e,t),e._zod.check=n=>{try{const s=n.value.trim(),i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Mu=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Vl()),it.init(e,t)}),Pu=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Fl),it.init(e,t)}),Tu=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Al),it.init(e,t)}),Cu=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Dl),it.init(e,t)}),Ou=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ll),it.init(e,t)}),zu=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Nl),it.init(e,t)}),Ru=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=$l),it.init(e,t)}),Iu=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ql(t)),it.init(e,t)}),Eu=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Xl),it.init(e,t)}),Au=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Gl(t)),it.init(e,t)}),Du=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Hl),it.init(e,t)}),Lu=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Wl),it.init(e,t),e._zod.bag.format="ipv4"}),Nu=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=ql),it.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$u=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ul),it.init(e,t)}),Fu=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Yl),it.init(e,t),e._zod.check=n=>{const s=n.value.split("/");try{if(s.length!==2)throw new Error;const[i,o]=s;if(!o)throw new Error;const r=Number(o);if(`${r}`!==o)throw new Error;if(r<0||r>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function va(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Hu=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Jl),it.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{va(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function ju(e){if(!pa.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return va(n)}const Bu=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=pa),it.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{ju(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Zu=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Kl),it.init(e,t)});function Vu(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[s]=n;if(!s)return!1;const i=JSON.parse(atob(s));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const Wu=k("$ZodJWT",(e,t)=>{it.init(e,t),e._zod.check=n=>{Vu(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),wa=k("$ZodNumber",(e,t)=>{Q.init(e,t),e._zod.pattern=e._zod.bag.pattern??ba,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),n}}),qu=k("$ZodNumberFormat",(e,t)=>{cu.init(e,t),wa.init(e,t)}),Uu=k("$ZodBoolean",(e,t)=>{Q.init(e,t),e._zod.pattern=nu,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Yu=k("$ZodUndefined",(e,t)=>{Q.init(e,t),e._zod.pattern=iu,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,s)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),Ju=k("$ZodNull",(e,t)=>{Q.init(e,t),e._zod.pattern=su,e._zod.values=new Set([null]),e._zod.parse=(n,s)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),Ku=k("$ZodUnknown",(e,t)=>{Q.init(e,t),e._zod.parse=n=>n}),Xu=k("$ZodNever",(e,t)=>{Q.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function go(e,t,n){e.issues.length&&t.issues.push(...Re(n,e.issues)),t.value[n]=e.value}const Gu=k("$ZodArray",(e,t)=>{Q.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const o=[];for(let r=0;r<i.length;r++){const a=i[r],c=t.element._zod.run({value:a,issues:[]},s);c instanceof Promise?o.push(c.then(l=>go(l,n,r))):go(c,n,r)}return o.length?Promise.all(o).then(()=>n):n}});function as(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...Re(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function ka(e){var s,i,o,r;const t=Object.keys(e.shape);for(const a of t)if(!((r=(o=(i=(s=e.shape)==null?void 0:s[a])==null?void 0:i._zod)==null?void 0:o.traits)!=null&&r.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=pl(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Sa(e,t,n,s,i,o){const r=[],a=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optout==="optional";for(const h in t){if(a.has(h))continue;if(l==="never"){r.push(h);continue}const d=c.run({value:t[h],issues:[]},s);d instanceof Promise?e.push(d.then(f=>as(f,n,h,t,u))):as(d,n,h,t,u)}return r.length&&n.issues.push({code:"unrecognized_keys",keys:r,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const Qu=k("$ZodObject",(e,t)=>{Q.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}const s=vs(()=>ka(t));V(e._zod,"propValues",()=>{const a=t.shape,c={};for(const l in a){const u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const h of u.values)c[l].add(h)}}return c});const i=ln,o=t.catchall;let r;e._zod.parse=(a,c)=>{r??(r=s.value);const l=a.value;if(!i(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),a;a.value={};const u=[],h=r.shape;for(const d of r.keys){const f=h[d],p=f._zod.optout==="optional",g=f._zod.run({value:l[d],issues:[]},c);g instanceof Promise?u.push(g.then(m=>as(m,a,d,l,p))):as(g,a,d,l,p)}return o?Sa(u,l,a,c,s.value,e):u.length?Promise.all(u).then(()=>a):a}}),th=k("$ZodObjectJIT",(e,t)=>{Qu.init(e,t);const n=e._zod.parse,s=vs(()=>ka(t)),i=d=>{var M;const f=new yu(["shape","payload","ctx"]),p=s.value,g=S=>{const w=fo(S);return`shape[${w}]._zod.run({ value: input[${w}], issues: [] }, ctx)`};f.write("const input = payload.value;");const m=Object.create(null);let b=0;for(const S of p.keys)m[S]=`key_${b++}`;f.write("const newResult = {};");for(const S of p.keys){const w=m[S],C=fo(S),T=d[S],O=((M=T==null?void 0:T._zod)==null?void 0:M.optout)==="optional";f.write(`const ${w} = ${g(S)};`),O?f.write(`
|
|
11
|
-
if (${w}.issues.length) {
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
<script type="module" crossorigin>var ib=Object.defineProperty;var rb=(t,e,i)=>e in t?ib(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var w=(t,e,i)=>rb(t,typeof e!="symbol"?e+"":e,i);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function i(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(n){if(n.ep)return;n.ep=!0;const o=i(n);fetch(n.href,o)}})();const ob="modulepreload",sb=function(t,e){return new URL(t,e).href},xu={},ab=function(e,i,r){let n=Promise.resolve();if(i&&i.length>0){let s=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const a=document.getElementsByTagName("link"),c=document.querySelector("meta[property=csp-nonce]"),l=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));n=s(i.map(u=>{if(u=sb(u,r),u in xu)return;xu[u]=!0;const d=u.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(!!r)for(let p=a.length-1;p>=0;p--){const g=a[p];if(g.href===u&&(!d||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${h}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":ob,d||(m.as="script"),m.crossOrigin="",m.href=u,l&&m.setAttribute("nonce",l),document.head.appendChild(m),d)return new Promise((p,g)=>{m.addEventListener("load",p),m.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function o(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return n.then(s=>{for(const a of s||[])a.status==="rejected"&&o(a.reason);return e().catch(o)})},ga=Object.freeze({status:"aborted"});function b(t,e,i){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);const l=s.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){const h=u[d];h in a||(a[h]=l[h].bind(a))}}const n=(i==null?void 0:i.Parent)??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function s(a){var c;const l=i!=null&&i.Parent?new o:this;r(l,a),(c=l._zod).deferred??(c.deferred=[]);for(const u of l._zod.deferred)u();return l}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var c,l;return i!=null&&i.Parent&&a instanceof i.Parent?!0:(l=(c=a==null?void 0:a._zod)==null?void 0:c.traits)==null?void 0:l.has(t)}}),Object.defineProperty(s,"name",{value:t}),s}const va=Symbol("zod_brand");class Lt extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class po extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const Gr={};function _e(t){return t&&Object.assign(Gr,t),Gr}function cb(t){return t}function lb(t){return t}function ub(t){}function db(t){throw new Error("Unexpected value in exhaustive check")}function hb(t){}function ba(t){const e=Object.values(t).filter(r=>typeof r=="number");return Object.entries(t).filter(([r,n])=>e.indexOf(+r)===-1).map(([r,n])=>n)}function T(t,e="|"){return t.map(i=>A(i)).join(e)}function Yr(t,e){return typeof e=="bigint"?e.toString():e}function mi(t){return{get value(){{const e=t();return Object.defineProperty(this,"value",{value:e}),e}}}}function Kt(t){return t==null}function go(t){const e=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;return t.slice(e,i)}function bh(t,e){const i=(t.toString().split(".")[1]||"").length,r=e.toString();let n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(n=Number.parseInt(c[1]))}const o=i>n?i:n,s=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return s%a/10**o}const $u=Symbol("evaluating");function Z(t,e,i){let r;Object.defineProperty(t,e,{get(){if(r!==$u)return r===void 0&&(r=$u,r=i()),r},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function fb(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function wt(t,e,i){Object.defineProperty(t,e,{value:i,writable:!0,enumerable:!0,configurable:!0})}function nt(...t){const e={};for(const i of t){const r=Object.getOwnPropertyDescriptors(i);Object.assign(e,r)}return Object.defineProperties({},e)}function mb(t){return nt(t._zod.def)}function pb(t,e){return e?e.reduce((i,r)=>i==null?void 0:i[r],t):t}function gb(t){const e=Object.keys(t),i=e.map(r=>t[r]);return Promise.all(i).then(r=>{const n={};for(let o=0;o<e.length;o++)n[e[o]]=r[o];return n})}function vb(t=10){const e="abcdefghijklmnopqrstuvwxyz";let i="";for(let r=0;r<t;r++)i+=e[Math.floor(Math.random()*e.length)];return i}function Js(t){return JSON.stringify(t)}function _h(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const _a="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function sn(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}const yh=mi(()=>{var t;if(typeof navigator<"u"&&((t=navigator==null?void 0:navigator.userAgent)!=null&&t.includes("Cloudflare")))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Bt(t){if(sn(t)===!1)return!1;const e=t.constructor;if(e===void 0||typeof e!="function")return!0;const i=e.prototype;return!(sn(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function vo(t){return Bt(t)?{...t}:Array.isArray(t)?[...t]:t}function bb(t){let e=0;for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&e++;return e}const _b=t=>{const e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},Xr=new Set(["string","number","symbol"]),xh=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ht(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Le(t,e,i){const r=new t._zod.constr(e??t._zod.def);return(!e||i!=null&&i.parent)&&(r._zod.parent=t),r}function S(t){const e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if((e==null?void 0:e.message)!==void 0){if((e==null?void 0:e.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function yb(t){let e;return new Proxy({},{get(i,r,n){return e??(e=t()),Reflect.get(e,r,n)},set(i,r,n,o){return e??(e=t()),Reflect.set(e,r,n,o)},has(i,r){return e??(e=t()),Reflect.has(e,r)},deleteProperty(i,r){return e??(e=t()),Reflect.deleteProperty(e,r)},ownKeys(i){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(i,r){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,r)},defineProperty(i,r,n){return e??(e=t()),Reflect.defineProperty(e,r,n)}})}function A(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function $h(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}const kh={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]},Sh={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function wh(t,e){const i=t._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=nt(t._zod.def,{get shape(){const s={};for(const a in e){if(!(a in i.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=i.shape[a])}return wt(this,"shape",s),s},checks:[]});return Le(t,o)}function Ih(t,e){const i=t._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=nt(t._zod.def,{get shape(){const s={...t._zod.def.shape};for(const a in e){if(!(a in i.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete s[a]}return wt(this,"shape",s),s},checks:[]});return Le(t,o)}function zh(t,e){if(!Bt(e))throw new Error("Invalid input to extend: expected a plain object");const i=t._zod.def.checks;if(i&&i.length>0){const o=t._zod.def.shape;for(const s in e)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=nt(t._zod.def,{get shape(){const o={...t._zod.def.shape,...e};return wt(this,"shape",o),o}});return Le(t,n)}function Ph(t,e){if(!Bt(e))throw new Error("Invalid input to safeExtend: expected a plain object");const i=nt(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e};return wt(this,"shape",r),r}});return Le(t,i)}function Th(t,e){const i=nt(t._zod.def,{get shape(){const r={...t._zod.def.shape,...e._zod.def.shape};return wt(this,"shape",r),r},get catchall(){return e._zod.def.catchall},checks:[]});return Le(t,i)}function Oh(t,e,i){const n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=nt(e._zod.def,{get shape(){const a=e._zod.def.shape,c={...a};if(i)for(const l in i){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);i[l]&&(c[l]=t?new t({type:"optional",innerType:a[l]}):a[l])}else for(const l in a)c[l]=t?new t({type:"optional",innerType:a[l]}):a[l];return wt(this,"shape",c),c},checks:[]});return Le(e,s)}function Dh(t,e,i){const r=nt(e._zod.def,{get shape(){const n=e._zod.def.shape,o={...n};if(i)for(const s in i){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);i[s]&&(o[s]=new t({type:"nonoptional",innerType:n[s]}))}else for(const s in n)o[s]=new t({type:"nonoptional",innerType:n[s]});return wt(this,"shape",o),o}});return Le(e,r)}function Nt(t,e=0){var i;if(t.aborted===!0)return!0;for(let r=e;r<t.issues.length;r++)if(((i=t.issues[r])==null?void 0:i.continue)!==!0)return!0;return!1}function Je(t,e){return e.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(t),i})}function Hn(t){return typeof t=="string"?t:t==null?void 0:t.message}function He(t,e,i){var n,o,s,a,c,l;const r={...t,path:t.path??[]};if(!t.message){const u=Hn((s=(o=(n=t.inst)==null?void 0:n._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,t))??Hn((a=e==null?void 0:e.error)==null?void 0:a.call(e,t))??Hn((c=i.customError)==null?void 0:c.call(i,t))??Hn((l=i.localeError)==null?void 0:l.call(i,t))??"Invalid input";r.message=u}return delete r.inst,delete r.continue,e!=null&&e.reportInput||delete r.input,r}function bo(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function _o(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function j(t){const e=typeof t;switch(e){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const i=t;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return e}function an(...t){const[e,i,r]=t;return typeof e=="string"?{message:e,code:"custom",input:i,inst:r}:{...e}}function xb(t){return Object.entries(t).filter(([e,i])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function Mh(t){const e=atob(t),i=new Uint8Array(e.length);for(let r=0;r<e.length;r++)i[r]=e.charCodeAt(r);return i}function Eh(t){let e="";for(let i=0;i<t.length;i++)e+=String.fromCharCode(t[i]);return btoa(e)}function $b(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-e.length%4)%4);return Mh(e+i)}function kb(t){return Eh(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Sb(t){const e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");const i=new Uint8Array(e.length/2);for(let r=0;r<e.length;r+=2)i[r/2]=Number.parseInt(e.slice(r,r+2),16);return i}function wb(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}class Ib{constructor(...e){}}const ya=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:Sh,Class:Ib,NUMBER_FORMAT_RANGES:kh,aborted:Nt,allowsEval:yh,assert:hb,assertEqual:cb,assertIs:ub,assertNever:db,assertNotEqual:lb,assignProp:wt,base64ToUint8Array:Mh,base64urlToUint8Array:$b,cached:mi,captureStackTrace:_a,cleanEnum:xb,cleanRegex:go,clone:Le,cloneDef:mb,createTransparentProxy:yb,defineLazy:Z,esc:Js,escapeRegex:ht,extend:zh,finalizeIssue:He,floatSafeRemainder:bh,getElementAtPath:pb,getEnumValues:ba,getLengthableOrigin:_o,getParsedType:_b,getSizableOrigin:bo,hexToUint8Array:Sb,isObject:sn,isPlainObject:Bt,issue:an,joinValues:T,jsonStringifyReplacer:Yr,merge:Th,mergeDefs:nt,normalizeParams:S,nullish:Kt,numKeys:bb,objectClone:fb,omit:Ih,optionalKeys:$h,parsedType:j,partial:Oh,pick:wh,prefixIssues:Je,primitiveTypes:xh,promiseAllObject:gb,propertyKeyTypes:Xr,randomString:vb,required:Dh,safeExtend:Ph,shallowClone:vo,slugify:_h,stringifyPrimitive:A,uint8ArrayToBase64:Eh,uint8ArrayToBase64url:kb,uint8ArrayToHex:wb,unwrapMessage:Hn},Symbol.toStringTag,{value:"Module"})),Ch=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,Yr,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},xa=b("$ZodError",Ch),Fe=b("$ZodError",Ch,{Parent:Error});function yo(t,e=i=>i.message){const i={},r=[];for(const n of t.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:i}}function xo(t,e=i=>i.message){const i={_errors:[]},r=n=>{for(const o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>r({issues:s}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)i._errors.push(e(o));else{let s=i,a=0;for(;a<o.path.length;){const c=o.path[a];a===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(e(o))):s[c]=s[c]||{_errors:[]},s=s[c],a++}}};return r(t),i}function $a(t,e=i=>i.message){const i={errors:[]},r=(n,o=[])=>{var s,a;for(const c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>r({issues:l},c.path));else if(c.code==="invalid_key")r({issues:c.issues},c.path);else if(c.code==="invalid_element")r({issues:c.issues},c.path);else{const l=[...o,...c.path];if(l.length===0){i.errors.push(e(c));continue}let u=i,d=0;for(;d<l.length;){const h=l[d],f=d===l.length-1;typeof h=="string"?(u.properties??(u.properties={}),(s=u.properties)[h]??(s[h]={errors:[]}),u=u.properties[h]):(u.items??(u.items=[]),(a=u.items)[h]??(a[h]={errors:[]}),u=u.items[h]),f&&u.errors.push(e(c)),d++}}};return r(t),i}function Ah(t){const e=[],i=t.map(r=>typeof r=="object"?r.key:r);for(const r of i)typeof r=="number"?e.push(`[${r}]`):typeof r=="symbol"?e.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?e.push(`[${JSON.stringify(r)}]`):(e.length&&e.push("."),e.push(r));return e.join("")}function ka(t){var r;const e=[],i=[...t.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(const n of i)e.push(`✖ ${n.message}`),(r=n.path)!=null&&r.length&&e.push(` → at ${Ah(n.path)}`);return e.join(`
|
|
9
|
+
`)}const pi=t=>(e,i,r,n)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},s=e._zod.run({value:i,issues:[]},o);if(s instanceof Promise)throw new Lt;if(s.issues.length){const a=new((n==null?void 0:n.Err)??t)(s.issues.map(c=>He(c,o,_e())));throw _a(a,n==null?void 0:n.callee),a}return s.value},Ks=pi(Fe),gi=t=>async(e,i,r,n)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=e._zod.run({value:i,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((n==null?void 0:n.Err)??t)(s.issues.map(c=>He(c,o,_e())));throw _a(a,n==null?void 0:n.callee),a}return s.value},Gs=gi(Fe),vi=t=>(e,i,r)=>{const n=r?{...r,async:!1}:{async:!1},o=e._zod.run({value:i,issues:[]},n);if(o instanceof Promise)throw new Lt;return o.issues.length?{success:!1,error:new(t??xa)(o.issues.map(s=>He(s,n,_e())))}:{success:!0,data:o.value}},Sa=vi(Fe),bi=t=>async(e,i,r)=>{const n=r?Object.assign(r,{async:!0}):{async:!0};let o=e._zod.run({value:i,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(s=>He(s,n,_e())))}:{success:!0,data:o.value}},jh=bi(Fe),wa=t=>(e,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pi(t)(e,i,n)},zb=wa(Fe),Ia=t=>(e,i,r)=>pi(t)(e,i,r),Pb=Ia(Fe),za=t=>async(e,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return gi(t)(e,i,n)},Tb=za(Fe),Pa=t=>async(e,i,r)=>gi(t)(e,i,r),Ob=Pa(Fe),Ta=t=>(e,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vi(t)(e,i,n)},Db=Ta(Fe),Oa=t=>(e,i,r)=>vi(t)(e,i,r),Mb=Oa(Fe),Da=t=>async(e,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return bi(t)(e,i,n)},Eb=Da(Fe),Ma=t=>async(e,i,r)=>bi(t)(e,i,r),Cb=Ma(Fe),Rh=/^[cC][^\s-]{8,}$/,Nh=/^[0-9a-z]+$/,Uh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Lh=/^[0-9a-vA-V]{20}$/,Fh=/^[A-Za-z0-9]{27}$/,Zh=/^[a-zA-Z0-9_-]{21}$/,Bh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ab=/^[-+]?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)?)??$/,Hh=/^([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})$/,cn=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jb=cn(4),Rb=cn(6),Nb=cn(7),Vh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Ub=/^[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])?)*$/,Lb=/^(([^<>()\[\]\\.,;:\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,}))$/,Wh=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Fb=Wh,Zb=/^[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])?)*$/,Bb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function qh(){return new RegExp(Bb,"u")}const Jh=/^(?:(?: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])$/,Kh=/^(([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}|:))$/,Gh=t=>{const e=ht(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Yh=/^((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])$/,Xh=/^(([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])$/,Qh=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ea=/^[A-Za-z0-9_-]*$/,ef=/^(?=.{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])?)*\.?$/,tf=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,nf=/^\+[1-9]\d{6,14}$/,rf="(?:(?:\\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])))",of=new RegExp(`^${rf}$`);function sf(t){const e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function af(t){return new RegExp(`^${sf(t)}$`)}function cf(t){const e=sf({precision:t.precision}),i=["Z"];t.local&&i.push(""),t.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${e}(?:${i.join("|")})`;return new RegExp(`^${rf}T(?:${r})$`)}const lf=t=>{const e=t?`[\\s\\S]{${(t==null?void 0:t.minimum)??0},${(t==null?void 0:t.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},uf=/^-?\d+n?$/,df=/^-?\d+$/,Ca=/^-?\d+(?:\.\d+)?$/,hf=/^(?:true|false)$/i,ff=/^null$/i,mf=/^undefined$/i,pf=/^[^A-Z]*$/,gf=/^[^a-z]*$/,vf=/^[0-9a-fA-F]*$/;function _i(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function yi(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}const Hb=/^[0-9a-fA-F]{32}$/,Vb=_i(22,"=="),Wb=yi(22),qb=/^[0-9a-fA-F]{40}$/,Jb=_i(27,"="),Kb=yi(27),Gb=/^[0-9a-fA-F]{64}$/,Yb=_i(43,"="),Xb=yi(43),Qb=/^[0-9a-fA-F]{96}$/,e_=_i(64,""),t_=yi(64),n_=/^[0-9a-fA-F]{128}$/,i_=_i(86,"=="),r_=yi(86),$o=Object.freeze(Object.defineProperty({__proto__:null,base64:Qh,base64url:Ea,bigint:uf,boolean:hf,browserEmail:Zb,cidrv4:Yh,cidrv6:Xh,cuid:Rh,cuid2:Nh,date:of,datetime:cf,domain:tf,duration:Bh,e164:nf,email:Vh,emoji:qh,extendedDuration:Ab,guid:Hh,hex:vf,hostname:ef,html5Email:Ub,idnEmail:Fb,integer:df,ipv4:Jh,ipv6:Kh,ksuid:Fh,lowercase:pf,mac:Gh,md5_base64:Vb,md5_base64url:Wb,md5_hex:Hb,nanoid:Zh,null:ff,number:Ca,rfc5322Email:Lb,sha1_base64:Jb,sha1_base64url:Kb,sha1_hex:qb,sha256_base64:Yb,sha256_base64url:Xb,sha256_hex:Gb,sha384_base64:e_,sha384_base64url:t_,sha384_hex:Qb,sha512_base64:i_,sha512_base64url:r_,sha512_hex:n_,string:lf,time:af,ulid:Uh,undefined:mf,unicodeEmail:Wh,uppercase:gf,uuid:cn,uuid4:jb,uuid6:Rb,uuid7:Nb,xid:Lh},Symbol.toStringTag,{value:"Module"})),he=b("$ZodCheck",(t,e)=>{var i;t._zod??(t._zod={}),t._zod.def=e,(i=t._zod).onattach??(i.onattach=[])}),bf={number:"number",bigint:"bigint",object:"date"},Aa=b("$ZodCheckLessThan",(t,e)=>{he.init(t,e);const i=bf[typeof e.value];t._zod.onattach.push(r=>{const n=r._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value<=e.value:r.value<e.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),ja=b("$ZodCheckGreaterThan",(t,e)=>{he.init(t,e);const i=bf[typeof e.value];t._zod.onattach.push(r=>{const n=r._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=r=>{(e.inclusive?r.value>=e.value:r.value>e.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:r.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),_f=b("$ZodCheckMultipleOf",(t,e)=>{he.init(t,e),t._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=e.value)}),t._zod.check=i=>{if(typeof i.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%e.value===BigInt(0):bh(i.value,e.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:e.value,input:i.value,inst:t,continue:!e.abort})}}),yf=b("$ZodCheckNumberFormat",(t,e)=>{var s;he.init(t,e),e.format=e.format||"float64";const i=(s=e.format)==null?void 0:s.includes("int"),r=i?"int":"number",[n,o]=kh[e.format];t._zod.onattach.push(a=>{const c=a._zod.bag;c.format=e.format,c.minimum=n,c.maximum=o,i&&(c.pattern=df)}),t._zod.check=a=>{const c=a.value;if(i){if(!Number.isInteger(c)){a.issues.push({expected:r,format:e.format,code:"invalid_type",continue:!1,input:c,inst:t});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:r,inclusive:!0,continue:!e.abort});return}}c<n&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),c>o&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:t,continue:!e.abort})}}),xf=b("$ZodCheckBigIntFormat",(t,e)=>{he.init(t,e);const[i,r]=Sh[e.format];t._zod.onattach.push(n=>{const o=n._zod.bag;o.format=e.format,o.minimum=i,o.maximum=r}),t._zod.check=n=>{const o=n.value;o<i&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:i,inclusive:!0,inst:t,continue:!e.abort}),o>r&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:t,continue:!e.abort})}}),$f=b("$ZodCheckMaxSize",(t,e)=>{var i;he.init(t,e),(i=t._zod.def).when??(i.when=r=>{const n=r.value;return!Kt(n)&&n.size!==void 0}),t._zod.onattach.push(r=>{const n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const n=r.value;n.size<=e.maximum||r.issues.push({origin:bo(n),code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),kf=b("$ZodCheckMinSize",(t,e)=>{var i;he.init(t,e),(i=t._zod.def).when??(i.when=r=>{const n=r.value;return!Kt(n)&&n.size!==void 0}),t._zod.onattach.push(r=>{const n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const n=r.value;n.size>=e.minimum||r.issues.push({origin:bo(n),code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Sf=b("$ZodCheckSizeEquals",(t,e)=>{var i;he.init(t,e),(i=t._zod.def).when??(i.when=r=>{const n=r.value;return!Kt(n)&&n.size!==void 0}),t._zod.onattach.push(r=>{const n=r._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=r=>{const n=r.value,o=n.size;if(o===e.size)return;const s=o>e.size;r.issues.push({origin:bo(n),...s?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),wf=b("$ZodCheckMaxLength",(t,e)=>{var i;he.init(t,e),(i=t._zod.def).when??(i.when=r=>{const n=r.value;return!Kt(n)&&n.length!==void 0}),t._zod.onattach.push(r=>{const n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(r._zod.bag.maximum=e.maximum)}),t._zod.check=r=>{const n=r.value;if(n.length<=e.maximum)return;const s=_o(n);r.issues.push({origin:s,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),If=b("$ZodCheckMinLength",(t,e)=>{var i;he.init(t,e),(i=t._zod.def).when??(i.when=r=>{const n=r.value;return!Kt(n)&&n.length!==void 0}),t._zod.onattach.push(r=>{const n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(r._zod.bag.minimum=e.minimum)}),t._zod.check=r=>{const n=r.value;if(n.length>=e.minimum)return;const s=_o(n);r.issues.push({origin:s,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),zf=b("$ZodCheckLengthEquals",(t,e)=>{var i;he.init(t,e),(i=t._zod.def).when??(i.when=r=>{const n=r.value;return!Kt(n)&&n.length!==void 0}),t._zod.onattach.push(r=>{const n=r._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=r=>{const n=r.value,o=n.length;if(o===e.length)return;const s=_o(n),a=o>e.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:r.value,inst:t,continue:!e.abort})}}),xi=b("$ZodCheckStringFormat",(t,e)=>{var i,r;he.init(t,e),t._zod.onattach.push(n=>{const o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(i=t._zod).check??(i.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(r=t._zod).check??(r.check=()=>{})}),Pf=b("$ZodCheckRegex",(t,e)=>{xi.init(t,e),t._zod.check=i=>{e.pattern.lastIndex=0,!e.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Tf=b("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=pf),xi.init(t,e)}),Of=b("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=gf),xi.init(t,e)}),Df=b("$ZodCheckIncludes",(t,e)=>{he.init(t,e);const i=ht(e.includes),r=new RegExp(typeof e.position=="number"?`^.{${e.position}}${i}`:i);e.pattern=r,t._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),Mf=b("$ZodCheckStartsWith",(t,e)=>{he.init(t,e);const i=new RegExp(`^${ht(e.prefix)}.*`);e.pattern??(e.pattern=i),t._zod.onattach.push(r=>{const n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),t._zod.check=r=>{r.value.startsWith(e.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:r.value,inst:t,continue:!e.abort})}}),Ef=b("$ZodCheckEndsWith",(t,e)=>{he.init(t,e);const i=new RegExp(`.*${ht(e.suffix)}$`);e.pattern??(e.pattern=i),t._zod.onattach.push(r=>{const n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),t._zod.check=r=>{r.value.endsWith(e.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:r.value,inst:t,continue:!e.abort})}});function ku(t,e,i){t.issues.length&&e.issues.push(...Je(i,t.issues))}const Cf=b("$ZodCheckProperty",(t,e)=>{he.init(t,e),t._zod.check=i=>{const r=e.schema._zod.run({value:i.value[e.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>ku(n,i,e.property));ku(r,i,e.property)}}),Af=b("$ZodCheckMimeType",(t,e)=>{he.init(t,e);const i=new Set(e.mime);t._zod.onattach.push(r=>{r._zod.bag.mime=e.mime}),t._zod.check=r=>{i.has(r.value.type)||r.issues.push({code:"invalid_value",values:e.mime,input:r.value.type,inst:t,continue:!e.abort})}}),jf=b("$ZodCheckOverwrite",(t,e)=>{he.init(t,e),t._zod.check=i=>{i.value=e.tx(i.value)}});class Rf{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}const r=e.split(`
|
|
10
|
+
`).filter(s=>s),n=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const e=Function,i=this==null?void 0:this.args,n=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new e(...i,n.join(`
|
|
11
|
+
`))}}const Nf={major:4,minor:3,patch:5},N=b("$ZodType",(t,e)=>{var n;var i;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=Nf;const r=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&r.unshift(t);for(const o of r)for(const s of o._zod.onattach)s(t);if(r.length===0)(i=t._zod).deferred??(i.deferred=[]),(n=t._zod.deferred)==null||n.push(()=>{t._zod.run=t._zod.parse});else{const o=(a,c,l)=>{let u=Nt(a),d;for(const h of c){if(h._zod.def.when){if(!h._zod.def.when(a))continue}else if(u)continue;const f=a.issues.length,m=h._zod.check(a);if(m instanceof Promise&&(l==null?void 0:l.async)===!1)throw new Lt;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==f&&(u||(u=Nt(a,f)))});else{if(a.issues.length===f)continue;u||(u=Nt(a,f))}}return d?d.then(()=>a):a},s=(a,c,l)=>{if(Nt(a))return a.aborted=!0,a;const u=o(c,r,l);if(u instanceof Promise){if(l.async===!1)throw new Lt;return u.then(d=>t._zod.parse(d,l))}return t._zod.parse(u,l)};t._zod.run=(a,c)=>{if(c.skipChecks)return t._zod.parse(a,c);if(c.direction==="backward"){const u=t._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return u instanceof Promise?u.then(d=>s(d,a,c)):s(u,a,c)}const l=t._zod.parse(a,c);if(l instanceof Promise){if(c.async===!1)throw new Lt;return l.then(u=>o(u,r,c))}return o(l,r,c)}}Z(t,"~standard",()=>({validate:o=>{var s;try{const a=Sa(t,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return jh(t,o).then(c=>{var l;return c.success?{value:c.data}:{issues:(l=c.error)==null?void 0:l.issues}})}},vendor:"zod",version:1}))}),$i=b("$ZodString",(t,e)=>{var i;N.init(t,e),t._zod.pattern=[...((i=t==null?void 0:t._zod.bag)==null?void 0:i.patterns)??[]].pop()??lf(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),se=b("$ZodStringFormat",(t,e)=>{xi.init(t,e),$i.init(t,e)}),Uf=b("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=Hh),se.init(t,e)}),Lf=b("$ZodUUID",(t,e)=>{if(e.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(r===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=cn(r))}else e.pattern??(e.pattern=cn());se.init(t,e)}),Ff=b("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Vh),se.init(t,e)}),Zf=b("$ZodURL",(t,e)=>{se.init(t,e),t._zod.check=i=>{try{const r=i.value.trim(),n=new URL(r);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:i.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:i.value,inst:t,continue:!e.abort})),e.normalize?i.value=n.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:t,continue:!e.abort})}}}),Bf=b("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=qh()),se.init(t,e)}),Hf=b("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=Zh),se.init(t,e)}),Vf=b("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=Rh),se.init(t,e)}),Wf=b("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=Nh),se.init(t,e)}),qf=b("$ZodULID",(t,e)=>{e.pattern??(e.pattern=Uh),se.init(t,e)}),Jf=b("$ZodXID",(t,e)=>{e.pattern??(e.pattern=Lh),se.init(t,e)}),Kf=b("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Fh),se.init(t,e)}),Gf=b("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=cf(e)),se.init(t,e)}),Yf=b("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=of),se.init(t,e)}),Xf=b("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=af(e)),se.init(t,e)}),Qf=b("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=Bh),se.init(t,e)}),em=b("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Jh),se.init(t,e),t._zod.bag.format="ipv4"}),tm=b("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Kh),se.init(t,e),t._zod.bag.format="ipv6",t._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:t,continue:!e.abort})}}}),nm=b("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=Gh(e.delimiter)),se.init(t,e),t._zod.bag.format="mac"}),im=b("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Yh),se.init(t,e)}),rm=b("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Xh),se.init(t,e),t._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[n,o]=r;if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:t,continue:!e.abort})}}});function Ra(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}const om=b("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Qh),se.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=i=>{Ra(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:t,continue:!e.abort})}});function sm(t){if(!Ea.test(t))return!1;const e=t.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ra(i)}const am=b("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Ea),se.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=i=>{sm(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:t,continue:!e.abort})}}),cm=b("$ZodE164",(t,e)=>{e.pattern??(e.pattern=nf),se.init(t,e)});function lm(t,e=null){try{const i=t.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const n=JSON.parse(atob(r));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}const um=b("$ZodJWT",(t,e)=>{se.init(t,e),t._zod.check=i=>{lm(i.value,e.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:t,continue:!e.abort})}}),dm=b("$ZodCustomStringFormat",(t,e)=>{se.init(t,e),t._zod.check=i=>{e.fn(i.value)||i.issues.push({code:"invalid_format",format:e.format,input:i.value,inst:t,continue:!e.abort})}}),Na=b("$ZodNumber",(t,e)=>{N.init(t,e),t._zod.pattern=t._zod.bag.pattern??Ca,t._zod.parse=(i,r)=>{if(e.coerce)try{i.value=Number(i.value)}catch{}const n=i.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return i;const o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...o?{received:o}:{}}),i}}),hm=b("$ZodNumberFormat",(t,e)=>{yf.init(t,e),Na.init(t,e)}),Ua=b("$ZodBoolean",(t,e)=>{N.init(t,e),t._zod.pattern=hf,t._zod.parse=(i,r)=>{if(e.coerce)try{i.value=!!i.value}catch{}const n=i.value;return typeof n=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),i}}),La=b("$ZodBigInt",(t,e)=>{N.init(t,e),t._zod.pattern=uf,t._zod.parse=(i,r)=>{if(e.coerce)try{i.value=BigInt(i.value)}catch{}return typeof i.value=="bigint"||i.issues.push({expected:"bigint",code:"invalid_type",input:i.value,inst:t}),i}}),fm=b("$ZodBigIntFormat",(t,e)=>{xf.init(t,e),La.init(t,e)}),mm=b("$ZodSymbol",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value;return typeof n=="symbol"||i.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),i}}),pm=b("$ZodUndefined",(t,e)=>{N.init(t,e),t._zod.pattern=mf,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(i,r)=>{const n=i.value;return typeof n>"u"||i.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),i}}),gm=b("$ZodNull",(t,e)=>{N.init(t,e),t._zod.pattern=ff,t._zod.values=new Set([null]),t._zod.parse=(i,r)=>{const n=i.value;return n===null||i.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),i}}),vm=b("$ZodAny",(t,e)=>{N.init(t,e),t._zod.parse=i=>i}),bm=b("$ZodUnknown",(t,e)=>{N.init(t,e),t._zod.parse=i=>i}),_m=b("$ZodNever",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:t}),i)}),ym=b("$ZodVoid",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value;return typeof n>"u"||i.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),i}}),xm=b("$ZodDate",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{if(e.coerce)try{i.value=new Date(i.value)}catch{}const n=i.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:t}),i}});function Su(t,e,i){t.issues.length&&e.issues.push(...Je(i,t.issues)),e.value[i]=t.value}const $m=b("$ZodArray",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value;if(!Array.isArray(n))return i.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),i;i.value=Array(n.length);const o=[];for(let s=0;s<n.length;s++){const a=n[s],c=e.element._zod.run({value:a,issues:[]},r);c instanceof Promise?o.push(c.then(l=>Su(l,i,s))):Su(c,i,s)}return o.length?Promise.all(o).then(()=>i):i}});function Qr(t,e,i,r,n){if(t.issues.length){if(n&&!(i in r))return;e.issues.push(...Je(i,t.issues))}t.value===void 0?i in r&&(e.value[i]=void 0):e.value[i]=t.value}function km(t){var r,n,o,s;const e=Object.keys(t.shape);for(const a of e)if(!((s=(o=(n=(r=t.shape)==null?void 0:r[a])==null?void 0:n._zod)==null?void 0:o.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const i=$h(t.shape);return{...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}}function Sm(t,e,i,r,n,o){const s=[],a=n.keySet,c=n.catchall._zod,l=c.def.type,u=c.optout==="optional";for(const d in e){if(a.has(d))continue;if(l==="never"){s.push(d);continue}const h=c.run({value:e[d],issues:[]},r);h instanceof Promise?t.push(h.then(f=>Qr(f,i,d,e,u))):Qr(h,i,d,e,u)}return s.length&&i.issues.push({code:"unrecognized_keys",keys:s,input:e,inst:o}),t.length?Promise.all(t).then(()=>i):i}const wm=b("$ZodObject",(t,e)=>{N.init(t,e);const i=Object.getOwnPropertyDescriptor(e,"shape");if(!(i!=null&&i.get)){const a=e.shape;Object.defineProperty(e,"shape",{get:()=>{const c={...a};return Object.defineProperty(e,"shape",{value:c}),c}})}const r=mi(()=>km(e));Z(t._zod,"propValues",()=>{const a=e.shape,c={};for(const l in a){const u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(const d of u.values)c[l].add(d)}}return c});const n=sn,o=e.catchall;let s;t._zod.parse=(a,c)=>{s??(s=r.value);const l=a.value;if(!n(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};const u=[],d=s.shape;for(const h of s.keys){const f=d[h],m=f._zod.optout==="optional",p=f._zod.run({value:l[h],issues:[]},c);p instanceof Promise?u.push(p.then(g=>Qr(g,a,h,l,m))):Qr(p,a,h,l,m)}return o?Sm(u,l,a,c,r.value,t):u.length?Promise.all(u).then(()=>a):a}}),Im=b("$ZodObjectJIT",(t,e)=>{wm.init(t,e);const i=t._zod.parse,r=mi(()=>km(e)),n=h=>{var z;const f=new Rf(["shape","payload","ctx"]),m=r.value,p=I=>{const k=Js(I);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};f.write("const input = payload.value;");const g=Object.create(null);let v=0;for(const I of m.keys)g[I]=`key_${v++}`;f.write("const newResult = {};");for(const I of m.keys){const k=g[I],O=Js(I),P=h[I],D=((z=P==null?void 0:P._zod)==null?void 0:z.optout)==="optional";f.write(`const ${k} = ${p(I)};`),D?f.write(`
|
|
12
|
+
if (${k}.issues.length) {
|
|
13
|
+
if (${O} in input) {
|
|
14
|
+
payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
|
|
14
15
|
...iss,
|
|
15
|
-
path: iss.path ? [${
|
|
16
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
16
17
|
})));
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
if (${
|
|
21
|
-
if (${
|
|
22
|
-
newResult[${
|
|
21
|
+
if (${k}.value === undefined) {
|
|
22
|
+
if (${O} in input) {
|
|
23
|
+
newResult[${O}] = undefined;
|
|
23
24
|
}
|
|
24
25
|
} else {
|
|
25
|
-
newResult[${
|
|
26
|
+
newResult[${O}] = ${k}.value;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
`):f.write(`
|
|
29
|
-
if (${
|
|
30
|
-
payload.issues = payload.issues.concat(${
|
|
30
|
+
if (${k}.issues.length) {
|
|
31
|
+
payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
|
|
31
32
|
...iss,
|
|
32
|
-
path: iss.path ? [${
|
|
33
|
+
path: iss.path ? [${O}, ...iss.path] : [${O}]
|
|
33
34
|
})));
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
if (${
|
|
37
|
-
if (${
|
|
38
|
-
newResult[${
|
|
37
|
+
if (${k}.value === undefined) {
|
|
38
|
+
if (${O} in input) {
|
|
39
|
+
newResult[${O}] = undefined;
|
|
39
40
|
}
|
|
40
41
|
} else {
|
|
41
|
-
newResult[${
|
|
42
|
+
newResult[${O}] = ${k}.value;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
`)}f.write("payload.value = newResult;"),f.write("return payload;");const x=f.compile();return(S,w)=>x(d,S,w)};let o;const r=ln,a=!ra.jitless,l=a&&dl.value,u=t.catchall;let h;e._zod.parse=(d,f)=>{h??(h=s.value);const p=d.value;return r(p)?a&&l&&(f==null?void 0:f.async)===!1&&f.jitless!==!0?(o||(o=i(t.shape)),d=o(d,f),u?Sa([],p,d,f,h,e):d):n(d,f):(d.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),d)}});function mo(e,t,n,s){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const i=e.filter(o=>!ze(o));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(r=>se(r,s,ne())))}),t)}const Ma=k("$ZodUnion",(e,t)=>{Q.init(e,t),V(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>vi(o.source)).join("|")})$`)}});const n=t.options.length===1,s=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(n)return s(i,o);let r=!1;const a=[];for(const c of t.options){const l=c._zod.run({value:i.value,issues:[]},o);if(l instanceof Promise)a.push(l),r=!0;else{if(l.issues.length===0)return l;a.push(l)}}return r?Promise.all(a).then(c=>mo(c,i,e,o)):mo(a,i,e,o)}}),eh=k("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ma.init(e,t);const n=e._zod.parse;V(e._zod,"propValues",()=>{const i={};for(const o of t.options){const r=o._zod.propValues;if(!r||Object.keys(r).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[a,c]of Object.entries(r)){i[a]||(i[a]=new Set);for(const l of c)i[a].add(l)}}return i});const s=vs(()=>{var r;const i=t.options,o=new Map;for(const a of i){const c=(r=a._zod.propValues)==null?void 0:r[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const l of c){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});e._zod.parse=(i,o)=>{const r=i.value;if(!ln(r))return i.issues.push({code:"invalid_type",expected:"object",input:r,inst:e}),i;const a=s.value.get(r==null?void 0:r[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?n(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:r,path:[t.discriminator],inst:e}),i)}}),nh=k("$ZodIntersection",(e,t)=>{Q.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,o=t.left._zod.run({value:i,issues:[]},s),r=t.right._zod.run({value:i,issues:[]},s);return o instanceof Promise||r instanceof Promise?Promise.all([o,r]).then(([c,l])=>bo(n,c,l)):bo(n,o,r)}});function ti(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ae(e)&&Ae(t)){const n=Object.keys(t),s=Object.keys(e).filter(o=>n.indexOf(o)!==-1),i={...e,...t};for(const o of s){const r=ti(e[o],t[o]);if(!r.valid)return{valid:!1,mergeErrorPath:[o,...r.mergeErrorPath]};i[o]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let s=0;s<e.length;s++){const i=e[s],o=t[s],r=ti(i,o);if(!r.valid)return{valid:!1,mergeErrorPath:[s,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function bo(e,t,n){const s=new Map;let i;for(const a of t.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(const c of a.keys)s.has(c)||s.set(c,{}),s.get(c).l=!0}else e.issues.push(a);for(const a of n.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)s.has(c)||s.set(c,{}),s.get(c).r=!0;else e.issues.push(a);const o=[...s].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&i&&e.issues.push({...i,keys:o}),ze(e))return e;const r=ti(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const sh=k("$ZodRecord",(e,t)=>{Q.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Ae(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const o=[],r=t.keyType._zod.values;if(r){n.value={};const a=new Set;for(const l of r)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const u=t.valueType._zod.run({value:i[l],issues:[]},s);u instanceof Promise?o.push(u.then(h=>{h.issues.length&&n.issues.push(...Re(l,h.issues)),n.value[l]=h.value})):(u.issues.length&&n.issues.push(...Re(l,u.issues)),n.value[l]=u.value)}let c;for(const l in i)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{n.value={};for(const a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},s);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&ba.test(a)&&c.issues.length&&c.issues.some(h=>h.code==="invalid_type"&&h.expected==="number")){const h=t.keyType._zod.run({value:Number(a),issues:[]},s);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(c=h)}if(c.issues.length){t.mode==="loose"?n.value[a]=i[a]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(h=>se(h,s,ne())),input:a,path:[a],inst:e});continue}const u=t.valueType._zod.run({value:i[a],issues:[]},s);u instanceof Promise?o.push(u.then(h=>{h.issues.length&&n.issues.push(...Re(a,h.issues)),n.value[c.value]=h.value})):(u.issues.length&&n.issues.push(...Re(a,u.issues)),n.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>n):n}}),ih=k("$ZodEnum",(e,t)=>{Q.init(e,t);const n=aa(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>fl.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,o)=>{const r=i.value;return s.has(r)||i.issues.push({code:"invalid_value",values:n,input:r,inst:e}),i}}),oh=k("$ZodLiteral",(e,t)=>{if(Q.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(s=>typeof s=="string"?De(s):s?De(s.toString()):String(s)).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return n.has(o)||s.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),s}}),rh=k("$ZodTransform",(e,t)=>{Q.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new oa(e.constructor.name);const i=t.transform(n.value,n);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(r=>(n.value=r,n));if(i instanceof Promise)throw new Ie;return n.value=i,n}});function _o(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Pa=k("$ZodOptional",(e,t)=>{Q.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${vi(n.source)})?$`):void 0}),e._zod.parse=(n,s)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(o=>_o(o,n.value)):_o(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),ah=k("$ZodExactOptional",(e,t)=>{Pa.init(e,t),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),ch=k("$ZodNullable",(e,t)=>{Q.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${vi(n.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,s)=>n.value===null?n:t.innerType._zod.run(n,s)}),lh=k("$ZodDefault",(e,t)=>{Q.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(o=>yo(o,t)):yo(i,t)}});function yo(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const uh=k("$ZodPrefault",(e,t)=>{Q.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>(s.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,s))}),hh=k("$ZodNonOptional",(e,t)=>{Q.init(e,t),V(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,s)=>{const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(o=>xo(o,e)):xo(i,e)}});function xo(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const dh=k("$ZodCatch",(e,t)=>{Q.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(o=>(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(r=>se(r,s,ne()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>se(o,s,ne()))},input:n.value}),n.issues=[]),n)}}),fh=k("$ZodPipe",(e,t)=>{Q.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,s)=>{if(s.direction==="backward"){const o=t.out._zod.run(n,s);return o instanceof Promise?o.then(r=>En(r,t.in,s)):En(o,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(o=>En(o,t.out,s)):En(i,t.out,s)}});function En(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const ph=k("$ZodReadonly",(e,t)=>{Q.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>{var n,s;return(s=(n=t.innerType)==null?void 0:n._zod)==null?void 0:s.optin}),V(e._zod,"optout",()=>{var n,s;return(s=(n=t.innerType)==null?void 0:n._zod)==null?void 0:s.optout}),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(vo):vo(i)}});function vo(e){return e.value=Object.freeze(e.value),e}const gh=k("$ZodCustom",(e,t)=>{Pt.init(e,t),Q.init(e,t),e._zod.parse=(n,s)=>n,e._zod.check=n=>{const s=n.value,i=t.fn(s);if(i instanceof Promise)return i.then(o=>wo(o,n,s,e));wo(i,n,s,e)}});function wo(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(un(i))}}var ko;class mh{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const s=n[0];return this._map.set(t,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const s={...this.get(n)??{}};delete s.id;const i={...s,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function bh(){return new mh}(ko=globalThis).__zod_globalRegistry??(ko.__zod_globalRegistry=bh());const Ke=globalThis.__zod_globalRegistry;function _h(e,t){return new e({type:"string",...R(t)})}function yh(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...R(t)})}function So(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...R(t)})}function xh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...R(t)})}function vh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...R(t)})}function wh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...R(t)})}function kh(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...R(t)})}function Sh(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...R(t)})}function Mh(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...R(t)})}function Ph(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...R(t)})}function Th(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...R(t)})}function Ch(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...R(t)})}function Oh(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...R(t)})}function zh(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...R(t)})}function Rh(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...R(t)})}function Ih(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...R(t)})}function Eh(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...R(t)})}function Ah(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...R(t)})}function Dh(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...R(t)})}function Lh(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...R(t)})}function Nh(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...R(t)})}function $h(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...R(t)})}function Fh(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...R(t)})}function Hh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...R(t)})}function jh(e,t){return new e({type:"string",format:"date",check:"string_format",...R(t)})}function Bh(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...R(t)})}function Zh(e,t){return new e({type:"string",format:"duration",check:"string_format",...R(t)})}function Vh(e,t){return new e({type:"number",checks:[],...R(t)})}function Wh(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...R(t)})}function qh(e,t){return new e({type:"boolean",...R(t)})}function Uh(e,t){return new e({type:"undefined",...R(t)})}function Yh(e,t){return new e({type:"null",...R(t)})}function Jh(e){return new e({type:"unknown"})}function Kh(e,t){return new e({type:"never",...R(t)})}function Mo(e,t){return new ya({check:"less_than",...R(t),value:e,inclusive:!1})}function Ls(e,t){return new ya({check:"less_than",...R(t),value:e,inclusive:!0})}function Po(e,t){return new xa({check:"greater_than",...R(t),value:e,inclusive:!1})}function Ns(e,t){return new xa({check:"greater_than",...R(t),value:e,inclusive:!0})}function To(e,t){return new au({check:"multiple_of",...R(t),value:e})}function Ta(e,t){return new lu({check:"max_length",...R(t),maximum:e})}function cs(e,t){return new uu({check:"min_length",...R(t),minimum:e})}function Ca(e,t){return new hu({check:"length_equals",...R(t),length:e})}function Xh(e,t){return new du({check:"string_format",format:"regex",...R(t),pattern:e})}function Gh(e){return new fu({check:"string_format",format:"lowercase",...R(e)})}function Qh(e){return new pu({check:"string_format",format:"uppercase",...R(e)})}function td(e,t){return new gu({check:"string_format",format:"includes",...R(t),includes:e})}function ed(e,t){return new mu({check:"string_format",format:"starts_with",...R(t),prefix:e})}function nd(e,t){return new bu({check:"string_format",format:"ends_with",...R(t),suffix:e})}function je(e){return new _u({check:"overwrite",tx:e})}function sd(e){return je(t=>t.normalize(e))}function id(){return je(e=>e.trim())}function od(){return je(e=>e.toLowerCase())}function rd(){return je(e=>e.toUpperCase())}function ad(){return je(e=>hl(e))}function cd(e,t,n){return new e({type:"array",element:t,...R(n)})}function ld(e,t,n){const s=R(n);return s.abort??(s.abort=!0),new e({type:"custom",check:"custom",fn:t,...s})}function ud(e,t,n){return new e({type:"custom",check:"custom",fn:t,...R(n)})}function hd(e){const t=dd(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(un(s,n.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(un(i))}},e(n.value,n)));return t}function dd(e,t){const n=new Pt({check:"custom",...R(t)});return n._zod.check=e,n}function Oa(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ke,target:t,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 ut(e,t,n={path:[],schemaPath:[]}){var u,h;var s;const i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;const r={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,r);const a=(h=(u=e._zod).toJSONSchema)==null?void 0:h.call(u);if(a)r.schema=a;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,r.schema,d);else{const p=r.schema,g=t.processors[i.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);g(e,t,p,d)}const f=e._zod.parent;f&&(r.ref||(r.ref=f),ut(f,t,d),t.seen.get(f).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(r.schema,c),t.io==="input"&&wt(e)&&(delete r.schema.examples,delete r.schema.default),t.io==="input"&&r.schema._prefault&&((s=r.schema).default??(s.default=r.schema._prefault)),delete r.schema._prefault,t.seen.get(e).schema}function za(e,t){var r,a,c,l;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const u of e.seen.entries()){const h=(r=e.metadataRegistry.get(u[0]))==null?void 0:r.id;if(h){const d=s.get(h);if(d&&d!==u[0])throw new Error(`Duplicate schema id "${h}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(h,u[0])}}const i=u=>{var g;const h=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const m=(g=e.external.registry.get(u[0]))==null?void 0:g.id,b=e.external.uri??(M=>M);if(m)return{ref:b(m)};const x=u[1].defId??u[1].schema.id??`schema${e.counter++}`;return u[1].defId=x,{defId:x,ref:`${b("__shared")}#/${h}/${x}`}}if(u[1]===n)return{ref:"#"};const f=`#/${h}/`,p=u[1].schema.id??`__schema${e.counter++}`;return{defId:p,ref:f+p}},o=u=>{if(u[1].schema.$ref)return;const h=u[1],{ref:d,defId:f}=i(u);h.def={...h.schema},f&&(h.defId=f);const p=h.schema;for(const g in p)delete p[g];p.$ref=d};if(e.cycles==="throw")for(const u of e.seen.entries()){const h=u[1];if(h.cycle)throw new Error(`Cycle detected: #/${(a=h.cycle)==null?void 0:a.join("/")}/<root>
|
|
45
|
+
`)}f.write("payload.value = newResult;"),f.write("return payload;");const x=f.compile();return(I,k)=>x(h,I,k)};let o;const s=sn,a=!Gr.jitless,l=a&&yh.value,u=e.catchall;let d;t._zod.parse=(h,f)=>{d??(d=r.value);const m=h.value;return s(m)?a&&l&&(f==null?void 0:f.async)===!1&&f.jitless!==!0?(o||(o=n(e.shape)),h=o(h,f),u?Sm([],m,h,f,d,t):h):i(h,f):(h.issues.push({expected:"object",code:"invalid_type",input:m,inst:t}),h)}});function wu(t,e,i,r){for(const o of t)if(o.issues.length===0)return e.value=o.value,e;const n=t.filter(o=>!Nt(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:i,errors:t.map(o=>o.issues.map(s=>He(s,r,_e())))}),e)}const ko=b("$ZodUnion",(t,e)=>{N.init(t,e),Z(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Z(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Z(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Z(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){const n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>go(o.source)).join("|")})$`)}});const i=e.options.length===1,r=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(i)return r(n,o);let s=!1;const a=[];for(const c of e.options){const l=c._zod.run({value:n.value,issues:[]},o);if(l instanceof Promise)a.push(l),s=!0;else{if(l.issues.length===0)return l;a.push(l)}}return s?Promise.all(a).then(c=>wu(c,n,t,o)):wu(a,n,t,o)}});function Iu(t,e,i,r){const n=t.filter(o=>o.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:i,errors:t.map(o=>o.issues.map(s=>He(s,r,_e())))}):e.issues.push({code:"invalid_union",input:e.value,inst:i,errors:[],inclusive:!1}),e)}const zm=b("$ZodXor",(t,e)=>{ko.init(t,e),e.inclusive=!1;const i=e.options.length===1,r=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(i)return r(n,o);let s=!1;const a=[];for(const c of e.options){const l=c._zod.run({value:n.value,issues:[]},o);l instanceof Promise?(a.push(l),s=!0):a.push(l)}return s?Promise.all(a).then(c=>Iu(c,n,t,o)):Iu(a,n,t,o)}}),Pm=b("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=!1,ko.init(t,e);const i=t._zod.parse;Z(t._zod,"propValues",()=>{const n={};for(const o of e.options){const s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(const[a,c]of Object.entries(s)){n[a]||(n[a]=new Set);for(const l of c)n[a].add(l)}}return n});const r=mi(()=>{var s;const n=e.options,o=new Map;for(const a of n){const c=(s=a._zod.propValues)==null?void 0:s[e.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(const l of c){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});t._zod.parse=(n,o)=>{const s=n.value;if(!sn(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:t}),n;const a=r.value.get(s==null?void 0:s[e.discriminator]);return a?a._zod.run(n,o):e.unionFallback?i(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:s,path:[e.discriminator],inst:t}),n)}}),Tm=b("$ZodIntersection",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value,o=e.left._zod.run({value:n,issues:[]},r),s=e.right._zod.run({value:n,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([c,l])=>zu(i,c,l)):zu(i,o,s)}});function Ys(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(Bt(t)&&Bt(e)){const i=Object.keys(e),r=Object.keys(t).filter(o=>i.indexOf(o)!==-1),n={...t,...e};for(const o of r){const s=Ys(t[o],e[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<t.length;r++){const n=t[r],o=e[r],s=Ys(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};i.push(s.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function zu(t,e,i){const r=new Map;let n;for(const a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else t.issues.push(a);for(const a of i.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else t.issues.push(a);const o=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&t.issues.push({...n,keys:o}),Nt(t))return t;const s=Ys(e.value,i.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return t.value=s.data,t}const Fa=b("$ZodTuple",(t,e)=>{N.init(t,e);const i=e.items;t._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:t,expected:"tuple",code:"invalid_type"}),r;r.value=[];const s=[],a=[...i].reverse().findIndex(u=>u._zod.optin!=="optional"),c=a===-1?0:i.length-a;if(!e.rest){const u=o.length>i.length,d=o.length<c-1;if(u||d)return r.issues.push({...u?{code:"too_big",maximum:i.length,inclusive:!0}:{code:"too_small",minimum:i.length},input:o,inst:t,origin:"array"}),r}let l=-1;for(const u of i){if(l++,l>=o.length&&l>=c)continue;const d=u._zod.run({value:o[l],issues:[]},n);d instanceof Promise?s.push(d.then(h=>yr(h,r,l))):yr(d,r,l)}if(e.rest){const u=o.slice(i.length);for(const d of u){l++;const h=e.rest._zod.run({value:d,issues:[]},n);h instanceof Promise?s.push(h.then(f=>yr(f,r,l))):yr(h,r,l)}}return s.length?Promise.all(s).then(()=>r):r}});function yr(t,e,i){t.issues.length&&e.issues.push(...Je(i,t.issues)),e.value[i]=t.value}const Om=b("$ZodRecord",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value;if(!Bt(n))return i.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),i;const o=[],s=e.keyType._zod.values;if(s){i.value={};const a=new Set;for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);const u=e.valueType._zod.run({value:n[l],issues:[]},r);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&i.issues.push(...Je(l,d.issues)),i.value[l]=d.value})):(u.issues.length&&i.issues.push(...Je(l,u.issues)),i.value[l]=u.value)}let c;for(const l in n)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&i.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c})}else{i.value={};for(const a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let c=e.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Ca.test(a)&&c.issues.length&&c.issues.some(d=>d.code==="invalid_type"&&d.expected==="number")){const d=e.keyType._zod.run({value:Number(a),issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d)}if(c.issues.length){e.mode==="loose"?i.value[a]=n[a]:i.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>He(d,r,_e())),input:a,path:[a],inst:t});continue}const u=e.valueType._zod.run({value:n[a],issues:[]},r);u instanceof Promise?o.push(u.then(d=>{d.issues.length&&i.issues.push(...Je(a,d.issues)),i.value[c.value]=d.value})):(u.issues.length&&i.issues.push(...Je(a,u.issues)),i.value[c.value]=u.value)}}return o.length?Promise.all(o).then(()=>i):i}}),Dm=b("$ZodMap",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value;if(!(n instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),i;const o=[];i.value=new Map;for(const[s,a]of n){const c=e.keyType._zod.run({value:s,issues:[]},r),l=e.valueType._zod.run({value:a,issues:[]},r);c instanceof Promise||l instanceof Promise?o.push(Promise.all([c,l]).then(([u,d])=>{Pu(u,d,i,s,n,t,r)})):Pu(c,l,i,s,n,t,r)}return o.length?Promise.all(o).then(()=>i):i}});function Pu(t,e,i,r,n,o,s){t.issues.length&&(Xr.has(typeof r)?i.issues.push(...Je(r,t.issues)):i.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(a=>He(a,s,_e()))})),e.issues.length&&(Xr.has(typeof r)?i.issues.push(...Je(r,e.issues)):i.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:r,issues:e.issues.map(a=>He(a,s,_e()))})),i.value.set(t.value,e.value)}const Mm=b("$ZodSet",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value;if(!(n instanceof Set))return i.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),i;const o=[];i.value=new Set;for(const s of n){const a=e.valueType._zod.run({value:s,issues:[]},r);a instanceof Promise?o.push(a.then(c=>Tu(c,i))):Tu(a,i)}return o.length?Promise.all(o).then(()=>i):i}});function Tu(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}const Em=b("$ZodEnum",(t,e)=>{N.init(t,e);const i=ba(e.entries),r=new Set(i);t._zod.values=r,t._zod.pattern=new RegExp(`^(${i.filter(n=>Xr.has(typeof n)).map(n=>typeof n=="string"?ht(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{const s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:i,input:s,inst:t}),n}}),Cm=b("$ZodLiteral",(t,e)=>{if(N.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(e.values);t._zod.values=i,t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?ht(r):r?ht(r.toString()):String(r)).join("|")})$`),t._zod.parse=(r,n)=>{const o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),Am=b("$ZodFile",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{const n=i.value;return n instanceof File||i.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),i}}),jm=b("$ZodTransform",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{if(r.direction==="backward")throw new po(t.constructor.name);const n=e.transform(i.value,i);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(i.value=s,i));if(n instanceof Promise)throw new Lt;return i.value=n,i}});function Ou(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}const Za=b("$ZodOptional",(t,e)=>{N.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Z(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Z(t._zod,"pattern",()=>{const i=e.innerType._zod.pattern;return i?new RegExp(`^(${go(i.source)})?$`):void 0}),t._zod.parse=(i,r)=>{if(e.innerType._zod.optin==="optional"){const n=e.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Ou(o,i.value)):Ou(n,i.value)}return i.value===void 0?i:e.innerType._zod.run(i,r)}}),Rm=b("$ZodExactOptional",(t,e)=>{Za.init(t,e),Z(t._zod,"values",()=>e.innerType._zod.values),Z(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(i,r)=>e.innerType._zod.run(i,r)}),Nm=b("$ZodNullable",(t,e)=>{N.init(t,e),Z(t._zod,"optin",()=>e.innerType._zod.optin),Z(t._zod,"optout",()=>e.innerType._zod.optout),Z(t._zod,"pattern",()=>{const i=e.innerType._zod.pattern;return i?new RegExp(`^(${go(i.source)}|null)$`):void 0}),Z(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(i,r)=>i.value===null?i:e.innerType._zod.run(i,r)}),Um=b("$ZodDefault",(t,e)=>{N.init(t,e),t._zod.optin="optional",Z(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(i,r)=>{if(r.direction==="backward")return e.innerType._zod.run(i,r);if(i.value===void 0)return i.value=e.defaultValue,i;const n=e.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Du(o,e)):Du(n,e)}});function Du(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}const Lm=b("$ZodPrefault",(t,e)=>{N.init(t,e),t._zod.optin="optional",Z(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=e.defaultValue),e.innerType._zod.run(i,r))}),Fm=b("$ZodNonOptional",(t,e)=>{N.init(t,e),Z(t._zod,"values",()=>{const i=e.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),t._zod.parse=(i,r)=>{const n=e.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Mu(o,t)):Mu(n,t)}});function Mu(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}const Zm=b("$ZodSuccess",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>{if(r.direction==="backward")throw new po("ZodSuccess");const n=e.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.issues.length===0,i)):(i.value=n.issues.length===0,i)}}),Bm=b("$ZodCatch",(t,e)=>{N.init(t,e),Z(t._zod,"optin",()=>e.innerType._zod.optin),Z(t._zod,"optout",()=>e.innerType._zod.optout),Z(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(i,r)=>{if(r.direction==="backward")return e.innerType._zod.run(i,r);const n=e.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.value,o.issues.length&&(i.value=e.catchValue({...i,error:{issues:o.issues.map(s=>He(s,r,_e()))},input:i.value}),i.issues=[]),i)):(i.value=n.value,n.issues.length&&(i.value=e.catchValue({...i,error:{issues:n.issues.map(o=>He(o,r,_e()))},input:i.value}),i.issues=[]),i)}}),Hm=b("$ZodNaN",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>((typeof i.value!="number"||!Number.isNaN(i.value))&&i.issues.push({input:i.value,inst:t,expected:"nan",code:"invalid_type"}),i)}),Vm=b("$ZodPipe",(t,e)=>{N.init(t,e),Z(t._zod,"values",()=>e.in._zod.values),Z(t._zod,"optin",()=>e.in._zod.optin),Z(t._zod,"optout",()=>e.out._zod.optout),Z(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(i,r)=>{if(r.direction==="backward"){const o=e.out._zod.run(i,r);return o instanceof Promise?o.then(s=>xr(s,e.in,r)):xr(o,e.in,r)}const n=e.in._zod.run(i,r);return n instanceof Promise?n.then(o=>xr(o,e.out,r)):xr(n,e.out,r)}});function xr(t,e,i){return t.issues.length?(t.aborted=!0,t):e._zod.run({value:t.value,issues:t.issues},i)}const Ba=b("$ZodCodec",(t,e)=>{N.init(t,e),Z(t._zod,"values",()=>e.in._zod.values),Z(t._zod,"optin",()=>e.in._zod.optin),Z(t._zod,"optout",()=>e.out._zod.optout),Z(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(i,r)=>{if((r.direction||"forward")==="forward"){const o=e.in._zod.run(i,r);return o instanceof Promise?o.then(s=>$r(s,e,r)):$r(o,e,r)}else{const o=e.out._zod.run(i,r);return o instanceof Promise?o.then(s=>$r(s,e,r)):$r(o,e,r)}}});function $r(t,e,i){if(t.issues.length)return t.aborted=!0,t;if((i.direction||"forward")==="forward"){const n=e.transform(t.value,t);return n instanceof Promise?n.then(o=>kr(t,o,e.out,i)):kr(t,n,e.out,i)}else{const n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(o=>kr(t,o,e.in,i)):kr(t,n,e.in,i)}}function kr(t,e,i,r){return t.issues.length?(t.aborted=!0,t):i._zod.run({value:e,issues:t.issues},r)}const Wm=b("$ZodReadonly",(t,e)=>{N.init(t,e),Z(t._zod,"propValues",()=>e.innerType._zod.propValues),Z(t._zod,"values",()=>e.innerType._zod.values),Z(t._zod,"optin",()=>{var i,r;return(r=(i=e.innerType)==null?void 0:i._zod)==null?void 0:r.optin}),Z(t._zod,"optout",()=>{var i,r;return(r=(i=e.innerType)==null?void 0:i._zod)==null?void 0:r.optout}),t._zod.parse=(i,r)=>{if(r.direction==="backward")return e.innerType._zod.run(i,r);const n=e.innerType._zod.run(i,r);return n instanceof Promise?n.then(Eu):Eu(n)}});function Eu(t){return t.value=Object.freeze(t.value),t}const qm=b("$ZodTemplateLiteral",(t,e)=>{N.init(t,e);const i=[];for(const r of e.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);const n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${r._zod.traits}`);const o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;i.push(n.slice(o,s))}else if(r===null||xh.has(typeof r))i.push(ht(`${r}`));else throw new Error(`Invalid template literal part: ${r}`);t._zod.pattern=new RegExp(`^${i.join("")}$`),t._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:t,expected:"string",code:"invalid_type"}),r):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),r)}),Jm=b("$ZodFunction",(t,e)=>(N.init(t,e),t._def=e,t._zod.def=e,t.implement=i=>{if(typeof i!="function")throw new Error("implement() must be called with a function");return function(...r){const n=t._def.input?Ks(t._def.input,r):r,o=Reflect.apply(i,this,n);return t._def.output?Ks(t._def.output,o):o}},t.implementAsync=i=>{if(typeof i!="function")throw new Error("implementAsync() must be called with a function");return async function(...r){const n=t._def.input?await Gs(t._def.input,r):r,o=await Reflect.apply(i,this,n);return t._def.output?await Gs(t._def.output,o):o}},t._zod.parse=(i,r)=>typeof i.value!="function"?(i.issues.push({code:"invalid_type",expected:"function",input:i.value,inst:t}),i):(t._def.output&&t._def.output._zod.def.type==="promise"?i.value=t.implementAsync(i.value):i.value=t.implement(i.value),i),t.input=(...i)=>{const r=t.constructor;return Array.isArray(i[0])?new r({type:"function",input:new Fa({type:"tuple",items:i[0],rest:i[1]}),output:t._def.output}):new r({type:"function",input:i[0],output:t._def.output})},t.output=i=>{const r=t.constructor;return new r({type:"function",input:t._def.input,output:i})},t)),Km=b("$ZodPromise",(t,e)=>{N.init(t,e),t._zod.parse=(i,r)=>Promise.resolve(i.value).then(n=>e.innerType._zod.run({value:n,issues:[]},r))}),Gm=b("$ZodLazy",(t,e)=>{N.init(t,e),Z(t._zod,"innerType",()=>e.getter()),Z(t._zod,"pattern",()=>{var i,r;return(r=(i=t._zod.innerType)==null?void 0:i._zod)==null?void 0:r.pattern}),Z(t._zod,"propValues",()=>{var i,r;return(r=(i=t._zod.innerType)==null?void 0:i._zod)==null?void 0:r.propValues}),Z(t._zod,"optin",()=>{var i,r;return((r=(i=t._zod.innerType)==null?void 0:i._zod)==null?void 0:r.optin)??void 0}),Z(t._zod,"optout",()=>{var i,r;return((r=(i=t._zod.innerType)==null?void 0:i._zod)==null?void 0:r.optout)??void 0}),t._zod.parse=(i,r)=>t._zod.innerType._zod.run(i,r)}),Ym=b("$ZodCustom",(t,e)=>{he.init(t,e),N.init(t,e),t._zod.parse=(i,r)=>i,t._zod.check=i=>{const r=i.value,n=e.fn(r);if(n instanceof Promise)return n.then(o=>Cu(o,i,r,t));Cu(n,i,r,t)}});function Cu(t,e,i,r){if(!t){const n={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),e.issues.push(an(n))}}const o_=()=>{const t={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function e(n){return t[n]??null}const i={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:"مدخل"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${a}`:`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${a}`}case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${A(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${s.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${s.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${i[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${T(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function s_(){return{localeError:o_()}}const a_=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${a}`:`Yanlış dəyər: gözlənilən ${o}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${A(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function c_(){return{localeError:a_()}}function Au(t,e,i,r){const n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?r:o===1?e:o>=2&&o<=4?i:r}const l_=()=>{const t={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 e(n){return t[n]??null}const i={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:"увод"},r={nan:"NaN",number:"лік",array:"масіў"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Няправільны ўвод: чакаўся instanceof ${n.expected}, атрымана ${a}`:`Няправільны ўвод: чакаўся ${o}, атрымана ${a}`}case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${A(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);if(s){const a=Number(n.maximum),c=Au(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${s.verb} ${o}${n.maximum.toString()} ${c}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);if(s){const a=Number(n.minimum),c=Au(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${s.verb} ${o}${n.minimum.toString()} ${c}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${i[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${T(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function u_(){return{localeError:l_()}}const d_=()=>{const t={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function e(n){return t[n]??null}const i={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:"вход"},r={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Невалиден вход: очакван instanceof ${n.expected}, получен ${a}`:`Невалиден вход: очакван ${o}, получен ${a}`}case"invalid_value":return n.values.length===1?`Невалиден вход: очакван ${A(n.values[0])}`:`Невалидна опция: очаквано едно от ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${o}${n.maximum.toString()} ${s.unit??"елемента"}`:`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Твърде малко: очаква се ${n.origin} да съдържа ${o}${n.minimum.toString()} ${s.unit}`:`Твърде малко: очаква се ${n.origin} да бъде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let s="Невалиден";return o.format==="emoji"&&(s="Невалидно"),o.format==="datetime"&&(s="Невалидно"),o.format==="date"&&(s="Невалидна"),o.format==="time"&&(s="Невалидно"),o.format==="duration"&&(s="Невалидна"),`${s} ${i[o.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};function h_(){return{localeError:d_()}}const f_=()=>{const t={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus invàlid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${A(n.values[0])}`:`Opció invàlida: s'esperava una de ${T(n.values," o ")}`;case"too_big":{const o=n.inclusive?"com a màxim":"menys de",s=e(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"com a mínim":"més de",s=e(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function m_(){return{localeError:f_()}}const p_=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${a}`:`Neplatný vstup: očekáváno ${o}, obdrženo ${a}`}case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${A(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${T(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function g_(){return{localeError:p_()}}const v_=()=>{const t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig værdi: forventede ${A(n.values[0])}`:`Ugyldigt valg: forventede en af følgende ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin),a=r[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin),a=r[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};function b_(){return{localeError:v_()}}const __=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ungültige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${A(n.values[0])}`:`Ungültige Option: erwartet eine von ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function y_(){return{localeError:__()}}const x_=()=>{const t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${A(n.values[0])}`:`Invalid option: expected one of ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Xm(){return{localeError:x_()}}const $_=()=>{const t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${a}`:`Nevalida enigo: atendiĝis ${o}, riceviĝis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendiĝis ${A(n.values[0])}`:`Nevalida opcio: atendiĝis unu el ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Tro malgranda: atendiĝis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendiĝis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${i[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function k_(){return{localeError:$_()}}const S_=()=>{const t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[n]??null}const i={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"},r={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 n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inválida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${A(n.values[0])}`:`Opción inválida: se esperaba una de ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin),a=r[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin),a=r[n.origin]??n.origin;return s?`Demasiado pequeño: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${i[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r[n.origin]??n.origin}`;default:return"Entrada inválida"}}};function w_(){return{localeError:S_()}}const I_=()=>{const t={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function e(n){return t[n]??null}const i={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:"ورودی"},r={nan:"NaN",number:"عدد",array:"آرایه"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ورودی نامعتبر: میبایست instanceof ${n.expected} میبود، ${a} دریافت شد`:`ورودی نامعتبر: میبایست ${o} میبود، ${a} دریافت شد`}case"invalid_value":return n.values.length===1?`ورودی نامعتبر: میبایست ${A(n.values[0])} میبود`:`گزینه نامعتبر: میبایست یکی از ${T(n.values,"|")} میبود`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{const o=n;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${i[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${T(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function z_(){return{localeError:I_()}}const P_=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${A(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Liian suuri: ${s.subject} täytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Liian pieni: ${s.subject} täytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${T(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function T_(){return{localeError:P_()}}const O_=()=>{const t={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Entrée invalide : instanceof ${n.expected} attendu, ${a} reçu`:`Entrée invalide : ${o} attendu, ${a} reçu`}case"invalid_value":return n.values.length===1?`Entrée invalide : ${A(n.values[0])} attendu`:`Option invalide : une valeur parmi ${T(n.values,"|")} attendue`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function D_(){return{localeError:O_()}}const M_=()=>{const t={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Entrée invalide : attendu instanceof ${n.expected}, reçu ${a}`:`Entrée invalide : attendu ${o}, reçu ${a}`}case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${A(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"≤":"<",s=e(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"≥":">",s=e(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${T(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function E_(){return{localeError:M_()}}const C_=()=>{const t={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"}},e={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},i=l=>l?t[l]:void 0,r=l=>{const u=i(l);return u?u.label:l??t.unknown.label},n=l=>`ה${r(l)}`,o=l=>{const u=i(l);return((u==null?void 0:u.gender)??"m")==="f"?"צריכה להיות":"צריך להיות"},s=l=>l?e[l]??null:null,a={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"}},c={nan:"NaN"};return l=>{var u;switch(l.code){case"invalid_type":{const d=l.expected,h=c[d??""]??r(d),f=j(l.input),m=c[f]??((u=t[f])==null?void 0:u.label)??f;return/^[A-Z]/.test(l.expected)?`קלט לא תקין: צריך להיות instanceof ${l.expected}, התקבל ${m}`:`קלט לא תקין: צריך להיות ${h}, התקבל ${m}`}case"invalid_value":{if(l.values.length===1)return`ערך לא תקין: הערך חייב להיות ${A(l.values[0])}`;const d=l.values.map(m=>A(m));if(l.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;const h=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${h}`}case"too_big":{const d=s(l.origin),h=n(l.origin??"value");if(l.origin==="string")return`${(d==null?void 0:d.longLabel)??"ארוך"} מדי: ${h} צריכה להכיל ${l.maximum.toString()} ${(d==null?void 0:d.unit)??""} ${l.inclusive?"או פחות":"לכל היותר"}`.trim();if(l.origin==="number"){const p=l.inclusive?`קטן או שווה ל-${l.maximum}`:`קטן מ-${l.maximum}`;return`גדול מדי: ${h} צריך להיות ${p}`}if(l.origin==="array"||l.origin==="set"){const p=l.origin==="set"?"צריכה":"צריך",g=l.inclusive?`${l.maximum} ${(d==null?void 0:d.unit)??""} או פחות`:`פחות מ-${l.maximum} ${(d==null?void 0:d.unit)??""}`;return`גדול מדי: ${h} ${p} להכיל ${g}`.trim()}const f=l.inclusive?"<=":"<",m=o(l.origin??"value");return d!=null&&d.unit?`${d.longLabel} מדי: ${h} ${m} ${f}${l.maximum.toString()} ${d.unit}`:`${(d==null?void 0:d.longLabel)??"גדול"} מדי: ${h} ${m} ${f}${l.maximum.toString()}`}case"too_small":{const d=s(l.origin),h=n(l.origin??"value");if(l.origin==="string")return`${(d==null?void 0:d.shortLabel)??"קצר"} מדי: ${h} צריכה להכיל ${l.minimum.toString()} ${(d==null?void 0:d.unit)??""} ${l.inclusive?"או יותר":"לפחות"}`.trim();if(l.origin==="number"){const p=l.inclusive?`גדול או שווה ל-${l.minimum}`:`גדול מ-${l.minimum}`;return`קטן מדי: ${h} צריך להיות ${p}`}if(l.origin==="array"||l.origin==="set"){const p=l.origin==="set"?"צריכה":"צריך";if(l.minimum===1&&l.inclusive){const v=(l.origin==="set","לפחות פריט אחד");return`קטן מדי: ${h} ${p} להכיל ${v}`}const g=l.inclusive?`${l.minimum} ${(d==null?void 0:d.unit)??""} או יותר`:`יותר מ-${l.minimum} ${(d==null?void 0:d.unit)??""}`;return`קטן מדי: ${h} ${p} להכיל ${g}`.trim()}const f=l.inclusive?">=":">",m=o(l.origin??"value");return d!=null&&d.unit?`${d.shortLabel} מדי: ${h} ${m} ${f}${l.minimum.toString()} ${d.unit}`:`${(d==null?void 0:d.shortLabel)??"קטן"} מדי: ${h} ${m} ${f}${l.minimum.toString()}`}case"invalid_format":{const d=l;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;const h=a[d.format],f=(h==null?void 0:h.label)??d.format,p=((h==null?void 0:h.gender)??"m")==="f"?"תקינה":"תקין";return`${f} לא ${p}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${l.divisor}`;case"unrecognized_keys":return`מפתח${l.keys.length>1?"ות":""} לא מזוה${l.keys.length>1?"ים":"ה"}: ${T(l.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(l.origin??"array")}`;default:return"קלט לא תקין"}}};function A_(){return{localeError:C_()}}const j_=()=>{const t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"szám",array:"tömb"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${a}`:`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${a}`}case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${A(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function R_(){return{localeError:j_()}}function ju(t,e,i){return Math.abs(t)===1?e:i}function tn(t){if(!t)return"";const e=["ա","ե","ը","ի","ո","ու","օ"],i=t[t.length-1];return t+(e.includes(i)?"ն":"ը")}const N_=()=>{const t={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function e(n){return t[n]??null}const i={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:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${n.expected}, ստացվել է ${a}`:`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${a}`}case"invalid_value":return n.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${A(n.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);if(s){const a=Number(n.maximum),c=ju(a,s.unit.one,s.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${tn(n.origin??"արժեք")} կունենա ${o}${n.maximum.toString()} ${c}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${tn(n.origin??"արժեք")} լինի ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);if(s){const a=Number(n.minimum),c=ju(a,s.unit.one,s.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${tn(n.origin)} կունենա ${o}${n.minimum.toString()} ${c}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${tn(n.origin)} լինի ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${o.prefix}"-ով`:o.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${o.suffix}"-ով`:o.format==="includes"?`Սխալ տող․ պետք է պարունակի "${o.includes}"`:o.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${o.pattern} ձևաչափին`:`Սխալ ${i[o.format]??n.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${n.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${n.keys.length>1?"ներ":""}. ${T(n.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${tn(n.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${tn(n.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function U_(){return{localeError:N_()}}const L_=()=>{const t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${A(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function F_(){return{localeError:L_()}}const Z_=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"númer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: Þú slóst inn ${a} þar sem á að vera instanceof ${n.expected}`:`Rangt gildi: Þú slóst inn ${a} þar sem á að vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert ráð fyrir ${A(n.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of lítið: gert er ráð fyrir að ${n.origin} sé ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ógildur strengur: verður að byrja á "${o.prefix}"`:o.format==="ends_with"?`Ógildur strengur: verður að enda á "${o.suffix}"`:o.format==="includes"?`Ógildur strengur: verður að innihalda "${o.includes}"`:o.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`:`Rangt ${i[o.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${T(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};function B_(){return{localeError:Z_()}}const H_=()=>{const t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${A(n.values[0])}`:`Opzione non valida: atteso uno tra ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${T(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function V_(){return{localeError:H_()}}const W_=()=>{const t={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function e(n){return t[n]??null}const i={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:"入力値"},r={nan:"NaN",number:"数値",array:"配列"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`無効な入力: instanceof ${n.expected}が期待されましたが、${a}が入力されました`:`無効な入力: ${o}が期待されましたが、${a}が入力されました`}case"invalid_value":return n.values.length===1?`無効な入力: ${A(n.values[0])}が期待されました`:`無効な選択: ${T(n.values,"、")}のいずれかである必要があります`;case"too_big":{const o=n.inclusive?"以下である":"より小さい",s=e(n.origin);return s?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s.unit??"要素"}${o}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{const o=n.inclusive?"以上である":"より大きい",s=e(n.origin);return s?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s.unit}${o}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{const o=n;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${i[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${T(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function q_(){return{localeError:W_()}}const J_=()=>{const t={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function e(n){return t[n]??null}const i={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:"შეყვანა"},r={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${a}`:`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${a}`}case"invalid_value":return n.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${A(n.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${T(n.values,"|")}-დან`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${o.prefix}"-ით`:o.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${o.suffix}"-ით`:o.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${o.includes}"-ს`:o.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${o.pattern}`:`არასწორი ${i[o.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${T(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};function K_(){return{localeError:J_()}}const G_=()=>{const t={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function e(n){return t[n]??null}const i={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:"ទិន្នន័យបញ្ចូល"},r={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${a}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${a}`}case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${A(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${s.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${T(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Qm(){return{localeError:G_()}}function Y_(){return Qm()}const X_=()=>{const t={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function e(n){return t[n]??null}const i={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:"입력"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${a}입니다`:`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${a}입니다`}case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${A(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${T(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const o=n.inclusive?"이하":"미만",s=o==="미만"?"이어야 합니다":"여야 합니다",a=e(n.origin),c=(a==null?void 0:a.unit)??"요소";return a?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${c} ${o}${s}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${s}`}case"too_small":{const o=n.inclusive?"이상":"초과",s=o==="이상"?"이어야 합니다":"여야 합니다",a=e(n.origin),c=(a==null?void 0:a.unit)??"요소";return a?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${c} ${o}${s}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${T(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function Q_(){return{localeError:X_()}}const Nn=t=>t.charAt(0).toUpperCase()+t.slice(1);function Ru(t){const e=Math.abs(t),i=e%10,r=e%100;return r>=11&&r<=19||i===0?"many":i===1?"one":"few"}const ey=()=>{const t={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 e(n,o,s,a){const c=t[n]??null;return c===null?c:{unit:c.unit[o],verb:c.verb[a][s?"inclusive":"notInclusive"]}}const i={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"},r={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 n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tikėtasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tikėtasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo būti ${A(n.values[0])}`:`Privalo būti vienas iš ${T(n.values,"|")} pasirinkimų`;case"too_big":{const o=r[n.origin]??n.origin,s=e(n.origin,Ru(Number(n.maximum)),n.inclusive??!1,"smaller");if(s!=null&&s.verb)return`${Nn(o??n.origin??"reikšmė")} ${s.verb} ${n.maximum.toString()} ${s.unit??"elementų"}`;const a=n.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Nn(o??n.origin??"reikšmė")} turi būti ${a} ${n.maximum.toString()} ${s==null?void 0:s.unit}`}case"too_small":{const o=r[n.origin]??n.origin,s=e(n.origin,Ru(Number(n.minimum)),n.inclusive??!1,"bigger");if(s!=null&&s.verb)return`${Nn(o??n.origin??"reikšmė")} ${s.verb} ${n.minimum.toString()} ${s.unit??"elementų"}`;const a=n.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Nn(o??n.origin??"reikšmė")} turi būti ${a} ${n.minimum.toString()} ${s==null?void 0:s.unit}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Eilutė privalo prasidėti "${o.prefix}"`:o.format==="ends_with"?`Eilutė privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilutė privalo įtraukti "${o.includes}"`:o.format==="regex"?`Eilutė privalo atitikti ${o.pattern}`:`Neteisingas ${i[o.format]??n.format}`}case"not_multiple_of":return`Skaičius privalo būti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${T(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const o=r[n.origin]??n.origin;return`${Nn(o??n.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function ty(){return{localeError:ey()}}const ny=()=>{const t={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function e(n){return t[n]??null}const i={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:"внес"},r={nan:"NaN",number:"број",array:"низа"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Грешен внес: се очекува instanceof ${n.expected}, примено ${a}`:`Грешен внес: се очекува ${o}, примено ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${A(n.values[0])}`:`Грешана опција: се очекува една ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${s.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${s.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${T(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function iy(){return{localeError:ny()}}const ry=()=>{const t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${A(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${T(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function oy(){return{localeError:ry()}}const sy=()=>{const t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${A(n.values[0])}`:`Ongeldige optie: verwacht één van ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function ay(){return{localeError:sy()}}const cy=()=>{const t={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${A(n.values[0])}`:`Ugyldig valg: forventet en av ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function ly(){return{localeError:cy()}}const uy=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Fâsit giren: umulan instanceof ${n.expected}, alınan ${a}`:`Fâsit giren: umulan ${o}, alınan ${a}`}case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${A(n.values[0])}`:`Fâsit tercih: mûteberler ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${i[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function dy(){return{localeError:uy()}}const hy=()=>{const t={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function e(n){return t[n]??null}const i={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:"ورودي"},r={nan:"NaN",number:"عدد",array:"ارې"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${a} ترلاسه شو`:`ناسم ورودي: باید ${o} وای, مګر ${a} ترلاسه شو`}case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${A(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${T(n.values,"|")} څخه وای`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{const o=n;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${i[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${T(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function fy(){return{localeError:hy()}}const my=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${A(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${s.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${s.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function py(){return{localeError:my()}}const gy=()=>{const t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"número",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inválido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inválido: esperado ${o}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${A(n.values[0])}`:`Opção inválida: esperada uma das ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${i[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function vy(){return{localeError:gy()}}function Nu(t,e,i,r){const n=Math.abs(t),o=n%10,s=n%100;return s>=11&&s<=19?r:o===1?e:o>=2&&o<=4?i:r}const by=()=>{const t={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 e(n){return t[n]??null}const i={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:"ввод"},r={nan:"NaN",number:"число",array:"массив"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Неверный ввод: ожидалось instanceof ${n.expected}, получено ${a}`:`Неверный ввод: ожидалось ${o}, получено ${a}`}case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${A(n.values[0])}`:`Неверный вариант: ожидалось одно из ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);if(s){const a=Number(n.maximum),c=Nu(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${c}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);if(s){const a=Number(n.minimum),c=Nu(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${c}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${i[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function _y(){return{localeError:by()}}const yy=()=>{const t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"število",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pričakovano ${o}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${A(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${T(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function xy(){return{localeError:yy()}}const $y=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: förväntat ${o}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${A(n.values[0])}`:`Ogiltigt val: förväntade en av ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${T(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function ky(){return{localeError:$y()}}const Sy=()=>{const t={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${a}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${a}`}case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${A(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${T(n.values,"|")} இல் ஒன்று`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const o=n;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function wy(){return{localeError:Sy()}}const Iy=()=>{const t={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function e(n){return t[n]??null}const i={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:"ข้อมูลที่ป้อน"},r={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${a}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${a}`}case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${A(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"ไม่เกิน":"น้อยกว่า",s=e(n.origin);return s?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${s.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?"อย่างน้อย":"มากกว่า",s=e(n.origin);return s?`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${s.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${T(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function zy(){return{localeError:Iy()}}const Py=()=>{const t={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function e(n){return t[n]??null}const i={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"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${a}`:`Geçersiz değer: beklenen ${o}, alınan ${a}`}case"invalid_value":return n.values.length===1?`Geçersiz değer: beklenen ${A(n.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()} ${s.unit??"öğe"}`:`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Geçersiz metin: "${o.prefix}" ile başlamalı`:o.format==="ends_with"?`Geçersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Geçersiz metin: "${o.includes}" içermeli`:o.format==="regex"?`Geçersiz metin: ${o.pattern} desenine uymalı`:`Geçersiz ${i[o.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function Ty(){return{localeError:Py()}}const Oy=()=>{const t={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function e(n){return t[n]??null}const i={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:"вхідні дані"},r={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${a}`:`Неправильні вхідні дані: очікується ${o}, отримано ${a}`}case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${A(n.values[0])}`:`Неправильна опція: очікується одне з ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Занадто велике: очікується, що ${n.origin??"значення"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Занадто мале: очікується, що ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${i[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${T(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function ep(){return{localeError:Oy()}}function Dy(){return ep()}const My=()=>{const t={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function e(n){return t[n]??null}const i={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:"ان پٹ"},r={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${a} موصول ہوا`:`غلط ان پٹ: ${o} متوقع تھا، ${a} موصول ہوا`}case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${A(n.values[0])} متوقع تھا`:`غلط آپشن: ${T(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${s.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const o=n;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${i[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${T(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function Ey(){return{localeError:My()}}const Cy=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto‘g‘ri kirish: kutilgan ${A(n.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`:o.format==="regex"?`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${i[o.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function Ay(){return{localeError:Cy()}}const jy=()=>{const t={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 e(n){return t[n]??null}const i={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"},r={nan:"NaN",number:"số",array:"mảng"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${a}`:`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${a}`}case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${A(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Quá nhỏ: mong đợi ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${i[o.format]??n.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 ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${T(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.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 ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function Ry(){return{localeError:jy()}}const Ny=()=>{const t={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function e(n){return t[n]??null}const i={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:"输入"},r={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`无效输入:期望 instanceof ${n.expected},实际接收 ${a}`:`无效输入:期望 ${o},实际接收 ${a}`}case"invalid_value":return n.values.length===1?`无效输入:期望 ${A(n.values[0])}`:`无效选项:期望以下之一 ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${s.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${i[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${T(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function Uy(){return{localeError:Ny()}}const Ly=()=>{const t={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function e(n){return t[n]??null}const i={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:"輸入"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${a}`:`無效的輸入值:預期為 ${o},但收到 ${a}`}case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${A(n.values[0])}`:`無效的選項:預期為以下其中之一 ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${s.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${s.unit}`:`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${i[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${T(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function Fy(){return{localeError:Ly()}}const Zy=()=>{const t={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function e(n){return t[n]??null}const i={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é"},r={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return n=>{switch(n.code){case"invalid_type":{const o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${a}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${a}`}case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${A(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${T(n.values,"|")}`;case"too_big":{const o=n.inclusive?"<=":"<",s=e(n.origin);return s?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${n.maximum}`}case"too_small":{const o=n.inclusive?">=":">",s=e(n.origin);return s?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${n.minimum}`}case"invalid_format":{const o=n;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${i[o.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${T(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function By(){return{localeError:Zy()}}const Ha=Object.freeze(Object.defineProperty({__proto__:null,ar:s_,az:c_,be:u_,bg:h_,ca:m_,cs:g_,da:b_,de:y_,en:Xm,eo:k_,es:w_,fa:z_,fi:T_,fr:D_,frCA:E_,he:A_,hu:R_,hy:U_,id:F_,is:B_,it:V_,ja:q_,ka:K_,kh:Y_,km:Qm,ko:Q_,lt:ty,mk:iy,ms:oy,nl:ay,no:ly,ota:dy,pl:py,ps:fy,pt:vy,ru:_y,sl:xy,sv:ky,ta:wy,th:zy,tr:Ty,ua:Dy,uk:ep,ur:Ey,uz:Ay,vi:Ry,yo:By,zhCN:Uy,zhTW:Fy},Symbol.toStringTag,{value:"Module"}));var Uu;const Va=Symbol("ZodOutput"),Wa=Symbol("ZodInput");class tp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...i){const r=i[0];return this._map.set(e,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const i=this._map.get(e);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(e),this}get(e){const i=e._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function So(){return new tp}(Uu=globalThis).__zod_globalRegistry??(Uu.__zod_globalRegistry=So());const Ne=globalThis.__zod_globalRegistry;function np(t,e){return new t({type:"string",...S(e)})}function ip(t,e){return new t({type:"string",coerce:!0,...S(e)})}function qa(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...S(e)})}function eo(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...S(e)})}function Ja(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...S(e)})}function Ka(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(e)})}function Ga(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(e)})}function Ya(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(e)})}function wo(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...S(e)})}function Xa(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...S(e)})}function Qa(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(e)})}function ec(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...S(e)})}function tc(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(e)})}function nc(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...S(e)})}function ic(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...S(e)})}function rc(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(e)})}function oc(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(e)})}function sc(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(e)})}function rp(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...S(e)})}function ac(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(e)})}function cc(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(e)})}function lc(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...S(e)})}function uc(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...S(e)})}function dc(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...S(e)})}function hc(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...S(e)})}const fc={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function op(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(e)})}function sp(t,e){return new t({type:"string",format:"date",check:"string_format",...S(e)})}function ap(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...S(e)})}function cp(t,e){return new t({type:"string",format:"duration",check:"string_format",...S(e)})}function lp(t,e){return new t({type:"number",checks:[],...S(e)})}function up(t,e){return new t({type:"number",coerce:!0,checks:[],...S(e)})}function dp(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...S(e)})}function hp(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...S(e)})}function fp(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...S(e)})}function mp(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...S(e)})}function pp(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...S(e)})}function gp(t,e){return new t({type:"boolean",...S(e)})}function vp(t,e){return new t({type:"boolean",coerce:!0,...S(e)})}function bp(t,e){return new t({type:"bigint",...S(e)})}function _p(t,e){return new t({type:"bigint",coerce:!0,...S(e)})}function yp(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...S(e)})}function xp(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...S(e)})}function $p(t,e){return new t({type:"symbol",...S(e)})}function kp(t,e){return new t({type:"undefined",...S(e)})}function Sp(t,e){return new t({type:"null",...S(e)})}function wp(t){return new t({type:"any"})}function Ip(t){return new t({type:"unknown"})}function zp(t,e){return new t({type:"never",...S(e)})}function Pp(t,e){return new t({type:"void",...S(e)})}function Tp(t,e){return new t({type:"date",...S(e)})}function Op(t,e){return new t({type:"date",coerce:!0,...S(e)})}function Dp(t,e){return new t({type:"nan",...S(e)})}function ft(t,e){return new Aa({check:"less_than",...S(e),value:t,inclusive:!1})}function Ue(t,e){return new Aa({check:"less_than",...S(e),value:t,inclusive:!0})}function mt(t,e){return new ja({check:"greater_than",...S(e),value:t,inclusive:!1})}function Me(t,e){return new ja({check:"greater_than",...S(e),value:t,inclusive:!0})}function Io(t){return mt(0,t)}function zo(t){return ft(0,t)}function Po(t){return Ue(0,t)}function To(t){return Me(0,t)}function Ht(t,e){return new _f({check:"multiple_of",...S(e),value:t})}function Gt(t,e){return new $f({check:"max_size",...S(e),maximum:t})}function pt(t,e){return new kf({check:"min_size",...S(e),minimum:t})}function $n(t,e){return new Sf({check:"size_equals",...S(e),size:t})}function kn(t,e){return new wf({check:"max_length",...S(e),maximum:t})}function $t(t,e){return new If({check:"min_length",...S(e),minimum:t})}function Sn(t,e){return new zf({check:"length_equals",...S(e),length:t})}function ki(t,e){return new Pf({check:"string_format",format:"regex",...S(e),pattern:t})}function Si(t){return new Tf({check:"string_format",format:"lowercase",...S(t)})}function wi(t){return new Of({check:"string_format",format:"uppercase",...S(t)})}function Ii(t,e){return new Df({check:"string_format",format:"includes",...S(e),includes:t})}function zi(t,e){return new Mf({check:"string_format",format:"starts_with",...S(e),prefix:t})}function Pi(t,e){return new Ef({check:"string_format",format:"ends_with",...S(e),suffix:t})}function Oo(t,e,i){return new Cf({check:"property",property:t,schema:e,...S(i)})}function Ti(t,e){return new Af({check:"mime_type",mime:t,...S(e)})}function it(t){return new jf({check:"overwrite",tx:t})}function Oi(t){return it(e=>e.normalize(t))}function Di(){return it(t=>t.trim())}function Mi(){return it(t=>t.toLowerCase())}function Ei(){return it(t=>t.toUpperCase())}function Ci(){return it(t=>_h(t))}function Mp(t,e,i){return new t({type:"array",element:e,...S(i)})}function Hy(t,e,i){return new t({type:"union",options:e,...S(i)})}function Vy(t,e,i){return new t({type:"union",options:e,inclusive:!1,...S(i)})}function Wy(t,e,i,r){return new t({type:"union",options:i,discriminator:e,...S(r)})}function qy(t,e,i){return new t({type:"intersection",left:e,right:i})}function Jy(t,e,i,r){const n=i instanceof N,o=n?r:i,s=n?i:null;return new t({type:"tuple",items:e,rest:s,...S(o)})}function Ky(t,e,i,r){return new t({type:"record",keyType:e,valueType:i,...S(r)})}function Gy(t,e,i,r){return new t({type:"map",keyType:e,valueType:i,...S(r)})}function Yy(t,e,i){return new t({type:"set",valueType:e,...S(i)})}function Xy(t,e,i){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:r,...S(i)})}function Qy(t,e,i){return new t({type:"enum",entries:e,...S(i)})}function ex(t,e,i){return new t({type:"literal",values:Array.isArray(e)?e:[e],...S(i)})}function Ep(t,e){return new t({type:"file",...S(e)})}function tx(t,e){return new t({type:"transform",transform:e})}function nx(t,e){return new t({type:"optional",innerType:e})}function ix(t,e){return new t({type:"nullable",innerType:e})}function rx(t,e,i){return new t({type:"default",innerType:e,get defaultValue(){return typeof i=="function"?i():vo(i)}})}function ox(t,e,i){return new t({type:"nonoptional",innerType:e,...S(i)})}function sx(t,e){return new t({type:"success",innerType:e})}function ax(t,e,i){return new t({type:"catch",innerType:e,catchValue:typeof i=="function"?i:()=>i})}function cx(t,e,i){return new t({type:"pipe",in:e,out:i})}function lx(t,e){return new t({type:"readonly",innerType:e})}function ux(t,e,i){return new t({type:"template_literal",parts:e,...S(i)})}function dx(t,e){return new t({type:"lazy",getter:e})}function hx(t,e){return new t({type:"promise",innerType:e})}function Cp(t,e,i){const r=S(i);return r.abort??(r.abort=!0),new t({type:"custom",check:"custom",fn:e,...r})}function Ap(t,e,i){return new t({type:"custom",check:"custom",fn:e,...S(i)})}function jp(t){const e=Rp(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(an(r,i.value,e._zod.def));else{const n=r;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),i.issues.push(an(n))}},t(i.value,i)));return e}function Rp(t,e){const i=new he({check:"custom",...S(e)});return i._zod.check=t,i}function Np(t){const e=new he({check:"describe"});return e._zod.onattach=[i=>{const r=Ne.get(i)??{};Ne.add(i,{...r,description:t})}],e._zod.check=()=>{},e}function Up(t){const e=new he({check:"meta"});return e._zod.onattach=[i=>{const r=Ne.get(i)??{};Ne.add(i,{...r,...t})}],e._zod.check=()=>{},e}function Lp(t,e){const i=S(e);let r=i.truthy??["true","1","yes","on","y","enabled"],n=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(r=r.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));const o=new Set(r),s=new Set(n),a=t.Codec??Ba,c=t.Boolean??Ua,l=t.String??$i,u=new l({type:"string",error:i.error}),d=new c({type:"boolean",error:i.error}),h=new a({type:"pipe",in:u,out:d,transform:((f,m)=>{let p=f;return i.case!=="sensitive"&&(p=p.toLowerCase()),o.has(p)?!0:s.has(p)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:m.value,inst:h,continue:!1}),{})}),reverseTransform:((f,m)=>f===!0?r[0]||"true":n[0]||"false"),error:i.error});return h}function Ai(t,e,i,r={}){const n=S(r),o={...S(r),check:"string_format",type:"string",format:e,fn:typeof i=="function"?i:a=>i.test(a),...n};return i instanceof RegExp&&(o.pattern=i),new t(o)}function ln(t){let e=(t==null?void 0:t.target)??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:(t==null?void 0:t.metadata)??Ne,target:e,unrepresentable:(t==null?void 0:t.unrepresentable)??"throw",override:(t==null?void 0:t.override)??(()=>{}),io:(t==null?void 0:t.io)??"output",counter:0,seen:new Map,cycles:(t==null?void 0:t.cycles)??"ref",reused:(t==null?void 0:t.reused)??"inline",external:(t==null?void 0:t.external)??void 0}}function ie(t,e,i={path:[],schemaPath:[]}){var u,d;var r;const n=t._zod.def,o=e.seen.get(t);if(o)return o.count++,i.schemaPath.includes(t)&&(o.cycle=i.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:i.path};e.seen.set(t,s);const a=(d=(u=t._zod).toJSONSchema)==null?void 0:d.call(u);if(a)s.schema=a;else{const h={...i,schemaPath:[...i.schemaPath,t],path:i.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,s.schema,h);else{const m=s.schema,p=e.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(t,e,m,h)}const f=t._zod.parent;f&&(s.ref||(s.ref=f),ie(f,e,h),e.seen.get(f).isParent=!0)}const c=e.metadataRegistry.get(t);return c&&Object.assign(s.schema,c),e.io==="input"&&De(t)&&(delete s.schema.examples,delete s.schema.default),e.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,e.seen.get(t).schema}function un(t,e){var s,a,c,l;const i=t.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const u of t.seen.entries()){const d=(s=t.metadataRegistry.get(u[0]))==null?void 0:s.id;if(d){const h=r.get(d);if(h&&h!==u[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(d,u[0])}}const n=u=>{var p;const d=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){const g=(p=t.external.registry.get(u[0]))==null?void 0:p.id,v=t.external.uri??(z=>z);if(g)return{ref:v(g)};const x=u[1].defId??u[1].schema.id??`schema${t.counter++}`;return u[1].defId=x,{defId:x,ref:`${v("__shared")}#/${d}/${x}`}}if(u[1]===i)return{ref:"#"};const f=`#/${d}/`,m=u[1].schema.id??`__schema${t.counter++}`;return{defId:m,ref:f+m}},o=u=>{if(u[1].schema.$ref)return;const d=u[1],{ref:h,defId:f}=n(u);d.def={...d.schema},f&&(d.defId=f);const m=d.schema;for(const p in m)delete m[p];m.$ref=h};if(t.cycles==="throw")for(const u of t.seen.entries()){const d=u[1];if(d.cycle)throw new Error(`Cycle detected: #/${(a=d.cycle)==null?void 0:a.join("/")}/<root>
|
|
45
46
|
|
|
46
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of e.seen.entries()){const h=u[1];if(t===u[0]){o(u);continue}if(e.external){const f=(c=e.external.registry.get(u[0]))==null?void 0:c.id;if(t!==u[0]&&f){o(u);continue}}if((l=e.metadataRegistry.get(u[0]))==null?void 0:l.id){o(u);continue}if(h.cycle){o(u);continue}if(h.count>1&&e.reused==="ref"){o(u);continue}}}function Ra(e,t){var r,a,c;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=l=>{const u=e.seen.get(l);if(u.ref===null)return;const h=u.def??u.schema,d={...h},f=u.ref;if(u.ref=null,f){s(f);const g=e.seen.get(f),m=g.schema;if(m.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(h.allOf=h.allOf??[],h.allOf.push(m)):Object.assign(h,m),Object.assign(h,d),l._zod.parent===f)for(const x in h)x==="$ref"||x==="allOf"||x in d||delete h[x];if(m.$ref)for(const x in h)x==="$ref"||x==="allOf"||x in g.def&&JSON.stringify(h[x])===JSON.stringify(g.def[x])&&delete h[x]}const p=l._zod.parent;if(p&&p!==f){s(p);const g=e.seen.get(p);if(g!=null&&g.schema.$ref&&(h.$ref=g.schema.$ref,g.def))for(const m in h)m==="$ref"||m==="allOf"||m in g.def&&JSON.stringify(h[m])===JSON.stringify(g.def[m])&&delete h[m]}e.override({zodSchema:l,jsonSchema:h,path:u.path??[]})};for(const l of[...e.seen.entries()].reverse())s(l[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,(r=e.external)!=null&&r.uri){const l=(a=e.external.registry.get(t))==null?void 0:a.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const o=((c=e.external)==null?void 0:c.defs)??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(o[u.defId]=u.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:ls(t,"input",e.processors),output:ls(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function wt(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return wt(s.element,n);if(s.type==="set")return wt(s.valueType,n);if(s.type==="lazy")return wt(s.getter(),n);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return wt(s.innerType,n);if(s.type==="intersection")return wt(s.left,n)||wt(s.right,n);if(s.type==="record"||s.type==="map")return wt(s.keyType,n)||wt(s.valueType,n);if(s.type==="pipe")return wt(s.in,n)||wt(s.out,n);if(s.type==="object"){for(const i in s.shape)if(wt(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(wt(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(wt(i,n))return!0;return!!(s.rest&&wt(s.rest,n))}return!1}const fd=(e,t={})=>n=>{const s=Oa({...n,processors:t});return ut(e,s),za(s,e),Ra(s,e)},ls=(e,t,n={})=>s=>{const{libraryOptions:i,target:o}=s??{},r=Oa({...i??{},target:o,io:t,processors:n});return ut(e,r),za(r,e),Ra(r,e)},pd={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gd=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:o,maximum:r,format:a,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof r=="number"&&(i.maxLength=r),a&&(i.format=pd[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?i.pattern=u[0].source:u.length>1&&(i.allOf=[...u.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},md=(e,t,n,s)=>{const i=n,{minimum:o,maximum:r,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof o=="number"&&(i.minimum=o,typeof u=="number"&&t.target!=="draft-04"&&(u>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof r=="number"&&(i.maximum=r,typeof l=="number"&&t.target!=="draft-04"&&(l<=r?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},bd=(e,t,n,s)=>{n.type="boolean"},_d=(e,t,n,s)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},yd=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},xd=(e,t,n,s)=>{n.not={}},vd=(e,t,n,s)=>{},wd=(e,t,n,s)=>{const i=e._zod.def,o=aa(i.entries);o.every(r=>typeof r=="number")&&(n.type="number"),o.every(r=>typeof r=="string")&&(n.type="string"),n.enum=o},kd=(e,t,n,s)=>{const i=e._zod.def,o=[];for(const r of i.values)if(r===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof r=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(r))}else o.push(r);if(o.length!==0)if(o.length===1){const r=o[0];n.type=r===null?"null":typeof r,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[r]:n.const=r}else o.every(r=>typeof r=="number")&&(n.type="number"),o.every(r=>typeof r=="string")&&(n.type="string"),o.every(r=>typeof r=="boolean")&&(n.type="boolean"),o.every(r=>r===null)&&(n.type="null"),n.enum=o},Sd=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Md=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Pd=(e,t,n,s)=>{const i=n,o=e._zod.def,{minimum:r,maximum:a}=e._zod.bag;typeof r=="number"&&(i.minItems=r),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=ut(o.element,t,{...s,path:[...s.path,"items"]})},Td=(e,t,n,s)=>{var l;const i=n,o=e._zod.def;i.type="object",i.properties={};const r=o.shape;for(const u in r)i.properties[u]=ut(r[u],t,{...s,path:[...s.path,"properties",u]});const a=new Set(Object.keys(r)),c=new Set([...a].filter(u=>{const h=o.shape[u]._zod;return t.io==="input"?h.optin===void 0:h.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((l=o.catchall)==null?void 0:l._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=ut(o.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Cd=(e,t,n,s)=>{const i=e._zod.def,o=i.inclusive===!1,r=i.options.map((a,c)=>ut(a,t,{...s,path:[...s.path,o?"oneOf":"anyOf",c]}));o?n.oneOf=r:n.anyOf=r},Od=(e,t,n,s)=>{const i=e._zod.def,o=ut(i.left,t,{...s,path:[...s.path,"allOf",0]}),r=ut(i.right,t,{...s,path:[...s.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(r)?r.allOf:[r]];n.allOf=c},zd=(e,t,n,s)=>{const i=n,o=e._zod.def;i.type="object";const r=o.keyType,a=r._zod.bag,c=a==null?void 0:a.patterns;if(o.mode==="loose"&&c&&c.size>0){const u=ut(o.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const h of c)i.patternProperties[h.source]=u}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=ut(o.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=ut(o.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const l=r._zod.values;if(l){const u=[...l].filter(h=>typeof h=="string"||typeof h=="number");u.length>0&&(i.required=u)}},Rd=(e,t,n,s)=>{const i=e._zod.def,o=ut(i.innerType,t,s),r=t.seen.get(e);t.target==="openapi-3.0"?(r.ref=i.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]},Id=(e,t,n,s)=>{const i=e._zod.def;ut(i.innerType,t,s);const o=t.seen.get(e);o.ref=i.innerType},Ed=(e,t,n,s)=>{const i=e._zod.def;ut(i.innerType,t,s);const o=t.seen.get(e);o.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ad=(e,t,n,s)=>{const i=e._zod.def;ut(i.innerType,t,s);const o=t.seen.get(e);o.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Dd=(e,t,n,s)=>{const i=e._zod.def;ut(i.innerType,t,s);const o=t.seen.get(e);o.ref=i.innerType;let r;try{r=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=r},Ld=(e,t,n,s)=>{const i=e._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;ut(o,t,s);const r=t.seen.get(e);r.ref=o},Nd=(e,t,n,s)=>{const i=e._zod.def;ut(i.innerType,t,s);const o=t.seen.get(e);o.ref=i.innerType,n.readOnly=!0},Ia=(e,t,n,s)=>{const i=e._zod.def;ut(i.innerType,t,s);const o=t.seen.get(e);o.ref=i.innerType},$d=k("ZodISODateTime",(e,t)=>{Iu.init(e,t),rt.init(e,t)});function Ea(e){return Hh($d,e)}const Fd=k("ZodISODate",(e,t)=>{Eu.init(e,t),rt.init(e,t)});function Hd(e){return jh(Fd,e)}const jd=k("ZodISOTime",(e,t)=>{Au.init(e,t),rt.init(e,t)});function Bd(e){return Bh(jd,e)}const Zd=k("ZodISODuration",(e,t)=>{Du.init(e,t),rt.init(e,t)});function Vd(e){return Zh(Zd,e)}const Wd=(e,t)=>{ha.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Sl(e,n)},flatten:{value:n=>kl(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Qs,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Qs,2)}},isEmpty:{get(){return e.issues.length===0}}})},It=k("ZodError",Wd,{Parent:Error}),qd=ki(It),Ud=Si(It),Yd=ws(It),Jd=ks(It),Kd=Pl(It),Xd=Tl(It),Gd=Cl(It),Qd=Ol(It),tf=zl(It),ef=Rl(It),nf=Il(It),sf=El(It),tt=k("ZodType",(e,t)=>(Q.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ls(e,"input"),output:ls(e,"output")}}),e.toJSONSchema=fd(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(re(t,{checks:[...t.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),e.with=e.check,e.clone=(n,s)=>ae(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>qd(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>Yd(e,n,s),e.parseAsync=async(n,s)=>Ud(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>Jd(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>Kd(e,n,s),e.decode=(n,s)=>Xd(e,n,s),e.encodeAsync=async(n,s)=>Gd(e,n,s),e.decodeAsync=async(n,s)=>Qd(e,n,s),e.safeEncode=(n,s)=>tf(e,n,s),e.safeDecode=(n,s)=>ef(e,n,s),e.safeEncodeAsync=async(n,s)=>nf(e,n,s),e.safeDecodeAsync=async(n,s)=>sf(e,n,s),e.refine=(n,s)=>e.check(Xf(n,s)),e.superRefine=n=>e.check(Gf(n)),e.overwrite=n=>e.check(je(n)),e.optional=()=>ot(e),e.exactOptional=()=>$f(e),e.nullable=()=>zo(e),e.nullish=()=>ot(zo(e)),e.nonoptional=n=>Vf(e,n),e.array=()=>I(e),e.or=n=>F([e,n]),e.and=n=>Pi(e,n),e.transform=n=>si(e,Fa(n)),e.default=n=>jf(e,n),e.prefault=n=>Zf(e,n),e.catch=n=>qf(e,n),e.pipe=n=>si(e,n),e.readonly=()=>Jf(e),e.describe=n=>{const s=e.clone();return Ke.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){var n;return(n=Ke.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ke.get(e);const s=e.clone();return Ke.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Aa=k("_ZodString",(e,t)=>{Mi.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(s,i,o)=>gd(e,s,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...s)=>e.check(Xh(...s)),e.includes=(...s)=>e.check(td(...s)),e.startsWith=(...s)=>e.check(ed(...s)),e.endsWith=(...s)=>e.check(nd(...s)),e.min=(...s)=>e.check(cs(...s)),e.max=(...s)=>e.check(Ta(...s)),e.length=(...s)=>e.check(Ca(...s)),e.nonempty=(...s)=>e.check(cs(1,...s)),e.lowercase=s=>e.check(Gh(s)),e.uppercase=s=>e.check(Qh(s)),e.trim=()=>e.check(id()),e.normalize=(...s)=>e.check(sd(...s)),e.toLowerCase=()=>e.check(od()),e.toUpperCase=()=>e.check(rd()),e.slugify=()=>e.check(ad())}),of=k("ZodString",(e,t)=>{Mi.init(e,t),Aa.init(e,t),e.email=n=>e.check(yh(rf,n)),e.url=n=>e.check(Sh(af,n)),e.jwt=n=>e.check(Fh(wf,n)),e.emoji=n=>e.check(Mh(cf,n)),e.guid=n=>e.check(So(Co,n)),e.uuid=n=>e.check(xh(An,n)),e.uuidv4=n=>e.check(vh(An,n)),e.uuidv6=n=>e.check(wh(An,n)),e.uuidv7=n=>e.check(kh(An,n)),e.nanoid=n=>e.check(Ph(lf,n)),e.guid=n=>e.check(So(Co,n)),e.cuid=n=>e.check(Th(uf,n)),e.cuid2=n=>e.check(Ch(hf,n)),e.ulid=n=>e.check(Oh(df,n)),e.base64=n=>e.check(Lh(yf,n)),e.base64url=n=>e.check(Nh(xf,n)),e.xid=n=>e.check(zh(ff,n)),e.ksuid=n=>e.check(Rh(pf,n)),e.ipv4=n=>e.check(Ih(gf,n)),e.ipv6=n=>e.check(Eh(mf,n)),e.cidrv4=n=>e.check(Ah(bf,n)),e.cidrv6=n=>e.check(Dh(_f,n)),e.e164=n=>e.check($h(vf,n)),e.datetime=n=>e.check(Ea(n)),e.date=n=>e.check(Hd(n)),e.time=n=>e.check(Bd(n)),e.duration=n=>e.check(Vd(n))});function y(e){return _h(of,e)}const rt=k("ZodStringFormat",(e,t)=>{it.init(e,t),Aa.init(e,t)}),rf=k("ZodEmail",(e,t)=>{ku.init(e,t),rt.init(e,t)}),Co=k("ZodGUID",(e,t)=>{vu.init(e,t),rt.init(e,t)}),An=k("ZodUUID",(e,t)=>{wu.init(e,t),rt.init(e,t)}),af=k("ZodURL",(e,t)=>{Su.init(e,t),rt.init(e,t)}),cf=k("ZodEmoji",(e,t)=>{Mu.init(e,t),rt.init(e,t)}),lf=k("ZodNanoID",(e,t)=>{Pu.init(e,t),rt.init(e,t)}),uf=k("ZodCUID",(e,t)=>{Tu.init(e,t),rt.init(e,t)}),hf=k("ZodCUID2",(e,t)=>{Cu.init(e,t),rt.init(e,t)}),df=k("ZodULID",(e,t)=>{Ou.init(e,t),rt.init(e,t)}),ff=k("ZodXID",(e,t)=>{zu.init(e,t),rt.init(e,t)}),pf=k("ZodKSUID",(e,t)=>{Ru.init(e,t),rt.init(e,t)}),gf=k("ZodIPv4",(e,t)=>{Lu.init(e,t),rt.init(e,t)}),mf=k("ZodIPv6",(e,t)=>{Nu.init(e,t),rt.init(e,t)}),bf=k("ZodCIDRv4",(e,t)=>{$u.init(e,t),rt.init(e,t)}),_f=k("ZodCIDRv6",(e,t)=>{Fu.init(e,t),rt.init(e,t)}),yf=k("ZodBase64",(e,t)=>{Hu.init(e,t),rt.init(e,t)}),xf=k("ZodBase64URL",(e,t)=>{Bu.init(e,t),rt.init(e,t)}),vf=k("ZodE164",(e,t)=>{Zu.init(e,t),rt.init(e,t)}),wf=k("ZodJWT",(e,t)=>{Wu.init(e,t),rt.init(e,t)}),Da=k("ZodNumber",(e,t)=>{wa.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(s,i,o)=>md(e,s,i),e.gt=(s,i)=>e.check(Po(s,i)),e.gte=(s,i)=>e.check(Ns(s,i)),e.min=(s,i)=>e.check(Ns(s,i)),e.lt=(s,i)=>e.check(Mo(s,i)),e.lte=(s,i)=>e.check(Ls(s,i)),e.max=(s,i)=>e.check(Ls(s,i)),e.int=s=>e.check(Oo(s)),e.safe=s=>e.check(Oo(s)),e.positive=s=>e.check(Po(0,s)),e.nonnegative=s=>e.check(Ns(0,s)),e.negative=s=>e.check(Mo(0,s)),e.nonpositive=s=>e.check(Ls(0,s)),e.multipleOf=(s,i)=>e.check(To(s,i)),e.step=(s,i)=>e.check(To(s,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function L(e){return Vh(Da,e)}const kf=k("ZodNumberFormat",(e,t)=>{qu.init(e,t),Da.init(e,t)});function Oo(e){return Wh(kf,e)}const Sf=k("ZodBoolean",(e,t)=>{Uu.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>bd(e,n,s)});function X(e){return qh(Sf,e)}const Mf=k("ZodUndefined",(e,t)=>{Yu.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>yd(e,n)});function ei(e){return Uh(Mf,e)}const Pf=k("ZodNull",(e,t)=>{Ju.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>_d(e,n,s)});function Tf(e){return Yh(Pf,e)}const Cf=k("ZodUnknown",(e,t)=>{Ku.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>vd()});function J(){return Jh(Cf)}const Of=k("ZodNever",(e,t)=>{Xu.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>xd(e,n,s)});function zf(e){return Kh(Of,e)}const Rf=k("ZodArray",(e,t)=>{Gu.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Pd(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(cs(n,s)),e.nonempty=n=>e.check(cs(1,n)),e.max=(n,s)=>e.check(Ta(n,s)),e.length=(n,s)=>e.check(Ca(n,s)),e.unwrap=()=>e.element});function I(e,t){return cd(Rf,e,t)}const La=k("ZodObject",(e,t)=>{th.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Td(e,n,s,i),V(e,"shape",()=>t.shape),e.keyof=()=>Ot(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:J()}),e.loose=()=>e.clone({...e._zod.def,catchall:J()}),e.strict=()=>e.clone({...e._zod.def,catchall:zf()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>_l(e,n),e.safeExtend=n=>yl(e,n),e.merge=n=>xl(e,n),e.pick=n=>ml(e,n),e.omit=n=>bl(e,n),e.partial=(...n)=>vl(Ha,e,n[0]),e.required=(...n)=>wl(ja,e,n[0])});function v(e,t){const n={type:"object",shape:e??{},...R(t)};return new La(n)}function Mt(e,t){return new La({type:"object",shape:e,catchall:J(),...R(t)})}const Na=k("ZodUnion",(e,t)=>{Ma.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Cd(e,n,s,i),e.options=t.options});function F(e,t){return new Na({type:"union",options:e,...R(t)})}const If=k("ZodDiscriminatedUnion",(e,t)=>{Na.init(e,t),eh.init(e,t)});function $a(e,t,n){return new If({type:"union",options:t,discriminator:e,...R(n)})}const Ef=k("ZodIntersection",(e,t)=>{nh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Od(e,n,s,i)});function Pi(e,t){return new Ef({type:"intersection",left:e,right:t})}const Af=k("ZodRecord",(e,t)=>{sh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>zd(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function W(e,t,n){return new Af({type:"record",keyType:e,valueType:t,...R(n)})}const ni=k("ZodEnum",(e,t)=>{ih.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(s,i,o)=>wd(e,s,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(s,i)=>{const o={};for(const r of s)if(n.has(r))o[r]=t.entries[r];else throw new Error(`Key ${r} not found in enum`);return new ni({...t,checks:[],...R(i),entries:o})},e.exclude=(s,i)=>{const o={...t.entries};for(const r of s)if(n.has(r))delete o[r];else throw new Error(`Key ${r} not found in enum`);return new ni({...t,checks:[],...R(i),entries:o})}});function Ot(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new ni({type:"enum",entries:n,...R(t)})}const Df=k("ZodLiteral",(e,t)=>{oh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>kd(e,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function _(e,t){return new Df({type:"literal",values:Array.isArray(e)?e:[e],...R(t)})}const Lf=k("ZodTransform",(e,t)=>{rh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Md(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new oa(e.constructor.name);n.addIssue=o=>{if(typeof o=="string")n.issues.push(un(o,n.value,t));else{const r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=e),n.issues.push(un(r))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(o=>(n.value=o,n)):(n.value=i,n)}});function Fa(e){return new Lf({type:"transform",transform:e})}const Ha=k("ZodOptional",(e,t)=>{Pa.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Ia(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function ot(e){return new Ha({type:"optional",innerType:e})}const Nf=k("ZodExactOptional",(e,t)=>{ah.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Ia(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function $f(e){return new Nf({type:"optional",innerType:e})}const Ff=k("ZodNullable",(e,t)=>{ch.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Rd(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function zo(e){return new Ff({type:"nullable",innerType:e})}const Hf=k("ZodDefault",(e,t)=>{lh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Ed(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function jf(e,t){return new Hf({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():la(t)}})}const Bf=k("ZodPrefault",(e,t)=>{uh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Ad(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function Zf(e,t){return new Bf({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():la(t)}})}const ja=k("ZodNonOptional",(e,t)=>{hh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Id(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function Vf(e,t){return new ja({type:"nonoptional",innerType:e,...R(t)})}const Wf=k("ZodCatch",(e,t)=>{dh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Dd(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function qf(e,t){return new Wf({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Uf=k("ZodPipe",(e,t)=>{fh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Ld(e,n,s,i),e.in=t.in,e.out=t.out});function si(e,t){return new Uf({type:"pipe",in:e,out:t})}const Yf=k("ZodReadonly",(e,t)=>{ph.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Nd(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function Jf(e){return new Yf({type:"readonly",innerType:e})}const Ba=k("ZodCustom",(e,t)=>{gh.init(e,t),tt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>Sd(e,n)});function Kf(e,t){return ld(Ba,e??(()=>!0),t)}function Xf(e,t={}){return ud(Ba,e,t)}function Gf(e){return hd(e)}function Za(e,t){return si(Fa(e),t)}const me="io.modelcontextprotocol/related-task",Ms="2.0",ht=Kf(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Va=F([y(),L().int()]),Wa=y();Mt({ttl:L().optional(),pollInterval:L().optional()});const Qf=v({ttl:L().optional()}),tp=v({taskId:y()}),Ti=Mt({progressToken:Va.optional(),[me]:tp.optional()}),zt=v({_meta:Ti.optional()}),vn=zt.extend({task:Qf.optional()}),ep=e=>vn.safeParse(e).success,gt=v({method:y(),params:zt.loose().optional()}),Et=v({_meta:Ti.optional()}),At=v({method:y(),params:Et.loose().optional()}),mt=Mt({_meta:Ti.optional()}),wn=F([y(),L().int()]),qa=v({jsonrpc:_(Ms),id:wn,...gt.shape}).strict(),Ro=e=>qa.safeParse(e).success,Ua=v({jsonrpc:_(Ms),...At.shape}).strict(),np=e=>Ua.safeParse(e).success,Ci=v({jsonrpc:_(Ms),id:wn,result:mt}).strict(),Dn=e=>Ci.safeParse(e).success;var q;(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"})(q||(q={}));const Oi=v({jsonrpc:_(Ms),id:wn.optional(),error:v({code:L().int(),message:y(),data:J().optional()})}).strict(),sp=e=>Oi.safeParse(e).success,ip=F([qa,Ua,Ci,Oi]);F([Ci,Oi]);const zi=mt.strict(),op=Et.extend({requestId:wn.optional(),reason:y().optional()}),Ri=At.extend({method:_("notifications/cancelled"),params:op}),rp=v({src:y(),mimeType:y().optional(),sizes:I(y()).optional(),theme:Ot(["light","dark"]).optional()}),kn=v({icons:I(rp).optional()}),Le=v({name:y(),title:y().optional()}),Ps=Le.extend({...Le.shape,...kn.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),ap=Pi(v({applyDefaults:X().optional()}),W(y(),J())),cp=Za(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Pi(v({form:ap.optional(),url:ht.optional()}),W(y(),J()).optional())),lp=Mt({list:ht.optional(),cancel:ht.optional(),requests:Mt({sampling:Mt({createMessage:ht.optional()}).optional(),elicitation:Mt({create:ht.optional()}).optional()}).optional()}),up=Mt({list:ht.optional(),cancel:ht.optional(),requests:Mt({tools:Mt({call:ht.optional()}).optional()}).optional()}),hp=v({experimental:W(y(),ht).optional(),sampling:v({context:ht.optional(),tools:ht.optional()}).optional(),elicitation:cp.optional(),roots:v({listChanged:X().optional()}).optional(),tasks:lp.optional(),extensions:W(y(),ht).optional()}),dp=zt.extend({protocolVersion:y(),capabilities:hp,clientInfo:Ps}),fp=gt.extend({method:_("initialize"),params:dp}),pp=v({experimental:W(y(),ht).optional(),logging:ht.optional(),completions:ht.optional(),prompts:v({listChanged:X().optional()}).optional(),resources:v({subscribe:X().optional(),listChanged:X().optional()}).optional(),tools:v({listChanged:X().optional()}).optional(),tasks:up.optional(),extensions:W(y(),ht).optional()}),gp=mt.extend({protocolVersion:y(),capabilities:pp,serverInfo:Ps,instructions:y().optional()}),mp=At.extend({method:_("notifications/initialized"),params:Et.optional()}),Ts=gt.extend({method:_("ping"),params:zt.optional()}),bp=v({progress:L(),total:ot(L()),message:ot(y())}),_p=v({...Et.shape,...bp.shape,progressToken:Va}),Ii=At.extend({method:_("notifications/progress"),params:_p}),yp=zt.extend({cursor:Wa.optional()}),Sn=gt.extend({params:yp.optional()}),Mn=mt.extend({nextCursor:Wa.optional()}),xp=Ot(["working","input_required","completed","failed","cancelled"]),Pn=v({taskId:y(),status:xp,ttl:F([L(),Tf()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:ot(L()),statusMessage:ot(y())}),Ei=mt.extend({task:Pn}),vp=Et.merge(Pn),us=At.extend({method:_("notifications/tasks/status"),params:vp}),Ai=gt.extend({method:_("tasks/get"),params:zt.extend({taskId:y()})}),Di=mt.merge(Pn),Li=gt.extend({method:_("tasks/result"),params:zt.extend({taskId:y()})});mt.loose();const Ni=Sn.extend({method:_("tasks/list")}),$i=Mn.extend({tasks:I(Pn)}),Fi=gt.extend({method:_("tasks/cancel"),params:zt.extend({taskId:y()})}),wp=mt.merge(Pn),Ya=v({uri:y(),mimeType:ot(y()),_meta:W(y(),J()).optional()}),Ja=Ya.extend({text:y()}),Hi=y().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Ka=Ya.extend({blob:Hi}),Tn=Ot(["user","assistant"]),Be=v({audience:I(Tn).optional(),priority:L().min(0).max(1).optional(),lastModified:Ea({offset:!0}).optional()}),Xa=v({...Le.shape,...kn.shape,uri:y(),description:ot(y()),mimeType:ot(y()),size:ot(L()),annotations:Be.optional(),_meta:ot(Mt({}))}),kp=v({...Le.shape,...kn.shape,uriTemplate:y(),description:ot(y()),mimeType:ot(y()),annotations:Be.optional(),_meta:ot(Mt({}))}),Sp=Sn.extend({method:_("resources/list")}),Ga=Mn.extend({resources:I(Xa)}),Mp=Sn.extend({method:_("resources/templates/list")}),Pp=Mn.extend({resourceTemplates:I(kp)}),ji=zt.extend({uri:y()}),Tp=ji,Cp=gt.extend({method:_("resources/read"),params:Tp}),Qa=mt.extend({contents:I(F([Ja,Ka]))}),Op=At.extend({method:_("notifications/resources/list_changed"),params:Et.optional()}),zp=ji,Rp=gt.extend({method:_("resources/subscribe"),params:zp}),Ip=ji,Ep=gt.extend({method:_("resources/unsubscribe"),params:Ip}),Ap=Et.extend({uri:y()}),Dp=At.extend({method:_("notifications/resources/updated"),params:Ap}),Lp=v({name:y(),description:ot(y()),required:ot(X())}),Np=v({...Le.shape,...kn.shape,description:ot(y()),arguments:ot(I(Lp)),_meta:ot(Mt({}))}),$p=Sn.extend({method:_("prompts/list")}),Fp=Mn.extend({prompts:I(Np)}),Hp=zt.extend({name:y(),arguments:W(y(),y()).optional()}),jp=gt.extend({method:_("prompts/get"),params:Hp}),Bi=v({type:_("text"),text:y(),annotations:Be.optional(),_meta:W(y(),J()).optional()}),Zi=v({type:_("image"),data:Hi,mimeType:y(),annotations:Be.optional(),_meta:W(y(),J()).optional()}),Vi=v({type:_("audio"),data:Hi,mimeType:y(),annotations:Be.optional(),_meta:W(y(),J()).optional()}),Bp=v({type:_("tool_use"),name:y(),id:y(),input:W(y(),J()),_meta:W(y(),J()).optional()}),tc=v({type:_("resource"),resource:F([Ja,Ka]),annotations:Be.optional(),_meta:W(y(),J()).optional()}),ec=Xa.extend({type:_("resource_link")}),Cn=F([Bi,Zi,Vi,ec,tc]),Zp=v({role:Tn,content:Cn}),Vp=mt.extend({description:y().optional(),messages:I(Zp)}),Wp=At.extend({method:_("notifications/prompts/list_changed"),params:Et.optional()}),qp=v({title:y().optional(),readOnlyHint:X().optional(),destructiveHint:X().optional(),idempotentHint:X().optional(),openWorldHint:X().optional()}),Up=v({taskSupport:Ot(["required","optional","forbidden"]).optional()}),Wi=v({...Le.shape,...kn.shape,description:y().optional(),inputSchema:v({type:_("object"),properties:W(y(),ht).optional(),required:I(y()).optional()}).catchall(J()),outputSchema:v({type:_("object"),properties:W(y(),ht).optional(),required:I(y()).optional()}).catchall(J()).optional(),annotations:qp.optional(),execution:Up.optional(),_meta:W(y(),J()).optional()}),nc=Sn.extend({method:_("tools/list")}),Yp=Mn.extend({tools:I(Wi)}),Cs=mt.extend({content:I(Cn).default([]),structuredContent:W(y(),J()).optional(),isError:X().optional()});Cs.or(mt.extend({toolResult:J()}));const Jp=vn.extend({name:y(),arguments:W(y(),J()).optional()}),sc=gt.extend({method:_("tools/call"),params:Jp}),Kp=At.extend({method:_("notifications/tools/list_changed"),params:Et.optional()});v({autoRefresh:X().default(!0),debounceMs:L().int().nonnegative().default(300)});const ic=Ot(["debug","info","notice","warning","error","critical","alert","emergency"]),Xp=zt.extend({level:ic}),Gp=gt.extend({method:_("logging/setLevel"),params:Xp}),Qp=Et.extend({level:ic,logger:y().optional(),data:J()}),tg=At.extend({method:_("notifications/message"),params:Qp}),eg=v({name:y().optional()}),ng=v({hints:I(eg).optional(),costPriority:L().min(0).max(1).optional(),speedPriority:L().min(0).max(1).optional(),intelligencePriority:L().min(0).max(1).optional()}),sg=v({mode:Ot(["auto","required","none"]).optional()}),ig=v({type:_("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:I(Cn).default([]),structuredContent:v({}).loose().optional(),isError:X().optional(),_meta:W(y(),J()).optional()}),og=$a("type",[Bi,Zi,Vi]),hs=$a("type",[Bi,Zi,Vi,Bp,ig]),rg=v({role:Tn,content:F([hs,I(hs)]),_meta:W(y(),J()).optional()}),ag=vn.extend({messages:I(rg),modelPreferences:ng.optional(),systemPrompt:y().optional(),includeContext:Ot(["none","thisServer","allServers"]).optional(),temperature:L().optional(),maxTokens:L().int(),stopSequences:I(y()).optional(),metadata:ht.optional(),tools:I(Wi).optional(),toolChoice:sg.optional()}),cg=gt.extend({method:_("sampling/createMessage"),params:ag}),lg=mt.extend({model:y(),stopReason:ot(Ot(["endTurn","stopSequence","maxTokens"]).or(y())),role:Tn,content:og}),ug=mt.extend({model:y(),stopReason:ot(Ot(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:Tn,content:F([hs,I(hs)])}),hg=v({type:_("boolean"),title:y().optional(),description:y().optional(),default:X().optional()}),dg=v({type:_("string"),title:y().optional(),description:y().optional(),minLength:L().optional(),maxLength:L().optional(),format:Ot(["email","uri","date","date-time"]).optional(),default:y().optional()}),fg=v({type:Ot(["number","integer"]),title:y().optional(),description:y().optional(),minimum:L().optional(),maximum:L().optional(),default:L().optional()}),pg=v({type:_("string"),title:y().optional(),description:y().optional(),enum:I(y()),default:y().optional()}),gg=v({type:_("string"),title:y().optional(),description:y().optional(),oneOf:I(v({const:y(),title:y()})),default:y().optional()}),mg=v({type:_("string"),title:y().optional(),description:y().optional(),enum:I(y()),enumNames:I(y()).optional(),default:y().optional()}),bg=F([pg,gg]),_g=v({type:_("array"),title:y().optional(),description:y().optional(),minItems:L().optional(),maxItems:L().optional(),items:v({type:_("string"),enum:I(y())}),default:I(y()).optional()}),yg=v({type:_("array"),title:y().optional(),description:y().optional(),minItems:L().optional(),maxItems:L().optional(),items:v({anyOf:I(v({const:y(),title:y()}))}),default:I(y()).optional()}),xg=F([_g,yg]),vg=F([mg,bg,xg]),wg=F([vg,hg,dg,fg]),kg=vn.extend({mode:_("form").optional(),message:y(),requestedSchema:v({type:_("object"),properties:W(y(),wg),required:I(y()).optional()})}),Sg=vn.extend({mode:_("url"),message:y(),elicitationId:y(),url:y().url()}),Mg=F([kg,Sg]),Pg=gt.extend({method:_("elicitation/create"),params:Mg}),Tg=Et.extend({elicitationId:y()}),Cg=At.extend({method:_("notifications/elicitation/complete"),params:Tg}),Og=mt.extend({action:Ot(["accept","decline","cancel"]),content:Za(e=>e===null?void 0:e,W(y(),F([y(),L(),X(),I(y())])).optional())}),zg=v({type:_("ref/resource"),uri:y()}),Rg=v({type:_("ref/prompt"),name:y()}),Ig=zt.extend({ref:F([Rg,zg]),argument:v({name:y(),value:y()}),context:v({arguments:W(y(),y()).optional()}).optional()}),Eg=gt.extend({method:_("completion/complete"),params:Ig}),Ag=mt.extend({completion:Mt({values:I(y()).max(100),total:ot(L().int()),hasMore:ot(X())})}),Dg=v({uri:y().startsWith("file://"),name:y().optional(),_meta:W(y(),J()).optional()}),Lg=gt.extend({method:_("roots/list"),params:zt.optional()}),Ng=mt.extend({roots:I(Dg)}),$g=At.extend({method:_("notifications/roots/list_changed"),params:Et.optional()});F([Ts,fp,Eg,Gp,jp,$p,Sp,Mp,Cp,Rp,Ep,sc,nc,Ai,Li,Ni,Fi]);F([Ri,Ii,mp,$g,us]);F([zi,lg,ug,Og,Ng,Di,$i,Ei]);F([Ts,cg,Pg,Lg,Ai,Li,Ni,Fi]);F([Ri,Ii,tg,Dp,Op,Kp,Wp,us,Cg]);F([zi,gp,Ag,Vp,Fp,Ga,Pp,Qa,Cs,Yp,Di,$i,Ei]);class j extends Error{constructor(t,n,s){super(`MCP error ${t}: ${n}`),this.code=t,this.data=s,this.name="McpError"}static fromError(t,n,s){if(t===q.UrlElicitationRequired&&s){const i=s;if(i.elicitations)return new Fg(i.elicitations,n)}return new j(t,n,s)}}class Fg extends j{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(q.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){var t;return((t=this.data)==null?void 0:t.elicitations)??[]}}function qi(e){return!!e._zod}function oc(e,t){return qi(e)?fa(e,t):e.safeParse(t)}function Hg(e){var n,s;if(!e)return;let t;if(qi(e)?t=(s=(n=e._zod)==null?void 0:n.def)==null?void 0:s.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function jg(e){var i;if(qi(e)){const r=(i=e._zod)==null?void 0:i.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 n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}const s=e.value;if(s!==void 0)return s}function he(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Io(e){const t=Hg(e),n=t==null?void 0:t.method;if(!n)throw new Error("Schema is missing a method literal");const s=jg(n);if(typeof s!="string")throw new Error("Schema method literal must be a string");return s}function Eo(e,t){const n=oc(e,t);if(!n.success)throw n.error;return n.data}const Bg=6e4;class Zg{constructor(t){this._options=t,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(Ri,n=>{this._oncancel(n)}),this.setNotificationHandler(Ii,n=>{this._onprogress(n)}),this.setRequestHandler(Ts,n=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Ai,async(n,s)=>{const i=await this._taskStore.getTask(n.params.taskId,s.sessionId);if(!i)throw new j(q.InvalidParams,"Failed to retrieve task: Task not found");return{...i}}),this.setRequestHandler(Li,async(n,s)=>{const i=async()=>{var a;const o=n.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,s.sessionId);){if(c.type==="response"||c.type==="error"){const l=c.message,u=l.id,h=this._requestResolvers.get(u);if(h)if(this._requestResolvers.delete(u),c.type==="response")h(l);else{const d=l,f=new j(d.error.code,d.error.message,d.error.data);h(f)}else{const d=c.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await((a=this._transport)==null?void 0:a.send(c.message,{relatedRequestId:s.requestId}))}}const r=await this._taskStore.getTask(o,s.sessionId);if(!r)throw new j(q.InvalidParams,`Task not found: ${o}`);if(!he(r.status))return await this._waitForTaskUpdate(o,s.signal),await i();if(he(r.status)){const c=await this._taskStore.getTaskResult(o,s.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[me]:{taskId:o}}}}return await i()};return await i()}),this.setRequestHandler(Ni,async(n,s)=>{var i;try{const{tasks:o,nextCursor:r}=await this._taskStore.listTasks((i=n.params)==null?void 0:i.cursor,s.sessionId);return{tasks:o,nextCursor:r,_meta:{}}}catch(o){throw new j(q.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Fi,async(n,s)=>{try{const i=await this._taskStore.getTask(n.params.taskId,s.sessionId);if(!i)throw new j(q.InvalidParams,`Task not found: ${n.params.taskId}`);if(he(i.status))throw new j(q.InvalidParams,`Cannot cancel task in terminal status: ${i.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",s.sessionId),this._clearTaskQueue(n.params.taskId);const o=await this._taskStore.getTask(n.params.taskId,s.sessionId);if(!o)throw new j(q.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...o}}catch(i){throw i instanceof j?i:new j(q.InvalidRequest,`Failed to cancel task: ${i instanceof Error?i.message:String(i)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;const n=this._requestHandlerAbortControllers.get(t.params.requestId);n==null||n.abort(t.params.reason)}_setupTimeout(t,n,s,i,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(i,n),startTime:Date.now(),timeout:n,maxTotalTimeout:s,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(t){const n=this._timeoutInfo.get(t);if(!n)return!1;const s=Date.now()-n.startTime;if(n.maxTotalTimeout&&s>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),j.fromError(q.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:s});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){const n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var o,r,a;if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;const n=(o=this.transport)==null?void 0:o.onclose;this._transport.onclose=()=>{n==null||n(),this._onclose()};const s=(r=this.transport)==null?void 0:r.onerror;this._transport.onerror=c=>{s==null||s(c),this._onerror(c)};const i=(a=this._transport)==null?void 0:a.onmessage;this._transport.onmessage=(c,l)=>{i==null||i(c,l),Dn(c)||sp(c)?this._onresponse(c):Ro(c)?this._onrequest(c,l):np(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var s;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();for(const i of this._requestHandlerAbortControllers.values())i.abort();this._requestHandlerAbortControllers.clear();const n=j.fromError(q.ConnectionClosed,"Connection closed");this._transport=void 0,(s=this.onclose)==null||s.call(this);for(const i of t.values())i(n)}_onerror(t){var n;(n=this.onerror)==null||n.call(this,t)}_onnotification(t){const n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(s=>this._onerror(new Error(`Uncaught error in notification handler: ${s}`)))}_onrequest(t,n){var u,h,d,f;const s=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,i=this._transport,o=(d=(h=(u=t.params)==null?void 0:u._meta)==null?void 0:h[me])==null?void 0:d.taskId;if(s===void 0){const p={jsonrpc:"2.0",id:t.id,error:{code:q.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},i==null?void 0:i.sessionId).catch(g=>this._onerror(new Error(`Failed to enqueue error response: ${g}`))):i==null||i.send(p).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)));return}const r=new AbortController;this._requestHandlerAbortControllers.set(t.id,r);const a=ep(t.params)?t.params.task:void 0,c=this._taskStore?this.requestTaskStore(t,i==null?void 0:i.sessionId):void 0,l={signal:r.signal,sessionId:i==null?void 0:i.sessionId,_meta:(f=t.params)==null?void 0:f._meta,sendNotification:async p=>{if(r.signal.aborted)return;const g={relatedRequestId:t.id};o&&(g.relatedTask={taskId:o}),await this.notification(p,g)},sendRequest:async(p,g,m)=>{var M;if(r.signal.aborted)throw new j(q.ConnectionClosed,"Request was cancelled");const b={...m,relatedRequestId:t.id};o&&!b.relatedTask&&(b.relatedTask={taskId:o});const x=((M=b.relatedTask)==null?void 0:M.taskId)??o;return x&&c&&await c.updateTaskStatus(x,"input_required"),await this.request(p,g,b)},authInfo:n==null?void 0:n.authInfo,requestId:t.id,requestInfo:n==null?void 0:n.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a==null?void 0:a.ttl,closeSSEStream:n==null?void 0:n.closeSSEStream,closeStandaloneSSEStream:n==null?void 0:n.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>s(t,l)).then(async p=>{if(r.signal.aborted)return;const g={result:p,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:g,timestamp:Date.now()},i==null?void 0:i.sessionId):await(i==null?void 0:i.send(g))},async p=>{if(r.signal.aborted)return;const g={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(p.code)?p.code:q.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:g,timestamp:Date.now()},i==null?void 0:i.sessionId):await(i==null?void 0:i.send(g))}).catch(p=>this._onerror(new Error(`Failed to send response: ${p}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===r&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:n,...s}=t.params,i=Number(n),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const r=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&r&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),r(c);return}o(s)}_onresponse(t){const n=Number(t.id),s=this._requestResolvers.get(n);if(s){if(this._requestResolvers.delete(n),Dn(t))s(t);else{const r=new j(t.error.code,t.error.message,t.error.data);s(r)}return}const i=this._responseHandlers.get(n);if(i===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let o=!1;if(Dn(t)&&t.result&&typeof t.result=="object"){const r=t.result;if(r.task&&typeof r.task=="object"){const a=r.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,n))}}if(o||this._progressHandlers.delete(n),Dn(t))i(t);else{const r=j.fromError(t.error.code,t.error.message,t.error.data);i(r)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)==null?void 0:t.close())}async*requestStream(t,n,s){var r,a;const{task:i}=s??{};if(!i){try{yield{type:"result",result:await this.request(t,n,s)}}catch(c){yield{type:"error",error:c instanceof j?c:new j(q.InternalError,String(c))}}return}let o;try{const c=await this.request(t,Ei,s);if(c.task)o=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new j(q.InternalError,"Task creation did not return a task");for(;;){const l=await this.getTask({taskId:o},s);if(yield{type:"taskStatus",task:l},he(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},n,s)}:l.status==="failed"?yield{type:"error",error:new j(q.InternalError,`Task ${o} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new j(q.InternalError,`Task ${o} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},n,s)};return}const u=l.pollInterval??((r=this._options)==null?void 0:r.defaultTaskPollInterval)??1e3;await new Promise(h=>setTimeout(h,u)),(a=s==null?void 0:s.signal)==null||a.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof j?c:new j(q.InternalError,String(c))}}}request(t,n,s){const{relatedRequestId:i,resumptionToken:o,onresumptiontoken:r,task:a,relatedTask:c}=s??{};return new Promise((l,u)=>{var x,M,S,w,C;const h=T=>{u(T)};if(!this._transport){h(new Error("Not connected"));return}if(((x=this._options)==null?void 0:x.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(T){h(T);return}(M=s==null?void 0:s.signal)==null||M.throwIfAborted();const d=this._requestMessageId++,f={...t,jsonrpc:"2.0",id:d};s!=null&&s.onprogress&&(this._progressHandlers.set(d,s.onprogress),f.params={...t.params,_meta:{...((S=t.params)==null?void 0:S._meta)||{},progressToken:d}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...((w=f.params)==null?void 0:w._meta)||{},[me]:c}});const p=T=>{var z;this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),(z=this._transport)==null||z.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:d,reason:String(T)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:r}).catch(A=>this._onerror(new Error(`Failed to send cancellation: ${A}`)));const O=T instanceof j?T:new j(q.RequestTimeout,String(T));u(O)};this._responseHandlers.set(d,T=>{var O;if(!((O=s==null?void 0:s.signal)!=null&&O.aborted)){if(T instanceof Error)return u(T);try{const z=oc(n,T.result);z.success?l(z.data):u(z.error)}catch(z){u(z)}}}),(C=s==null?void 0:s.signal)==null||C.addEventListener("abort",()=>{var T;p((T=s==null?void 0:s.signal)==null?void 0:T.reason)});const g=(s==null?void 0:s.timeout)??Bg,m=()=>p(j.fromError(q.RequestTimeout,"Request timed out",{timeout:g}));this._setupTimeout(d,g,s==null?void 0:s.maxTotalTimeout,m,(s==null?void 0:s.resetTimeoutOnProgress)??!1);const b=c==null?void 0:c.taskId;if(b){const T=O=>{const z=this._responseHandlers.get(d);z?z(O):this._onerror(new Error(`Response handler missing for side-channeled request ${d}`))};this._requestResolvers.set(d,T),this._enqueueTaskMessage(b,{type:"request",message:f,timestamp:Date.now()}).catch(O=>{this._cleanupTimeout(d),u(O)})}else this._transport.send(f,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:r}).catch(T=>{this._cleanupTimeout(d),u(T)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},Di,n)}async getTaskResult(t,n,s){return this.request({method:"tasks/result",params:t},n,s)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},$i,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},wp,n)}async notification(t,n){var a,c,l,u;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const s=(a=n==null?void 0:n.relatedTask)==null?void 0:a.taskId;if(s){const h={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((c=t.params)==null?void 0:c._meta)||{},[me]:n.relatedTask}}};await this._enqueueTaskMessage(s,{type:"notification",message:h,timestamp:Date.now()});return}if((((l=this._options)==null?void 0:l.debouncedNotificationMethods)??[]).includes(t.method)&&!t.params&&!(n!=null&&n.relatedRequestId)&&!(n!=null&&n.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var d,f;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let h={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(h={...h,params:{...h.params,_meta:{...((d=h.params)==null?void 0:d._meta)||{},[me]:n.relatedTask}}}),(f=this._transport)==null||f.send(h,n).catch(p=>this._onerror(p))});return}let r={...t,jsonrpc:"2.0"};n!=null&&n.relatedTask&&(r={...r,params:{...r.params,_meta:{...((u=r.params)==null?void 0:u._meta)||{},[me]:n.relatedTask}}}),await this._transport.send(r,n)}setRequestHandler(t,n){const s=Io(t);this.assertRequestHandlerCapability(s),this._requestHandlers.set(s,(i,o)=>{const r=Eo(t,i);return Promise.resolve(n(r,o))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){const s=Io(t);this._notificationHandlers.set(s,i=>{const o=Eo(t,i);return Promise.resolve(n(o))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,s){var o;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const i=(o=this._options)==null?void 0:o.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,s,i)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){const s=await this._taskMessageQueue.dequeueAll(t,n);for(const i of s)if(i.type==="request"&&Ro(i.message)){const o=i.message.id,r=this._requestResolvers.get(o);r?(r(new j(q.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n){var i,o;let s=((i=this._options)==null?void 0:i.defaultTaskPollInterval)??1e3;try{const r=await((o=this._taskStore)==null?void 0:o.getTask(t));r!=null&&r.pollInterval&&(s=r.pollInterval)}catch{}return new Promise((r,a)=>{if(n.aborted){a(new j(q.InvalidRequest,"Request cancelled"));return}const c=setTimeout(r,s);n.addEventListener("abort",()=>{clearTimeout(c),a(new j(q.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){const s=this._taskStore;if(!s)throw new Error("No task store configured");return{createTask:async i=>{if(!t)throw new Error("No request provided");return await s.createTask(i,t.id,{method:t.method,params:t.params},n)},getTask:async i=>{const o=await s.getTask(i,n);if(!o)throw new j(q.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(i,o,r)=>{await s.storeTaskResult(i,o,r,n);const a=await s.getTask(i,n);if(a){const c=us.parse({method:"notifications/tasks/status",params:a});await this.notification(c),he(a.status)&&this._cleanupTaskProgressHandler(i)}},getTaskResult:i=>s.getTaskResult(i,n),updateTaskStatus:async(i,o,r)=>{const a=await s.getTask(i,n);if(!a)throw new j(q.InvalidParams,`Task "${i}" not found - it may have been cleaned up`);if(he(a.status))throw new j(q.InvalidParams,`Cannot update task "${i}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await s.updateTaskStatus(i,o,r,n);const c=await s.getTask(i,n);if(c){const l=us.parse({method:"notifications/tasks/status",params:c});await this.notification(l),he(c.status)&&this._cleanupTaskProgressHandler(i)}},listTasks:i=>s.listTasks(i,n)}}}class Vg extends Zg{constructor(){super(...arguments);P(this,"_registeredMethods",new Set);P(this,"_eventSlots",new Map);P(this,"setRequestHandler",(n,s)=>{this._assertMethodNotRegistered(n,"setRequestHandler"),super.setRequestHandler(n,s)});P(this,"setNotificationHandler",(n,s)=>{this._assertMethodNotRegistered(n,"setNotificationHandler"),super.setNotificationHandler(n,s)});P(this,"replaceRequestHandler",(n,s)=>{let i=n.shape.method.value;this._registeredMethods.add(i),super.setRequestHandler(n,s)})}onEventDispatch(n,s){}_ensureEventSlot(n){let s=this._eventSlots.get(n);if(!s){let i=this.eventSchemas[n];if(!i)throw Error(`Unknown event: ${String(n)}`);s={listeners:[]},this._eventSlots.set(n,s);let o=i.shape.method.value;this._registeredMethods.add(o);let r=s;super.setNotificationHandler(i,a=>{var l;let c=a.params;this.onEventDispatch(n,c),(l=r.onHandler)==null||l.call(r,c);for(let u of[...r.listeners])u(c)})}return s}setEventHandler(n,s){let i=this._ensureEventSlot(n);i.onHandler&&s&&console.warn(`[MCP Apps] on${String(n)} handler replaced. Use addEventListener("${String(n)}", …) to add multiple listeners without replacing.`),i.onHandler=s}getEventHandler(n){var s;return(s=this._eventSlots.get(n))==null?void 0:s.onHandler}addEventListener(n,s){this._ensureEventSlot(n).listeners.push(s)}removeEventListener(n,s){let i=this._eventSlots.get(n);if(!i)return;let o=i.listeners.indexOf(s);o!==-1&&i.listeners.splice(o,1)}warnIfRequestHandlerReplaced(n,s,i){s&&i&&console.warn(`[MCP Apps] ${n} handler replaced. Previous handler will no longer be called.`)}_assertMethodNotRegistered(n,s){let i=n.shape.method.value;if(this._registeredMethods.has(i))throw Error(`Handler for "${i}" already registered (via ${s}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(i)}}var Wg="2026-01-26",qg="ui/notifications/tool-input-partial";class Ug{constructor(t=window.parent,n){P(this,"eventTarget");P(this,"eventSource");P(this,"messageListener");P(this,"onclose");P(this,"onerror");P(this,"onmessage");P(this,"sessionId");P(this,"setProtocolVersion");this.eventTarget=t,this.eventSource=n,this.messageListener=s=>{var o,r,a;if(n&&s.source!==this.eventSource){console.debug("Ignoring message from unknown source",s);return}let i=ip.safeParse(s.data);i.success?(console.debug("Parsed message",i.data),(o=this.onmessage)==null||o.call(this,i.data)):((r=s.data)==null?void 0:r.jsonrpc)!=="2.0"?console.debug("Ignoring non-JSON-RPC message",i.error.message,s):(console.error("Failed to parse message",i.error.message,s),(a=this.onerror)==null||a.call(this,Error("Invalid JSON-RPC message received: "+i.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,n){t.method!==qg&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){var t;window.removeEventListener("message",this.messageListener),(t=this.onclose)==null||t.call(this)}}var Yg=F([_("light"),_("dark")]).describe("Color theme preference for the host environment."),hn=F([_("inline"),_("fullscreen"),_("pip")]).describe("Display mode for UI presentation."),Jg=F([_("--color-background-primary"),_("--color-background-secondary"),_("--color-background-tertiary"),_("--color-background-inverse"),_("--color-background-ghost"),_("--color-background-info"),_("--color-background-danger"),_("--color-background-success"),_("--color-background-warning"),_("--color-background-disabled"),_("--color-text-primary"),_("--color-text-secondary"),_("--color-text-tertiary"),_("--color-text-inverse"),_("--color-text-ghost"),_("--color-text-info"),_("--color-text-danger"),_("--color-text-success"),_("--color-text-warning"),_("--color-text-disabled"),_("--color-border-primary"),_("--color-border-secondary"),_("--color-border-tertiary"),_("--color-border-inverse"),_("--color-border-ghost"),_("--color-border-info"),_("--color-border-danger"),_("--color-border-success"),_("--color-border-warning"),_("--color-border-disabled"),_("--color-ring-primary"),_("--color-ring-secondary"),_("--color-ring-inverse"),_("--color-ring-info"),_("--color-ring-danger"),_("--color-ring-success"),_("--color-ring-warning"),_("--font-sans"),_("--font-mono"),_("--font-weight-normal"),_("--font-weight-medium"),_("--font-weight-semibold"),_("--font-weight-bold"),_("--font-text-xs-size"),_("--font-text-sm-size"),_("--font-text-md-size"),_("--font-text-lg-size"),_("--font-heading-xs-size"),_("--font-heading-sm-size"),_("--font-heading-md-size"),_("--font-heading-lg-size"),_("--font-heading-xl-size"),_("--font-heading-2xl-size"),_("--font-heading-3xl-size"),_("--font-text-xs-line-height"),_("--font-text-sm-line-height"),_("--font-text-md-line-height"),_("--font-text-lg-line-height"),_("--font-heading-xs-line-height"),_("--font-heading-sm-line-height"),_("--font-heading-md-line-height"),_("--font-heading-lg-line-height"),_("--font-heading-xl-line-height"),_("--font-heading-2xl-line-height"),_("--font-heading-3xl-line-height"),_("--border-radius-xs"),_("--border-radius-sm"),_("--border-radius-md"),_("--border-radius-lg"),_("--border-radius-xl"),_("--border-radius-full"),_("--border-width-regular"),_("--shadow-hairline"),_("--shadow-sm"),_("--shadow-md"),_("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),Kg=W(Jg.describe(`Style variables for theming MCP apps.
|
|
47
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const u of t.seen.entries()){const d=u[1];if(e===u[0]){o(u);continue}if(t.external){const f=(c=t.external.registry.get(u[0]))==null?void 0:c.id;if(e!==u[0]&&f){o(u);continue}}if((l=t.metadataRegistry.get(u[0]))==null?void 0:l.id){o(u);continue}if(d.cycle){o(u);continue}if(d.count>1&&t.reused==="ref"){o(u);continue}}}function dn(t,e){var s,a,c;const i=t.seen.get(e);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const u=t.seen.get(l);if(u.ref===null)return;const d=u.def??u.schema,h={...d},f=u.ref;if(u.ref=null,f){r(f);const p=t.seen.get(f),g=p.schema;if(g.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(g)):Object.assign(d,g),Object.assign(d,h),l._zod.parent===f)for(const x in d)x==="$ref"||x==="allOf"||x in h||delete d[x];if(g.$ref)for(const x in d)x==="$ref"||x==="allOf"||x in p.def&&JSON.stringify(d[x])===JSON.stringify(p.def[x])&&delete d[x]}const m=l._zod.parent;if(m&&m!==f){r(m);const p=t.seen.get(m);if(p!=null&&p.schema.$ref&&(d.$ref=p.schema.$ref,p.def))for(const g in d)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(d[g])===JSON.stringify(p.def[g])&&delete d[g]}t.override({zodSchema:l,jsonSchema:d,path:u.path??[]})};for(const l of[...t.seen.entries()].reverse())r(l[0]);const n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,(s=t.external)!=null&&s.uri){const l=(a=t.external.registry.get(e))==null?void 0:a.id;if(!l)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(l)}Object.assign(n,i.def??i.schema);const o=((c=t.external)==null?void 0:c.defs)??{};for(const l of t.seen.entries()){const u=l[1];u.def&&u.defId&&(o[u.defId]=u.def)}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{const l=JSON.parse(JSON.stringify(n));return Object.defineProperty(l,"~standard",{value:{...e["~standard"],jsonSchema:{input:ni(e,"input",t.processors),output:ni(e,"output",t.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function De(t,e){const i=e??{seen:new Set};if(i.seen.has(t))return!1;i.seen.add(t);const r=t._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return De(r.element,i);if(r.type==="set")return De(r.valueType,i);if(r.type==="lazy")return De(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return De(r.innerType,i);if(r.type==="intersection")return De(r.left,i)||De(r.right,i);if(r.type==="record"||r.type==="map")return De(r.keyType,i)||De(r.valueType,i);if(r.type==="pipe")return De(r.in,i)||De(r.out,i);if(r.type==="object"){for(const n in r.shape)if(De(r.shape[n],i))return!0;return!1}if(r.type==="union"){for(const n of r.options)if(De(n,i))return!0;return!1}if(r.type==="tuple"){for(const n of r.items)if(De(n,i))return!0;return!!(r.rest&&De(r.rest,i))}return!1}const Fp=(t,e={})=>i=>{const r=ln({...i,processors:e});return ie(t,r),un(r,t),dn(r,t)},ni=(t,e,i={})=>r=>{const{libraryOptions:n,target:o}=r??{},s=ln({...n??{},target:o,io:e,processors:i});return ie(t,s),un(s,t),dn(s,t)},fx={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Zp=(t,e,i,r)=>{const n=i;n.type="string";const{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=fx[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){const u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},Bp=(t,e,i,r)=>{const n=i,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof u=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.minimum=u,n.exclusiveMinimum=!0):n.exclusiveMinimum=u),typeof o=="number"&&(n.minimum=o,typeof u=="number"&&e.target!=="draft-04"&&(u>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof l=="number"&&(e.target==="draft-04"||e.target==="openapi-3.0"?(n.maximum=l,n.exclusiveMaximum=!0):n.exclusiveMaximum=l),typeof s=="number"&&(n.maximum=s,typeof l=="number"&&e.target!=="draft-04"&&(l<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof c=="number"&&(n.multipleOf=c)},Hp=(t,e,i,r)=>{i.type="boolean"},Vp=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Wp=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},qp=(t,e,i,r)=>{e.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Jp=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Kp=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Gp=(t,e,i,r)=>{i.not={}},Yp=(t,e,i,r)=>{},Xp=(t,e,i,r)=>{},Qp=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},eg=(t,e,i,r)=>{const n=t._zod.def,o=ba(n.entries);o.every(s=>typeof s=="number")&&(i.type="number"),o.every(s=>typeof s=="string")&&(i.type="string"),i.enum=o},tg=(t,e,i,r)=>{const n=t._zod.def,o=[];for(const s of n.values)if(s===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){const s=o[0];i.type=s===null?"null":typeof s,e.target==="draft-04"||e.target==="openapi-3.0"?i.enum=[s]:i.const=s}else o.every(s=>typeof s=="number")&&(i.type="number"),o.every(s=>typeof s=="string")&&(i.type="string"),o.every(s=>typeof s=="boolean")&&(i.type="boolean"),o.every(s=>s===null)&&(i.type="null"),i.enum=o},ng=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},ig=(t,e,i,r)=>{const n=i,o=t._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},rg=(t,e,i,r)=>{const n=i,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=t._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),c?c.length===1?(o.contentMediaType=c[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,o)},og=(t,e,i,r)=>{i.type="boolean"},sg=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ag=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},cg=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},lg=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},ug=(t,e,i,r)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},dg=(t,e,i,r)=>{const n=i,o=t._zod.def,{minimum:s,maximum:a}=t._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=ie(o.element,e,{...r,path:[...r.path,"items"]})},hg=(t,e,i,r)=>{var l;const n=i,o=t._zod.def;n.type="object",n.properties={};const s=o.shape;for(const u in s)n.properties[u]=ie(s[u],e,{...r,path:[...r.path,"properties",u]});const a=new Set(Object.keys(s)),c=new Set([...a].filter(u=>{const d=o.shape[u]._zod;return e.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(n.required=Array.from(c)),((l=o.catchall)==null?void 0:l._zod.def.type)==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=ie(o.catchall,e,{...r,path:[...r.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=!1)},mc=(t,e,i,r)=>{const n=t._zod.def,o=n.inclusive===!1,s=n.options.map((a,c)=>ie(a,e,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?i.oneOf=s:i.anyOf=s},fg=(t,e,i,r)=>{const n=t._zod.def,o=ie(n.left,e,{...r,path:[...r.path,"allOf",0]}),s=ie(n.right,e,{...r,path:[...r.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];i.allOf=c},mg=(t,e,i,r)=>{const n=i,o=t._zod.def;n.type="array";const s=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((h,f)=>ie(h,e,{...r,path:[...r.path,s,f]})),l=o.rest?ie(o.rest,e,{...r,path:[...r.path,a,...e.target==="openapi-3.0"?[o.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):e.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));const{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d)},pg=(t,e,i,r)=>{const n=i,o=t._zod.def;n.type="object";const s=o.keyType,a=s._zod.bag,c=a==null?void 0:a.patterns;if(o.mode==="loose"&&c&&c.size>0){const u=ie(o.valueType,e,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(const d of c)n.patternProperties[d.source]=u}else(e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=ie(o.keyType,e,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=ie(o.valueType,e,{...r,path:[...r.path,"additionalProperties"]});const l=s._zod.values;if(l){const u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u)}},gg=(t,e,i,r)=>{const n=t._zod.def,o=ie(n.innerType,e,r),s=e.seen.get(t);e.target==="openapi-3.0"?(s.ref=n.innerType,i.nullable=!0):i.anyOf=[o,{type:"null"}]},vg=(t,e,i,r)=>{const n=t._zod.def;ie(n.innerType,e,r);const o=e.seen.get(t);o.ref=n.innerType},bg=(t,e,i,r)=>{const n=t._zod.def;ie(n.innerType,e,r);const o=e.seen.get(t);o.ref=n.innerType,i.default=JSON.parse(JSON.stringify(n.defaultValue))},_g=(t,e,i,r)=>{const n=t._zod.def;ie(n.innerType,e,r);const o=e.seen.get(t);o.ref=n.innerType,e.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},yg=(t,e,i,r)=>{const n=t._zod.def;ie(n.innerType,e,r);const o=e.seen.get(t);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=s},xg=(t,e,i,r)=>{const n=t._zod.def,o=e.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;ie(o,e,r);const s=e.seen.get(t);s.ref=o},$g=(t,e,i,r)=>{const n=t._zod.def;ie(n.innerType,e,r);const o=e.seen.get(t);o.ref=n.innerType,i.readOnly=!0},kg=(t,e,i,r)=>{const n=t._zod.def;ie(n.innerType,e,r);const o=e.seen.get(t);o.ref=n.innerType},pc=(t,e,i,r)=>{const n=t._zod.def;ie(n.innerType,e,r);const o=e.seen.get(t);o.ref=n.innerType},Sg=(t,e,i,r)=>{const n=t._zod.innerType;ie(n,e,r);const o=e.seen.get(t);o.ref=n},Xs={string:Zp,number:Bp,boolean:Hp,bigint:Vp,symbol:Wp,null:qp,undefined:Jp,void:Kp,never:Gp,any:Yp,unknown:Xp,date:Qp,enum:eg,literal:tg,nan:ng,template_literal:ig,file:rg,success:og,custom:sg,function:ag,transform:cg,map:lg,set:ug,array:dg,object:hg,union:mc,intersection:fg,tuple:mg,record:pg,nullable:gg,nonoptional:vg,default:bg,prefault:_g,catch:yg,pipe:xg,readonly:$g,promise:kg,optional:pc,lazy:Sg};function gc(t,e){if("_idmap"in t){const r=t,n=ln({...e,processors:Xs}),o={};for(const c of r._idmap.entries()){const[l,u]=c;ie(u,n)}const s={},a={registry:r,uri:e==null?void 0:e.uri,defs:o};n.external=a;for(const c of r._idmap.entries()){const[l,u]=c;un(n,u),s[l]=dn(n,u)}if(Object.keys(o).length>0){const c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:o}}return{schemas:s}}const i=ln({...e,processors:Xs});return ie(t,i),un(i,t),dn(i,t)}class mx{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let i=(e==null?void 0:e.target)??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=ln({processors:Xs,target:i,...(e==null?void 0:e.metadata)&&{metadata:e.metadata},...(e==null?void 0:e.unrepresentable)&&{unrepresentable:e.unrepresentable},...(e==null?void 0:e.override)&&{override:e.override},...(e==null?void 0:e.io)&&{io:e.io}})}process(e,i={path:[],schemaPath:[]}){return ie(e,this.ctx,i)}emit(e,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),un(this.ctx,e);const r=dn(this.ctx,e),{"~standard":n,...o}=r;return o}}const px=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),wg=Object.freeze(Object.defineProperty({__proto__:null,$ZodAny:vm,$ZodArray:$m,$ZodAsyncError:Lt,$ZodBase64:om,$ZodBase64URL:am,$ZodBigInt:La,$ZodBigIntFormat:fm,$ZodBoolean:Ua,$ZodCIDRv4:im,$ZodCIDRv6:rm,$ZodCUID:Vf,$ZodCUID2:Wf,$ZodCatch:Bm,$ZodCheck:he,$ZodCheckBigIntFormat:xf,$ZodCheckEndsWith:Ef,$ZodCheckGreaterThan:ja,$ZodCheckIncludes:Df,$ZodCheckLengthEquals:zf,$ZodCheckLessThan:Aa,$ZodCheckLowerCase:Tf,$ZodCheckMaxLength:wf,$ZodCheckMaxSize:$f,$ZodCheckMimeType:Af,$ZodCheckMinLength:If,$ZodCheckMinSize:kf,$ZodCheckMultipleOf:_f,$ZodCheckNumberFormat:yf,$ZodCheckOverwrite:jf,$ZodCheckProperty:Cf,$ZodCheckRegex:Pf,$ZodCheckSizeEquals:Sf,$ZodCheckStartsWith:Mf,$ZodCheckStringFormat:xi,$ZodCheckUpperCase:Of,$ZodCodec:Ba,$ZodCustom:Ym,$ZodCustomStringFormat:dm,$ZodDate:xm,$ZodDefault:Um,$ZodDiscriminatedUnion:Pm,$ZodE164:cm,$ZodEmail:Ff,$ZodEmoji:Bf,$ZodEncodeError:po,$ZodEnum:Em,$ZodError:xa,$ZodExactOptional:Rm,$ZodFile:Am,$ZodFunction:Jm,$ZodGUID:Uf,$ZodIPv4:em,$ZodIPv6:tm,$ZodISODate:Yf,$ZodISODateTime:Gf,$ZodISODuration:Qf,$ZodISOTime:Xf,$ZodIntersection:Tm,$ZodJWT:um,$ZodKSUID:Kf,$ZodLazy:Gm,$ZodLiteral:Cm,$ZodMAC:nm,$ZodMap:Dm,$ZodNaN:Hm,$ZodNanoID:Hf,$ZodNever:_m,$ZodNonOptional:Fm,$ZodNull:gm,$ZodNullable:Nm,$ZodNumber:Na,$ZodNumberFormat:hm,$ZodObject:wm,$ZodObjectJIT:Im,$ZodOptional:Za,$ZodPipe:Vm,$ZodPrefault:Lm,$ZodPromise:Km,$ZodReadonly:Wm,$ZodRealError:Fe,$ZodRecord:Om,$ZodRegistry:tp,$ZodSet:Mm,$ZodString:$i,$ZodStringFormat:se,$ZodSuccess:Zm,$ZodSymbol:mm,$ZodTemplateLiteral:qm,$ZodTransform:jm,$ZodTuple:Fa,$ZodType:N,$ZodULID:qf,$ZodURL:Zf,$ZodUUID:Lf,$ZodUndefined:pm,$ZodUnion:ko,$ZodUnknown:bm,$ZodVoid:ym,$ZodXID:Jf,$ZodXor:zm,$brand:va,$constructor:b,$input:Wa,$output:Va,Doc:Rf,JSONSchema:px,JSONSchemaGenerator:mx,NEVER:ga,TimePrecision:fc,_any:wp,_array:Mp,_base64:lc,_base64url:uc,_bigint:bp,_boolean:gp,_catch:ax,_check:Rp,_cidrv4:ac,_cidrv6:cc,_coercedBigint:_p,_coercedBoolean:vp,_coercedDate:Op,_coercedNumber:up,_coercedString:ip,_cuid:ec,_cuid2:tc,_custom:Cp,_date:Tp,_decode:Ia,_decodeAsync:Pa,_default:rx,_discriminatedUnion:Wy,_e164:dc,_email:qa,_emoji:Xa,_encode:wa,_encodeAsync:za,_endsWith:Pi,_enum:Xy,_file:Ep,_float32:hp,_float64:fp,_gt:mt,_gte:Me,_guid:eo,_includes:Ii,_int:dp,_int32:mp,_int64:yp,_intersection:qy,_ipv4:oc,_ipv6:sc,_isoDate:sp,_isoDateTime:op,_isoDuration:cp,_isoTime:ap,_jwt:hc,_ksuid:rc,_lazy:dx,_length:Sn,_literal:ex,_lowercase:Si,_lt:ft,_lte:Ue,_mac:rp,_map:Gy,_max:Ue,_maxLength:kn,_maxSize:Gt,_mime:Ti,_min:Me,_minLength:$t,_minSize:pt,_multipleOf:Ht,_nan:Dp,_nanoid:Qa,_nativeEnum:Qy,_negative:zo,_never:zp,_nonnegative:To,_nonoptional:ox,_nonpositive:Po,_normalize:Oi,_null:Sp,_nullable:ix,_number:lp,_optional:nx,_overwrite:it,_parse:pi,_parseAsync:gi,_pipe:cx,_positive:Io,_promise:hx,_property:Oo,_readonly:lx,_record:Ky,_refine:Ap,_regex:ki,_safeDecode:Oa,_safeDecodeAsync:Ma,_safeEncode:Ta,_safeEncodeAsync:Da,_safeParse:vi,_safeParseAsync:bi,_set:Yy,_size:$n,_slugify:Ci,_startsWith:zi,_string:np,_stringFormat:Ai,_stringbool:Lp,_success:sx,_superRefine:jp,_symbol:$p,_templateLiteral:ux,_toLowerCase:Mi,_toUpperCase:Ei,_transform:tx,_trim:Di,_tuple:Jy,_uint32:pp,_uint64:xp,_ulid:nc,_undefined:kp,_union:Hy,_unknown:Ip,_uppercase:wi,_url:wo,_uuid:Ja,_uuidv4:Ka,_uuidv6:Ga,_uuidv7:Ya,_void:Pp,_xid:ic,_xor:Vy,clone:Le,config:_e,createStandardJSONSchemaMethod:ni,createToJSONSchemaMethod:Fp,decode:Pb,decodeAsync:Ob,describe:Np,encode:zb,encodeAsync:Tb,extractDefs:un,finalize:dn,flattenError:yo,formatError:xo,globalConfig:Gr,globalRegistry:Ne,initializeContext:ln,isValidBase64:Ra,isValidBase64URL:sm,isValidJWT:lm,locales:Ha,meta:Up,parse:Ks,parseAsync:Gs,prettifyError:ka,process:ie,regexes:$o,registry:So,safeDecode:Mb,safeDecodeAsync:Cb,safeEncode:Db,safeEncodeAsync:Eb,safeParse:Sa,safeParseAsync:jh,toDotPath:Ah,toJSONSchema:gc,treeifyError:$a,util:ya,version:Nf},Symbol.toStringTag,{value:"Module"}));function vc(t){return!!t._zod}function Ig(t,e){return vc(t)?Sa(t,e):t.safeParse(e)}function gx(t){var i,r;if(!t)return;let e;if(vc(t)?e=(r=(i=t._zod)==null?void 0:i.def)==null?void 0:r.shape:e=t.shape,!!e){if(typeof e=="function")try{return e()}catch{return}return e}}function vx(t){var n;if(vc(t)){const s=(n=t._zod)==null?void 0:n.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 i=t._def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}const r=t.value;if(r!==void 0)return r}const bx=Object.freeze(Object.defineProperty({__proto__:null,endsWith:Pi,gt:mt,gte:Me,includes:Ii,length:Sn,lowercase:Si,lt:ft,lte:Ue,maxLength:kn,maxSize:Gt,mime:Ti,minLength:$t,minSize:pt,multipleOf:Ht,negative:zo,nonnegative:To,nonpositive:Po,normalize:Oi,overwrite:it,positive:Io,property:Oo,regex:ki,size:$n,slugify:Ci,startsWith:zi,toLowerCase:Mi,toUpperCase:Ei,trim:Di,uppercase:wi},Symbol.toStringTag,{value:"Module"})),Do=b("ZodISODateTime",(t,e)=>{Gf.init(t,e),re.init(t,e)});function bc(t){return op(Do,t)}const Mo=b("ZodISODate",(t,e)=>{Yf.init(t,e),re.init(t,e)});function zg(t){return sp(Mo,t)}const Eo=b("ZodISOTime",(t,e)=>{Xf.init(t,e),re.init(t,e)});function Pg(t){return ap(Eo,t)}const Co=b("ZodISODuration",(t,e)=>{Qf.init(t,e),re.init(t,e)});function Tg(t){return cp(Co,t)}const _c=Object.freeze(Object.defineProperty({__proto__:null,ZodISODate:Mo,ZodISODateTime:Do,ZodISODuration:Co,ZodISOTime:Eo,date:zg,datetime:bc,duration:Tg,time:Pg},Symbol.toStringTag,{value:"Module"})),Og=(t,e)=>{xa.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:i=>xo(t,i)},flatten:{value:i=>yo(t,i)},addIssue:{value:i=>{t.issues.push(i),t.message=JSON.stringify(t.issues,Yr,2)}},addIssues:{value:i=>{t.issues.push(...i),t.message=JSON.stringify(t.issues,Yr,2)}},isEmpty:{get(){return t.issues.length===0}}})},Dg=b("ZodError",Og),Ae=b("ZodError",Og,{Parent:Error}),yc=pi(Ae),xc=gi(Ae),$c=vi(Ae),kc=bi(Ae),Sc=wa(Ae),wc=Ia(Ae),Ic=za(Ae),zc=Pa(Ae),Pc=Ta(Ae),Tc=Oa(Ae),Oc=Da(Ae),Dc=Ma(Ae),L=b("ZodType",(t,e)=>(N.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ni(t,"input"),output:ni(t,"output")}}),t.toJSONSchema=Fp(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.check=(...i)=>t.clone(nt(e,{checks:[...e.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),t.with=t.check,t.clone=(i,r)=>Le(t,i,r),t.brand=()=>t,t.register=((i,r)=>(i.add(t,r),t)),t.parse=(i,r)=>yc(t,i,r,{callee:t.parse}),t.safeParse=(i,r)=>$c(t,i,r),t.parseAsync=async(i,r)=>xc(t,i,r,{callee:t.parseAsync}),t.safeParseAsync=async(i,r)=>kc(t,i,r),t.spa=t.safeParseAsync,t.encode=(i,r)=>Sc(t,i,r),t.decode=(i,r)=>wc(t,i,r),t.encodeAsync=async(i,r)=>Ic(t,i,r),t.decodeAsync=async(i,r)=>zc(t,i,r),t.safeEncode=(i,r)=>Pc(t,i,r),t.safeDecode=(i,r)=>Tc(t,i,r),t.safeEncodeAsync=async(i,r)=>Oc(t,i,r),t.safeDecodeAsync=async(i,r)=>Dc(t,i,r),t.refine=(i,r)=>t.check(ys(i,r)),t.superRefine=i=>t.check(xs(i)),t.overwrite=i=>t.check(it(i)),t.optional=()=>oe(t),t.exactOptional=()=>ts(t),t.nullable=()=>mn(t),t.nullish=()=>oe(mn(t)),t.nonoptional=i=>as(t,i),t.array=()=>C(t),t.or=i=>H([t,i]),t.and=i=>Mn(t,i),t.transform=i=>pn(t,ir(i)),t.default=i=>rs(t,i),t.prefault=i=>ss(t,i),t.catch=i=>us(t,i),t.pipe=i=>pn(t,i),t.readonly=()=>fs(t),t.describe=i=>{const r=t.clone();return Ne.add(r,{description:i}),r},Object.defineProperty(t,"description",{get(){var i;return(i=Ne.get(t))==null?void 0:i.description},configurable:!0}),t.meta=(...i)=>{if(i.length===0)return Ne.get(t);const r=t.clone();return Ne.add(r,i[0]),r},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t.apply=i=>i(t),t)),ji=b("_ZodString",(t,e)=>{$i.init(t,e),L.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Zp(t,r,n);const i=t._zod.bag;t.format=i.format??null,t.minLength=i.minimum??null,t.maxLength=i.maximum??null,t.regex=(...r)=>t.check(ki(...r)),t.includes=(...r)=>t.check(Ii(...r)),t.startsWith=(...r)=>t.check(zi(...r)),t.endsWith=(...r)=>t.check(Pi(...r)),t.min=(...r)=>t.check($t(...r)),t.max=(...r)=>t.check(kn(...r)),t.length=(...r)=>t.check(Sn(...r)),t.nonempty=(...r)=>t.check($t(1,...r)),t.lowercase=r=>t.check(Si(r)),t.uppercase=r=>t.check(wi(r)),t.trim=()=>t.check(Di()),t.normalize=(...r)=>t.check(Oi(...r)),t.toLowerCase=()=>t.check(Mi()),t.toUpperCase=()=>t.check(Ei()),t.slugify=()=>t.check(Ci())}),wn=b("ZodString",(t,e)=>{$i.init(t,e),ji.init(t,e),t.email=i=>t.check(qa(Ri,i)),t.url=i=>t.check(wo(In,i)),t.jwt=i=>t.check(hc(Xi,i)),t.emoji=i=>t.check(Xa(Ni,i)),t.guid=i=>t.check(eo(hn,i)),t.uuid=i=>t.check(Ja(Ke,i)),t.uuidv4=i=>t.check(Ka(Ke,i)),t.uuidv6=i=>t.check(Ga(Ke,i)),t.uuidv7=i=>t.check(Ya(Ke,i)),t.nanoid=i=>t.check(Qa(Ui,i)),t.guid=i=>t.check(eo(hn,i)),t.cuid=i=>t.check(ec(Li,i)),t.cuid2=i=>t.check(tc(Fi,i)),t.ulid=i=>t.check(nc(Zi,i)),t.base64=i=>t.check(lc(Ki,i)),t.base64url=i=>t.check(uc(Gi,i)),t.xid=i=>t.check(ic(Bi,i)),t.ksuid=i=>t.check(rc(Hi,i)),t.ipv4=i=>t.check(oc(Vi,i)),t.ipv6=i=>t.check(sc(Wi,i)),t.cidrv4=i=>t.check(ac(qi,i)),t.cidrv6=i=>t.check(cc(Ji,i)),t.e164=i=>t.check(dc(Yi,i)),t.datetime=i=>t.check(bc(i)),t.date=i=>t.check(zg(i)),t.time=i=>t.check(Pg(i)),t.duration=i=>t.check(Tg(i))});function y(t){return np(wn,t)}const re=b("ZodStringFormat",(t,e)=>{se.init(t,e),ji.init(t,e)}),Ri=b("ZodEmail",(t,e)=>{Ff.init(t,e),re.init(t,e)});function Mc(t){return qa(Ri,t)}const hn=b("ZodGUID",(t,e)=>{Uf.init(t,e),re.init(t,e)});function Ec(t){return eo(hn,t)}const Ke=b("ZodUUID",(t,e)=>{Lf.init(t,e),re.init(t,e)});function Cc(t){return Ja(Ke,t)}function Ac(t){return Ka(Ke,t)}function jc(t){return Ga(Ke,t)}function Rc(t){return Ya(Ke,t)}const In=b("ZodURL",(t,e)=>{Zf.init(t,e),re.init(t,e)});function Nc(t){return wo(In,t)}function Uc(t){return wo(In,{protocol:/^https?$/,hostname:tf,...S(t)})}const Ni=b("ZodEmoji",(t,e)=>{Bf.init(t,e),re.init(t,e)});function Lc(t){return Xa(Ni,t)}const Ui=b("ZodNanoID",(t,e)=>{Hf.init(t,e),re.init(t,e)});function Fc(t){return Qa(Ui,t)}const Li=b("ZodCUID",(t,e)=>{Vf.init(t,e),re.init(t,e)});function Zc(t){return ec(Li,t)}const Fi=b("ZodCUID2",(t,e)=>{Wf.init(t,e),re.init(t,e)});function Bc(t){return tc(Fi,t)}const Zi=b("ZodULID",(t,e)=>{qf.init(t,e),re.init(t,e)});function Hc(t){return nc(Zi,t)}const Bi=b("ZodXID",(t,e)=>{Jf.init(t,e),re.init(t,e)});function Vc(t){return ic(Bi,t)}const Hi=b("ZodKSUID",(t,e)=>{Kf.init(t,e),re.init(t,e)});function Wc(t){return rc(Hi,t)}const Vi=b("ZodIPv4",(t,e)=>{em.init(t,e),re.init(t,e)});function qc(t){return oc(Vi,t)}const Ao=b("ZodMAC",(t,e)=>{nm.init(t,e),re.init(t,e)});function Jc(t){return rp(Ao,t)}const Wi=b("ZodIPv6",(t,e)=>{tm.init(t,e),re.init(t,e)});function Kc(t){return sc(Wi,t)}const qi=b("ZodCIDRv4",(t,e)=>{im.init(t,e),re.init(t,e)});function Gc(t){return ac(qi,t)}const Ji=b("ZodCIDRv6",(t,e)=>{rm.init(t,e),re.init(t,e)});function Yc(t){return cc(Ji,t)}const Ki=b("ZodBase64",(t,e)=>{om.init(t,e),re.init(t,e)});function Xc(t){return lc(Ki,t)}const Gi=b("ZodBase64URL",(t,e)=>{am.init(t,e),re.init(t,e)});function Qc(t){return uc(Gi,t)}const Yi=b("ZodE164",(t,e)=>{cm.init(t,e),re.init(t,e)});function el(t){return dc(Yi,t)}const Xi=b("ZodJWT",(t,e)=>{um.init(t,e),re.init(t,e)});function tl(t){return hc(Xi,t)}const Yt=b("ZodCustomStringFormat",(t,e)=>{dm.init(t,e),re.init(t,e)});function nl(t,e,i={}){return Ai(Yt,t,e,i)}function il(t){return Ai(Yt,"hostname",ef,t)}function rl(t){return Ai(Yt,"hex",vf,t)}function ol(t,e){const i=(e==null?void 0:e.enc)??"hex",r=`${t}_${i}`,n=$o[r];if(!n)throw new Error(`Unrecognized hash format: ${r}`);return Ai(Yt,r,n,e)}const zn=b("ZodNumber",(t,e)=>{Na.init(t,e),L.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Bp(t,r,n),t.gt=(r,n)=>t.check(mt(r,n)),t.gte=(r,n)=>t.check(Me(r,n)),t.min=(r,n)=>t.check(Me(r,n)),t.lt=(r,n)=>t.check(ft(r,n)),t.lte=(r,n)=>t.check(Ue(r,n)),t.max=(r,n)=>t.check(Ue(r,n)),t.int=r=>t.check(ii(r)),t.safe=r=>t.check(ii(r)),t.positive=r=>t.check(mt(0,r)),t.nonnegative=r=>t.check(Me(0,r)),t.negative=r=>t.check(ft(0,r)),t.nonpositive=r=>t.check(Ue(0,r)),t.multipleOf=(r,n)=>t.check(Ht(r,n)),t.step=(r,n)=>t.check(Ht(r,n)),t.finite=()=>t;const i=t._zod.bag;t.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),t.isFinite=!0,t.format=i.format??null});function U(t){return lp(zn,t)}const It=b("ZodNumberFormat",(t,e)=>{hm.init(t,e),zn.init(t,e)});function ii(t){return dp(It,t)}function sl(t){return hp(It,t)}function al(t){return fp(It,t)}function cl(t){return mp(It,t)}function ll(t){return pp(It,t)}const Pn=b("ZodBoolean",(t,e)=>{Ua.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Hp(t,i,r)});function Q(t){return gp(Pn,t)}const Tn=b("ZodBigInt",(t,e)=>{La.init(t,e),L.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Vp(t,r),t.gte=(r,n)=>t.check(Me(r,n)),t.min=(r,n)=>t.check(Me(r,n)),t.gt=(r,n)=>t.check(mt(r,n)),t.gte=(r,n)=>t.check(Me(r,n)),t.min=(r,n)=>t.check(Me(r,n)),t.lt=(r,n)=>t.check(ft(r,n)),t.lte=(r,n)=>t.check(Ue(r,n)),t.max=(r,n)=>t.check(Ue(r,n)),t.positive=r=>t.check(mt(BigInt(0),r)),t.negative=r=>t.check(ft(BigInt(0),r)),t.nonpositive=r=>t.check(Ue(BigInt(0),r)),t.nonnegative=r=>t.check(Me(BigInt(0),r)),t.multipleOf=(r,n)=>t.check(Ht(r,n));const i=t._zod.bag;t.minValue=i.minimum??null,t.maxValue=i.maximum??null,t.format=i.format??null});function ul(t){return bp(Tn,t)}const Qi=b("ZodBigIntFormat",(t,e)=>{fm.init(t,e),Tn.init(t,e)});function dl(t){return yp(Qi,t)}function hl(t){return xp(Qi,t)}const jo=b("ZodSymbol",(t,e)=>{mm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Wp(t,i)});function fl(t){return $p(jo,t)}const Ro=b("ZodUndefined",(t,e)=>{pm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Jp(t,i)});function fn(t){return kp(Ro,t)}const No=b("ZodNull",(t,e)=>{gm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>qp(t,i,r)});function er(t){return Sp(No,t)}const Uo=b("ZodAny",(t,e)=>{vm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Yp()});function ml(){return wp(Uo)}const Lo=b("ZodUnknown",(t,e)=>{bm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Xp()});function X(){return Ip(Lo)}const Fo=b("ZodNever",(t,e)=>{_m.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Gp(t,i,r)});function Vt(t){return zp(Fo,t)}const Zo=b("ZodVoid",(t,e)=>{ym.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Kp(t,i)});function pl(t){return Pp(Zo,t)}const tr=b("ZodDate",(t,e)=>{xm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(r,n,o)=>Qp(t,r),t.min=(r,n)=>t.check(Me(r,n)),t.max=(r,n)=>t.check(Ue(r,n));const i=t._zod.bag;t.minDate=i.minimum?new Date(i.minimum):null,t.maxDate=i.maximum?new Date(i.maximum):null});function gl(t){return Tp(tr,t)}const Bo=b("ZodArray",(t,e)=>{$m.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>dg(t,i,r,n),t.element=e.element,t.min=(i,r)=>t.check($t(i,r)),t.nonempty=i=>t.check($t(1,i)),t.max=(i,r)=>t.check(kn(i,r)),t.length=(i,r)=>t.check(Sn(i,r)),t.unwrap=()=>t.element});function C(t,e){return Mp(Bo,t,e)}function vl(t){const e=t._zod.def.shape;return $e(Object.keys(e))}const On=b("ZodObject",(t,e)=>{Im.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>hg(t,i,r,n),Z(t,"shape",()=>e.shape),t.keyof=()=>$e(Object.keys(t._zod.def.shape)),t.catchall=i=>t.clone({...t._zod.def,catchall:i}),t.passthrough=()=>t.clone({...t._zod.def,catchall:X()}),t.loose=()=>t.clone({...t._zod.def,catchall:X()}),t.strict=()=>t.clone({...t._zod.def,catchall:Vt()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=i=>zh(t,i),t.safeExtend=i=>Ph(t,i),t.merge=i=>Th(t,i),t.pick=i=>wh(t,i),t.omit=i=>Ih(t,i),t.partial=(...i)=>Oh(rr,t,i[0]),t.required=(...i)=>Dh(or,t,i[0])});function $(t,e){const i={type:"object",shape:t??{},...S(e)};return new On(i)}function bl(t,e){return new On({type:"object",shape:t,catchall:Vt(),...S(e)})}function xe(t,e){return new On({type:"object",shape:t,catchall:X(),...S(e)})}const Dn=b("ZodUnion",(t,e)=>{ko.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>mc(t,i,r,n),t.options=e.options});function H(t,e){return new Dn({type:"union",options:t,...S(e)})}const Ho=b("ZodXor",(t,e)=>{Dn.init(t,e),zm.init(t,e),t._zod.processJSONSchema=(i,r,n)=>mc(t,i,r,n),t.options=e.options});function _l(t,e){return new Ho({type:"union",options:t,inclusive:!1,...S(e)})}const Vo=b("ZodDiscriminatedUnion",(t,e)=>{Dn.init(t,e),Pm.init(t,e)});function nr(t,e,i){return new Vo({type:"union",options:e,discriminator:t,...S(i)})}const Wo=b("ZodIntersection",(t,e)=>{Tm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>fg(t,i,r,n)});function Mn(t,e){return new Wo({type:"intersection",left:t,right:e})}const qo=b("ZodTuple",(t,e)=>{Fa.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>mg(t,i,r,n),t.rest=i=>t.clone({...t._zod.def,rest:i})});function Jo(t,e,i){const r=e instanceof N,n=r?i:e,o=r?e:null;return new qo({type:"tuple",items:t,rest:o,...S(n)})}const En=b("ZodRecord",(t,e)=>{Om.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>pg(t,i,r,n),t.keyType=e.keyType,t.valueType=e.valueType});function J(t,e,i){return new En({type:"record",keyType:t,valueType:e,...S(i)})}function yl(t,e,i){const r=Le(t);return r._zod.values=void 0,new En({type:"record",keyType:r,valueType:e,...S(i)})}function xl(t,e,i){return new En({type:"record",keyType:t,valueType:e,mode:"loose",...S(i)})}const Ko=b("ZodMap",(t,e)=>{Dm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>lg(t,i),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...i)=>t.check(pt(...i)),t.nonempty=i=>t.check(pt(1,i)),t.max=(...i)=>t.check(Gt(...i)),t.size=(...i)=>t.check($n(...i))});function $l(t,e,i){return new Ko({type:"map",keyType:t,valueType:e,...S(i)})}const Go=b("ZodSet",(t,e)=>{Mm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>ug(t,i),t.min=(...i)=>t.check(pt(...i)),t.nonempty=i=>t.check(pt(1,i)),t.max=(...i)=>t.check(Gt(...i)),t.size=(...i)=>t.check($n(...i))});function kl(t,e){return new Go({type:"set",valueType:t,...S(e)})}const Wt=b("ZodEnum",(t,e)=>{Em.init(t,e),L.init(t,e),t._zod.processJSONSchema=(r,n,o)=>eg(t,r,n),t.enum=e.entries,t.options=Object.values(e.entries);const i=new Set(Object.keys(e.entries));t.extract=(r,n)=>{const o={};for(const s of r)if(i.has(s))o[s]=e.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Wt({...e,checks:[],...S(n),entries:o})},t.exclude=(r,n)=>{const o={...e.entries};for(const s of r)if(i.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Wt({...e,checks:[],...S(n),entries:o})}});function $e(t,e){const i=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new Wt({type:"enum",entries:i,...S(e)})}function Sl(t,e){return new Wt({type:"enum",entries:t,...S(e)})}const Yo=b("ZodLiteral",(t,e)=>{Cm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>tg(t,i,r),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function _(t,e){return new Yo({type:"literal",values:Array.isArray(t)?t:[t],...S(e)})}const Xo=b("ZodFile",(t,e)=>{Am.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>rg(t,i,r),t.min=(i,r)=>t.check(pt(i,r)),t.max=(i,r)=>t.check(Gt(i,r)),t.mime=(i,r)=>t.check(Ti(Array.isArray(i)?i:[i],r))});function wl(t){return Ep(Xo,t)}const Qo=b("ZodTransform",(t,e)=>{jm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>cg(t,i),t._zod.parse=(i,r)=>{if(r.direction==="backward")throw new po(t.constructor.name);i.addIssue=o=>{if(typeof o=="string")i.issues.push(an(o,i.value,e));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=t),i.issues.push(an(s))}};const n=e.transform(i.value,i);return n instanceof Promise?n.then(o=>(i.value=o,i)):(i.value=n,i)}});function ir(t){return new Qo({type:"transform",transform:t})}const rr=b("ZodOptional",(t,e)=>{Za.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>pc(t,i,r,n),t.unwrap=()=>t._zod.def.innerType});function oe(t){return new rr({type:"optional",innerType:t})}const es=b("ZodExactOptional",(t,e)=>{Rm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>pc(t,i,r,n),t.unwrap=()=>t._zod.def.innerType});function ts(t){return new es({type:"optional",innerType:t})}const ns=b("ZodNullable",(t,e)=>{Nm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>gg(t,i,r,n),t.unwrap=()=>t._zod.def.innerType});function mn(t){return new ns({type:"nullable",innerType:t})}function Il(t){return oe(mn(t))}const is=b("ZodDefault",(t,e)=>{Um.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>bg(t,i,r,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function rs(t,e){return new is({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():vo(e)}})}const os=b("ZodPrefault",(t,e)=>{Lm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>_g(t,i,r,n),t.unwrap=()=>t._zod.def.innerType});function ss(t,e){return new os({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():vo(e)}})}const or=b("ZodNonOptional",(t,e)=>{Fm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>vg(t,i,r,n),t.unwrap=()=>t._zod.def.innerType});function as(t,e){return new or({type:"nonoptional",innerType:t,...S(e)})}const cs=b("ZodSuccess",(t,e)=>{Zm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>og(t,i,r),t.unwrap=()=>t._zod.def.innerType});function zl(t){return new cs({type:"success",innerType:t})}const ls=b("ZodCatch",(t,e)=>{Bm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>yg(t,i,r,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function us(t,e){return new ls({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}const ds=b("ZodNaN",(t,e)=>{Hm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>ng(t,i)});function Pl(t){return Dp(ds,t)}const sr=b("ZodPipe",(t,e)=>{Vm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>xg(t,i,r,n),t.in=e.in,t.out=e.out});function pn(t,e){return new sr({type:"pipe",in:t,out:e})}const ar=b("ZodCodec",(t,e)=>{sr.init(t,e),Ba.init(t,e)});function Tl(t,e,i){return new ar({type:"pipe",in:t,out:e,transform:i.decode,reverseTransform:i.encode})}const hs=b("ZodReadonly",(t,e)=>{Wm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>$g(t,i,r,n),t.unwrap=()=>t._zod.def.innerType});function fs(t){return new hs({type:"readonly",innerType:t})}const ms=b("ZodTemplateLiteral",(t,e)=>{qm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>ig(t,i,r)});function Ol(t,e){return new ms({type:"template_literal",parts:t,...S(e)})}const ps=b("ZodLazy",(t,e)=>{Gm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>Sg(t,i,r,n),t.unwrap=()=>t._zod.def.getter()});function gs(t){return new ps({type:"lazy",getter:t})}const vs=b("ZodPromise",(t,e)=>{Km.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>kg(t,i,r,n),t.unwrap=()=>t._zod.def.innerType});function Dl(t){return new vs({type:"promise",innerType:t})}const bs=b("ZodFunction",(t,e)=>{Jm.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>ag(t,i)});function gn(t){return new bs({type:"function",input:Array.isArray(t==null?void 0:t.input)?Jo(t==null?void 0:t.input):(t==null?void 0:t.input)??C(X()),output:(t==null?void 0:t.output)??X()})}const Cn=b("ZodCustom",(t,e)=>{Ym.init(t,e),L.init(t,e),t._zod.processJSONSchema=(i,r,n)=>sg(t,i)});function Ml(t){const e=new he({check:"custom"});return e._zod.check=t,e}function _s(t,e){return Cp(Cn,t??(()=>!0),e)}function ys(t,e={}){return Ap(Cn,t,e)}function xs(t){return jp(t)}const El=Np,Cl=Up;function Al(t,e={}){const i=new Cn({type:"custom",check:"custom",fn:r=>r instanceof t,abort:!0,...S(e)});return i._zod.bag.Class=t,i._zod.check=r=>{r.value instanceof t||r.issues.push({code:"invalid_type",expected:t.name,input:r.value,inst:i,path:[...i._zod.def.path??[]]})},i}const jl=(...t)=>Lp({Codec:ar,Boolean:Pn,String:wn},...t);function Rl(t){const e=gs(()=>H([y(t),U(),Q(),er(),C(e),J(y(),e)]));return e}function cr(t,e){return pn(ir(t),e)}const _x=Object.freeze(Object.defineProperty({__proto__:null,ZodAny:Uo,ZodArray:Bo,ZodBase64:Ki,ZodBase64URL:Gi,ZodBigInt:Tn,ZodBigIntFormat:Qi,ZodBoolean:Pn,ZodCIDRv4:qi,ZodCIDRv6:Ji,ZodCUID:Li,ZodCUID2:Fi,ZodCatch:ls,ZodCodec:ar,ZodCustom:Cn,ZodCustomStringFormat:Yt,ZodDate:tr,ZodDefault:is,ZodDiscriminatedUnion:Vo,ZodE164:Yi,ZodEmail:Ri,ZodEmoji:Ni,ZodEnum:Wt,ZodExactOptional:es,ZodFile:Xo,ZodFunction:bs,ZodGUID:hn,ZodIPv4:Vi,ZodIPv6:Wi,ZodIntersection:Wo,ZodJWT:Xi,ZodKSUID:Hi,ZodLazy:ps,ZodLiteral:Yo,ZodMAC:Ao,ZodMap:Ko,ZodNaN:ds,ZodNanoID:Ui,ZodNever:Fo,ZodNonOptional:or,ZodNull:No,ZodNullable:ns,ZodNumber:zn,ZodNumberFormat:It,ZodObject:On,ZodOptional:rr,ZodPipe:sr,ZodPrefault:os,ZodPromise:vs,ZodReadonly:hs,ZodRecord:En,ZodSet:Go,ZodString:wn,ZodStringFormat:re,ZodSuccess:cs,ZodSymbol:jo,ZodTemplateLiteral:ms,ZodTransform:Qo,ZodTuple:qo,ZodType:L,ZodULID:Zi,ZodURL:In,ZodUUID:Ke,ZodUndefined:Ro,ZodUnion:Dn,ZodUnknown:Lo,ZodVoid:Zo,ZodXID:Bi,ZodXor:Ho,_ZodString:ji,_default:rs,_function:gn,any:ml,array:C,base64:Xc,base64url:Qc,bigint:ul,boolean:Q,catch:us,check:Ml,cidrv4:Gc,cidrv6:Yc,codec:Tl,cuid:Zc,cuid2:Bc,custom:_s,date:gl,describe:El,discriminatedUnion:nr,e164:el,email:Mc,emoji:Lc,enum:$e,exactOptional:ts,file:wl,float32:sl,float64:al,function:gn,guid:Ec,hash:ol,hex:rl,hostname:il,httpUrl:Uc,instanceof:Al,int:ii,int32:cl,int64:dl,intersection:Mn,ipv4:qc,ipv6:Kc,json:Rl,jwt:tl,keyof:vl,ksuid:Wc,lazy:gs,literal:_,looseObject:xe,looseRecord:xl,mac:Jc,map:$l,meta:Cl,nan:Pl,nanoid:Fc,nativeEnum:Sl,never:Vt,nonoptional:as,null:er,nullable:mn,nullish:Il,number:U,object:$,optional:oe,partialRecord:yl,pipe:pn,prefault:ss,preprocess:cr,promise:Dl,readonly:fs,record:J,refine:ys,set:kl,strictObject:bl,string:y,stringFormat:nl,stringbool:jl,success:zl,superRefine:xs,symbol:fl,templateLiteral:Ol,transform:ir,tuple:Jo,uint32:ll,uint64:hl,ulid:Hc,undefined:fn,union:H,unknown:X,url:Nc,uuid:Cc,uuidv4:Ac,uuidv6:jc,uuidv7:Rc,void:pl,xid:Vc,xor:_l},Symbol.toStringTag,{value:"Module"})),Mg={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 Eg(t){_e({customError:t})}function Cg(){return _e().customError}var to;to||(to={});const M={..._x,...bx,iso:_c},yx=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 xx(t,e){const i=t.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function $x(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const i=t.slice(1).split("/").filter(Boolean);if(i.length===0)return e.rootSchema;const r=e.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===r){const n=i[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function Ag(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return M.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){const n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return M.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);const o=$x(n,e),s=Ie(o,e);return e.refs.set(n,s),e.processing.delete(n),s}if(t.enum!==void 0){const n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===!0&&n.length===1&&n[0]===null)return M.null();if(n.length===0)return M.never();if(n.length===1)return M.literal(n[0]);if(n.every(s=>typeof s=="string"))return M.enum(n);const o=n.map(s=>M.literal(s));return o.length<2?o[0]:M.union([o[0],o[1],...o.slice(2)])}if(t.const!==void 0)return M.literal(t.const);const i=t.type;if(Array.isArray(i)){const n=i.map(o=>{const s={...t,type:o};return Ag(s,e)});return n.length===0?M.never():n.length===1?n[0]:M.union(n)}if(!i)return M.any();let r;switch(i){case"string":{let n=M.string();if(t.format){const o=t.format;o==="email"?n=n.check(M.email()):o==="uri"||o==="uri-reference"?n=n.check(M.url()):o==="uuid"||o==="guid"?n=n.check(M.uuid()):o==="date-time"?n=n.check(M.iso.datetime()):o==="date"?n=n.check(M.iso.date()):o==="time"?n=n.check(M.iso.time()):o==="duration"?n=n.check(M.iso.duration()):o==="ipv4"?n=n.check(M.ipv4()):o==="ipv6"?n=n.check(M.ipv6()):o==="mac"?n=n.check(M.mac()):o==="cidr"?n=n.check(M.cidrv4()):o==="cidr-v6"?n=n.check(M.cidrv6()):o==="base64"?n=n.check(M.base64()):o==="base64url"?n=n.check(M.base64url()):o==="e164"?n=n.check(M.e164()):o==="jwt"?n=n.check(M.jwt()):o==="emoji"?n=n.check(M.emoji()):o==="nanoid"?n=n.check(M.nanoid()):o==="cuid"?n=n.check(M.cuid()):o==="cuid2"?n=n.check(M.cuid2()):o==="ulid"?n=n.check(M.ulid()):o==="xid"?n=n.check(M.xid()):o==="ksuid"&&(n=n.check(M.ksuid()))}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),r=n;break}case"number":case"integer":{let n=i==="integer"?M.number().int():M.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),r=n;break}case"boolean":{r=M.boolean();break}case"null":{r=M.null();break}case"object":{const n={},o=t.properties||{},s=new Set(t.required||[]);for(const[c,l]of Object.entries(o)){const u=Ie(l,e);n[c]=s.has(c)?u:u.optional()}if(t.propertyNames){const c=Ie(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?Ie(t.additionalProperties,e):M.any();if(Object.keys(n).length===0){r=M.record(c,l);break}const u=M.object(n).passthrough(),d=M.looseRecord(c,l);r=M.intersection(u,d);break}if(t.patternProperties){const c=t.patternProperties,l=Object.keys(c),u=[];for(const h of l){const f=Ie(c[h],e),m=M.string().regex(new RegExp(h));u.push(M.looseRecord(m,f))}const d=[];if(Object.keys(n).length>0&&d.push(M.object(n).passthrough()),d.push(...u),d.length===0)r=M.object({}).passthrough();else if(d.length===1)r=d[0];else{let h=M.intersection(d[0],d[1]);for(let f=2;f<d.length;f++)h=M.intersection(h,d[f]);r=h}break}const a=M.object(n);t.additionalProperties===!1?r=a.strict():typeof t.additionalProperties=="object"?r=a.catchall(Ie(t.additionalProperties,e)):r=a.passthrough();break}case"array":{const n=t.prefixItems,o=t.items;if(n&&Array.isArray(n)){const s=n.map(c=>Ie(c,e)),a=o&&typeof o=="object"&&!Array.isArray(o)?Ie(o,e):void 0;a?r=M.tuple(s).rest(a):r=M.tuple(s),typeof t.minItems=="number"&&(r=r.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(r=r.check(M.maxLength(t.maxItems)))}else if(Array.isArray(o)){const s=o.map(c=>Ie(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?Ie(t.additionalItems,e):void 0;a?r=M.tuple(s).rest(a):r=M.tuple(s),typeof t.minItems=="number"&&(r=r.check(M.minLength(t.minItems))),typeof t.maxItems=="number"&&(r=r.check(M.maxLength(t.maxItems)))}else if(o!==void 0){const s=Ie(o,e);let a=M.array(s);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),r=a}else r=M.array(M.any());break}default:throw new Error(`Unsupported type: ${i}`)}return t.description&&(r=r.describe(t.description)),t.default!==void 0&&(r=r.default(t.default)),r}function Ie(t,e){if(typeof t=="boolean")return t?M.any():M.never();let i=Ag(t,e);const r=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){const a=t.anyOf.map(l=>Ie(l,e)),c=M.union(a);i=r?M.intersection(i,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){const a=t.oneOf.map(l=>Ie(l,e)),c=M.xor(a);i=r?M.intersection(i,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)i=r?i:M.any();else{let a=r?i:Ie(t.allOf[0],e);const c=r?0:1;for(let l=c;l<t.allOf.length;l++)a=M.intersection(a,Ie(t.allOf[l],e));i=a}t.nullable===!0&&e.version==="openapi-3.0"&&(i=M.nullable(i)),t.readOnly===!0&&(i=M.readonly(i));const n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const a of o)a in t&&(n[a]=t[a]);const s=["contentEncoding","contentMediaType","contentSchema"];for(const a of s)a in t&&(n[a]=t[a]);for(const a of Object.keys(t))yx.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(i,n),i}function jg(t,e){if(typeof t=="boolean")return t?M.any():M.never();const i=xx(t,e==null?void 0:e.defaultTarget),r=t.$defs||t.definitions||{},n={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:t,registry:(e==null?void 0:e.registry)??Ne};return Ie(t,n)}function kx(t){return ip(wn,t)}function Sx(t){return up(zn,t)}function wx(t){return vp(Pn,t)}function Ix(t){return _p(Tn,t)}function zx(t){return Op(tr,t)}const Rg=Object.freeze(Object.defineProperty({__proto__:null,bigint:Ix,boolean:wx,date:zx,number:Sx,string:kx},Symbol.toStringTag,{value:"Module"}));_e(Xm());const Lu=Object.freeze(Object.defineProperty({__proto__:null,$brand:va,$input:Wa,$output:Va,NEVER:ga,TimePrecision:fc,ZodAny:Uo,ZodArray:Bo,ZodBase64:Ki,ZodBase64URL:Gi,ZodBigInt:Tn,ZodBigIntFormat:Qi,ZodBoolean:Pn,ZodCIDRv4:qi,ZodCIDRv6:Ji,ZodCUID:Li,ZodCUID2:Fi,ZodCatch:ls,ZodCodec:ar,ZodCustom:Cn,ZodCustomStringFormat:Yt,ZodDate:tr,ZodDefault:is,ZodDiscriminatedUnion:Vo,ZodE164:Yi,ZodEmail:Ri,ZodEmoji:Ni,ZodEnum:Wt,ZodError:Dg,ZodExactOptional:es,ZodFile:Xo,get ZodFirstPartyTypeKind(){return to},ZodFunction:bs,ZodGUID:hn,ZodIPv4:Vi,ZodIPv6:Wi,ZodISODate:Mo,ZodISODateTime:Do,ZodISODuration:Co,ZodISOTime:Eo,ZodIntersection:Wo,ZodIssueCode:Mg,ZodJWT:Xi,ZodKSUID:Hi,ZodLazy:ps,ZodLiteral:Yo,ZodMAC:Ao,ZodMap:Ko,ZodNaN:ds,ZodNanoID:Ui,ZodNever:Fo,ZodNonOptional:or,ZodNull:No,ZodNullable:ns,ZodNumber:zn,ZodNumberFormat:It,ZodObject:On,ZodOptional:rr,ZodPipe:sr,ZodPrefault:os,ZodPromise:vs,ZodReadonly:hs,ZodRealError:Ae,ZodRecord:En,ZodSet:Go,ZodString:wn,ZodStringFormat:re,ZodSuccess:cs,ZodSymbol:jo,ZodTemplateLiteral:ms,ZodTransform:Qo,ZodTuple:qo,ZodType:L,ZodULID:Zi,ZodURL:In,ZodUUID:Ke,ZodUndefined:Ro,ZodUnion:Dn,ZodUnknown:Lo,ZodVoid:Zo,ZodXID:Bi,ZodXor:Ho,_ZodString:ji,_default:rs,_function:gn,any:ml,array:C,base64:Xc,base64url:Qc,bigint:ul,boolean:Q,catch:us,check:Ml,cidrv4:Gc,cidrv6:Yc,clone:Le,codec:Tl,coerce:Rg,config:_e,core:wg,cuid:Zc,cuid2:Bc,custom:_s,date:gl,decode:wc,decodeAsync:zc,describe:El,discriminatedUnion:nr,e164:el,email:Mc,emoji:Lc,encode:Sc,encodeAsync:Ic,endsWith:Pi,enum:$e,exactOptional:ts,file:wl,flattenError:yo,float32:sl,float64:al,formatError:xo,fromJSONSchema:jg,function:gn,getErrorMap:Cg,globalRegistry:Ne,gt:mt,gte:Me,guid:Ec,hash:ol,hex:rl,hostname:il,httpUrl:Uc,includes:Ii,instanceof:Al,int:ii,int32:cl,int64:dl,intersection:Mn,ipv4:qc,ipv6:Kc,iso:_c,json:Rl,jwt:tl,keyof:vl,ksuid:Wc,lazy:gs,length:Sn,literal:_,locales:Ha,looseObject:xe,looseRecord:xl,lowercase:Si,lt:ft,lte:Ue,mac:Jc,map:$l,maxLength:kn,maxSize:Gt,meta:Cl,mime:Ti,minLength:$t,minSize:pt,multipleOf:Ht,nan:Pl,nanoid:Fc,nativeEnum:Sl,negative:zo,never:Vt,nonnegative:To,nonoptional:as,nonpositive:Po,normalize:Oi,null:er,nullable:mn,nullish:Il,number:U,object:$,optional:oe,overwrite:it,parse:yc,parseAsync:xc,partialRecord:yl,pipe:pn,positive:Io,prefault:ss,preprocess:cr,prettifyError:ka,promise:Dl,property:Oo,readonly:fs,record:J,refine:ys,regex:ki,regexes:$o,registry:So,safeDecode:Tc,safeDecodeAsync:Dc,safeEncode:Pc,safeEncodeAsync:Oc,safeParse:$c,safeParseAsync:kc,set:kl,setErrorMap:Eg,size:$n,slugify:Ci,startsWith:zi,strictObject:bl,string:y,stringFormat:nl,stringbool:jl,success:zl,superRefine:xs,symbol:fl,templateLiteral:Ol,toJSONSchema:gc,toLowerCase:Mi,toUpperCase:Ei,transform:ir,treeifyError:$a,trim:Di,tuple:Jo,uint32:ll,uint64:hl,ulid:Hc,undefined:fn,union:H,unknown:X,uppercase:wi,url:Nc,util:ya,uuid:Cc,uuidv4:Ac,uuidv6:jc,uuidv7:Rc,void:pl,xid:Vc,xor:_l},Symbol.toStringTag,{value:"Module"})),Px=Object.freeze(Object.defineProperty({__proto__:null,$brand:va,$input:Wa,$output:Va,NEVER:ga,TimePrecision:fc,ZodAny:Uo,ZodArray:Bo,ZodBase64:Ki,ZodBase64URL:Gi,ZodBigInt:Tn,ZodBigIntFormat:Qi,ZodBoolean:Pn,ZodCIDRv4:qi,ZodCIDRv6:Ji,ZodCUID:Li,ZodCUID2:Fi,ZodCatch:ls,ZodCodec:ar,ZodCustom:Cn,ZodCustomStringFormat:Yt,ZodDate:tr,ZodDefault:is,ZodDiscriminatedUnion:Vo,ZodE164:Yi,ZodEmail:Ri,ZodEmoji:Ni,ZodEnum:Wt,ZodError:Dg,ZodExactOptional:es,ZodFile:Xo,get ZodFirstPartyTypeKind(){return to},ZodFunction:bs,ZodGUID:hn,ZodIPv4:Vi,ZodIPv6:Wi,ZodISODate:Mo,ZodISODateTime:Do,ZodISODuration:Co,ZodISOTime:Eo,ZodIntersection:Wo,ZodIssueCode:Mg,ZodJWT:Xi,ZodKSUID:Hi,ZodLazy:ps,ZodLiteral:Yo,ZodMAC:Ao,ZodMap:Ko,ZodNaN:ds,ZodNanoID:Ui,ZodNever:Fo,ZodNonOptional:or,ZodNull:No,ZodNullable:ns,ZodNumber:zn,ZodNumberFormat:It,ZodObject:On,ZodOptional:rr,ZodPipe:sr,ZodPrefault:os,ZodPromise:vs,ZodReadonly:hs,ZodRealError:Ae,ZodRecord:En,ZodSet:Go,ZodString:wn,ZodStringFormat:re,ZodSuccess:cs,ZodSymbol:jo,ZodTemplateLiteral:ms,ZodTransform:Qo,ZodTuple:qo,ZodType:L,ZodULID:Zi,ZodURL:In,ZodUUID:Ke,ZodUndefined:Ro,ZodUnion:Dn,ZodUnknown:Lo,ZodVoid:Zo,ZodXID:Bi,ZodXor:Ho,_ZodString:ji,_default:rs,_function:gn,any:ml,array:C,base64:Xc,base64url:Qc,bigint:ul,boolean:Q,catch:us,check:Ml,cidrv4:Gc,cidrv6:Yc,clone:Le,codec:Tl,coerce:Rg,config:_e,core:wg,cuid:Zc,cuid2:Bc,custom:_s,date:gl,decode:wc,decodeAsync:zc,default:Lu,describe:El,discriminatedUnion:nr,e164:el,email:Mc,emoji:Lc,encode:Sc,encodeAsync:Ic,endsWith:Pi,enum:$e,exactOptional:ts,file:wl,flattenError:yo,float32:sl,float64:al,formatError:xo,fromJSONSchema:jg,function:gn,getErrorMap:Cg,globalRegistry:Ne,gt:mt,gte:Me,guid:Ec,hash:ol,hex:rl,hostname:il,httpUrl:Uc,includes:Ii,instanceof:Al,int:ii,int32:cl,int64:dl,intersection:Mn,ipv4:qc,ipv6:Kc,iso:_c,json:Rl,jwt:tl,keyof:vl,ksuid:Wc,lazy:gs,length:Sn,literal:_,locales:Ha,looseObject:xe,looseRecord:xl,lowercase:Si,lt:ft,lte:Ue,mac:Jc,map:$l,maxLength:kn,maxSize:Gt,meta:Cl,mime:Ti,minLength:$t,minSize:pt,multipleOf:Ht,nan:Pl,nanoid:Fc,nativeEnum:Sl,negative:zo,never:Vt,nonnegative:To,nonoptional:as,nonpositive:Po,normalize:Oi,null:er,nullable:mn,nullish:Il,number:U,object:$,optional:oe,overwrite:it,parse:yc,parseAsync:xc,partialRecord:yl,pipe:pn,positive:Io,prefault:ss,preprocess:cr,prettifyError:ka,promise:Dl,property:Oo,readonly:fs,record:J,refine:ys,regex:ki,regexes:$o,registry:So,safeDecode:Tc,safeDecodeAsync:Dc,safeEncode:Pc,safeEncodeAsync:Oc,safeParse:$c,safeParseAsync:kc,set:kl,setErrorMap:Eg,size:$n,slugify:Ci,startsWith:zi,strictObject:bl,string:y,stringFormat:nl,stringbool:jl,success:zl,superRefine:xs,symbol:fl,templateLiteral:Ol,toJSONSchema:gc,toLowerCase:Mi,toUpperCase:Ei,transform:ir,treeifyError:$a,trim:Di,tuple:Jo,uint32:ll,uint64:hl,ulid:Hc,undefined:fn,union:H,unknown:X,uppercase:wi,url:Nc,util:ya,uuid:Cc,uuidv4:Ac,uuidv6:jc,uuidv7:Rc,void:pl,xid:Vc,xor:_l,z:Lu},Symbol.toStringTag,{value:"Module"})),At="io.modelcontextprotocol/related-task",$s="2.0",ge=_s(t=>t!==null&&(typeof t=="object"||typeof t=="function")),Ng=H([y(),U().int()]),Ug=y();xe({ttl:U().optional(),pollInterval:U().optional()});const Tx=$({ttl:U().optional()}),Ox=$({taskId:y()}),Nl=xe({progressToken:Ng.optional(),[At]:Ox.optional()}),Ze=$({_meta:Nl.optional()}),lr=Ze.extend({task:Tx.optional()}),Dx=t=>lr.safeParse(t).success,ke=$({method:y(),params:Ze.loose().optional()}),Ve=$({_meta:Nl.optional()}),We=$({method:y(),params:Ve.loose().optional()}),Se=xe({_meta:Nl.optional()}),ur=H([y(),U().int()]),Lg=$({jsonrpc:_($s),id:ur,...ke.shape}).strict(),Fu=t=>Lg.safeParse(t).success,Fg=$({jsonrpc:_($s),...We.shape}).strict(),Mx=t=>Fg.safeParse(t).success,Ul=$({jsonrpc:_($s),id:ur,result:Se}).strict(),Sr=t=>Ul.safeParse(t).success;var ee;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ee||(ee={}));const Ll=$({jsonrpc:_($s),id:ur.optional(),error:$({code:U().int(),message:y(),data:X().optional()})}).strict(),Ex=t=>Ll.safeParse(t).success,Cx=H([Lg,Fg,Ul,Ll]);H([Ul,Ll]);const Fl=Se.strict(),Ax=Ve.extend({requestId:ur.optional(),reason:y().optional()}),Zl=We.extend({method:_("notifications/cancelled"),params:Ax}),jx=$({src:y(),mimeType:y().optional(),sizes:C(y()).optional(),theme:$e(["light","dark"]).optional()}),dr=$({icons:C(jx).optional()}),vn=$({name:y(),title:y().optional()}),ks=vn.extend({...vn.shape,...dr.shape,version:y(),websiteUrl:y().optional(),description:y().optional()}),Rx=Mn($({applyDefaults:Q().optional()}),J(y(),X())),Nx=cr(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,Mn($({form:Rx.optional(),url:ge.optional()}),J(y(),X()).optional())),Ux=xe({list:ge.optional(),cancel:ge.optional(),requests:xe({sampling:xe({createMessage:ge.optional()}).optional(),elicitation:xe({create:ge.optional()}).optional()}).optional()}),Lx=xe({list:ge.optional(),cancel:ge.optional(),requests:xe({tools:xe({call:ge.optional()}).optional()}).optional()}),Fx=$({experimental:J(y(),ge).optional(),sampling:$({context:ge.optional(),tools:ge.optional()}).optional(),elicitation:Nx.optional(),roots:$({listChanged:Q().optional()}).optional(),tasks:Ux.optional(),extensions:J(y(),ge).optional()}),Zx=Ze.extend({protocolVersion:y(),capabilities:Fx,clientInfo:ks}),Bx=ke.extend({method:_("initialize"),params:Zx}),Hx=$({experimental:J(y(),ge).optional(),logging:ge.optional(),completions:ge.optional(),prompts:$({listChanged:Q().optional()}).optional(),resources:$({subscribe:Q().optional(),listChanged:Q().optional()}).optional(),tools:$({listChanged:Q().optional()}).optional(),tasks:Lx.optional(),extensions:J(y(),ge).optional()}),Vx=Se.extend({protocolVersion:y(),capabilities:Hx,serverInfo:ks,instructions:y().optional()}),Wx=We.extend({method:_("notifications/initialized"),params:Ve.optional()}),Ss=ke.extend({method:_("ping"),params:Ze.optional()}),qx=$({progress:U(),total:oe(U()),message:oe(y())}),Jx=$({...Ve.shape,...qx.shape,progressToken:Ng}),Bl=We.extend({method:_("notifications/progress"),params:Jx}),Kx=Ze.extend({cursor:Ug.optional()}),hr=ke.extend({params:Kx.optional()}),fr=Se.extend({nextCursor:Ug.optional()}),Gx=$e(["working","input_required","completed","failed","cancelled"]),mr=$({taskId:y(),status:Gx,ttl:H([U(),er()]),createdAt:y(),lastUpdatedAt:y(),pollInterval:oe(U()),statusMessage:oe(y())}),Hl=Se.extend({task:mr}),Yx=Ve.merge(mr),no=We.extend({method:_("notifications/tasks/status"),params:Yx}),Vl=ke.extend({method:_("tasks/get"),params:Ze.extend({taskId:y()})}),Wl=Se.merge(mr),ql=ke.extend({method:_("tasks/result"),params:Ze.extend({taskId:y()})});Se.loose();const Jl=hr.extend({method:_("tasks/list")}),Kl=fr.extend({tasks:C(mr)}),Gl=ke.extend({method:_("tasks/cancel"),params:Ze.extend({taskId:y()})}),Xx=Se.merge(mr),Zg=$({uri:y(),mimeType:oe(y()),_meta:J(y(),X()).optional()}),Bg=Zg.extend({text:y()}),Yl=y().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),Hg=Zg.extend({blob:Yl}),pr=$e(["user","assistant"]),An=$({audience:C(pr).optional(),priority:U().min(0).max(1).optional(),lastModified:bc({offset:!0}).optional()}),Vg=$({...vn.shape,...dr.shape,uri:y(),description:oe(y()),mimeType:oe(y()),size:oe(U()),annotations:An.optional(),_meta:oe(xe({}))}),Qx=$({...vn.shape,...dr.shape,uriTemplate:y(),description:oe(y()),mimeType:oe(y()),annotations:An.optional(),_meta:oe(xe({}))}),e$=hr.extend({method:_("resources/list")}),Wg=fr.extend({resources:C(Vg)}),t$=hr.extend({method:_("resources/templates/list")}),n$=fr.extend({resourceTemplates:C(Qx)}),Xl=Ze.extend({uri:y()}),i$=Xl,r$=ke.extend({method:_("resources/read"),params:i$}),qg=Se.extend({contents:C(H([Bg,Hg]))}),o$=We.extend({method:_("notifications/resources/list_changed"),params:Ve.optional()}),s$=Xl,a$=ke.extend({method:_("resources/subscribe"),params:s$}),c$=Xl,l$=ke.extend({method:_("resources/unsubscribe"),params:c$}),u$=Ve.extend({uri:y()}),d$=We.extend({method:_("notifications/resources/updated"),params:u$}),h$=$({name:y(),description:oe(y()),required:oe(Q())}),f$=$({...vn.shape,...dr.shape,description:oe(y()),arguments:oe(C(h$)),_meta:oe(xe({}))}),m$=hr.extend({method:_("prompts/list")}),p$=fr.extend({prompts:C(f$)}),g$=Ze.extend({name:y(),arguments:J(y(),y()).optional()}),v$=ke.extend({method:_("prompts/get"),params:g$}),Ql=$({type:_("text"),text:y(),annotations:An.optional(),_meta:J(y(),X()).optional()}),eu=$({type:_("image"),data:Yl,mimeType:y(),annotations:An.optional(),_meta:J(y(),X()).optional()}),tu=$({type:_("audio"),data:Yl,mimeType:y(),annotations:An.optional(),_meta:J(y(),X()).optional()}),b$=$({type:_("tool_use"),name:y(),id:y(),input:J(y(),X()),_meta:J(y(),X()).optional()}),Jg=$({type:_("resource"),resource:H([Bg,Hg]),annotations:An.optional(),_meta:J(y(),X()).optional()}),Kg=Vg.extend({type:_("resource_link")}),gr=H([Ql,eu,tu,Kg,Jg]),_$=$({role:pr,content:gr}),y$=Se.extend({description:y().optional(),messages:C(_$)}),x$=We.extend({method:_("notifications/prompts/list_changed"),params:Ve.optional()}),$$=$({title:y().optional(),readOnlyHint:Q().optional(),destructiveHint:Q().optional(),idempotentHint:Q().optional(),openWorldHint:Q().optional()}),k$=$({taskSupport:$e(["required","optional","forbidden"]).optional()}),nu=$({...vn.shape,...dr.shape,description:y().optional(),inputSchema:$({type:_("object"),properties:J(y(),ge).optional(),required:C(y()).optional()}).catchall(X()),outputSchema:$({type:_("object"),properties:J(y(),ge).optional(),required:C(y()).optional()}).catchall(X()).optional(),annotations:$$.optional(),execution:k$.optional(),_meta:J(y(),X()).optional()}),Gg=hr.extend({method:_("tools/list")}),S$=fr.extend({tools:C(nu)}),ws=Se.extend({content:C(gr).default([]),structuredContent:J(y(),X()).optional(),isError:Q().optional()});ws.or(Se.extend({toolResult:X()}));const w$=lr.extend({name:y(),arguments:J(y(),X()).optional()}),Yg=ke.extend({method:_("tools/call"),params:w$}),I$=We.extend({method:_("notifications/tools/list_changed"),params:Ve.optional()});$({autoRefresh:Q().default(!0),debounceMs:U().int().nonnegative().default(300)});const Xg=$e(["debug","info","notice","warning","error","critical","alert","emergency"]),z$=Ze.extend({level:Xg}),P$=ke.extend({method:_("logging/setLevel"),params:z$}),T$=Ve.extend({level:Xg,logger:y().optional(),data:X()}),O$=We.extend({method:_("notifications/message"),params:T$}),D$=$({name:y().optional()}),M$=$({hints:C(D$).optional(),costPriority:U().min(0).max(1).optional(),speedPriority:U().min(0).max(1).optional(),intelligencePriority:U().min(0).max(1).optional()}),E$=$({mode:$e(["auto","required","none"]).optional()}),C$=$({type:_("tool_result"),toolUseId:y().describe("The unique identifier for the corresponding tool call."),content:C(gr).default([]),structuredContent:$({}).loose().optional(),isError:Q().optional(),_meta:J(y(),X()).optional()}),A$=nr("type",[Ql,eu,tu]),io=nr("type",[Ql,eu,tu,b$,C$]),j$=$({role:pr,content:H([io,C(io)]),_meta:J(y(),X()).optional()}),R$=lr.extend({messages:C(j$),modelPreferences:M$.optional(),systemPrompt:y().optional(),includeContext:$e(["none","thisServer","allServers"]).optional(),temperature:U().optional(),maxTokens:U().int(),stopSequences:C(y()).optional(),metadata:ge.optional(),tools:C(nu).optional(),toolChoice:E$.optional()}),N$=ke.extend({method:_("sampling/createMessage"),params:R$}),Qg=Se.extend({model:y(),stopReason:oe($e(["endTurn","stopSequence","maxTokens"]).or(y())),role:pr,content:A$}),ev=Se.extend({model:y(),stopReason:oe($e(["endTurn","stopSequence","maxTokens","toolUse"]).or(y())),role:pr,content:H([io,C(io)])}),U$=$({type:_("boolean"),title:y().optional(),description:y().optional(),default:Q().optional()}),L$=$({type:_("string"),title:y().optional(),description:y().optional(),minLength:U().optional(),maxLength:U().optional(),format:$e(["email","uri","date","date-time"]).optional(),default:y().optional()}),F$=$({type:$e(["number","integer"]),title:y().optional(),description:y().optional(),minimum:U().optional(),maximum:U().optional(),default:U().optional()}),Z$=$({type:_("string"),title:y().optional(),description:y().optional(),enum:C(y()),default:y().optional()}),B$=$({type:_("string"),title:y().optional(),description:y().optional(),oneOf:C($({const:y(),title:y()})),default:y().optional()}),H$=$({type:_("string"),title:y().optional(),description:y().optional(),enum:C(y()),enumNames:C(y()).optional(),default:y().optional()}),V$=H([Z$,B$]),W$=$({type:_("array"),title:y().optional(),description:y().optional(),minItems:U().optional(),maxItems:U().optional(),items:$({type:_("string"),enum:C(y())}),default:C(y()).optional()}),q$=$({type:_("array"),title:y().optional(),description:y().optional(),minItems:U().optional(),maxItems:U().optional(),items:$({anyOf:C($({const:y(),title:y()}))}),default:C(y()).optional()}),J$=H([W$,q$]),K$=H([H$,V$,J$]),G$=H([K$,U$,L$,F$]),Y$=lr.extend({mode:_("form").optional(),message:y(),requestedSchema:$({type:_("object"),properties:J(y(),G$),required:C(y()).optional()})}),X$=lr.extend({mode:_("url"),message:y(),elicitationId:y(),url:y().url()}),Q$=H([Y$,X$]),ek=ke.extend({method:_("elicitation/create"),params:Q$}),tk=Ve.extend({elicitationId:y()}),nk=We.extend({method:_("notifications/elicitation/complete"),params:tk}),ik=Se.extend({action:$e(["accept","decline","cancel"]),content:cr(t=>t===null?void 0:t,J(y(),H([y(),U(),Q(),C(y())])).optional())}),rk=$({type:_("ref/resource"),uri:y()}),ok=$({type:_("ref/prompt"),name:y()}),sk=Ze.extend({ref:H([ok,rk]),argument:$({name:y(),value:y()}),context:$({arguments:J(y(),y()).optional()}).optional()}),ak=ke.extend({method:_("completion/complete"),params:sk}),ck=Se.extend({completion:xe({values:C(y()).max(100),total:oe(U().int()),hasMore:oe(Q())})}),lk=$({uri:y().startsWith("file://"),name:y().optional(),_meta:J(y(),X()).optional()}),uk=ke.extend({method:_("roots/list"),params:Ze.optional()}),dk=Se.extend({roots:C(lk)}),hk=We.extend({method:_("notifications/roots/list_changed"),params:Ve.optional()});H([Ss,Bx,ak,P$,v$,m$,e$,t$,r$,a$,l$,Yg,Gg,Vl,ql,Jl,Gl]);H([Zl,Bl,Wx,hk,no]);H([Fl,Qg,ev,ik,dk,Wl,Kl,Hl]);H([Ss,N$,ek,uk,Vl,ql,Jl,Gl]);H([Zl,Bl,O$,d$,o$,I$,x$,no,nk]);H([Fl,Vx,ck,y$,p$,Wg,n$,qg,ws,S$,Wl,Kl,Hl]);class K extends Error{constructor(e,i,r){super(`MCP error ${e}: ${i}`),this.code=e,this.data=r,this.name="McpError"}static fromError(e,i,r){if(e===ee.UrlElicitationRequired&&r){const n=r;if(n.elicitations)return new fk(n.elicitations,i)}return new K(e,i,r)}}class fk extends K{constructor(e,i=`URL elicitation${e.length>1?"s":""} required`){super(ee.UrlElicitationRequired,i,{elicitations:e})}get elicitations(){var e;return((e=this.data)==null?void 0:e.elicitations)??[]}}function Ot(t){return t==="completed"||t==="failed"||t==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Zu(t){const e=gx(t),i=e==null?void 0:e.method;if(!i)throw new Error("Schema is missing a method literal");const r=vx(i);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function Bu(t,e){const i=Ig(t,e);if(!i.success)throw i.error;return i.data}const mk=6e4;class pk{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Zl,i=>{this._oncancel(i)}),this.setNotificationHandler(Bl,i=>{this._onprogress(i)}),this.setRequestHandler(Ss,i=>({})),this._taskStore=e==null?void 0:e.taskStore,this._taskMessageQueue=e==null?void 0:e.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Vl,async(i,r)=>{const n=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!n)throw new K(ee.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(ql,async(i,r)=>{const n=async()=>{var a;const o=i.params.taskId;if(this._taskMessageQueue){let c;for(;c=await this._taskMessageQueue.dequeue(o,r.sessionId);){if(c.type==="response"||c.type==="error"){const l=c.message,u=l.id,d=this._requestResolvers.get(u);if(d)if(this._requestResolvers.delete(u),c.type==="response")d(l);else{const h=l,f=new K(h.error.code,h.error.message,h.error.data);d(f)}else{const h=c.type==="response"?"Response":"Error";this._onerror(new Error(`${h} handler missing for request ${u}`))}continue}await((a=this._transport)==null?void 0:a.send(c.message,{relatedRequestId:r.requestId}))}}const s=await this._taskStore.getTask(o,r.sessionId);if(!s)throw new K(ee.InvalidParams,`Task not found: ${o}`);if(!Ot(s.status))return await this._waitForTaskUpdate(o,r.signal),await n();if(Ot(s.status)){const c=await this._taskStore.getTaskResult(o,r.sessionId);return this._clearTaskQueue(o),{...c,_meta:{...c._meta,[At]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler(Jl,async(i,r)=>{var n;try{const{tasks:o,nextCursor:s}=await this._taskStore.listTasks((n=i.params)==null?void 0:n.cursor,r.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new K(ee.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(Gl,async(i,r)=>{try{const n=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!n)throw new K(ee.InvalidParams,`Task not found: ${i.params.taskId}`);if(Ot(n.status))throw new K(ee.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(i.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(i.params.taskId);const o=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!o)throw new K(ee.InvalidParams,`Task not found after cancellation: ${i.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof K?n:new K(ee.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(e){if(!e.params.requestId)return;const i=this._requestHandlerAbortControllers.get(e.params.requestId);i==null||i.abort(e.params.reason)}_setupTimeout(e,i,r,n,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(n,i),startTime:Date.now(),timeout:i,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(e){const i=this._timeoutInfo.get(e);if(!i)return!1;const r=Date.now()-i.startTime;if(i.maxTotalTimeout&&r>=i.maxTotalTimeout)throw this._timeoutInfo.delete(e),K.fromError(ee.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:r});return clearTimeout(i.timeoutId),i.timeoutId=setTimeout(i.onTimeout,i.timeout),!0}_cleanupTimeout(e){const i=this._timeoutInfo.get(e);i&&(clearTimeout(i.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var o,s,a;if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=e;const i=(o=this.transport)==null?void 0:o.onclose;this._transport.onclose=()=>{i==null||i(),this._onclose()};const r=(s=this.transport)==null?void 0:s.onerror;this._transport.onerror=c=>{r==null||r(c),this._onerror(c)};const n=(a=this._transport)==null?void 0:a.onmessage;this._transport.onmessage=(c,l)=>{n==null||n(c,l),Sr(c)||Ex(c)?this._onresponse(c):Fu(c)?this._onrequest(c,l):Mx(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var r;const e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(const n of this._timeoutInfo.values())clearTimeout(n.timeoutId);this._timeoutInfo.clear();for(const n of this._requestHandlerAbortControllers.values())n.abort();this._requestHandlerAbortControllers.clear();const i=K.fromError(ee.ConnectionClosed,"Connection closed");this._transport=void 0,(r=this.onclose)==null||r.call(this);for(const n of e.values())n(i)}_onerror(e){var i;(i=this.onerror)==null||i.call(this,e)}_onnotification(e){const i=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;i!==void 0&&Promise.resolve().then(()=>i(e)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(e,i){var u,d,h,f;const r=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,n=this._transport,o=(h=(d=(u=e.params)==null?void 0:u._meta)==null?void 0:d[At])==null?void 0:h.taskId;if(r===void 0){const m={jsonrpc:"2.0",id:e.id,error:{code:ee.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:m,timestamp:Date.now()},n==null?void 0:n.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):n==null||n.send(m).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}const s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);const a=Dx(e.params)?e.params.task:void 0,c=this._taskStore?this.requestTaskStore(e,n==null?void 0:n.sessionId):void 0,l={signal:s.signal,sessionId:n==null?void 0:n.sessionId,_meta:(f=e.params)==null?void 0:f._meta,sendNotification:async m=>{if(s.signal.aborted)return;const p={relatedRequestId:e.id};o&&(p.relatedTask={taskId:o}),await this.notification(m,p)},sendRequest:async(m,p,g)=>{var z;if(s.signal.aborted)throw new K(ee.ConnectionClosed,"Request was cancelled");const v={...g,relatedRequestId:e.id};o&&!v.relatedTask&&(v.relatedTask={taskId:o});const x=((z=v.relatedTask)==null?void 0:z.taskId)??o;return x&&c&&await c.updateTaskStatus(x,"input_required"),await this.request(m,p,v)},authInfo:i==null?void 0:i.authInfo,requestId:e.id,requestInfo:i==null?void 0:i.requestInfo,taskId:o,taskStore:c,taskRequestedTtl:a==null?void 0:a.ttl,closeSSEStream:i==null?void 0:i.closeSSEStream,closeStandaloneSSEStream:i==null?void 0:i.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(e.method)}).then(()=>r(e,l)).then(async m=>{if(s.signal.aborted)return;const p={result:m,jsonrpc:"2.0",id:e.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:p,timestamp:Date.now()},n==null?void 0:n.sessionId):await(n==null?void 0:n.send(p))},async m=>{if(s.signal.aborted)return;const p={jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(m.code)?m.code:ee.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},n==null?void 0:n.sessionId):await(n==null?void 0:n.send(p))}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===s&&this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){const{progressToken:i,...r}=e.params,n=Number(i),o=this._progressHandlers.get(n);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}const s=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(c){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),s(c);return}o(r)}_onresponse(e){const i=Number(e.id),r=this._requestResolvers.get(i);if(r){if(this._requestResolvers.delete(i),Sr(e))r(e);else{const s=new K(e.error.code,e.error.message,e.error.data);r(s)}return}const n=this._responseHandlers.get(i);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(i),this._cleanupTimeout(i);let o=!1;if(Sr(e)&&e.result&&typeof e.result=="object"){const s=e.result;if(s.task&&typeof s.task=="object"){const a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,i))}}if(o||this._progressHandlers.delete(i),Sr(e))n(e);else{const s=K.fromError(e.error.code,e.error.message,e.error.data);n(s)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)==null?void 0:e.close())}async*requestStream(e,i,r){var s,a;const{task:n}=r??{};if(!n){try{yield{type:"result",result:await this.request(e,i,r)}}catch(c){yield{type:"error",error:c instanceof K?c:new K(ee.InternalError,String(c))}}return}let o;try{const c=await this.request(e,Hl,r);if(c.task)o=c.task.taskId,yield{type:"taskCreated",task:c.task};else throw new K(ee.InternalError,"Task creation did not return a task");for(;;){const l=await this.getTask({taskId:o},r);if(yield{type:"taskStatus",task:l},Ot(l.status)){l.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},i,r)}:l.status==="failed"?yield{type:"error",error:new K(ee.InternalError,`Task ${o} failed`)}:l.status==="cancelled"&&(yield{type:"error",error:new K(ee.InternalError,`Task ${o} was cancelled`)});return}if(l.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},i,r)};return}const u=l.pollInterval??((s=this._options)==null?void 0:s.defaultTaskPollInterval)??1e3;await new Promise(d=>setTimeout(d,u)),(a=r==null?void 0:r.signal)==null||a.throwIfAborted()}}catch(c){yield{type:"error",error:c instanceof K?c:new K(ee.InternalError,String(c))}}}request(e,i,r){const{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:c}=r??{};return new Promise((l,u)=>{var x,z,I,k,O;const d=P=>{u(P)};if(!this._transport){d(new Error("Not connected"));return}if(((x=this._options)==null?void 0:x.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(e.method),a&&this.assertTaskCapability(e.method)}catch(P){d(P);return}(z=r==null?void 0:r.signal)==null||z.throwIfAborted();const h=this._requestMessageId++,f={...e,jsonrpc:"2.0",id:h};r!=null&&r.onprogress&&(this._progressHandlers.set(h,r.onprogress),f.params={...e.params,_meta:{...((I=e.params)==null?void 0:I._meta)||{},progressToken:h}}),a&&(f.params={...f.params,task:a}),c&&(f.params={...f.params,_meta:{...((k=f.params)==null?void 0:k._meta)||{},[At]:c}});const m=P=>{var E;this._responseHandlers.delete(h),this._progressHandlers.delete(h),this._cleanupTimeout(h),(E=this._transport)==null||E.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:h,reason:String(P)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(F=>this._onerror(new Error(`Failed to send cancellation: ${F}`)));const D=P instanceof K?P:new K(ee.RequestTimeout,String(P));u(D)};this._responseHandlers.set(h,P=>{var D;if(!((D=r==null?void 0:r.signal)!=null&&D.aborted)){if(P instanceof Error)return u(P);try{const E=Ig(i,P.result);E.success?l(E.data):u(E.error)}catch(E){u(E)}}}),(O=r==null?void 0:r.signal)==null||O.addEventListener("abort",()=>{var P;m((P=r==null?void 0:r.signal)==null?void 0:P.reason)});const p=(r==null?void 0:r.timeout)??mk,g=()=>m(K.fromError(ee.RequestTimeout,"Request timed out",{timeout:p}));this._setupTimeout(h,p,r==null?void 0:r.maxTotalTimeout,g,(r==null?void 0:r.resetTimeoutOnProgress)??!1);const v=c==null?void 0:c.taskId;if(v){const P=D=>{const E=this._responseHandlers.get(h);E?E(D):this._onerror(new Error(`Response handler missing for side-channeled request ${h}`))};this._requestResolvers.set(h,P),this._enqueueTaskMessage(v,{type:"request",message:f,timestamp:Date.now()}).catch(D=>{this._cleanupTimeout(h),u(D)})}else this._transport.send(f,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(P=>{this._cleanupTimeout(h),u(P)})})}async getTask(e,i){return this.request({method:"tasks/get",params:e},Wl,i)}async getTaskResult(e,i,r){return this.request({method:"tasks/result",params:e},i,r)}async listTasks(e,i){return this.request({method:"tasks/list",params:e},Kl,i)}async cancelTask(e,i){return this.request({method:"tasks/cancel",params:e},Xx,i)}async notification(e,i){var a,c,l,u;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(e.method);const r=(a=i==null?void 0:i.relatedTask)==null?void 0:a.taskId;if(r){const d={...e,jsonrpc:"2.0",params:{...e.params,_meta:{...((c=e.params)==null?void 0:c._meta)||{},[At]:i.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:d,timestamp:Date.now()});return}if((((l=this._options)==null?void 0:l.debouncedNotificationMethods)??[]).includes(e.method)&&!e.params&&!(i!=null&&i.relatedRequestId)&&!(i!=null&&i.relatedTask)){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var h,f;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let d={...e,jsonrpc:"2.0"};i!=null&&i.relatedTask&&(d={...d,params:{...d.params,_meta:{...((h=d.params)==null?void 0:h._meta)||{},[At]:i.relatedTask}}}),(f=this._transport)==null||f.send(d,i).catch(m=>this._onerror(m))});return}let s={...e,jsonrpc:"2.0"};i!=null&&i.relatedTask&&(s={...s,params:{...s.params,_meta:{...((u=s.params)==null?void 0:u._meta)||{},[At]:i.relatedTask}}}),await this._transport.send(s,i)}setRequestHandler(e,i){const r=Zu(e);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(n,o)=>{const s=Bu(e,n);return Promise.resolve(i(s,o))})}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,i){const r=Zu(e);this._notificationHandlers.set(r,n=>{const o=Bu(e,n);return Promise.resolve(i(o))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){const i=this._taskProgressTokens.get(e);i!==void 0&&(this._progressHandlers.delete(i),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,i,r){var o;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const n=(o=this._options)==null?void 0:o.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,i,r,n)}async _clearTaskQueue(e,i){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(e,i);for(const n of r)if(n.type==="request"&&Fu(n.message)){const o=n.message.id,s=this._requestResolvers.get(o);s?(s(new K(ee.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,i){var n,o;let r=((n=this._options)==null?void 0:n.defaultTaskPollInterval)??1e3;try{const s=await((o=this._taskStore)==null?void 0:o.getTask(e));s!=null&&s.pollInterval&&(r=s.pollInterval)}catch{}return new Promise((s,a)=>{if(i.aborted){a(new K(ee.InvalidRequest,"Request cancelled"));return}const c=setTimeout(s,r);i.addEventListener("abort",()=>{clearTimeout(c),a(new K(ee.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(e,i){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async n=>{if(!e)throw new Error("No request provided");return await r.createTask(n,e.id,{method:e.method,params:e.params},i)},getTask:async n=>{const o=await r.getTask(n,i);if(!o)throw new K(ee.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,s)=>{await r.storeTaskResult(n,o,s,i);const a=await r.getTask(n,i);if(a){const c=no.parse({method:"notifications/tasks/status",params:a});await this.notification(c),Ot(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>r.getTaskResult(n,i),updateTaskStatus:async(n,o,s)=>{const a=await r.getTask(n,i);if(!a)throw new K(ee.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(Ot(a.status))throw new K(ee.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(n,o,s,i);const c=await r.getTask(n,i);if(c){const l=no.parse({method:"notifications/tasks/status",params:c});await this.notification(l),Ot(c.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>r.listTasks(n,i)}}}function Hu(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function gk(t,e){const i={...t};for(const r in e){const n=r,o=e[n];if(o===void 0)continue;const s=i[n];Hu(s)&&Hu(o)?i[n]={...s,...o}:i[n]=o}return i}(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});class vk extends pk{constructor(){super(...arguments);w(this,"_registeredMethods",new Set);w(this,"_eventSlots",new Map);w(this,"setRequestHandler",(i,r)=>{this._assertMethodNotRegistered(i,"setRequestHandler"),super.setRequestHandler(i,r)});w(this,"setNotificationHandler",(i,r)=>{this._assertMethodNotRegistered(i,"setNotificationHandler"),super.setNotificationHandler(i,r)});w(this,"replaceRequestHandler",(i,r)=>{let n=i.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(i,r)})}onEventDispatch(i,r){}_ensureEventSlot(i){let r=this._eventSlots.get(i);if(!r){let n=this.eventSchemas[i];if(!n)throw Error(`Unknown event: ${String(i)}`);r={listeners:[]},this._eventSlots.set(i,r);let o=n.shape.method.value;this._registeredMethods.add(o);let s=r;super.setNotificationHandler(n,a=>{var l;let c=a.params;this.onEventDispatch(i,c),(l=s.onHandler)==null||l.call(s,c);for(let u of[...s.listeners])u(c)})}return r}setEventHandler(i,r){let n=this._ensureEventSlot(i);n.onHandler&&r&&console.warn(`[MCP Apps] on${String(i)} handler replaced. Use addEventListener("${String(i)}", …) to add multiple listeners without replacing.`),n.onHandler=r}getEventHandler(i){var r;return(r=this._eventSlots.get(i))==null?void 0:r.onHandler}addEventListener(i,r){this._ensureEventSlot(i).listeners.push(r)}removeEventListener(i,r){let n=this._eventSlots.get(i);if(!n)return;let o=n.listeners.indexOf(r);o!==-1&&n.listeners.splice(o,1)}warnIfRequestHandlerReplaced(i,r,n){r&&n&&console.warn(`[MCP Apps] ${i} handler replaced. Previous handler will no longer be called.`)}_assertMethodNotRegistered(i,r){let n=i.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${r}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}}var bk="2026-01-26",_k="ui/notifications/tool-input-partial";class yk{constructor(e=window.parent,i){w(this,"eventTarget");w(this,"eventSource");w(this,"messageListener");w(this,"onclose");w(this,"onerror");w(this,"onmessage");w(this,"sessionId");w(this,"setProtocolVersion");this.eventTarget=e,this.eventSource=i,this.messageListener=r=>{var o,s,a;if(i&&r.source!==this.eventSource){console.debug("Ignoring message from unknown source",r);return}let n=Cx.safeParse(r.data);n.success?(console.debug("Parsed message",n.data),(o=this.onmessage)==null||o.call(this,n.data)):((s=r.data)==null?void 0:s.jsonrpc)!=="2.0"?console.debug("Ignoring non-JSON-RPC message",n.error.message,r):(console.error("Failed to parse message",n.error.message,r),(a=this.onerror)==null||a.call(this,Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(e,i){e.method!==_k&&console.debug("Sending message",e),this.eventTarget.postMessage(e,"*")}async close(){var e;window.removeEventListener("message",this.messageListener),(e=this.onclose)==null||e.call(this)}}var xk=H([_("light"),_("dark")]).describe("Color theme preference for the host environment."),ri=H([_("inline"),_("fullscreen"),_("pip")]).describe("Display mode for UI presentation."),$k=H([_("--color-background-primary"),_("--color-background-secondary"),_("--color-background-tertiary"),_("--color-background-inverse"),_("--color-background-ghost"),_("--color-background-info"),_("--color-background-danger"),_("--color-background-success"),_("--color-background-warning"),_("--color-background-disabled"),_("--color-text-primary"),_("--color-text-secondary"),_("--color-text-tertiary"),_("--color-text-inverse"),_("--color-text-ghost"),_("--color-text-info"),_("--color-text-danger"),_("--color-text-success"),_("--color-text-warning"),_("--color-text-disabled"),_("--color-border-primary"),_("--color-border-secondary"),_("--color-border-tertiary"),_("--color-border-inverse"),_("--color-border-ghost"),_("--color-border-info"),_("--color-border-danger"),_("--color-border-success"),_("--color-border-warning"),_("--color-border-disabled"),_("--color-ring-primary"),_("--color-ring-secondary"),_("--color-ring-inverse"),_("--color-ring-info"),_("--color-ring-danger"),_("--color-ring-success"),_("--color-ring-warning"),_("--font-sans"),_("--font-mono"),_("--font-weight-normal"),_("--font-weight-medium"),_("--font-weight-semibold"),_("--font-weight-bold"),_("--font-text-xs-size"),_("--font-text-sm-size"),_("--font-text-md-size"),_("--font-text-lg-size"),_("--font-heading-xs-size"),_("--font-heading-sm-size"),_("--font-heading-md-size"),_("--font-heading-lg-size"),_("--font-heading-xl-size"),_("--font-heading-2xl-size"),_("--font-heading-3xl-size"),_("--font-text-xs-line-height"),_("--font-text-sm-line-height"),_("--font-text-md-line-height"),_("--font-text-lg-line-height"),_("--font-heading-xs-line-height"),_("--font-heading-sm-line-height"),_("--font-heading-md-line-height"),_("--font-heading-lg-line-height"),_("--font-heading-xl-line-height"),_("--font-heading-2xl-line-height"),_("--font-heading-3xl-line-height"),_("--border-radius-xs"),_("--border-radius-sm"),_("--border-radius-md"),_("--border-radius-lg"),_("--border-radius-xl"),_("--border-radius-full"),_("--border-width-regular"),_("--shadow-hairline"),_("--shadow-sm"),_("--shadow-md"),_("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),kk=J($k.describe(`Style variables for theming MCP apps.
|
|
47
48
|
|
|
48
49
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
49
50
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
50
51
|
|
|
51
52
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
52
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),
|
|
53
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),H([y(),fn()]).describe(`Style variables for theming MCP apps.
|
|
53
54
|
|
|
54
55
|
Individual style keys are optional - hosts may provide any subset of these values.
|
|
55
56
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
@@ -61,10 +62,10 @@ Individual style keys are optional - hosts may provide any subset of these value
|
|
|
61
62
|
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
|
|
62
63
|
|
|
63
64
|
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
|
|
64
|
-
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)
|
|
65
|
+
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);$({method:_("ui/open-link"),params:$({url:y().describe("URL to open in the host's browser")})});var Sk=$({isError:Q().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),wk=$({isError:Q().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),Ik=$({isError:Q().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();$({method:_("ui/notifications/sandbox-proxy-ready"),params:$({})});var iu=$({connectDomains:C(y()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
|
|
65
66
|
|
|
66
67
|
- Maps to CSP \`connect-src\` directive
|
|
67
|
-
- Empty or omitted → no network connections (secure default)`),resourceDomains:
|
|
68
|
+
- Empty or omitted → no network connections (secure default)`),resourceDomains:C(y()).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:C(y()).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:C(y()).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'`)")}),ru=$({camera:$({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:$({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:$({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:$({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")});$({method:_("ui/notifications/size-changed"),params:$({width:U().optional().describe("New width in pixels."),height:U().optional().describe("New height in pixels.")})});var zk=$({method:_("ui/notifications/tool-input"),params:$({arguments:J(y(),X().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),Pk=$({method:_("ui/notifications/tool-input-partial"),params:$({arguments:J(y(),X().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),Tk=$({method:_("ui/notifications/tool-cancelled"),params:$({reason:y().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),Ok=$({fonts:y().optional()}),Dk=$({variables:kk.optional().describe("CSS variables for theming the app."),css:Ok.optional().describe("CSS blocks that apps can inject.")}),Mk=$({method:_("ui/resource-teardown"),params:$({})});J(y(),X());var Vu=$({text:$({}).optional().describe("Host supports text content blocks."),image:$({}).optional().describe("Host supports image content blocks."),audio:$({}).optional().describe("Host supports audio content blocks."),resource:$({}).optional().describe("Host supports resource content blocks."),resourceLink:$({}).optional().describe("Host supports resource link content blocks."),structuredContent:$({}).optional().describe("Host supports structured content.")});$({method:_("ui/notifications/request-teardown"),params:$({}).optional()});var Ek=$({experimental:$({}).optional().describe("Experimental features (structure TBD)."),openLinks:$({}).optional().describe("Host supports opening external URLs."),downloadFile:$({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:$({listChanged:Q().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:$({listChanged:Q().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:$({}).optional().describe("Host accepts log messages."),sandbox:$({permissions:ru.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:iu.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Vu.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Vu.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:$({tools:$({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Ck=$({experimental:$({}).optional().describe("Experimental features (structure TBD)."),tools:$({listChanged:Q().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:C(ri).optional().describe("Display modes the app supports.")});$({method:_("ui/notifications/initialized"),params:$({}).optional()});$({csp:iu.optional().describe("Content Security Policy configuration for UI resources."),permissions:ru.optional().describe("Sandbox permissions requested by the UI resource."),domain:y().optional().describe(`Dedicated origin for view sandbox.
|
|
68
69
|
|
|
69
70
|
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
|
|
70
71
|
|
|
@@ -72,33 +73,33 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
|
|
|
72
73
|
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
|
|
73
74
|
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
|
|
74
75
|
|
|
75
|
-
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:
|
|
76
|
+
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Q().optional().describe(`Visual boundary preference - true if view prefers a visible border.
|
|
76
77
|
|
|
77
78
|
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.
|
|
78
79
|
|
|
79
80
|
- \`true\`: request visible border + background
|
|
80
81
|
- \`false\`: request no visible border + background
|
|
81
|
-
- omitted: host decides border`)})
|
|
82
|
+
- omitted: host decides border`)});$({method:_("ui/request-display-mode"),params:$({mode:ri.describe("The display mode being requested.")})});var Ak=$({mode:ri.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),jk=H([_("model"),_("app")]).describe("Tool visibility scope - who can access the tool.");$({resourceUri:y().optional(),visibility:C(jk).optional().describe(`Who can access this tool. Default: ["model", "app"]
|
|
82
83
|
- "model": Tool visible to and callable by the agent
|
|
83
|
-
- "app": Tool callable by the app from this server only`)})
|
|
84
|
-
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:y().optional().describe("User's language and region preference in BCP 47 format."),timeZone:y().optional().describe("User's timezone in IANA format."),userAgent:y().optional().describe("Host application identifier."),platform:F([_("web"),_("desktop"),_("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:v({touch:X().optional().describe("Whether the device supports touch input."),hover:X().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:v({top:L().describe("Top safe area inset in pixels."),right:L().describe("Right safe area inset in pixels."),bottom:L().describe("Bottom safe area inset in pixels."),left:L().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),hm=v({method:_("ui/notifications/host-context-changed"),params:rc.describe("Partial context update containing only changed fields.")});v({method:_("ui/update-model-context"),params:v({content:I(Cn).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:W(y(),J().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});v({method:_("ui/initialize"),params:v({appInfo:Ps.describe("App identification (name and version)."),appCapabilities:am.describe("Features and capabilities this app provides."),protocolVersion:y().describe("Protocol version this app supports.")})});var dm=v({protocolVersion:y().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ps.describe("Host application identification and version."),hostCapabilities:rm.describe("Features and capabilities provided by the host."),hostContext:rc.describe("Rich context about the host environment.")}).passthrough();class fm extends Vg{constructor(n,s={},i={autoResize:!0}){super(i);P(this,"_appInfo");P(this,"_capabilities");P(this,"options");P(this,"_hostCapabilities");P(this,"_hostInfo");P(this,"_hostContext");P(this,"eventSchemas",{toolinput:tm,toolinputpartial:em,toolresult:um,toolcancelled:nm,hostcontextchanged:hm});P(this,"_onteardown");P(this,"_oncalltool");P(this,"_onlisttools");P(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=s,this.options=i,this.setRequestHandler(Ts,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}onEventDispatch(n,s){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...s})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(om,(s,i)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(s.params,i)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(sc,(s,i)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(s.params,i)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(nc,(s,i)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(s.params,i)})}assertCapabilityForMethod(n){}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,s){if(typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},Cs,s)}async readServerResource(n,s){return await this.request({method:"resources/read",params:n},Qa,s)}async listServerResources(n,s){return await this.request({method:"resources/list",params:n},Ga,s)}sendMessage(n,s){return this.request({method:"ui/message",params:n},Qg,s)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,s){return this.request({method:"ui/update-model-context",params:n},zi,s)}openLink(n,s){return this.request({method:"ui/open-link",params:n},Xg,s)}downloadFile(n,s){return this.request({method:"ui/download-file",params:n},Gg,s)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,s){return this.request({method:"ui/request-display-mode",params:n},cm,s)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,s=0,i=0,o=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let a=document.documentElement,c=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=c;let u=Math.ceil(window.innerWidth);(u!==s||l!==i)&&(s=u,i=l,this.sendSizeChanged({width:u,height:l}))}))};o();let r=new ResizeObserver(o);return r.observe(document.documentElement),r.observe(document.body),()=>r.disconnect()}async connect(n=new Ug(window.parent,window.parent),s){var i;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect(n);try{let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:Wg}},dm,s);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),(i=this.options)!=null&&i.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}/*!
|
|
84
|
+
- "app": Tool callable by the app from this server only`),csp:Vt().optional(),permissions:Vt().optional()});$({mimeTypes:C(y()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});$({method:_("ui/download-file"),params:$({contents:C(H([Jg,Kg])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});$({method:_("ui/message"),params:$({role:_("user").describe('Message role, currently only "user" is supported.'),content:C(gr).describe("Message content blocks (text, image, etc.).")})});$({method:_("ui/notifications/sandbox-resource-ready"),params:$({html:y().describe("HTML content to load into the inner iframe."),sandbox:y().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:iu.optional().describe("CSP configuration from resource metadata."),permissions:ru.optional().describe("Sandbox permissions from resource metadata.")})});var Rk=$({method:_("ui/notifications/tool-result"),params:ws.describe("Standard MCP tool execution result.")}),tv=$({toolInfo:$({id:ur.optional().describe("JSON-RPC id of the tools/call request."),tool:nu.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:xk.optional().describe("Current color theme preference."),styles:Dk.optional().describe("Style configuration for theming the app."),displayMode:ri.optional().describe("How the UI is currently displayed."),availableDisplayModes:C(ri).optional().describe("Display modes the host supports."),containerDimensions:H([$({height:U().describe("Fixed container height in pixels.")}),$({maxHeight:H([U(),fn()]).optional().describe("Maximum container height in pixels.")})]).and(H([$({width:U().describe("Fixed container width in pixels.")}),$({maxWidth:H([U(),fn()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
|
|
85
|
+
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:y().optional().describe("User's language and region preference in BCP 47 format."),timeZone:y().optional().describe("User's timezone in IANA format."),userAgent:y().optional().describe("Host application identifier."),platform:H([_("web"),_("desktop"),_("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:$({touch:Q().optional().describe("Whether the device supports touch input."),hover:Q().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:$({top:U().describe("Top safe area inset in pixels."),right:U().describe("Right safe area inset in pixels."),bottom:U().describe("Bottom safe area inset in pixels."),left:U().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Nk=$({method:_("ui/notifications/host-context-changed"),params:tv.describe("Partial context update containing only changed fields.")});$({method:_("ui/update-model-context"),params:$({content:C(gr).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:J(y(),X().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});$({method:_("ui/initialize"),params:$({appInfo:ks.describe("App identification (name and version)."),appCapabilities:Ck.describe("Features and capabilities this app provides."),protocolVersion:y().describe("Protocol version this app supports.")})});var Uk=$({protocolVersion:y().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:ks.describe("Host application identification and version."),hostCapabilities:Ek.describe("Features and capabilities provided by the host."),hostContext:tv.describe("Rich context about the host environment.")}).passthrough(),Lk={target:"draft-2020-12"};async function Wu(t,e){let i=t["~standard"];if(i.jsonSchema)return i.jsonSchema[e](Lk);if(i.vendor==="zod"){let{z:r}=await ab(()=>Promise.resolve().then(()=>Px),void 0,import.meta.url);return r.toJSONSchema(t,{io:e})}throw Error(`Schema (vendor: ${i.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function qu(t,e,i=""){let r=await t["~standard"].validate(e);if(r.issues){let n=r.issues.map(o=>{var a;let s=(a=o.path)==null?void 0:a.map(c=>typeof c=="object"?c.key:c).join(".");return s?`${s}: ${o.message}`:o.message}).join("; ");throw Error(i+n)}return r.value}const mo=class mo extends vk{constructor(i,r={},n={autoResize:!0}){super(n);w(this,"_appInfo");w(this,"_capabilities");w(this,"options");w(this,"_hostCapabilities");w(this,"_hostInfo");w(this,"_hostContext");w(this,"_registeredTools",{});w(this,"_initializedSent",!1);w(this,"eventSchemas",{toolinput:zk,toolinputpartial:Pk,toolresult:Rk,toolcancelled:Tk,hostcontextchanged:Nk});w(this,"_everHadListener",new Set);w(this,"_toolHandlersInitialized",!1);w(this,"_onteardown");w(this,"_oncalltool");w(this,"_onlisttools");w(this,"sendOpenLink",this.openLink);this._appInfo=i,this._capabilities=r,this.options=n,n.allowUnsafeEval||_e({jitless:!0}),this.setRequestHandler(Ss,o=>(console.log("Received ping:",o.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(i){var n;if(this._initializedSent)return;let r=`[ext-apps] App.${i}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if((n=this.options)!=null&&n.strict)throw Error(r);console.warn(`${r}. This will throw in a future release.`)}_assertHandlerTiming(i){var n;if(!mo.ONE_SHOT_EVENTS.has(i)||this._everHadListener.has(i)||(this._everHadListener.add(i),!this._initializedSent))return;let r=`[ext-apps] "${String(i)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if((n=this.options)!=null&&n.strict)throw Error(r);console.warn(r)}setEventHandler(i,r){r&&this._assertHandlerTiming(i),super.setEventHandler(i,r)}addEventListener(i,r){this._assertHandlerTiming(i),super.addEventListener(i,r)}onEventDispatch(i,r){i==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...r})}registerCapabilities(i){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=gk(this._capabilities,i)}registerTool(i,r,n){if(this._registeredTools[i])throw Error(`Tool ${i} is already registered`);let o=this,s=()=>{var l;o._initializedSent&&((l=o._capabilities.tools)!=null&&l.listChanged)&&o.sendToolListChanged()},a=r.inputSchema!==void 0,c={title:r.title,description:r.description,inputSchema:r.inputSchema,outputSchema:r.outputSchema,annotations:r.annotations,_meta:r._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(l){Object.assign(this,l),s()},remove(){o._registeredTools[i]===c&&(delete o._registeredTools[i],s())},handler:async(l,u)=>{if(!c.enabled)throw Error(`Tool ${i} is disabled`);let d;if(a){let h=c.inputSchema,f=h?await qu(h,l??{},`Invalid input for tool ${i}: `):l??{};d=await n(f,u)}else d=await n(u);return c.outputSchema&&!d.isError&&(d.structuredContent=await qu(c.outputSchema,d.structuredContent,`Invalid output for tool ${i}: `)),d}};return this._registeredTools[i]=c,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),c}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(i,r)=>{let n=this._registeredTools[i.name];if(!n)throw Error(`Tool ${i.name} not found`);return n.handler(i.arguments,r)},this.onlisttools=async(i,r)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([n,o])=>o.enabled).map(async([n,o])=>{let s={name:n,title:o.title,description:o.description,inputSchema:o.inputSchema?await Wu(o.inputSchema,"input"):{type:"object",properties:{}}};return o.outputSchema&&(s.outputSchema=await Wu(o.outputSchema,"output")),o.annotations&&(s.annotations=o.annotations),o._meta&&(s._meta=o._meta),s}))}))}async sendToolListChanged(i={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:i})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(i){this.setEventHandler("toolinput",i)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(i){this.setEventHandler("toolinputpartial",i)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(i){this.setEventHandler("toolresult",i)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(i){this.setEventHandler("toolcancelled",i)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(i){this.setEventHandler("hostcontextchanged",i)}get onteardown(){return this._onteardown}set onteardown(i){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,i),this._onteardown=i,this.replaceRequestHandler(Mk,(r,n)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(r.params,n)})}get oncalltool(){return this._oncalltool}set oncalltool(i){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,i),this._oncalltool=i,this.replaceRequestHandler(Yg,(r,n)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(r.params,n)})}get onlisttools(){return this._onlisttools}set onlisttools(i){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,i),this._onlisttools=i,this.replaceRequestHandler(Gg,(r,n)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(r.params,n)})}assertCapabilityForMethod(i){var r;switch(i){case"sampling/createMessage":if(!((r=this._hostCapabilities)!=null&&r.sampling))throw Error(`Host does not support sampling (required for ${i})`);break}}assertRequestHandlerCapability(i){switch(i){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${i})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${i} registered`)}}assertNotificationCapability(i){}assertTaskCapability(i){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(i){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(i,r){if(this._assertInitialized("callServerTool"),typeof i=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${i}"). Did you mean: callServerTool({ name: "${i}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:i},ws,{onprogress:()=>{},resetTimeoutOnProgress:!0,...r})}async readServerResource(i,r){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:i},qg,r)}async listServerResources(i,r){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:i},Wg,r)}async createSamplingMessage(i,r){this._assertInitialized("createSamplingMessage");let n=i.tools?ev:Qg;return await this.request({method:"sampling/createMessage",params:i},n,r)}sendMessage(i,r){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:i},Ik,r)}sendLog(i){return this.notification({method:"notifications/message",params:i})}updateModelContext(i,r){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:i},Fl,r)}openLink(i,r){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:i},Sk,r)}downloadFile(i,r){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:i},wk,r)}requestTeardown(i={}){return this.notification({method:"ui/notifications/request-teardown",params:i})}requestDisplayMode(i,r){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:i},Ak,r)}sendSizeChanged(i){return this.notification({method:"ui/notifications/size-changed",params:i})}setupSizeChangedNotifications(){let i=!1,r=0,n=0,o=()=>{i||(i=!0,requestAnimationFrame(()=>{i=!1;let a=document.documentElement,c=a.style.height;a.style.height="max-content";let l=Math.ceil(a.getBoundingClientRect().height);a.style.height=c;let u=Math.ceil(window.innerWidth);(u!==r||l!==n)&&(r=u,n=l,this.sendSizeChanged({width:u,height:l}))}))};o();let s=new ResizeObserver(o);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(i=new yk(window.parent,window.parent),r){var n;if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(i);try{let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:bk}},Uk,r);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,(n=this.options)!=null&&n.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}};w(mo,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));let Qs=mo;/*!
|
|
85
86
|
* @kurkle/color v0.3.4
|
|
86
87
|
* https://github.com/kurkle/color#readme
|
|
87
88
|
* (c) 2024 Jukka Kurkela
|
|
88
89
|
* Released under the MIT License
|
|
89
|
-
*/function
|
|
90
|
+
*/function vr(t){return t+.5|0}const gt=(t,e,i)=>Math.max(Math.min(t,i),e);function Vn(t){return gt(vr(t*2.55),0,255)}function xt(t){return gt(vr(t*255),0,255)}function at(t){return gt(vr(t/2.55)/100,0,1)}function Ju(t){return gt(vr(t*100),0,100)}const Be={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ea=[..."0123456789ABCDEF"],Fk=t=>ea[t&15],Zk=t=>ea[(t&240)>>4]+ea[t&15],wr=t=>(t&240)>>4===(t&15),Bk=t=>wr(t.r)&&wr(t.g)&&wr(t.b)&&wr(t.a);function Hk(t){var e=t.length,i;return t[0]==="#"&&(e===4||e===5?i={r:255&Be[t[1]]*17,g:255&Be[t[2]]*17,b:255&Be[t[3]]*17,a:e===5?Be[t[4]]*17:255}:(e===7||e===9)&&(i={r:Be[t[1]]<<4|Be[t[2]],g:Be[t[3]]<<4|Be[t[4]],b:Be[t[5]]<<4|Be[t[6]],a:e===9?Be[t[7]]<<4|Be[t[8]]:255})),i}const Vk=(t,e)=>t<255?e(t):"";function Wk(t){var e=Bk(t)?Fk:Zk;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Vk(t.a,e):void 0}const qk=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function nv(t,e,i){const r=e*Math.min(i,1-i),n=(o,s=(o+t/30)%12)=>i-r*Math.max(Math.min(s-3,9-s,1),-1);return[n(0),n(8),n(4)]}function Jk(t,e,i){const r=(n,o=(n+t/60)%6)=>i-i*e*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function Kk(t,e,i){const r=nv(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)r[n]*=1-e-i,r[n]+=e;return r}function Gk(t,e,i,r,n){return t===n?(e-i)/r+(e<i?6:0):e===n?(i-t)/r+2:(t-e)/r+4}function ou(t){const i=t.r/255,r=t.g/255,n=t.b/255,o=Math.max(i,r,n),s=Math.min(i,r,n),a=(o+s)/2;let c,l,u;return o!==s&&(u=o-s,l=a>.5?u/(2-o-s):u/(o+s),c=Gk(i,r,n,u,o),c=c*60+.5),[c|0,l||0,a]}function su(t,e,i,r){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,r)).map(xt)}function au(t,e,i){return su(nv,t,e,i)}function Yk(t,e,i){return su(Kk,t,e,i)}function Xk(t,e,i){return su(Jk,t,e,i)}function iv(t){return(t%360+360)%360}function Qk(t){const e=qk.exec(t);let i=255,r;if(!e)return;e[5]!==r&&(i=e[6]?Vn(+e[5]):xt(+e[5]));const n=iv(+e[2]),o=+e[3]/100,s=+e[4]/100;return e[1]==="hwb"?r=Yk(n,o,s):e[1]==="hsv"?r=Xk(n,o,s):r=au(n,o,s),{r:r[0],g:r[1],b:r[2],a:i}}function eS(t,e){var i=ou(t);i[0]=iv(i[0]+e),i=au(i),t.r=i[0],t.g=i[1],t.b=i[2]}function tS(t){if(!t)return;const e=ou(t),i=e[0],r=Ju(e[1]),n=Ju(e[2]);return t.a<255?`hsla(${i}, ${r}%, ${n}%, ${at(t.a)})`:`hsl(${i}, ${r}%, ${n}%)`}const Ku={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Gu={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function nS(){const t={},e=Object.keys(Gu),i=Object.keys(Ku);let r,n,o,s,a;for(r=0;r<e.length;r++){for(s=a=e[r],n=0;n<i.length;n++)o=i[n],a=a.replace(o,Ku[o]);o=parseInt(Gu[s],16),t[a]=[o>>16&255,o>>8&255,o&255]}return t}let Ir;function iS(t){Ir||(Ir=nS(),Ir.transparent=[0,0,0,0]);const e=Ir[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const rS=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oS(t){const e=rS.exec(t);let i=255,r,n,o;if(e){if(e[7]!==r){const s=+e[7];i=e[8]?Vn(s):gt(s*255,0,255)}return r=+e[1],n=+e[3],o=+e[5],r=255&(e[2]?Vn(r):gt(r,0,255)),n=255&(e[4]?Vn(n):gt(n,0,255)),o=255&(e[6]?Vn(o):gt(o,0,255)),{r,g:n,b:o,a:i}}}function sS(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${at(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Es=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,nn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function aS(t,e,i){const r=nn(at(t.r)),n=nn(at(t.g)),o=nn(at(t.b));return{r:xt(Es(r+i*(nn(at(e.r))-r))),g:xt(Es(n+i*(nn(at(e.g))-n))),b:xt(Es(o+i*(nn(at(e.b))-o))),a:t.a+i*(e.a-t.a)}}function zr(t,e,i){if(t){let r=ou(t);r[e]=Math.max(0,Math.min(r[e]+r[e]*i,e===0?360:1)),r=au(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function rv(t,e){return t&&Object.assign(e||{},t)}function Yu(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=xt(t[3]))):(e=rv(t,{r:0,g:0,b:0,a:1}),e.a=xt(e.a)),e}function cS(t){return t.charAt(0)==="r"?oS(t):Qk(t)}class oi{constructor(e){if(e instanceof oi)return e;const i=typeof e;let r;i==="object"?r=Yu(e):i==="string"&&(r=Hk(e)||iS(e)||cS(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=rv(this._rgb);return e&&(e.a=at(e.a)),e}set rgb(e){this._rgb=Yu(e)}rgbString(){return this._valid?sS(this._rgb):void 0}hexString(){return this._valid?Wk(this._rgb):void 0}hslString(){return this._valid?tS(this._rgb):void 0}mix(e,i){if(e){const r=this.rgb,n=e.rgb;let o;const s=i===o?.5:i,a=2*s-1,c=r.a-n.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,r.r=255&l*r.r+o*n.r+.5,r.g=255&l*r.g+o*n.g+.5,r.b=255&l*r.b+o*n.b+.5,r.a=s*r.a+(1-s)*n.a,this.rgb=r}return this}interpolate(e,i){return e&&(this._rgb=aS(this._rgb,e._rgb,i)),this}clone(){return new oi(this.rgb)}alpha(e){return this._rgb.a=xt(e),this}clearer(e){const i=this._rgb;return i.a*=1-e,this}greyscale(){const e=this._rgb,i=vr(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=i,this}opaquer(e){const i=this._rgb;return i.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return zr(this._rgb,2,e),this}darken(e){return zr(this._rgb,2,-e),this}saturate(e){return zr(this._rgb,1,e),this}desaturate(e){return zr(this._rgb,1,-e),this}rotate(e){return eS(this._rgb,e),this}}/*!
|
|
90
91
|
* Chart.js v4.5.1
|
|
91
92
|
* https://www.chartjs.org
|
|
92
93
|
* (c) 2025 Chart.js Contributors
|
|
93
94
|
* Released under the MIT License
|
|
94
|
-
*/function Bt(){}const Lm=(()=>{let e=0;return()=>e++})();function N(e){return e==null}function nt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function $(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function at(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Ct(e,t){return at(e)?e:t}function E(e,t){return typeof e>"u"?t:e}const Nm=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,uc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function K(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function U(e,t,n,s){let i,o,r;if(nt(e))for(o=e.length,i=0;i<o;i++)t.call(n,e[i],i);else if($(e))for(r=Object.keys(e),o=r.length,i=0;i<o;i++)t.call(n,e[r[i]],r[i])}function ds(e,t){let n,s,i,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,s=e.length;n<s;++n)if(i=e[n],o=t[n],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function fs(e){if(nt(e))return e.map(fs);if($(e)){const t=Object.create(null),n=Object.keys(e),s=n.length;let i=0;for(;i<s;++i)t[n[i]]=fs(e[n[i]]);return t}return e}function hc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function $m(e,t,n,s){if(!hc(e))return;const i=t[e],o=n[e];$(i)&&$(o)?fn(i,o,s):t[e]=fs(o)}function fn(e,t,n){const s=nt(t)?t:[t],i=s.length;if(!$(e))return e;n=n||{};const o=n.merger||$m;let r;for(let a=0;a<i;++a){if(r=s[a],!$(r))continue;const c=Object.keys(r);for(let l=0,u=c.length;l<u;++l)o(c[l],e,r,n)}return e}function sn(e,t){return fn(e,t,{merger:Fm})}function Fm(e,t,n){if(!hc(e))return;const s=t[e],i=n[e];$(s)&&$(i)?sn(s,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=fs(i))}const Fo={"":e=>e,x:e=>e.x,y:e=>e.y};function Hm(e){const t=e.split("."),n=[];let s="";for(const i of t)s+=i,s.endsWith("\\")?s=s.slice(0,-1)+".":(n.push(s),s="");return n}function jm(e){const t=Hm(e);return n=>{for(const s of t){if(s==="")break;n=n&&n[s]}return n}}function ie(e,t){return(Fo[t]||(Fo[t]=jm(t)))(e)}function Gi(e){return e.charAt(0).toUpperCase()+e.slice(1)}const pn=e=>typeof e<"u",oe=e=>typeof e=="function",Ho=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Bm(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Z=Math.PI,G=2*Z,Zm=G+Z,ps=Number.POSITIVE_INFINITY,Vm=Z/180,lt=Z/2,de=Z/4,jo=Z*2/3,Xt=Math.log10,jt=Math.sign;function on(e,t,n){return Math.abs(e-t)<n}function Bo(e){const t=Math.round(e);e=on(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Xt(e))),s=e/n;return(s<=1?1:s<=2?2:s<=5?5:10)*n}function Wm(e){const t=[],n=Math.sqrt(e);let s;for(s=1;s<n;s++)e%s===0&&(t.push(s),t.push(e/s));return n===(n|0)&&t.push(n),t.sort((i,o)=>i-o).pop(),t}function qm(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ne(e){return!qm(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Um(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function dc(e,t,n){let s,i,o;for(s=0,i=e.length;s<i;s++)o=e[s][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Lt(e){return e*(Z/180)}function Qi(e){return e*(180/Z)}function Zo(e){if(!at(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function fc(e,t){const n=t.x-e.x,s=t.y-e.y,i=Math.sqrt(n*n+s*s);let o=Math.atan2(s,n);return o<-.5*Z&&(o+=G),{angle:o,distance:i}}function oi(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Ym(e,t){return(e-t+Zm)%G-Z}function yt(e){return(e%G+G)%G}function gn(e,t,n,s){const i=yt(e),o=yt(t),r=yt(n),a=yt(o-i),c=yt(r-i),l=yt(i-o),u=yt(i-r);return i===o||i===r||s&&o===r||a>c&&l<u}function ft(e,t,n){return Math.max(t,Math.min(n,e))}function Jm(e){return ft(e,-32768,32767)}function Ut(e,t,n,s=1e-6){return e>=Math.min(t,n)-s&&e<=Math.max(t,n)+s}function to(e,t,n){n=n||(r=>e[r]<t);let s=e.length-1,i=0,o;for(;s-i>1;)o=i+s>>1,n(o)?i=o:s=o;return{lo:i,hi:s}}const Yt=(e,t,n,s)=>to(e,n,s?i=>{const o=e[i][t];return o<n||o===n&&e[i+1][t]===n}:i=>e[i][t]<n),Km=(e,t,n)=>to(e,n,s=>e[s][t]>=n);function Xm(e,t,n){let s=0,i=e.length;for(;s<i&&e[s]<t;)s++;for(;i>s&&e[i-1]>n;)i--;return s>0||i<e.length?e.slice(s,i):e}const pc=["push","pop","shift","splice","unshift"];function Gm(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),pc.forEach(n=>{const s="_onData"+Gi(n),i=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const r=i.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function Vo(e,t){const n=e._chartjs;if(!n)return;const s=n.listeners,i=s.indexOf(t);i!==-1&&s.splice(i,1),!(s.length>0)&&(pc.forEach(o=>{delete e[o]}),delete e._chartjs)}function gc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const mc=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function bc(e,t){let n=[],s=!1;return function(...i){n=i,s||(s=!0,mc.call(window,()=>{s=!1,e.apply(t,n)}))}}function Qm(e,t){let n;return function(...s){return t?(clearTimeout(n),n=setTimeout(e,t,s)):e.apply(this,s),t}}const eo=e=>e==="start"?"left":e==="end"?"right":"center",_t=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,tb=(e,t,n,s)=>e===(s?"left":"right")?n:e==="center"?(t+n)/2:t;function _c(e,t,n){const s=t.length;let i=0,o=s;if(e._sorted){const{iScale:r,vScale:a,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=r.axis,{min:h,max:d,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(i=Math.min(Yt(c,u,h).lo,n?s:Yt(t,u,r.getPixelForValue(h)).lo),l){const g=c.slice(0,i+1).reverse().findIndex(m=>!N(m[a.axis]));i-=Math.max(0,g)}i=ft(i,0,s-1)}if(p){let g=Math.max(Yt(c,r.axis,d,!0).hi+1,n?0:Yt(t,u,r.getPixelForValue(d),!0).hi+1);if(l){const m=c.slice(g-1).findIndex(b=>!N(b[a.axis]));g+=Math.max(0,m)}o=ft(g,i,s)-i}else o=s-i}return{start:i,count:o}}function yc(e){const{xScale:t,yScale:n,_scaleRanges:s}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!s)return e._scaleRanges=i,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==n.min||s.ymax!==n.max;return Object.assign(s,i),o}const Fn=e=>e===0||e===1,Wo=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*G/n)),qo=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*G/n)+1,rn={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*lt)+1,easeOutSine:e=>Math.sin(e*lt),easeInOutSine:e=>-.5*(Math.cos(Z*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Fn(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Fn(e)?e:Wo(e,.075,.3),easeOutElastic:e=>Fn(e)?e:qo(e,.075,.3),easeInOutElastic(e){return Fn(e)?e:e<.5?.5*Wo(e*2,.1125,.45):.5+.5*qo(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-rn.easeOutBounce(1-e),easeOutBounce(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},easeInOutBounce:e=>e<.5?rn.easeInBounce(e*2)*.5:rn.easeOutBounce(e*2-1)*.5+.5};function no(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Uo(e){return no(e)?e:new dn(e)}function Fs(e){return no(e)?e:new dn(e).saturate(.5).darken(.1).hexString()}const eb=["x","y","borderWidth","radius","tension"],nb=["color","borderColor","backgroundColor"];function sb(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:nb},numbers:{type:"number",properties:eb}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ib(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Yo=new Map;function ob(e,t){t=t||{};const n=e+JSON.stringify(t);let s=Yo.get(n);return s||(s=new Intl.NumberFormat(e,t),Yo.set(n,s)),s}function zn(e,t,n){return ob(t,n).format(e)}const xc={values(e){return nt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const s=this.chart.options.locale;let i,o=e;if(n.length>1){const l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(i="scientific"),o=rb(e,n)}const r=Xt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:i,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),zn(e,s,c)},logarithmic(e,t,n){if(e===0)return"0";const s=n[t].significand||e/Math.pow(10,Math.floor(Xt(e)));return[1,2,3,5,10,15].includes(s)||t>.8*n.length?xc.numeric.call(this,e,t,n):""}};function rb(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Os={formatters:xc};function ab(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Os.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const we=Object.create(null),ri=Object.create(null);function an(e,t){if(!t)return e;const n=t.split(".");for(let s=0,i=n.length;s<i;++s){const o=n[s];e=e[o]||(e[o]=Object.create(null))}return e}function Hs(e,t,n){return typeof t=="string"?fn(an(e,t),n):fn(an(e,""),t)}class cb{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,i)=>Fs(i.backgroundColor),this.hoverBorderColor=(s,i)=>Fs(i.borderColor),this.hoverColor=(s,i)=>Fs(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Hs(this,t,n)}get(t){return an(this,t)}describe(t,n){return Hs(ri,t,n)}override(t,n){return Hs(we,t,n)}route(t,n,s,i){const o=an(this,t),r=an(this,s),a="_"+n;Object.defineProperties(o,{[a]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[a],l=r[i];return $(c)?Object.assign({},l,c):E(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(n=>n(this))}}var st=new cb({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sb,ib,ab]);function lb(e){return!e||N(e.size)||N(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function gs(e,t,n,s,i){let o=t[i];return o||(o=t[i]=e.measureText(i).width,n.push(i)),o>s&&(s=o),s}function ub(e,t,n,s){s=s||{};let i=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(i=s.data={},o=s.garbageCollect=[],s.font=t),e.save(),e.font=t;let r=0;const a=n.length;let c,l,u,h,d;for(c=0;c<a;c++)if(h=n[c],h!=null&&!nt(h))r=gs(e,i,o,r,h);else if(nt(h))for(l=0,u=h.length;l<u;l++)d=h[l],d!=null&&!nt(d)&&(r=gs(e,i,o,r,d));e.restore();const f=o.length/2;if(f>n.length){for(c=0;c<f;c++)delete i[o[c]];o.splice(0,f)}return r}function fe(e,t,n){const s=e.currentDevicePixelRatio,i=n!==0?Math.max(n/2,.5):0;return Math.round((t-i)*s)/s+i}function Jo(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ai(e,t,n,s){vc(e,t,n,s,null)}function vc(e,t,n,s,i){let o,r,a,c,l,u,h,d;const f=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*Vm;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,s),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),f){default:i?e.ellipse(n,s,i/2,g,0,0,G):e.arc(n,s,g,0,G),e.closePath();break;case"triangle":u=i?i/2:g,e.moveTo(n+Math.sin(m)*u,s-Math.cos(m)*g),m+=jo,e.lineTo(n+Math.sin(m)*u,s-Math.cos(m)*g),m+=jo,e.lineTo(n+Math.sin(m)*u,s-Math.cos(m)*g),e.closePath();break;case"rectRounded":l=g*.516,c=g-l,r=Math.cos(m+de)*c,h=Math.cos(m+de)*(i?i/2-l:c),a=Math.sin(m+de)*c,d=Math.sin(m+de)*(i?i/2-l:c),e.arc(n-h,s-a,l,m-Z,m-lt),e.arc(n+d,s-r,l,m-lt,m),e.arc(n+h,s+a,l,m,m+lt),e.arc(n-d,s+r,l,m+lt,m+Z),e.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=i?i/2:c,e.rect(n-u,s-c,2*u,2*c);break}m+=de;case"rectRot":h=Math.cos(m)*(i?i/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(i?i/2:g),e.moveTo(n-h,s-a),e.lineTo(n+d,s-r),e.lineTo(n+h,s+a),e.lineTo(n-d,s+r),e.closePath();break;case"crossRot":m+=de;case"cross":h=Math.cos(m)*(i?i/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(i?i/2:g),e.moveTo(n-h,s-a),e.lineTo(n+h,s+a),e.moveTo(n+d,s-r),e.lineTo(n-d,s+r);break;case"star":h=Math.cos(m)*(i?i/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(i?i/2:g),e.moveTo(n-h,s-a),e.lineTo(n+h,s+a),e.moveTo(n+d,s-r),e.lineTo(n-d,s+r),m+=de,h=Math.cos(m)*(i?i/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,d=Math.sin(m)*(i?i/2:g),e.moveTo(n-h,s-a),e.lineTo(n+h,s+a),e.moveTo(n+d,s-r),e.lineTo(n-d,s+r);break;case"line":r=i?i/2:Math.cos(m)*g,a=Math.sin(m)*g,e.moveTo(n-r,s-a),e.lineTo(n+r,s+a);break;case"dash":e.moveTo(n,s),e.lineTo(n+Math.cos(m)*(i?i/2:g),s+Math.sin(m)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Jt(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function zs(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Rs(e){e.restore()}function hb(e,t,n,s,i){if(!t)return e.lineTo(n.x,n.y);if(i==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else i==="after"!=!!s?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function db(e,t,n,s){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?n.cp2x:n.cp1x,s?n.cp2y:n.cp1y,n.x,n.y)}function fb(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),N(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function pb(e,t,n,s,i){if(i.strikethrough||i.underline){const o=e.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=n-o.actualBoundingBoxAscent,l=n+o.actualBoundingBoxDescent,u=i.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=i.decorationWidth||2,e.moveTo(r,u),e.lineTo(a,u),e.stroke()}}function gb(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ke(e,t,n,s,i,o={}){const r=nt(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let c,l;for(e.save(),e.font=i.string,fb(e,o),c=0;c<r.length;++c)l=r[c],o.backdrop&&gb(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),N(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(l,n,s,o.maxWidth)),e.fillText(l,n,s,o.maxWidth),pb(e,n,s,l,o),s+=Number(i.lineHeight);e.restore()}function mn(e,t){const{x:n,y:s,w:i,h:o,radius:r}=t;e.arc(n+r.topLeft,s+r.topLeft,r.topLeft,1.5*Z,Z,!0),e.lineTo(n,s+o-r.bottomLeft),e.arc(n+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,Z,lt,!0),e.lineTo(n+i-r.bottomRight,s+o),e.arc(n+i-r.bottomRight,s+o-r.bottomRight,r.bottomRight,lt,0,!0),e.lineTo(n+i,s+r.topRight),e.arc(n+i-r.topRight,s+r.topRight,r.topRight,0,-lt,!0),e.lineTo(n+r.topLeft,s)}const mb=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,bb=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _b(e,t){const n=(""+e).match(mb);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const yb=e=>+e||0;function so(e,t){const n={},s=$(t),i=s?Object.keys(t):t,o=$(e)?s?r=>E(e[r],e[t[r]]):r=>e[r]:()=>e;for(const r of i)n[r]=yb(o(r));return n}function wc(e){return so(e,{top:"y",right:"x",bottom:"y",left:"x"})}function xe(e){return so(e,["topLeft","topRight","bottomLeft","bottomRight"])}function vt(e){const t=wc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function dt(e,t){e=e||{},t=t||st.font;let n=E(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let s=E(e.style,t.style);s&&!(""+s).match(bb)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const i={family:E(e.family,t.family),lineHeight:_b(E(e.lineHeight,t.lineHeight),n),size:n,style:s,weight:E(e.weight,t.weight),string:""};return i.string=lb(i),i}function Ge(e,t,n,s){let i,o,r;for(i=0,o=e.length;i<o;++i)if(r=e[i],r!==void 0&&r!==void 0)return r}function xb(e,t,n){const{min:s,max:i}=e,o=uc(t,(i-s)/2),r=(a,c)=>n&&a===0?0:a+c;return{min:r(s,-Math.abs(o)),max:r(i,o)}}function ce(e,t){return Object.assign(Object.create(e),t)}function io(e,t=[""],n,s,i=()=>e[0]){const o=n||e;typeof s>"u"&&(s=Pc("_fallback",e));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:s,_getTarget:i,override:a=>io([a,...e],t,o,s)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return Sc(a,c,()=>Cb(c,t,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return Xo(a).includes(c)},ownKeys(a){return Xo(a)},set(a,c,l){const u=a._storage||(a._storage=i());return a[c]=u[c]=l,delete a._keys,!0}})}function $e(e,t,n,s){const i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:kc(e,s),setContext:o=>$e(e,o,n,s),override:o=>$e(e.override(o),t,n,s)};return new Proxy(i,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return Sc(o,r,()=>wb(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function kc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:s=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:s,isScriptable:oe(n)?n:()=>n,isIndexable:oe(s)?s:()=>s}}const vb=(e,t)=>e?e+Gi(t):t,oo=(e,t)=>$(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Sc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const s=n();return e[t]=s,s}function wb(e,t,n){const{_proxy:s,_context:i,_subProxy:o,_descriptors:r}=e;let a=s[t];return oe(a)&&r.isScriptable(t)&&(a=kb(t,a,e,n)),nt(a)&&a.length&&(a=Sb(t,a,e,r.isIndexable)),oo(t,a)&&(a=$e(a,i,o&&o[t],r)),a}function kb(e,t,n,s){const{_proxy:i,_context:o,_subProxy:r,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let c=t(o,r||s);return a.delete(e),oo(e,c)&&(c=ro(i._scopes,i,e,c)),c}function Sb(e,t,n,s){const{_proxy:i,_context:o,_subProxy:r,_descriptors:a}=n;if(typeof o.index<"u"&&s(e))return t[o.index%t.length];if($(t[0])){const c=t,l=i._scopes.filter(u=>u!==c);t=[];for(const u of c){const h=ro(l,i,e,u);t.push($e(h,o,r&&r[e],a))}}return t}function Mc(e,t,n){return oe(e)?e(t,n):e}const Mb=(e,t)=>e===!0?t:typeof e=="string"?ie(t,e):void 0;function Pb(e,t,n,s,i){for(const o of t){const r=Mb(n,o);if(r){e.add(r);const a=Mc(r._fallback,n,i);if(typeof a<"u"&&a!==n&&a!==s)return a}else if(r===!1&&typeof s<"u"&&n!==s)return null}return!1}function ro(e,t,n,s){const i=t._rootScopes,o=Mc(t._fallback,n,s),r=[...e,...i],a=new Set;a.add(s);let c=Ko(a,r,n,o||n,s);return c===null||typeof o<"u"&&o!==n&&(c=Ko(a,r,o,c,s),c===null)?!1:io(Array.from(a),[""],i,o,()=>Tb(t,n,s))}function Ko(e,t,n,s,i){for(;n;)n=Pb(e,t,n,s,i);return n}function Tb(e,t,n){const s=e._getTarget();t in s||(s[t]={});const i=s[t];return nt(i)&&$(n)?n:i||{}}function Cb(e,t,n,s){let i;for(const o of t)if(i=Pc(vb(o,e),n),typeof i<"u")return oo(e,i)?ro(n,s,e,i):i}function Pc(e,t){for(const n of t){if(!n)continue;const s=n[e];if(typeof s<"u")return s}}function Xo(e){let t=e._keys;return t||(t=e._keys=Ob(e._scopes)),t}function Ob(e){const t=new Set;for(const n of e)for(const s of Object.keys(n).filter(i=>!i.startsWith("_")))t.add(s);return Array.from(t)}function Tc(e,t,n,s){const{iScale:i}=e,{key:o="r"}=this._parsing,r=new Array(s);let a,c,l,u;for(a=0,c=s;a<c;++a)l=a+n,u=t[l],r[a]={r:i.parse(ie(u,o),l)};return r}const zb=Number.EPSILON||1e-14,Fe=(e,t)=>t<e.length&&!e[t].skip&&e[t],Cc=e=>e==="x"?"y":"x";function Rb(e,t,n,s){const i=e.skip?t:e,o=t,r=n.skip?t:n,a=oi(o,i),c=oi(r,o);let l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const h=s*l,d=s*u;return{previous:{x:o.x-h*(r.x-i.x),y:o.y-h*(r.y-i.y)},next:{x:o.x+d*(r.x-i.x),y:o.y+d*(r.y-i.y)}}}function Ib(e,t,n){const s=e.length;let i,o,r,a,c,l=Fe(e,0);for(let u=0;u<s-1;++u)if(c=l,l=Fe(e,u+1),!(!c||!l)){if(on(t[u],0,zb)){n[u]=n[u+1]=0;continue}i=n[u]/t[u],o=n[u+1]/t[u],a=Math.pow(i,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),n[u]=i*r*t[u],n[u+1]=o*r*t[u])}}function Eb(e,t,n="x"){const s=Cc(n),i=e.length;let o,r,a,c=Fe(e,0);for(let l=0;l<i;++l){if(r=a,a=c,c=Fe(e,l+1),!a)continue;const u=a[n],h=a[s];r&&(o=(u-r[n])/3,a[`cp1${n}`]=u-o,a[`cp1${s}`]=h-o*t[l]),c&&(o=(c[n]-u)/3,a[`cp2${n}`]=u+o,a[`cp2${s}`]=h+o*t[l])}}function Ab(e,t="x"){const n=Cc(t),s=e.length,i=Array(s).fill(0),o=Array(s);let r,a,c,l=Fe(e,0);for(r=0;r<s;++r)if(a=c,c=l,l=Fe(e,r+1),!!c){if(l){const u=l[t]-c[t];i[r]=u!==0?(l[n]-c[n])/u:0}o[r]=a?l?jt(i[r-1])!==jt(i[r])?0:(i[r-1]+i[r])/2:i[r-1]:i[r]}Ib(e,i,o),Eb(e,o,t)}function Hn(e,t,n){return Math.max(Math.min(e,n),t)}function Db(e,t){let n,s,i,o,r,a=Jt(e[0],t);for(n=0,s=e.length;n<s;++n)r=o,o=a,a=n<s-1&&Jt(e[n+1],t),o&&(i=e[n],r&&(i.cp1x=Hn(i.cp1x,t.left,t.right),i.cp1y=Hn(i.cp1y,t.top,t.bottom)),a&&(i.cp2x=Hn(i.cp2x,t.left,t.right),i.cp2y=Hn(i.cp2y,t.top,t.bottom)))}function Lb(e,t,n,s,i){let o,r,a,c;if(t.spanGaps&&(e=e.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")Ab(e,i);else{let l=s?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],c=Rb(l,a,e[Math.min(o+1,r-(s?0:1))%r],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&Db(e,n)}function ao(){return typeof window<"u"&&typeof document<"u"}function co(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ms(e,t,n){let s;return typeof e=="string"?(s=parseInt(e,10),e.indexOf("%")!==-1&&(s=s/100*t.parentNode[n])):s=e,s}const Is=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Nb(e,t){return Is(e).getPropertyValue(t)}const $b=["top","right","bottom","left"];function ve(e,t,n){const s={};n=n?"-"+n:"";for(let i=0;i<4;i++){const o=$b[i];s[o]=parseFloat(e[t+"-"+o+n])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Fb=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Hb(e,t){const n=e.touches,s=n&&n.length?n[0]:e,{offsetX:i,offsetY:o}=s;let r=!1,a,c;if(Fb(i,o,e.target))a=i,c=o;else{const l=t.getBoundingClientRect();a=s.clientX-l.left,c=s.clientY-l.top,r=!0}return{x:a,y:c,box:r}}function be(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:s}=t,i=Is(n),o=i.boxSizing==="border-box",r=ve(i,"padding"),a=ve(i,"border","width"),{x:c,y:l,box:u}=Hb(e,n),h=r.left+(u&&a.left),d=r.top+(u&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((c-h)/f*n.width/s),y:Math.round((l-d)/p*n.height/s)}}function jb(e,t,n){let s,i;if(t===void 0||n===void 0){const o=e&&co(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const r=o.getBoundingClientRect(),a=Is(o),c=ve(a,"border","width"),l=ve(a,"padding");t=r.width-l.width-c.width,n=r.height-l.height-c.height,s=ms(a.maxWidth,o,"clientWidth"),i=ms(a.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:s||ps,maxHeight:i||ps}}const Gt=e=>Math.round(e*10)/10;function Bb(e,t,n,s){const i=Is(e),o=ve(i,"margin"),r=ms(i.maxWidth,e,"clientWidth")||ps,a=ms(i.maxHeight,e,"clientHeight")||ps,c=jb(e,t,n);let{width:l,height:u}=c;if(i.boxSizing==="content-box"){const d=ve(i,"border","width"),f=ve(i,"padding");l-=f.width+d.width,u-=f.height+d.height}return l=Math.max(0,l-o.width),u=Math.max(0,s?l/s:u-o.height),l=Gt(Math.min(l,r,c.maxWidth)),u=Gt(Math.min(u,a,c.maxHeight)),l&&!u&&(u=Gt(l/2)),(t!==void 0||n!==void 0)&&s&&c.height&&u>c.height&&(u=c.height,l=Gt(Math.floor(u*s))),{width:l,height:u}}function Go(e,t,n){const s=t||1,i=Gt(e.height*s),o=Gt(e.width*s);e.height=Gt(e.height),e.width=Gt(e.width);const r=e.canvas;return r.style&&(n||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==s||r.height!==i||r.width!==o?(e.currentDevicePixelRatio=s,r.height=i,r.width=o,e.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Zb=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};ao()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Qo(e,t){const n=Nb(e,t),s=n&&n.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function _e(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Vb(e,t,n,s){return{x:e.x+n*(t.x-e.x),y:s==="middle"?n<.5?e.y:t.y:s==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Wb(e,t,n,s){const i={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=_e(e,i,n),a=_e(i,o,n),c=_e(o,t,n),l=_e(r,a,n),u=_e(a,c,n);return _e(l,u,n)}const qb=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,s){return n-s},leftForLtr(n,s){return n-s}}},Ub=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function Ee(e,t,n){return e?qb(t,n):Ub()}function Oc(e,t){let n,s;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,s=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=s)}function zc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Rc(e){return e==="angle"?{between:gn,compare:Ym,normalize:yt}:{between:Ut,compare:(t,n)=>t-n,normalize:t=>t}}function tr({start:e,end:t,count:n,loop:s,style:i}){return{start:e%n,end:t%n,loop:s&&(t-e+1)%n===0,style:i}}function Yb(e,t,n){const{property:s,start:i,end:o}=n,{between:r,normalize:a}=Rc(s),c=t.length;let{start:l,end:u,loop:h}=e,d,f;if(h){for(l+=c,u+=c,d=0,f=c;d<f&&r(a(t[l%c][s]),i,o);++d)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:h,style:e.style}}function Ic(e,t,n){if(!n)return[e];const{property:s,start:i,end:o}=n,r=t.length,{compare:a,between:c,normalize:l}=Rc(s),{start:u,end:h,loop:d,style:f}=Yb(e,t,n),p=[];let g=!1,m=null,b,x,M;const S=()=>c(i,M,b)&&a(i,M)!==0,w=()=>a(o,b)===0||c(o,M,b),C=()=>g||S(),T=()=>!g||w();for(let O=u,z=u;O<=h;++O)x=t[O%r],!x.skip&&(b=l(x[s]),b!==M&&(g=c(b,i,o),m===null&&C()&&(m=a(b,i)===0?O:z),m!==null&&T()&&(p.push(tr({start:m,end:O,loop:d,count:r,style:f})),m=null),z=O,M=b));return m!==null&&p.push(tr({start:m,end:h,loop:d,count:r,style:f})),p}function Ec(e,t){const n=[],s=e.segments;for(let i=0;i<s.length;i++){const o=Ic(s[i],e.points,t);o.length&&n.push(...o)}return n}function Jb(e,t,n,s){let i=0,o=t-1;if(n&&!s)for(;i<t&&!e[i].skip;)i++;for(;i<t&&e[i].skip;)i++;for(i%=t,n&&(o+=i);o>i&&e[o%t].skip;)o--;return o%=t,{start:i,end:o}}function Kb(e,t,n,s){const i=e.length,o=[];let r=t,a=e[t],c;for(c=t+1;c<=n;++c){const l=e[c%i];l.skip||l.stop?a.skip||(s=!1,o.push({start:t%i,end:(c-1)%i,loop:s}),t=r=l.stop?c:null):(r=c,a.skip&&(t=c)),a=l}return r!==null&&o.push({start:t%i,end:r%i,loop:s}),o}function Xb(e,t){const n=e.points,s=e.options.spanGaps,i=n.length;if(!i)return[];const o=!!e._loop,{start:r,end:a}=Jb(n,i,o,s);if(s===!0)return er(e,[{start:r,end:a,loop:o}],n,t);const c=a<r?a+i:a,l=!!e._fullLoop&&r===0&&a===i-1;return er(e,Kb(n,r,c,l),n,t)}function er(e,t,n,s){return!s||!s.setContext||!n?t:Gb(e,t,n,s)}function Gb(e,t,n,s){const i=e._chart.getContext(),o=nr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,c=n.length,l=[];let u=o,h=t[0].start,d=h;function f(p,g,m,b){const x=a?-1:1;if(p!==g){for(p+=c;n[p%c].skip;)p-=x;for(;n[g%c].skip;)g+=x;p%c!==g%c&&(l.push({start:p%c,end:g%c,loop:m,style:b}),u=b,h=g%c)}}for(const p of t){h=a?h:p.start;let g=n[h%c],m;for(d=h+1;d<=p.end;d++){const b=n[d%c];m=nr(s.setContext(ce(i,{type:"segment",p0:g,p1:b,p0DataIndex:(d-1)%c,p1DataIndex:d%c,datasetIndex:r}))),Qb(m,u)&&f(h,d-1,p.loop,u),g=b,u=m}h<d-1&&f(h,d-1,p.loop,u)}return l}function nr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Qb(e,t){if(!t)return!1;const n=[],s=function(i,o){return no(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,s)!==JSON.stringify(t,s)}function jn(e,t,n){return e.options.clip?e[n]:t[n]}function t_(e,t){const{xScale:n,yScale:s}=e;return n&&s?{left:jn(n,t,"left"),right:jn(n,t,"right"),top:jn(s,t,"top"),bottom:jn(s,t,"bottom")}:t}function Ac(e,t){const n=t._clip;if(n.disabled)return!1;const s=t_(t,e.chartArea);return{left:n.left===!1?0:s.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:s.right+(n.right===!0?0:n.right),top:n.top===!1?0:s.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:s.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
|
95
|
+
*/function rt(){}const lS=(()=>{let t=0;return()=>t++})();function V(t){return t==null}function ue(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function W(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function fe(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Re(t,e){return fe(t)?t:e}function R(t,e){return typeof t>"u"?e:t}const uS=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,ov=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function ae(t,e,i){if(t&&typeof t.call=="function")return t.apply(i,e)}function te(t,e,i,r){let n,o,s;if(ue(t))for(o=t.length,n=0;n<o;n++)e.call(i,t[n],n);else if(W(t))for(s=Object.keys(t),o=s.length,n=0;n<o;n++)e.call(i,t[s[n]],s[n])}function ro(t,e){let i,r,n,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,r=t.length;i<r;++i)if(n=t[i],o=e[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function oo(t){if(ue(t))return t.map(oo);if(W(t)){const e=Object.create(null),i=Object.keys(t),r=i.length;let n=0;for(;n<r;++n)e[i[n]]=oo(t[i[n]]);return e}return t}function sv(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function dS(t,e,i,r){if(!sv(t))return;const n=e[t],o=i[t];W(n)&&W(o)?si(n,o,r):e[t]=oo(o)}function si(t,e,i){const r=ue(e)?e:[e],n=r.length;if(!W(t))return t;i=i||{};const o=i.merger||dS;let s;for(let a=0;a<n;++a){if(s=r[a],!W(s))continue;const c=Object.keys(s);for(let l=0,u=c.length;l<u;++l)o(c[l],t,s,i)}return t}function Yn(t,e){return si(t,e,{merger:hS})}function hS(t,e,i){if(!sv(t))return;const r=e[t],n=i[t];W(r)&&W(n)?Yn(r,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=oo(n))}const Xu={"":t=>t,x:t=>t.x,y:t=>t.y};function fS(t){const e=t.split("."),i=[];let r="";for(const n of e)r+=n,r.endsWith("\\")?r=r.slice(0,-1)+".":(i.push(r),r="");return i}function mS(t){const e=fS(t);return i=>{for(const r of e){if(r==="")break;i=i&&i[r]}return i}}function kt(t,e){return(Xu[e]||(Xu[e]=mS(e)))(t)}function cu(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ai=t=>typeof t<"u",St=t=>typeof t=="function",Qu=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function pS(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Y=Math.PI,ce=2*Y,gS=ce+Y,so=Number.POSITIVE_INFINITY,vS=Y/180,pe=Y/2,Dt=Y/4,ed=Y*2/3,vt=Math.log10,tt=Math.sign;function Xn(t,e,i){return Math.abs(t-e)<i}function td(t){const e=Math.round(t);t=Xn(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(vt(t))),r=t/i;return(r<=1?1:r<=2?2:r<=5?5:10)*i}function bS(t){const e=[],i=Math.sqrt(t);let r;for(r=1;r<i;r++)t%r===0&&(e.push(r),e.push(t/r));return i===(i|0)&&e.push(i),e.sort((n,o)=>n-o).pop(),e}function _S(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function bn(t){return!_S(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function yS(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function av(t,e,i){let r,n,o;for(r=0,n=t.length;r<n;r++)o=t[r][i],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function Ge(t){return t*(Y/180)}function lu(t){return t*(180/Y)}function nd(t){if(!fe(t))return;let e=1,i=0;for(;Math.round(t*e)/e!==t;)e*=10,i++;return i}function cv(t,e){const i=e.x-t.x,r=e.y-t.y,n=Math.sqrt(i*i+r*r);let o=Math.atan2(r,i);return o<-.5*Y&&(o+=ce),{angle:o,distance:n}}function ta(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function xS(t,e){return(t-e+gS)%ce-Y}function Pe(t){return(t%ce+ce)%ce}function ci(t,e,i,r){const n=Pe(t),o=Pe(e),s=Pe(i),a=Pe(o-n),c=Pe(s-n),l=Pe(n-o),u=Pe(n-s);return n===o||n===s||r&&o===s||a>c&&l<u}function be(t,e,i){return Math.max(e,Math.min(i,t))}function $S(t){return be(t,-32768,32767)}function lt(t,e,i,r=1e-6){return t>=Math.min(e,i)-r&&t<=Math.max(e,i)+r}function uu(t,e,i){i=i||(s=>t[s]<e);let r=t.length-1,n=0,o;for(;r-n>1;)o=n+r>>1,i(o)?n=o:r=o;return{lo:n,hi:r}}const ut=(t,e,i,r)=>uu(t,i,r?n=>{const o=t[n][e];return o<i||o===i&&t[n+1][e]===i}:n=>t[n][e]<i),kS=(t,e,i)=>uu(t,i,r=>t[r][e]>=i);function SS(t,e,i){let r=0,n=t.length;for(;r<n&&t[r]<e;)r++;for(;n>r&&t[n-1]>i;)n--;return r>0||n<t.length?t.slice(r,n):t}const lv=["push","pop","shift","splice","unshift"];function wS(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),lv.forEach(i=>{const r="_onData"+cu(i),n=t[i];Object.defineProperty(t,i,{configurable:!0,enumerable:!1,value(...o){const s=n.apply(this,o);return t._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function id(t,e){const i=t._chartjs;if(!i)return;const r=i.listeners,n=r.indexOf(e);n!==-1&&r.splice(n,1),!(r.length>0)&&(lv.forEach(o=>{delete t[o]}),delete t._chartjs)}function uv(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const dv=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function hv(t,e){let i=[],r=!1;return function(...n){i=n,r||(r=!0,dv.call(window,()=>{r=!1,t.apply(e,i)}))}}function IS(t,e){let i;return function(...r){return e?(clearTimeout(i),i=setTimeout(t,e,r)):t.apply(this,r),e}}const du=t=>t==="start"?"left":t==="end"?"right":"center",ze=(t,e,i)=>t==="start"?e:t==="end"?i:(e+i)/2,zS=(t,e,i,r)=>t===(r?"left":"right")?i:t==="center"?(e+i)/2:e;function fv(t,e,i){const r=e.length;let n=0,o=r;if(t._sorted){const{iScale:s,vScale:a,_parsed:c}=t,l=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=s.axis,{min:d,max:h,minDefined:f,maxDefined:m}=s.getUserBounds();if(f){if(n=Math.min(ut(c,u,d).lo,i?r:ut(e,u,s.getPixelForValue(d)).lo),l){const p=c.slice(0,n+1).reverse().findIndex(g=>!V(g[a.axis]));n-=Math.max(0,p)}n=be(n,0,r-1)}if(m){let p=Math.max(ut(c,s.axis,h,!0).hi+1,i?0:ut(e,u,s.getPixelForValue(h),!0).hi+1);if(l){const g=c.slice(p-1).findIndex(v=>!V(v[a.axis]));p+=Math.max(0,g)}o=be(p,n,r)-n}else o=r-n}return{start:n,count:o}}function mv(t){const{xScale:e,yScale:i,_scaleRanges:r}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!r)return t._scaleRanges=n,!0;const o=r.xmin!==e.min||r.xmax!==e.max||r.ymin!==i.min||r.ymax!==i.max;return Object.assign(r,n),o}const Pr=t=>t===0||t===1,rd=(t,e,i)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*ce/i)),od=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*ce/i)+1,Qn={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*pe)+1,easeOutSine:t=>Math.sin(t*pe),easeInOutSine:t=>-.5*(Math.cos(Y*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Pr(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Pr(t)?t:rd(t,.075,.3),easeOutElastic:t=>Pr(t)?t:od(t,.075,.3),easeInOutElastic(t){return Pr(t)?t:t<.5?.5*rd(t*2,.1125,.45):.5+.5*od(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-Qn.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?Qn.easeInBounce(t*2)*.5:Qn.easeOutBounce(t*2-1)*.5+.5};function hu(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function sd(t){return hu(t)?t:new oi(t)}function Cs(t){return hu(t)?t:new oi(t).saturate(.5).darken(.1).hexString()}const PS=["x","y","borderWidth","radius","tension"],TS=["color","borderColor","backgroundColor"];function OS(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:TS},numbers:{type:"number",properties:PS}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function DS(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ad=new Map;function MS(t,e){e=e||{};const i=t+JSON.stringify(e);let r=ad.get(i);return r||(r=new Intl.NumberFormat(t,e),ad.set(i,r)),r}function br(t,e,i){return MS(e,i).format(t)}const pv={values(t){return ue(t)?t:""+t},numeric(t,e,i){if(t===0)return"0";const r=this.chart.options.locale;let n,o=t;if(i.length>1){const l=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(l<1e-4||l>1e15)&&(n="scientific"),o=ES(t,i)}const s=vt(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),c={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),br(t,r,c)},logarithmic(t,e,i){if(t===0)return"0";const r=i[e].significand||t/Math.pow(10,Math.floor(vt(t)));return[1,2,3,5,10,15].includes(r)||e>.8*i.length?pv.numeric.call(this,t,e,i):""}};function ES(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var Is={formatters:pv};function CS(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,i)=>i.lineWidth,tickColor:(e,i)=>i.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Is.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const qt=Object.create(null),na=Object.create(null);function ei(t,e){if(!e)return t;const i=e.split(".");for(let r=0,n=i.length;r<n;++r){const o=i[r];t=t[o]||(t[o]=Object.create(null))}return t}function As(t,e,i){return typeof e=="string"?si(ei(t,e),i):si(ei(t,""),e)}class AS{constructor(e,i){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,n)=>Cs(n.backgroundColor),this.hoverBorderColor=(r,n)=>Cs(n.borderColor),this.hoverColor=(r,n)=>Cs(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(i)}set(e,i){return As(this,e,i)}get(e){return ei(this,e)}describe(e,i){return As(na,e,i)}override(e,i){return As(qt,e,i)}route(e,i,r,n){const o=ei(this,e),s=ei(this,r),a="_"+i;Object.defineProperties(o,{[a]:{value:o[i],writable:!0},[i]:{enumerable:!0,get(){const c=this[a],l=s[n];return W(c)?Object.assign({},l,c):R(c,l)},set(c){this[a]=c}}})}apply(e){e.forEach(i=>i(this))}}var de=new AS({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[OS,DS,CS]);function jS(t){return!t||V(t.size)||V(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function ao(t,e,i,r,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>r&&(r=o),r}function RS(t,e,i,r){r=r||{};let n=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==e&&(n=r.data={},o=r.garbageCollect=[],r.font=e),t.save(),t.font=e;let s=0;const a=i.length;let c,l,u,d,h;for(c=0;c<a;c++)if(d=i[c],d!=null&&!ue(d))s=ao(t,n,o,s,d);else if(ue(d))for(l=0,u=d.length;l<u;l++)h=d[l],h!=null&&!ue(h)&&(s=ao(t,n,o,s,h));t.restore();const f=o.length/2;if(f>i.length){for(c=0;c<f;c++)delete n[o[c]];o.splice(0,f)}return s}function Mt(t,e,i){const r=t.currentDevicePixelRatio,n=i!==0?Math.max(i/2,.5):0;return Math.round((e-n)*r)/r+n}function cd(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function ia(t,e,i,r){gv(t,e,i,r,null)}function gv(t,e,i,r,n){let o,s,a,c,l,u,d,h;const f=e.pointStyle,m=e.rotation,p=e.radius;let g=(m||0)*vS;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){t.save(),t.translate(i,r),t.rotate(g),t.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),t.restore();return}if(!(isNaN(p)||p<=0)){switch(t.beginPath(),f){default:n?t.ellipse(i,r,n/2,p,0,0,ce):t.arc(i,r,p,0,ce),t.closePath();break;case"triangle":u=n?n/2:p,t.moveTo(i+Math.sin(g)*u,r-Math.cos(g)*p),g+=ed,t.lineTo(i+Math.sin(g)*u,r-Math.cos(g)*p),g+=ed,t.lineTo(i+Math.sin(g)*u,r-Math.cos(g)*p),t.closePath();break;case"rectRounded":l=p*.516,c=p-l,s=Math.cos(g+Dt)*c,d=Math.cos(g+Dt)*(n?n/2-l:c),a=Math.sin(g+Dt)*c,h=Math.sin(g+Dt)*(n?n/2-l:c),t.arc(i-d,r-a,l,g-Y,g-pe),t.arc(i+h,r-s,l,g-pe,g),t.arc(i+d,r+a,l,g,g+pe),t.arc(i-h,r+s,l,g+pe,g+Y),t.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*p,u=n?n/2:c,t.rect(i-u,r-c,2*u,2*c);break}g+=Dt;case"rectRot":d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,h=Math.sin(g)*(n?n/2:p),t.moveTo(i-d,r-a),t.lineTo(i+h,r-s),t.lineTo(i+d,r+a),t.lineTo(i-h,r+s),t.closePath();break;case"crossRot":g+=Dt;case"cross":d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,h=Math.sin(g)*(n?n/2:p),t.moveTo(i-d,r-a),t.lineTo(i+d,r+a),t.moveTo(i+h,r-s),t.lineTo(i-h,r+s);break;case"star":d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,h=Math.sin(g)*(n?n/2:p),t.moveTo(i-d,r-a),t.lineTo(i+d,r+a),t.moveTo(i+h,r-s),t.lineTo(i-h,r+s),g+=Dt,d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,h=Math.sin(g)*(n?n/2:p),t.moveTo(i-d,r-a),t.lineTo(i+d,r+a),t.moveTo(i+h,r-s),t.lineTo(i-h,r+s);break;case"line":s=n?n/2:Math.cos(g)*p,a=Math.sin(g)*p,t.moveTo(i-s,r-a),t.lineTo(i+s,r+a);break;case"dash":t.moveTo(i,r),t.lineTo(i+Math.cos(g)*(n?n/2:p),r+Math.sin(g)*p);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function dt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function zs(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function Ps(t){t.restore()}function NS(t,e,i,r,n){if(!e)return t.lineTo(i.x,i.y);if(n==="middle"){const o=(e.x+i.x)/2;t.lineTo(o,e.y),t.lineTo(o,i.y)}else n==="after"!=!!r?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function US(t,e,i,r){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(r?e.cp1x:e.cp2x,r?e.cp1y:e.cp2y,r?i.cp2x:i.cp1x,r?i.cp2y:i.cp1y,i.x,i.y)}function LS(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),V(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function FS(t,e,i,r,n){if(n.strikethrough||n.underline){const o=t.measureText(r),s=e-o.actualBoundingBoxLeft,a=e+o.actualBoundingBoxRight,c=i-o.actualBoundingBoxAscent,l=i+o.actualBoundingBoxDescent,u=n.strikethrough?(c+l)/2:l;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(s,u),t.lineTo(a,u),t.stroke()}}function ZS(t,e){const i=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=i}function Jt(t,e,i,r,n,o={}){const s=ue(e)?e:[e],a=o.strokeWidth>0&&o.strokeColor!=="";let c,l;for(t.save(),t.font=n.string,LS(t,o),c=0;c<s.length;++c)l=s[c],o.backdrop&&ZS(t,o.backdrop),a&&(o.strokeColor&&(t.strokeStyle=o.strokeColor),V(o.strokeWidth)||(t.lineWidth=o.strokeWidth),t.strokeText(l,i,r,o.maxWidth)),t.fillText(l,i,r,o.maxWidth),FS(t,i,r,l,o),r+=Number(n.lineHeight);t.restore()}function li(t,e){const{x:i,y:r,w:n,h:o,radius:s}=e;t.arc(i+s.topLeft,r+s.topLeft,s.topLeft,1.5*Y,Y,!0),t.lineTo(i,r+o-s.bottomLeft),t.arc(i+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,Y,pe,!0),t.lineTo(i+n-s.bottomRight,r+o),t.arc(i+n-s.bottomRight,r+o-s.bottomRight,s.bottomRight,pe,0,!0),t.lineTo(i+n,r+s.topRight),t.arc(i+n-s.topRight,r+s.topRight,s.topRight,0,-pe,!0),t.lineTo(i+s.topLeft,r)}const BS=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,HS=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function VS(t,e){const i=(""+t).match(BS);if(!i||i[1]==="normal")return e*1.2;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100;break}return e*t}const WS=t=>+t||0;function fu(t,e){const i={},r=W(e),n=r?Object.keys(e):e,o=W(t)?r?s=>R(t[s],t[e[s]]):s=>t[s]:()=>t;for(const s of n)i[s]=WS(o(s));return i}function vv(t){return fu(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ft(t){return fu(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Oe(t){const e=vv(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ve(t,e){t=t||{},e=e||de.font;let i=R(t.size,e.size);typeof i=="string"&&(i=parseInt(i,10));let r=R(t.style,e.style);r&&!(""+r).match(HS)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const n={family:R(t.family,e.family),lineHeight:VS(R(t.lineHeight,e.lineHeight),i),size:i,style:r,weight:R(t.weight,e.weight),string:""};return n.string=jS(n),n}function Wn(t,e,i,r){let n,o,s;for(n=0,o=t.length;n<o;++n)if(s=t[n],s!==void 0&&s!==void 0)return s}function qS(t,e,i){const{min:r,max:n}=t,o=ov(e,(n-r)/2),s=(a,c)=>i&&a===0?0:a+c;return{min:s(r,-Math.abs(o)),max:s(n,o)}}function zt(t,e){return Object.assign(Object.create(t),e)}function mu(t,e=[""],i,r,n=()=>t[0]){const o=i||t;typeof r>"u"&&(r=xv("_fallback",t));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:o,_fallback:r,_getTarget:n,override:a=>mu([a,...t],e,o,r)};return new Proxy(s,{deleteProperty(a,c){return delete a[c],delete a._keys,delete t[0][c],!0},get(a,c){return _v(a,c,()=>tw(c,e,t,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(a,c){return ud(a).includes(c)},ownKeys(a){return ud(a)},set(a,c,l){const u=a._storage||(a._storage=n());return a[c]=u[c]=l,delete a._keys,!0}})}function _n(t,e,i,r){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:bv(t,r),setContext:o=>_n(t,o,i,r),override:o=>_n(t.override(o),e,i,r)};return new Proxy(n,{deleteProperty(o,s){return delete o[s],delete t[s],!0},get(o,s,a){return _v(o,s,()=>KS(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(t,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,s)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(o,s){return Reflect.has(t,s)},ownKeys(){return Reflect.ownKeys(t)},set(o,s,a){return t[s]=a,delete o[s],!0}})}function bv(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:r=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:r,isScriptable:St(i)?i:()=>i,isIndexable:St(r)?r:()=>r}}const JS=(t,e)=>t?t+cu(e):e,pu=(t,e)=>W(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function _v(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const r=i();return t[e]=r,r}function KS(t,e,i){const{_proxy:r,_context:n,_subProxy:o,_descriptors:s}=t;let a=r[e];return St(a)&&s.isScriptable(e)&&(a=GS(e,a,t,i)),ue(a)&&a.length&&(a=YS(e,a,t,s.isIndexable)),pu(e,a)&&(a=_n(a,n,o&&o[e],s)),a}function GS(t,e,i,r){const{_proxy:n,_context:o,_subProxy:s,_stack:a}=i;if(a.has(t))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+t);a.add(t);let c=e(o,s||r);return a.delete(t),pu(t,c)&&(c=gu(n._scopes,n,t,c)),c}function YS(t,e,i,r){const{_proxy:n,_context:o,_subProxy:s,_descriptors:a}=i;if(typeof o.index<"u"&&r(t))return e[o.index%e.length];if(W(e[0])){const c=e,l=n._scopes.filter(u=>u!==c);e=[];for(const u of c){const d=gu(l,n,t,u);e.push(_n(d,o,s&&s[t],a))}}return e}function yv(t,e,i){return St(t)?t(e,i):t}const XS=(t,e)=>t===!0?e:typeof t=="string"?kt(e,t):void 0;function QS(t,e,i,r,n){for(const o of e){const s=XS(i,o);if(s){t.add(s);const a=yv(s._fallback,i,n);if(typeof a<"u"&&a!==i&&a!==r)return a}else if(s===!1&&typeof r<"u"&&i!==r)return null}return!1}function gu(t,e,i,r){const n=e._rootScopes,o=yv(e._fallback,i,r),s=[...t,...n],a=new Set;a.add(r);let c=ld(a,s,i,o||i,r);return c===null||typeof o<"u"&&o!==i&&(c=ld(a,s,o,c,r),c===null)?!1:mu(Array.from(a),[""],n,o,()=>ew(e,i,r))}function ld(t,e,i,r,n){for(;i;)i=QS(t,e,i,r,n);return i}function ew(t,e,i){const r=t._getTarget();e in r||(r[e]={});const n=r[e];return ue(n)&&W(i)?i:n||{}}function tw(t,e,i,r){let n;for(const o of e)if(n=xv(JS(o,t),i),typeof n<"u")return pu(t,n)?gu(i,r,t,n):n}function xv(t,e){for(const i of e){if(!i)continue;const r=i[t];if(typeof r<"u")return r}}function ud(t){let e=t._keys;return e||(e=t._keys=nw(t._scopes)),e}function nw(t){const e=new Set;for(const i of t)for(const r of Object.keys(i).filter(n=>!n.startsWith("_")))e.add(r);return Array.from(e)}function $v(t,e,i,r){const{iScale:n}=t,{key:o="r"}=this._parsing,s=new Array(r);let a,c,l,u;for(a=0,c=r;a<c;++a)l=a+i,u=e[l],s[a]={r:n.parse(kt(u,o),l)};return s}const iw=Number.EPSILON||1e-14,yn=(t,e)=>e<t.length&&!t[e].skip&&t[e],kv=t=>t==="x"?"y":"x";function rw(t,e,i,r){const n=t.skip?e:t,o=e,s=i.skip?e:i,a=ta(o,n),c=ta(s,o);let l=a/(a+c),u=c/(a+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const d=r*l,h=r*u;return{previous:{x:o.x-d*(s.x-n.x),y:o.y-d*(s.y-n.y)},next:{x:o.x+h*(s.x-n.x),y:o.y+h*(s.y-n.y)}}}function ow(t,e,i){const r=t.length;let n,o,s,a,c,l=yn(t,0);for(let u=0;u<r-1;++u)if(c=l,l=yn(t,u+1),!(!c||!l)){if(Xn(e[u],0,iw)){i[u]=i[u+1]=0;continue}n=i[u]/e[u],o=i[u+1]/e[u],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),i[u]=n*s*e[u],i[u+1]=o*s*e[u])}}function sw(t,e,i="x"){const r=kv(i),n=t.length;let o,s,a,c=yn(t,0);for(let l=0;l<n;++l){if(s=a,a=c,c=yn(t,l+1),!a)continue;const u=a[i],d=a[r];s&&(o=(u-s[i])/3,a[`cp1${i}`]=u-o,a[`cp1${r}`]=d-o*e[l]),c&&(o=(c[i]-u)/3,a[`cp2${i}`]=u+o,a[`cp2${r}`]=d+o*e[l])}}function aw(t,e="x"){const i=kv(e),r=t.length,n=Array(r).fill(0),o=Array(r);let s,a,c,l=yn(t,0);for(s=0;s<r;++s)if(a=c,c=l,l=yn(t,s+1),!!c){if(l){const u=l[e]-c[e];n[s]=u!==0?(l[i]-c[i])/u:0}o[s]=a?l?tt(n[s-1])!==tt(n[s])?0:(n[s-1]+n[s])/2:n[s-1]:n[s]}ow(t,n,o),sw(t,o,e)}function Tr(t,e,i){return Math.max(Math.min(t,i),e)}function cw(t,e){let i,r,n,o,s,a=dt(t[0],e);for(i=0,r=t.length;i<r;++i)s=o,o=a,a=i<r-1&&dt(t[i+1],e),o&&(n=t[i],s&&(n.cp1x=Tr(n.cp1x,e.left,e.right),n.cp1y=Tr(n.cp1y,e.top,e.bottom)),a&&(n.cp2x=Tr(n.cp2x,e.left,e.right),n.cp2y=Tr(n.cp2y,e.top,e.bottom)))}function lw(t,e,i,r,n){let o,s,a,c;if(e.spanGaps&&(t=t.filter(l=>!l.skip)),e.cubicInterpolationMode==="monotone")aw(t,n);else{let l=r?t[t.length-1]:t[0];for(o=0,s=t.length;o<s;++o)a=t[o],c=rw(l,a,t[Math.min(o+1,s-(r?0:1))%s],e.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}e.capBezierPoints&&cw(t,i)}function vu(){return typeof window<"u"&&typeof document<"u"}function bu(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function co(t,e,i){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*e.parentNode[i])):r=t,r}const Ts=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function uw(t,e){return Ts(t).getPropertyValue(e)}const dw=["top","right","bottom","left"];function Zt(t,e,i){const r={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=dw[n];r[o]=parseFloat(t[e+"-"+o+i])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const hw=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function fw(t,e){const i=t.touches,r=i&&i.length?i[0]:t,{offsetX:n,offsetY:o}=r;let s=!1,a,c;if(hw(n,o,t.target))a=n,c=o;else{const l=e.getBoundingClientRect();a=r.clientX-l.left,c=r.clientY-l.top,s=!0}return{x:a,y:c,box:s}}function jt(t,e){if("native"in t)return t;const{canvas:i,currentDevicePixelRatio:r}=e,n=Ts(i),o=n.boxSizing==="border-box",s=Zt(n,"padding"),a=Zt(n,"border","width"),{x:c,y:l,box:u}=fw(t,i),d=s.left+(u&&a.left),h=s.top+(u&&a.top);let{width:f,height:m}=e;return o&&(f-=s.width+a.width,m-=s.height+a.height),{x:Math.round((c-d)/f*i.width/r),y:Math.round((l-h)/m*i.height/r)}}function mw(t,e,i){let r,n;if(e===void 0||i===void 0){const o=t&&bu(t);if(!o)e=t.clientWidth,i=t.clientHeight;else{const s=o.getBoundingClientRect(),a=Ts(o),c=Zt(a,"border","width"),l=Zt(a,"padding");e=s.width-l.width-c.width,i=s.height-l.height-c.height,r=co(a.maxWidth,o,"clientWidth"),n=co(a.maxHeight,o,"clientHeight")}}return{width:e,height:i,maxWidth:r||so,maxHeight:n||so}}const bt=t=>Math.round(t*10)/10;function pw(t,e,i,r){const n=Ts(t),o=Zt(n,"margin"),s=co(n.maxWidth,t,"clientWidth")||so,a=co(n.maxHeight,t,"clientHeight")||so,c=mw(t,e,i);let{width:l,height:u}=c;if(n.boxSizing==="content-box"){const h=Zt(n,"border","width"),f=Zt(n,"padding");l-=f.width+h.width,u-=f.height+h.height}return l=Math.max(0,l-o.width),u=Math.max(0,r?l/r:u-o.height),l=bt(Math.min(l,s,c.maxWidth)),u=bt(Math.min(u,a,c.maxHeight)),l&&!u&&(u=bt(l/2)),(e!==void 0||i!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=bt(Math.floor(u*r))),{width:l,height:u}}function dd(t,e,i){const r=e||1,n=bt(t.height*r),o=bt(t.width*r);t.height=bt(t.height),t.width=bt(t.width);const s=t.canvas;return s.style&&(i||!s.style.height&&!s.style.width)&&(s.style.height=`${t.height}px`,s.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||s.height!==n||s.width!==o?(t.currentDevicePixelRatio=r,s.height=n,s.width=o,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const gw=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};vu()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function hd(t,e){const i=uw(t,e),r=i&&i.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Rt(t,e,i,r){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function vw(t,e,i,r){return{x:t.x+i*(e.x-t.x),y:r==="middle"?i<.5?t.y:e.y:r==="after"?i<1?t.y:e.y:i>0?e.y:t.y}}function bw(t,e,i,r){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},s=Rt(t,n,i),a=Rt(n,o,i),c=Rt(o,e,i),l=Rt(s,a,i),u=Rt(a,c,i);return Rt(l,u,i)}const _w=function(t,e){return{x(i){return t+t+e-i},setWidth(i){e=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,r){return i-r},leftForLtr(i,r){return i-r}}},yw=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function on(t,e,i){return t?_w(e,i):yw()}function Sv(t,e){let i,r;(e==="ltr"||e==="rtl")&&(i=t.canvas.style,r=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=r)}function wv(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Iv(t){return t==="angle"?{between:ci,compare:xS,normalize:Pe}:{between:lt,compare:(e,i)=>e-i,normalize:e=>e}}function fd({start:t,end:e,count:i,loop:r,style:n}){return{start:t%i,end:e%i,loop:r&&(e-t+1)%i===0,style:n}}function xw(t,e,i){const{property:r,start:n,end:o}=i,{between:s,normalize:a}=Iv(r),c=e.length;let{start:l,end:u,loop:d}=t,h,f;if(d){for(l+=c,u+=c,h=0,f=c;h<f&&s(a(e[l%c][r]),n,o);++h)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:d,style:t.style}}function zv(t,e,i){if(!i)return[t];const{property:r,start:n,end:o}=i,s=e.length,{compare:a,between:c,normalize:l}=Iv(r),{start:u,end:d,loop:h,style:f}=xw(t,e,i),m=[];let p=!1,g=null,v,x,z;const I=()=>c(n,z,v)&&a(n,z)!==0,k=()=>a(o,v)===0||c(o,z,v),O=()=>p||I(),P=()=>!p||k();for(let D=u,E=u;D<=d;++D)x=e[D%s],!x.skip&&(v=l(x[r]),v!==z&&(p=c(v,n,o),g===null&&O()&&(g=a(v,n)===0?D:E),g!==null&&P()&&(m.push(fd({start:g,end:D,loop:h,count:s,style:f})),g=null),E=D,z=v));return g!==null&&m.push(fd({start:g,end:d,loop:h,count:s,style:f})),m}function Pv(t,e){const i=[],r=t.segments;for(let n=0;n<r.length;n++){const o=zv(r[n],t.points,e);o.length&&i.push(...o)}return i}function $w(t,e,i,r){let n=0,o=e-1;if(i&&!r)for(;n<e&&!t[n].skip;)n++;for(;n<e&&t[n].skip;)n++;for(n%=e,i&&(o+=n);o>n&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}function kw(t,e,i,r){const n=t.length,o=[];let s=e,a=t[e],c;for(c=e+1;c<=i;++c){const l=t[c%n];l.skip||l.stop?a.skip||(r=!1,o.push({start:e%n,end:(c-1)%n,loop:r}),e=s=l.stop?c:null):(s=c,a.skip&&(e=c)),a=l}return s!==null&&o.push({start:e%n,end:s%n,loop:r}),o}function Sw(t,e){const i=t.points,r=t.options.spanGaps,n=i.length;if(!n)return[];const o=!!t._loop,{start:s,end:a}=$w(i,n,o,r);if(r===!0)return md(t,[{start:s,end:a,loop:o}],i,e);const c=a<s?a+n:a,l=!!t._fullLoop&&s===0&&a===n-1;return md(t,kw(i,s,c,l),i,e)}function md(t,e,i,r){return!r||!r.setContext||!i?e:ww(t,e,i,r)}function ww(t,e,i,r){const n=t._chart.getContext(),o=pd(t.options),{_datasetIndex:s,options:{spanGaps:a}}=t,c=i.length,l=[];let u=o,d=e[0].start,h=d;function f(m,p,g,v){const x=a?-1:1;if(m!==p){for(m+=c;i[m%c].skip;)m-=x;for(;i[p%c].skip;)p+=x;m%c!==p%c&&(l.push({start:m%c,end:p%c,loop:g,style:v}),u=v,d=p%c)}}for(const m of e){d=a?d:m.start;let p=i[d%c],g;for(h=d+1;h<=m.end;h++){const v=i[h%c];g=pd(r.setContext(zt(n,{type:"segment",p0:p,p1:v,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:s}))),Iw(g,u)&&f(d,h-1,m.loop,u),p=v,u=g}d<h-1&&f(d,h-1,m.loop,u)}return l}function pd(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Iw(t,e){if(!e)return!1;const i=[],r=function(n,o){return hu(o)?(i.includes(o)||i.push(o),i.indexOf(o)):o};return JSON.stringify(t,r)!==JSON.stringify(e,r)}function Or(t,e,i){return t.options.clip?t[i]:e[i]}function zw(t,e){const{xScale:i,yScale:r}=t;return i&&r?{left:Or(i,e,"left"),right:Or(i,e,"right"),top:Or(r,e,"top"),bottom:Or(r,e,"bottom")}:e}function Tv(t,e){const i=e._clip;if(i.disabled)return!1;const r=zw(e,t.chartArea);return{left:i.left===!1?0:r.left-(i.left===!0?0:i.left),right:i.right===!1?t.width:r.right+(i.right===!0?0:i.right),top:i.top===!1?0:r.top-(i.top===!0?0:i.top),bottom:i.bottom===!1?t.height:r.bottom+(i.bottom===!0?0:i.bottom)}}/*!
|
|
95
96
|
* Chart.js v4.5.1
|
|
96
97
|
* https://www.chartjs.org
|
|
97
98
|
* (c) 2025 Chart.js Contributors
|
|
98
99
|
* Released under the MIT License
|
|
99
|
-
*/class e_{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,s,i){const o=n.listeners[i],r=n.duration;o.forEach(a=>a({chart:t,initial:n.initial,numSteps:r,currentStep:Math.min(s-n.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=mc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((s,i)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,c;for(;r>=0;--r)c=o[r],c._active?(c._total>s.duration&&(s.duration=c._total),c.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,s,t,"progress")),o.length||(s.running=!1,this._notify(i,s,t,"complete"),s.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let s=n.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,s)),s}listen(t,n,s){this._getAnims(t).listeners[n].push(s)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((s,i)=>Math.max(s,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const s=n.items;let i=s.length-1;for(;i>=0;--i)s[i].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Zt=new e_;const sr="transparent",n_={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const s=Uo(e||sr),i=s.valid&&Uo(t||sr);return i&&i.valid?i.mix(s,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class s_{constructor(t,n,s,i){const o=n[s];i=Ge([t.to,i,o,t.from]);const r=Ge([t.from,o,i]);this._active=!0,this._fn=t.fn||n_[t.type||typeof r],this._easing=rn[t.easing]||rn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=s,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(t,n,s){if(this._active){this._notify(!1);const i=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ge([t.to,n,i,t.from]),this._from=Ge([t.from,i,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,s=this._duration,i=this._prop,o=this._from,r=this._loop,a=this._to;let c;if(this._active=o!==a&&(r||n<s),!this._active){this._target[i]=a,this._notify(!0);return}if(n<0){this._target[i]=o;return}c=n/s%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[i]=this._fn(o,a,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,s)=>{t.push({res:n,rej:s})})}_notify(t){const n=t?"res":"rej",s=this._promises||[];for(let i=0;i<s.length;i++)s[i][n]()}}class Dc{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!$(t))return;const n=Object.keys(st.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!$(o))return;const r={};for(const a of n)r[a]=o[a];(nt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,n){const s=n.options,i=o_(t,s);if(!i)return[];const o=this._createAnimations(i,s);return s.$shared&&i_(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,n){const s=this._properties,i=[],o=t.$animations||(t.$animations={}),r=Object.keys(n),a=Date.now();let c;for(c=r.length-1;c>=0;--c){const l=r[c];if(l.charAt(0)==="$")continue;if(l==="options"){i.push(...this._animateOptions(t,n));continue}const u=n[l];let h=o[l];const d=s.get(l);if(h)if(d&&h.active()){h.update(d,u,a);continue}else h.cancel();if(!d||!d.duration){t[l]=u;continue}o[l]=h=new s_(d,t,l,u),i.push(h)}return i}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const s=this._createAnimations(t,n);if(s.length)return Zt.add(this._chart,s),!0}}function i_(e,t){const n=[],s=Object.keys(t);for(let i=0;i<s.length;i++){const o=e[s[i]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function o_(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function ir(e,t){const n=e&&e.options||{},s=n.reverse,i=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:s?o:i,end:s?i:o}}function r_(e,t,n){if(n===!1)return!1;const s=ir(e,n),i=ir(t,n);return{top:i.end,right:s.end,bottom:i.start,left:s.start}}function a_(e){let t,n,s,i;return $(e)?(t=e.top,n=e.right,s=e.bottom,i=e.left):t=n=s=i=e,{top:t,right:n,bottom:s,left:i,disabled:e===!1}}function Lc(e,t){const n=[],s=e._getSortedDatasetMetas(t);let i,o;for(i=0,o=s.length;i<o;++i)n.push(s[i].index);return n}function or(e,t,n,s={}){const i=e.keys,o=s.mode==="single";let r,a,c,l;if(t===null)return;let u=!1;for(r=0,a=i.length;r<a;++r){if(c=+i[r],c===n){if(u=!0,s.all)continue;break}l=e.values[c],at(l)&&(o||t===0||jt(t)===jt(l))&&(t+=l)}return!u&&!s.all?0:t}function c_(e,t){const{iScale:n,vScale:s}=t,i=n.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length);let c,l,u;for(c=0,l=r.length;c<l;++c)u=r[c],a[c]={[i]:u,[o]:e[u]};return a}function js(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function l_(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function u_(e){const{min:t,max:n,minDefined:s,maxDefined:i}=e.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:i?n:Number.POSITIVE_INFINITY}}function h_(e,t,n){const s=e[t]||(e[t]={});return s[n]||(s[n]={})}function rr(e,t,n,s){for(const i of t.getMatchingVisibleMetas(s).reverse()){const o=e[i.index];if(n&&o>0||!n&&o<0)return i.index}return null}function ar(e,t){const{chart:n,_cachedMeta:s}=e,i=n._stacks||(n._stacks={}),{iScale:o,vScale:r,index:a}=s,c=o.axis,l=r.axis,u=l_(o,r,s),h=t.length;let d;for(let f=0;f<h;++f){const p=t[f],{[c]:g,[l]:m}=p,b=p._stacks||(p._stacks={});d=b[l]=h_(i,u,g),d[a]=m,d._top=rr(d,r,!0,s.type),d._bottom=rr(d,r,!1,s.type);const x=d._visualValues||(d._visualValues={});x[a]=m}}function Bs(e,t){const n=e.scales;return Object.keys(n).filter(s=>n[s].axis===t).shift()}function d_(e,t){return ce(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function f_(e,t,n){return ce(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function We(e,t){const n=e.controller.index,s=e.vScale&&e.vScale.axis;if(s){t=t||e._parsed;for(const i of t){const o=i._stacks;if(!o||o[s]===void 0||o[s][n]===void 0)return;delete o[s][n],o[s]._visualValues!==void 0&&o[s]._visualValues[n]!==void 0&&delete o[s]._visualValues[n]}}}const Zs=e=>e==="reset"||e==="none",cr=(e,t)=>t?e:Object.assign({},e),p_=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Lc(n,!0),values:null};class Nt{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=js(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&We(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,s=this.getDataset(),i=(h,d,f,p)=>h==="x"?d:h==="r"?p:f,o=n.xAxisID=E(s.xAxisID,Bs(t,"x")),r=n.yAxisID=E(s.yAxisID,Bs(t,"y")),a=n.rAxisID=E(s.rAxisID,Bs(t,"r")),c=n.indexAxis,l=n.iAxisID=i(c,o,r,a),u=n.vAxisID=i(c,r,o,a);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(r),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(l),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Vo(this._data,this),t._stacked&&We(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),s=this._data;if($(n)){const i=this._cachedMeta;this._data=c_(n,i)}else if(s!==n){if(s){Vo(s,this);const i=this._cachedMeta;We(i),i._parsed=[]}n&&Object.isExtensible(n)&&Gm(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,s=this.getDataset();let i=!1;this._dataCheck();const o=n._stacked;n._stacked=js(n.vScale,n),n.stack!==s.stack&&(i=!0,We(n),n.stack=s.stack),this._resyncElements(t),(i||o!==n._stacked)&&(ar(this,n._parsed),n._stacked=js(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:s,_data:i}=this,{iScale:o,_stacked:r}=s,a=o.axis;let c=t===0&&n===i.length?!0:s._sorted,l=t>0&&s._parsed[t-1],u,h,d;if(this._parsing===!1)s._parsed=i,s._sorted=!0,d=i;else{nt(i[t])?d=this.parseArrayData(s,i,t,n):$(i[t])?d=this.parseObjectData(s,i,t,n):d=this.parsePrimitiveData(s,i,t,n);const f=()=>h[a]===null||l&&h[a]<l[a];for(u=0;u<n;++u)s._parsed[u+t]=h=d[u],c&&(f()&&(c=!1),l=h);s._sorted=c}r&&ar(this,d)}parsePrimitiveData(t,n,s,i){const{iScale:o,vScale:r}=t,a=o.axis,c=r.axis,l=o.getLabels(),u=o===r,h=new Array(i);let d,f,p;for(d=0,f=i;d<f;++d)p=d+s,h[d]={[a]:u||o.parse(l[p],p),[c]:r.parse(n[p],p)};return h}parseArrayData(t,n,s,i){const{xScale:o,yScale:r}=t,a=new Array(i);let c,l,u,h;for(c=0,l=i;c<l;++c)u=c+s,h=n[u],a[c]={x:o.parse(h[0],u),y:r.parse(h[1],u)};return a}parseObjectData(t,n,s,i){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(i);let u,h,d,f;for(u=0,h=i;u<h;++u)d=u+s,f=n[d],l[u]={x:o.parse(ie(f,a),d),y:r.parse(ie(f,c),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,s){const i=this.chart,o=this._cachedMeta,r=n[t.axis],a={keys:Lc(i,!0),values:n._stacks[t.axis]._visualValues};return or(a,r,o.index,{mode:s})}updateRangeFromParsed(t,n,s,i){const o=s[n.axis];let r=o===null?NaN:o;const a=i&&s._stacks[n.axis];i&&a&&(i.values=a,r=or(i,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,n){const s=this._cachedMeta,i=s._parsed,o=s._sorted&&t===s.iScale,r=i.length,a=this._getOtherScale(t),c=p_(n,s,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=u_(a);let d,f;function p(){f=i[d];const g=f[a.axis];return!at(f[t.axis])||u>g||h<g}for(d=0;d<r&&!(!p()&&(this.updateRangeFromParsed(l,t,f,c),o));++d);if(o){for(d=r-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(l,t,f,c);break}}return l}getAllParsedValues(t){const n=this._cachedMeta._parsed,s=[];let i,o,r;for(i=0,o=n.length;i<o;++i)r=n[i][t.axis],at(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,s=n.iScale,i=n.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:i?""+i.getLabelForValue(o[i.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=a_(E(this.options.clip,r_(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,s=this._cachedMeta,i=s.data||[],o=n.chartArea,r=[],a=this._drawStart||0,c=this._drawCount||i.length-a,l=this.options.drawActiveElementsOnTop;let u;for(s.dataset&&s.dataset.draw(t,o,a,c),u=a;u<a+c;++u){const h=i[u];h.hidden||(h.active&&l?r.push(h):h.draw(t,o))}for(u=0;u<r.length;++u)r[u].draw(t,o)}getStyle(t,n){const s=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,n,s){const i=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=f_(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=i.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=d_(this.chart.getContext(),this.index)),o.dataset=i,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",s){const i=n==="active",o=this._cachedDataOpts,r=t+"-"+n,a=o[r],c=this.enableOptionSharing&&pn(s);if(a)return cr(a,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,t),h=i?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),u),f=Object.keys(st.elements[t]),p=()=>this.getContext(s,i,n),g=l.resolveNamedOptions(d,f,p,h);return g.$shared&&(g.$shared=c,o[r]=Object.freeze(cr(g,c))),g}_resolveAnimations(t,n,s){const i=this.chart,o=this._cachedDataOpts,r=`animation-${n}`,a=o[r];if(a)return a;let c;if(i.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),d=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(d,this.getContext(t,s,n))}const l=new Dc(i,c&&c.animations);return c&&c._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||Zs(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const s=this.resolveDataElementOptions(t,n),i=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(n,o)||o!==i;return this.updateSharedOptions(o,n,s),{sharedOptions:o,includeOptions:r}}updateElement(t,n,s,i){Zs(i)?Object.assign(t,s):this._resolveAnimations(n,i).update(t,s)}updateSharedOptions(t,n,s){t&&!Zs(n)&&this._resolveAnimations(void 0,n).update(t,s)}_setStyle(t,n,s,i){t.active=i;const o=this.getStyle(n,i);this._resolveAnimations(n,s,i).update(t,{options:!i&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,n,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,s=this._cachedMeta.data;for(const[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const i=s.length,o=n.length,r=Math.min(o,i);r&&this.parse(0,r),o>i?this._insertElements(i,o-i,t):o<i&&this._removeElements(o,i-o)}_insertElements(t,n,s=!0){const i=this._cachedMeta,o=i.data,r=t+n;let a;const c=l=>{for(l.length+=n,a=l.length-1;a>=r;a--)l[a]=l[a-n]};for(c(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&c(i._parsed),this.parse(t,n),s&&this.updateElements(o,t,n,"reset")}updateElements(t,n,s,i){}_removeElements(t,n){const s=this._cachedMeta;if(this._parsing){const i=s._parsed.splice(t,n);s._stacked&&We(s,i)}s.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,s,i]=t;this[n](s,i)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(Nt,"defaults",{}),P(Nt,"datasetElementType",null),P(Nt,"dataElementType",null);function g_(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let s=[];for(let i=0,o=n.length;i<o;i++)s=s.concat(n[i].controller.getAllParsedValues(e));e._cache.$bar=gc(s.sort((i,o)=>i-o))}return e._cache.$bar}function m_(e){const t=e.iScale,n=g_(t,e.type);let s=t._length,i,o,r,a;const c=()=>{r===32767||r===-32768||(pn(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(i=0,o=n.length;i<o;++i)r=t.getPixelForValue(n[i]),c();for(a=void 0,i=0,o=t.ticks.length;i<o;++i)r=t.getPixelForTick(i),c();return s}function b_(e,t,n,s){const i=n.barThickness;let o,r;return N(i)?(o=t.min*n.categoryPercentage,r=n.barPercentage):(o=i*s,r=1),{chunk:o/s,ratio:r,start:t.pixels[e]-o/2}}function __(e,t,n,s){const i=t.pixels,o=i[e];let r=e>0?i[e-1]:null,a=e<i.length-1?i[e+1]:null;const c=n.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const l=o-(o-Math.min(r,a))/2*c;return{chunk:Math.abs(a-r)/2*c/s,ratio:n.barPercentage,start:l}}function y_(e,t,n,s){const i=n.parse(e[0],s),o=n.parse(e[1],s),r=Math.min(i,o),a=Math.max(i,o);let c=r,l=a;Math.abs(r)>Math.abs(a)&&(c=a,l=r),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:o,min:r,max:a}}function Nc(e,t,n,s){return nt(e)?y_(e,t,n,s):t[n.axis]=n.parse(e,s),t}function lr(e,t,n,s){const i=e.iScale,o=e.vScale,r=i.getLabels(),a=i===o,c=[];let l,u,h,d;for(l=n,u=n+s;l<u;++l)d=t[l],h={},h[i.axis]=a||i.parse(r[l],l),c.push(Nc(d,h,o,l));return c}function Vs(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function x_(e,t,n){return e!==0?jt(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function v_(e){let t,n,s,i,o;return e.horizontal?(t=e.base>e.x,n="left",s="right"):(t=e.base<e.y,n="bottom",s="top"),t?(i="end",o="start"):(i="start",o="end"),{start:n,end:s,reverse:t,top:i,bottom:o}}function w_(e,t,n,s){let i=t.borderSkipped;const o={};if(!i){e.borderSkipped=o;return}if(i===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:c,top:l,bottom:u}=v_(e);i==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===s?i=l:(n._bottom||0)===s?i=u:(o[ur(u,r,a,c)]=!0,i=l)),o[ur(i,r,a,c)]=!0,e.borderSkipped=o}function ur(e,t,n,s){return s?(e=k_(e,t,n),e=hr(e,n,t)):e=hr(e,t,n),e}function k_(e,t,n){return e===t?n:e===n?t:e}function hr(e,t,n){return e==="start"?t:e==="end"?n:e}function S_(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Gn extends Nt{parsePrimitiveData(t,n,s,i){return lr(t,n,s,i)}parseArrayData(t,n,s,i){return lr(t,n,s,i)}parseObjectData(t,n,s,i){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=o.axis==="x"?a:c,u=r.axis==="x"?a:c,h=[];let d,f,p,g;for(d=s,f=s+i;d<f;++d)g=n[d],p={},p[o.axis]=o.parse(ie(g,l),d),h.push(Nc(ie(g,u),p,r,d));return h}updateRangeFromParsed(t,n,s,i){super.updateRangeFromParsed(t,n,s,i);const o=s._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:s,vScale:i}=n,o=this.getParsed(t),r=o._custom,a=Vs(r)?"["+r.start+", "+r.end+"]":""+i.getLabelForValue(o[i.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,s,i){const o=i==="reset",{index:r,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),l=a.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(n,i);for(let f=n;f<n+s;f++){const p=this.getParsed(f),g=o||N(p[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,u),b=(p._stacks||{})[a.axis],x={horizontal:l,base:g.base,enableBorderRadius:!b||Vs(p._custom)||r===b._top||r===b._bottom,x:l?g.head:m.center,y:l?m.center:g.head,height:l?m.size:Math.abs(g.size),width:l?Math.abs(g.size):m.size};d&&(x.options=h||this.resolveDataElementOptions(f,t[f].active?"active":i));const M=x.options||t[f].options;w_(x,M,b,r),S_(x,M,u.ratio),this.updateElement(t[f],f,x,i)}}_getStacks(t,n){const{iScale:s}=this._cachedMeta,i=s.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=s.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(n),c=a&&a[s.axis],l=u=>{const h=u._parsed.find(f=>f[s.axis]===c),d=h&&h[u.vScale.axis];if(N(d)||isNaN(d))return!0};for(const u of i)if(!(n!==void 0&&l(u))&&((o===!1||r.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&r.push(u.stack),u.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)t[E(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,s){const i=this._getStacks(t,s),o=n!==void 0?i.indexOf(n):-1;return o===-1?i.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,s=n.iScale,i=[];let o,r;for(o=0,r=n.data.length;o<r;++o)i.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const a=t.barThickness;return{min:a||m_(n),pixels:i,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:s,index:i},options:{base:o,minBarLength:r}}=this,a=o||0,c=this.getParsed(t),l=c._custom,u=Vs(l);let h=c[n.axis],d=0,f=s?this.applyStack(n,c,s):h,p,g;f!==h&&(d=f-h,f=h),u&&(h=l.barStart,f=l.barEnd-l.barStart,h!==0&&jt(h)!==jt(l.barEnd)&&(d=0),d+=h);const m=!N(o)&&!u?o:d;let b=n.getPixelForValue(m);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(d+f):p=b,g=p-b,Math.abs(g)<r){g=x_(g,n,a)*r,h===a&&(b-=g/2);const x=n.getPixelForDecimal(0),M=n.getPixelForDecimal(1),S=Math.min(x,M),w=Math.max(x,M);b=Math.max(Math.min(b,w),S),p=b+g,s&&!u&&(c._stacks[n.axis]._visualValues[i]=n.getValueForPixel(p)-n.getValueForPixel(b))}if(b===n.getPixelForValue(a)){const x=jt(g)*n.getLineWidthForValue(a)/2;b+=x,g-=x}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(t,n){const s=n.scale,i=this.options,o=i.skipNull,r=E(i.maxBarThickness,1/0);let a,c;const l=this._getAxisCount();if(n.grouped){const u=o?this._getStackCount(t):n.stackCount,h=i.barThickness==="flex"?__(t,n,i,u*l):b_(t,n,i,u*l),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(E(d,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;a=h.start+h.chunk*p+h.chunk/2,c=Math.min(r,h.chunk*h.ratio)}else a=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(r,n.min*n.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const t=this._cachedMeta,n=t.vScale,s=t.data,i=s.length;let o=0;for(;o<i;++o)this.getParsed(o)[n.axis]!==null&&!s[o].hidden&&s[o].draw(this._ctx)}}P(Gn,"id","bar"),P(Gn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Gn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Qn extends Nt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,s,i){const o=super.parsePrimitiveData(t,n,s,i);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+s).radius;return o}parseArrayData(t,n,s,i){const o=super.parseArrayData(t,n,s,i);for(let r=0;r<o.length;r++){const a=n[s+r];o[r]._custom=E(a[2],this.resolveDataElementOptions(r+s).radius)}return o}parseObjectData(t,n,s,i){const o=super.parseObjectData(t,n,s,i);for(let r=0;r<o.length;r++){const a=n[s+r];o[r]._custom=E(a&&a.r&&+a.r,this.resolveDataElementOptions(r+s).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let s=t.length-1;s>=0;--s)n=Math.max(n,t[s].size(this.resolveDataElementOptions(s))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:o}=n,r=this.getParsed(t),a=i.getLabelForValue(r.x),c=o.getLabelForValue(r.y),l=r._custom;return{label:s[t]||"",value:"("+a+", "+c+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(n,i),u=r.axis,h=a.axis;for(let d=n;d<n+s;d++){const f=t[d],p=!o&&this.getParsed(d),g={},m=g[u]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[u]),b=g[h]=o?a.getBasePixel():a.getPixelForValue(p[h]);g.skip=isNaN(m)||isNaN(b),l&&(g.options=c||this.resolveDataElementOptions(d,f.active?"active":i),o&&(g.options.radius=0)),this.updateElement(f,d,g,i)}}resolveDataElementOptions(t,n){const s=this.getParsed(t);let i=super.resolveDataElementOptions(t,n);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const o=i.radius;return n!=="active"&&(i.radius=0),i.radius+=E(s&&s._custom,o),i}}P(Qn,"id","bubble"),P(Qn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(Qn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function M_(e,t,n){let s=1,i=1,o=0,r=0;if(t<G){const a=e,c=a+t,l=Math.cos(a),u=Math.sin(a),h=Math.cos(c),d=Math.sin(c),f=(M,S,w)=>gn(M,a,c,!0)?1:Math.max(S,S*n,w,w*n),p=(M,S,w)=>gn(M,a,c,!0)?-1:Math.min(S,S*n,w,w*n),g=f(0,l,h),m=f(lt,u,d),b=p(Z,l,h),x=p(Z+lt,u,d);s=(g-b)/2,i=(m-x)/2,o=-(g+b)/2,r=-(m+x)/2}return{ratioX:s,ratioY:i,offsetX:o,offsetY:r}}class ye extends Nt{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const s=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=s;else{let o=c=>+s[c];if($(s[t])){const{key:c="value"}=this._parsing;o=l=>+ie(s[l],c)}let r,a;for(r=t,a=t+n;r<a;++r)i._parsed[r]=o(r)}}_getRotation(){return Lt(this.options.rotation-90)}_getCircumference(){return Lt(this.options.circumference)}_getRotationExtents(){let t=G,n=-G;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const i=this.chart.getDatasetMeta(s).controller,o=i._getRotation(),r=i._getCircumference();t=Math.min(t,o),n=Math.max(n,o+r)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:s}=n,i=this._cachedMeta,o=i.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(s.width,s.height)-r)/2,0),c=Math.min(Nm(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:p,offsetY:g}=M_(h,u,c),m=(s.width-r)/d,b=(s.height-r)/f,x=Math.max(Math.min(m,b)/2,0),M=uc(this.options.radius,x),S=Math.max(M*c,0),w=(M-S)/this._getVisibleDatasetWeightTotal();this.offsetX=p*M,this.offsetY=g*M,i.total=this.calculateTotal(),this.outerRadius=M-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const s=this.options,i=this._cachedMeta,o=this._getCircumference();return n&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*o/G)}updateElements(t,n,s,i){const o=i==="reset",r=this.chart,a=r.chartArea,l=r.options.animation,u=(a.left+a.right)/2,h=(a.top+a.bottom)/2,d=o&&l.animateScale,f=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:g,includeOptions:m}=this._getSharedOptions(n,i);let b=this._getRotation(),x;for(x=0;x<n;++x)b+=this._circumference(x,o);for(x=n;x<n+s;++x){const M=this._circumference(x,o),S=t[x],w={x:u+this.offsetX,y:h+this.offsetY,startAngle:b,endAngle:b+M,circumference:M,outerRadius:p,innerRadius:f};m&&(w.options=g||this.resolveDataElementOptions(x,S.active?"active":i)),b+=M,this.updateElement(S,x,w,i)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let s=0,i;for(i=0;i<n.length;i++){const o=t._parsed[i];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(i)&&!n[i].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?G*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=zn(n._parsed[t],s.options.locale);return{label:i[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const s=this.chart;let i,o,r,a,c;if(!t){for(i=0,o=s.data.datasets.length;i<o;++i)if(s.isDatasetVisible(i)){r=s.getDatasetMeta(i),t=r.data,a=r.controller;break}}if(!t)return 0;for(i=0,o=t.length;i<o;++i)c=a.resolveDataElementOptions(i),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let s=0,i=t.length;s<i;++s){const o=this.resolveDataElementOptions(s);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(n+=this._getRingWeight(s));return n}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(ye,"id","doughnut"),P(ye,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(ye,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(ye,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:s,textAlign:i,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,l)=>{const h=t.getDatasetMeta(0).controller.getStyle(l);return{text:c,fillStyle:h.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(l),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:i,pointStyle:s,borderRadius:r&&(a||h.borderRadius),index:l}}):[]}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update()}}}});class ts extends Nt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:s,data:i=[],_dataset:o}=n,r=this.chart._animationsDisabled;let{start:a,count:c}=_c(n,i,r);this._drawStart=a,this._drawCount=c,yc(n)&&(a=0,c=i.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=i;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:l},t),this.updateElements(i,a,c,t)}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,i),d=r.axis,f=a.axis,{spanGaps:p,segment:g}=this.options,m=Ne(p)?p:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||i==="none",x=n+s,M=t.length;let S=n>0&&this.getParsed(n-1);for(let w=0;w<M;++w){const C=t[w],T=b?C:{};if(w<n||w>=x){T.skip=!0;continue}const O=this.getParsed(w),z=N(O[f]),A=T[d]=r.getPixelForValue(O[d],w),D=T[f]=o||z?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,O,c):O[f],w);T.skip=isNaN(A)||isNaN(D)||z,T.stop=w>0&&Math.abs(O[d]-S[d])>m,g&&(T.parsed=O,T.raw=l.data[w]),h&&(T.options=u||this.resolveDataElementOptions(w,C.active?"active":i)),b||this.updateElement(C,w,T,i),S=O}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,s=n.options&&n.options.borderWidth||0,i=t.data||[];if(!i.length)return s;const o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(ts,"id","line"),P(ts,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(ts,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class cn extends Nt{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,s=this.chart,i=s.data.labels||[],o=zn(n._parsed[t].r,s.options.locale);return{label:i[t]||"",value:o}}parseObjectData(t,n,s,i){return Tc.bind(this)(t,n,s,i)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,i)=>{const o=this.getParsed(i).r;!isNaN(o)&&this.chart.getDataVisibility(i)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,s=t.options,i=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(i/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,n,s,i){const o=i==="reset",r=this.chart,c=r.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*Z;let f=d,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)f+=this._computeAngle(p,i,g);for(p=n;p<n+s;p++){const m=t[p];let b=f,x=f+this._computeAngle(p,i,g),M=r.getDataVisibility(p)?l.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=x,o&&(c.animateScale&&(M=0),c.animateRotate&&(b=x=d));const S={x:u,y:h,innerRadius:0,outerRadius:M,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(p,m.active?"active":i)};this.updateElement(m,p,S,i)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((s,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&n++}),n}_computeAngle(t,n,s){return this.chart.getDataVisibility(t)?Lt(this.resolveDataElementOptions(t,n).angle||s):0}}P(cn,"id","polarArea"),P(cn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(cn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:s,color:i}}=t.legend.options;return n.labels.map((o,r)=>{const c=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:i,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,n,s){s.chart.toggleDataVisibility(n.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ci extends ye{}P(ci,"id","pie"),P(ci,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class es extends Nt{getLabelAndValue(t){const n=this._cachedMeta.vScale,s=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(s[n.axis])}}parseObjectData(t,n,s,i){return Tc.bind(this)(t,n,s,i)}update(t){const n=this._cachedMeta,s=n.dataset,i=n.data||[],o=n.iScale.getLabels();if(s.points=i,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===i.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(i,0,i.length,t)}updateElements(t,n,s,i){const o=this._cachedMeta.rScale,r=i==="reset";for(let a=n;a<n+s;a++){const c=t[a],l=this.resolveDataElementOptions(a,c.active?"active":i),u=o.getPointPositionForValue(a,this.getParsed(a).r),h=r?o.xCenter:u.x,d=r?o.yCenter:u.y,f={x:h,y:d,angle:u.angle,skip:isNaN(h)||isNaN(d),options:l};this.updateElement(c,a,f,i)}}}P(es,"id","radar"),P(es,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(es,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ns extends Nt{getLabelAndValue(t){const n=this._cachedMeta,s=this.chart.data.labels||[],{xScale:i,yScale:o}=n,r=this.getParsed(t),a=i.getLabelForValue(r.x),c=o.getLabelForValue(r.y);return{label:s[t]||"",value:"("+a+", "+c+")"}}update(t){const n=this._cachedMeta,{data:s=[]}=n,i=this.chart._animationsDisabled;let{start:o,count:r}=_c(n,s,i);if(this._drawStart=o,this._drawCount=r,yc(n)&&(o=0,r=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=n;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=s;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:l},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(s,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,s,i){const o=i==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(n,i),h=this.getSharedOptions(u),d=this.includeOptions(i,h),f=r.axis,p=a.axis,{spanGaps:g,segment:m}=this.options,b=Ne(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||i==="none";let M=n>0&&this.getParsed(n-1);for(let S=n;S<n+s;++S){const w=t[S],C=this.getParsed(S),T=x?w:{},O=N(C[p]),z=T[f]=r.getPixelForValue(C[f],S),A=T[p]=o||O?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,C,c):C[p],S);T.skip=isNaN(z)||isNaN(A)||O,T.stop=S>0&&Math.abs(C[f]-M[f])>b,m&&(T.parsed=C,T.raw=l.data[S]),d&&(T.options=h||this.resolveDataElementOptions(S,w.active?"active":i)),x||this.updateElement(w,S,T,i),M=C}this.updateSharedOptions(h,i,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let a=0;for(let c=n.length-1;c>=0;--c)a=Math.max(a,n[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const s=t.dataset,i=s.options&&s.options.borderWidth||0;if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}}P(ns,"id","scatter"),P(ns,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(ns,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var P_=Object.freeze({__proto__:null,BarController:Gn,BubbleController:Qn,DoughnutController:ye,LineController:ts,PieController:ci,PolarAreaController:cn,RadarController:es,ScatterController:ns});function pe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class lo{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(lo.prototype,t)}init(){}formats(){return pe()}parse(){return pe()}format(){return pe()}add(){return pe()}diff(){return pe()}startOf(){return pe()}endOf(){return pe()}}var T_={_date:lo};function C_(e,t,n,s){const{controller:i,data:o,_sorted:r}=e,a=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Km:Yt;if(s){if(i._sharedOptions){const u=o[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const d=l(o,t,n-h),f=l(o,t,n+h);return{lo:d.lo,hi:f.hi}}}}else{const u=l(o,t,n);if(c){const{vScale:h}=i._cachedMeta,{_parsed:d}=e,f=d.slice(0,u.lo+1).reverse().findIndex(g=>!N(g[h.axis]));u.lo-=Math.max(0,f);const p=d.slice(u.hi).findIndex(g=>!N(g[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:o.length-1}}function Es(e,t,n,s,i){const o=e.getSortedVisibleDatasetMetas(),r=n[t];for(let a=0,c=o.length;a<c;++a){const{index:l,data:u}=o[a],{lo:h,hi:d}=C_(o[a],t,r,i);for(let f=h;f<=d;++f){const p=u[f];p.skip||s(p,l,f)}}}function O_(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(s,i){const o=t?Math.abs(s.x-i.x):0,r=n?Math.abs(s.y-i.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ws(e,t,n,s,i){const o=[];return!i&&!e.isPointInArea(t)||Es(e,n,t,function(a,c,l){!i&&!Jt(a,e.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function z_(e,t,n,s){let i=[];function o(r,a,c){const{startAngle:l,endAngle:u}=r.getProps(["startAngle","endAngle"],s),{angle:h}=fc(r,{x:t.x,y:t.y});gn(h,l,u)&&i.push({element:r,datasetIndex:a,index:c})}return Es(e,n,t,o),i}function R_(e,t,n,s,i,o){let r=[];const a=O_(n);let c=Number.POSITIVE_INFINITY;function l(u,h,d){const f=u.inRange(t.x,t.y,i);if(s&&!f)return;const p=u.getCenterPoint(i);if(!(!!o||e.isPointInArea(p))&&!f)return;const m=a(t,p);m<c?(r=[{element:u,datasetIndex:h,index:d}],c=m):m===c&&r.push({element:u,datasetIndex:h,index:d})}return Es(e,n,t,l),r}function qs(e,t,n,s,i,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!s?z_(e,t,n,i):R_(e,t,n,s,i,o)}function dr(e,t,n,s,i){const o=[],r=n==="x"?"inXRange":"inYRange";let a=!1;return Es(e,n,t,(c,l,u)=>{c[r]&&c[r](t[n],i)&&(o.push({element:c,datasetIndex:l,index:u}),a=a||c.inRange(t.x,t.y,i))}),s&&!a?[]:o}var I_={modes:{index(e,t,n,s){const i=be(t,e),o=n.axis||"x",r=n.includeInvisible||!1,a=n.intersect?Ws(e,i,o,s,r):qs(e,i,o,!1,s,r),c=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(l=>{const u=a[0].index,h=l.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:l.index,index:u})}),c):[]},dataset(e,t,n,s){const i=be(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;let a=n.intersect?Ws(e,i,o,s,r):qs(e,i,o,!1,s,r);if(a.length>0){const c=a[0].datasetIndex,l=e.getDatasetMeta(c).data;a=[];for(let u=0;u<l.length;++u)a.push({element:l[u],datasetIndex:c,index:u})}return a},point(e,t,n,s){const i=be(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return Ws(e,i,o,s,r)},nearest(e,t,n,s){const i=be(t,e),o=n.axis||"xy",r=n.includeInvisible||!1;return qs(e,i,o,n.intersect,s,r)},x(e,t,n,s){const i=be(t,e);return dr(e,i,"x",n.intersect,s)},y(e,t,n,s){const i=be(t,e);return dr(e,i,"y",n.intersect,s)}}};const $c=["left","top","right","bottom"];function qe(e,t){return e.filter(n=>n.pos===t)}function fr(e,t){return e.filter(n=>$c.indexOf(n.pos)===-1&&n.box.axis===t)}function Ue(e,t){return e.sort((n,s)=>{const i=t?s:n,o=t?n:s;return i.weight===o.weight?i.index-o.index:i.weight-o.weight})}function E_(e){const t=[];let n,s,i,o,r,a;for(n=0,s=(e||[]).length;n<s;++n)i=e[n],{position:o,options:{stack:r,stackWeight:a=1}}=i,t.push({index:n,box:i,pos:o,horizontal:i.isHorizontal(),weight:i.weight,stack:r&&o+r,stackWeight:a});return t}function A_(e){const t={};for(const n of e){const{stack:s,pos:i,stackWeight:o}=n;if(!s||!$c.includes(i))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function D_(e,t){const n=A_(e),{vBoxMaxWidth:s,hBoxMaxHeight:i}=t;let o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];const{fullSize:c}=a.box,l=n[a.stack],u=l&&a.stackWeight/l.weight;a.horizontal?(a.width=u?u*s:c&&t.availableWidth,a.height=i):(a.width=s,a.height=u?u*i:c&&t.availableHeight)}return n}function L_(e){const t=E_(e),n=Ue(t.filter(l=>l.box.fullSize),!0),s=Ue(qe(t,"left"),!0),i=Ue(qe(t,"right")),o=Ue(qe(t,"top"),!0),r=Ue(qe(t,"bottom")),a=fr(t,"x"),c=fr(t,"y");return{fullSize:n,leftAndTop:s.concat(o),rightAndBottom:i.concat(c).concat(r).concat(a),chartArea:qe(t,"chartArea"),vertical:s.concat(i).concat(c),horizontal:o.concat(r).concat(a)}}function pr(e,t,n,s){return Math.max(e[n],t[n])+Math.max(e[s],t[s])}function Fc(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function N_(e,t,n,s){const{pos:i,box:o}=n,r=e.maxPadding;if(!$(i)){n.size&&(e[i]-=n.size);const h=s[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[i]+=n.size}o.getPadding&&Fc(r,o.getPadding());const a=Math.max(0,t.outerWidth-pr(r,e,"left","right")),c=Math.max(0,t.outerHeight-pr(r,e,"top","bottom")),l=a!==e.w,u=c!==e.h;return e.w=a,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function $_(e){const t=e.maxPadding;function n(s){const i=Math.max(t[s]-e[s],0);return e[s]+=i,i}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function F_(e,t){const n=t.maxPadding;function s(i){const o={left:0,top:0,right:0,bottom:0};return i.forEach(r=>{o[r]=Math.max(t[r],n[r])}),o}return s(e?["left","right"]:["top","bottom"])}function Qe(e,t,n,s){const i=[];let o,r,a,c,l,u;for(o=0,r=e.length,l=0;o<r;++o){a=e[o],c=a.box,c.update(a.width||t.w,a.height||t.h,F_(a.horizontal,t));const{same:h,other:d}=N_(t,n,a,s);l|=h&&i.length,u=u||d,c.fullSize||i.push(a)}return l&&Qe(i,t,n,s)||u}function Bn(e,t,n,s,i){e.top=n,e.left=t,e.right=t+s,e.bottom=n+i,e.width=s,e.height=i}function gr(e,t,n,s){const i=n.padding;let{x:o,y:r}=t;for(const a of e){const c=a.box,l=s[a.stack]||{placed:0,weight:1},u=a.stackWeight/l.weight||1;if(a.horizontal){const h=t.w*u,d=l.size||c.height;pn(l.start)&&(r=l.start),c.fullSize?Bn(c,i.left,r,n.outerWidth-i.right-i.left,d):Bn(c,t.left+l.placed,r,h,d),l.start=r,l.placed+=h,r=c.bottom}else{const h=t.h*u,d=l.size||c.width;pn(l.start)&&(o=l.start),c.fullSize?Bn(c,o,i.top,d,n.outerHeight-i.bottom-i.top):Bn(c,o,t.top+l.placed,d,h),l.start=o,l.placed+=h,o=c.right}}t.x=o,t.y=r}var xt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,s){if(!e)return;const i=vt(e.options.layout.padding),o=Math.max(t-i.width,0),r=Math.max(n-i.height,0),a=L_(e.boxes),c=a.vertical,l=a.horizontal;U(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/u,hBoxMaxHeight:r/2}),d=Object.assign({},i);Fc(d,vt(s));const f=Object.assign({maxPadding:d,w:o,h:r,x:i.left,y:i.top},i),p=D_(c.concat(l),h);Qe(a.fullSize,f,h,p),Qe(c,f,h,p),Qe(l,f,h,p)&&Qe(c,f,h,p),$_(f),gr(a.leftAndTop,f,h,p),f.x+=f.w,f.y+=f.h,gr(a.rightAndBottom,f,h,p),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},U(a.chartArea,g=>{const m=g.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Hc{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,s){}removeEventListener(t,n,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,s,i){return n=Math.max(0,n||t.width),s=s||t.height,{width:n,height:Math.max(0,i?Math.floor(n/i):s)}}isAttached(t){return!0}updateConfig(t){}}class H_ extends Hc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ss="$chartjs",j_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mr=e=>e===null||e==="";function B_(e,t){const n=e.style,s=e.getAttribute("height"),i=e.getAttribute("width");if(e[ss]={initial:{height:s,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",mr(i)){const o=Qo(e,"width");o!==void 0&&(e.width=o)}if(mr(s))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Qo(e,"height");o!==void 0&&(e.height=o)}return e}const jc=Zb?{passive:!0}:!1;function Z_(e,t,n){e&&e.addEventListener(t,n,jc)}function V_(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,jc)}function W_(e,t){const n=j_[e.type]||e.type,{x:s,y:i}=be(e,t);return{type:n,chart:t,native:e,x:s!==void 0?s:null,y:i!==void 0?i:null}}function bs(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function q_(e,t,n){const s=e.canvas,i=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||bs(a.addedNodes,s),r=r&&!bs(a.removedNodes,s);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function U_(e,t,n){const s=e.canvas,i=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||bs(a.removedNodes,s),r=r&&!bs(a.addedNodes,s);r&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}const bn=new Map;let br=0;function Bc(){const e=window.devicePixelRatio;e!==br&&(br=e,bn.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Y_(e,t){bn.size||window.addEventListener("resize",Bc),bn.set(e,t)}function J_(e){bn.delete(e),bn.size||window.removeEventListener("resize",Bc)}function K_(e,t,n){const s=e.canvas,i=s&&co(s);if(!i)return;const o=bc((a,c)=>{const l=i.clientWidth;n(a,c),l<i.clientWidth&&n()},window),r=new ResizeObserver(a=>{const c=a[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||o(l,u)});return r.observe(i),Y_(e,o),r}function Us(e,t,n){n&&n.disconnect(),t==="resize"&&J_(e)}function X_(e,t,n){const s=e.canvas,i=bc(o=>{e.ctx!==null&&n(W_(o,e))},e);return Z_(s,t,i),i}class G_ extends Hc{acquireContext(t,n){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(B_(t,n),s):null}releaseContext(t){const n=t.canvas;if(!n[ss])return!1;const s=n[ss].initial;["height","width"].forEach(o=>{const r=s[o];N(r)?n.removeAttribute(o):n.setAttribute(o,r)});const i=s.style||{};return Object.keys(i).forEach(o=>{n.style[o]=i[o]}),n.width=n.width,delete n[ss],!0}addEventListener(t,n,s){this.removeEventListener(t,n);const i=t.$proxies||(t.$proxies={}),r={attach:q_,detach:U_,resize:K_}[n]||X_;i[n]=r(t,n,s)}removeEventListener(t,n){const s=t.$proxies||(t.$proxies={}),i=s[n];if(!i)return;({attach:Us,detach:Us,resize:Us}[n]||V_)(t,n,i),s[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,s,i){return Bb(t,n,s,i)}isAttached(t){const n=t&&co(t);return!!(n&&n.isConnected)}}function Q_(e){return!ao()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?H_:G_}class $t{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:n,y:s}=this.getProps(["x","y"],t);return{x:n,y:s}}hasValue(){return Ne(this.x)&&Ne(this.y)}getProps(t,n){const s=this.$animations;if(!n||!s)return this;const i={};return t.forEach(o=>{i[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),i}}P($t,"defaults",{}),P($t,"defaultRoutes");function ty(e,t){const n=e.options.ticks,s=ey(e),i=Math.min(n.maxTicksLimit||s,s),o=n.major.enabled?sy(t):[],r=o.length,a=o[0],c=o[r-1],l=[];if(r>i)return iy(t,l,o,r/i),l;const u=ny(o,t,i);if(r>0){let h,d;const f=r>1?Math.round((c-a)/(r-1)):null;for(Zn(t,l,u,N(f)?0:a-f,a),h=0,d=r-1;h<d;h++)Zn(t,l,u,o[h],o[h+1]);return Zn(t,l,u,c,N(f)?t.length:c+f),l}return Zn(t,l,u),l}function ey(e){const t=e.options.offset,n=e._tickSize(),s=e._length/n+(t?0:1),i=e._maxLength/n;return Math.floor(Math.min(s,i))}function ny(e,t,n){const s=oy(e),i=t.length/n;if(!s)return Math.max(i,1);const o=Wm(s);for(let r=0,a=o.length-1;r<a;r++){const c=o[r];if(c>i)return c}return Math.max(i,1)}function sy(e){const t=[];let n,s;for(n=0,s=e.length;n<s;n++)e[n].major&&t.push(n);return t}function iy(e,t,n,s){let i=0,o=n[0],r;for(s=Math.ceil(s),r=0;r<e.length;r++)r===o&&(t.push(e[r]),i++,o=n[i*s])}function Zn(e,t,n,s,i){const o=E(s,0),r=Math.min(E(i,e.length),e.length);let a=0,c,l,u;for(n=Math.ceil(n),i&&(c=i-s,n=c/Math.floor(c/n)),u=o;u<0;)a++,u=Math.round(o+a*n);for(l=Math.max(o,0);l<r;l++)l===u&&(t.push(e[l]),a++,u=Math.round(o+a*n))}function oy(e){const t=e.length;let n,s;if(t<2)return!1;for(s=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==s)return!1;return s}const ry=e=>e==="left"?"right":e==="right"?"left":e,_r=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,yr=(e,t)=>Math.min(t||e,e);function xr(e,t){const n=[],s=e.length/t,i=e.length;let o=0;for(;o<i;o+=s)n.push(e[Math.floor(o)]);return n}function ay(e,t,n){const s=e.ticks.length,i=Math.min(t,s-1),o=e._startPixel,r=e._endPixel,a=1e-6;let c=e.getPixelForTick(i),l;if(!(n&&(s===1?l=Math.max(c-o,r-c):t===0?l=(e.getPixelForTick(1)-c)/2:l=(c-e.getPixelForTick(i-1))/2,c+=i<t?l:-l,c<o-a||c>r+a)))return c}function cy(e,t){U(e,n=>{const s=n.gc,i=s.length/2;let o;if(i>t){for(o=0;o<i;++o)delete n.data[s[o]];s.splice(0,i)}})}function Ye(e){return e.drawTicks?e.tickLength:0}function vr(e,t){if(!e.display)return 0;const n=dt(e.font,t),s=vt(e.padding);return(nt(e.text)?e.text.length:1)*n.lineHeight+s.height}function ly(e,t){return ce(e,{scale:t,type:"scale"})}function uy(e,t,n){return ce(e,{tick:n,index:t,type:"tick"})}function hy(e,t,n){let s=eo(e);return(n&&t!=="right"||!n&&t==="right")&&(s=ry(s)),s}function dy(e,t,n,s){const{top:i,left:o,bottom:r,right:a,chart:c}=e,{chartArea:l,scales:u}=c;let h=0,d,f,p;const g=r-i,m=a-o;if(e.isHorizontal()){if(f=_t(s,o,a),$(n)){const b=Object.keys(n)[0],x=n[b];p=u[b].getPixelForValue(x)+g-t}else n==="center"?p=(l.bottom+l.top)/2+g-t:p=_r(e,n,t);d=a-o}else{if($(n)){const b=Object.keys(n)[0],x=n[b];f=u[b].getPixelForValue(x)-m+t}else n==="center"?f=(l.left+l.right)/2-m+t:f=_r(e,n,t);p=_t(s,r,i),h=n==="left"?-lt:lt}return{titleX:f,titleY:p,maxWidth:d,rotation:h}}class Me extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:s,_suggestedMax:i}=this;return t=Ct(t,Number.POSITIVE_INFINITY),n=Ct(n,Number.NEGATIVE_INFINITY),s=Ct(s,Number.POSITIVE_INFINITY),i=Ct(i,Number.NEGATIVE_INFINITY),{min:Ct(t,s),max:Ct(n,i),minDefined:at(t),maxDefined:at(n)}}getMinMax(t){let{min:n,max:s,minDefined:i,maxDefined:o}=this.getUserBounds(),r;if(i&&o)return{min:n,max:s};const a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)r=a[c].controller.getMinMax(this,t),i||(n=Math.min(n,r.min)),o||(s=Math.max(s,r.max));return n=o&&n>s?s:n,s=i&&n>s?n:s,{min:Ct(n,Ct(s,n)),max:Ct(s,Ct(n,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){K(this.options.beforeUpdate,[this])}update(t,n,s){const{beginAtZero:i,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xb(this,o,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?xr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=ty(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,s;this.isHorizontal()?(n=this.left,s=this.right):(n=this.top,s=this.bottom,t=!t),this._startPixel=n,this._endPixel=s,this._reversePixels=t,this._length=s-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){K(this.options.afterUpdate,[this])}beforeSetDimensions(){K(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){K(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),K(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){K(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let s,i,o;for(s=0,i=t.length;s<i;s++)o=t[s],o.label=K(n.callback,[o.value,s,t],this)}afterTickToLabelConversion(){K(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){K(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,s=yr(this.ticks.length,t.ticks.maxTicksLimit),i=n.minRotation||0,o=n.maxRotation;let r=i,a,c,l;if(!this._isVisible()||!n.display||i>=o||s<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),h=u.widest.width,d=u.highest.height,f=ft(this.chart.width-h,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),h+6>a&&(a=f/(s-(t.offset?.5:1)),c=this.maxHeight-Ye(t.grid)-n.padding-vr(t.title,this.chart.options.font),l=Math.sqrt(h*h+d*d),r=Qi(Math.min(Math.asin(ft((u.highest.height+6)/a,-1,1)),Math.asin(ft(c/l,-1,1))-Math.asin(ft(d/l,-1,1)))),r=Math.max(i,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){K(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){K(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:s,title:i,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const c=vr(i,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ye(o)+c):(t.height=this.maxHeight,t.width=Ye(o)+c),s.display&&this.ticks.length){const{first:l,last:u,widest:h,highest:d}=this._getLabelSizes(),f=s.padding*2,p=Lt(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=s.mirror?0:m*h.width+g*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:g*h.width+m*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(l,u,m,g)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,s,i){const{ticks:{align:o,padding:r},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;c?l?(d=i*t.width,f=s*n.height):(d=s*t.height,f=i*n.width):o==="start"?f=n.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,f=n.width/2),this.paddingLeft=Math.max((d-u+r)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-h+r)*this.width/(this.width-h),0)}else{let u=n.height/2,h=t.height/2;o==="start"?(u=0,h=t.height):o==="end"&&(u=n.height,h=0),this.paddingTop=u+r,this.paddingBottom=h+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){K(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,s;for(n=0,s=t.length;n<s;n++)N(t[n].label)&&(t.splice(n,1),s--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let s=this.ticks;n<s.length&&(s=xr(s,n)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,s){const{ctx:i,_longestTextCache:o}=this,r=[],a=[],c=Math.floor(n/yr(n,s));let l=0,u=0,h,d,f,p,g,m,b,x,M,S,w;for(h=0;h<n;h+=c){if(p=t[h].label,g=this._resolveTickFontOptions(h),i.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},x=g.lineHeight,M=S=0,!N(p)&&!nt(p))M=gs(i,b.data,b.gc,M,p),S=x;else if(nt(p))for(d=0,f=p.length;d<f;++d)w=p[d],!N(w)&&!nt(w)&&(M=gs(i,b.data,b.gc,M,w),S+=x);r.push(M),a.push(S),l=Math.max(M,l),u=Math.max(S,u)}cy(o,n);const C=r.indexOf(l),T=a.indexOf(u),O=z=>({width:r[z]||0,height:a[z]||0});return{first:O(0),last:O(n-1),widest:O(C),highest:O(T),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Jm(this._alignToPixels?fe(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const s=n[t];return s.$context||(s.$context=uy(this.getContext(),t,s))}return this.$context||(this.$context=ly(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Lt(this.labelRotation),s=Math.abs(Math.cos(n)),i=Math.abs(Math.sin(n)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,c=o?o.highest.height+r:0;return this.isHorizontal()?c*s>a*i?a/s:c/i:c*i<a*s?c/s:a/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,s=this.chart,i=this.options,{grid:o,position:r,border:a}=i,c=o.offset,l=this.isHorizontal(),h=this.ticks.length+(c?1:0),d=Ye(o),f=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(et){return fe(s,et,g)};let x,M,S,w,C,T,O,z,A,D,H,pt;if(r==="top")x=b(this.bottom),T=this.bottom-d,z=x-m,D=b(t.top)+m,pt=t.bottom;else if(r==="bottom")x=b(this.top),D=t.top,pt=b(t.bottom)-m,T=x+m,z=this.top+d;else if(r==="left")x=b(this.right),C=this.right-d,O=x-m,A=b(t.left)+m,H=t.right;else if(r==="right")x=b(this.left),A=t.left,H=b(t.right)-m,C=x+m,O=this.left+d;else if(n==="x"){if(r==="center")x=b((t.top+t.bottom)/2+.5);else if($(r)){const et=Object.keys(r)[0],ct=r[et];x=b(this.chart.scales[et].getPixelForValue(ct))}D=t.top,pt=t.bottom,T=x+m,z=T+d}else if(n==="y"){if(r==="center")x=b((t.left+t.right)/2);else if($(r)){const et=Object.keys(r)[0],ct=r[et];x=b(this.chart.scales[et].getPixelForValue(ct))}C=x-m,O=C-d,A=t.left,H=t.right}const Tt=E(i.ticks.maxTicksLimit,h),Y=Math.max(1,Math.ceil(h/Tt));for(M=0;M<h;M+=Y){const et=this.getContext(M),ct=o.setContext(et),Dt=a.setContext(et),bt=ct.lineWidth,Pe=ct.color,Rn=Dt.dash||[],Te=Dt.dashOffset,Ze=ct.tickWidth,le=ct.tickColor,Ve=ct.tickBorderDash||[],ue=ct.tickBorderDashOffset;S=ay(this,M,c),S!==void 0&&(w=fe(s,S,bt),l?C=O=A=H=w:T=z=D=pt=w,f.push({tx1:C,ty1:T,tx2:O,ty2:z,x1:A,y1:D,x2:H,y2:pt,width:bt,color:Pe,borderDash:Rn,borderDashOffset:Te,tickWidth:Ze,tickColor:le,tickBorderDash:Ve,tickBorderDashOffset:ue}))}return this._ticksLength=h,this._borderValue=x,f}_computeLabelItems(t){const n=this.axis,s=this.options,{position:i,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:u,mirror:h}=o,d=Ye(s.grid),f=d+u,p=h?-u:f,g=-Lt(this.labelRotation),m=[];let b,x,M,S,w,C,T,O,z,A,D,H,pt="middle";if(i==="top")C=this.bottom-p,T=this._getXAxisLabelAlignment();else if(i==="bottom")C=this.top+p,T=this._getXAxisLabelAlignment();else if(i==="left"){const Y=this._getYAxisLabelAlignment(d);T=Y.textAlign,w=Y.x}else if(i==="right"){const Y=this._getYAxisLabelAlignment(d);T=Y.textAlign,w=Y.x}else if(n==="x"){if(i==="center")C=(t.top+t.bottom)/2+f;else if($(i)){const Y=Object.keys(i)[0],et=i[Y];C=this.chart.scales[Y].getPixelForValue(et)+f}T=this._getXAxisLabelAlignment()}else if(n==="y"){if(i==="center")w=(t.left+t.right)/2-f;else if($(i)){const Y=Object.keys(i)[0],et=i[Y];w=this.chart.scales[Y].getPixelForValue(et)}T=this._getYAxisLabelAlignment(d).textAlign}n==="y"&&(c==="start"?pt="top":c==="end"&&(pt="bottom"));const Tt=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){M=a[b],S=M.label;const Y=o.setContext(this.getContext(b));O=this.getPixelForTick(b)+o.labelOffset,z=this._resolveTickFontOptions(b),A=z.lineHeight,D=nt(S)?S.length:1;const et=D/2,ct=Y.color,Dt=Y.textStrokeColor,bt=Y.textStrokeWidth;let Pe=T;r?(w=O,T==="inner"&&(b===x-1?Pe=this.options.reverse?"left":"right":b===0?Pe=this.options.reverse?"right":"left":Pe="center"),i==="top"?l==="near"||g!==0?H=-D*A+A/2:l==="center"?H=-Tt.highest.height/2-et*A+A:H=-Tt.highest.height+A/2:l==="near"||g!==0?H=A/2:l==="center"?H=Tt.highest.height/2-et*A:H=Tt.highest.height-D*A,h&&(H*=-1),g!==0&&!Y.showLabelBackdrop&&(w+=A/2*Math.sin(g))):(C=O,H=(1-D)*A/2);let Rn;if(Y.showLabelBackdrop){const Te=vt(Y.backdropPadding),Ze=Tt.heights[b],le=Tt.widths[b];let Ve=H-Te.top,ue=0-Te.left;switch(pt){case"middle":Ve-=Ze/2;break;case"bottom":Ve-=Ze;break}switch(T){case"center":ue-=le/2;break;case"right":ue-=le;break;case"inner":b===x-1?ue-=le:b>0&&(ue-=le/2);break}Rn={left:ue,top:Ve,width:le+Te.width,height:Ze+Te.height,color:Y.backdropColor}}m.push({label:S,font:z,textOffset:H,options:{rotation:g,color:ct,strokeColor:Dt,strokeWidth:bt,textAlign:Pe,textBaseline:pt,translation:[w,C],backdrop:Rn}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Lt(this.labelRotation))return t==="top"?"left":"right";let i="center";return n.align==="start"?i="left":n.align==="end"?i="right":n.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:s,mirror:i,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,c=r.widest.width;let l,u;return n==="left"?i?(u=this.right+o,s==="near"?l="left":s==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-a,s==="near"?l="right":s==="center"?(l="center",u-=c/2):(l="left",u=this.left)):n==="right"?i?(u=this.left+o,s==="near"?l="right":s==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+a,s==="near"?l="left":s==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:s,top:i,width:o,height:r}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(s,i,o,r),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const i=this.ticks.findIndex(o=>o.value===t);return i>=0?n.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const n=this.options.grid,s=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(c,l,u)=>{!u.width||!u.color||(s.save(),s.lineWidth=u.width,s.strokeStyle=u.color,s.setLineDash(u.borderDash||[]),s.lineDashOffset=u.borderDashOffset,s.beginPath(),s.moveTo(c.x,c.y),s.lineTo(l.x,l.y),s.stroke(),s.restore())};if(n.display)for(o=0,r=i.length;o<r;++o){const c=i[o];n.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:s,grid:i}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=i.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,h,d;this.isHorizontal()?(l=fe(t,this.left,r)-r/2,u=fe(t,this.right,a)+a/2,h=d=c):(h=fe(t,this.top,r)-r/2,d=fe(t,this.bottom,a)+a/2,l=u=c),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(l,h),n.lineTo(u,d),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,i=this._computeLabelArea();i&&zs(s,i);const o=this.getLabelItems(t);for(const r of o){const a=r.options,c=r.font,l=r.label,u=r.textOffset;ke(s,l,0,u,c,a)}i&&Rs(s)}drawTitle(){const{ctx:t,options:{position:n,title:s,reverse:i}}=this;if(!s.display)return;const o=dt(s.font),r=vt(s.padding),a=s.align;let c=o.lineHeight/2;n==="bottom"||n==="center"||$(n)?(c+=r.bottom,nt(s.text)&&(c+=o.lineHeight*(s.text.length-1))):c+=r.top;const{titleX:l,titleY:u,maxWidth:h,rotation:d}=dy(this,c,n,a);ke(t,s.text,0,0,o,{color:s.color,maxWidth:h,rotation:d,textAlign:hy(a,n,i),textBaseline:"middle",translation:[l,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,s=E(t.grid&&t.grid.z,-1),i=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Me.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",i=[];let o,r;for(o=0,r=n.length;o<r;++o){const a=n[o];a[s]===this.id&&(!t||a.type===t)&&i.push(a)}return i}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return dt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Vn{constructor(t,n,s){this.type=t,this.scope=n,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let s;gy(n)&&(s=this.register(n));const i=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in i||(i[o]=t,fy(t,r,s),this.override&&st.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const n=this.items,s=t.id,i=this.scope;s in n&&delete n[s],i&&s in st[i]&&(delete st[i][s],this.override&&delete we[s])}}function fy(e,t,n){const s=fn(Object.create(null),[n?st.get(n):{},st.get(t),e.defaults]);st.set(t,s),e.defaultRoutes&&py(t,e.defaultRoutes),e.descriptors&&st.describe(t,e.descriptors)}function py(e,t){Object.keys(t).forEach(n=>{const s=n.split("."),i=s.pop(),o=[e].concat(s).join("."),r=t[n].split("."),a=r.pop(),c=r.join(".");st.route(o,i,c,a)})}function gy(e){return"id"in e&&"defaults"in e}class my{constructor(){this.controllers=new Vn(Nt,"datasets",!0),this.elements=new Vn($t,"elements"),this.plugins=new Vn(Object,"plugins"),this.scales=new Vn(Me,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,s){[...n].forEach(i=>{const o=s||this._getRegistryForType(i);s||o.isForType(i)||o===this.plugins&&i.id?this._exec(t,o,i):U(i,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,n,s){const i=Gi(t);K(s["before"+i],[],s),n[t](s),K(s["after"+i],[],s)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const s=this._typedRegistries[n];if(s.isForType(t))return s}return this.plugins}_get(t,n,s){const i=n.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return i}}var Ht=new my;class by{constructor(){this._init=void 0}notify(t,n,s,i){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=i?this._descriptors(t).filter(i):this._descriptors(t),r=this._notify(o,t,n,s);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,n,s,i){i=i||{};for(const o of t){const r=o.plugin,a=r[s],c=[n,i,o.options];if(K(a,c,r)===!1&&i.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const s=t&&t.config,i=E(s.options&&s.options.plugins,{}),o=_y(s);return i===!1&&!n?[]:xy(t,o,i,n)}_notifyStateChanges(t){const n=this._oldCache||[],s=this._cache,i=(o,r)=>o.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(i(n,s),t,"stop"),this._notify(i(s,n),t,"start")}}function _y(e){const t={},n=[],s=Object.keys(Ht.plugins.items);for(let o=0;o<s.length;o++)n.push(Ht.getPlugin(s[o]));const i=e.plugins||[];for(let o=0;o<i.length;o++){const r=i[o];n.indexOf(r)===-1&&(n.push(r),t[r.id]=!0)}return{plugins:n,localIds:t}}function yy(e,t){return!t&&e===!1?null:e===!0?{}:e}function xy(e,{plugins:t,localIds:n},s,i){const o=[],r=e.getContext();for(const a of t){const c=a.id,l=yy(s[c],i);l!==null&&o.push({plugin:a,options:vy(e.config,{plugin:a,local:n[c]},l,r)})}return o}function vy(e,{plugin:t,local:n},s,i){const o=e.pluginScopeKeys(t),r=e.getOptionScopes(s,o);return n&&t.defaults&&r.push(t.defaults),e.createResolver(r,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function li(e,t){const n=st.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function wy(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function ky(e,t){return e===t?"_index_":"_value_"}function wr(e){if(e==="x"||e==="y"||e==="r")return e}function Sy(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function ui(e,...t){if(wr(e))return e;for(const n of t){const s=n.axis||Sy(n.position)||e.length>1&&wr(e[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function kr(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function My(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(s=>s.xAxisID===e||s.yAxisID===e);if(n.length)return kr(e,"x",n[0])||kr(e,"y",n[0])}return{}}function Py(e,t){const n=we[e.type]||{scales:{}},s=t.scales||{},i=li(e.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!$(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const c=ui(r,a,My(r,e),st.scales[a.type]),l=ky(c,i),u=n.scales||{};o[r]=sn(Object.create(null),[{axis:c},a,u[c],u[l]])}),e.data.datasets.forEach(r=>{const a=r.type||e.type,c=r.indexAxis||li(a,t),u=(we[a]||{}).scales||{};Object.keys(u).forEach(h=>{const d=wy(h,c),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),sn(o[f],[{axis:d},s[f],u[h]])})}),Object.keys(o).forEach(r=>{const a=o[r];sn(a,[st.scales[a.type],st.scale])}),o}function Zc(e){const t=e.options||(e.options={});t.plugins=E(t.plugins,{}),t.scales=Py(e,t)}function Vc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Ty(e){return e=e||{},e.data=Vc(e.data),Zc(e),e}const Sr=new Map,Wc=new Set;function Wn(e,t){let n=Sr.get(e);return n||(n=t(),Sr.set(e,n),Wc.add(n)),n}const Je=(e,t,n)=>{const s=ie(t,n);s!==void 0&&e.add(s)};class Cy{constructor(t){this._config=Ty(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Vc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Zc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Wn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Wn(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Wn(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,s=this.type;return Wn(`${s}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const s=this._scopeCache;let i=s.get(t);return(!i||n)&&(i=new Map,s.set(t,i)),i}getOptionScopes(t,n,s){const{options:i,type:o}=this,r=this._cachedScopes(t,s),a=r.get(n);if(a)return a;const c=new Set;n.forEach(u=>{t&&(c.add(t),u.forEach(h=>Je(c,t,h))),u.forEach(h=>Je(c,i,h)),u.forEach(h=>Je(c,we[o]||{},h)),u.forEach(h=>Je(c,st,h)),u.forEach(h=>Je(c,ri,h))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),Wc.has(n)&&r.set(n,l),l}chartOptionScopes(){const{options:t,type:n}=this;return[t,we[n]||{},st.datasets[n]||{},{type:n},st,ri]}resolveNamedOptions(t,n,s,i=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Mr(this._resolverCache,t,i);let c=r;if(zy(r,n)){o.$shared=!1,s=oe(s)?s():s;const l=this.createResolver(t,s,a);c=$e(r,s,l)}for(const l of n)o[l]=c[l];return o}createResolver(t,n,s=[""],i){const{resolver:o}=Mr(this._resolverCache,t,s);return $(n)?$e(o,n,void 0,i):o}}function Mr(e,t,n){let s=e.get(t);s||(s=new Map,e.set(t,s));const i=n.join();let o=s.get(i);return o||(o={resolver:io(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},s.set(i,o)),o}const Oy=e=>$(e)&&Object.getOwnPropertyNames(e).some(t=>oe(e[t]));function zy(e,t){const{isScriptable:n,isIndexable:s}=kc(e);for(const i of t){const o=n(i),r=s(i),a=(r||o)&&e[i];if(o&&(oe(a)||Oy(a))||r&&nt(a))return!0}return!1}var Ry="4.5.1";const Iy=["top","bottom","left","right","chartArea"];function Pr(e,t){return e==="top"||e==="bottom"||Iy.indexOf(e)===-1&&t==="x"}function Tr(e,t){return function(n,s){return n[e]===s[e]?n[t]-s[t]:n[e]-s[e]}}function Cr(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),K(n&&n.onComplete,[e],t)}function Ey(e){const t=e.chart,n=t.options.animation;K(n&&n.onProgress,[e],t)}function qc(e){return ao()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const is={},Or=e=>{const t=qc(e);return Object.values(is).filter(n=>n.canvas===t).pop()};function Ay(e,t,n){const s=Object.keys(e);for(const i of s){const o=+i;if(o>=t){const r=e[i];delete e[i],(n>0||o>t)&&(e[o+n]=r)}}}function Dy(e,t,n,s){return!n||e.type==="mouseout"?null:s?t:e}class qt{static register(...t){Ht.add(...t),zr()}static unregister(...t){Ht.remove(...t),zr()}constructor(t,n){const s=this.config=new Cy(n),i=qc(t),o=Or(i);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Q_(i)),this.platform.updateConfig(s);const a=this.platform.acquireContext(i,r.aspectRatio),c=a&&a.canvas,l=c&&c.height,u=c&&c.width;if(this.id=Lm(),this.ctx=a,this.canvas=c,this.width=u,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new by,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Qm(h=>this.update(h),r.resizeDelay||0),this._dataChanges=[],is[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Zt.listen(this,"complete",Cr),Zt.listen(this,"progress",Ey),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:s,height:i,_aspectRatio:o}=this;return N(t)?n&&o?o:i?s/i:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ht}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Go(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Jo(this.canvas,this.ctx),this}stop(){return Zt.stop(this),this}resize(t,n){Zt.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const s=this.options,i=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(i,t,n,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Go(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),K(s.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};U(n,(s,i)=>{s.id=i})}buildOrUpdateScales(){const t=this.options,n=t.scales,s=this.scales,i=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];n&&(o=o.concat(Object.keys(n).map(r=>{const a=n[r],c=ui(r,a),l=c==="r",u=c==="x";return{options:a,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),U(o,r=>{const a=r.options,c=a.id,l=ui(c,a),u=E(a.type,r.dtype);(a.position===void 0||Pr(a.position,l)!==Pr(r.dposition))&&(a.position=r.dposition),i[c]=!0;let h=null;if(c in s&&s[c].type===u)h=s[c];else{const d=Ht.getScale(u);h=new d({id:c,type:u,ctx:this.ctx,chart:this}),s[h.id]=h}h.init(a,t)}),U(i,(r,a)=>{r||delete s[a]}),U(s,r=>{xt.configure(this,r,r.options),xt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,s=t.length;if(t.sort((i,o)=>i.index-o.index),s>n){for(let i=n;i<s;++i)this._destroyDatasetMeta(i);t.splice(n,s-n)}this._sortedMetasets=t.slice(0).sort(Tr("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((s,i)=>{n.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let s,i;for(this._removeUnreferencedMetasets(),s=0,i=n.length;s<i;s++){const o=n[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||li(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const c=Ht.getController(a),{datasetElementType:l,dataElementType:u}=st.datasets[a];Object.assign(c,{dataElementType:Ht.getElement(u),datasetElementType:l&&Ht.getElement(l)}),r.controller=new c(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){U(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const s=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:h}=this.getDatasetMeta(l),d=!i&&o.indexOf(h)===-1;h.buildOrUpdateElements(d),r=Math.max(+h.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),i||U(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Tr("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){U(this.scales,t=>{xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Ho(n,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:s,start:i,count:o}of n){const r=s==="_removeElements"?-o:o;Ay(t,i,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),i=s(0);for(let o=1;o<n;o++)if(!Ho(i,s(o)))return;return Array.from(i).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xt.update(this,this.width,this.height,t);const n=this.chartArea,s=n.width<=0||n.height<=0;this._layers=[],U(this.boxes,i=>{s&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,o)=>{i._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,s=this.data.datasets.length;n<s;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,s=this.data.datasets.length;n<s;++n)this._updateDataset(n,oe(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const s=this.getDatasetMeta(t),i={meta:s,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(s.controller._update(n),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Zt.has(this)?this.attached&&!Zt.running(this)&&Zt.start(this):(this.draw(),Cr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:i}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,i)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,s=[];let i,o;for(i=0,o=n.length;i<o;++i){const r=n[i];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,s={meta:t,index:t.index,cancelable:!0},i=Ac(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&zs(n,i),t.controller.draw(),i&&Rs(n),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Jt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,s,i){const o=I_.modes[n];return typeof o=="function"?o(this,t,s,i):[]}getDatasetMeta(t){const n=this.data.datasets[t],s=this._metasets;let i=s.filter(o=>o&&o._dataset===n).pop();return i||(i={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},s.push(i)),i}getContext(){return this.$context||(this.$context=ce(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!n.hidden}setDatasetVisibility(t,n){const s=this.getDatasetMeta(t);s.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,s){const i=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,i);pn(n)?(o.data[n].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?i:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Zt.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Jo(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete is[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,s=(o,r)=>{n.addEventListener(this,o,r),t[o]=r},i=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};U(this.options.events,o=>s(o,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,s=(c,l)=>{n.addEventListener(this,c,l),t[c]=l},i=(c,l)=>{t[c]&&(n.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let r;const a=()=>{i("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,i("resize",o),this._stop(),this._resize(0,0),s("attach",a)},n.isAttached(this.canvas)?a():r()}unbindEvents(){U(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},U(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,s){const i=s?"set":"remove";let o,r,a,c;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+i+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){r=t[a];const l=r&&this.getDatasetMeta(r.datasetIndex).controller;l&&l[i+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!ds(s,n)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,n))}notifyPlugins(t,n,s){return this._plugins.notify(this,t,n,s)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,s){const i=this.options.hover,o=(c,l)=>c.filter(u=>!l.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),r=o(n,t),a=s?t:o(t,n);r.length&&this.updateHoverStyle(r,i.mode,!1),a.length&&i.mode&&this.updateHoverStyle(a,i.mode,!0)}_eventHandler(t,n){const s={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},i=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,i)===!1)return;const o=this._handleEvent(t,n,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,i),(o||s.changed)&&this.render(),this}_handleEvent(t,n,s){const{_active:i=[],options:o}=this,r=n,a=this._getActiveElements(t,i,s,r),c=Bm(t),l=Dy(t,this._lastEvent,s,c);s&&(this._lastEvent=null,K(o.onHover,[t,a,this],this),c&&K(o.onClick,[t,a,this],this));const u=!ds(a,i);return(u||n)&&(this._active=a,this._updateHoverStyles(a,i,n)),this._lastEvent=l,u}_getActiveElements(t,n,s,i){if(t.type==="mouseout")return[];if(!s)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,i)}}P(qt,"defaults",st),P(qt,"instances",is),P(qt,"overrides",we),P(qt,"registry",Ht),P(qt,"version",Ry),P(qt,"getChart",Or);function zr(){return U(qt.instances,e=>e._plugins.invalidate())}function Ly(e,t,n){const{startAngle:s,x:i,y:o,outerRadius:r,innerRadius:a,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,h=Math.min(l/r,yt(s-n));if(e.beginPath(),e.arc(i,o,r-l/2,s+h/2,n-h/2),a>0){const d=Math.min(l/a,yt(s-n));e.arc(i,o,a+l/2,n-d/2,s+d/2,!0)}else{const d=Math.min(l/2,r*yt(s-n));if(u==="round")e.arc(i,o,d,n-Z/2,s+Z/2,!0);else if(u==="bevel"){const f=2*d*d,p=-f*Math.cos(n+Z/2)+i,g=-f*Math.sin(n+Z/2)+o,m=f*Math.cos(s+Z/2)+i,b=f*Math.sin(s+Z/2)+o;e.lineTo(p,g),e.lineTo(m,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ny(e,t,n){const{startAngle:s,pixelMargin:i,x:o,y:r,outerRadius:a,innerRadius:c}=t;let l=i/a;e.beginPath(),e.arc(o,r,a,s-l,n+l),c>i?(l=i/c,e.arc(o,r,c,n+l,s-l,!0)):e.arc(o,r,i,n+lt,s-lt),e.closePath(),e.clip()}function $y(e){return so(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Fy(e,t,n,s){const i=$y(e.options.borderRadius),o=(n-t)/2,r=Math.min(o,s*t/2),a=c=>{const l=(n-Math.min(o,c))*s/2;return ft(c,0,Math.min(o,l))};return{outerStart:a(i.outerStart),outerEnd:a(i.outerEnd),innerStart:ft(i.innerStart,0,r),innerEnd:ft(i.innerEnd,0,r)}}function Oe(e,t,n,s){return{x:n+e*Math.cos(t),y:s+e*Math.sin(t)}}function _s(e,t,n,s,i,o){const{x:r,y:a,startAngle:c,pixelMargin:l,innerRadius:u}=t,h=Math.max(t.outerRadius+s+n-l,0),d=u>0?u+s+n+l:0;let f=0;const p=i-c;if(s){const Y=u>0?u-s:0,et=h>0?h-s:0,ct=(Y+et)/2,Dt=ct!==0?p*ct/(ct+s):p;f=(p-Dt)/2}const g=Math.max(.001,p*h-n/Z)/h,m=(p-g)/2,b=c+m+f,x=i-m-f,{outerStart:M,outerEnd:S,innerStart:w,innerEnd:C}=Fy(t,d,h,x-b),T=h-M,O=h-S,z=b+M/T,A=x-S/O,D=d+w,H=d+C,pt=b+w/D,Tt=x-C/H;if(e.beginPath(),o){const Y=(z+A)/2;if(e.arc(r,a,h,z,Y),e.arc(r,a,h,Y,A),S>0){const bt=Oe(O,A,r,a);e.arc(bt.x,bt.y,S,A,x+lt)}const et=Oe(H,x,r,a);if(e.lineTo(et.x,et.y),C>0){const bt=Oe(H,Tt,r,a);e.arc(bt.x,bt.y,C,x+lt,Tt+Math.PI)}const ct=(x-C/d+(b+w/d))/2;if(e.arc(r,a,d,x-C/d,ct,!0),e.arc(r,a,d,ct,b+w/d,!0),w>0){const bt=Oe(D,pt,r,a);e.arc(bt.x,bt.y,w,pt+Math.PI,b-lt)}const Dt=Oe(T,b,r,a);if(e.lineTo(Dt.x,Dt.y),M>0){const bt=Oe(T,z,r,a);e.arc(bt.x,bt.y,M,b-lt,z)}}else{e.moveTo(r,a);const Y=Math.cos(z)*h+r,et=Math.sin(z)*h+a;e.lineTo(Y,et);const ct=Math.cos(A)*h+r,Dt=Math.sin(A)*h+a;e.lineTo(ct,Dt)}e.closePath()}function Hy(e,t,n,s,i){const{fullCircles:o,startAngle:r,circumference:a}=t;let c=t.endAngle;if(o){_s(e,t,n,s,c,i);for(let l=0;l<o;++l)e.fill();isNaN(a)||(c=r+(a%G||G))}return _s(e,t,n,s,c,i),e.fill(),c}function jy(e,t,n,s,i){const{fullCircles:o,startAngle:r,circumference:a,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:h,borderDashOffset:d,borderRadius:f}=c,p=c.borderAlign==="inner";if(!l)return;e.setLineDash(h||[]),e.lineDashOffset=d,p?(e.lineWidth=l*2,e.lineJoin=u||"round"):(e.lineWidth=l,e.lineJoin=u||"bevel");let g=t.endAngle;if(o){_s(e,t,n,s,g,i);for(let m=0;m<o;++m)e.stroke();isNaN(a)||(g=r+(a%G||G))}p&&Ny(e,t,g),c.selfJoin&&g-r>=Z&&f===0&&u!=="miter"&&Ly(e,t,g),o||(_s(e,t,n,s,g,i),e.stroke())}class tn extends $t{constructor(n){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,n&&Object.assign(this,n)}inRange(n,s,i){const o=this.getProps(["x","y"],i),{angle:r,distance:a}=fc(o,{x:n,y:s}),{startAngle:c,endAngle:l,innerRadius:u,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,p=E(d,l-c),g=gn(r,c,l)&&c!==l,m=p>=G||g,b=Ut(a,u+f,h+f);return m&&b}getCenterPoint(n){const{x:s,y:i,startAngle:o,endAngle:r,innerRadius:a,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:l,spacing:u}=this.options,h=(o+r)/2,d=(a+c+u+l)/2;return{x:s+Math.cos(h)*d,y:i+Math.sin(h)*d}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:s,circumference:i}=this,o=(s.offset||0)/4,r=(s.spacing||0)/2,a=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=i>G?Math.floor(i/G):0,i===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*o,Math.sin(c)*o);const l=1-Math.sin(Math.min(Z,i||0)),u=o*l;n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,Hy(n,this,u,r,a),jy(n,this,u,r,a),n.restore()}}P(tn,"id","arc"),P(tn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),P(tn,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(tn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Uc(e,t,n=t){e.lineCap=E(n.borderCapStyle,t.borderCapStyle),e.setLineDash(E(n.borderDash,t.borderDash)),e.lineDashOffset=E(n.borderDashOffset,t.borderDashOffset),e.lineJoin=E(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=E(n.borderWidth,t.borderWidth),e.strokeStyle=E(n.borderColor,t.borderColor)}function By(e,t,n){e.lineTo(n.x,n.y)}function Zy(e){return e.stepped?hb:e.tension||e.cubicInterpolationMode==="monotone"?db:By}function Yc(e,t,n={}){const s=e.length,{start:i=0,end:o=s-1}=n,{start:r,end:a}=t,c=Math.max(i,r),l=Math.min(o,a),u=i<r&&o<r||i>a&&o>a;return{count:s,start:c,loop:t.loop,ilen:l<c&&!u?s+l-c:l-c}}function Vy(e,t,n,s){const{points:i,options:o}=t,{count:r,start:a,loop:c,ilen:l}=Yc(i,n,s),u=Zy(o);let{move:h=!0,reverse:d}=s||{},f,p,g;for(f=0;f<=l;++f)p=i[(a+(d?l-f:f))%r],!p.skip&&(h?(e.moveTo(p.x,p.y),h=!1):u(e,g,p,d,o.stepped),g=p);return c&&(p=i[(a+(d?l:0))%r],u(e,g,p,d,o.stepped)),!!c}function Wy(e,t,n,s){const i=t.points,{count:o,start:r,ilen:a}=Yc(i,n,s),{move:c=!0,reverse:l}=s||{};let u=0,h=0,d,f,p,g,m,b;const x=S=>(r+(l?a-S:S))%o,M=()=>{g!==m&&(e.lineTo(u,m),e.lineTo(u,g),e.lineTo(u,b))};for(c&&(f=i[x(0)],e.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=i[x(d)],f.skip)continue;const S=f.x,w=f.y,C=S|0;C===p?(w<g?g=w:w>m&&(m=w),u=(h*u+S)/++h):(M(),e.lineTo(S,w),p=C,h=0,g=m=w),b=w}M()}function hi(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Wy:Vy}function qy(e){return e.stepped?Vb:e.tension||e.cubicInterpolationMode==="monotone"?Wb:_e}function Uy(e,t,n,s){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,s)&&i.closePath()),Uc(e,t.options),e.stroke(i)}function Yy(e,t,n,s){const{segments:i,options:o}=t,r=hi(t);for(const a of i)Uc(e,o,a.style),e.beginPath(),r(e,t,a,{start:n,end:n+s-1})&&e.closePath(),e.stroke()}const Jy=typeof Path2D=="function";function Ky(e,t,n,s){Jy&&!t.options.segment?Uy(e,t,n,s):Yy(e,t,n,s)}class Qt extends $t{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const i=s.spanGaps?this._loop:this._fullLoop;Lb(this._points,s,t,i,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Xb(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,s=t.length;return s&&n[t[s-1].end]}interpolate(t,n){const s=this.options,i=t[n],o=this.points,r=Ec(this,{property:n,start:i,end:i});if(!r.length)return;const a=[],c=qy(s);let l,u;for(l=0,u=r.length;l<u;++l){const{start:h,end:d}=r[l],f=o[h],p=o[d];if(f===p){a.push(f);continue}const g=Math.abs((i-f[n])/(p[n]-f[n])),m=c(f,p,g,s.stepped);m[n]=t[n],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,n,s){return hi(this)(t,this,n,s)}path(t,n,s){const i=this.segments,o=hi(this);let r=this._loop;n=n||0,s=s||this.points.length-n;for(const a of i)r&=o(t,this,a,{start:n,end:n+s-1});return!!r}draw(t,n,s,i){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Ky(t,this,s,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(Qt,"id","line"),P(Qt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(Qt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(Qt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Rr(e,t,n,s){const i=e.options,{[n]:o}=e.getProps([n],s);return Math.abs(t-o)<i.radius+i.hitRadius}class os extends $t{constructor(n){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,s,i){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],i);return Math.pow(n-r,2)+Math.pow(s-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(n,s){return Rr(this,n,"x",s)}inYRange(n,s){return Rr(this,n,"y",s)}getCenterPoint(n){const{x:s,y:i}=this.getProps(["x","y"],n);return{x:s,y:i}}size(n){n=n||this.options||{};let s=n.radius||0;s=Math.max(s,s&&n.hoverRadius||0);const i=s&&n.borderWidth||0;return(s+i)*2}draw(n,s){const i=this.options;this.skip||i.radius<.1||!Jt(this,s,this.size(i)/2)||(n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.fillStyle=i.backgroundColor,ai(n,i,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}P(os,"id","point"),P(os,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(os,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Jc(e,t){const{x:n,y:s,base:i,width:o,height:r}=e.getProps(["x","y","base","width","height"],t);let a,c,l,u,h;return e.horizontal?(h=r/2,a=Math.min(n,i),c=Math.max(n,i),l=s-h,u=s+h):(h=o/2,a=n-h,c=n+h,l=Math.min(s,i),u=Math.max(s,i)),{left:a,top:l,right:c,bottom:u}}function te(e,t,n,s){return e?0:ft(t,n,s)}function Xy(e,t,n){const s=e.options.borderWidth,i=e.borderSkipped,o=wc(s);return{t:te(i.top,o.top,0,n),r:te(i.right,o.right,0,t),b:te(i.bottom,o.bottom,0,n),l:te(i.left,o.left,0,t)}}function Gy(e,t,n){const{enableBorderRadius:s}=e.getProps(["enableBorderRadius"]),i=e.options.borderRadius,o=xe(i),r=Math.min(t,n),a=e.borderSkipped,c=s||$(i);return{topLeft:te(!c||a.top||a.left,o.topLeft,0,r),topRight:te(!c||a.top||a.right,o.topRight,0,r),bottomLeft:te(!c||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:te(!c||a.bottom||a.right,o.bottomRight,0,r)}}function Qy(e){const t=Jc(e),n=t.right-t.left,s=t.bottom-t.top,i=Xy(e,n/2,s/2),o=Gy(e,n/2,s/2);return{outer:{x:t.left,y:t.top,w:n,h:s,radius:o},inner:{x:t.left+i.l,y:t.top+i.t,w:n-i.l-i.r,h:s-i.t-i.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,o.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(i.b,i.r))}}}}function Ys(e,t,n,s){const i=t===null,o=n===null,a=e&&!(i&&o)&&Jc(e,s);return a&&(i||Ut(t,a.left,a.right))&&(o||Ut(n,a.top,a.bottom))}function tx(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function ex(e,t){e.rect(t.x,t.y,t.w,t.h)}function Js(e,t,n={}){const s=e.x!==n.x?-t:0,i=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-s,r=(e.y+e.h!==n.y+n.h?t:0)-i;return{x:e.x+s,y:e.y+i,w:e.w+o,h:e.h+r,radius:e.radius}}class rs extends $t{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:s,backgroundColor:i}}=this,{inner:o,outer:r}=Qy(this),a=tx(r.radius)?mn:ex;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Js(r,n,o)),t.clip(),a(t,Js(o,-n,r)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),a(t,Js(o,n)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,n,s){return Ys(this,t,n,s)}inXRange(t,n){return Ys(this,t,null,n)}inYRange(t,n){return Ys(this,null,t,n)}getCenterPoint(t){const{x:n,y:s,base:i,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+i)/2:n,y:o?s:(s+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(rs,"id","bar"),P(rs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(rs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var nx=Object.freeze({__proto__:null,ArcElement:tn,BarElement:rs,LineElement:Qt,PointElement:os});const di=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Ir=di.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Kc(e){return di[e%di.length]}function Xc(e){return Ir[e%Ir.length]}function sx(e,t){return e.borderColor=Kc(t),e.backgroundColor=Xc(t),++t}function ix(e,t){return e.backgroundColor=e.data.map(()=>Kc(t++)),t}function ox(e,t){return e.backgroundColor=e.data.map(()=>Xc(t++)),t}function rx(e){let t=0;return(n,s)=>{const i=e.getDatasetMeta(s).controller;i instanceof ye?t=ix(n,t):i instanceof cn?t=ox(n,t):i&&(t=sx(n,t))}}function Er(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function ax(e){return e&&(e.borderColor||e.backgroundColor)}function cx(){return st.borderColor!=="rgba(0,0,0,0.1)"||st.backgroundColor!=="rgba(0,0,0,0.1)"}var lx={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:s},options:i}=e.config,{elements:o}=i,r=Er(s)||ax(i)||o&&Er(o)||cx();if(!n.forceOverride&&r)return;const a=rx(e);s.forEach(a)}};function ux(e,t,n,s,i){const o=i.samples||s;if(o>=n)return e.slice(t,t+n);const r=[],a=(n-2)/(o-2);let c=0;const l=t+n-1;let u=t,h,d,f,p,g;for(r[c++]=e[u],h=0;h<o-2;h++){let m=0,b=0,x;const M=Math.floor((h+1)*a)+1+t,S=Math.min(Math.floor((h+2)*a)+1,n)+t,w=S-M;for(x=M;x<S;x++)m+=e[x].x,b+=e[x].y;m/=w,b/=w;const C=Math.floor(h*a)+1+t,T=Math.min(Math.floor((h+1)*a)+1,n)+t,{x:O,y:z}=e[u];for(f=p=-1,x=C;x<T;x++)p=.5*Math.abs((O-m)*(e[x].y-z)-(O-e[x].x)*(b-z)),p>f&&(f=p,d=e[x],g=x);r[c++]=d,u=g}return r[c++]=e[l],r}function hx(e,t,n,s){let i=0,o=0,r,a,c,l,u,h,d,f,p,g;const m=[],b=t+n-1,x=e[t].x,S=e[b].x-x;for(r=t;r<t+n;++r){a=e[r],c=(a.x-x)/S*s,l=a.y;const w=c|0;if(w===u)l<p?(p=l,h=r):l>g&&(g=l,d=r),i=(o*i+a.x)/++o;else{const C=r-1;if(!N(h)&&!N(d)){const T=Math.min(h,d),O=Math.max(h,d);T!==f&&T!==C&&m.push({...e[T],x:i}),O!==f&&O!==C&&m.push({...e[O],x:i})}r>0&&C!==f&&m.push(e[C]),m.push(a),u=w,o=0,p=g=l,h=d=f=r}}return m}function Gc(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ar(e){e.data.datasets.forEach(t=>{Gc(t)})}function dx(e,t){const n=t.length;let s=0,i;const{iScale:o}=e,{min:r,max:a,minDefined:c,maxDefined:l}=o.getUserBounds();return c&&(s=ft(Yt(t,o.axis,r).lo,0,n-1)),l?i=ft(Yt(t,o.axis,a).hi+1,s,n)-s:i=n-s,{start:s,count:i}}var fx={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ar(e);return}const s=e.width;e.data.datasets.forEach((i,o)=>{const{_data:r,indexAxis:a}=i,c=e.getDatasetMeta(o),l=r||i.data;if(Ge([a,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=e.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:h,count:d}=dx(c,l);const f=n.threshold||4*s;if(d<=f){Gc(i);return}N(r)&&(i._data=l,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=ux(l,h,d,s,n);break;case"min-max":p=hx(l,h,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}i._decimated=p})},destroy(e){Ar(e)}};function px(e,t,n){const s=e.segments,i=e.points,o=t.points,r=[];for(const a of s){let{start:c,end:l}=a;l=As(c,l,i);const u=fi(n,i[c],i[l],a.loop);if(!t.segments){r.push({source:a,target:u,start:i[c],end:i[l]});continue}const h=Ec(t,u);for(const d of h){const f=fi(n,o[d.start],o[d.end],d.loop),p=Ic(a,i,f);for(const g of p)r.push({source:g,target:d,start:{[n]:Dr(u,f,"start",Math.max)},end:{[n]:Dr(u,f,"end",Math.min)}})}}return r}function fi(e,t,n,s){if(s)return;let i=t[e],o=n[e];return e==="angle"&&(i=yt(i),o=yt(o)),{property:e,start:i,end:o}}function gx(e,t){const{x:n=null,y:s=null}=e||{},i=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=As(r,a,i);const c=i[r],l=i[a];s!==null?(o.push({x:c.x,y:s}),o.push({x:l.x,y:s})):n!==null&&(o.push({x:n,y:c.y}),o.push({x:n,y:l.y}))}),o}function As(e,t,n){for(;t>e;t--){const s=n[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Dr(e,t,n,s){return e&&t?s(e[n],t[n]):e?e[n]:t?t[n]:0}function Qc(e,t){let n=[],s=!1;return nt(e)?(s=!0,n=e):n=gx(e,t),n.length?new Qt({points:n,options:{tension:0},_loop:s,_fullLoop:s}):null}function Lr(e){return e&&e.fill!==!1}function mx(e,t,n){let i=e[t].fill;const o=[t];let r;if(!n)return i;for(;i!==!1&&o.indexOf(i)===-1;){if(!at(i))return i;if(r=e[i],!r)return!1;if(r.visible)return i;o.push(i),i=r.fill}return!1}function bx(e,t,n){const s=vx(e);if($(s))return isNaN(s.value)?!1:s;let i=parseFloat(s);return at(i)&&Math.floor(i)===i?_x(s[0],t,i,n):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function _x(e,t,n,s){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=s?!1:n}function yx(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:$(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function xx(e,t,n){let s;return e==="start"?s=n:e==="end"?s=t.options.reverse?t.min:t.max:$(e)?s=e.value:s=t.getBaseValue(),s}function vx(e){const t=e.options,n=t.fill;let s=E(n&&n.target,n);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function wx(e){const{scale:t,index:n,line:s}=e,i=[],o=s.segments,r=s.points,a=kx(t,n);a.push(Qc({x:null,y:t.bottom},s));for(let c=0;c<o.length;c++){const l=o[c];for(let u=l.start;u<=l.end;u++)Sx(i,r[u],a)}return new Qt({points:i,options:{}})}function kx(e,t){const n=[],s=e.getMatchingVisibleMetas("line");for(let i=0;i<s.length;i++){const o=s[i];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function Sx(e,t,n){const s=[];for(let i=0;i<n.length;i++){const o=n[i],{first:r,last:a,point:c}=Mx(o,t,"x");if(!(!c||r&&a)){if(r)s.unshift(c);else if(e.push(c),!a)break}}e.push(...s)}function Mx(e,t,n){const s=e.interpolate(t,n);if(!s)return{};const i=s[n],o=e.segments,r=e.points;let a=!1,c=!1;for(let l=0;l<o.length;l++){const u=o[l],h=r[u.start][n],d=r[u.end][n];if(Ut(i,h,d)){a=i===h,c=i===d;break}}return{first:a,last:c,point:s}}class tl{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,s){const{x:i,y:o,radius:r}=this;return n=n||{start:0,end:G},t.arc(i,o,r,n.end,n.start,!0),!s.bounds}interpolate(t){const{x:n,y:s,radius:i}=this,o=t.angle;return{x:n+Math.cos(o)*i,y:s+Math.sin(o)*i,angle:o}}}function Px(e){const{chart:t,fill:n,line:s}=e;if(at(n))return Tx(t,n);if(n==="stack")return wx(e);if(n==="shape")return!0;const i=Cx(e);return i instanceof tl?i:Qc(i,s)}function Tx(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function Cx(e){return(e.scale||{}).getPointPositionForValue?zx(e):Ox(e)}function Ox(e){const{scale:t={},fill:n}=e,s=yx(n,t);if(at(s)){const i=t.isHorizontal();return{x:i?s:null,y:i?null:s}}return null}function zx(e){const{scale:t,fill:n}=e,s=t.options,i=t.getLabels().length,o=s.reverse?t.max:t.min,r=xx(n,t,o),a=[];if(s.grid.circular){const c=t.getPointPositionForValue(0,o);return new tl({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(r)})}for(let c=0;c<i;++c)a.push(t.getPointPositionForValue(c,r));return a}function Ks(e,t,n){const s=Px(t),{chart:i,index:o,line:r,scale:a,axis:c}=t,l=r.options,u=l.fill,h=l.backgroundColor,{above:d=h,below:f=h}=u||{},p=i.getDatasetMeta(o),g=Ac(i,p);s&&r.points.length&&(zs(e,n),Rx(e,{line:r,target:s,above:d,below:f,area:n,scale:a,axis:c,clip:g}),Rs(e))}function Rx(e,t){const{line:n,target:s,above:i,below:o,area:r,scale:a,clip:c}=t,l=n._loop?"angle":t.axis;e.save();let u=o;o!==i&&(l==="x"?(Nr(e,s,r.top),Xs(e,{line:n,target:s,color:i,scale:a,property:l,clip:c}),e.restore(),e.save(),Nr(e,s,r.bottom)):l==="y"&&($r(e,s,r.left),Xs(e,{line:n,target:s,color:o,scale:a,property:l,clip:c}),e.restore(),e.save(),$r(e,s,r.right),u=i)),Xs(e,{line:n,target:s,color:u,scale:a,property:l,clip:c}),e.restore()}function Nr(e,t,n){const{segments:s,points:i}=t;let o=!0,r=!1;e.beginPath();for(const a of s){const{start:c,end:l}=a,u=i[c],h=i[As(c,l,i)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function $r(e,t,n){const{segments:s,points:i}=t;let o=!0,r=!1;e.beginPath();for(const a of s){const{start:c,end:l}=a,u=i[c],h=i[As(c,l,i)];o?(e.moveTo(u.x,u.y),o=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Xs(e,t){const{line:n,target:s,property:i,color:o,scale:r,clip:a}=t,c=px(n,s,i);for(const{source:l,target:u,start:h,end:d}of c){const{style:{backgroundColor:f=o}={}}=l,p=s!==!0;e.save(),e.fillStyle=f,Ix(e,r,a,p&&fi(i,h,d)),e.beginPath();const g=!!n.pathSegment(e,l);let m;if(p){g?e.closePath():Fr(e,s,d,i);const b=!!s.pathSegment(e,u,{move:g,reverse:!0});m=g&&b,m||Fr(e,s,h,i)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function Ix(e,t,n,s){const i=t.chart.chartArea,{property:o,start:r,end:a}=s||{};if(o==="x"||o==="y"){let c,l,u,h;o==="x"?(c=r,l=i.top,u=a,h=i.bottom):(c=i.left,l=r,u=i.right,h=a),e.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),l=Math.max(l,n.top),h=Math.min(h,n.bottom)),e.rect(c,l,u-c,h-l),e.clip()}}function Fr(e,t,n,s){const i=t.interpolate(n,s);i&&e.lineTo(i.x,i.y)}var Ex={id:"filler",afterDatasetsUpdate(e,t,n){const s=(e.data.datasets||[]).length,i=[];let o,r,a,c;for(r=0;r<s;++r)o=e.getDatasetMeta(r),a=o.dataset,c=null,a&&a.options&&a instanceof Qt&&(c={visible:e.isDatasetVisible(r),index:r,fill:bx(a,r,s),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=c,i.push(c);for(r=0;r<s;++r)c=i[r],!(!c||c.fill===!1)&&(c.fill=mx(i,r,n.propagate))},beforeDraw(e,t,n){const s=n.drawTime==="beforeDraw",i=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&Ks(e.ctx,a,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const s=e.getSortedVisibleDatasetMetas();for(let i=s.length-1;i>=0;--i){const o=s[i].$filler;Lr(o)&&Ks(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const s=t.meta.$filler;!Lr(s)||n.drawTime!=="beforeDatasetDraw"||Ks(e.ctx,s,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Hr=(e,t)=>{let{boxHeight:n=t,boxWidth:s=t}=e;return e.usePointStyle&&(n=Math.min(n,t),s=e.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:n,itemHeight:Math.max(t,n)}},Ax=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class jr extends $t{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,s){this.maxWidth=t,this.maxHeight=n,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=K(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(s=>t.filter(s,this.chart.data))),t.sort&&(n=n.sort((s,i)=>t.sort(s,i,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,i=dt(s.font),o=i.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Hr(s,o);let l,u;n.font=i.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(r,o,a,c)+10):(u=this.maxHeight,l=this._fitCols(r,i,a,c)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,s,i){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=i+a;let h=t;o.textAlign="left",o.textBaseline="middle";let d=-1,f=-u;return this.legendItems.forEach((p,g)=>{const m=s+n/2+o.measureText(p.text).width;(g===0||l[l.length-1]+m+2*a>r)&&(h+=u,l[l.length-(g>0?0:1)]=0,f+=u,d++),c[g]={left:0,top:f,row:d,width:m,height:i},l[l.length-1]+=m+a}),h}_fitCols(t,n,s,i){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=r-t;let h=a,d=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:x,itemHeight:M}=Dx(s,n,o,m,i);b>0&&f+M+2*a>u&&(h+=d+a,l.push({width:d,height:f}),p+=d+a,g++,d=f=0),c[b]={left:p,top:f,col:g,width:x,height:M},d=Math.max(d,x),f+=M+a}),h+=d,l.push({width:d,height:f}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:s,labels:{padding:i},rtl:o}}=this,r=Ee(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=_t(s,this.left+i,this.right-this.lineWidths[a]);for(const l of n)a!==l.row&&(a=l.row,c=_t(s,this.left+i,this.right-this.lineWidths[a])),l.top+=this.top+t+i,l.left=r.leftForLtr(r.x(c),l.width),c+=l.width+i}else{let a=0,c=_t(s,this.top+t+i,this.bottom-this.columnSizes[a].height);for(const l of n)l.col!==a&&(a=l.col,c=_t(s,this.top+t+i,this.bottom-this.columnSizes[a].height)),l.top=c,l.left+=this.left+i,l.left=r.leftForLtr(r.x(l.left),l.width),c+=l.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;zs(t,this),this._draw(),Rs(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:s,ctx:i}=this,{align:o,labels:r}=t,a=st.color,c=Ee(t.rtl,this.left,this.width),l=dt(r.font),{padding:u}=r,h=l.size,d=h/2;let f;this.drawTitle(),i.textAlign=c.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=l.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=Hr(r,h),b=function(C,T,O){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;i.save();const z=E(O.lineWidth,1);if(i.fillStyle=E(O.fillStyle,a),i.lineCap=E(O.lineCap,"butt"),i.lineDashOffset=E(O.lineDashOffset,0),i.lineJoin=E(O.lineJoin,"miter"),i.lineWidth=z,i.strokeStyle=E(O.strokeStyle,a),i.setLineDash(E(O.lineDash,[])),r.usePointStyle){const A={radius:g*Math.SQRT2/2,pointStyle:O.pointStyle,rotation:O.rotation,borderWidth:z},D=c.xPlus(C,p/2),H=T+d;vc(i,A,D,H,r.pointStyleWidth&&p)}else{const A=T+Math.max((h-g)/2,0),D=c.leftForLtr(C,p),H=xe(O.borderRadius);i.beginPath(),Object.values(H).some(pt=>pt!==0)?mn(i,{x:D,y:A,w:p,h:g,radius:H}):i.rect(D,A,p,g),i.fill(),z!==0&&i.stroke()}i.restore()},x=function(C,T,O){ke(i,O.text,C,T+m/2,l,{strikethrough:O.hidden,textAlign:c.textAlign(O.textAlign)})},M=this.isHorizontal(),S=this._computeTitleHeight();M?f={x:_t(o,this.left+u,this.right-s[0]),y:this.top+u+S,line:0}:f={x:this.left+u,y:_t(o,this.top+S+u,this.bottom-n[0].height),line:0},Oc(this.ctx,t.textDirection);const w=m+u;this.legendItems.forEach((C,T)=>{i.strokeStyle=C.fontColor,i.fillStyle=C.fontColor;const O=i.measureText(C.text).width,z=c.textAlign(C.textAlign||(C.textAlign=r.textAlign)),A=p+d+O;let D=f.x,H=f.y;c.setWidth(this.width),M?T>0&&D+A+u>this.right&&(H=f.y+=w,f.line++,D=f.x=_t(o,this.left+u,this.right-s[f.line])):T>0&&H+w>this.bottom&&(D=f.x=D+n[f.line].width+u,f.line++,H=f.y=_t(o,this.top+S+u,this.bottom-n[f.line].height));const pt=c.x(D);if(b(pt,H,C),D=tb(z,D+p+d,M?D+A:this.right,t.rtl),x(c.x(D),H,C),M)f.x+=A+u;else if(typeof C.text!="string"){const Tt=l.lineHeight;f.y+=el(C,Tt)+u}else f.y+=w}),zc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,s=dt(n.font),i=vt(n.padding);if(!n.display)return;const o=Ee(t.rtl,this.left,this.width),r=this.ctx,a=n.position,c=s.size/2,l=i.top+c;let u,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),u=this.top+l,h=_t(t.align,h,this.right-d);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);u=l+_t(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=_t(a,h,h+d);r.textAlign=o.textAlign(eo(a)),r.textBaseline="middle",r.strokeStyle=n.color,r.fillStyle=n.color,r.font=s.string,ke(r,n.text,f,u,s)}_computeTitleHeight(){const t=this.options.title,n=dt(t.font),s=vt(t.padding);return t.display?n.lineHeight+s.height:0}_getLegendItemAt(t,n){let s,i,o;if(Ut(t,this.left,this.right)&&Ut(n,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(i=o[s],Ut(t,i.left,i.left+i.width)&&Ut(n,i.top,i.top+i.height))return this.legendItems[s]}return null}handleEvent(t){const n=this.options;if(!$x(t.type,n))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,o=Ax(i,s);i&&!o&&K(n.onLeave,[t,i,this],this),this._hoveredItem=s,s&&!o&&K(n.onHover,[t,s,this],this)}else s&&K(n.onClick,[t,s,this],this)}}function Dx(e,t,n,s,i){const o=Lx(s,e,t,n),r=Nx(i,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Lx(e,t,n,s){let i=e.text;return i&&typeof i!="string"&&(i=i.reduce((o,r)=>o.length>r.length?o:r)),t+n.size/2+s.measureText(i).width}function Nx(e,t,n){let s=e;return typeof t.text!="string"&&(s=el(t,n)),s}function el(e,t){const n=e.text?e.text.length:0;return t*n}function $x(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Fx={id:"legend",_element:jr,start(e,t,n){const s=e.legend=new jr({ctx:e.ctx,options:n,chart:e});xt.configure(e,s,n),xt.addBox(e,s)},stop(e){xt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const s=e.legend;xt.configure(e,s,n),s.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const s=t.datasetIndex,i=n.chart;i.isDatasetVisible(s)?(i.hide(s),t.hidden=!0):(i.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:s,textAlign:i,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(n?0:void 0),u=vt(l.borderWidth);return{text:t[c.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:i||l.textAlign,borderRadius:r&&(a||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class uo extends $t{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const i=nt(s.text)?s.text.length:1;this._padding=vt(s.padding);const o=i*dt(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:s,bottom:i,right:o,options:r}=this,a=r.align;let c=0,l,u,h;return this.isHorizontal()?(u=_t(a,s,o),h=n+t,l=o-s):(r.position==="left"?(u=s+t,h=_t(a,i,n),c=Z*-.5):(u=o-t,h=_t(a,n,i),c=Z*.5),l=i-n),{titleX:u,titleY:h,maxWidth:l,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const s=dt(n.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:c,rotation:l}=this._drawArgs(o);ke(t,n.text,0,0,s,{color:n.color,maxWidth:c,rotation:l,textAlign:eo(n.align),textBaseline:"middle",translation:[r,a]})}}function Hx(e,t){const n=new uo({ctx:e.ctx,options:t,chart:e});xt.configure(e,n,t),xt.addBox(e,n),e.titleBlock=n}var jx={id:"title",_element:uo,start(e,t,n){Hx(e,n)},stop(e){const t=e.titleBlock;xt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const s=e.titleBlock;xt.configure(e,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qn=new WeakMap;var Bx={id:"subtitle",start(e,t,n){const s=new uo({ctx:e.ctx,options:n,chart:e});xt.configure(e,s,n),xt.addBox(e,s),qn.set(e,s)},stop(e){xt.removeBox(e,qn.get(e)),qn.delete(e)},beforeUpdate(e,t,n){const s=qn.get(e);xt.configure(e,s,n),s.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const en={average(e){if(!e.length)return!1;let t,n,s=new Set,i=0,o=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const c=a.tooltipPosition();s.add(c.x),i+=c.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,c)=>a+c)/s.size,y:i/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,s=t.y,i=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){const c=e[o].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=oi(t,l);u<i&&(i=u,a=c)}}if(a){const c=a.tooltipPosition();n=c.x,s=c.y}return{x:n,y:s}}};function Ft(e,t){return t&&(nt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Vt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
100
|
-
`)>-1?
|
|
101
|
-
`):e}function Zx(e,t){const{element:n,datasetIndex:s,index:i}=t,o=e.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(i);return{chart:e,label:r,parsed:o.getParsed(i),raw:e.data.datasets[s].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:s,element:n}}function Br(e,t){const n=e.chart.ctx,{body:s,footer:i,title:o}=e,{boxWidth:r,boxHeight:a}=t,c=dt(t.bodyFont),l=dt(t.titleFont),u=dt(t.footerFont),h=o.length,d=i.length,f=s.length,p=vt(t.padding);let g=p.height,m=0,b=s.reduce((S,w)=>S+w.before.length+w.lines.length+w.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,h&&(g+=h*l.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),b){const S=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;g+=f*S+(b-f)*c.lineHeight+(b-1)*t.bodySpacing}d&&(g+=t.footerMarginTop+d*u.lineHeight+(d-1)*t.footerSpacing);let x=0;const M=function(S){m=Math.max(m,n.measureText(S).width+x)};return n.save(),n.font=l.string,U(e.title,M),n.font=c.string,U(e.beforeBody.concat(e.afterBody),M),x=t.displayColors?r+2+t.boxPadding:0,U(s,S=>{U(S.before,M),U(S.lines,M),U(S.after,M)}),x=0,n.font=u.string,U(e.footer,M),n.restore(),m+=p.width,{width:m,height:g}}function Vx(e,t){const{y:n,height:s}=t;return n<s/2?"top":n>e.height-s/2?"bottom":"center"}function Wx(e,t,n,s){const{x:i,width:o}=s,r=n.caretSize+n.caretPadding;if(e==="left"&&i+o+r>t.width||e==="right"&&i-o-r<0)return!0}function qx(e,t,n,s){const{x:i,width:o}=n,{width:r,chartArea:{left:a,right:c}}=e;let l="center";return s==="center"?l=i<=(a+c)/2?"left":"right":i<=o/2?l="left":i>=r-o/2&&(l="right"),Wx(l,e,t,n)&&(l="center"),l}function Zr(e,t,n){const s=n.yAlign||t.yAlign||Vx(e,n);return{xAlign:n.xAlign||t.xAlign||qx(e,t,n,s),yAlign:s}}function Ux(e,t){let{x:n,width:s}=e;return t==="right"?n-=s:t==="center"&&(n-=s/2),n}function Yx(e,t,n){let{y:s,height:i}=e;return t==="top"?s+=n:t==="bottom"?s-=i+n:s-=i/2,s}function Vr(e,t,n,s){const{caretSize:i,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:c}=n,l=i+o,{topLeft:u,topRight:h,bottomLeft:d,bottomRight:f}=xe(r);let p=Ux(t,a);const g=Yx(t,c,l);return c==="center"?a==="left"?p+=l:a==="right"&&(p-=l):a==="left"?p-=Math.max(u,d)+i:a==="right"&&(p+=Math.max(h,f)+i),{x:ft(p,0,s.width-t.width),y:ft(g,0,s.height-t.height)}}function Un(e,t,n){const s=vt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-s.right:e.x+s.left}function Wr(e){return Ft([],Vt(e))}function Jx(e,t,n){return ce(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function qr(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const nl={beforeTitle:Bt,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,s=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return n[t.dataIndex]}return""},afterTitle:Bt,beforeBody:Bt,beforeLabel:Bt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return N(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Bt,afterBody:Bt,beforeFooter:Bt,footer:Bt,afterFooter:Bt};function kt(e,t,n,s){const i=e[t].call(n,s);return typeof i>"u"?nl[t].call(n,s):i}class pi extends $t{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,s=this.options.setContext(this.getContext()),i=s.enabled&&n.options.animation&&s.animations,o=new Dc(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Jx(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:s}=n,i=kt(s,"beforeTitle",this,t),o=kt(s,"title",this,t),r=kt(s,"afterTitle",this,t);let a=[];return a=Ft(a,Vt(i)),a=Ft(a,Vt(o)),a=Ft(a,Vt(r)),a}getBeforeBody(t,n){return Wr(kt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:s}=n,i=[];return U(t,o=>{const r={before:[],lines:[],after:[]},a=qr(s,o);Ft(r.before,Vt(kt(a,"beforeLabel",this,o))),Ft(r.lines,kt(a,"label",this,o)),Ft(r.after,Vt(kt(a,"afterLabel",this,o))),i.push(r)}),i}getAfterBody(t,n){return Wr(kt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:s}=n,i=kt(s,"beforeFooter",this,t),o=kt(s,"footer",this,t),r=kt(s,"afterFooter",this,t);let a=[];return a=Ft(a,Vt(i)),a=Ft(a,Vt(o)),a=Ft(a,Vt(r)),a}_createItems(t){const n=this._active,s=this.chart.data,i=[],o=[],r=[];let a=[],c,l;for(c=0,l=n.length;c<l;++c)a.push(Zx(this.chart,n[c]));return t.filter&&(a=a.filter((u,h,d)=>t.filter(u,h,d,s))),t.itemSort&&(a=a.sort((u,h)=>t.itemSort(u,h,s))),U(a,u=>{const h=qr(t.callbacks,u);i.push(kt(h,"labelColor",this,u)),o.push(kt(h,"labelPointStyle",this,u)),r.push(kt(h,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,n){const s=this.options.setContext(this.getContext()),i=this._active;let o,r=[];if(!i.length)this.opacity!==0&&(o={opacity:0});else{const a=en[s.position].call(this,i,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const c=this._size=Br(this,s),l=Object.assign({},a,c),u=Zr(this.chart,s,l),h=Vr(s,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,s,i){const o=this.getCaretPosition(t,s,i);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,s){const{xAlign:i,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:h}=xe(a),{x:d,y:f}=t,{width:p,height:g}=n;let m,b,x,M,S,w;return o==="center"?(S=f+g/2,i==="left"?(m=d,b=m-r,M=S+r,w=S-r):(m=d+p,b=m+r,M=S-r,w=S+r),x=m):(i==="left"?b=d+Math.max(c,u)+r:i==="right"?b=d+p-Math.max(l,h)-r:b=this.caretX,o==="top"?(M=f,S=M-r,m=b-r,x=b+r):(M=f+g,S=M+r,m=b+r,x=b-r),w=M),{x1:m,x2:b,x3:x,y1:M,y2:S,y3:w}}drawTitle(t,n,s){const i=this.title,o=i.length;let r,a,c;if(o){const l=Ee(s.rtl,this.x,this.width);for(t.x=Un(this,s.titleAlign,s),n.textAlign=l.textAlign(s.titleAlign),n.textBaseline="middle",r=dt(s.titleFont),a=s.titleSpacing,n.fillStyle=s.titleColor,n.font=r.string,c=0;c<o;++c)n.fillText(i[c],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,c+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,n,s,i,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:c,boxWidth:l}=o,u=dt(o.bodyFont),h=Un(this,"left",o),d=i.x(h),f=c<u.lineHeight?(u.lineHeight-c)/2:0,p=n.y+f;if(o.usePointStyle){const g={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=i.leftForLtr(d,l)+l/2,b=p+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ai(t,g,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,ai(t,g,m,b)}else{t.lineWidth=$(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const g=i.leftForLtr(d,l),m=i.leftForLtr(i.xPlus(d,1),l-2),b=xe(r.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,mn(t,{x:g,y:p,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),mn(t,{x:m,y:p+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,l,c),t.strokeRect(g,p,l,c),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,l-2,c-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,n,s){const{body:i}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:u}=s,h=dt(s.bodyFont);let d=h.lineHeight,f=0;const p=Ee(s.rtl,this.x,this.width),g=function(O){n.fillText(O,p.x(t.x+f),t.y+d/2),t.y+=d+o},m=p.textAlign(r);let b,x,M,S,w,C,T;for(n.textAlign=r,n.textBaseline="middle",n.font=h.string,t.x=Un(this,m,s),n.fillStyle=s.bodyColor,U(this.beforeBody,g),f=a&&m!=="right"?r==="center"?l/2+u:l+2+u:0,S=0,C=i.length;S<C;++S){for(b=i[S],x=this.labelTextColors[S],n.fillStyle=x,U(b.before,g),M=b.lines,a&&M.length&&(this._drawColorBox(n,t,S,p,s),d=Math.max(h.lineHeight,c)),w=0,T=M.length;w<T;++w)g(M[w]),d=h.lineHeight;U(b.after,g)}f=0,d=h.lineHeight,U(this.afterBody,g),t.y-=o}drawFooter(t,n,s){const i=this.footer,o=i.length;let r,a;if(o){const c=Ee(s.rtl,this.x,this.width);for(t.x=Un(this,s.footerAlign,s),t.y+=s.footerMarginTop,n.textAlign=c.textAlign(s.footerAlign),n.textBaseline="middle",r=dt(s.footerFont),n.fillStyle=s.footerColor,n.font=r.string,a=0;a<o;++a)n.fillText(i[a],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,n,s,i){const{xAlign:o,yAlign:r}=this,{x:a,y:c}=t,{width:l,height:u}=s,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:p}=xe(i.cornerRadius);n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,n.lineWidth=i.borderWidth,n.beginPath(),n.moveTo(a+h,c),r==="top"&&this.drawCaret(t,n,s,i),n.lineTo(a+l-d,c),n.quadraticCurveTo(a+l,c,a+l,c+d),r==="center"&&o==="right"&&this.drawCaret(t,n,s,i),n.lineTo(a+l,c+u-p),n.quadraticCurveTo(a+l,c+u,a+l-p,c+u),r==="bottom"&&this.drawCaret(t,n,s,i),n.lineTo(a+f,c+u),n.quadraticCurveTo(a,c+u,a,c+u-f),r==="center"&&o==="left"&&this.drawCaret(t,n,s,i),n.lineTo(a,c+h),n.quadraticCurveTo(a,c,a+h,c),n.closePath(),n.fill(),i.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,s=this.$animations,i=s&&s.x,o=s&&s.y;if(i||o){const r=en[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Br(this,t),c=Object.assign({},r,this._size),l=Zr(n,t,c),u=Vr(t,c,l,n);(i._to!==u.x||o._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(n);const i={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=vt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,i,n),Oc(t,n.textDirection),o.y+=r.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),zc(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const s=this._active,i=t.map(({datasetIndex:a,index:c})=>{const l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!ds(s,i),r=this._positionChanged(i,n);(o||r)&&(this._active=i,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,s=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,o=this._active||[],r=this._getActiveElements(t,o,n,s),a=this._positionChanged(r,t),c=n||!ds(r,o)||a;return c&&(this._active=r,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,s,i){const o=this.options;if(t.type==="mouseout")return[];if(!i)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,n){const{caretX:s,caretY:i,options:o}=this,r=en[o.position].call(this,t,n);return r!==!1&&(s!==r.x||i!==r.y)}}P(pi,"positioners",en);var Kx={id:"tooltip",_element:pi,positioners:en,afterInit(e,t,n){n&&(e.tooltip=new pi({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:nl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Xx=Object.freeze({__proto__:null,Colors:lx,Decimation:fx,Filler:Ex,Legend:Fx,SubTitle:Bx,Title:jx,Tooltip:Kx});const Gx=(e,t,n,s)=>(typeof t=="string"?(n=e.push(t)-1,s.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function Qx(e,t,n,s){const i=e.indexOf(t);if(i===-1)return Gx(e,t,n,s);const o=e.lastIndexOf(t);return i!==o?n:i}const t0=(e,t)=>e===null?null:ft(Math.round(e),0,t);function Ur(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class gi extends Me{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const s=this.getLabels();for(const{index:i,label:o}of n)s[i]===o&&s.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(N(t))return null;const s=this.getLabels();return n=isFinite(n)&&s[n]===t?n:Qx(s,t,E(n,t),this._addedLabels),t0(n,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:s,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),n||(i=this.getLabels().length-1)),this.min=s,this.max=i}buildTicks(){const t=this.min,n=this.max,s=this.options.offset,i=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=n;r++)i.push({value:r});return i}getLabelForValue(t){return Ur.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(gi,"id","category"),P(gi,"defaults",{ticks:{callback:Ur}});function e0(e,t){const n=[],{bounds:i,step:o,min:r,max:a,precision:c,count:l,maxTicks:u,maxDigits:h,includeBounds:d}=e,f=o||1,p=u-1,{min:g,max:m}=t,b=!N(r),x=!N(a),M=!N(l),S=(m-g)/(h+1);let w=Bo((m-g)/p/f)*f,C,T,O,z;if(w<1e-14&&!b&&!x)return[{value:g},{value:m}];z=Math.ceil(m/w)-Math.floor(g/w),z>p&&(w=Bo(z*w/p/f)*f),N(c)||(C=Math.pow(10,c),w=Math.ceil(w*C)/C),i==="ticks"?(T=Math.floor(g/w)*w,O=Math.ceil(m/w)*w):(T=g,O=m),b&&x&&o&&Um((a-r)/o,w/1e3)?(z=Math.round(Math.min((a-r)/w,u)),w=(a-r)/z,T=r,O=a):M?(T=b?r:T,O=x?a:O,z=l-1,w=(O-T)/z):(z=(O-T)/w,on(z,Math.round(z),w/1e3)?z=Math.round(z):z=Math.ceil(z));const A=Math.max(Zo(w),Zo(T));C=Math.pow(10,N(c)?A:c),T=Math.round(T*C)/C,O=Math.round(O*C)/C;let D=0;for(b&&(d&&T!==r?(n.push({value:r}),T<r&&D++,on(Math.round((T+D*w)*C)/C,r,Yr(r,S,e))&&D++):T<r&&D++);D<z;++D){const H=Math.round((T+D*w)*C)/C;if(x&&H>a)break;n.push({value:H})}return x&&d&&O!==a?n.length&&on(n[n.length-1].value,a,Yr(a,S,e))?n[n.length-1].value=a:n.push({value:a}):(!x||O===a)&&n.push({value:O}),n}function Yr(e,t,{horizontal:n,minRotation:s}){const i=Lt(s),o=(n?Math.sin(i):Math.cos(i))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}class ys extends Me{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return N(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:s}=this.getUserBounds();let{min:i,max:o}=this;const r=c=>i=n?i:c,a=c=>o=s?o:c;if(t){const c=jt(i),l=jt(o);c<0&&l<0?a(0):c>0&&l>0&&r(0)}if(i===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||r(i-c)}this.min=i,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:s}=t,i;return s?(i=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),n=n||11),n&&(i=Math.min(n,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const i={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,r=e0(i,o);return t.bounds==="ticks"&&dc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let n=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const i=(s-n)/Math.max(t.length-1,1)/2;n-=i,s+=i}this._startValue=n,this._endValue=s,this._valueRange=s-n}getLabelForValue(t){return zn(t,this.chart.options.locale,this.options.ticks.format)}}class mi extends ys{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=at(t)?t:0,this.max=at(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,s=Lt(this.options.ticks.minRotation),i=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(mi,"id","linear"),P(mi,"defaults",{ticks:{callback:Os.formatters.numeric}});const _n=e=>Math.floor(Xt(e)),ge=(e,t)=>Math.pow(10,_n(e)+t);function Jr(e){return e/Math.pow(10,_n(e))===1}function Kr(e,t,n){const s=Math.pow(10,n),i=Math.floor(e/s);return Math.ceil(t/s)-i}function n0(e,t){const n=t-e;let s=_n(n);for(;Kr(e,t,s)>10;)s++;for(;Kr(e,t,s)<10;)s--;return Math.min(s,_n(e))}function s0(e,{min:t,max:n}){t=Ct(e.min,t);const s=[],i=_n(t);let o=n0(t,n),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=i>o?Math.pow(10,i):0,l=Math.round((t-c)*r)/r,u=Math.floor((t-c)/a/10)*a*10;let h=Math.floor((l-u)/Math.pow(10,o)),d=Ct(e.min,Math.round((c+u+h*Math.pow(10,o))*r)/r);for(;d<n;)s.push({value:d,major:Jr(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,r=o>=0?1:r),d=Math.round((c+u+h*Math.pow(10,o))*r)/r;const f=Ct(e.max,d);return s.push({value:f,major:Jr(f),significand:h}),s}class bi extends Me{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const s=ys.prototype.parse.apply(this,[t,n]);if(s===0){this._zero=!0;return}return at(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=at(t)?Math.max(0,t):null,this.max=at(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!at(this._userMin)&&(this.min=t===ge(this.min,0)?ge(this.min,-1):ge(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let s=this.min,i=this.max;const o=a=>s=t?s:a,r=a=>i=n?i:a;s===i&&(s<=0?(o(1),r(10)):(o(ge(s,-1)),r(ge(i,1)))),s<=0&&o(ge(i,-1)),i<=0&&r(ge(s,1)),this.min=s,this.max=i}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},s=s0(n,this);return t.bounds==="ticks"&&dc(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":zn(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Xt(t),this._valueRange=Xt(this.max)-Xt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Xt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}P(bi,"id","logarithmic"),P(bi,"defaults",{ticks:{callback:Os.formatters.logarithmic,major:{enabled:!0}}});function _i(e){const t=e.ticks;if(t.display&&e.display){const n=vt(t.backdropPadding);return E(t.font&&t.font.size,st.font.size)+n.height}return 0}function i0(e,t,n){return n=nt(n)?n:[n],{w:ub(e,t.string,n),h:n.length*t.lineHeight}}function Xr(e,t,n,s,i){return e===s||e===i?{start:t-n/2,end:t+n/2}:e<s||e>i?{start:t-n,end:t}:{start:t,end:t+n}}function o0(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),s=[],i=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?Z/o:0;for(let c=0;c<o;c++){const l=r.setContext(e.getPointLabelContext(c));i[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+i[c],a),h=dt(l.font),d=i0(e.ctx,h,e._pointLabels[c]);s[c]=d;const f=yt(e.getIndexAngle(c)+a),p=Math.round(Qi(f)),g=Xr(p,u.x,d.w,0,180),m=Xr(p,u.y,d.h,90,270);r0(n,t,f,g,m)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=l0(e,s,i)}function r0(e,t,n,s,i){const o=Math.abs(Math.sin(n)),r=Math.abs(Math.cos(n));let a=0,c=0;s.start<t.l?(a=(t.l-s.start)/o,e.l=Math.min(e.l,t.l-a)):s.end>t.r&&(a=(s.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),i.start<t.t?(c=(t.t-i.start)/r,e.t=Math.min(e.t,t.t-c)):i.end>t.b&&(c=(i.end-t.b)/r,e.b=Math.max(e.b,t.b+c))}function a0(e,t,n){const s=e.drawingArea,{extra:i,additionalAngle:o,padding:r,size:a}=n,c=e.getPointPosition(t,s+i+r,o),l=Math.round(Qi(yt(c.angle+lt))),u=d0(c.y,a.h,l),h=u0(l),d=h0(c.x,a.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:d,top:u,right:d+a.w,bottom:u+a.h}}function c0(e,t){if(!t)return!0;const{left:n,top:s,right:i,bottom:o}=e;return!(Jt({x:n,y:s},t)||Jt({x:n,y:o},t)||Jt({x:i,y:s},t)||Jt({x:i,y:o},t))}function l0(e,t,n){const s=[],i=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,c={extra:_i(o)/2,additionalAngle:r?Z/i:0};let l;for(let u=0;u<i;u++){c.padding=n[u],c.size=t[u];const h=a0(e,u,c);s.push(h),a==="auto"&&(h.visible=c0(h,l),h.visible&&(l=h))}return s}function u0(e){return e===0||e===180?"center":e<180?"left":"right"}function h0(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function d0(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function f0(e,t,n){const{left:s,top:i,right:o,bottom:r}=n,{backdropColor:a}=t;if(!N(a)){const c=xe(t.borderRadius),l=vt(t.backdropPadding);e.fillStyle=a;const u=s-l.left,h=i-l.top,d=o-s+l.width,f=r-i+l.height;Object.values(c).some(p=>p!==0)?(e.beginPath(),mn(e,{x:u,y:h,w:d,h:f,radius:c}),e.fill()):e.fillRect(u,h,d,f)}}function p0(e,t){const{ctx:n,options:{pointLabels:s}}=e;for(let i=t-1;i>=0;i--){const o=e._pointLabelItems[i];if(!o.visible)continue;const r=s.setContext(e.getPointLabelContext(i));f0(n,r,o);const a=dt(r.font),{x:c,y:l,textAlign:u}=o;ke(n,e._pointLabels[i],c,l+a.lineHeight/2,a,{color:r.color,textAlign:u,textBaseline:"middle"})}}function sl(e,t,n,s){const{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,G);else{let o=e.getPointPosition(0,t);i.moveTo(o.x,o.y);for(let r=1;r<s;r++)o=e.getPointPosition(r,t),i.lineTo(o.x,o.y)}}function g0(e,t,n,s,i){const o=e.ctx,r=t.circular,{color:a,lineWidth:c}=t;!r&&!s||!a||!c||n<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(i.dash||[]),o.lineDashOffset=i.dashOffset,o.beginPath(),sl(e,n,r,s),o.closePath(),o.stroke(),o.restore())}function m0(e,t,n){return ce(e,{label:n,index:t,type:"pointLabel"})}class nn extends ys{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=vt(_i(this.options)/2),n=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(n,s)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=at(t)&&!isNaN(t)?t:0,this.max=at(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/_i(this.options))}generateTickLabels(t){ys.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,s)=>{const i=K(this.options.pointLabels.callback,[n,s],this);return i||i===0?i:""}).filter((n,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?o0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,s,i){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((s-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,s,i))}getIndexAngle(t){const n=G/(this._pointLabels.length||1),s=this.options.startAngle||0;return yt(t*n+Lt(s))}getDistanceFromCenterForValue(t){if(N(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(N(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const s=n[t];return m0(this.getContext(),t,s)}}getPointPosition(t,n,s=0){const i=this.getIndexAngle(t)-lt+s;return{x:Math.cos(i)*n+this.xCenter,y:Math.sin(i)*n+this.yCenter,angle:i}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:s,right:i,bottom:o}=this._pointLabelItems[t];return{left:n,top:s,right:i,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),sl(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:s,grid:i,border:o}=n,r=this._pointLabels.length;let a,c,l;if(n.pointLabels.display&&p0(this,r),i.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const d=this.getContext(h),f=i.setContext(d),p=o.setContext(d);g0(this,f,c,r,p)}}),s.display){for(t.save(),a=r-1;a>=0;a--){const u=s.setContext(this.getPointLabelContext(a)),{color:h,lineWidth:d}=u;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,s=n.ticks;if(!s.display)return;const i=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=s.setContext(this.getContext(c)),u=dt(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,r=t.measureText(a.label).width,t.fillStyle=l.backdropColor;const h=vt(l.backdropPadding);t.fillRect(-r/2-h.left,-o-u.size/2-h.top,r+h.width,u.size+h.height)}ke(t,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}P(nn,"id","radialLinear"),P(nn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Os.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(nn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(nn,"descriptors",{angleLines:{_fallback:"grid"}});const Ds={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},St=Object.keys(Ds);function Gr(e,t){return e-t}function Qr(e,t){if(N(t))return null;const n=e._adapter,{parser:s,round:i,isoWeekday:o}=e._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),at(r)||(r=typeof s=="string"?n.parse(r,s):n.parse(r)),r===null?null:(i&&(r=i==="week"&&(Ne(o)||o===!0)?n.startOf(r,"isoWeek",o):n.startOf(r,i)),+r)}function ta(e,t,n,s){const i=St.length;for(let o=St.indexOf(e);o<i-1;++o){const r=Ds[St[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((n-t)/(a*r.size))<=s)return St[o]}return St[i-1]}function b0(e,t,n,s,i){for(let o=St.length-1;o>=St.indexOf(n);o--){const r=St[o];if(Ds[r].common&&e._adapter.diff(i,s,r)>=t-1)return r}return St[n?St.indexOf(n):0]}function _0(e){for(let t=St.indexOf(e)+1,n=St.length;t<n;++t)if(Ds[St[t]].common)return St[t]}function ea(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:s,hi:i}=to(n,t),o=n[s]>=t?n[s]:n[i];e[o]=!0}}function y0(e,t,n,s){const i=e._adapter,o=+i.startOf(t[0].value,s),r=t[t.length-1].value;let a,c;for(a=o;a<=r;a=+i.add(a,1,s))c=n[a],c>=0&&(t[c].major=!0);return t}function na(e,t,n){const s=[],i={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],i[a]=r,s.push({value:a,major:!1});return o===0||!n?s:y0(e,s,i,n)}class yn extends Me{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const s=t.time||(t.time={}),i=this._adapter=new T_._date(t.adapters.date);i.init(n),sn(s.displayFormats,i.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Qr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,s=t.time.unit||"day";let{min:i,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function c(l){!r&&!isNaN(l.min)&&(i=Math.min(i,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!r||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),i=at(i)&&!isNaN(i)?i:+n.startOf(Date.now(),s),o=at(o)&&!isNaN(o)?o:+n.endOf(Date.now(),s)+1,this.min=Math.min(i,o-1),this.max=Math.max(i+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],s=t[t.length-1]),{min:n,max:s}}buildTicks(){const t=this.options,n=t.time,s=t.ticks,i=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const o=this.min,r=this.max,a=Xm(i,o,r);return this._unit=n.unit||(s.autoSkip?ta(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):b0(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:_0(this._unit),this.initOffsets(i),t.reverse&&a.reverse(),na(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,s=0,i,o;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?n=1-i:n=(this.getDecimalForValue(t[1])-i)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;n=ft(n,0,r),s=ft(s,0,r),this._offsets={start:n,end:s,factor:1/(n+1+s)}}_generate(){const t=this._adapter,n=this.min,s=this.max,i=this.options,o=i.time,r=o.unit||ta(o.minUnit,n,s,this._getLabelCapacity(n)),a=E(i.ticks.stepSize,1),c=r==="week"?o.isoWeekday:!1,l=Ne(c)||c===!0,u={};let h=n,d,f;if(l&&(h=+t.startOf(h,"isoWeek",c)),h=+t.startOf(h,l?"day":r),t.diff(s,n,r)>1e5*a)throw new Error(n+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=i.ticks.source==="data"&&this.getDataTimestamps();for(d=h,f=0;d<s;d=+t.add(d,a,r),f++)ea(u,d,p);return(d===s||i.bounds==="ticks"||f===1)&&ea(u,d,p),Object.keys(u).sort(Gr).map(g=>+g)}getLabelForValue(t){const n=this._adapter,s=this.options.time;return s.tooltipFormat?n.format(t,s.tooltipFormat):n.format(t,s.displayFormats.datetime)}format(t,n){const i=this.options.time.displayFormats,o=this._unit,r=n||i[o];return this._adapter.format(t,r)}_tickFormatFunction(t,n,s,i){const o=this.options,r=o.ticks.callback;if(r)return K(r,[t,n,s],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&a[c],h=l&&a[l],d=s[n],f=l&&h&&d&&d.major;return this._adapter.format(t,i||(f?h:u))}generateTickLabels(t){let n,s,i;for(n=0,s=t.length;n<s;++n)i=t[n],i.label=this._tickFormatFunction(i.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+s)*n.factor)}getValueForPixel(t){const n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,s=this.ctx.measureText(t).width,i=Lt(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(i),r=Math.sin(i),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const n=this.options.time,s=n.displayFormats,i=s[n.unit]||s.millisecond,o=this._tickFormatFunction(t,0,na(this,[t],this._majorUnit),i),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,s;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(n=0,s=i.length;n<s;++n)t=t.concat(i[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,s;if(t.length)return t;const i=this.getLabels();for(n=0,s=i.length;n<s;++n)t.push(Qr(this,i[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gc(t.sort(Gr))}}P(yn,"id","time"),P(yn,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Yn(e,t,n){let s=0,i=e.length-1,o,r,a,c;n?(t>=e[s].pos&&t<=e[i].pos&&({lo:s,hi:i}=Yt(e,"pos",t)),{pos:o,time:a}=e[s],{pos:r,time:c}=e[i]):(t>=e[s].time&&t<=e[i].time&&({lo:s,hi:i}=Yt(e,"time",t)),{time:o,pos:a}=e[s],{time:r,pos:c}=e[i]);const l=r-o;return l?a+(c-a)*(t-o)/l:a}class yi extends yn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Yn(n,this.min),this._tableRange=Yn(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:s}=this,i=[],o=[];let r,a,c,l,u;for(r=0,a=t.length;r<a;++r)l=t[r],l>=n&&l<=s&&i.push(l);if(i.length<2)return[{time:n,pos:0},{time:s,pos:1}];for(r=0,a=i.length;r<a;++r)u=i[r+1],c=i[r-1],l=i[r],Math.round((u+c)/2)!==l&&o.push({time:l,pos:r/(a-1)});return o}_generate(){const t=this.min,n=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(n)||s.length===1)&&s.push(n),s.sort((i,o)=>i-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),s=this.getLabelTimestamps();return n.length&&s.length?t=this.normalize(n.concat(s)):t=n.length?n:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Yn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,s=this.getDecimalForPixel(t)/n.factor-n.end;return Yn(this._table,s*this._tableRange+this._minPos,!0)}}P(yi,"id","timeseries"),P(yi,"defaults",yn.defaults);var x0=Object.freeze({__proto__:null,CategoryScale:gi,LinearScale:mi,LogarithmicScale:bi,RadialLinearScale:nn,TimeScale:yn,TimeSeriesScale:yi});const v0=[P_,nx,Xx,x0];qt.register(...v0);const Jn=document.querySelector(".main"),xn=document.getElementById("poll-toggle-btn"),Gs=document.getElementById("status-indicator"),w0=document.getElementById("status-text"),k0=document.getElementById("cpu-chart"),Kn=document.getElementById("memory-bar-fill"),S0=document.getElementById("memory-percent"),M0=document.getElementById("memory-detail"),P0=document.getElementById("info-hostname"),T0=document.getElementById("info-platform"),C0=document.getElementById("info-uptime"),O0=30,z0=2e3,Xn=["rgba(59, 130, 246, 0.7)","rgba(16, 185, 129, 0.7)","rgba(245, 158, 11, 0.7)","rgba(239, 68, 68, 0.7)","rgba(139, 92, 246, 0.7)","rgba(236, 72, 153, 0.7)","rgba(20, 184, 166, 0.7)","rgba(249, 115, 22, 0.7)","rgba(34, 197, 94, 0.7)","rgba(168, 85, 247, 0.7)","rgba(251, 146, 60, 0.7)","rgba(74, 222, 128, 0.7)","rgba(96, 165, 250, 0.7)","rgba(248, 113, 113, 0.7)","rgba(167, 139, 250, 0.7)","rgba(244, 114, 182, 0.7)"],B={systemInfo:null,isPolling:!1,intervalId:null,cpuHistory:[],labels:[],chart:null,previousCpuSnapshots:null};function sa(e){const t=["B","KB","MB","GB","TB"];let n=e,s=0;for(;n>=1024&&s<t.length-1;)n/=1024,s++;return`${n.toFixed(1)} ${t[s]}`}function R0(e){const t=Math.floor(e/86400),n=Math.floor(e%86400/3600),s=Math.floor(e%3600/60),i=[];return t>0&&i.push(`${t}d`),n>0&&i.push(`${n}h`),s>0&&i.push(`${s}m`),i.length>0?i.join(" "):"< 1m"}function il(e){const t=window.matchMedia("(prefers-color-scheme: dark)").matches,n=t?"#9ca3af":"#6b7280",s=t?"#374151":"#e5e7eb",i=Array.from({length:e},(o,r)=>({label:`P${r}`,data:[],fill:!0,backgroundColor:Xn[r%Xn.length],borderColor:Xn[r%Xn.length].replace("0.7","1"),borderWidth:1,pointRadius:0,tension:.3}));return new qt(k0,{type:"line",data:{labels:[],datasets:i},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:300},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!0,position:"bottom",labels:{boxWidth:12,padding:8,font:{size:10},color:n}},tooltip:{enabled:!0,callbacks:{label:o=>`${o.dataset.label}: ${o.parsed.y}%`}}},scales:{x:{display:!1},y:{stacked:!0,min:0,max:e*100,ticks:{callback:o=>`${o}%`,color:n,font:{size:10}},grid:{color:s}}}}})}function ol(e,t,n){if(!B.chart)return;B.chart.data.labels=t;for(let l=0;l<n;l++)B.chart.data.datasets[l].data=e.map(u=>u[l]??0);const s=e.map(l=>l.reduce((u,h)=>u+h,0)),i=Math.max(...s,0),o=1.2,r=n*15,a=n*100,c=Math.min(Math.max(i*o,r),a);B.chart.options.scales.y.max=c,B.chart.update("none")}function I0(e,t){const n=e.usedPercent;Kn.style.width=`${n}%`,Kn.classList.remove("warning","danger"),n>=80?Kn.classList.add("danger"):n>=60&&Kn.classList.add("warning"),S0.textContent=`${n}%`,M0.textContent=`${sa(e.usedBytes)} / ${sa(t)}`}function E0(e){P0.textContent=e.hostname,T0.textContent=e.platform}function A0(e){C0.textContent=R0(e.seconds)}function xs(e,t=!1,n=!1){w0.textContent=e,Gs.classList.remove("polling","error"),n?Gs.classList.add("error"):t&&Gs.classList.add("polling")}const He=new fm({name:"System Monitor",version:"1.0.0"});function D0(e,t){return!t||t.length!==e.length?e.map(()=>0):e.map((n,s)=>{const i=t[s],o=n.idle-i.idle,r=n.total-i.total;return r===0?0:Math.round((1-o/r)*100)})}async function ia(){const{systemInfo:e}=B;if(e)try{const n=(await He.callServerTool({name:"poll-system-stats",arguments:{}})).structuredContent,s=e.cpu.count,i=D0(n.cpu.cores,B.previousCpuSnapshots);B.previousCpuSnapshots=n.cpu.cores,B.cpuHistory.push(i),B.labels.push(new Date().toLocaleTimeString()),B.cpuHistory.length>O0&&(B.cpuHistory.shift(),B.labels.shift()),ol(B.cpuHistory,B.labels,s),I0(n.memory,e.memory.totalBytes),A0(n.uptime);const o=new Date().toLocaleTimeString("en-US",{hour12:!1});xs(o,!0)}catch(t){console.error("Failed to fetch stats:",t),xs("Error",!1,!0)}}function rl(){B.isPolling||(B.isPolling=!0,xn.textContent="Stop",xn.classList.add("active"),xs("Starting...",!0),ia(),B.intervalId=window.setInterval(ia,z0))}function L0(){B.isPolling&&(B.isPolling=!1,B.intervalId&&(clearInterval(B.intervalId),B.intervalId=null),xn.textContent="Start",xn.classList.remove("active"),xs("Stopped"))}function N0(){B.isPolling?L0():rl()}xn.addEventListener("click",N0);window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{if(B.chart&&B.systemInfo){const e=B.systemInfo.cpu.count;B.chart.destroy(),B.chart=il(e),ol(B.cpuHistory,B.labels,e)}});He.onerror=console.error;He.ontoolresult=e=>{const t=e.structuredContent;t&&(B.systemInfo=t,B.chart=il(t.cpu.count),E0(t),rl())};function al(e){e.safeAreaInsets&&(Jn.style.paddingTop=`${e.safeAreaInsets.top}px`,Jn.style.paddingRight=`${e.safeAreaInsets.right}px`,Jn.style.paddingBottom=`${e.safeAreaInsets.bottom}px`,Jn.style.paddingLeft=`${e.safeAreaInsets.left}px`)}He.onhostcontextchanged=al;He.connect().then(()=>{const e=He.getHostContext();e&&al(e)});</script>
|
|
100
|
+
*/class Pw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,i,r,n){const o=i.listeners[n],s=i.duration;o.forEach(a=>a({chart:e,initial:i.initial,numSteps:s,currentStep:Math.min(r-i.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=dv.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let i=0;this._charts.forEach((r,n)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,c;for(;s>=0;--s)c=o[s],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(e),a=!0):(o[s]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,r,e,"progress")),o.length||(r.running=!1,this._notify(n,r,e,"complete"),r.initial=!1),i+=o.length}),this._lastDate=e,i===0&&(this._running=!1)}_getAnims(e){const i=this._charts;let r=i.get(e);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(e,r)),r}listen(e,i,r){this._getAnims(e).listeners[i].push(r)}add(e,i){!i||!i.length||this._getAnims(e).items.push(...i)}has(e){return this._getAnims(e).items.length>0}start(e){const i=this._charts.get(e);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((r,n)=>Math.max(r,n._duration),0),this._refresh())}running(e){if(!this._running)return!1;const i=this._charts.get(e);return!(!i||!i.running||!i.items.length)}stop(e){const i=this._charts.get(e);if(!i||!i.items.length)return;const r=i.items;let n=r.length-1;for(;n>=0;--n)r[n].cancel();i.items=[],this._notify(e,i,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ot=new Pw;const gd="transparent",Tw={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const r=sd(t||gd),n=r.valid&&sd(e||gd);return n&&n.valid?n.mix(r,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class Ow{constructor(e,i,r,n){const o=i[r];n=Wn([e.to,n,o,e.from]);const s=Wn([e.from,o,n]);this._active=!0,this._fn=e.fn||Tw[e.type||typeof s],this._easing=Qn[e.easing]||Qn.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=i,this._prop=r,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(e,i,r){if(this._active){this._notify(!1);const n=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Wn([e.to,i,n,e.from]),this._from=Wn([e.from,n,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const i=e-this._start,r=this._duration,n=this._prop,o=this._from,s=this._loop,a=this._to;let c;if(this._active=o!==a&&(s||i<r),!this._active){this._target[n]=a,this._notify(!0);return}if(i<0){this._target[n]=o;return}c=i/r%2,c=s&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[n]=this._fn(o,a,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((i,r)=>{e.push({res:i,rej:r})})}_notify(e){const i=e?"res":"rej",r=this._promises||[];for(let n=0;n<r.length;n++)r[n][i]()}}class Ov{constructor(e,i){this._chart=e,this._properties=new Map,this.configure(i)}configure(e){if(!W(e))return;const i=Object.keys(de.animation),r=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{const o=e[n];if(!W(o))return;const s={};for(const a of i)s[a]=o[a];(ue(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!r.has(a))&&r.set(a,s)})})}_animateOptions(e,i){const r=i.options,n=Mw(e,r);if(!n)return[];const o=this._createAnimations(n,r);return r.$shared&&Dw(e.options.$animations,r).then(()=>{e.options=r},()=>{}),o}_createAnimations(e,i){const r=this._properties,n=[],o=e.$animations||(e.$animations={}),s=Object.keys(i),a=Date.now();let c;for(c=s.length-1;c>=0;--c){const l=s[c];if(l.charAt(0)==="$")continue;if(l==="options"){n.push(...this._animateOptions(e,i));continue}const u=i[l];let d=o[l];const h=r.get(l);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){e[l]=u;continue}o[l]=d=new Ow(h,e,l,u),n.push(d)}return n}update(e,i){if(this._properties.size===0){Object.assign(e,i);return}const r=this._createAnimations(e,i);if(r.length)return ot.add(this._chart,r),!0}}function Dw(t,e){const i=[],r=Object.keys(e);for(let n=0;n<r.length;n++){const o=t[r[n]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}function Mw(t,e){if(!e)return;let i=t.options;if(!i){t.options=e;return}return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}function vd(t,e){const i=t&&t.options||{},r=i.reverse,n=i.min===void 0?e:0,o=i.max===void 0?e:0;return{start:r?o:n,end:r?n:o}}function Ew(t,e,i){if(i===!1)return!1;const r=vd(t,i),n=vd(e,i);return{top:n.end,right:r.end,bottom:n.start,left:r.start}}function Cw(t){let e,i,r,n;return W(t)?(e=t.top,i=t.right,r=t.bottom,n=t.left):e=i=r=n=t,{top:e,right:i,bottom:r,left:n,disabled:t===!1}}function Dv(t,e){const i=[],r=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=r.length;n<o;++n)i.push(r[n].index);return i}function bd(t,e,i,r={}){const n=t.keys,o=r.mode==="single";let s,a,c,l;if(e===null)return;let u=!1;for(s=0,a=n.length;s<a;++s){if(c=+n[s],c===i){if(u=!0,r.all)continue;break}l=t.values[c],fe(l)&&(o||e===0||tt(e)===tt(l))&&(e+=l)}return!u&&!r.all?0:e}function Aw(t,e){const{iScale:i,vScale:r}=e,n=i.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",s=Object.keys(t),a=new Array(s.length);let c,l,u;for(c=0,l=s.length;c<l;++c)u=s[c],a[c]={[n]:u,[o]:t[u]};return a}function js(t,e){const i=t&&t.options.stacked;return i||i===void 0&&e.stack!==void 0}function jw(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}function Rw(t){const{min:e,max:i,minDefined:r,maxDefined:n}=t.getUserBounds();return{min:r?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}function Nw(t,e,i){const r=t[e]||(t[e]={});return r[i]||(r[i]={})}function _d(t,e,i,r){for(const n of e.getMatchingVisibleMetas(r).reverse()){const o=t[n.index];if(i&&o>0||!i&&o<0)return n.index}return null}function yd(t,e){const{chart:i,_cachedMeta:r}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:s,index:a}=r,c=o.axis,l=s.axis,u=jw(o,s,r),d=e.length;let h;for(let f=0;f<d;++f){const m=e[f],{[c]:p,[l]:g}=m,v=m._stacks||(m._stacks={});h=v[l]=Nw(n,u,p),h[a]=g,h._top=_d(h,s,!0,r.type),h._bottom=_d(h,s,!1,r.type);const x=h._visualValues||(h._visualValues={});x[a]=g}}function Rs(t,e){const i=t.scales;return Object.keys(i).filter(r=>i[r].axis===e).shift()}function Uw(t,e){return zt(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Lw(t,e,i){return zt(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function Un(t,e){const i=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){e=e||t._parsed;for(const n of e){const o=n._stacks;if(!o||o[r]===void 0||o[r][i]===void 0)return;delete o[r][i],o[r]._visualValues!==void 0&&o[r]._visualValues[i]!==void 0&&delete o[r]._visualValues[i]}}}const Ns=t=>t==="reset"||t==="none",xd=(t,e)=>e?t:Object.assign({},t),Fw=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:Dv(i,!0),values:null};class Ye{constructor(e,i){this.chart=e,this._ctx=e.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=js(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Un(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,i=this._cachedMeta,r=this.getDataset(),n=(d,h,f,m)=>d==="x"?h:d==="r"?m:f,o=i.xAxisID=R(r.xAxisID,Rs(e,"x")),s=i.yAxisID=R(r.yAxisID,Rs(e,"y")),a=i.rAxisID=R(r.rAxisID,Rs(e,"r")),c=i.indexAxis,l=i.iAxisID=n(c,o,s,a),u=i.vAxisID=n(c,s,o,a);i.xScale=this.getScaleForId(o),i.yScale=this.getScaleForId(s),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(l),i.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const i=this._cachedMeta;return e===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&id(this._data,this),e._stacked&&Un(e)}_dataCheck(){const e=this.getDataset(),i=e.data||(e.data=[]),r=this._data;if(W(i)){const n=this._cachedMeta;this._data=Aw(i,n)}else if(r!==i){if(r){id(r,this);const n=this._cachedMeta;Un(n),n._parsed=[]}i&&Object.isExtensible(i)&&wS(i,this),this._syncList=[],this._data=i}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const i=this._cachedMeta,r=this.getDataset();let n=!1;this._dataCheck();const o=i._stacked;i._stacked=js(i.vScale,i),i.stack!==r.stack&&(n=!0,Un(i),i.stack=r.stack),this._resyncElements(e),(n||o!==i._stacked)&&(yd(this,i._parsed),i._stacked=js(i.vScale,i))}configure(){const e=this.chart.config,i=e.datasetScopeKeys(this._type),r=e.getOptionScopes(this.getDataset(),i,!0);this.options=e.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,i){const{_cachedMeta:r,_data:n}=this,{iScale:o,_stacked:s}=r,a=o.axis;let c=e===0&&i===n.length?!0:r._sorted,l=e>0&&r._parsed[e-1],u,d,h;if(this._parsing===!1)r._parsed=n,r._sorted=!0,h=n;else{ue(n[e])?h=this.parseArrayData(r,n,e,i):W(n[e])?h=this.parseObjectData(r,n,e,i):h=this.parsePrimitiveData(r,n,e,i);const f=()=>d[a]===null||l&&d[a]<l[a];for(u=0;u<i;++u)r._parsed[u+e]=d=h[u],c&&(f()&&(c=!1),l=d);r._sorted=c}s&&yd(this,h)}parsePrimitiveData(e,i,r,n){const{iScale:o,vScale:s}=e,a=o.axis,c=s.axis,l=o.getLabels(),u=o===s,d=new Array(n);let h,f,m;for(h=0,f=n;h<f;++h)m=h+r,d[h]={[a]:u||o.parse(l[m],m),[c]:s.parse(i[m],m)};return d}parseArrayData(e,i,r,n){const{xScale:o,yScale:s}=e,a=new Array(n);let c,l,u,d;for(c=0,l=n;c<l;++c)u=c+r,d=i[u],a[c]={x:o.parse(d[0],u),y:s.parse(d[1],u)};return a}parseObjectData(e,i,r,n){const{xScale:o,yScale:s}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(n);let u,d,h,f;for(u=0,d=n;u<d;++u)h=u+r,f=i[h],l[u]={x:o.parse(kt(f,a),h),y:s.parse(kt(f,c),h)};return l}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,i,r){const n=this.chart,o=this._cachedMeta,s=i[e.axis],a={keys:Dv(n,!0),values:i._stacks[e.axis]._visualValues};return bd(a,s,o.index,{mode:r})}updateRangeFromParsed(e,i,r,n){const o=r[i.axis];let s=o===null?NaN:o;const a=n&&r._stacks[i.axis];n&&a&&(n.values=a,s=bd(n,o,this._cachedMeta.index)),e.min=Math.min(e.min,s),e.max=Math.max(e.max,s)}getMinMax(e,i){const r=this._cachedMeta,n=r._parsed,o=r._sorted&&e===r.iScale,s=n.length,a=this._getOtherScale(e),c=Fw(i,r,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Rw(a);let h,f;function m(){f=n[h];const p=f[a.axis];return!fe(f[e.axis])||u>p||d<p}for(h=0;h<s&&!(!m()&&(this.updateRangeFromParsed(l,e,f,c),o));++h);if(o){for(h=s-1;h>=0;--h)if(!m()){this.updateRangeFromParsed(l,e,f,c);break}}return l}getAllParsedValues(e){const i=this._cachedMeta._parsed,r=[];let n,o,s;for(n=0,o=i.length;n<o;++n)s=i[n][e.axis],fe(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(e){const i=this._cachedMeta,r=i.iScale,n=i.vScale,o=this.getParsed(e);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(e){const i=this._cachedMeta;this.update(e||"default"),i._clip=Cw(R(this.options.clip,Ew(i.xScale,i.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,i=this.chart,r=this._cachedMeta,n=r.data||[],o=i.chartArea,s=[],a=this._drawStart||0,c=this._drawCount||n.length-a,l=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(e,o,a,c),u=a;u<a+c;++u){const d=n[u];d.hidden||(d.active&&l?s.push(d):d.draw(e,o))}for(u=0;u<s.length;++u)s[u].draw(e,o)}getStyle(e,i){const r=i?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(e||0,r)}getContext(e,i,r){const n=this.getDataset();let o;if(e>=0&&e<this._cachedMeta.data.length){const s=this._cachedMeta.data[e];o=s.$context||(s.$context=Lw(this.getContext(),e,s)),o.parsed=this.getParsed(e),o.raw=n.data[e],o.index=o.dataIndex=e}else o=this.$context||(this.$context=Uw(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!i,o.mode=r,o}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,i){return this._resolveElementOptions(this.dataElementType.id,i,e)}_resolveElementOptions(e,i="default",r){const n=i==="active",o=this._cachedDataOpts,s=e+"-"+i,a=o[s],c=this.enableOptionSharing&&ai(r);if(a)return xd(a,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,e),d=n?[`${e}Hover`,"hover",e,""]:[e,""],h=l.getOptionScopes(this.getDataset(),u),f=Object.keys(de.elements[e]),m=()=>this.getContext(r,n,i),p=l.resolveNamedOptions(h,f,m,d);return p.$shared&&(p.$shared=c,o[s]=Object.freeze(xd(p,c))),p}_resolveAnimations(e,i,r){const n=this.chart,o=this._cachedDataOpts,s=`animation-${i}`,a=o[s];if(a)return a;let c;if(n.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,i),h=u.getOptionScopes(this.getDataset(),d);c=u.createResolver(h,this.getContext(e,r,i))}const l=new Ov(n,c&&c.animations);return c&&c._cacheable&&(o[s]=Object.freeze(l)),l}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,i){return!i||Ns(e)||this.chart._animationsDisabled}_getSharedOptions(e,i){const r=this.resolveDataElementOptions(e,i),n=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(i,o)||o!==n;return this.updateSharedOptions(o,i,r),{sharedOptions:o,includeOptions:s}}updateElement(e,i,r,n){Ns(n)?Object.assign(e,r):this._resolveAnimations(i,n).update(e,r)}updateSharedOptions(e,i,r){e&&!Ns(i)&&this._resolveAnimations(void 0,i).update(e,r)}_setStyle(e,i,r,n){e.active=n;const o=this.getStyle(i,n);this._resolveAnimations(i,r,n).update(e,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(e,i,r){this._setStyle(e,r,"active",!1)}setHoverStyle(e,i,r){this._setStyle(e,r,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const i=this._data,r=this._cachedMeta.data;for(const[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];const n=r.length,o=i.length,s=Math.min(o,n);s&&this.parse(0,s),o>n?this._insertElements(n,o-n,e):o<n&&this._removeElements(o,n-o)}_insertElements(e,i,r=!0){const n=this._cachedMeta,o=n.data,s=e+i;let a;const c=l=>{for(l.length+=i,a=l.length-1;a>=s;a--)l[a]=l[a-i]};for(c(o),a=e;a<s;++a)o[a]=new this.dataElementType;this._parsing&&c(n._parsed),this.parse(e,i),r&&this.updateElements(o,e,i,"reset")}updateElements(e,i,r,n){}_removeElements(e,i){const r=this._cachedMeta;if(this._parsing){const n=r._parsed.splice(e,i);r._stacked&&Un(r,n)}r.data.splice(e,i)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[i,r,n]=e;this[i](r,n)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,i){i&&this._sync(["_removeElements",e,i]);const r=arguments.length-2;r&&this._sync(["_insertElements",e,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}w(Ye,"defaults",{}),w(Ye,"datasetElementType",null),w(Ye,"dataElementType",null);function Zw(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let r=[];for(let n=0,o=i.length;n<o;n++)r=r.concat(i[n].controller.getAllParsedValues(t));t._cache.$bar=uv(r.sort((n,o)=>n-o))}return t._cache.$bar}function Bw(t){const e=t.iScale,i=Zw(e,t.type);let r=e._length,n,o,s,a;const c=()=>{s===32767||s===-32768||(ai(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(n=0,o=i.length;n<o;++n)s=e.getPixelForValue(i[n]),c();for(a=void 0,n=0,o=e.ticks.length;n<o;++n)s=e.getPixelForTick(n),c();return r}function Hw(t,e,i,r){const n=i.barThickness;let o,s;return V(n)?(o=e.min*i.categoryPercentage,s=i.barPercentage):(o=n*r,s=1),{chunk:o/r,ratio:s,start:e.pixels[t]-o/2}}function Vw(t,e,i,r){const n=e.pixels,o=n[t];let s=t>0?n[t-1]:null,a=t<n.length-1?n[t+1]:null;const c=i.categoryPercentage;s===null&&(s=o-(a===null?e.end-e.start:a-o)),a===null&&(a=o+o-s);const l=o-(o-Math.min(s,a))/2*c;return{chunk:Math.abs(a-s)/2*c/r,ratio:i.barPercentage,start:l}}function Ww(t,e,i,r){const n=i.parse(t[0],r),o=i.parse(t[1],r),s=Math.min(n,o),a=Math.max(n,o);let c=s,l=a;Math.abs(s)>Math.abs(a)&&(c=a,l=s),e[i.axis]=l,e._custom={barStart:c,barEnd:l,start:n,end:o,min:s,max:a}}function Mv(t,e,i,r){return ue(t)?Ww(t,e,i,r):e[i.axis]=i.parse(t,r),e}function $d(t,e,i,r){const n=t.iScale,o=t.vScale,s=n.getLabels(),a=n===o,c=[];let l,u,d,h;for(l=i,u=i+r;l<u;++l)h=e[l],d={},d[n.axis]=a||n.parse(s[l],l),c.push(Mv(h,d,o,l));return c}function Us(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function qw(t,e,i){return t!==0?tt(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}function Jw(t){let e,i,r,n,o;return t.horizontal?(e=t.base>t.x,i="left",r="right"):(e=t.base<t.y,i="bottom",r="top"),e?(n="end",o="start"):(n="start",o="end"),{start:i,end:r,reverse:e,top:n,bottom:o}}function Kw(t,e,i,r){let n=e.borderSkipped;const o={};if(!n){t.borderSkipped=o;return}if(n===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:c,top:l,bottom:u}=Jw(t);n==="middle"&&i&&(t.enableBorderRadius=!0,(i._top||0)===r?n=l:(i._bottom||0)===r?n=u:(o[kd(u,s,a,c)]=!0,n=l)),o[kd(n,s,a,c)]=!0,t.borderSkipped=o}function kd(t,e,i,r){return r?(t=Gw(t,e,i),t=Sd(t,i,e)):t=Sd(t,e,i),t}function Gw(t,e,i){return t===e?i:t===i?e:t}function Sd(t,e,i){return t==="start"?e:t==="end"?i:t}function Yw(t,{inflateAmount:e},i){t.inflateAmount=e==="auto"?i===1?.33:0:e}class Fr extends Ye{parsePrimitiveData(e,i,r,n){return $d(e,i,r,n)}parseArrayData(e,i,r,n){return $d(e,i,r,n)}parseObjectData(e,i,r,n){const{iScale:o,vScale:s}=e,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=o.axis==="x"?a:c,u=s.axis==="x"?a:c,d=[];let h,f,m,p;for(h=r,f=r+n;h<f;++h)p=i[h],m={},m[o.axis]=o.parse(kt(p,l),h),d.push(Mv(kt(p,u),m,s,h));return d}updateRangeFromParsed(e,i,r,n){super.updateRangeFromParsed(e,i,r,n);const o=r._custom;o&&i===this._cachedMeta.vScale&&(e.min=Math.min(e.min,o.min),e.max=Math.max(e.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const i=this._cachedMeta,{iScale:r,vScale:n}=i,o=this.getParsed(e),s=o._custom,a=Us(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,e)}updateElements(e,i,r,n){const o=n==="reset",{index:s,_cachedMeta:{vScale:a}}=this,c=a.getBasePixel(),l=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(i,n);for(let f=i;f<i+r;f++){const m=this.getParsed(f),p=o||V(m[a.axis])?{base:c,head:c}:this._calculateBarValuePixels(f),g=this._calculateBarIndexPixels(f,u),v=(m._stacks||{})[a.axis],x={horizontal:l,base:p.base,enableBorderRadius:!v||Us(m._custom)||s===v._top||s===v._bottom,x:l?p.head:g.center,y:l?g.center:p.head,height:l?g.size:Math.abs(p.size),width:l?Math.abs(p.size):g.size};h&&(x.options=d||this.resolveDataElementOptions(f,e[f].active?"active":n));const z=x.options||e[f].options;Kw(x,z,v,s),Yw(x,z,u.ratio),this.updateElement(e[f],f,x,n)}}_getStacks(e,i){const{iScale:r}=this._cachedMeta,n=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),o=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(i),c=a&&a[r.axis],l=u=>{const d=u._parsed.find(f=>f[r.axis]===c),h=d&&d[u.vScale.axis];if(V(h)||isNaN(h))return!0};for(const u of n)if(!(i!==void 0&&l(u))&&((o===!1||s.indexOf(u.stack)===-1||o===void 0&&u.stack===void 0)&&s.push(u.stack),u.index===e))break;return s.length||s.push(void 0),s}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(e).filter(r=>e[r].axis===i).shift()}_getAxis(){const e={},i=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)e[R(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,i)]=!0;return Object.keys(e)}_getStackIndex(e,i,r){const n=this._getStacks(e,r),o=i!==void 0?n.indexOf(i):-1;return o===-1?n.length-1:o}_getRuler(){const e=this.options,i=this._cachedMeta,r=i.iScale,n=[];let o,s;for(o=0,s=i.data.length;o<s;++o)n.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=e.barThickness;return{min:a||Bw(i),pixels:n,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:e.grouped,ratio:a?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:i,_stacked:r,index:n},options:{base:o,minBarLength:s}}=this,a=o||0,c=this.getParsed(e),l=c._custom,u=Us(l);let d=c[i.axis],h=0,f=r?this.applyStack(i,c,r):d,m,p;f!==d&&(h=f-d,f=d),u&&(d=l.barStart,f=l.barEnd-l.barStart,d!==0&&tt(d)!==tt(l.barEnd)&&(h=0),h+=d);const g=!V(o)&&!u?o:h;let v=i.getPixelForValue(g);if(this.chart.getDataVisibility(e)?m=i.getPixelForValue(h+f):m=v,p=m-v,Math.abs(p)<s){p=qw(p,i,a)*s,d===a&&(v-=p/2);const x=i.getPixelForDecimal(0),z=i.getPixelForDecimal(1),I=Math.min(x,z),k=Math.max(x,z);v=Math.max(Math.min(v,k),I),m=v+p,r&&!u&&(c._stacks[i.axis]._visualValues[n]=i.getValueForPixel(m)-i.getValueForPixel(v))}if(v===i.getPixelForValue(a)){const x=tt(p)*i.getLineWidthForValue(a)/2;v+=x,p-=x}return{size:p,base:v,head:m,center:m+p/2}}_calculateBarIndexPixels(e,i){const r=i.scale,n=this.options,o=n.skipNull,s=R(n.maxBarThickness,1/0);let a,c;const l=this._getAxisCount();if(i.grouped){const u=o?this._getStackCount(e):i.stackCount,d=n.barThickness==="flex"?Vw(e,i,n,u*l):Hw(e,i,n,u*l),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(R(h,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?e:void 0)+f;a=d.start+d.chunk*m+d.chunk/2,c=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(e)[r.axis],e),c=Math.min(s,i.min*i.ratio);return{base:a-c/2,head:a+c/2,center:a,size:c}}draw(){const e=this._cachedMeta,i=e.vScale,r=e.data,n=r.length;let o=0;for(;o<n;++o)this.getParsed(o)[i.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}w(Fr,"id","bar"),w(Fr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),w(Fr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Zr extends Ye{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,i,r,n){const o=super.parsePrimitiveData(e,i,r,n);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(e,i,r,n){const o=super.parseArrayData(e,i,r,n);for(let s=0;s<o.length;s++){const a=i[r+s];o[s]._custom=R(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(e,i,r,n){const o=super.parseObjectData(e,i,r,n);for(let s=0;s<o.length;s++){const a=i[r+s];o[s]._custom=R(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const e=this._cachedMeta.data;let i=0;for(let r=e.length-1;r>=0;--r)i=Math.max(i,e[r].size(this.resolveDataElementOptions(r))/2);return i>0&&i}getLabelAndValue(e){const i=this._cachedMeta,r=this.chart.data.labels||[],{xScale:n,yScale:o}=i,s=this.getParsed(e),a=n.getLabelForValue(s.x),c=o.getLabelForValue(s.y),l=s._custom;return{label:r[e]||"",value:"("+a+", "+c+(l?", "+l:"")+")"}}update(e){const i=this._cachedMeta.data;this.updateElements(i,0,i.length,e)}updateElements(e,i,r,n){const o=n==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(i,n),u=s.axis,d=a.axis;for(let h=i;h<i+r;h++){const f=e[h],m=!o&&this.getParsed(h),p={},g=p[u]=o?s.getPixelForDecimal(.5):s.getPixelForValue(m[u]),v=p[d]=o?a.getBasePixel():a.getPixelForValue(m[d]);p.skip=isNaN(g)||isNaN(v),l&&(p.options=c||this.resolveDataElementOptions(h,f.active?"active":n),o&&(p.options.radius=0)),this.updateElement(f,h,p,n)}}resolveDataElementOptions(e,i){const r=this.getParsed(e);let n=super.resolveDataElementOptions(e,i);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return i!=="active"&&(n.radius=0),n.radius+=R(r&&r._custom,o),n}}w(Zr,"id","bubble"),w(Zr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),w(Zr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Xw(t,e,i){let r=1,n=1,o=0,s=0;if(e<ce){const a=t,c=a+e,l=Math.cos(a),u=Math.sin(a),d=Math.cos(c),h=Math.sin(c),f=(z,I,k)=>ci(z,a,c,!0)?1:Math.max(I,I*i,k,k*i),m=(z,I,k)=>ci(z,a,c,!0)?-1:Math.min(I,I*i,k,k*i),p=f(0,l,d),g=f(pe,u,h),v=m(Y,l,d),x=m(Y+pe,u,h);r=(p-v)/2,n=(g-x)/2,o=-(p+v)/2,s=-(g+x)/2}return{ratioX:r,ratioY:n,offsetX:o,offsetY:s}}class Ut extends Ye{constructor(e,i){super(e,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,i){const r=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=r;else{let o=c=>+r[c];if(W(r[e])){const{key:c="value"}=this._parsing;o=l=>+kt(r[l],c)}let s,a;for(s=e,a=e+i;s<a;++s)n._parsed[s]=o(s)}}_getRotation(){return Ge(this.options.rotation-90)}_getCircumference(){return Ge(this.options.circumference)}_getRotationExtents(){let e=ce,i=-ce;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const n=this.chart.getDatasetMeta(r).controller,o=n._getRotation(),s=n._getCircumference();e=Math.min(e,o),i=Math.max(i,o+s)}return{rotation:e,circumference:i-e}}update(e){const i=this.chart,{chartArea:r}=i,n=this._cachedMeta,o=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),c=Math.min(uS(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:m,offsetY:p}=Xw(d,u,c),g=(r.width-s)/h,v=(r.height-s)/f,x=Math.max(Math.min(g,v)/2,0),z=ov(this.options.radius,x),I=Math.max(z*c,0),k=(z-I)/this._getVisibleDatasetWeightTotal();this.offsetX=m*z,this.offsetY=p*z,n.total=this.calculateTotal(),this.outerRadius=z-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*l,0),this.updateElements(o,0,o.length,e)}_circumference(e,i){const r=this.options,n=this._cachedMeta,o=this._getCircumference();return i&&r.animation.animateRotate||!this.chart.getDataVisibility(e)||n._parsed[e]===null||n.data[e].hidden?0:this.calculateCircumference(n._parsed[e]*o/ce)}updateElements(e,i,r,n){const o=n==="reset",s=this.chart,a=s.chartArea,l=s.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,h=o&&l.animateScale,f=h?0:this.innerRadius,m=h?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(i,n);let v=this._getRotation(),x;for(x=0;x<i;++x)v+=this._circumference(x,o);for(x=i;x<i+r;++x){const z=this._circumference(x,o),I=e[x],k={x:u+this.offsetX,y:d+this.offsetY,startAngle:v,endAngle:v+z,circumference:z,outerRadius:m,innerRadius:f};g&&(k.options=p||this.resolveDataElementOptions(x,I.active?"active":n)),v+=z,this.updateElement(I,x,k,n)}}calculateTotal(){const e=this._cachedMeta,i=e.data;let r=0,n;for(n=0;n<i.length;n++){const o=e._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!i[n].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(e){const i=this._cachedMeta.total;return i>0&&!isNaN(e)?ce*(Math.abs(e)/i):0}getLabelAndValue(e){const i=this._cachedMeta,r=this.chart,n=r.data.labels||[],o=br(i._parsed[e],r.options.locale);return{label:n[e]||"",value:o}}getMaxBorderWidth(e){let i=0;const r=this.chart;let n,o,s,a,c;if(!e){for(n=0,o=r.data.datasets.length;n<o;++n)if(r.isDatasetVisible(n)){s=r.getDatasetMeta(n),e=s.data,a=s.controller;break}}if(!e)return 0;for(n=0,o=e.length;n<o;++n)c=a.resolveDataElementOptions(n),c.borderAlign!=="inner"&&(i=Math.max(i,c.borderWidth||0,c.hoverBorderWidth||0));return i}getMaxOffset(e){let i=0;for(let r=0,n=e.length;r<n;++r){const o=this.resolveDataElementOptions(r);i=Math.max(i,o.offset||0,o.hoverOffset||0)}return i}_getRingWeightOffset(e){let i=0;for(let r=0;r<e;++r)this.chart.isDatasetVisible(r)&&(i+=this._getRingWeight(r));return i}_getRingWeight(e){return Math.max(R(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}w(Ut,"id","doughnut"),w(Ut,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),w(Ut,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),w(Ut,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const i=e.data,{labels:{pointStyle:r,textAlign:n,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return i.labels.length&&i.datasets.length?i.labels.map((c,l)=>{const d=e.getDatasetMeta(0).controller.getStyle(l);return{text:c,fillStyle:d.backgroundColor,fontColor:o,hidden:!e.getDataVisibility(l),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:r,borderRadius:s&&(a||d.borderRadius),index:l}}):[]}},onClick(e,i,r){r.chart.toggleDataVisibility(i.index),r.chart.update()}}}});class Br extends Ye{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const i=this._cachedMeta,{dataset:r,data:n=[],_dataset:o}=i,s=this.chart._animationsDisabled;let{start:a,count:c}=fv(i,n,s);this._drawStart=a,this._drawCount=c,mv(i)&&(a=0,c=n.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=n;const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:l},e),this.updateElements(n,a,c,e)}updateElements(e,i,r,n){const o=n==="reset",{iScale:s,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(i,n),h=s.axis,f=a.axis,{spanGaps:m,segment:p}=this.options,g=bn(m)?m:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||o||n==="none",x=i+r,z=e.length;let I=i>0&&this.getParsed(i-1);for(let k=0;k<z;++k){const O=e[k],P=v?O:{};if(k<i||k>=x){P.skip=!0;continue}const D=this.getParsed(k),E=V(D[f]),F=P[h]=s.getPixelForValue(D[h],k),B=P[f]=o||E?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,D,c):D[f],k);P.skip=isNaN(F)||isNaN(B)||E,P.stop=k>0&&Math.abs(D[h]-I[h])>g,p&&(P.parsed=D,P.raw=l.data[k]),d&&(P.options=u||this.resolveDataElementOptions(k,O.active?"active":n)),v||this.updateElement(O,k,P,n),I=D}}getMaxOverflow(){const e=this._cachedMeta,i=e.dataset,r=i.options&&i.options.borderWidth||0,n=e.data||[];if(!n.length)return r;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,o,s)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}w(Br,"id","line"),w(Br,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),w(Br,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ti extends Ye{constructor(e,i){super(e,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const i=this._cachedMeta,r=this.chart,n=r.data.labels||[],o=br(i._parsed[e].r,r.options.locale);return{label:n[e]||"",value:o}}parseObjectData(e,i,r,n){return $v.bind(this)(e,i,r,n)}update(e){const i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,e)}getMinMax(){const e=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((r,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<i.min&&(i.min=o),o>i.max&&(i.max=o))}),i}_updateRadius(){const e=this.chart,i=e.chartArea,r=e.options,n=Math.min(i.right-i.left,i.bottom-i.top),o=Math.max(n/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/e.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(e,i,r,n){const o=n==="reset",s=this.chart,c=s.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,d=l.yCenter,h=l.getIndexAngle(0)-.5*Y;let f=h,m;const p=360/this.countVisibleElements();for(m=0;m<i;++m)f+=this._computeAngle(m,n,p);for(m=i;m<i+r;m++){const g=e[m];let v=f,x=f+this._computeAngle(m,n,p),z=s.getDataVisibility(m)?l.getDistanceFromCenterForValue(this.getParsed(m).r):0;f=x,o&&(c.animateScale&&(z=0),c.animateRotate&&(v=x=h));const I={x:u,y:d,innerRadius:0,outerRadius:z,startAngle:v,endAngle:x,options:this.resolveDataElementOptions(m,g.active?"active":n)};this.updateElement(g,m,I,n)}}countVisibleElements(){const e=this._cachedMeta;let i=0;return e.data.forEach((r,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(e,i,r){return this.chart.getDataVisibility(e)?Ge(this.resolveDataElementOptions(e,i).angle||r):0}}w(ti,"id","polarArea"),w(ti,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),w(ti,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const i=e.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:r,color:n}}=e.legend.options;return i.labels.map((o,s)=>{const c=e.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:n,lineWidth:c.borderWidth,pointStyle:r,hidden:!e.getDataVisibility(s),index:s}})}return[]}},onClick(e,i,r){r.chart.toggleDataVisibility(i.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class ra extends Ut{}w(ra,"id","pie"),w(ra,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Hr extends Ye{getLabelAndValue(e){const i=this._cachedMeta.vScale,r=this.getParsed(e);return{label:i.getLabels()[e],value:""+i.getLabelForValue(r[i.axis])}}parseObjectData(e,i,r,n){return $v.bind(this)(e,i,r,n)}update(e){const i=this._cachedMeta,r=i.dataset,n=i.data||[],o=i.iScale.getLabels();if(r.points=n,e!=="resize"){const s=this.resolveDatasetElementOptions(e);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:s};this.updateElement(r,void 0,a,e)}this.updateElements(n,0,n.length,e)}updateElements(e,i,r,n){const o=this._cachedMeta.rScale,s=n==="reset";for(let a=i;a<i+r;a++){const c=e[a],l=this.resolveDataElementOptions(a,c.active?"active":n),u=o.getPointPositionForValue(a,this.getParsed(a).r),d=s?o.xCenter:u.x,h=s?o.yCenter:u.y,f={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:l};this.updateElement(c,a,f,n)}}}w(Hr,"id","radar"),w(Hr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),w(Hr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Vr extends Ye{getLabelAndValue(e){const i=this._cachedMeta,r=this.chart.data.labels||[],{xScale:n,yScale:o}=i,s=this.getParsed(e),a=n.getLabelForValue(s.x),c=o.getLabelForValue(s.y);return{label:r[e]||"",value:"("+a+", "+c+")"}}update(e){const i=this._cachedMeta,{data:r=[]}=i,n=this.chart._animationsDisabled;let{start:o,count:s}=fv(i,r,n);if(this._drawStart=o,this._drawCount=s,mv(i)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:c}=i;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!c._decimated,a.points=r;const l=this.resolveDatasetElementOptions(e);l.segment=this.options.segment,this.updateElement(a,void 0,{animated:!n,options:l},e)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,i,r,n){const o=n==="reset",{iScale:s,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(i,n),d=this.getSharedOptions(u),h=this.includeOptions(n,d),f=s.axis,m=a.axis,{spanGaps:p,segment:g}=this.options,v=bn(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||n==="none";let z=i>0&&this.getParsed(i-1);for(let I=i;I<i+r;++I){const k=e[I],O=this.getParsed(I),P=x?k:{},D=V(O[m]),E=P[f]=s.getPixelForValue(O[f],I),F=P[m]=o||D?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,O,c):O[m],I);P.skip=isNaN(E)||isNaN(F)||D,P.stop=I>0&&Math.abs(O[f]-z[f])>v,g&&(P.parsed=O,P.raw=l.data[I]),h&&(P.options=d||this.resolveDataElementOptions(I,k.active?"active":n)),x||this.updateElement(k,I,P,n),z=O}this.updateSharedOptions(d,n,u)}getMaxOverflow(){const e=this._cachedMeta,i=e.data||[];if(!this.options.showLine){let a=0;for(let c=i.length-1;c>=0;--c)a=Math.max(a,i[c].size(this.resolveDataElementOptions(c))/2);return a>0&&a}const r=e.dataset,n=r.options&&r.options.borderWidth||0;if(!i.length)return n;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,o,s)/2}}w(Vr,"id","scatter"),w(Vr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),w(Vr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Qw=Object.freeze({__proto__:null,BarController:Fr,BubbleController:Zr,DoughnutController:Ut,LineController:Br,PieController:ra,PolarAreaController:ti,RadarController:Hr,ScatterController:Vr});function Et(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class _u{constructor(e){w(this,"options");this.options=e||{}}static override(e){Object.assign(_u.prototype,e)}init(){}formats(){return Et()}parse(){return Et()}format(){return Et()}add(){return Et()}diff(){return Et()}startOf(){return Et()}endOf(){return Et()}}var e0={_date:_u};function t0(t,e,i,r){const{controller:n,data:o,_sorted:s}=t,a=n._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(a&&e===a.axis&&e!=="r"&&s&&o.length){const l=a._reversePixels?kS:ut;if(r){if(n._sharedOptions){const u=o[0],d=typeof u.getRange=="function"&&u.getRange(e);if(d){const h=l(o,e,i-d),f=l(o,e,i+d);return{lo:h.lo,hi:f.hi}}}}else{const u=l(o,e,i);if(c){const{vScale:d}=n._cachedMeta,{_parsed:h}=t,f=h.slice(0,u.lo+1).reverse().findIndex(p=>!V(p[d.axis]));u.lo-=Math.max(0,f);const m=h.slice(u.hi).findIndex(p=>!V(p[d.axis]));u.hi+=Math.max(0,m)}return u}}return{lo:0,hi:o.length-1}}function Os(t,e,i,r,n){const o=t.getSortedVisibleDatasetMetas(),s=i[e];for(let a=0,c=o.length;a<c;++a){const{index:l,data:u}=o[a],{lo:d,hi:h}=t0(o[a],e,s,n);for(let f=d;f<=h;++f){const m=u[f];m.skip||r(m,l,f)}}}function n0(t){const e=t.indexOf("x")!==-1,i=t.indexOf("y")!==-1;return function(r,n){const o=e?Math.abs(r.x-n.x):0,s=i?Math.abs(r.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function Ls(t,e,i,r,n){const o=[];return!n&&!t.isPointInArea(e)||Os(t,i,e,function(a,c,l){!n&&!dt(a,t.chartArea,0)||a.inRange(e.x,e.y,r)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function i0(t,e,i,r){let n=[];function o(s,a,c){const{startAngle:l,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=cv(s,{x:e.x,y:e.y});ci(d,l,u)&&n.push({element:s,datasetIndex:a,index:c})}return Os(t,i,e,o),n}function r0(t,e,i,r,n,o){let s=[];const a=n0(i);let c=Number.POSITIVE_INFINITY;function l(u,d,h){const f=u.inRange(e.x,e.y,n);if(r&&!f)return;const m=u.getCenterPoint(n);if(!(!!o||t.isPointInArea(m))&&!f)return;const g=a(e,m);g<c?(s=[{element:u,datasetIndex:d,index:h}],c=g):g===c&&s.push({element:u,datasetIndex:d,index:h})}return Os(t,i,e,l),s}function Fs(t,e,i,r,n,o){return!o&&!t.isPointInArea(e)?[]:i==="r"&&!r?i0(t,e,i,n):r0(t,e,i,r,n,o)}function wd(t,e,i,r,n){const o=[],s=i==="x"?"inXRange":"inYRange";let a=!1;return Os(t,i,e,(c,l,u)=>{c[s]&&c[s](e[i],n)&&(o.push({element:c,datasetIndex:l,index:u}),a=a||c.inRange(e.x,e.y,n))}),r&&!a?[]:o}var o0={modes:{index(t,e,i,r){const n=jt(e,t),o=i.axis||"x",s=i.includeInvisible||!1,a=i.intersect?Ls(t,n,o,r,s):Fs(t,n,o,!1,r,s),c=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach(l=>{const u=a[0].index,d=l.data[u];d&&!d.skip&&c.push({element:d,datasetIndex:l.index,index:u})}),c):[]},dataset(t,e,i,r){const n=jt(e,t),o=i.axis||"xy",s=i.includeInvisible||!1;let a=i.intersect?Ls(t,n,o,r,s):Fs(t,n,o,!1,r,s);if(a.length>0){const c=a[0].datasetIndex,l=t.getDatasetMeta(c).data;a=[];for(let u=0;u<l.length;++u)a.push({element:l[u],datasetIndex:c,index:u})}return a},point(t,e,i,r){const n=jt(e,t),o=i.axis||"xy",s=i.includeInvisible||!1;return Ls(t,n,o,r,s)},nearest(t,e,i,r){const n=jt(e,t),o=i.axis||"xy",s=i.includeInvisible||!1;return Fs(t,n,o,i.intersect,r,s)},x(t,e,i,r){const n=jt(e,t);return wd(t,n,"x",i.intersect,r)},y(t,e,i,r){const n=jt(e,t);return wd(t,n,"y",i.intersect,r)}}};const Ev=["left","top","right","bottom"];function Ln(t,e){return t.filter(i=>i.pos===e)}function Id(t,e){return t.filter(i=>Ev.indexOf(i.pos)===-1&&i.box.axis===e)}function Fn(t,e){return t.sort((i,r)=>{const n=e?r:i,o=e?i:r;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function s0(t){const e=[];let i,r,n,o,s,a;for(i=0,r=(t||[]).length;i<r;++i)n=t[i],{position:o,options:{stack:s,stackWeight:a=1}}=n,e.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:s&&o+s,stackWeight:a});return e}function a0(t){const e={};for(const i of t){const{stack:r,pos:n,stackWeight:o}=i;if(!r||!Ev.includes(n))continue;const s=e[r]||(e[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return e}function c0(t,e){const i=a0(t),{vBoxMaxWidth:r,hBoxMaxHeight:n}=e;let o,s,a;for(o=0,s=t.length;o<s;++o){a=t[o];const{fullSize:c}=a.box,l=i[a.stack],u=l&&a.stackWeight/l.weight;a.horizontal?(a.width=u?u*r:c&&e.availableWidth,a.height=n):(a.width=r,a.height=u?u*n:c&&e.availableHeight)}return i}function l0(t){const e=s0(t),i=Fn(e.filter(l=>l.box.fullSize),!0),r=Fn(Ln(e,"left"),!0),n=Fn(Ln(e,"right")),o=Fn(Ln(e,"top"),!0),s=Fn(Ln(e,"bottom")),a=Id(e,"x"),c=Id(e,"y");return{fullSize:i,leftAndTop:r.concat(o),rightAndBottom:n.concat(c).concat(s).concat(a),chartArea:Ln(e,"chartArea"),vertical:r.concat(n).concat(c),horizontal:o.concat(s).concat(a)}}function zd(t,e,i,r){return Math.max(t[i],e[i])+Math.max(t[r],e[r])}function Cv(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function u0(t,e,i,r){const{pos:n,box:o}=i,s=t.maxPadding;if(!W(n)){i.size&&(t[n]-=i.size);const d=r[i.stack]||{size:0,count:1};d.size=Math.max(d.size,i.horizontal?o.height:o.width),i.size=d.size/d.count,t[n]+=i.size}o.getPadding&&Cv(s,o.getPadding());const a=Math.max(0,e.outerWidth-zd(s,t,"left","right")),c=Math.max(0,e.outerHeight-zd(s,t,"top","bottom")),l=a!==t.w,u=c!==t.h;return t.w=a,t.h=c,i.horizontal?{same:l,other:u}:{same:u,other:l}}function d0(t){const e=t.maxPadding;function i(r){const n=Math.max(e[r]-t[r],0);return t[r]+=n,n}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function h0(t,e){const i=e.maxPadding;function r(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(s=>{o[s]=Math.max(e[s],i[s])}),o}return r(t?["left","right"]:["top","bottom"])}function qn(t,e,i,r){const n=[];let o,s,a,c,l,u;for(o=0,s=t.length,l=0;o<s;++o){a=t[o],c=a.box,c.update(a.width||e.w,a.height||e.h,h0(a.horizontal,e));const{same:d,other:h}=u0(e,i,a,r);l|=d&&n.length,u=u||h,c.fullSize||n.push(a)}return l&&qn(n,e,i,r)||u}function Dr(t,e,i,r,n){t.top=i,t.left=e,t.right=e+r,t.bottom=i+n,t.width=r,t.height=n}function Pd(t,e,i,r){const n=i.padding;let{x:o,y:s}=e;for(const a of t){const c=a.box,l=r[a.stack]||{placed:0,weight:1},u=a.stackWeight/l.weight||1;if(a.horizontal){const d=e.w*u,h=l.size||c.height;ai(l.start)&&(s=l.start),c.fullSize?Dr(c,n.left,s,i.outerWidth-n.right-n.left,h):Dr(c,e.left+l.placed,s,d,h),l.start=s,l.placed+=d,s=c.bottom}else{const d=e.h*u,h=l.size||c.width;ai(l.start)&&(o=l.start),c.fullSize?Dr(c,o,n.top,h,i.outerHeight-n.bottom-n.top):Dr(c,o,e.top+l.placed,h,d),l.start=o,l.placed+=d,o=c.right}}e.x=o,e.y=s}var Te={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(i){e.draw(i)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;i!==-1&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,r){if(!t)return;const n=Oe(t.options.layout.padding),o=Math.max(e-n.width,0),s=Math.max(i-n.height,0),a=l0(t.boxes),c=a.vertical,l=a.horizontal;te(t.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=c.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},n);Cv(h,Oe(r));const f=Object.assign({maxPadding:h,w:o,h:s,x:n.left,y:n.top},n),m=c0(c.concat(l),d);qn(a.fullSize,f,d,m),qn(c,f,d,m),qn(l,f,d,m)&&qn(c,f,d,m),d0(f),Pd(a.leftAndTop,f,d,m),f.x+=f.w,f.y+=f.h,Pd(a.rightAndBottom,f,d,m),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},te(a.chartArea,p=>{const g=p.box;Object.assign(g,t.chartArea),g.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Av{acquireContext(e,i){}releaseContext(e){return!1}addEventListener(e,i,r){}removeEventListener(e,i,r){}getDevicePixelRatio(){return 1}getMaximumSize(e,i,r,n){return i=Math.max(0,i||e.width),r=r||e.height,{width:i,height:Math.max(0,n?Math.floor(i/n):r)}}isAttached(e){return!0}updateConfig(e){}}class f0 extends Av{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Wr="$chartjs",m0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Td=t=>t===null||t==="";function p0(t,e){const i=t.style,r=t.getAttribute("height"),n=t.getAttribute("width");if(t[Wr]={initial:{height:r,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Td(n)){const o=hd(t,"width");o!==void 0&&(t.width=o)}if(Td(r))if(t.style.height==="")t.height=t.width/(e||2);else{const o=hd(t,"height");o!==void 0&&(t.height=o)}return t}const jv=gw?{passive:!0}:!1;function g0(t,e,i){t&&t.addEventListener(e,i,jv)}function v0(t,e,i){t&&t.canvas&&t.canvas.removeEventListener(e,i,jv)}function b0(t,e){const i=m0[t.type]||t.type,{x:r,y:n}=jt(t,e);return{type:i,chart:e,native:t,x:r!==void 0?r:null,y:n!==void 0?n:null}}function lo(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function _0(t,e,i){const r=t.canvas,n=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||lo(a.addedNodes,r),s=s&&!lo(a.removedNodes,r);s&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function y0(t,e,i){const r=t.canvas,n=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||lo(a.removedNodes,r),s=s&&!lo(a.addedNodes,r);s&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const ui=new Map;let Od=0;function Rv(){const t=window.devicePixelRatio;t!==Od&&(Od=t,ui.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function x0(t,e){ui.size||window.addEventListener("resize",Rv),ui.set(t,e)}function $0(t){ui.delete(t),ui.size||window.removeEventListener("resize",Rv)}function k0(t,e,i){const r=t.canvas,n=r&&bu(r);if(!n)return;const o=hv((a,c)=>{const l=n.clientWidth;i(a,c),l<n.clientWidth&&i()},window),s=new ResizeObserver(a=>{const c=a[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||o(l,u)});return s.observe(n),x0(t,o),s}function Zs(t,e,i){i&&i.disconnect(),e==="resize"&&$0(t)}function S0(t,e,i){const r=t.canvas,n=hv(o=>{t.ctx!==null&&i(b0(o,t))},t);return g0(r,e,n),n}class w0 extends Av{acquireContext(e,i){const r=e&&e.getContext&&e.getContext("2d");return r&&r.canvas===e?(p0(e,i),r):null}releaseContext(e){const i=e.canvas;if(!i[Wr])return!1;const r=i[Wr].initial;["height","width"].forEach(o=>{const s=r[o];V(s)?i.removeAttribute(o):i.setAttribute(o,s)});const n=r.style||{};return Object.keys(n).forEach(o=>{i.style[o]=n[o]}),i.width=i.width,delete i[Wr],!0}addEventListener(e,i,r){this.removeEventListener(e,i);const n=e.$proxies||(e.$proxies={}),s={attach:_0,detach:y0,resize:k0}[i]||S0;n[i]=s(e,i,r)}removeEventListener(e,i){const r=e.$proxies||(e.$proxies={}),n=r[i];if(!n)return;({attach:Zs,detach:Zs,resize:Zs}[i]||v0)(e,i,n),r[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,i,r,n){return pw(e,i,r,n)}isAttached(e){const i=e&&bu(e);return!!(i&&i.isConnected)}}function I0(t){return!vu()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?f0:w0}class Xe{constructor(){w(this,"x");w(this,"y");w(this,"active",!1);w(this,"options");w(this,"$animations")}tooltipPosition(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}hasValue(){return bn(this.x)&&bn(this.y)}getProps(e,i){const r=this.$animations;if(!i||!r)return this;const n={};return e.forEach(o=>{n[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),n}}w(Xe,"defaults",{}),w(Xe,"defaultRoutes");function z0(t,e){const i=t.options.ticks,r=P0(t),n=Math.min(i.maxTicksLimit||r,r),o=i.major.enabled?O0(e):[],s=o.length,a=o[0],c=o[s-1],l=[];if(s>n)return D0(e,l,o,s/n),l;const u=T0(o,e,n);if(s>0){let d,h;const f=s>1?Math.round((c-a)/(s-1)):null;for(Mr(e,l,u,V(f)?0:a-f,a),d=0,h=s-1;d<h;d++)Mr(e,l,u,o[d],o[d+1]);return Mr(e,l,u,c,V(f)?e.length:c+f),l}return Mr(e,l,u),l}function P0(t){const e=t.options.offset,i=t._tickSize(),r=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(r,n))}function T0(t,e,i){const r=M0(t),n=e.length/i;if(!r)return Math.max(n,1);const o=bS(r);for(let s=0,a=o.length-1;s<a;s++){const c=o[s];if(c>n)return c}return Math.max(n,1)}function O0(t){const e=[];let i,r;for(i=0,r=t.length;i<r;i++)t[i].major&&e.push(i);return e}function D0(t,e,i,r){let n=0,o=i[0],s;for(r=Math.ceil(r),s=0;s<t.length;s++)s===o&&(e.push(t[s]),n++,o=i[n*r])}function Mr(t,e,i,r,n){const o=R(r,0),s=Math.min(R(n,t.length),t.length);let a=0,c,l,u;for(i=Math.ceil(i),n&&(c=n-r,i=c/Math.floor(c/i)),u=o;u<0;)a++,u=Math.round(o+a*i);for(l=Math.max(o,0);l<s;l++)l===u&&(e.push(t[l]),a++,u=Math.round(o+a*i))}function M0(t){const e=t.length;let i,r;if(e<2)return!1;for(r=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==r)return!1;return r}const E0=t=>t==="left"?"right":t==="right"?"left":t,Dd=(t,e,i)=>e==="top"||e==="left"?t[e]+i:t[e]-i,Md=(t,e)=>Math.min(e||t,t);function Ed(t,e){const i=[],r=t.length/e,n=t.length;let o=0;for(;o<n;o+=r)i.push(t[Math.floor(o)]);return i}function C0(t,e,i){const r=t.ticks.length,n=Math.min(e,r-1),o=t._startPixel,s=t._endPixel,a=1e-6;let c=t.getPixelForTick(n),l;if(!(i&&(r===1?l=Math.max(c-o,s-c):e===0?l=(t.getPixelForTick(1)-c)/2:l=(c-t.getPixelForTick(n-1))/2,c+=n<e?l:-l,c<o-a||c>s+a)))return c}function A0(t,e){te(t,i=>{const r=i.gc,n=r.length/2;let o;if(n>e){for(o=0;o<n;++o)delete i.data[r[o]];r.splice(0,n)}})}function Zn(t){return t.drawTicks?t.tickLength:0}function Cd(t,e){if(!t.display)return 0;const i=ve(t.font,e),r=Oe(t.padding);return(ue(t.text)?t.text.length:1)*i.lineHeight+r.height}function j0(t,e){return zt(t,{scale:e,type:"scale"})}function R0(t,e,i){return zt(t,{tick:i,index:e,type:"tick"})}function N0(t,e,i){let r=du(t);return(i&&e!=="right"||!i&&e==="right")&&(r=E0(r)),r}function U0(t,e,i,r){const{top:n,left:o,bottom:s,right:a,chart:c}=t,{chartArea:l,scales:u}=c;let d=0,h,f,m;const p=s-n,g=a-o;if(t.isHorizontal()){if(f=ze(r,o,a),W(i)){const v=Object.keys(i)[0],x=i[v];m=u[v].getPixelForValue(x)+p-e}else i==="center"?m=(l.bottom+l.top)/2+p-e:m=Dd(t,i,e);h=a-o}else{if(W(i)){const v=Object.keys(i)[0],x=i[v];f=u[v].getPixelForValue(x)-g+e}else i==="center"?f=(l.left+l.right)/2-g+e:f=Dd(t,i,e);m=ze(r,s,n),d=i==="left"?-pe:pe}return{titleX:f,titleY:m,maxWidth:h,rotation:d}}class Xt extends Xe{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,i){return e}getUserBounds(){let{_userMin:e,_userMax:i,_suggestedMin:r,_suggestedMax:n}=this;return e=Re(e,Number.POSITIVE_INFINITY),i=Re(i,Number.NEGATIVE_INFINITY),r=Re(r,Number.POSITIVE_INFINITY),n=Re(n,Number.NEGATIVE_INFINITY),{min:Re(e,r),max:Re(i,n),minDefined:fe(e),maxDefined:fe(i)}}getMinMax(e){let{min:i,max:r,minDefined:n,maxDefined:o}=this.getUserBounds(),s;if(n&&o)return{min:i,max:r};const a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)s=a[c].controller.getMinMax(this,e),n||(i=Math.min(i,s.min)),o||(r=Math.max(r,s.max));return i=o&&i>r?r:i,r=n&&i>r?i:r,{min:Re(i,Re(r,i)),max:Re(r,Re(i,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ae(this.options.beforeUpdate,[this])}update(e,i,r){const{beginAtZero:n,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=i,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=qS(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=a<this.ticks.length;this._convertTicksToLabels(c?Ed(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=z0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,i,r;this.isHorizontal()?(i=this.left,r=this.right):(i=this.top,r=this.bottom,e=!e),this._startPixel=i,this._endPixel=r,this._reversePixels=e,this._length=r-i,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ae(this.options.afterUpdate,[this])}beforeSetDimensions(){ae(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ae(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ae(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ae(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const i=this.options.ticks;let r,n,o;for(r=0,n=e.length;r<n;r++)o=e[r],o.label=ae(i.callback,[o.value,r,e],this)}afterTickToLabelConversion(){ae(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ae(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,i=e.ticks,r=Md(this.ticks.length,e.ticks.maxTicksLimit),n=i.minRotation||0,o=i.maxRotation;let s=n,a,c,l;if(!this._isVisible()||!i.display||n>=o||r<=1||!this.isHorizontal()){this.labelRotation=n;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=be(this.chart.width-d,0,this.maxWidth);a=e.offset?this.maxWidth/r:f/(r-1),d+6>a&&(a=f/(r-(e.offset?.5:1)),c=this.maxHeight-Zn(e.grid)-i.padding-Cd(e.title,this.chart.options.font),l=Math.sqrt(d*d+h*h),s=lu(Math.min(Math.asin(be((u.highest.height+6)/a,-1,1)),Math.asin(be(c/l,-1,1))-Math.asin(be(h/l,-1,1)))),s=Math.max(n,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){ae(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ae(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:i,options:{ticks:r,title:n,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const c=Cd(n,i.options.font);if(a?(e.width=this.maxWidth,e.height=Zn(o)+c):(e.height=this.maxHeight,e.width=Zn(o)+c),r.display&&this.ticks.length){const{first:l,last:u,widest:d,highest:h}=this._getLabelSizes(),f=r.padding*2,m=Ge(this.labelRotation),p=Math.cos(m),g=Math.sin(m);if(a){const v=r.mirror?0:g*d.width+p*h.height;e.height=Math.min(this.maxHeight,e.height+v+f)}else{const v=r.mirror?0:p*d.width+g*h.height;e.width=Math.min(this.maxWidth,e.width+v+f)}this._calculatePadding(l,u,g,p)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,i,r,n){const{ticks:{align:o,padding:s},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;c?l?(h=n*e.width,f=r*i.height):(h=r*e.height,f=n*i.width):o==="start"?f=i.width:o==="end"?h=e.width:o!=="inner"&&(h=e.width/2,f=i.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+s)*this.width/(this.width-d),0)}else{let u=i.height/2,d=e.height/2;o==="start"?(u=0,d=e.height):o==="end"&&(u=i.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ae(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:i}=this.options;return i==="top"||i==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let i,r;for(i=0,r=e.length;i<r;i++)V(e[i].label)&&(e.splice(i,1),r--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const i=this.options.ticks.sampleSize;let r=this.ticks;i<r.length&&(r=Ed(r,i)),this._labelSizes=e=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,i,r){const{ctx:n,_longestTextCache:o}=this,s=[],a=[],c=Math.floor(i/Md(i,r));let l=0,u=0,d,h,f,m,p,g,v,x,z,I,k;for(d=0;d<i;d+=c){if(m=e[d].label,p=this._resolveTickFontOptions(d),n.font=g=p.string,v=o[g]=o[g]||{data:{},gc:[]},x=p.lineHeight,z=I=0,!V(m)&&!ue(m))z=ao(n,v.data,v.gc,z,m),I=x;else if(ue(m))for(h=0,f=m.length;h<f;++h)k=m[h],!V(k)&&!ue(k)&&(z=ao(n,v.data,v.gc,z,k),I+=x);s.push(z),a.push(I),l=Math.max(z,l),u=Math.max(I,u)}A0(o,i);const O=s.indexOf(l),P=a.indexOf(u),D=E=>({width:s[E]||0,height:a[E]||0});return{first:D(0),last:D(i-1),widest:D(O),highest:D(P),widths:s,heights:a}}getLabelForValue(e){return e}getPixelForValue(e,i){return NaN}getValueForPixel(e){}getPixelForTick(e){const i=this.ticks;return e<0||e>i.length-1?null:this.getPixelForValue(i[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const i=this._startPixel+e*this._length;return $S(this._alignToPixels?Mt(this.chart,i,0):i)}getDecimalForPixel(e){const i=(e-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:i}=this;return e<0&&i<0?i:e>0&&i>0?e:0}getContext(e){const i=this.ticks||[];if(e>=0&&e<i.length){const r=i[e];return r.$context||(r.$context=R0(this.getContext(),e,r))}return this.$context||(this.$context=j0(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,i=Ge(this.labelRotation),r=Math.abs(Math.cos(i)),n=Math.abs(Math.sin(i)),o=this._getLabelSizes(),s=e.autoSkipPadding||0,a=o?o.widest.width+s:0,c=o?o.highest.height+s:0;return this.isHorizontal()?c*r>a*n?a/r:c/n:c*n<a*r?c/r:a/n}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const i=this.axis,r=this.chart,n=this.options,{grid:o,position:s,border:a}=n,c=o.offset,l=this.isHorizontal(),d=this.ticks.length+(c?1:0),h=Zn(o),f=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,g=p/2,v=function(le){return Mt(r,le,p)};let x,z,I,k,O,P,D,E,F,B,q,ye;if(s==="top")x=v(this.bottom),P=this.bottom-h,E=x-g,B=v(e.top)+g,ye=e.bottom;else if(s==="bottom")x=v(this.top),B=e.top,ye=v(e.bottom)-g,P=x+g,E=this.top+h;else if(s==="left")x=v(this.right),O=this.right-h,D=x-g,F=v(e.left)+g,q=e.right;else if(s==="right")x=v(this.left),F=e.left,q=v(e.right)-g,O=x+g,D=this.left+h;else if(i==="x"){if(s==="center")x=v((e.top+e.bottom)/2+.5);else if(W(s)){const le=Object.keys(s)[0],me=s[le];x=v(this.chart.scales[le].getPixelForValue(me))}B=e.top,ye=e.bottom,P=x+g,E=P+h}else if(i==="y"){if(s==="center")x=v((e.left+e.right)/2);else if(W(s)){const le=Object.keys(s)[0],me=s[le];x=v(this.chart.scales[le].getPixelForValue(me))}O=x-g,D=O-h,F=e.left,q=e.right}const je=R(n.ticks.maxTicksLimit,d),ne=Math.max(1,Math.ceil(d/je));for(z=0;z<d;z+=ne){const le=this.getContext(z),me=o.setContext(le),qe=a.setContext(le),we=me.lineWidth,Qt=me.color,_r=qe.dash||[],en=qe.dashOffset,jn=me.tickWidth,Pt=me.tickColor,Rn=me.tickBorderDash||[],Tt=me.tickBorderDashOffset;I=C0(this,z,c),I!==void 0&&(k=Mt(r,I,we),l?O=D=F=q=k:P=E=B=ye=k,f.push({tx1:O,ty1:P,tx2:D,ty2:E,x1:F,y1:B,x2:q,y2:ye,width:we,color:Qt,borderDash:_r,borderDashOffset:en,tickWidth:jn,tickColor:Pt,tickBorderDash:Rn,tickBorderDashOffset:Tt}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(e){const i=this.axis,r=this.options,{position:n,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:u,mirror:d}=o,h=Zn(r.grid),f=h+u,m=d?-u:f,p=-Ge(this.labelRotation),g=[];let v,x,z,I,k,O,P,D,E,F,B,q,ye="middle";if(n==="top")O=this.bottom-m,P=this._getXAxisLabelAlignment();else if(n==="bottom")O=this.top+m,P=this._getXAxisLabelAlignment();else if(n==="left"){const ne=this._getYAxisLabelAlignment(h);P=ne.textAlign,k=ne.x}else if(n==="right"){const ne=this._getYAxisLabelAlignment(h);P=ne.textAlign,k=ne.x}else if(i==="x"){if(n==="center")O=(e.top+e.bottom)/2+f;else if(W(n)){const ne=Object.keys(n)[0],le=n[ne];O=this.chart.scales[ne].getPixelForValue(le)+f}P=this._getXAxisLabelAlignment()}else if(i==="y"){if(n==="center")k=(e.left+e.right)/2-f;else if(W(n)){const ne=Object.keys(n)[0],le=n[ne];k=this.chart.scales[ne].getPixelForValue(le)}P=this._getYAxisLabelAlignment(h).textAlign}i==="y"&&(c==="start"?ye="top":c==="end"&&(ye="bottom"));const je=this._getLabelSizes();for(v=0,x=a.length;v<x;++v){z=a[v],I=z.label;const ne=o.setContext(this.getContext(v));D=this.getPixelForTick(v)+o.labelOffset,E=this._resolveTickFontOptions(v),F=E.lineHeight,B=ue(I)?I.length:1;const le=B/2,me=ne.color,qe=ne.textStrokeColor,we=ne.textStrokeWidth;let Qt=P;s?(k=D,P==="inner"&&(v===x-1?Qt=this.options.reverse?"left":"right":v===0?Qt=this.options.reverse?"right":"left":Qt="center"),n==="top"?l==="near"||p!==0?q=-B*F+F/2:l==="center"?q=-je.highest.height/2-le*F+F:q=-je.highest.height+F/2:l==="near"||p!==0?q=F/2:l==="center"?q=je.highest.height/2-le*F:q=je.highest.height-B*F,d&&(q*=-1),p!==0&&!ne.showLabelBackdrop&&(k+=F/2*Math.sin(p))):(O=D,q=(1-B)*F/2);let _r;if(ne.showLabelBackdrop){const en=Oe(ne.backdropPadding),jn=je.heights[v],Pt=je.widths[v];let Rn=q-en.top,Tt=0-en.left;switch(ye){case"middle":Rn-=jn/2;break;case"bottom":Rn-=jn;break}switch(P){case"center":Tt-=Pt/2;break;case"right":Tt-=Pt;break;case"inner":v===x-1?Tt-=Pt:v>0&&(Tt-=Pt/2);break}_r={left:Tt,top:Rn,width:Pt+en.width,height:jn+en.height,color:ne.backdropColor}}g.push({label:I,font:E,textOffset:q,options:{rotation:p,color:me,strokeColor:qe,strokeWidth:we,textAlign:Qt,textBaseline:ye,translation:[k,O],backdrop:_r}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:i}=this.options;if(-Ge(this.labelRotation))return e==="top"?"left":"right";let n="center";return i.align==="start"?n="left":i.align==="end"?n="right":i.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(e){const{position:i,ticks:{crossAlign:r,mirror:n,padding:o}}=this.options,s=this._getLabelSizes(),a=e+o,c=s.widest.width;let l,u;return i==="left"?n?(u=this.right+o,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-a,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u=this.left)):i==="right"?n?(u=this.left+o,r==="near"?l="right":r==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+a,r==="near"?l="left":r==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:i},left:r,top:n,width:o,height:s}=this;i&&(e.save(),e.fillStyle=i,e.fillRect(r,n,o,s),e.restore())}getLineWidthForValue(e){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const n=this.ticks.findIndex(o=>o.value===e);return n>=0?i.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){const i=this.options.grid,r=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let o,s;const a=(c,l,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(l.x,l.y),r.stroke(),r.restore())};if(i.display)for(o=0,s=n.length;o<s;++o){const c=n[o];i.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),i.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:i,options:{border:r,grid:n}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=n.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,d,h;this.isHorizontal()?(l=Mt(e,this.left,s)-s/2,u=Mt(e,this.right,a)+a/2,d=h=c):(d=Mt(e,this.top,s)-s/2,h=Mt(e,this.bottom,a)+a/2,l=u=c),i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.beginPath(),i.moveTo(l,d),i.lineTo(u,h),i.stroke(),i.restore()}drawLabels(e){if(!this.options.ticks.display)return;const r=this.ctx,n=this._computeLabelArea();n&&zs(r,n);const o=this.getLabelItems(e);for(const s of o){const a=s.options,c=s.font,l=s.label,u=s.textOffset;Jt(r,l,0,u,c,a)}n&&Ps(r)}drawTitle(){const{ctx:e,options:{position:i,title:r,reverse:n}}=this;if(!r.display)return;const o=ve(r.font),s=Oe(r.padding),a=r.align;let c=o.lineHeight/2;i==="bottom"||i==="center"||W(i)?(c+=s.bottom,ue(r.text)&&(c+=o.lineHeight*(r.text.length-1))):c+=s.top;const{titleX:l,titleY:u,maxWidth:d,rotation:h}=U0(this,c,i,a);Jt(e,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:h,textAlign:N0(a,i,n),textBaseline:"middle",translation:[l,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,i=e.ticks&&e.ticks.z||0,r=R(e.grid&&e.grid.z,-1),n=R(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Xt.prototype.draw?[{z:i,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:i,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){const i=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",n=[];let o,s;for(o=0,s=i.length;o<s;++o){const a=i[o];a[r]===this.id&&(!e||a.type===e)&&n.push(a)}return n}_resolveTickFontOptions(e){const i=this.options.ticks.setContext(this.getContext(e));return ve(i.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Er{constructor(e,i,r){this.type=e,this.scope=i,this.override=r,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const i=Object.getPrototypeOf(e);let r;Z0(i)&&(r=this.register(i));const n=this.items,o=e.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in n||(n[o]=e,L0(e,s,r),this.override&&de.override(e.id,e.overrides)),s}get(e){return this.items[e]}unregister(e){const i=this.items,r=e.id,n=this.scope;r in i&&delete i[r],n&&r in de[n]&&(delete de[n][r],this.override&&delete qt[r])}}function L0(t,e,i){const r=si(Object.create(null),[i?de.get(i):{},de.get(e),t.defaults]);de.set(e,r),t.defaultRoutes&&F0(e,t.defaultRoutes),t.descriptors&&de.describe(e,t.descriptors)}function F0(t,e){Object.keys(e).forEach(i=>{const r=i.split("."),n=r.pop(),o=[t].concat(r).join("."),s=e[i].split("."),a=s.pop(),c=s.join(".");de.route(o,n,c,a)})}function Z0(t){return"id"in t&&"defaults"in t}class B0{constructor(){this.controllers=new Er(Ye,"datasets",!0),this.elements=new Er(Xe,"elements"),this.plugins=new Er(Object,"plugins"),this.scales=new Er(Xt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,i,r){[...i].forEach(n=>{const o=r||this._getRegistryForType(n);r||o.isForType(n)||o===this.plugins&&n.id?this._exec(e,o,n):te(n,s=>{const a=r||this._getRegistryForType(s);this._exec(e,a,s)})})}_exec(e,i,r){const n=cu(e);ae(r["before"+n],[],r),i[e](r),ae(r["after"+n],[],r)}_getRegistryForType(e){for(let i=0;i<this._typedRegistries.length;i++){const r=this._typedRegistries[i];if(r.isForType(e))return r}return this.plugins}_get(e,i,r){const n=i.get(e);if(n===void 0)throw new Error('"'+e+'" is not a registered '+r+".");return n}}var et=new B0;class H0{constructor(){this._init=void 0}notify(e,i,r,n){if(i==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const o=n?this._descriptors(e).filter(n):this._descriptors(e),s=this._notify(o,e,i,r);return i==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),s}_notify(e,i,r,n){n=n||{};for(const o of e){const s=o.plugin,a=s[r],c=[i,n,o.options];if(ae(a,c,s)===!1&&n.cancelable)return!1}return!0}invalidate(){V(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const i=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),i}_createDescriptors(e,i){const r=e&&e.config,n=R(r.options&&r.options.plugins,{}),o=V0(r);return n===!1&&!i?[]:q0(e,o,n,i)}_notifyStateChanges(e){const i=this._oldCache||[],r=this._cache,n=(o,s)=>o.filter(a=>!s.some(c=>a.plugin.id===c.plugin.id));this._notify(n(i,r),e,"stop"),this._notify(n(r,i),e,"start")}}function V0(t){const e={},i=[],r=Object.keys(et.plugins.items);for(let o=0;o<r.length;o++)i.push(et.getPlugin(r[o]));const n=t.plugins||[];for(let o=0;o<n.length;o++){const s=n[o];i.indexOf(s)===-1&&(i.push(s),e[s.id]=!0)}return{plugins:i,localIds:e}}function W0(t,e){return!e&&t===!1?null:t===!0?{}:t}function q0(t,{plugins:e,localIds:i},r,n){const o=[],s=t.getContext();for(const a of e){const c=a.id,l=W0(r[c],n);l!==null&&o.push({plugin:a,options:J0(t.config,{plugin:a,local:i[c]},l,s)})}return o}function J0(t,{plugin:e,local:i},r,n){const o=t.pluginScopeKeys(e),s=t.getOptionScopes(r,o);return i&&e.defaults&&s.push(e.defaults),t.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function oa(t,e){const i=de.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function K0(t,e){let i=t;return t==="_index_"?i=e:t==="_value_"&&(i=e==="x"?"y":"x"),i}function G0(t,e){return t===e?"_index_":"_value_"}function Ad(t){if(t==="x"||t==="y"||t==="r")return t}function Y0(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function sa(t,...e){if(Ad(t))return t;for(const i of e){const r=i.axis||Y0(i.position)||t.length>1&&Ad(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function jd(t,e,i){if(i[e+"AxisID"]===t)return{axis:e}}function X0(t,e){if(e.data&&e.data.datasets){const i=e.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(i.length)return jd(t,"x",i[0])||jd(t,"y",i[0])}return{}}function Q0(t,e){const i=qt[t.type]||{scales:{}},r=e.scales||{},n=oa(t.type,e),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!W(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const c=sa(s,a,X0(s,t),de.scales[a.type]),l=G0(c,n),u=i.scales||{};o[s]=Yn(Object.create(null),[{axis:c},a,u[c],u[l]])}),t.data.datasets.forEach(s=>{const a=s.type||t.type,c=s.indexAxis||oa(a,e),u=(qt[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=K0(d,c),f=s[h+"AxisID"]||h;o[f]=o[f]||Object.create(null),Yn(o[f],[{axis:h},r[f],u[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];Yn(a,[de.scales[a.type],de.scale])}),o}function Nv(t){const e=t.options||(t.options={});e.plugins=R(e.plugins,{}),e.scales=Q0(t,e)}function Uv(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function eI(t){return t=t||{},t.data=Uv(t.data),Nv(t),t}const Rd=new Map,Lv=new Set;function Cr(t,e){let i=Rd.get(t);return i||(i=e(),Rd.set(t,i),Lv.add(i)),i}const Bn=(t,e,i)=>{const r=kt(e,i);r!==void 0&&t.add(r)};class tI{constructor(e){this._config=eI(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Uv(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Nv(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Cr(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,i){return Cr(`${e}.transition.${i}`,()=>[[`datasets.${e}.transitions.${i}`,`transitions.${i}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,i){return Cr(`${e}-${i}`,()=>[[`datasets.${e}.elements.${i}`,`datasets.${e}`,`elements.${i}`,""]])}pluginScopeKeys(e){const i=e.id,r=this.type;return Cr(`${r}-plugin-${i}`,()=>[[`plugins.${i}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,i){const r=this._scopeCache;let n=r.get(e);return(!n||i)&&(n=new Map,r.set(e,n)),n}getOptionScopes(e,i,r){const{options:n,type:o}=this,s=this._cachedScopes(e,r),a=s.get(i);if(a)return a;const c=new Set;i.forEach(u=>{e&&(c.add(e),u.forEach(d=>Bn(c,e,d))),u.forEach(d=>Bn(c,n,d)),u.forEach(d=>Bn(c,qt[o]||{},d)),u.forEach(d=>Bn(c,de,d)),u.forEach(d=>Bn(c,na,d))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),Lv.has(i)&&s.set(i,l),l}chartOptionScopes(){const{options:e,type:i}=this;return[e,qt[i]||{},de.datasets[i]||{},{type:i},de,na]}resolveNamedOptions(e,i,r,n=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=Nd(this._resolverCache,e,n);let c=s;if(iI(s,i)){o.$shared=!1,r=St(r)?r():r;const l=this.createResolver(e,r,a);c=_n(s,r,l)}for(const l of i)o[l]=c[l];return o}createResolver(e,i,r=[""],n){const{resolver:o}=Nd(this._resolverCache,e,r);return W(i)?_n(o,i,void 0,n):o}}function Nd(t,e,i){let r=t.get(e);r||(r=new Map,t.set(e,r));const n=i.join();let o=r.get(n);return o||(o={resolver:mu(e,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},r.set(n,o)),o}const nI=t=>W(t)&&Object.getOwnPropertyNames(t).some(e=>St(t[e]));function iI(t,e){const{isScriptable:i,isIndexable:r}=bv(t);for(const n of e){const o=i(n),s=r(n),a=(s||o)&&t[n];if(o&&(St(a)||nI(a))||s&&ue(a))return!0}return!1}var rI="4.5.1";const oI=["top","bottom","left","right","chartArea"];function Ud(t,e){return t==="top"||t==="bottom"||oI.indexOf(t)===-1&&e==="x"}function Ld(t,e){return function(i,r){return i[t]===r[t]?i[e]-r[e]:i[t]-r[t]}}function Fd(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),ae(i&&i.onComplete,[t],e)}function sI(t){const e=t.chart,i=e.options.animation;ae(i&&i.onProgress,[t],e)}function Fv(t){return vu()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const qr={},Zd=t=>{const e=Fv(t);return Object.values(qr).filter(i=>i.canvas===e).pop()};function aI(t,e,i){const r=Object.keys(t);for(const n of r){const o=+n;if(o>=e){const s=t[n];delete t[n],(i>0||o>e)&&(t[o+i]=s)}}}function cI(t,e,i,r){return!i||t.type==="mouseout"?null:r?e:t}class ct{static register(...e){et.add(...e),Bd()}static unregister(...e){et.remove(...e),Bd()}constructor(e,i){const r=this.config=new tI(i),n=Fv(e),o=Zd(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||I0(n)),this.platform.updateConfig(r);const a=this.platform.acquireContext(n,s.aspectRatio),c=a&&a.canvas,l=c&&c.height,u=c&&c.width;if(this.id=lS(),this.ctx=a,this.canvas=c,this.width=u,this.height=l,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new H0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=IS(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],qr[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}ot.listen(this,"complete",Fd),ot.listen(this,"progress",sI),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:i},width:r,height:n,_aspectRatio:o}=this;return V(e)?i&&o?o:n?r/n:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return et}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dd(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return cd(this.canvas,this.ctx),this}stop(){return ot.stop(this),this}resize(e,i){ot.running(this)?this._resizeBeforeDraw={width:e,height:i}:this._resize(e,i)}_resize(e,i){const r=this.options,n=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,e,i,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,dd(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),ae(r.onResize,[this,s],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const i=this.options.scales||{};te(i,(r,n)=>{r.id=n})}buildOrUpdateScales(){const e=this.options,i=e.scales,r=this.scales,n=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];i&&(o=o.concat(Object.keys(i).map(s=>{const a=i[s],c=sa(s,a),l=c==="r",u=c==="x";return{options:a,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),te(o,s=>{const a=s.options,c=a.id,l=sa(c,a),u=R(a.type,s.dtype);(a.position===void 0||Ud(a.position,l)!==Ud(s.dposition))&&(a.position=s.dposition),n[c]=!0;let d=null;if(c in r&&r[c].type===u)d=r[c];else{const h=et.getScale(u);d=new h({id:c,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,e)}),te(n,(s,a)=>{s||delete r[a]}),te(r,s=>{Te.configure(this,s,s.options),Te.addBox(this,s)})}_updateMetasets(){const e=this._metasets,i=this.data.datasets.length,r=e.length;if(e.sort((n,o)=>n.index-o.index),r>i){for(let n=i;n<r;++n)this._destroyDatasetMeta(n);e.splice(i,r-i)}this._sortedMetasets=e.slice(0).sort(Ld("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:i}}=this;e.length>i.length&&delete this._stacks,e.forEach((r,n)=>{i.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const e=[],i=this.data.datasets;let r,n;for(this._removeUnreferencedMetasets(),r=0,n=i.length;r<n;r++){const o=i[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||oa(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const c=et.getController(a),{datasetElementType:l,dataElementType:u}=de.datasets[a];Object.assign(c,{dataElementType:et.getElement(u),datasetElementType:l&&et.getElement(l)}),s.controller=new c(this,r),e.push(s.controller)}}return this._updateMetasets(),e}_resetElements(){te(this.data.datasets,(e,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const i=this.config;i.update();const r=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:d}=this.getDatasetMeta(l),h=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(h),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),n||te(o,l=>{l.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Ld("z","_idx"));const{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){te(this.scales,e=>{Te.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,i=new Set(Object.keys(this._listeners)),r=new Set(e.events);(!Qu(i,r)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,i=this._getUniformDataChanges()||[];for(const{method:r,start:n,count:o}of i){const s=r==="_removeElements"?-o:o;aI(e,n,s)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const i=this.data.datasets.length,r=o=>new Set(e.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),n=r(0);for(let o=1;o<i;o++)if(!Qu(n,r(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Te.update(this,this.width,this.height,e);const i=this.chartArea,r=i.width<=0||i.height<=0;this._layers=[],te(this.boxes,n=>{r&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let i=0,r=this.data.datasets.length;i<r;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,r=this.data.datasets.length;i<r;++i)this._updateDataset(i,St(e)?e({datasetIndex:i}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,i){const r=this.getDatasetMeta(e),n={meta:r,index:e,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(r.controller._update(i),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ot.has(this)?this.attached&&!ot.running(this)&&ot.start(this):(this.draw(),Fd({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:r,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const i=this._layers;for(e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(this.chartArea);for(this._drawDatasets();e<i.length;++e)i[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const i=this._sortedMetasets,r=[];let n,o;for(n=0,o=i.length;n<o;++n){const s=i[n];(!e||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let i=e.length-1;i>=0;--i)this._drawDataset(e[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const i=this.ctx,r={meta:e,index:e.index,cancelable:!0},n=Tv(this,e);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&zs(i,n),e.controller.draw(),n&&Ps(i),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(e){return dt(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,i,r,n){const o=o0.modes[i];return typeof o=="function"?o(this,e,r,n):[]}getDatasetMeta(e){const i=this.data.datasets[e],r=this._metasets;let n=r.filter(o=>o&&o._dataset===i).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:e,_dataset:i,_parsed:[],_sorted:!1},r.push(n)),n}getContext(){return this.$context||(this.$context=zt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const i=this.data.datasets[e];if(!i)return!1;const r=this.getDatasetMeta(e);return typeof r.hidden=="boolean"?!r.hidden:!i.hidden}setDatasetVisibility(e,i){const r=this.getDatasetMeta(e);r.hidden=!i}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,i,r){const n=r?"show":"hide",o=this.getDatasetMeta(e),s=o.controller._resolveAnimations(void 0,n);ai(i)?(o.data[i].hidden=!r,this.update()):(this.setDatasetVisibility(e,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===e?n:void 0))}hide(e,i){this._updateVisibility(e,i,!1)}show(e,i){this._updateVisibility(e,i,!0)}_destroyDatasetMeta(e){const i=this._metasets[e];i&&i.controller&&i.controller._destroy(),delete this._metasets[e]}_stop(){let e,i;for(this.stop(),ot.remove(this),e=0,i=this.data.datasets.length;e<i;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:i}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),cd(e,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete qr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,i=this.platform,r=(o,s)=>{i.addEventListener(this,o,s),e[o]=s},n=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};te(this.options.events,o=>r(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,i=this.platform,r=(c,l)=>{i.addEventListener(this,c,l),e[c]=l},n=(c,l)=>{e[c]&&(i.removeEventListener(this,c,l),delete e[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)};let s;const a=()=>{n("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),r("attach",a)},i.isAttached(this.canvas)?a():s()}unbindEvents(){te(this._listeners,(e,i)=>{this.platform.removeEventListener(this,i,e)}),this._listeners={},te(this._responsiveListeners,(e,i)=>{this.platform.removeEventListener(this,i,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,i,r){const n=r?"set":"remove";let o,s,a,c;for(i==="dataset"&&(o=this.getDatasetMeta(e[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,c=e.length;a<c;++a){s=e[a];const l=s&&this.getDatasetMeta(s.datasetIndex).controller;l&&l[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const i=this._active||[],r=e.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!ro(r,i)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,i))}notifyPlugins(e,i,r){return this._plugins.notify(this,e,i,r)}isPluginEnabled(e){return this._plugins._cache.filter(i=>i.plugin.id===e).length===1}_updateHoverStyles(e,i,r){const n=this.options.hover,o=(c,l)=>c.filter(u=>!l.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=o(i,e),a=r?e:o(e,i);s.length&&this.updateHoverStyle(s,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(e,i){const r={event:e,replay:i,cancelable:!0,inChartArea:this.isPointInArea(e)},n=s=>(s.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",r,n)===!1)return;const o=this._handleEvent(e,i,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,n),(o||r.changed)&&this.render(),this}_handleEvent(e,i,r){const{_active:n=[],options:o}=this,s=i,a=this._getActiveElements(e,n,r,s),c=pS(e),l=cI(e,this._lastEvent,r,c);r&&(this._lastEvent=null,ae(o.onHover,[e,a,this],this),c&&ae(o.onClick,[e,a,this],this));const u=!ro(a,n);return(u||i)&&(this._active=a,this._updateHoverStyles(a,n,i)),this._lastEvent=l,u}_getActiveElements(e,i,r,n){if(e.type==="mouseout")return[];if(!r)return i;const o=this.options.hover;return this.getElementsAtEventForMode(e,o.mode,o,n)}}w(ct,"defaults",de),w(ct,"instances",qr),w(ct,"overrides",qt),w(ct,"registry",et),w(ct,"version",rI),w(ct,"getChart",Zd);function Bd(){return te(ct.instances,t=>t._plugins.invalidate())}function lI(t,e,i){const{startAngle:r,x:n,y:o,outerRadius:s,innerRadius:a,options:c}=e,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/s,Pe(r-i));if(t.beginPath(),t.arc(n,o,s-l/2,r+d/2,i-d/2),a>0){const h=Math.min(l/a,Pe(r-i));t.arc(n,o,a+l/2,i-h/2,r+h/2,!0)}else{const h=Math.min(l/2,s*Pe(r-i));if(u==="round")t.arc(n,o,h,i-Y/2,r+Y/2,!0);else if(u==="bevel"){const f=2*h*h,m=-f*Math.cos(i+Y/2)+n,p=-f*Math.sin(i+Y/2)+o,g=f*Math.cos(r+Y/2)+n,v=f*Math.sin(r+Y/2)+o;t.lineTo(m,p),t.lineTo(g,v)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function uI(t,e,i){const{startAngle:r,pixelMargin:n,x:o,y:s,outerRadius:a,innerRadius:c}=e;let l=n/a;t.beginPath(),t.arc(o,s,a,r-l,i+l),c>n?(l=n/c,t.arc(o,s,c,i+l,r-l,!0)):t.arc(o,s,n,i+pe,r-pe),t.closePath(),t.clip()}function dI(t){return fu(t,["outerStart","outerEnd","innerStart","innerEnd"])}function hI(t,e,i,r){const n=dI(t.options.borderRadius),o=(i-e)/2,s=Math.min(o,r*e/2),a=c=>{const l=(i-Math.min(o,c))*r/2;return be(c,0,Math.min(o,l))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:be(n.innerStart,0,s),innerEnd:be(n.innerEnd,0,s)}}function rn(t,e,i,r){return{x:i+t*Math.cos(e),y:r+t*Math.sin(e)}}function uo(t,e,i,r,n,o){const{x:s,y:a,startAngle:c,pixelMargin:l,innerRadius:u}=e,d=Math.max(e.outerRadius+r+i-l,0),h=u>0?u+r+i+l:0;let f=0;const m=n-c;if(r){const ne=u>0?u-r:0,le=d>0?d-r:0,me=(ne+le)/2,qe=me!==0?m*me/(me+r):m;f=(m-qe)/2}const p=Math.max(.001,m*d-i/Y)/d,g=(m-p)/2,v=c+g+f,x=n-g-f,{outerStart:z,outerEnd:I,innerStart:k,innerEnd:O}=hI(e,h,d,x-v),P=d-z,D=d-I,E=v+z/P,F=x-I/D,B=h+k,q=h+O,ye=v+k/B,je=x-O/q;if(t.beginPath(),o){const ne=(E+F)/2;if(t.arc(s,a,d,E,ne),t.arc(s,a,d,ne,F),I>0){const we=rn(D,F,s,a);t.arc(we.x,we.y,I,F,x+pe)}const le=rn(q,x,s,a);if(t.lineTo(le.x,le.y),O>0){const we=rn(q,je,s,a);t.arc(we.x,we.y,O,x+pe,je+Math.PI)}const me=(x-O/h+(v+k/h))/2;if(t.arc(s,a,h,x-O/h,me,!0),t.arc(s,a,h,me,v+k/h,!0),k>0){const we=rn(B,ye,s,a);t.arc(we.x,we.y,k,ye+Math.PI,v-pe)}const qe=rn(P,v,s,a);if(t.lineTo(qe.x,qe.y),z>0){const we=rn(P,E,s,a);t.arc(we.x,we.y,z,v-pe,E)}}else{t.moveTo(s,a);const ne=Math.cos(E)*d+s,le=Math.sin(E)*d+a;t.lineTo(ne,le);const me=Math.cos(F)*d+s,qe=Math.sin(F)*d+a;t.lineTo(me,qe)}t.closePath()}function fI(t,e,i,r,n){const{fullCircles:o,startAngle:s,circumference:a}=e;let c=e.endAngle;if(o){uo(t,e,i,r,c,n);for(let l=0;l<o;++l)t.fill();isNaN(a)||(c=s+(a%ce||ce))}return uo(t,e,i,r,c,n),t.fill(),c}function mI(t,e,i,r,n){const{fullCircles:o,startAngle:s,circumference:a,options:c}=e,{borderWidth:l,borderJoinStyle:u,borderDash:d,borderDashOffset:h,borderRadius:f}=c,m=c.borderAlign==="inner";if(!l)return;t.setLineDash(d||[]),t.lineDashOffset=h,m?(t.lineWidth=l*2,t.lineJoin=u||"round"):(t.lineWidth=l,t.lineJoin=u||"bevel");let p=e.endAngle;if(o){uo(t,e,i,r,p,n);for(let g=0;g<o;++g)t.stroke();isNaN(a)||(p=s+(a%ce||ce))}m&&uI(t,e,p),c.selfJoin&&p-s>=Y&&f===0&&u!=="miter"&&lI(t,e,p),o||(uo(t,e,i,r,p,n),t.stroke())}class Jn extends Xe{constructor(i){super();w(this,"circumference");w(this,"endAngle");w(this,"fullCircles");w(this,"innerRadius");w(this,"outerRadius");w(this,"pixelMargin");w(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i)}inRange(i,r,n){const o=this.getProps(["x","y"],n),{angle:s,distance:a}=cv(o,{x:i,y:r}),{startAngle:c,endAngle:l,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,m=R(h,l-c),p=ci(s,c,l)&&c!==l,g=m>=ce||p,v=lt(a,u+f,d+f);return g&&v}getCenterPoint(i){const{x:r,y:n,startAngle:o,endAngle:s,innerRadius:a,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:l,spacing:u}=this.options,d=(o+s)/2,h=(a+c+u+l)/2;return{x:r+Math.cos(d)*h,y:n+Math.sin(d)*h}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){const{options:r,circumference:n}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=n>ce?Math.floor(n/ce):0,n===0||this.innerRadius<0||this.outerRadius<0)return;i.save();const c=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(c)*o,Math.sin(c)*o);const l=1-Math.sin(Math.min(Y,n||0)),u=o*l;i.fillStyle=r.backgroundColor,i.strokeStyle=r.borderColor,fI(i,this,u,s,a),mI(i,this,u,s,a),i.restore()}}w(Jn,"id","arc"),w(Jn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),w(Jn,"defaultRoutes",{backgroundColor:"backgroundColor"}),w(Jn,"descriptors",{_scriptable:!0,_indexable:i=>i!=="borderDash"});function Zv(t,e,i=e){t.lineCap=R(i.borderCapStyle,e.borderCapStyle),t.setLineDash(R(i.borderDash,e.borderDash)),t.lineDashOffset=R(i.borderDashOffset,e.borderDashOffset),t.lineJoin=R(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=R(i.borderWidth,e.borderWidth),t.strokeStyle=R(i.borderColor,e.borderColor)}function pI(t,e,i){t.lineTo(i.x,i.y)}function gI(t){return t.stepped?NS:t.tension||t.cubicInterpolationMode==="monotone"?US:pI}function Bv(t,e,i={}){const r=t.length,{start:n=0,end:o=r-1}=i,{start:s,end:a}=e,c=Math.max(n,s),l=Math.min(o,a),u=n<s&&o<s||n>a&&o>a;return{count:r,start:c,loop:e.loop,ilen:l<c&&!u?r+l-c:l-c}}function vI(t,e,i,r){const{points:n,options:o}=e,{count:s,start:a,loop:c,ilen:l}=Bv(n,i,r),u=gI(o);let{move:d=!0,reverse:h}=r||{},f,m,p;for(f=0;f<=l;++f)m=n[(a+(h?l-f:f))%s],!m.skip&&(d?(t.moveTo(m.x,m.y),d=!1):u(t,p,m,h,o.stepped),p=m);return c&&(m=n[(a+(h?l:0))%s],u(t,p,m,h,o.stepped)),!!c}function bI(t,e,i,r){const n=e.points,{count:o,start:s,ilen:a}=Bv(n,i,r),{move:c=!0,reverse:l}=r||{};let u=0,d=0,h,f,m,p,g,v;const x=I=>(s+(l?a-I:I))%o,z=()=>{p!==g&&(t.lineTo(u,g),t.lineTo(u,p),t.lineTo(u,v))};for(c&&(f=n[x(0)],t.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=n[x(h)],f.skip)continue;const I=f.x,k=f.y,O=I|0;O===m?(k<p?p=k:k>g&&(g=k),u=(d*u+I)/++d):(z(),t.lineTo(I,k),m=O,d=0,p=g=k),v=k}z()}function aa(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!i?bI:vI}function _I(t){return t.stepped?vw:t.tension||t.cubicInterpolationMode==="monotone"?bw:Rt}function yI(t,e,i,r){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,r)&&n.closePath()),Zv(t,e.options),t.stroke(n)}function xI(t,e,i,r){const{segments:n,options:o}=e,s=aa(e);for(const a of n)Zv(t,o,a.style),t.beginPath(),s(t,e,a,{start:i,end:i+r-1})&&t.closePath(),t.stroke()}const $I=typeof Path2D=="function";function kI(t,e,i,r){$I&&!e.options.segment?yI(t,e,i,r):xI(t,e,i,r)}class _t extends Xe{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,i){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const n=r.spanGaps?this._loop:this._fullLoop;lw(this._points,r,e,n,i),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Sw(this,this.options.segment))}first(){const e=this.segments,i=this.points;return e.length&&i[e[0].start]}last(){const e=this.segments,i=this.points,r=e.length;return r&&i[e[r-1].end]}interpolate(e,i){const r=this.options,n=e[i],o=this.points,s=Pv(this,{property:i,start:n,end:n});if(!s.length)return;const a=[],c=_I(r);let l,u;for(l=0,u=s.length;l<u;++l){const{start:d,end:h}=s[l],f=o[d],m=o[h];if(f===m){a.push(f);continue}const p=Math.abs((n-f[i])/(m[i]-f[i])),g=c(f,m,p,r.stepped);g[i]=e[i],a.push(g)}return a.length===1?a[0]:a}pathSegment(e,i,r){return aa(this)(e,this,i,r)}path(e,i,r){const n=this.segments,o=aa(this);let s=this._loop;i=i||0,r=r||this.points.length-i;for(const a of n)s&=o(e,this,a,{start:i,end:i+r-1});return!!s}draw(e,i,r,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(e.save(),kI(e,this,r,n),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}w(_t,"id","line"),w(_t,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),w(_t,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),w(_t,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Hd(t,e,i,r){const n=t.options,{[i]:o}=t.getProps([i],r);return Math.abs(e-o)<n.radius+n.hitRadius}class Jr extends Xe{constructor(i){super();w(this,"parsed");w(this,"skip");w(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,i&&Object.assign(this,i)}inRange(i,r,n){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],n);return Math.pow(i-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(i,r){return Hd(this,i,"x",r)}inYRange(i,r){return Hd(this,i,"y",r)}getCenterPoint(i){const{x:r,y:n}=this.getProps(["x","y"],i);return{x:r,y:n}}size(i){i=i||this.options||{};let r=i.radius||0;r=Math.max(r,r&&i.hoverRadius||0);const n=r&&i.borderWidth||0;return(r+n)*2}draw(i,r){const n=this.options;this.skip||n.radius<.1||!dt(this,r,this.size(n)/2)||(i.strokeStyle=n.borderColor,i.lineWidth=n.borderWidth,i.fillStyle=n.backgroundColor,ia(i,n,this.x,this.y))}getRange(){const i=this.options||{};return i.radius+i.hitRadius}}w(Jr,"id","point"),w(Jr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),w(Jr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hv(t,e){const{x:i,y:r,base:n,width:o,height:s}=t.getProps(["x","y","base","width","height"],e);let a,c,l,u,d;return t.horizontal?(d=s/2,a=Math.min(i,n),c=Math.max(i,n),l=r-d,u=r+d):(d=o/2,a=i-d,c=i+d,l=Math.min(r,n),u=Math.max(r,n)),{left:a,top:l,right:c,bottom:u}}function yt(t,e,i,r){return t?0:be(e,i,r)}function SI(t,e,i){const r=t.options.borderWidth,n=t.borderSkipped,o=vv(r);return{t:yt(n.top,o.top,0,i),r:yt(n.right,o.right,0,e),b:yt(n.bottom,o.bottom,0,i),l:yt(n.left,o.left,0,e)}}function wI(t,e,i){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,o=Ft(n),s=Math.min(e,i),a=t.borderSkipped,c=r||W(n);return{topLeft:yt(!c||a.top||a.left,o.topLeft,0,s),topRight:yt(!c||a.top||a.right,o.topRight,0,s),bottomLeft:yt(!c||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:yt(!c||a.bottom||a.right,o.bottomRight,0,s)}}function II(t){const e=Hv(t),i=e.right-e.left,r=e.bottom-e.top,n=SI(t,i/2,r/2),o=wI(t,i/2,r/2);return{outer:{x:e.left,y:e.top,w:i,h:r,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:r-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function Bs(t,e,i,r){const n=e===null,o=i===null,a=t&&!(n&&o)&&Hv(t,r);return a&&(n||lt(e,a.left,a.right))&&(o||lt(i,a.top,a.bottom))}function zI(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function PI(t,e){t.rect(e.x,e.y,e.w,e.h)}function Hs(t,e,i={}){const r=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,o=(t.x+t.w!==i.x+i.w?e:0)-r,s=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+r,y:t.y+n,w:t.w+o,h:t.h+s,radius:t.radius}}class Kr extends Xe{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:i,options:{borderColor:r,backgroundColor:n}}=this,{inner:o,outer:s}=II(this),a=zI(s.radius)?li:PI;e.save(),(s.w!==o.w||s.h!==o.h)&&(e.beginPath(),a(e,Hs(s,i,o)),e.clip(),a(e,Hs(o,-i,s)),e.fillStyle=r,e.fill("evenodd")),e.beginPath(),a(e,Hs(o,i)),e.fillStyle=n,e.fill(),e.restore()}inRange(e,i,r){return Bs(this,e,i,r)}inXRange(e,i){return Bs(this,e,null,i)}inYRange(e,i){return Bs(this,null,e,i)}getCenterPoint(e){const{x:i,y:r,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(i+n)/2:i,y:o?r:(r+n)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}w(Kr,"id","bar"),w(Kr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),w(Kr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var TI=Object.freeze({__proto__:null,ArcElement:Jn,BarElement:Kr,LineElement:_t,PointElement:Jr});const ca=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Vd=ca.map(t=>t.replace("rgb(","rgba(").replace(")",", 0.5)"));function Vv(t){return ca[t%ca.length]}function Wv(t){return Vd[t%Vd.length]}function OI(t,e){return t.borderColor=Vv(e),t.backgroundColor=Wv(e),++e}function DI(t,e){return t.backgroundColor=t.data.map(()=>Vv(e++)),e}function MI(t,e){return t.backgroundColor=t.data.map(()=>Wv(e++)),e}function EI(t){let e=0;return(i,r)=>{const n=t.getDatasetMeta(r).controller;n instanceof Ut?e=DI(i,e):n instanceof ti?e=MI(i,e):n&&(e=OI(i,e))}}function Wd(t){let e;for(e in t)if(t[e].borderColor||t[e].backgroundColor)return!0;return!1}function CI(t){return t&&(t.borderColor||t.backgroundColor)}function AI(){return de.borderColor!=="rgba(0,0,0,0.1)"||de.backgroundColor!=="rgba(0,0,0,0.1)"}var jI={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(t,e,i){if(!i.enabled)return;const{data:{datasets:r},options:n}=t.config,{elements:o}=n,s=Wd(r)||CI(n)||o&&Wd(o)||AI();if(!i.forceOverride&&s)return;const a=EI(t);r.forEach(a)}};function RI(t,e,i,r,n){const o=n.samples||r;if(o>=i)return t.slice(e,e+i);const s=[],a=(i-2)/(o-2);let c=0;const l=e+i-1;let u=e,d,h,f,m,p;for(s[c++]=t[u],d=0;d<o-2;d++){let g=0,v=0,x;const z=Math.floor((d+1)*a)+1+e,I=Math.min(Math.floor((d+2)*a)+1,i)+e,k=I-z;for(x=z;x<I;x++)g+=t[x].x,v+=t[x].y;g/=k,v/=k;const O=Math.floor(d*a)+1+e,P=Math.min(Math.floor((d+1)*a)+1,i)+e,{x:D,y:E}=t[u];for(f=m=-1,x=O;x<P;x++)m=.5*Math.abs((D-g)*(t[x].y-E)-(D-t[x].x)*(v-E)),m>f&&(f=m,h=t[x],p=x);s[c++]=h,u=p}return s[c++]=t[l],s}function NI(t,e,i,r){let n=0,o=0,s,a,c,l,u,d,h,f,m,p;const g=[],v=e+i-1,x=t[e].x,I=t[v].x-x;for(s=e;s<e+i;++s){a=t[s],c=(a.x-x)/I*r,l=a.y;const k=c|0;if(k===u)l<m?(m=l,d=s):l>p&&(p=l,h=s),n=(o*n+a.x)/++o;else{const O=s-1;if(!V(d)&&!V(h)){const P=Math.min(d,h),D=Math.max(d,h);P!==f&&P!==O&&g.push({...t[P],x:n}),D!==f&&D!==O&&g.push({...t[D],x:n})}s>0&&O!==f&&g.push(t[O]),g.push(a),u=k,o=0,m=p=l,d=h=f=s}}return g}function qv(t){if(t._decimated){const e=t._data;delete t._decimated,delete t._data,Object.defineProperty(t,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function qd(t){t.data.datasets.forEach(e=>{qv(e)})}function UI(t,e){const i=e.length;let r=0,n;const{iScale:o}=t,{min:s,max:a,minDefined:c,maxDefined:l}=o.getUserBounds();return c&&(r=be(ut(e,o.axis,s).lo,0,i-1)),l?n=be(ut(e,o.axis,a).hi+1,r,i)-r:n=i-r,{start:r,count:n}}var LI={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled){qd(t);return}const r=t.width;t.data.datasets.forEach((n,o)=>{const{_data:s,indexAxis:a}=n,c=t.getDatasetMeta(o),l=s||n.data;if(Wn([a,t.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=t.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||t.options.parsing)return;let{start:d,count:h}=UI(c,l);const f=i.threshold||4*r;if(h<=f){qv(n);return}V(s)&&(n._data=l,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let m;switch(i.algorithm){case"lttb":m=RI(l,d,h,r,i);break;case"min-max":m=NI(l,d,h,r);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}n._decimated=m})},destroy(t){qd(t)}};function FI(t,e,i){const r=t.segments,n=t.points,o=e.points,s=[];for(const a of r){let{start:c,end:l}=a;l=Ds(c,l,n);const u=la(i,n[c],n[l],a.loop);if(!e.segments){s.push({source:a,target:u,start:n[c],end:n[l]});continue}const d=Pv(e,u);for(const h of d){const f=la(i,o[h.start],o[h.end],h.loop),m=zv(a,n,f);for(const p of m)s.push({source:p,target:h,start:{[i]:Jd(u,f,"start",Math.max)},end:{[i]:Jd(u,f,"end",Math.min)}})}}return s}function la(t,e,i,r){if(r)return;let n=e[t],o=i[t];return t==="angle"&&(n=Pe(n),o=Pe(o)),{property:t,start:n,end:o}}function ZI(t,e){const{x:i=null,y:r=null}=t||{},n=e.points,o=[];return e.segments.forEach(({start:s,end:a})=>{a=Ds(s,a,n);const c=n[s],l=n[a];r!==null?(o.push({x:c.x,y:r}),o.push({x:l.x,y:r})):i!==null&&(o.push({x:i,y:c.y}),o.push({x:i,y:l.y}))}),o}function Ds(t,e,i){for(;e>t;e--){const r=i[e];if(!isNaN(r.x)&&!isNaN(r.y))break}return e}function Jd(t,e,i,r){return t&&e?r(t[i],e[i]):t?t[i]:e?e[i]:0}function Jv(t,e){let i=[],r=!1;return ue(t)?(r=!0,i=t):i=ZI(t,e),i.length?new _t({points:i,options:{tension:0},_loop:r,_fullLoop:r}):null}function Kd(t){return t&&t.fill!==!1}function BI(t,e,i){let n=t[e].fill;const o=[e];let s;if(!i)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!fe(n))return n;if(s=t[n],!s)return!1;if(s.visible)return n;o.push(n),n=s.fill}return!1}function HI(t,e,i){const r=JI(t);if(W(r))return isNaN(r.value)?!1:r;let n=parseFloat(r);return fe(n)&&Math.floor(n)===n?VI(r[0],e,n,i):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function VI(t,e,i,r){return(t==="-"||t==="+")&&(i=e+i),i===e||i<0||i>=r?!1:i}function WI(t,e){let i=null;return t==="start"?i=e.bottom:t==="end"?i=e.top:W(t)?i=e.getPixelForValue(t.value):e.getBasePixel&&(i=e.getBasePixel()),i}function qI(t,e,i){let r;return t==="start"?r=i:t==="end"?r=e.options.reverse?e.min:e.max:W(t)?r=t.value:r=e.getBaseValue(),r}function JI(t){const e=t.options,i=e.fill;let r=R(i&&i.target,i);return r===void 0&&(r=!!e.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function KI(t){const{scale:e,index:i,line:r}=t,n=[],o=r.segments,s=r.points,a=GI(e,i);a.push(Jv({x:null,y:e.bottom},r));for(let c=0;c<o.length;c++){const l=o[c];for(let u=l.start;u<=l.end;u++)YI(n,s[u],a)}return new _t({points:n,options:{}})}function GI(t,e){const i=[],r=t.getMatchingVisibleMetas("line");for(let n=0;n<r.length;n++){const o=r[n];if(o.index===e)break;o.hidden||i.unshift(o.dataset)}return i}function YI(t,e,i){const r=[];for(let n=0;n<i.length;n++){const o=i[n],{first:s,last:a,point:c}=XI(o,e,"x");if(!(!c||s&&a)){if(s)r.unshift(c);else if(t.push(c),!a)break}}t.push(...r)}function XI(t,e,i){const r=t.interpolate(e,i);if(!r)return{};const n=r[i],o=t.segments,s=t.points;let a=!1,c=!1;for(let l=0;l<o.length;l++){const u=o[l],d=s[u.start][i],h=s[u.end][i];if(lt(n,d,h)){a=n===d,c=n===h;break}}return{first:a,last:c,point:r}}class Kv{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,i,r){const{x:n,y:o,radius:s}=this;return i=i||{start:0,end:ce},e.arc(n,o,s,i.end,i.start,!0),!r.bounds}interpolate(e){const{x:i,y:r,radius:n}=this,o=e.angle;return{x:i+Math.cos(o)*n,y:r+Math.sin(o)*n,angle:o}}}function QI(t){const{chart:e,fill:i,line:r}=t;if(fe(i))return ez(e,i);if(i==="stack")return KI(t);if(i==="shape")return!0;const n=tz(t);return n instanceof Kv?n:Jv(n,r)}function ez(t,e){const i=t.getDatasetMeta(e);return i&&t.isDatasetVisible(e)?i.dataset:null}function tz(t){return(t.scale||{}).getPointPositionForValue?iz(t):nz(t)}function nz(t){const{scale:e={},fill:i}=t,r=WI(i,e);if(fe(r)){const n=e.isHorizontal();return{x:n?r:null,y:n?null:r}}return null}function iz(t){const{scale:e,fill:i}=t,r=e.options,n=e.getLabels().length,o=r.reverse?e.max:e.min,s=qI(i,e,o),a=[];if(r.grid.circular){const c=e.getPointPositionForValue(0,o);return new Kv({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(s)})}for(let c=0;c<n;++c)a.push(e.getPointPositionForValue(c,s));return a}function Vs(t,e,i){const r=QI(e),{chart:n,index:o,line:s,scale:a,axis:c}=e,l=s.options,u=l.fill,d=l.backgroundColor,{above:h=d,below:f=d}=u||{},m=n.getDatasetMeta(o),p=Tv(n,m);r&&s.points.length&&(zs(t,i),rz(t,{line:s,target:r,above:h,below:f,area:i,scale:a,axis:c,clip:p}),Ps(t))}function rz(t,e){const{line:i,target:r,above:n,below:o,area:s,scale:a,clip:c}=e,l=i._loop?"angle":e.axis;t.save();let u=o;o!==n&&(l==="x"?(Gd(t,r,s.top),Ws(t,{line:i,target:r,color:n,scale:a,property:l,clip:c}),t.restore(),t.save(),Gd(t,r,s.bottom)):l==="y"&&(Yd(t,r,s.left),Ws(t,{line:i,target:r,color:o,scale:a,property:l,clip:c}),t.restore(),t.save(),Yd(t,r,s.right),u=n)),Ws(t,{line:i,target:r,color:u,scale:a,property:l,clip:c}),t.restore()}function Gd(t,e,i){const{segments:r,points:n}=e;let o=!0,s=!1;t.beginPath();for(const a of r){const{start:c,end:l}=a,u=n[c],d=n[Ds(c,l,n)];o?(t.moveTo(u.x,u.y),o=!1):(t.lineTo(u.x,i),t.lineTo(u.x,u.y)),s=!!e.pathSegment(t,a,{move:s}),s?t.closePath():t.lineTo(d.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function Yd(t,e,i){const{segments:r,points:n}=e;let o=!0,s=!1;t.beginPath();for(const a of r){const{start:c,end:l}=a,u=n[c],d=n[Ds(c,l,n)];o?(t.moveTo(u.x,u.y),o=!1):(t.lineTo(i,u.y),t.lineTo(u.x,u.y)),s=!!e.pathSegment(t,a,{move:s}),s?t.closePath():t.lineTo(i,d.y)}t.lineTo(i,e.first().y),t.closePath(),t.clip()}function Ws(t,e){const{line:i,target:r,property:n,color:o,scale:s,clip:a}=e,c=FI(i,r,n);for(const{source:l,target:u,start:d,end:h}of c){const{style:{backgroundColor:f=o}={}}=l,m=r!==!0;t.save(),t.fillStyle=f,oz(t,s,a,m&&la(n,d,h)),t.beginPath();const p=!!i.pathSegment(t,l);let g;if(m){p?t.closePath():Xd(t,r,h,n);const v=!!r.pathSegment(t,u,{move:p,reverse:!0});g=p&&v,g||Xd(t,r,d,n)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function oz(t,e,i,r){const n=e.chart.chartArea,{property:o,start:s,end:a}=r||{};if(o==="x"||o==="y"){let c,l,u,d;o==="x"?(c=s,l=n.top,u=a,d=n.bottom):(c=n.left,l=s,u=n.right,d=a),t.beginPath(),i&&(c=Math.max(c,i.left),u=Math.min(u,i.right),l=Math.max(l,i.top),d=Math.min(d,i.bottom)),t.rect(c,l,u-c,d-l),t.clip()}}function Xd(t,e,i,r){const n=e.interpolate(i,r);n&&t.lineTo(n.x,n.y)}var sz={id:"filler",afterDatasetsUpdate(t,e,i){const r=(t.data.datasets||[]).length,n=[];let o,s,a,c;for(s=0;s<r;++s)o=t.getDatasetMeta(s),a=o.dataset,c=null,a&&a.options&&a instanceof _t&&(c={visible:t.isDatasetVisible(s),index:s,fill:HI(a,s,r),chart:t,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=c,n.push(c);for(s=0;s<r;++s)c=n[s],!(!c||c.fill===!1)&&(c.fill=BI(n,s,i.propagate))},beforeDraw(t,e,i){const r=i.drawTime==="beforeDraw",n=t.getSortedVisibleDatasetMetas(),o=t.chartArea;for(let s=n.length-1;s>=0;--s){const a=n[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Vs(t.ctx,a,o))}},beforeDatasetsDraw(t,e,i){if(i.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let n=r.length-1;n>=0;--n){const o=r[n].$filler;Kd(o)&&Vs(t.ctx,o,t.chartArea)}},beforeDatasetDraw(t,e,i){const r=e.meta.$filler;!Kd(r)||i.drawTime!=="beforeDatasetDraw"||Vs(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Qd=(t,e)=>{let{boxHeight:i=e,boxWidth:r=e}=t;return t.usePointStyle&&(i=Math.min(i,e),r=t.pointStyleWidth||Math.min(r,e)),{boxWidth:r,boxHeight:i,itemHeight:Math.max(e,i)}},az=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class eh extends Xe{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,i,r){this.maxWidth=e,this.maxHeight=i,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const e=this.options.labels||{};let i=ae(e.generateLabels,[this.chart],this)||[];e.filter&&(i=i.filter(r=>e.filter(r,this.chart.data))),e.sort&&(i=i.sort((r,n)=>e.sort(r,n,this.chart.data))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:e,ctx:i}=this;if(!e.display){this.width=this.height=0;return}const r=e.labels,n=ve(r.font),o=n.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:c}=Qd(r,o);let l,u;i.font=n.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(s,o,a,c)+10):(u=this.maxHeight,l=this._fitCols(s,n,a,c)+10),this.width=Math.min(l,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,i,r,n){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=n+a;let d=e;o.textAlign="left",o.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((m,p)=>{const g=r+i/2+o.measureText(m.text).width;(p===0||l[l.length-1]+g+2*a>s)&&(d+=u,l[l.length-(p>0?0:1)]=0,f+=u,h++),c[p]={left:0,top:f,row:h,width:g,height:n},l[l.length-1]+=g+a}),d}_fitCols(e,i,r,n){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=s-e;let d=a,h=0,f=0,m=0,p=0;return this.legendItems.forEach((g,v)=>{const{itemWidth:x,itemHeight:z}=cz(r,i,o,g,n);v>0&&f+z+2*a>u&&(d+=h+a,l.push({width:h,height:f}),m+=h+a,p++,h=f=0),c[v]={left:m,top:f,col:p,width:x,height:z},h=Math.max(h,x),f+=z+a}),d+=h,l.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:r,labels:{padding:n},rtl:o}}=this,s=on(o,this.left,this.width);if(this.isHorizontal()){let a=0,c=ze(r,this.left+n,this.right-this.lineWidths[a]);for(const l of i)a!==l.row&&(a=l.row,c=ze(r,this.left+n,this.right-this.lineWidths[a])),l.top+=this.top+e+n,l.left=s.leftForLtr(s.x(c),l.width),c+=l.width+n}else{let a=0,c=ze(r,this.top+e+n,this.bottom-this.columnSizes[a].height);for(const l of i)l.col!==a&&(a=l.col,c=ze(r,this.top+e+n,this.bottom-this.columnSizes[a].height)),l.top=c,l.left+=this.left+n,l.left=s.leftForLtr(s.x(l.left),l.width),c+=l.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;zs(e,this),this._draw(),Ps(e)}}_draw(){const{options:e,columnSizes:i,lineWidths:r,ctx:n}=this,{align:o,labels:s}=e,a=de.color,c=on(e.rtl,this.left,this.width),l=ve(s.font),{padding:u}=s,d=l.size,h=d/2;let f;this.drawTitle(),n.textAlign=c.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:m,boxHeight:p,itemHeight:g}=Qd(s,d),v=function(O,P,D){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;n.save();const E=R(D.lineWidth,1);if(n.fillStyle=R(D.fillStyle,a),n.lineCap=R(D.lineCap,"butt"),n.lineDashOffset=R(D.lineDashOffset,0),n.lineJoin=R(D.lineJoin,"miter"),n.lineWidth=E,n.strokeStyle=R(D.strokeStyle,a),n.setLineDash(R(D.lineDash,[])),s.usePointStyle){const F={radius:p*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:E},B=c.xPlus(O,m/2),q=P+h;gv(n,F,B,q,s.pointStyleWidth&&m)}else{const F=P+Math.max((d-p)/2,0),B=c.leftForLtr(O,m),q=Ft(D.borderRadius);n.beginPath(),Object.values(q).some(ye=>ye!==0)?li(n,{x:B,y:F,w:m,h:p,radius:q}):n.rect(B,F,m,p),n.fill(),E!==0&&n.stroke()}n.restore()},x=function(O,P,D){Jt(n,D.text,O,P+g/2,l,{strikethrough:D.hidden,textAlign:c.textAlign(D.textAlign)})},z=this.isHorizontal(),I=this._computeTitleHeight();z?f={x:ze(o,this.left+u,this.right-r[0]),y:this.top+u+I,line:0}:f={x:this.left+u,y:ze(o,this.top+I+u,this.bottom-i[0].height),line:0},Sv(this.ctx,e.textDirection);const k=g+u;this.legendItems.forEach((O,P)=>{n.strokeStyle=O.fontColor,n.fillStyle=O.fontColor;const D=n.measureText(O.text).width,E=c.textAlign(O.textAlign||(O.textAlign=s.textAlign)),F=m+h+D;let B=f.x,q=f.y;c.setWidth(this.width),z?P>0&&B+F+u>this.right&&(q=f.y+=k,f.line++,B=f.x=ze(o,this.left+u,this.right-r[f.line])):P>0&&q+k>this.bottom&&(B=f.x=B+i[f.line].width+u,f.line++,q=f.y=ze(o,this.top+I+u,this.bottom-i[f.line].height));const ye=c.x(B);if(v(ye,q,O),B=zS(E,B+m+h,z?B+F:this.right,e.rtl),x(c.x(B),q,O),z)f.x+=F+u;else if(typeof O.text!="string"){const je=l.lineHeight;f.y+=Gv(O,je)+u}else f.y+=k}),wv(this.ctx,e.textDirection)}drawTitle(){const e=this.options,i=e.title,r=ve(i.font),n=Oe(i.padding);if(!i.display)return;const o=on(e.rtl,this.left,this.width),s=this.ctx,a=i.position,c=r.size/2,l=n.top+c;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+l,d=ze(e.align,d,this.right-h);else{const m=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);u=l+ze(e.align,this.top,this.bottom-m-e.labels.padding-this._computeTitleHeight())}const f=ze(a,d,d+h);s.textAlign=o.textAlign(du(a)),s.textBaseline="middle",s.strokeStyle=i.color,s.fillStyle=i.color,s.font=r.string,Jt(s,i.text,f,u,r)}_computeTitleHeight(){const e=this.options.title,i=ve(e.font),r=Oe(e.padding);return e.display?i.lineHeight+r.height:0}_getLegendItemAt(e,i){let r,n,o;if(lt(e,this.left,this.right)&<(i,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(n=o[r],lt(e,n.left,n.left+n.width)&<(i,n.top,n.top+n.height))return this.legendItems[r]}return null}handleEvent(e){const i=this.options;if(!dz(e.type,i))return;const r=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const n=this._hoveredItem,o=az(n,r);n&&!o&&ae(i.onLeave,[e,n,this],this),this._hoveredItem=r,r&&!o&&ae(i.onHover,[e,r,this],this)}else r&&ae(i.onClick,[e,r,this],this)}}function cz(t,e,i,r,n){const o=lz(r,t,e,i),s=uz(n,r,e.lineHeight);return{itemWidth:o,itemHeight:s}}function lz(t,e,i,r){let n=t.text;return n&&typeof n!="string"&&(n=n.reduce((o,s)=>o.length>s.length?o:s)),e+i.size/2+r.measureText(n).width}function uz(t,e,i){let r=t;return typeof e.text!="string"&&(r=Gv(e,i)),r}function Gv(t,e){const i=t.text?t.text.length:0;return e*i}function dz(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var hz={id:"legend",_element:eh,start(t,e,i){const r=t.legend=new eh({ctx:t.ctx,options:i,chart:t});Te.configure(t,r,i),Te.addBox(t,r)},stop(t){Te.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,i){const r=t.legend;Te.configure(t,r,i),r.options=i},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,i){const r=e.datasetIndex,n=i.chart;n.isDatasetVisible(r)?(n.hide(r),e.hidden=!0):(n.show(r),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:r,textAlign:n,color:o,useBorderRadius:s,borderRadius:a}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(i?0:void 0),u=Oe(l.borderWidth);return{text:e[c.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:r||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:s&&(a||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class yu extends Xe{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,i){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=i;const n=ue(r.text)?r.text.length:1;this._padding=Oe(r.padding);const o=n*ve(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:i,left:r,bottom:n,right:o,options:s}=this,a=s.align;let c=0,l,u,d;return this.isHorizontal()?(u=ze(a,r,o),d=i+e,l=o-r):(s.position==="left"?(u=r+e,d=ze(a,n,i),c=Y*-.5):(u=o-e,d=ze(a,i,n),c=Y*.5),l=n-i),{titleX:u,titleY:d,maxWidth:l,rotation:c}}draw(){const e=this.ctx,i=this.options;if(!i.display)return;const r=ve(i.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:c,rotation:l}=this._drawArgs(o);Jt(e,i.text,0,0,r,{color:i.color,maxWidth:c,rotation:l,textAlign:du(i.align),textBaseline:"middle",translation:[s,a]})}}function fz(t,e){const i=new yu({ctx:t.ctx,options:e,chart:t});Te.configure(t,i,e),Te.addBox(t,i),t.titleBlock=i}var mz={id:"title",_element:yu,start(t,e,i){fz(t,i)},stop(t){const e=t.titleBlock;Te.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const r=t.titleBlock;Te.configure(t,r,i),r.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ar=new WeakMap;var pz={id:"subtitle",start(t,e,i){const r=new yu({ctx:t.ctx,options:i,chart:t});Te.configure(t,r,i),Te.addBox(t,r),Ar.set(t,r)},stop(t){Te.removeBox(t,Ar.get(t)),Ar.delete(t)},beforeUpdate(t,e,i){const r=Ar.get(t);Te.configure(t,r,i),r.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Kn={average(t){if(!t.length)return!1;let e,i,r=new Set,n=0,o=0;for(e=0,i=t.length;e<i;++e){const a=t[e].element;if(a&&a.hasValue()){const c=a.tooltipPosition();r.add(c.x),n+=c.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,c)=>a+c)/r.size,y:n/o}},nearest(t,e){if(!t.length)return!1;let i=e.x,r=e.y,n=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=t.length;o<s;++o){const c=t[o].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=ta(e,l);u<n&&(n=u,a=c)}}if(a){const c=a.tooltipPosition();i=c.x,r=c.y}return{x:i,y:r}}};function Qe(t,e){return e&&(ue(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function st(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
101
|
+
`)>-1?t.split(`
|
|
102
|
+
`):t}function gz(t,e){const{element:i,datasetIndex:r,index:n}=e,o=t.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(n);return{chart:t,label:s,parsed:o.getParsed(n),raw:t.data.datasets[r].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:r,element:i}}function th(t,e){const i=t.chart.ctx,{body:r,footer:n,title:o}=t,{boxWidth:s,boxHeight:a}=e,c=ve(e.bodyFont),l=ve(e.titleFont),u=ve(e.footerFont),d=o.length,h=n.length,f=r.length,m=Oe(e.padding);let p=m.height,g=0,v=r.reduce((I,k)=>I+k.before.length+k.lines.length+k.after.length,0);if(v+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*l.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),v){const I=e.displayColors?Math.max(a,c.lineHeight):c.lineHeight;p+=f*I+(v-f)*c.lineHeight+(v-1)*e.bodySpacing}h&&(p+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let x=0;const z=function(I){g=Math.max(g,i.measureText(I).width+x)};return i.save(),i.font=l.string,te(t.title,z),i.font=c.string,te(t.beforeBody.concat(t.afterBody),z),x=e.displayColors?s+2+e.boxPadding:0,te(r,I=>{te(I.before,z),te(I.lines,z),te(I.after,z)}),x=0,i.font=u.string,te(t.footer,z),i.restore(),g+=m.width,{width:g,height:p}}function vz(t,e){const{y:i,height:r}=e;return i<r/2?"top":i>t.height-r/2?"bottom":"center"}function bz(t,e,i,r){const{x:n,width:o}=r,s=i.caretSize+i.caretPadding;if(t==="left"&&n+o+s>e.width||t==="right"&&n-o-s<0)return!0}function _z(t,e,i,r){const{x:n,width:o}=i,{width:s,chartArea:{left:a,right:c}}=t;let l="center";return r==="center"?l=n<=(a+c)/2?"left":"right":n<=o/2?l="left":n>=s-o/2&&(l="right"),bz(l,t,e,i)&&(l="center"),l}function nh(t,e,i){const r=i.yAlign||e.yAlign||vz(t,i);return{xAlign:i.xAlign||e.xAlign||_z(t,e,i,r),yAlign:r}}function yz(t,e){let{x:i,width:r}=t;return e==="right"?i-=r:e==="center"&&(i-=r/2),i}function xz(t,e,i){let{y:r,height:n}=t;return e==="top"?r+=i:e==="bottom"?r-=n+i:r-=n/2,r}function ih(t,e,i,r){const{caretSize:n,caretPadding:o,cornerRadius:s}=t,{xAlign:a,yAlign:c}=i,l=n+o,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=Ft(s);let m=yz(e,a);const p=xz(e,c,l);return c==="center"?a==="left"?m+=l:a==="right"&&(m-=l):a==="left"?m-=Math.max(u,h)+n:a==="right"&&(m+=Math.max(d,f)+n),{x:be(m,0,r.width-e.width),y:be(p,0,r.height-e.height)}}function jr(t,e,i){const r=Oe(i.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-r.right:t.x+r.left}function rh(t){return Qe([],st(t))}function $z(t,e,i){return zt(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function oh(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}const Yv={beforeTitle:rt,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,r=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(r>0&&e.dataIndex<r)return i[e.dataIndex]}return""},afterTitle:rt,beforeBody:rt,beforeLabel:rt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return V(i)||(e+=i),e},labelColor(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const i=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:rt,afterBody:rt,beforeFooter:rt,footer:rt,afterFooter:rt};function Ee(t,e,i,r){const n=t[e].call(i,r);return typeof n>"u"?Yv[e].call(i,r):n}class ua extends Xe{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const i=this.chart,r=this.options.setContext(this.getContext()),n=r.enabled&&i.options.animation&&r.animations,o=new Ov(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=$z(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,i){const{callbacks:r}=i,n=Ee(r,"beforeTitle",this,e),o=Ee(r,"title",this,e),s=Ee(r,"afterTitle",this,e);let a=[];return a=Qe(a,st(n)),a=Qe(a,st(o)),a=Qe(a,st(s)),a}getBeforeBody(e,i){return rh(Ee(i.callbacks,"beforeBody",this,e))}getBody(e,i){const{callbacks:r}=i,n=[];return te(e,o=>{const s={before:[],lines:[],after:[]},a=oh(r,o);Qe(s.before,st(Ee(a,"beforeLabel",this,o))),Qe(s.lines,Ee(a,"label",this,o)),Qe(s.after,st(Ee(a,"afterLabel",this,o))),n.push(s)}),n}getAfterBody(e,i){return rh(Ee(i.callbacks,"afterBody",this,e))}getFooter(e,i){const{callbacks:r}=i,n=Ee(r,"beforeFooter",this,e),o=Ee(r,"footer",this,e),s=Ee(r,"afterFooter",this,e);let a=[];return a=Qe(a,st(n)),a=Qe(a,st(o)),a=Qe(a,st(s)),a}_createItems(e){const i=this._active,r=this.chart.data,n=[],o=[],s=[];let a=[],c,l;for(c=0,l=i.length;c<l;++c)a.push(gz(this.chart,i[c]));return e.filter&&(a=a.filter((u,d,h)=>e.filter(u,d,h,r))),e.itemSort&&(a=a.sort((u,d)=>e.itemSort(u,d,r))),te(a,u=>{const d=oh(e.callbacks,u);n.push(Ee(d,"labelColor",this,u)),o.push(Ee(d,"labelPointStyle",this,u)),s.push(Ee(d,"labelTextColor",this,u))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(e,i){const r=this.options.setContext(this.getContext()),n=this._active;let o,s=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=Kn[r.position].call(this,n,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const c=this._size=th(this,r),l=Object.assign({},a,c),u=nh(this.chart,r,l),d=ih(r,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,o={opacity:1,x:d.x,y:d.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),e&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(e,i,r,n){const o=this.getCaretPosition(e,r,n);i.lineTo(o.x1,o.y1),i.lineTo(o.x2,o.y2),i.lineTo(o.x3,o.y3)}getCaretPosition(e,i,r){const{xAlign:n,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:d}=Ft(a),{x:h,y:f}=e,{width:m,height:p}=i;let g,v,x,z,I,k;return o==="center"?(I=f+p/2,n==="left"?(g=h,v=g-s,z=I+s,k=I-s):(g=h+m,v=g+s,z=I-s,k=I+s),x=g):(n==="left"?v=h+Math.max(c,u)+s:n==="right"?v=h+m-Math.max(l,d)-s:v=this.caretX,o==="top"?(z=f,I=z-s,g=v-s,x=v+s):(z=f+p,I=z+s,g=v+s,x=v-s),k=z),{x1:g,x2:v,x3:x,y1:z,y2:I,y3:k}}drawTitle(e,i,r){const n=this.title,o=n.length;let s,a,c;if(o){const l=on(r.rtl,this.x,this.width);for(e.x=jr(this,r.titleAlign,r),i.textAlign=l.textAlign(r.titleAlign),i.textBaseline="middle",s=ve(r.titleFont),a=r.titleSpacing,i.fillStyle=r.titleColor,i.font=s.string,c=0;c<o;++c)i.fillText(n[c],l.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+a,c+1===o&&(e.y+=r.titleMarginBottom-a)}}_drawColorBox(e,i,r,n,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:c,boxWidth:l}=o,u=ve(o.bodyFont),d=jr(this,"left",o),h=n.x(d),f=c<u.lineHeight?(u.lineHeight-c)/2:0,m=i.y+f;if(o.usePointStyle){const p={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},g=n.leftForLtr(h,l)+l/2,v=m+c/2;e.strokeStyle=o.multiKeyBackground,e.fillStyle=o.multiKeyBackground,ia(e,p,g,v),e.strokeStyle=s.borderColor,e.fillStyle=s.backgroundColor,ia(e,p,g,v)}else{e.lineWidth=W(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,e.strokeStyle=s.borderColor,e.setLineDash(s.borderDash||[]),e.lineDashOffset=s.borderDashOffset||0;const p=n.leftForLtr(h,l),g=n.leftForLtr(n.xPlus(h,1),l-2),v=Ft(s.borderRadius);Object.values(v).some(x=>x!==0)?(e.beginPath(),e.fillStyle=o.multiKeyBackground,li(e,{x:p,y:m,w:l,h:c,radius:v}),e.fill(),e.stroke(),e.fillStyle=s.backgroundColor,e.beginPath(),li(e,{x:g,y:m+1,w:l-2,h:c-2,radius:v}),e.fill()):(e.fillStyle=o.multiKeyBackground,e.fillRect(p,m,l,c),e.strokeRect(p,m,l,c),e.fillStyle=s.backgroundColor,e.fillRect(g,m+1,l-2,c-2))}e.fillStyle=this.labelTextColors[r]}drawBody(e,i,r){const{body:n}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:u}=r,d=ve(r.bodyFont);let h=d.lineHeight,f=0;const m=on(r.rtl,this.x,this.width),p=function(D){i.fillText(D,m.x(e.x+f),e.y+h/2),e.y+=h+o},g=m.textAlign(s);let v,x,z,I,k,O,P;for(i.textAlign=s,i.textBaseline="middle",i.font=d.string,e.x=jr(this,g,r),i.fillStyle=r.bodyColor,te(this.beforeBody,p),f=a&&g!=="right"?s==="center"?l/2+u:l+2+u:0,I=0,O=n.length;I<O;++I){for(v=n[I],x=this.labelTextColors[I],i.fillStyle=x,te(v.before,p),z=v.lines,a&&z.length&&(this._drawColorBox(i,e,I,m,r),h=Math.max(d.lineHeight,c)),k=0,P=z.length;k<P;++k)p(z[k]),h=d.lineHeight;te(v.after,p)}f=0,h=d.lineHeight,te(this.afterBody,p),e.y-=o}drawFooter(e,i,r){const n=this.footer,o=n.length;let s,a;if(o){const c=on(r.rtl,this.x,this.width);for(e.x=jr(this,r.footerAlign,r),e.y+=r.footerMarginTop,i.textAlign=c.textAlign(r.footerAlign),i.textBaseline="middle",s=ve(r.footerFont),i.fillStyle=r.footerColor,i.font=s.string,a=0;a<o;++a)i.fillText(n[a],c.x(e.x),e.y+s.lineHeight/2),e.y+=s.lineHeight+r.footerSpacing}}drawBackground(e,i,r,n){const{xAlign:o,yAlign:s}=this,{x:a,y:c}=e,{width:l,height:u}=r,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:m}=Ft(n.cornerRadius);i.fillStyle=n.backgroundColor,i.strokeStyle=n.borderColor,i.lineWidth=n.borderWidth,i.beginPath(),i.moveTo(a+d,c),s==="top"&&this.drawCaret(e,i,r,n),i.lineTo(a+l-h,c),i.quadraticCurveTo(a+l,c,a+l,c+h),s==="center"&&o==="right"&&this.drawCaret(e,i,r,n),i.lineTo(a+l,c+u-m),i.quadraticCurveTo(a+l,c+u,a+l-m,c+u),s==="bottom"&&this.drawCaret(e,i,r,n),i.lineTo(a+f,c+u),i.quadraticCurveTo(a,c+u,a,c+u-f),s==="center"&&o==="left"&&this.drawCaret(e,i,r,n),i.lineTo(a,c+d),i.quadraticCurveTo(a,c,a+d,c),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()}_updateAnimationTarget(e){const i=this.chart,r=this.$animations,n=r&&r.x,o=r&&r.y;if(n||o){const s=Kn[e.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=th(this,e),c=Object.assign({},s,this._size),l=nh(i,e,c),u=ih(e,c,l,i);(n._to!==u.x||o._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const i=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(i);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Oe(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(e.save(),e.globalAlpha=r,this.drawBackground(o,e,n,i),Sv(e,i.textDirection),o.y+=s.top,this.drawTitle(o,e,i),this.drawBody(o,e,i),this.drawFooter(o,e,i),wv(e,i.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,i){const r=this._active,n=e.map(({datasetIndex:a,index:c})=>{const l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!ro(r,n),s=this._positionChanged(n,i);(o||s)&&(this._active=n,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,i,r=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],s=this._getActiveElements(e,o,i,r),a=this._positionChanged(s,e),c=i||!ro(s,o)||a;return c&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,i))),c}_getActiveElements(e,i,r,n){const o=this.options;if(e.type==="mouseout")return[];if(!n)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(e,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(e,i){const{caretX:r,caretY:n,options:o}=this,s=Kn[o.position].call(this,e,i);return s!==!1&&(r!==s.x||n!==s.y)}}w(ua,"positioners",Kn);var kz={id:"tooltip",_element:ua,positioners:Kn,afterInit(t,e,i){i&&(t.tooltip=new ua({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const i={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i)}},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Yv},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Sz=Object.freeze({__proto__:null,Colors:jI,Decimation:LI,Filler:sz,Legend:hz,SubTitle:pz,Title:mz,Tooltip:kz});const wz=(t,e,i,r)=>(typeof e=="string"?(i=t.push(e)-1,r.unshift({index:i,label:e})):isNaN(e)&&(i=null),i);function Iz(t,e,i,r){const n=t.indexOf(e);if(n===-1)return wz(t,e,i,r);const o=t.lastIndexOf(e);return n!==o?i:n}const zz=(t,e)=>t===null?null:be(Math.round(t),0,e);function sh(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class da extends Xt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const i=this._addedLabels;if(i.length){const r=this.getLabels();for(const{index:n,label:o}of i)r[n]===o&&r.splice(n,1);this._addedLabels=[]}super.init(e)}parse(e,i){if(V(e))return null;const r=this.getLabels();return i=isFinite(i)&&r[i]===e?i:Iz(r,e,R(i,e),this._addedLabels),zz(i,r.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(r=0),i||(n=this.getLabels().length-1)),this.min=r,this.max=n}buildTicks(){const e=this.min,i=this.max,r=this.options.offset,n=[];let o=this.getLabels();o=e===0&&i===o.length-1?o:o.slice(e,i+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=e;s<=i;s++)n.push({value:s});return n}getLabelForValue(e){return sh.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const i=this.ticks;return e<0||e>i.length-1?null:this.getPixelForValue(i[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}w(da,"id","category"),w(da,"defaults",{ticks:{callback:sh}});function Pz(t,e){const i=[],{bounds:n,step:o,min:s,max:a,precision:c,count:l,maxTicks:u,maxDigits:d,includeBounds:h}=t,f=o||1,m=u-1,{min:p,max:g}=e,v=!V(s),x=!V(a),z=!V(l),I=(g-p)/(d+1);let k=td((g-p)/m/f)*f,O,P,D,E;if(k<1e-14&&!v&&!x)return[{value:p},{value:g}];E=Math.ceil(g/k)-Math.floor(p/k),E>m&&(k=td(E*k/m/f)*f),V(c)||(O=Math.pow(10,c),k=Math.ceil(k*O)/O),n==="ticks"?(P=Math.floor(p/k)*k,D=Math.ceil(g/k)*k):(P=p,D=g),v&&x&&o&&yS((a-s)/o,k/1e3)?(E=Math.round(Math.min((a-s)/k,u)),k=(a-s)/E,P=s,D=a):z?(P=v?s:P,D=x?a:D,E=l-1,k=(D-P)/E):(E=(D-P)/k,Xn(E,Math.round(E),k/1e3)?E=Math.round(E):E=Math.ceil(E));const F=Math.max(nd(k),nd(P));O=Math.pow(10,V(c)?F:c),P=Math.round(P*O)/O,D=Math.round(D*O)/O;let B=0;for(v&&(h&&P!==s?(i.push({value:s}),P<s&&B++,Xn(Math.round((P+B*k)*O)/O,s,ah(s,I,t))&&B++):P<s&&B++);B<E;++B){const q=Math.round((P+B*k)*O)/O;if(x&&q>a)break;i.push({value:q})}return x&&h&&D!==a?i.length&&Xn(i[i.length-1].value,a,ah(a,I,t))?i[i.length-1].value=a:i.push({value:a}):(!x||D===a)&&i.push({value:D}),i}function ah(t,e,{horizontal:i,minRotation:r}){const n=Ge(r),o=(i?Math.sin(n):Math.cos(n))||.001,s=.75*e*(""+t).length;return Math.min(e/o,s)}class ho extends Xt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,i){return V(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:i,maxDefined:r}=this.getUserBounds();let{min:n,max:o}=this;const s=c=>n=i?n:c,a=c=>o=r?o:c;if(e){const c=tt(n),l=tt(o);c<0&&l<0?a(0):c>0&&l>0&&s(0)}if(n===o){let c=o===0?1:Math.abs(o*.05);a(o+c),e||s(n-c)}this.min=n,this.max=o}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:i,stepSize:r}=e,n;return r?(n=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),i=i||11),i&&(n=Math.min(i,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,i=e.ticks;let r=this.getTickLimit();r=Math.max(2,r);const n={maxTicks:r,bounds:e.bounds,min:e.min,max:e.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},o=this._range||this,s=Pz(n,o);return e.bounds==="ticks"&&av(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const e=this.ticks;let i=this.min,r=this.max;if(super.configure(),this.options.offset&&e.length){const n=(r-i)/Math.max(e.length-1,1)/2;i-=n,r+=n}this._startValue=i,this._endValue=r,this._valueRange=r-i}getLabelForValue(e){return br(e,this.chart.options.locale,this.options.ticks.format)}}class ha extends ho{determineDataLimits(){const{min:e,max:i}=this.getMinMax(!0);this.min=fe(e)?e:0,this.max=fe(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),i=e?this.width:this.height,r=Ge(this.options.ticks.minRotation),n=(e?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,o.lineHeight/n))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}w(ha,"id","linear"),w(ha,"defaults",{ticks:{callback:Is.formatters.numeric}});const di=t=>Math.floor(vt(t)),Ct=(t,e)=>Math.pow(10,di(t)+e);function ch(t){return t/Math.pow(10,di(t))===1}function lh(t,e,i){const r=Math.pow(10,i),n=Math.floor(t/r);return Math.ceil(e/r)-n}function Tz(t,e){const i=e-t;let r=di(i);for(;lh(t,e,r)>10;)r++;for(;lh(t,e,r)<10;)r--;return Math.min(r,di(t))}function Oz(t,{min:e,max:i}){e=Re(t.min,e);const r=[],n=di(e);let o=Tz(e,i),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),c=n>o?Math.pow(10,n):0,l=Math.round((e-c)*s)/s,u=Math.floor((e-c)/a/10)*a*10;let d=Math.floor((l-u)/Math.pow(10,o)),h=Re(t.min,Math.round((c+u+d*Math.pow(10,o))*s)/s);for(;h<i;)r.push({value:h,major:ch(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),h=Math.round((c+u+d*Math.pow(10,o))*s)/s;const f=Re(t.max,h);return r.push({value:f,major:ch(f),significand:d}),r}class fa extends Xt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,i){const r=ho.prototype.parse.apply(this,[e,i]);if(r===0){this._zero=!0;return}return fe(r)&&r>0?r:null}determineDataLimits(){const{min:e,max:i}=this.getMinMax(!0);this.min=fe(e)?Math.max(0,e):null,this.max=fe(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!fe(this._userMin)&&(this.min=e===Ct(this.min,0)?Ct(this.min,-1):Ct(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:i}=this.getUserBounds();let r=this.min,n=this.max;const o=a=>r=e?r:a,s=a=>n=i?n:a;r===n&&(r<=0?(o(1),s(10)):(o(Ct(r,-1)),s(Ct(n,1)))),r<=0&&o(Ct(n,-1)),n<=0&&s(Ct(r,1)),this.min=r,this.max=n}buildTicks(){const e=this.options,i={min:this._userMin,max:this._userMax},r=Oz(i,this);return e.bounds==="ticks"&&av(r,this,"value"),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(e){return e===void 0?"0":br(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=vt(e),this._valueRange=vt(this.max)-vt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(vt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const i=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+i*this._valueRange)}}w(fa,"id","logarithmic"),w(fa,"defaults",{ticks:{callback:Is.formatters.logarithmic,major:{enabled:!0}}});function ma(t){const e=t.ticks;if(e.display&&t.display){const i=Oe(e.backdropPadding);return R(e.font&&e.font.size,de.font.size)+i.height}return 0}function Dz(t,e,i){return i=ue(i)?i:[i],{w:RS(t,e.string,i),h:i.length*e.lineHeight}}function uh(t,e,i,r,n){return t===r||t===n?{start:e-i/2,end:e+i/2}:t<r||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function Mz(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),r=[],n=[],o=t._pointLabels.length,s=t.options.pointLabels,a=s.centerPointLabels?Y/o:0;for(let c=0;c<o;c++){const l=s.setContext(t.getPointLabelContext(c));n[c]=l.padding;const u=t.getPointPosition(c,t.drawingArea+n[c],a),d=ve(l.font),h=Dz(t.ctx,d,t._pointLabels[c]);r[c]=h;const f=Pe(t.getIndexAngle(c)+a),m=Math.round(lu(f)),p=uh(m,u.x,h.w,0,180),g=uh(m,u.y,h.h,90,270);Ez(i,e,f,p,g)}t.setCenterPoint(e.l-i.l,i.r-e.r,e.t-i.t,i.b-e.b),t._pointLabelItems=jz(t,r,n)}function Ez(t,e,i,r,n){const o=Math.abs(Math.sin(i)),s=Math.abs(Math.cos(i));let a=0,c=0;r.start<e.l?(a=(e.l-r.start)/o,t.l=Math.min(t.l,e.l-a)):r.end>e.r&&(a=(r.end-e.r)/o,t.r=Math.max(t.r,e.r+a)),n.start<e.t?(c=(e.t-n.start)/s,t.t=Math.min(t.t,e.t-c)):n.end>e.b&&(c=(n.end-e.b)/s,t.b=Math.max(t.b,e.b+c))}function Cz(t,e,i){const r=t.drawingArea,{extra:n,additionalAngle:o,padding:s,size:a}=i,c=t.getPointPosition(e,r+n+s,o),l=Math.round(lu(Pe(c.angle+pe))),u=Uz(c.y,a.h,l),d=Rz(l),h=Nz(c.x,a.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function Az(t,e){if(!e)return!0;const{left:i,top:r,right:n,bottom:o}=t;return!(dt({x:i,y:r},e)||dt({x:i,y:o},e)||dt({x:n,y:r},e)||dt({x:n,y:o},e))}function jz(t,e,i){const r=[],n=t._pointLabels.length,o=t.options,{centerPointLabels:s,display:a}=o.pointLabels,c={extra:ma(o)/2,additionalAngle:s?Y/n:0};let l;for(let u=0;u<n;u++){c.padding=i[u],c.size=e[u];const d=Cz(t,u,c);r.push(d),a==="auto"&&(d.visible=Az(d,l),d.visible&&(l=d))}return r}function Rz(t){return t===0||t===180?"center":t<180?"left":"right"}function Nz(t,e,i){return i==="right"?t-=e:i==="center"&&(t-=e/2),t}function Uz(t,e,i){return i===90||i===270?t-=e/2:(i>270||i<90)&&(t-=e),t}function Lz(t,e,i){const{left:r,top:n,right:o,bottom:s}=i,{backdropColor:a}=e;if(!V(a)){const c=Ft(e.borderRadius),l=Oe(e.backdropPadding);t.fillStyle=a;const u=r-l.left,d=n-l.top,h=o-r+l.width,f=s-n+l.height;Object.values(c).some(m=>m!==0)?(t.beginPath(),li(t,{x:u,y:d,w:h,h:f,radius:c}),t.fill()):t.fillRect(u,d,h,f)}}function Fz(t,e){const{ctx:i,options:{pointLabels:r}}=t;for(let n=e-1;n>=0;n--){const o=t._pointLabelItems[n];if(!o.visible)continue;const s=r.setContext(t.getPointLabelContext(n));Lz(i,s,o);const a=ve(s.font),{x:c,y:l,textAlign:u}=o;Jt(i,t._pointLabels[n],c,l+a.lineHeight/2,a,{color:s.color,textAlign:u,textBaseline:"middle"})}}function Xv(t,e,i,r){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,ce);else{let o=t.getPointPosition(0,e);n.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=t.getPointPosition(s,e),n.lineTo(o.x,o.y)}}function Zz(t,e,i,r,n){const o=t.ctx,s=e.circular,{color:a,lineWidth:c}=e;!s&&!r||!a||!c||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),Xv(t,i,s,r),o.closePath(),o.stroke(),o.restore())}function Bz(t,e,i){return zt(t,{label:i,index:e,type:"pointLabel"})}class Gn extends ho{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=Oe(ma(this.options)/2),i=this.width=this.maxWidth-e.width,r=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+i/2+e.left),this.yCenter=Math.floor(this.top+r/2+e.top),this.drawingArea=Math.floor(Math.min(i,r)/2)}determineDataLimits(){const{min:e,max:i}=this.getMinMax(!1);this.min=fe(e)&&!isNaN(e)?e:0,this.max=fe(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ma(this.options))}generateTickLabels(e){ho.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((i,r)=>{const n=ae(this.options.pointLabels.callback,[i,r],this);return n||n===0?n:""}).filter((i,r)=>this.chart.getDataVisibility(r))}fit(){const e=this.options;e.display&&e.pointLabels.display?Mz(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,i,r,n){this.xCenter+=Math.floor((e-i)/2),this.yCenter+=Math.floor((r-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,i,r,n))}getIndexAngle(e){const i=ce/(this._pointLabels.length||1),r=this.options.startAngle||0;return Pe(e*i+Ge(r))}getDistanceFromCenterForValue(e){if(V(e))return NaN;const i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*i:(e-this.min)*i}getValueForDistanceFromCenter(e){if(V(e))return NaN;const i=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(e){const i=this._pointLabels||[];if(e>=0&&e<i.length){const r=i[e];return Bz(this.getContext(),e,r)}}getPointPosition(e,i,r=0){const n=this.getIndexAngle(e)-pe+r;return{x:Math.cos(n)*i+this.xCenter,y:Math.sin(n)*i+this.yCenter,angle:n}}getPointPositionForValue(e,i){return this.getPointPosition(e,this.getDistanceFromCenterForValue(i))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:i,top:r,right:n,bottom:o}=this._pointLabelItems[e];return{left:i,top:r,right:n,bottom:o}}drawBackground(){const{backgroundColor:e,grid:{circular:i}}=this.options;if(e){const r=this.ctx;r.save(),r.beginPath(),Xv(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),r.closePath(),r.fillStyle=e,r.fill(),r.restore()}}drawGrid(){const e=this.ctx,i=this.options,{angleLines:r,grid:n,border:o}=i,s=this._pointLabels.length;let a,c,l;if(i.pointLabels.display&&Fz(this,s),n.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=n.setContext(h),m=o.setContext(h);Zz(this,f,c,s,m)}}),r.display){for(e.save(),a=s-1;a>=0;a--){const u=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:h}=u;!h||!d||(e.lineWidth=h,e.strokeStyle=d,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(i.reverse?this.min:this.max),l=this.getPointPosition(a,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(l.x,l.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,i=this.options,r=i.ticks;if(!r.display)return;const n=this.getIndexAngle(0);let o,s;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!i.reverse)return;const l=r.setContext(this.getContext(c)),u=ve(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){e.font=u.string,s=e.measureText(a.label).width,e.fillStyle=l.backdropColor;const d=Oe(l.backdropPadding);e.fillRect(-s/2-d.left,-o-u.size/2-d.top,s+d.width,u.size+d.height)}Jt(e,a.label,0,-o,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),e.restore()}drawTitle(){}}w(Gn,"id","radialLinear"),w(Gn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Is.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),w(Gn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),w(Gn,"descriptors",{angleLines:{_fallback:"grid"}});const Ms={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ce=Object.keys(Ms);function dh(t,e){return t-e}function hh(t,e){if(V(e))return null;const i=t._adapter,{parser:r,round:n,isoWeekday:o}=t._parseOpts;let s=e;return typeof r=="function"&&(s=r(s)),fe(s)||(s=typeof r=="string"?i.parse(s,r):i.parse(s)),s===null?null:(n&&(s=n==="week"&&(bn(o)||o===!0)?i.startOf(s,"isoWeek",o):i.startOf(s,n)),+s)}function fh(t,e,i,r){const n=Ce.length;for(let o=Ce.indexOf(t);o<n-1;++o){const s=Ms[Ce[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((i-e)/(a*s.size))<=r)return Ce[o]}return Ce[n-1]}function Hz(t,e,i,r,n){for(let o=Ce.length-1;o>=Ce.indexOf(i);o--){const s=Ce[o];if(Ms[s].common&&t._adapter.diff(n,r,s)>=e-1)return s}return Ce[i?Ce.indexOf(i):0]}function Vz(t){for(let e=Ce.indexOf(t)+1,i=Ce.length;e<i;++e)if(Ms[Ce[e]].common)return Ce[e]}function mh(t,e,i){if(!i)t[e]=!0;else if(i.length){const{lo:r,hi:n}=uu(i,e),o=i[r]>=e?i[r]:i[n];t[o]=!0}}function Wz(t,e,i,r){const n=t._adapter,o=+n.startOf(e[0].value,r),s=e[e.length-1].value;let a,c;for(a=o;a<=s;a=+n.add(a,1,r))c=i[a],c>=0&&(e[c].major=!0);return e}function ph(t,e,i){const r=[],n={},o=e.length;let s,a;for(s=0;s<o;++s)a=e[s],n[a]=s,r.push({value:a,major:!1});return o===0||!i?r:Wz(t,r,n,i)}class hi extends Xt{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,i={}){const r=e.time||(e.time={}),n=this._adapter=new e0._date(e.adapters.date);n.init(i),Yn(r.displayFormats,n.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(e),this._normalized=i.normalized}parse(e,i){return e===void 0?null:hh(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,i=this._adapter,r=e.time.unit||"day";let{min:n,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function c(l){!s&&!isNaN(l.min)&&(n=Math.min(n,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!s||!a)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),n=fe(n)&&!isNaN(n)?n:+i.startOf(Date.now(),r),o=fe(o)&&!isNaN(o)?o:+i.endOf(Date.now(),r)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const e=this.getLabelTimestamps();let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return e.length&&(i=e[0],r=e[e.length-1]),{min:i,max:r}}buildTicks(){const e=this.options,i=e.time,r=e.ticks,n=r.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,s=this.max,a=SS(n,o,s);return this._unit=i.unit||(r.autoSkip?fh(i.minUnit,this.min,this.max,this._getLabelCapacity(o)):Hz(this,a.length,i.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Vz(this._unit),this.initOffsets(n),e.reverse&&a.reverse(),ph(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let i=0,r=0,n,o;this.options.offset&&e.length&&(n=this.getDecimalForValue(e[0]),e.length===1?i=1-n:i=(this.getDecimalForValue(e[1])-n)/2,o=this.getDecimalForValue(e[e.length-1]),e.length===1?r=o:r=(o-this.getDecimalForValue(e[e.length-2]))/2);const s=e.length<3?.5:.25;i=be(i,0,s),r=be(r,0,s),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const e=this._adapter,i=this.min,r=this.max,n=this.options,o=n.time,s=o.unit||fh(o.minUnit,i,r,this._getLabelCapacity(i)),a=R(n.ticks.stepSize,1),c=s==="week"?o.isoWeekday:!1,l=bn(c)||c===!0,u={};let d=i,h,f;if(l&&(d=+e.startOf(d,"isoWeek",c)),d=+e.startOf(d,l?"day":s),e.diff(r,i,s)>1e5*a)throw new Error(i+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<r;h=+e.add(h,a,s),f++)mh(u,h,m);return(h===r||n.bounds==="ticks"||f===1)&&mh(u,h,m),Object.keys(u).sort(dh).map(p=>+p)}getLabelForValue(e){const i=this._adapter,r=this.options.time;return r.tooltipFormat?i.format(e,r.tooltipFormat):i.format(e,r.displayFormats.datetime)}format(e,i){const n=this.options.time.displayFormats,o=this._unit,s=i||n[o];return this._adapter.format(e,s)}_tickFormatFunction(e,i,r,n){const o=this.options,s=o.ticks.callback;if(s)return ae(s,[e,i,r],this);const a=o.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&a[c],d=l&&a[l],h=r[i],f=l&&d&&h&&h.major;return this._adapter.format(e,n||(f?d:u))}generateTickLabels(e){let i,r,n;for(i=0,r=e.length;i<r;++i)n=e[i],n.label=this._tickFormatFunction(n.value,i,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const i=this._offsets,r=this.getDecimalForValue(e);return this.getPixelForDecimal((i.start+r)*i.factor)}getValueForPixel(e){const i=this._offsets,r=this.getDecimalForPixel(e)/i.factor-i.end;return this.min+r*(this.max-this.min)}_getLabelSize(e){const i=this.options.ticks,r=this.ctx.measureText(e).width,n=Ge(this.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(n),s=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(e){const i=this.options.time,r=i.displayFormats,n=r[i.unit]||r.millisecond,o=this._tickFormatFunction(e,0,ph(this,[e],this._majorUnit),n),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let e=this._cache.data||[],i,r;if(e.length)return e;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(i=0,r=n.length;i<r;++i)e=e.concat(n[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let i,r;if(e.length)return e;const n=this.getLabels();for(i=0,r=n.length;i<r;++i)e.push(hh(this,n[i]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return uv(e.sort(dh))}}w(hi,"id","time"),w(hi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Rr(t,e,i){let r=0,n=t.length-1,o,s,a,c;i?(e>=t[r].pos&&e<=t[n].pos&&({lo:r,hi:n}=ut(t,"pos",e)),{pos:o,time:a}=t[r],{pos:s,time:c}=t[n]):(e>=t[r].time&&e<=t[n].time&&({lo:r,hi:n}=ut(t,"time",e)),{time:o,pos:a}=t[r],{time:s,pos:c}=t[n]);const l=s-o;return l?a+(c-a)*(e-o)/l:a}class pa extends hi{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(e);this._minPos=Rr(i,this.min),this._tableRange=Rr(i,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:i,max:r}=this,n=[],o=[];let s,a,c,l,u;for(s=0,a=e.length;s<a;++s)l=e[s],l>=i&&l<=r&&n.push(l);if(n.length<2)return[{time:i,pos:0},{time:r,pos:1}];for(s=0,a=n.length;s<a;++s)u=n[s+1],c=n[s-1],l=n[s],Math.round((u+c)/2)!==l&&o.push({time:l,pos:s/(a-1)});return o}_generate(){const e=this.min,i=this.max;let r=super.getDataTimestamps();return(!r.includes(e)||!r.length)&&r.splice(0,0,e),(!r.includes(i)||r.length===1)&&r.push(i),r.sort((n,o)=>n-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const i=this.getDataTimestamps(),r=this.getLabelTimestamps();return i.length&&r.length?e=this.normalize(i.concat(r)):e=i.length?i:r,e=this._cache.all=e,e}getDecimalForValue(e){return(Rr(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const i=this._offsets,r=this.getDecimalForPixel(e)/i.factor-i.end;return Rr(this._table,r*this._tableRange+this._minPos,!0)}}w(pa,"id","timeseries"),w(pa,"defaults",hi.defaults);var qz=Object.freeze({__proto__:null,CategoryScale:da,LinearScale:ha,LogarithmicScale:fa,RadialLinearScale:Gn,TimeScale:hi,TimeSeriesScale:pa});const Jz=[Qw,TI,Sz,qz];ct.register(...Jz);const Nr=document.querySelector(".main"),fi=document.getElementById("poll-toggle-btn"),qs=document.getElementById("status-indicator"),Kz=document.getElementById("status-text"),Gz=document.getElementById("cpu-chart"),Ur=document.getElementById("memory-bar-fill"),Yz=document.getElementById("memory-percent"),Xz=document.getElementById("memory-detail"),Qz=document.getElementById("info-hostname"),eP=document.getElementById("info-platform"),tP=document.getElementById("info-uptime"),nP=30,iP=2e3,Lr=["rgba(59, 130, 246, 0.7)","rgba(16, 185, 129, 0.7)","rgba(245, 158, 11, 0.7)","rgba(239, 68, 68, 0.7)","rgba(139, 92, 246, 0.7)","rgba(236, 72, 153, 0.7)","rgba(20, 184, 166, 0.7)","rgba(249, 115, 22, 0.7)","rgba(34, 197, 94, 0.7)","rgba(168, 85, 247, 0.7)","rgba(251, 146, 60, 0.7)","rgba(74, 222, 128, 0.7)","rgba(96, 165, 250, 0.7)","rgba(248, 113, 113, 0.7)","rgba(167, 139, 250, 0.7)","rgba(244, 114, 182, 0.7)"],G={systemInfo:null,isPolling:!1,intervalId:null,cpuHistory:[],labels:[],chart:null,previousCpuSnapshots:null};function gh(t){const e=["B","KB","MB","GB","TB"];let i=t,r=0;for(;i>=1024&&r<e.length-1;)i/=1024,r++;return`${i.toFixed(1)} ${e[r]}`}function rP(t){const e=Math.floor(t/86400),i=Math.floor(t%86400/3600),r=Math.floor(t%3600/60),n=[];return e>0&&n.push(`${e}d`),i>0&&n.push(`${i}h`),r>0&&n.push(`${r}m`),n.length>0?n.join(" "):"< 1m"}function Qv(t){const e=window.matchMedia("(prefers-color-scheme: dark)").matches,i=e?"#9ca3af":"#6b7280",r=e?"#374151":"#e5e7eb",n=Array.from({length:t},(o,s)=>({label:`P${s}`,data:[],fill:!0,backgroundColor:Lr[s%Lr.length],borderColor:Lr[s%Lr.length].replace("0.7","1"),borderWidth:1,pointRadius:0,tension:.3}));return new ct(Gz,{type:"line",data:{labels:[],datasets:n},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:300},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!0,position:"bottom",labels:{boxWidth:12,padding:8,font:{size:10},color:i}},tooltip:{enabled:!0,callbacks:{label:o=>`${o.dataset.label}: ${o.parsed.y}%`}}},scales:{x:{display:!1},y:{stacked:!0,min:0,max:t*100,ticks:{callback:o=>`${o}%`,color:i,font:{size:10}},grid:{color:r}}}}})}function eb(t,e,i){if(!G.chart)return;G.chart.data.labels=e;for(let l=0;l<i;l++)G.chart.data.datasets[l].data=t.map(u=>u[l]??0);const r=t.map(l=>l.reduce((u,d)=>u+d,0)),n=Math.max(...r,0),o=1.2,s=i*15,a=i*100,c=Math.min(Math.max(n*o,s),a);G.chart.options.scales.y.max=c,G.chart.update("none")}function oP(t,e){const i=t.usedPercent;Ur.style.width=`${i}%`,Ur.classList.remove("warning","danger"),i>=80?Ur.classList.add("danger"):i>=60&&Ur.classList.add("warning"),Yz.textContent=`${i}%`,Xz.textContent=`${gh(t.usedBytes)} / ${gh(e)}`}function sP(t){Qz.textContent=t.hostname,eP.textContent=t.platform}function aP(t){tP.textContent=rP(t.seconds)}function fo(t,e=!1,i=!1){Kz.textContent=t,qs.classList.remove("polling","error"),i?qs.classList.add("error"):e&&qs.classList.add("polling")}const xn=new Qs({name:"System Monitor",version:"1.0.0"});function cP(t,e){return!e||e.length!==t.length?t.map(()=>0):t.map((i,r)=>{const n=e[r],o=i.idle-n.idle,s=i.total-n.total;return s===0?0:Math.round((1-o/s)*100)})}async function vh(){const{systemInfo:t}=G;if(t)try{const i=(await xn.callServerTool({name:"poll-system-stats",arguments:{}})).structuredContent,r=t.cpu.count,n=cP(i.cpu.cores,G.previousCpuSnapshots);G.previousCpuSnapshots=i.cpu.cores,G.cpuHistory.push(n),G.labels.push(new Date().toLocaleTimeString()),G.cpuHistory.length>nP&&(G.cpuHistory.shift(),G.labels.shift()),eb(G.cpuHistory,G.labels,r),oP(i.memory,t.memory.totalBytes),aP(i.uptime);const o=new Date().toLocaleTimeString("en-US",{hour12:!1});fo(o,!0)}catch(e){console.error("Failed to fetch stats:",e),fo("Error",!1,!0)}}function tb(){G.isPolling||(G.isPolling=!0,fi.textContent="Stop",fi.classList.add("active"),fo("Starting...",!0),vh(),G.intervalId=window.setInterval(vh,iP))}function lP(){G.isPolling&&(G.isPolling=!1,G.intervalId&&(clearInterval(G.intervalId),G.intervalId=null),fi.textContent="Start",fi.classList.remove("active"),fo("Stopped"))}function uP(){G.isPolling?lP():tb()}fi.addEventListener("click",uP);window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{if(G.chart&&G.systemInfo){const t=G.systemInfo.cpu.count;G.chart.destroy(),G.chart=Qv(t),eb(G.cpuHistory,G.labels,t)}});xn.onerror=console.error;xn.ontoolresult=t=>{const e=t.structuredContent;e&&(G.systemInfo=e,G.chart=Qv(e.cpu.count),sP(e),tb())};function nb(t){t.safeAreaInsets&&(Nr.style.paddingTop=`${t.safeAreaInsets.top}px`,Nr.style.paddingRight=`${t.safeAreaInsets.right}px`,Nr.style.paddingBottom=`${t.safeAreaInsets.bottom}px`,Nr.style.paddingLeft=`${t.safeAreaInsets.left}px`)}xn.onhostcontextchanged=nb;xn.connect().then(()=>{const t=xn.getHostContext();t&&nb(t)});</script>
|
|
102
103
|
<style rel="stylesheet" crossorigin>*{box-sizing:border-box}html,body{font-family:system-ui,-apple-system,sans-serif;font-size:1rem}code{font-size:1em}:root{--color-bg: #ffffff;--color-text: #1f2937;--color-text-muted: #6b7280;--color-primary: #2563eb;--color-primary-hover: #1d4ed8;--color-success: #10b981;--color-warning: #f59e0b;--color-danger: #ef4444;--color-bar-bg: #e5e7eb;--color-card-bg: #f9fafb;--color-border: #e5e7eb}@media(prefers-color-scheme:dark){:root{--color-bg: #111827;--color-text: #f9fafb;--color-text-muted: #9ca3af;--color-primary: #3b82f6;--color-primary-hover: #60a5fa;--color-success: #34d399;--color-warning: #fbbf24;--color-danger: #f87171;--color-bar-bg: #374151;--color-card-bg: #1f2937;--color-border: #374151}}html,body{margin:0;padding:0;background:var(--color-bg);color:var(--color-text)}.main{width:100%;margin:0 auto;padding:16px;display:flex;flex-direction:column;gap:16px}.header{display:flex;justify-content:space-between;align-items:center;gap:12px}.title{margin:0;font-size:1.25rem;font-weight:600;flex-shrink:0}.header-controls{display:flex;align-items:center;gap:12px;flex-shrink:0}.btn{padding:6px 16px;min-width:60px;font-size:.875rem;font-weight:500;border:none;border-radius:6px;background:var(--color-primary);color:#fff;cursor:pointer;transition:background .15s ease}.btn:hover{background:var(--color-primary-hover)}.btn.active{background:var(--color-danger)}.btn.active:hover{background:#dc2626}.status{display:flex;align-items:center;gap:6px;font-size:.75rem;color:var(--color-text-muted)}.status-text{min-width:8ch;font-family:ui-monospace,monospace;text-align:right}.status-indicator{width:8px;height:8px;border-radius:50%;background:var(--color-text-muted)}.status-indicator.polling{background:var(--color-success);animation:pulse 1.5s infinite}.status-indicator.error{background:var(--color-danger)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.section-title{margin:0 0 8px;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-muted)}.chart-section{background:var(--color-card-bg);border-radius:8px;padding:12px;border:1px solid var(--color-border)}.chart-container{position:relative;height:200px}.memory-section{background:var(--color-card-bg);border-radius:8px;padding:12px;border:1px solid var(--color-border)}.memory-bar-container{display:flex;align-items:center;gap:12px}.memory-bar{flex:1;height:20px;background:var(--color-bar-bg);border-radius:10px;overflow:hidden}.memory-bar-fill{height:100%;width:0%;background:var(--color-success);border-radius:10px;transition:width .3s ease,background .3s ease}.memory-bar-fill.warning{background:var(--color-warning)}.memory-bar-fill.danger{background:var(--color-danger)}.memory-percent{font-size:1.25rem;font-weight:600;min-width:50px;text-align:right}.memory-detail{margin-top:4px;font-size:.875rem;color:var(--color-text-muted)}.info-section{background:var(--color-card-bg);border-radius:8px;padding:12px;border:1px solid var(--color-border)}.info-list{margin:0;display:flex;flex-direction:column;gap:6px}.info-item{display:flex;justify-content:space-between;align-items:center}.info-item dt{font-size:.875rem;color:var(--color-text-muted)}.info-item dd{margin:0;font-size:.875rem;font-weight:500}</style>
|
|
103
104
|
</head>
|
|
104
105
|
<body>
|