-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathapp.js
More file actions
39 lines (34 loc) · 260 KB
/
app.js
File metadata and controls
39 lines (34 loc) · 260 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(()=>{var Kc=Object.create;var Bn=Object.defineProperty;var Xc=Object.getOwnPropertyDescriptor;var qc=Object.getOwnPropertyNames;var Gc=Object.getPrototypeOf,Jc=Object.prototype.hasOwnProperty;var Zc=(e,t,i)=>t in e?Bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Qc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var th=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of qc(t))!Jc.call(e,s)&&s!==i&&Bn(e,s,{get:()=>t[s],enumerable:!(n=Xc(t,s))||n.enumerable});return e};var eh=(e,t,i)=>(i=e!=null?Kc(Gc(e)):{},th(t||!e||!e.__esModule?Bn(i,"default",{value:e,enumerable:!0}):i,e));var S=(e,t,i)=>(Zc(e,typeof t!="symbol"?t+"":t,i),i);var Uc=Qc((Yc,Fn)=>{(function(e,t){"use strict";(function(){for(var f=0,g=["ms","moz","webkit","o"],m=0;m<g.length&&!e.requestAnimationFrame;++m)e.requestAnimationFrame=e[g[m]+"RequestAnimationFrame"],e.cancelAnimationFrame=e[g[m]+"CancelAnimationFrame"]||e[g[m]+"CancelRequestAnimationFrame"];e.requestAnimationFrame||(e.requestAnimationFrame=function(p,b){var _=new Date().getTime(),y=Math.max(0,16-(_-f)),v=e.setTimeout(function(){p(_+y)},y);return f=_+y,v}),e.cancelAnimationFrame||(e.cancelAnimationFrame=function(p){clearTimeout(p)})})();var i,n,s,o=null,r=null,a=null,l=function(f,g,m){f.addEventListener?f.addEventListener(g,m,!1):f.attachEvent?f.attachEvent("on"+g,m):f["on"+g]=m},c={autoRun:!0,barThickness:3,barColors:{0:"rgba(26, 188, 156, .9)",".25":"rgba(52, 152, 219, .9)",".50":"rgba(241, 196, 15, .9)",".75":"rgba(230, 126, 34, .9)","1.0":"rgba(211, 84, 0, .9)"},shadowBlur:10,shadowColor:"rgba(0, 0, 0, .6)",className:null},h=function(){i.width=e.innerWidth,i.height=c.barThickness*5;var f=i.getContext("2d");f.shadowBlur=c.shadowBlur,f.shadowColor=c.shadowColor;var g=f.createLinearGradient(0,0,i.width,0);for(var m in c.barColors)g.addColorStop(m,c.barColors[m]);f.lineWidth=c.barThickness,f.beginPath(),f.moveTo(0,c.barThickness/2),f.lineTo(Math.ceil(n*i.width),c.barThickness/2),f.strokeStyle=g,f.stroke()},u=function(){i=t.createElement("canvas");var f=i.style;f.position="fixed",f.top=f.left=f.right=f.margin=f.padding=0,f.zIndex=100001,f.display="none",c.className&&i.classList.add(c.className),t.body.appendChild(i),l(e,"resize",h)},d={config:function(f){for(var g in f)c.hasOwnProperty(g)&&(c[g]=f[g])},show:function(f){if(!s)if(f){if(a)return;a=setTimeout(()=>d.show(),f)}else s=!0,r!==null&&e.cancelAnimationFrame(r),i||u(),i.style.opacity=1,i.style.display="block",d.progress(0),c.autoRun&&function g(){o=e.requestAnimationFrame(g),d.progress("+"+.05*Math.pow(1-Math.sqrt(n),2))}()},progress:function(f){return typeof f>"u"||(typeof f=="string"&&(f=(f.indexOf("+")>=0||f.indexOf("-")>=0?n:0)+parseFloat(f)),n=f>1?1:f,h()),n},hide:function(){clearTimeout(a),a=null,s&&(s=!1,o!=null&&(e.cancelAnimationFrame(o),o=null),function f(){if(d.progress("+.1")>=1&&(i.style.opacity-=.05,i.style.opacity<=.05)){i.style.display="none",r=null;return}r=e.requestAnimationFrame(f)}())}};typeof Fn=="object"&&typeof Fn.exports=="object"?Fn.exports=d:typeof define=="function"&&define.amd?define(function(){return d}):this.topbar=d}).call(Yc,window,document)});var $n=!1,Yn=!1,Jt=[],Un=-1;function ih(e){nh(e)}function nh(e){Jt.includes(e)||Jt.push(e),oh()}function sh(e){let t=Jt.indexOf(e);t!==-1&&t>Un&&Jt.splice(t,1)}function oh(){!Yn&&!$n&&($n=!0,queueMicrotask(rh))}function rh(){$n=!1,Yn=!0;for(let e=0;e<Jt.length;e++)Jt[e](),Un=e;Jt.length=0,Un=-1,Yn=!1}var ye,ie,ve,Jo,Kn=!0;function ah(e){Kn=!1,e(),Kn=!0}function lh(e){ye=e.reactive,ve=e.release,ie=t=>e.effect(t,{scheduler:i=>{Kn?ih(i):i()}}),Jo=e.raw}function zo(e){ie=e}function ch(e){let t=()=>{};return[n=>{let s=ie(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(s),t=()=>{s!==void 0&&(e._x_effects.delete(s),ve(s))},s},()=>{t()}]}function Zo(e,t){let i=!0,n,s=ie(()=>{let o=e();JSON.stringify(o),i?n=o:queueMicrotask(()=>{t(o,n),n=o}),i=!1});return()=>ve(s)}var Qo=[],tr=[],er=[];function hh(e){er.push(e)}function as(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,tr.push(t))}function ir(e){Qo.push(e)}function nr(e,t,i){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(i)}function sr(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([i,n])=>{(t===void 0||t.includes(i))&&(n.forEach(s=>s()),delete e._x_attributeCleanups[i])})}function uh(e){for(e._x_effects?.forEach(sh);e._x_cleanups?.length;)e._x_cleanups.pop()()}var ls=new MutationObserver(ds),cs=!1;function hs(){ls.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),cs=!0}function or(){dh(),ls.disconnect(),cs=!1}var Xe=[];function dh(){let e=ls.takeRecords();Xe.push(()=>e.length>0&&ds(e));let t=Xe.length;queueMicrotask(()=>{if(Xe.length===t)for(;Xe.length>0;)Xe.shift()()})}function V(e){if(!cs)return e();or();let t=e();return hs(),t}var us=!1,Ni=[];function fh(){us=!0}function gh(){us=!1,ds(Ni),Ni=[]}function ds(e){if(us){Ni=Ni.concat(e);return}let t=[],i=new Set,n=new Map,s=new Map;for(let o=0;o<e.length;o++)if(!e[o].target._x_ignoreMutationObserver&&(e[o].type==="childList"&&(e[o].removedNodes.forEach(r=>{r.nodeType===1&&r._x_marker&&i.add(r)}),e[o].addedNodes.forEach(r=>{if(r.nodeType===1){if(i.has(r)){i.delete(r);return}r._x_marker||t.push(r)}})),e[o].type==="attributes")){let r=e[o].target,a=e[o].attributeName,l=e[o].oldValue,c=()=>{n.has(r)||n.set(r,[]),n.get(r).push({name:a,value:r.getAttribute(a)})},h=()=>{s.has(r)||s.set(r,[]),s.get(r).push(a)};r.hasAttribute(a)&&l===null?c():r.hasAttribute(a)?(h(),c()):h()}s.forEach((o,r)=>{sr(r,o)}),n.forEach((o,r)=>{Qo.forEach(a=>a(r,o))});for(let o of i)t.some(r=>r.contains(o))||tr.forEach(r=>r(o));for(let o of t)o.isConnected&&er.forEach(r=>r(o));t=null,i=null,n=null,s=null}function rr(e){return ii(_e(e))}function ei(e,t,i){return e._x_dataStack=[t,..._e(i||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function _e(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?_e(e.host):e.parentNode?_e(e.parentNode):[]}function ii(e){return new Proxy({objects:e},ph)}var ph={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(i=>Object.prototype.hasOwnProperty.call(i,t)||Reflect.has(i,t))},get({objects:e},t,i){return t=="toJSON"?mh:Reflect.get(e.find(n=>Reflect.has(n,t))||{},t,i)},set({objects:e},t,i,n){let s=e.find(r=>Object.prototype.hasOwnProperty.call(r,t))||e[e.length-1],o=Object.getOwnPropertyDescriptor(s,t);return o?.set&&o?.get?o.set.call(n,i)||!0:Reflect.set(s,t,i)}};function mh(){return Reflect.ownKeys(this).reduce((t,i)=>(t[i]=Reflect.get(this,i),t),{})}function ar(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,i=(n,s="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:r,enumerable:a}])=>{if(a===!1||r===void 0||typeof r=="object"&&r!==null&&r.__v_skip)return;let l=s===""?o:`${s}.${o}`;typeof r=="object"&&r!==null&&r._x_interceptor?n[o]=r.initialize(e,l,o):t(r)&&r!==n&&!(r instanceof Element)&&i(r,l)})};return i(e)}function lr(e,t=()=>{}){let i={initialValue:void 0,_x_interceptor:!0,initialize(n,s,o){return e(this.initialValue,()=>bh(n,s),r=>Xn(n,s,r),s,o)}};return t(i),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let s=i.initialize.bind(i);i.initialize=(o,r,a)=>{let l=n.initialize(o,r,a);return i.initialValue=l,s(o,r,a)}}else i.initialValue=n;return i}}function bh(e,t){return t.split(".").reduce((i,n)=>i[n],e)}function Xn(e,t,i){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=i;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),Xn(e[t[0]],t.slice(1),i)}}var cr={};function gt(e,t){cr[e]=t}function qn(e,t){let i=_h(t);return Object.entries(cr).forEach(([n,s])=>{Object.defineProperty(e,`$${n}`,{get(){return s(t,i)},enumerable:!1})}),e}function _h(e){let[t,i]=pr(e),n={interceptor:lr,...t};return as(e,i),n}function xh(e,t,i,...n){try{return i(...n)}catch(s){ti(s,e,t)}}function ti(e,t,i=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:i}),console.warn(`Alpine Expression Error: ${e.message}
${i?'Expression: "'+i+`"
`:""}`,t),setTimeout(()=>{throw e},0)}var zi=!0;function hr(e){let t=zi;zi=!1;let i=e();return zi=t,i}function Zt(e,t,i={}){let n;return et(e,t)(s=>n=s,i),n}function et(...e){return ur(...e)}var ur=dr;function yh(e){ur=e}function dr(e,t){let i={};qn(i,e);let n=[i,..._e(e)],s=typeof t=="function"?vh(n,t):Sh(n,t,e);return xh.bind(null,e,t,s)}function vh(e,t){return(i=()=>{},{scope:n={},params:s=[]}={})=>{let o=t.apply(ii([n,...e]),s);Hi(i,o)}}var Nn={};function wh(e,t){if(Nn[e])return Nn[e];let i=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,o=(()=>{try{let r=new i(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`);return Object.defineProperty(r,"name",{value:`[Alpine] ${e}`}),r}catch(r){return ti(r,t,e),Promise.resolve()}})();return Nn[e]=o,o}function Sh(e,t,i){let n=wh(t,i);return(s=()=>{},{scope:o={},params:r=[]}={})=>{n.result=void 0,n.finished=!1;let a=ii([o,...e]);if(typeof n=="function"){let l=n(n,a).catch(c=>ti(c,i,t));n.finished?(Hi(s,n.result,a,r,i),n.result=void 0):l.then(c=>{Hi(s,c,a,r,i)}).catch(c=>ti(c,i,t)).finally(()=>n.result=void 0)}}}function Hi(e,t,i,n,s){if(zi&&typeof t=="function"){let o=t.apply(i,n);o instanceof Promise?o.then(r=>Hi(e,r,i,n)).catch(r=>ti(r,s,t)):e(o)}else typeof t=="object"&&t instanceof Promise?t.then(o=>e(o)):e(t)}var fs="x-";function we(e=""){return fs+e}function Mh(e){fs=e}var Wi={};function U(e,t){return Wi[e]=t,{before(i){if(!Wi[i]){console.warn(String.raw`Cannot find directive \`${i}\`. \`${e}\` will use the default order of execution`);return}let n=Gt.indexOf(i);Gt.splice(n>=0?n:Gt.indexOf("DEFAULT"),0,e)}}}function kh(e){return Object.keys(Wi).includes(e)}function gs(e,t,i){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,l])=>({name:a,value:l})),r=fr(o);o=o.map(a=>r.find(l=>l.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(_r((o,r)=>n[o]=r)).filter(yr).map(Ph(n,i)).sort(Oh).map(o=>Ch(e,o))}function fr(e){return Array.from(e).map(_r()).filter(t=>!yr(t))}var Gn=!1,Je=new Map,gr=Symbol();function Ah(e){Gn=!0;let t=Symbol();gr=t,Je.set(t,[]);let i=()=>{for(;Je.get(t).length;)Je.get(t).shift()();Je.delete(t)},n=()=>{Gn=!1,i()};e(i),n()}function pr(e){let t=[],i=a=>t.push(a),[n,s]=ch(e);return t.push(s),[{Alpine:ni,effect:n,cleanup:i,evaluateLater:et.bind(et,e),evaluate:Zt.bind(Zt,e)},()=>t.forEach(a=>a())]}function Ch(e,t){let i=()=>{},n=Wi[t.type]||i,[s,o]=pr(e);nr(e,t.original,o);let r=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,s),n=n.bind(n,e,t,s),Gn?Je.get(gr).push(n):n())};return r.runCleanups=o,r}var mr=(e,t)=>({name:i,value:n})=>(i.startsWith(e)&&(i=i.replace(e,t)),{name:i,value:n}),br=e=>e;function _r(e=()=>{}){return({name:t,value:i})=>{let{name:n,value:s}=xr.reduce((o,r)=>r(o),{name:t,value:i});return n!==t&&e(n,t),{name:n,value:s}}}var xr=[];function ps(e){xr.push(e)}function yr({name:e}){return vr().test(e)}var vr=()=>new RegExp(`^${fs}([^:^.]+)\\b`);function Ph(e,t){return({name:i,value:n})=>{let s=i.match(vr()),o=i.match(/:([a-zA-Z0-9\-_:]+)/),r=i.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[i]||i;return{type:s?s[1]:null,value:o?o[1]:null,modifiers:r.map(l=>l.replace(".","")),expression:n,original:a}}}var Jn="DEFAULT",Gt=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",Jn,"teleport"];function Oh(e,t){let i=Gt.indexOf(e.type)===-1?Jn:e.type,n=Gt.indexOf(t.type)===-1?Jn:t.type;return Gt.indexOf(i)-Gt.indexOf(n)}function Ze(e,t,i={}){e.dispatchEvent(new CustomEvent(t,{detail:i,bubbles:!0,composed:!0,cancelable:!0}))}function ee(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(s=>ee(s,t));return}let i=!1;if(t(e,()=>i=!0),i)return;let n=e.firstElementChild;for(;n;)ee(n,t,!1),n=n.nextElementSibling}function lt(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var Bo=!1;function Th(){Bo&<("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),Bo=!0,document.body||lt("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),Ze(document,"alpine:init"),Ze(document,"alpine:initializing"),hs(),hh(t=>Mt(t,ee)),as(t=>Me(t)),ir((t,i)=>{gs(t,i).forEach(n=>n())});let e=t=>!ji(t.parentElement,!0);Array.from(document.querySelectorAll(Mr().join(","))).filter(e).forEach(t=>{Mt(t)}),Ze(document,"alpine:initialized"),setTimeout(()=>{Rh()})}var ms=[],wr=[];function Sr(){return ms.map(e=>e())}function Mr(){return ms.concat(wr).map(e=>e())}function kr(e){ms.push(e)}function Ar(e){wr.push(e)}function ji(e,t=!1){return Se(e,i=>{if((t?Mr():Sr()).some(s=>i.matches(s)))return!0})}function Se(e,t){if(e){if(t(e))return e;if(e._x_teleportBack&&(e=e._x_teleportBack),!!e.parentElement)return Se(e.parentElement,t)}}function Dh(e){return Sr().some(t=>e.matches(t))}var Cr=[];function Eh(e){Cr.push(e)}var Lh=1;function Mt(e,t=ee,i=()=>{}){Se(e,n=>n._x_ignore)||Ah(()=>{t(e,(n,s)=>{n._x_marker||(i(n,s),Cr.forEach(o=>o(n,s)),gs(n,n.attributes).forEach(o=>o()),n._x_ignore||(n._x_marker=Lh++),n._x_ignore&&s())})})}function Me(e,t=ee){t(e,i=>{uh(i),sr(i),delete i._x_marker})}function Rh(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([t,i,n])=>{kh(i)||n.some(s=>{if(document.querySelector(s))return lt(`found "${s}", but missing ${t} plugin`),!0})})}var Zn=[],bs=!1;function _s(e=()=>{}){return queueMicrotask(()=>{bs||setTimeout(()=>{Qn()})}),new Promise(t=>{Zn.push(()=>{e(),t()})})}function Qn(){for(bs=!1;Zn.length;)Zn.shift()()}function Ih(){bs=!0}function xs(e,t){return Array.isArray(t)?No(e,t.join(" ")):typeof t=="object"&&t!==null?Fh(e,t):typeof t=="function"?xs(e,t()):No(e,t)}function No(e,t){let i=o=>o.split(" ").filter(Boolean),n=o=>o.split(" ").filter(r=>!e.classList.contains(r)).filter(Boolean),s=o=>(e.classList.add(...o),()=>{e.classList.remove(...o)});return t=t===!0?t="":t||"",s(n(t))}function Fh(e,t){let i=a=>a.split(" ").filter(Boolean),n=Object.entries(t).flatMap(([a,l])=>l?i(a):!1).filter(Boolean),s=Object.entries(t).flatMap(([a,l])=>l?!1:i(a)).filter(Boolean),o=[],r=[];return s.forEach(a=>{e.classList.contains(a)&&(e.classList.remove(a),r.push(a))}),n.forEach(a=>{e.classList.contains(a)||(e.classList.add(a),o.push(a))}),()=>{r.forEach(a=>e.classList.add(a)),o.forEach(a=>e.classList.remove(a))}}function $i(e,t){return typeof t=="object"&&t!==null?zh(e,t):Bh(e,t)}function zh(e,t){let i={};return Object.entries(t).forEach(([n,s])=>{i[n]=e.style[n],n.startsWith("--")||(n=Nh(n)),e.style.setProperty(n,s)}),setTimeout(()=>{e.style.length===0&&e.removeAttribute("style")}),()=>{$i(e,i)}}function Bh(e,t){let i=e.getAttribute("style",t);return e.setAttribute("style",t),()=>{e.setAttribute("style",i||"")}}function Nh(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ts(e,t=()=>{}){let i=!1;return function(){i?t.apply(this,arguments):(i=!0,e.apply(this,arguments))}}U("transition",(e,{value:t,modifiers:i,expression:n},{evaluate:s})=>{typeof n=="function"&&(n=s(n)),n!==!1&&(!n||typeof n=="boolean"?Wh(e,i,t):Hh(e,n,t))});function Hh(e,t,i){Pr(e,xs,""),{enter:s=>{e._x_transition.enter.during=s},"enter-start":s=>{e._x_transition.enter.start=s},"enter-end":s=>{e._x_transition.enter.end=s},leave:s=>{e._x_transition.leave.during=s},"leave-start":s=>{e._x_transition.leave.start=s},"leave-end":s=>{e._x_transition.leave.end=s}}[i](t)}function Wh(e,t,i){Pr(e,$i);let n=!t.includes("in")&&!t.includes("out")&&!i,s=n||t.includes("in")||["enter"].includes(i),o=n||t.includes("out")||["leave"].includes(i);t.includes("in")&&!n&&(t=t.filter((b,_)=>_<t.indexOf("out"))),t.includes("out")&&!n&&(t=t.filter((b,_)=>_>t.indexOf("out")));let r=!t.includes("opacity")&&!t.includes("scale"),a=r||t.includes("opacity"),l=r||t.includes("scale"),c=a?0:1,h=l?qe(t,"scale",95)/100:1,u=qe(t,"delay",0)/1e3,d=qe(t,"origin","center"),f="opacity, transform",g=qe(t,"duration",150)/1e3,m=qe(t,"duration",75)/1e3,p="cubic-bezier(0.4, 0.0, 0.2, 1)";s&&(e._x_transition.enter.during={transformOrigin:d,transitionDelay:`${u}s`,transitionProperty:f,transitionDuration:`${g}s`,transitionTimingFunction:p},e._x_transition.enter.start={opacity:c,transform:`scale(${h})`},e._x_transition.enter.end={opacity:1,transform:"scale(1)"}),o&&(e._x_transition.leave.during={transformOrigin:d,transitionDelay:`${u}s`,transitionProperty:f,transitionDuration:`${m}s`,transitionTimingFunction:p},e._x_transition.leave.start={opacity:1,transform:"scale(1)"},e._x_transition.leave.end={opacity:c,transform:`scale(${h})`})}function Pr(e,t,i={}){e._x_transition||(e._x_transition={enter:{during:i,start:i,end:i},leave:{during:i,start:i,end:i},in(n=()=>{},s=()=>{}){es(e,t,{during:this.enter.during,start:this.enter.start,end:this.enter.end},n,s)},out(n=()=>{},s=()=>{}){es(e,t,{during:this.leave.during,start:this.leave.start,end:this.leave.end},n,s)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(e,t,i,n){let s=document.visibilityState==="visible"?requestAnimationFrame:setTimeout,o=()=>s(i);if(t){e._x_transition&&(e._x_transition.enter||e._x_transition.leave)?e._x_transition.enter&&(Object.entries(e._x_transition.enter.during).length||Object.entries(e._x_transition.enter.start).length||Object.entries(e._x_transition.enter.end).length)?e._x_transition.in(i):o():e._x_transition?e._x_transition.in(i):o();return}e._x_hidePromise=e._x_transition?new Promise((r,a)=>{e._x_transition.out(()=>{},()=>r(n)),e._x_transitioning&&e._x_transitioning.beforeCancel(()=>a({isFromCancelledTransition:!0}))}):Promise.resolve(n),queueMicrotask(()=>{let r=Or(e);r?(r._x_hideChildren||(r._x_hideChildren=[]),r._x_hideChildren.push(e)):s(()=>{let a=l=>{let c=Promise.all([l._x_hidePromise,...(l._x_hideChildren||[]).map(a)]).then(([h])=>h?.());return delete l._x_hidePromise,delete l._x_hideChildren,c};a(e).catch(l=>{if(!l.isFromCancelledTransition)throw l})})})};function Or(e){let t=e.parentNode;if(t)return t._x_hidePromise?t:Or(t)}function es(e,t,{during:i,start:n,end:s}={},o=()=>{},r=()=>{}){if(e._x_transitioning&&e._x_transitioning.cancel(),Object.keys(i).length===0&&Object.keys(n).length===0&&Object.keys(s).length===0){o(),r();return}let a,l,c;Vh(e,{start(){a=t(e,n)},during(){l=t(e,i)},before:o,end(){a(),c=t(e,s)},after:r,cleanup(){l(),c()}})}function Vh(e,t){let i,n,s,o=ts(()=>{V(()=>{i=!0,n||t.before(),s||(t.end(),Qn()),t.after(),e.isConnected&&t.cleanup(),delete e._x_transitioning})});e._x_transitioning={beforeCancels:[],beforeCancel(r){this.beforeCancels.push(r)},cancel:ts(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();o()}),finish:o},V(()=>{t.start(),t.during()}),Ih(),requestAnimationFrame(()=>{if(i)return;let r=Number(getComputedStyle(e).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,a=Number(getComputedStyle(e).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;r===0&&(r=Number(getComputedStyle(e).animationDuration.replace("s",""))*1e3),V(()=>{t.before()}),n=!0,requestAnimationFrame(()=>{i||(V(()=>{t.end()}),Qn(),setTimeout(e._x_transitioning.finish,r+a),s=!0)})})}function qe(e,t,i){if(e.indexOf(t)===-1)return i;let n=e[e.indexOf(t)+1];if(!n||t==="scale"&&isNaN(n))return i;if(t==="duration"||t==="delay"){let s=n.match(/([0-9]+)ms/);if(s)return s[1]}return t==="origin"&&["top","right","left","center","bottom"].includes(e[e.indexOf(t)+2])?[n,e[e.indexOf(t)+2]].join(" "):n}var Rt=!1;function Ft(e,t=()=>{}){return(...i)=>Rt?t(...i):e(...i)}function jh(e){return(...t)=>Rt&&e(...t)}var Tr=[];function Yi(e){Tr.push(e)}function $h(e,t){Tr.forEach(i=>i(e,t)),Rt=!0,Dr(()=>{Mt(t,(i,n)=>{n(i,()=>{})})}),Rt=!1}var is=!1;function Yh(e,t){t._x_dataStack||(t._x_dataStack=e._x_dataStack),Rt=!0,is=!0,Dr(()=>{Uh(t)}),Rt=!1,is=!1}function Uh(e){let t=!1;Mt(e,(n,s)=>{ee(n,(o,r)=>{if(t&&Dh(o))return r();t=!0,s(o,r)})})}function Dr(e){let t=ie;zo((i,n)=>{let s=t(i);return ve(s),()=>{}}),e(),zo(t)}function Er(e,t,i,n=[]){switch(e._x_bindings||(e._x_bindings=ye({})),e._x_bindings[t]=i,t=n.includes("camel")?tu(t):t,t){case"value":Kh(e,i);break;case"style":qh(e,i);break;case"class":Xh(e,i);break;case"selected":case"checked":Gh(e,t,i);break;default:Lr(e,t,i);break}}function Kh(e,t){if(Fr(e))e.attributes.value===void 0&&(e.value=t),window.fromModel&&(typeof t=="boolean"?e.checked=Bi(e.value)===t:e.checked=Ho(e.value,t));else if(ys(e))Number.isInteger(t)?e.value=t:!Array.isArray(t)&&typeof t!="boolean"&&![null,void 0].includes(t)?e.value=String(t):Array.isArray(t)?e.checked=t.some(i=>Ho(i,e.value)):e.checked=!!t;else if(e.tagName==="SELECT")Qh(e,t);else{if(e.value===t)return;e.value=t===void 0?"":t}}function Xh(e,t){e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedClasses=xs(e,t)}function qh(e,t){e._x_undoAddedStyles&&e._x_undoAddedStyles(),e._x_undoAddedStyles=$i(e,t)}function Gh(e,t,i){Lr(e,t,i),Zh(e,t,i)}function Lr(e,t,i){[null,void 0,!1].includes(i)&&iu(t)?e.removeAttribute(t):(Rr(t)&&(i=t),Jh(e,t,i))}function Jh(e,t,i){e.getAttribute(t)!=i&&e.setAttribute(t,i)}function Zh(e,t,i){e[t]!==i&&(e[t]=i)}function Qh(e,t){let i=[].concat(t).map(n=>n+"");Array.from(e.options).forEach(n=>{n.selected=i.includes(n.value)})}function tu(e){return e.toLowerCase().replace(/-(\w)/g,(t,i)=>i.toUpperCase())}function Ho(e,t){return e==t}function Bi(e){return[1,"1","true","on","yes",!0].includes(e)?!0:[0,"0","false","off","no",!1].includes(e)?!1:e?!!e:null}var eu=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function Rr(e){return eu.has(e)}function iu(e){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(e)}function nu(e,t,i){return e._x_bindings&&e._x_bindings[t]!==void 0?e._x_bindings[t]:Ir(e,t,i)}function su(e,t,i,n=!0){if(e._x_bindings&&e._x_bindings[t]!==void 0)return e._x_bindings[t];if(e._x_inlineBindings&&e._x_inlineBindings[t]!==void 0){let s=e._x_inlineBindings[t];return s.extract=n,hr(()=>Zt(e,s.expression))}return Ir(e,t,i)}function Ir(e,t,i){let n=e.getAttribute(t);return n===null?typeof i=="function"?i():i:n===""?!0:Rr(t)?!![t,"true"].includes(n):n}function ys(e){return e.type==="checkbox"||e.localName==="ui-checkbox"||e.localName==="ui-switch"}function Fr(e){return e.type==="radio"||e.localName==="ui-radio"}function zr(e,t){var i;return function(){var n=this,s=arguments,o=function(){i=null,e.apply(n,s)};clearTimeout(i),i=setTimeout(o,t)}}function Br(e,t){let i;return function(){let n=this,s=arguments;i||(e.apply(n,s),i=!0,setTimeout(()=>i=!1,t))}}function Nr({get:e,set:t},{get:i,set:n}){let s=!0,o,r,a=ie(()=>{let l=e(),c=i();if(s)n(Hn(l)),s=!1;else{let h=JSON.stringify(l),u=JSON.stringify(c);h!==o?n(Hn(l)):h!==u&&t(Hn(c))}o=JSON.stringify(e()),r=JSON.stringify(i())});return()=>{ve(a)}}function Hn(e){return typeof e=="object"?JSON.parse(JSON.stringify(e)):e}function ou(e){(Array.isArray(e)?e:[e]).forEach(i=>i(ni))}var qt={},Wo=!1;function ru(e,t){if(Wo||(qt=ye(qt),Wo=!0),t===void 0)return qt[e];qt[e]=t,ar(qt[e]),typeof t=="object"&&t!==null&&t.hasOwnProperty("init")&&typeof t.init=="function"&&qt[e].init()}function au(){return qt}var Hr={};function lu(e,t){let i=typeof t!="function"?()=>t:t;return e instanceof Element?Wr(e,i()):(Hr[e]=i,()=>{})}function cu(e){return Object.entries(Hr).forEach(([t,i])=>{Object.defineProperty(e,t,{get(){return(...n)=>i(...n)}})}),e}function Wr(e,t,i){let n=[];for(;n.length;)n.pop()();let s=Object.entries(t).map(([r,a])=>({name:r,value:a})),o=fr(s);return s=s.map(r=>o.find(a=>a.name===r.name)?{name:`x-bind:${r.name}`,value:`"${r.value}"`}:r),gs(e,s,i).map(r=>{n.push(r.runCleanups),r()}),()=>{for(;n.length;)n.pop()()}}var Vr={};function hu(e,t){Vr[e]=t}function uu(e,t){return Object.entries(Vr).forEach(([i,n])=>{Object.defineProperty(e,i,{get(){return(...s)=>n.bind(t)(...s)},enumerable:!1})}),e}var du={get reactive(){return ye},get release(){return ve},get effect(){return ie},get raw(){return Jo},version:"3.14.7",flushAndStopDeferringMutations:gh,dontAutoEvaluateFunctions:hr,disableEffectScheduling:ah,startObservingMutations:hs,stopObservingMutations:or,setReactivityEngine:lh,onAttributeRemoved:nr,onAttributesAdded:ir,closestDataStack:_e,skipDuringClone:Ft,onlyDuringClone:jh,addRootSelector:kr,addInitSelector:Ar,interceptClone:Yi,addScopeToNode:ei,deferMutations:fh,mapAttributes:ps,evaluateLater:et,interceptInit:Eh,setEvaluator:yh,mergeProxies:ii,extractProp:su,findClosest:Se,onElRemoved:as,closestRoot:ji,destroyTree:Me,interceptor:lr,transition:es,setStyles:$i,mutateDom:V,directive:U,entangle:Nr,throttle:Br,debounce:zr,evaluate:Zt,initTree:Mt,nextTick:_s,prefixed:we,prefix:Mh,plugin:ou,magic:gt,store:ru,start:Th,clone:Yh,cloneNode:$h,bound:nu,$data:rr,watch:Zo,walk:ee,data:hu,bind:lu},ni=du;function jr(e,t){let i=Object.create(null),n=e.split(",");for(let s=0;s<n.length;s++)i[n[s]]=!0;return t?s=>!!i[s.toLowerCase()]:s=>!!i[s]}var fu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",wb=jr(fu+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"),gu=Object.freeze({}),Sb=Object.freeze([]),pu=Object.prototype.hasOwnProperty,Ui=(e,t)=>pu.call(e,t),Qt=Array.isArray,Qe=e=>$r(e)==="[object Map]",mu=e=>typeof e=="string",vs=e=>typeof e=="symbol",Ki=e=>e!==null&&typeof e=="object",bu=Object.prototype.toString,$r=e=>bu.call(e),Yr=e=>$r(e).slice(8,-1),ws=e=>mu(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xi=e=>{let t=Object.create(null);return i=>t[i]||(t[i]=e(i))},_u=/-(\w)/g,Mb=Xi(e=>e.replace(_u,(t,i)=>i?i.toUpperCase():"")),xu=/\B([A-Z])/g,kb=Xi(e=>e.replace(xu,"-$1").toLowerCase()),Ur=Xi(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ab=Xi(e=>e?`on${Ur(e)}`:""),Kr=(e,t)=>e!==t&&(e===e||t===t),ns=new WeakMap,Ge=[],mt,te=Symbol("iterate"),ss=Symbol("Map key iterate");function yu(e){return e&&e._isEffect===!0}function vu(e,t=gu){yu(e)&&(e=e.raw);let i=Mu(e,t);return t.lazy||i(),i}function wu(e){e.active&&(Xr(e),e.options.onStop&&e.options.onStop(),e.active=!1)}var Su=0;function Mu(e,t){let i=function(){if(!i.active)return e();if(!Ge.includes(i)){Xr(i);try{return Au(),Ge.push(i),mt=i,e()}finally{Ge.pop(),qr(),mt=Ge[Ge.length-1]}}};return i.id=Su++,i.allowRecurse=!!t.allowRecurse,i._isEffect=!0,i.active=!0,i.raw=e,i.deps=[],i.options=t,i}function Xr(e){let{deps:t}=e;if(t.length){for(let i=0;i<t.length;i++)t[i].delete(e);t.length=0}}var xe=!0,Ss=[];function ku(){Ss.push(xe),xe=!1}function Au(){Ss.push(xe),xe=!0}function qr(){let e=Ss.pop();xe=e===void 0?!0:e}function ft(e,t,i){if(!xe||mt===void 0)return;let n=ns.get(e);n||ns.set(e,n=new Map);let s=n.get(i);s||n.set(i,s=new Set),s.has(mt)||(s.add(mt),mt.deps.push(s),mt.options.onTrack&&mt.options.onTrack({effect:mt,target:e,type:t,key:i}))}function It(e,t,i,n,s,o){let r=ns.get(e);if(!r)return;let a=new Set,l=h=>{h&&h.forEach(u=>{(u!==mt||u.allowRecurse)&&a.add(u)})};if(t==="clear")r.forEach(l);else if(i==="length"&&Qt(e))r.forEach((h,u)=>{(u==="length"||u>=n)&&l(h)});else switch(i!==void 0&&l(r.get(i)),t){case"add":Qt(e)?ws(i)&&l(r.get("length")):(l(r.get(te)),Qe(e)&&l(r.get(ss)));break;case"delete":Qt(e)||(l(r.get(te)),Qe(e)&&l(r.get(ss)));break;case"set":Qe(e)&&l(r.get(te));break}let c=h=>{h.options.onTrigger&&h.options.onTrigger({effect:h,target:e,key:i,type:t,newValue:n,oldValue:s,oldTarget:o}),h.options.scheduler?h.options.scheduler(h):h()};a.forEach(c)}var Cu=jr("__proto__,__v_isRef,__isVue"),Gr=new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(vs)),Pu=Jr(),Ou=Jr(!0),Vo=Tu();function Tu(){let e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...i){let n=N(this);for(let o=0,r=this.length;o<r;o++)ft(n,"get",o+"");let s=n[t](...i);return s===-1||s===!1?n[t](...i.map(N)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...i){ku();let n=N(this)[t].apply(this,i);return qr(),n}}),e}function Jr(e=!1,t=!1){return function(n,s,o){if(s==="__v_isReactive")return!e;if(s==="__v_isReadonly")return e;if(s==="__v_raw"&&o===(e?t?Uu:ea:t?Yu:ta).get(n))return n;let r=Qt(n);if(!e&&r&&Ui(Vo,s))return Reflect.get(Vo,s,o);let a=Reflect.get(n,s,o);return(vs(s)?Gr.has(s):Cu(s))||(e||ft(n,"get",s),t)?a:os(a)?!r||!ws(s)?a.value:a:Ki(a)?e?ia(a):Cs(a):a}}var Du=Eu();function Eu(e=!1){return function(i,n,s,o){let r=i[n];if(!e&&(s=N(s),r=N(r),!Qt(i)&&os(r)&&!os(s)))return r.value=s,!0;let a=Qt(i)&&ws(n)?Number(n)<i.length:Ui(i,n),l=Reflect.set(i,n,s,o);return i===N(o)&&(a?Kr(s,r)&&It(i,"set",n,s,r):It(i,"add",n,s)),l}}function Lu(e,t){let i=Ui(e,t),n=e[t],s=Reflect.deleteProperty(e,t);return s&&i&&It(e,"delete",t,void 0,n),s}function Ru(e,t){let i=Reflect.has(e,t);return(!vs(t)||!Gr.has(t))&&ft(e,"has",t),i}function Iu(e){return ft(e,"iterate",Qt(e)?"length":te),Reflect.ownKeys(e)}var Fu={get:Pu,set:Du,deleteProperty:Lu,has:Ru,ownKeys:Iu},zu={get:Ou,set(e,t){return console.warn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0},deleteProperty(e,t){return console.warn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}},Ms=e=>Ki(e)?Cs(e):e,ks=e=>Ki(e)?ia(e):e,As=e=>e,qi=e=>Reflect.getPrototypeOf(e);function Ei(e,t,i=!1,n=!1){e=e.__v_raw;let s=N(e),o=N(t);t!==o&&!i&&ft(s,"get",t),!i&&ft(s,"get",o);let{has:r}=qi(s),a=n?As:i?ks:Ms;if(r.call(s,t))return a(e.get(t));if(r.call(s,o))return a(e.get(o));e!==s&&e.get(t)}function Li(e,t=!1){let i=this.__v_raw,n=N(i),s=N(e);return e!==s&&!t&&ft(n,"has",e),!t&&ft(n,"has",s),e===s?i.has(e):i.has(e)||i.has(s)}function Ri(e,t=!1){return e=e.__v_raw,!t&&ft(N(e),"iterate",te),Reflect.get(e,"size",e)}function jo(e){e=N(e);let t=N(this);return qi(t).has.call(t,e)||(t.add(e),It(t,"add",e,e)),this}function $o(e,t){t=N(t);let i=N(this),{has:n,get:s}=qi(i),o=n.call(i,e);o?Qr(i,n,e):(e=N(e),o=n.call(i,e));let r=s.call(i,e);return i.set(e,t),o?Kr(t,r)&&It(i,"set",e,t,r):It(i,"add",e,t),this}function Yo(e){let t=N(this),{has:i,get:n}=qi(t),s=i.call(t,e);s?Qr(t,i,e):(e=N(e),s=i.call(t,e));let o=n?n.call(t,e):void 0,r=t.delete(e);return s&&It(t,"delete",e,void 0,o),r}function Uo(){let e=N(this),t=e.size!==0,i=Qe(e)?new Map(e):new Set(e),n=e.clear();return t&&It(e,"clear",void 0,void 0,i),n}function Ii(e,t){return function(n,s){let o=this,r=o.__v_raw,a=N(r),l=t?As:e?ks:Ms;return!e&&ft(a,"iterate",te),r.forEach((c,h)=>n.call(s,l(c),l(h),o))}}function Fi(e,t,i){return function(...n){let s=this.__v_raw,o=N(s),r=Qe(o),a=e==="entries"||e===Symbol.iterator&&r,l=e==="keys"&&r,c=s[e](...n),h=i?As:t?ks:Ms;return!t&&ft(o,"iterate",l?ss:te),{next(){let{value:u,done:d}=c.next();return d?{value:u,done:d}:{value:a?[h(u[0]),h(u[1])]:h(u),done:d}},[Symbol.iterator](){return this}}}}function Lt(e){return function(...t){{let i=t[0]?`on key "${t[0]}" `:"";console.warn(`${Ur(e)} operation ${i}failed: target is readonly.`,N(this))}return e==="delete"?!1:this}}function Bu(){let e={get(o){return Ei(this,o)},get size(){return Ri(this)},has:Li,add:jo,set:$o,delete:Yo,clear:Uo,forEach:Ii(!1,!1)},t={get(o){return Ei(this,o,!1,!0)},get size(){return Ri(this)},has:Li,add:jo,set:$o,delete:Yo,clear:Uo,forEach:Ii(!1,!0)},i={get(o){return Ei(this,o,!0)},get size(){return Ri(this,!0)},has(o){return Li.call(this,o,!0)},add:Lt("add"),set:Lt("set"),delete:Lt("delete"),clear:Lt("clear"),forEach:Ii(!0,!1)},n={get(o){return Ei(this,o,!0,!0)},get size(){return Ri(this,!0)},has(o){return Li.call(this,o,!0)},add:Lt("add"),set:Lt("set"),delete:Lt("delete"),clear:Lt("clear"),forEach:Ii(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(o=>{e[o]=Fi(o,!1,!1),i[o]=Fi(o,!0,!1),t[o]=Fi(o,!1,!0),n[o]=Fi(o,!0,!0)}),[e,i,t,n]}var[Nu,Hu,Wu,Vu]=Bu();function Zr(e,t){let i=t?e?Vu:Wu:e?Hu:Nu;return(n,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?n:Reflect.get(Ui(i,s)&&s in n?i:n,s,o)}var ju={get:Zr(!1,!1)},$u={get:Zr(!0,!1)};function Qr(e,t,i){let n=N(i);if(n!==i&&t.call(e,n)){let s=Yr(e);console.warn(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var ta=new WeakMap,Yu=new WeakMap,ea=new WeakMap,Uu=new WeakMap;function Ku(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Xu(e){return e.__v_skip||!Object.isExtensible(e)?0:Ku(Yr(e))}function Cs(e){return e&&e.__v_isReadonly?e:na(e,!1,Fu,ju,ta)}function ia(e){return na(e,!0,zu,$u,ea)}function na(e,t,i,n,s){if(!Ki(e))return console.warn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;let o=s.get(e);if(o)return o;let r=Xu(e);if(r===0)return e;let a=new Proxy(e,r===2?n:i);return s.set(e,a),a}function N(e){return e&&N(e.__v_raw)||e}function os(e){return!!(e&&e.__v_isRef===!0)}gt("nextTick",()=>_s);gt("dispatch",e=>Ze.bind(Ze,e));gt("watch",(e,{evaluateLater:t,cleanup:i})=>(n,s)=>{let o=t(n),a=Zo(()=>{let l;return o(c=>l=c),l},s);i(a)});gt("store",au);gt("data",e=>rr(e));gt("root",e=>ji(e));gt("refs",e=>(e._x_refs_proxy||(e._x_refs_proxy=ii(qu(e))),e._x_refs_proxy));function qu(e){let t=[];return Se(e,i=>{i._x_refs&&t.push(i._x_refs)}),t}var Wn={};function sa(e){return Wn[e]||(Wn[e]=0),++Wn[e]}function Gu(e,t){return Se(e,i=>{if(i._x_ids&&i._x_ids[t])return!0})}function Ju(e,t){e._x_ids||(e._x_ids={}),e._x_ids[t]||(e._x_ids[t]=sa(t))}gt("id",(e,{cleanup:t})=>(i,n=null)=>{let s=`${i}${n?`-${n}`:""}`;return Zu(e,s,t,()=>{let o=Gu(e,i),r=o?o._x_ids[i]:sa(i);return n?`${i}-${r}-${n}`:`${i}-${r}`})});Yi((e,t)=>{e._x_id&&(t._x_id=e._x_id)});function Zu(e,t,i,n){if(e._x_id||(e._x_id={}),e._x_id[t])return e._x_id[t];let s=n();return e._x_id[t]=s,i(()=>{delete e._x_id[t]}),s}gt("el",e=>e);oa("Focus","focus","focus");oa("Persist","persist","persist");function oa(e,t,i){gt(t,n=>lt(`You can't use [$${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${i}`,n))}U("modelable",(e,{expression:t},{effect:i,evaluateLater:n,cleanup:s})=>{let o=n(t),r=()=>{let h;return o(u=>h=u),h},a=n(`${t} = __placeholder`),l=h=>a(()=>{},{scope:{__placeholder:h}}),c=r();l(c),queueMicrotask(()=>{if(!e._x_model)return;e._x_removeModelListeners.default();let h=e._x_model.get,u=e._x_model.set,d=Nr({get(){return h()},set(f){u(f)}},{get(){return r()},set(f){l(f)}});s(d)})});U("teleport",(e,{modifiers:t,expression:i},{cleanup:n})=>{e.tagName.toLowerCase()!=="template"&<("x-teleport can only be used on a <template> tag",e);let s=Ko(i),o=e.content.cloneNode(!0).firstElementChild;e._x_teleport=o,o._x_teleportBack=e,e.setAttribute("data-teleport-template",!0),o.setAttribute("data-teleport-target",!0),e._x_forwardEvents&&e._x_forwardEvents.forEach(a=>{o.addEventListener(a,l=>{l.stopPropagation(),e.dispatchEvent(new l.constructor(l.type,l))})}),ei(o,{},e);let r=(a,l,c)=>{c.includes("prepend")?l.parentNode.insertBefore(a,l):c.includes("append")?l.parentNode.insertBefore(a,l.nextSibling):l.appendChild(a)};V(()=>{r(o,s,t),Ft(()=>{Mt(o)})()}),e._x_teleportPutBack=()=>{let a=Ko(i);V(()=>{r(e._x_teleport,a,t)})},n(()=>V(()=>{o.remove(),Me(o)}))});var Qu=document.createElement("div");function Ko(e){let t=Ft(()=>document.querySelector(e),()=>Qu)();return t||lt(`Cannot find x-teleport element for selector: "${e}"`),t}var ra=()=>{};ra.inline=(e,{modifiers:t},{cleanup:i})=>{t.includes("self")?e._x_ignoreSelf=!0:e._x_ignore=!0,i(()=>{t.includes("self")?delete e._x_ignoreSelf:delete e._x_ignore})};U("ignore",ra);U("effect",Ft((e,{expression:t},{effect:i})=>{i(et(e,t))}));function rs(e,t,i,n){let s=e,o=l=>n(l),r={},a=(l,c)=>h=>c(l,h);if(i.includes("dot")&&(t=td(t)),i.includes("camel")&&(t=ed(t)),i.includes("passive")&&(r.passive=!0),i.includes("capture")&&(r.capture=!0),i.includes("window")&&(s=window),i.includes("document")&&(s=document),i.includes("debounce")){let l=i[i.indexOf("debounce")+1]||"invalid-wait",c=Vi(l.split("ms")[0])?Number(l.split("ms")[0]):250;o=zr(o,c)}if(i.includes("throttle")){let l=i[i.indexOf("throttle")+1]||"invalid-wait",c=Vi(l.split("ms")[0])?Number(l.split("ms")[0]):250;o=Br(o,c)}return i.includes("prevent")&&(o=a(o,(l,c)=>{c.preventDefault(),l(c)})),i.includes("stop")&&(o=a(o,(l,c)=>{c.stopPropagation(),l(c)})),i.includes("once")&&(o=a(o,(l,c)=>{l(c),s.removeEventListener(t,o,r)})),(i.includes("away")||i.includes("outside"))&&(s=document,o=a(o,(l,c)=>{e.contains(c.target)||c.target.isConnected!==!1&&(e.offsetWidth<1&&e.offsetHeight<1||e._x_isShown!==!1&&l(c))})),i.includes("self")&&(o=a(o,(l,c)=>{c.target===e&&l(c)})),(nd(t)||aa(t))&&(o=a(o,(l,c)=>{sd(c,i)||l(c)})),s.addEventListener(t,o,r),()=>{s.removeEventListener(t,o,r)}}function td(e){return e.replace(/-/g,".")}function ed(e){return e.toLowerCase().replace(/-(\w)/g,(t,i)=>i.toUpperCase())}function Vi(e){return!Array.isArray(e)&&!isNaN(e)}function id(e){return[" ","_"].includes(e)?e:e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function nd(e){return["keydown","keyup"].includes(e)}function aa(e){return["contextmenu","click","mouse"].some(t=>e.includes(t))}function sd(e,t){let i=t.filter(o=>!["window","document","prevent","stop","once","capture","self","away","outside","passive"].includes(o));if(i.includes("debounce")){let o=i.indexOf("debounce");i.splice(o,Vi((i[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(i.includes("throttle")){let o=i.indexOf("throttle");i.splice(o,Vi((i[o+1]||"invalid-wait").split("ms")[0])?2:1)}if(i.length===0||i.length===1&&Xo(e.key).includes(i[0]))return!1;let s=["ctrl","shift","alt","meta","cmd","super"].filter(o=>i.includes(o));return i=i.filter(o=>!s.includes(o)),!(s.length>0&&s.filter(r=>((r==="cmd"||r==="super")&&(r="meta"),e[`${r}Key`])).length===s.length&&(aa(e.type)||Xo(e.key).includes(i[0])))}function Xo(e){if(!e)return[];e=id(e);let t={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return t[e]=e,Object.keys(t).map(i=>{if(t[i]===e)return i}).filter(i=>i)}U("model",(e,{modifiers:t,expression:i},{effect:n,cleanup:s})=>{let o=e;t.includes("parent")&&(o=e.parentNode);let r=et(o,i),a;typeof i=="string"?a=et(o,`${i} = __placeholder`):typeof i=="function"&&typeof i()=="string"?a=et(o,`${i()} = __placeholder`):a=()=>{};let l=()=>{let d;return r(f=>d=f),qo(d)?d.get():d},c=d=>{let f;r(g=>f=g),qo(f)?f.set(d):a(()=>{},{scope:{__placeholder:d}})};typeof i=="string"&&e.type==="radio"&&V(()=>{e.hasAttribute("name")||e.setAttribute("name",i)});var h=e.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(e.type)||t.includes("lazy")?"change":"input";let u=Rt?()=>{}:rs(e,h,t,d=>{c(Vn(e,t,d,l()))});if(t.includes("fill")&&([void 0,null,""].includes(l())||ys(e)&&Array.isArray(l())||e.tagName.toLowerCase()==="select"&&e.multiple)&&c(Vn(e,t,{target:e},l())),e._x_removeModelListeners||(e._x_removeModelListeners={}),e._x_removeModelListeners.default=u,s(()=>e._x_removeModelListeners.default()),e.form){let d=rs(e.form,"reset",[],f=>{_s(()=>e._x_model&&e._x_model.set(Vn(e,t,{target:e},l())))});s(()=>d())}e._x_model={get(){return l()},set(d){c(d)}},e._x_forceModelUpdate=d=>{d===void 0&&typeof i=="string"&&i.match(/\./)&&(d=""),window.fromModel=!0,V(()=>Er(e,"value",d)),delete window.fromModel},n(()=>{let d=l();t.includes("unintrusive")&&document.activeElement.isSameNode(e)||e._x_forceModelUpdate(d)})});function Vn(e,t,i,n){return V(()=>{if(i instanceof CustomEvent&&i.detail!==void 0)return i.detail!==null&&i.detail!==void 0?i.detail:i.target.value;if(ys(e))if(Array.isArray(n)){let s=null;return t.includes("number")?s=jn(i.target.value):t.includes("boolean")?s=Bi(i.target.value):s=i.target.value,i.target.checked?n.includes(s)?n:n.concat([s]):n.filter(o=>!od(o,s))}else return i.target.checked;else{if(e.tagName.toLowerCase()==="select"&&e.multiple)return t.includes("number")?Array.from(i.target.selectedOptions).map(s=>{let o=s.value||s.text;return jn(o)}):t.includes("boolean")?Array.from(i.target.selectedOptions).map(s=>{let o=s.value||s.text;return Bi(o)}):Array.from(i.target.selectedOptions).map(s=>s.value||s.text);{let s;return Fr(e)?i.target.checked?s=i.target.value:s=n:s=i.target.value,t.includes("number")?jn(s):t.includes("boolean")?Bi(s):t.includes("trim")?s.trim():s}}})}function jn(e){let t=e?parseFloat(e):null;return rd(t)?t:e}function od(e,t){return e==t}function rd(e){return!Array.isArray(e)&&!isNaN(e)}function qo(e){return e!==null&&typeof e=="object"&&typeof e.get=="function"&&typeof e.set=="function"}U("cloak",e=>queueMicrotask(()=>V(()=>e.removeAttribute(we("cloak")))));Ar(()=>`[${we("init")}]`);U("init",Ft((e,{expression:t},{evaluate:i})=>typeof t=="string"?!!t.trim()&&i(t,{},!1):i(t,{},!1)));U("text",(e,{expression:t},{effect:i,evaluateLater:n})=>{let s=n(t);i(()=>{s(o=>{V(()=>{e.textContent=o})})})});U("html",(e,{expression:t},{effect:i,evaluateLater:n})=>{let s=n(t);i(()=>{s(o=>{V(()=>{e.innerHTML=o,e._x_ignoreSelf=!0,Mt(e),delete e._x_ignoreSelf})})})});ps(mr(":",br(we("bind:"))));var la=(e,{value:t,modifiers:i,expression:n,original:s},{effect:o,cleanup:r})=>{if(!t){let l={};cu(l),et(e,n)(h=>{Wr(e,h,s)},{scope:l});return}if(t==="key")return ad(e,n);if(e._x_inlineBindings&&e._x_inlineBindings[t]&&e._x_inlineBindings[t].extract)return;let a=et(e,n);o(()=>a(l=>{l===void 0&&typeof n=="string"&&n.match(/\./)&&(l=""),V(()=>Er(e,t,l,i))})),r(()=>{e._x_undoAddedClasses&&e._x_undoAddedClasses(),e._x_undoAddedStyles&&e._x_undoAddedStyles()})};la.inline=(e,{value:t,modifiers:i,expression:n})=>{t&&(e._x_inlineBindings||(e._x_inlineBindings={}),e._x_inlineBindings[t]={expression:n,extract:!1})};U("bind",la);function ad(e,t){e._x_keyExpression=t}kr(()=>`[${we("data")}]`);U("data",(e,{expression:t},{cleanup:i})=>{if(ld(e))return;t=t===""?"{}":t;let n={};qn(n,e);let s={};uu(s,n);let o=Zt(e,t,{scope:s});(o===void 0||o===!0)&&(o={}),qn(o,e);let r=ye(o);ar(r);let a=ei(e,r);r.init&&Zt(e,r.init),i(()=>{r.destroy&&Zt(e,r.destroy),a()})});Yi((e,t)=>{e._x_dataStack&&(t._x_dataStack=e._x_dataStack,t.setAttribute("data-has-alpine-state",!0))});function ld(e){return Rt?is?!0:e.hasAttribute("data-has-alpine-state"):!1}U("show",(e,{modifiers:t,expression:i},{effect:n})=>{let s=et(e,i);e._x_doHide||(e._x_doHide=()=>{V(()=>{e.style.setProperty("display","none",t.includes("important")?"important":void 0)})}),e._x_doShow||(e._x_doShow=()=>{V(()=>{e.style.length===1&&e.style.display==="none"?e.removeAttribute("style"):e.style.removeProperty("display")})});let o=()=>{e._x_doHide(),e._x_isShown=!1},r=()=>{e._x_doShow(),e._x_isShown=!0},a=()=>setTimeout(r),l=ts(u=>u?r():o(),u=>{typeof e._x_toggleAndCascadeWithTransitions=="function"?e._x_toggleAndCascadeWithTransitions(e,u,r,o):u?a():o()}),c,h=!0;n(()=>s(u=>{!h&&u===c||(t.includes("immediate")&&(u?a():o()),l(u),c=u,h=!1)}))});U("for",(e,{expression:t},{effect:i,cleanup:n})=>{let s=hd(t),o=et(e,s.items),r=et(e,e._x_keyExpression||"index");e._x_prevKeys=[],e._x_lookup={},i(()=>cd(e,s,o,r)),n(()=>{Object.values(e._x_lookup).forEach(a=>V(()=>{Me(a),a.remove()})),delete e._x_prevKeys,delete e._x_lookup})});function cd(e,t,i,n){let s=r=>typeof r=="object"&&!Array.isArray(r),o=e;i(r=>{ud(r)&&r>=0&&(r=Array.from(Array(r).keys(),p=>p+1)),r===void 0&&(r=[]);let a=e._x_lookup,l=e._x_prevKeys,c=[],h=[];if(s(r))r=Object.entries(r).map(([p,b])=>{let _=Go(t,b,p,r);n(y=>{h.includes(y)&<("Duplicate key on x-for",e),h.push(y)},{scope:{index:p,..._}}),c.push(_)});else for(let p=0;p<r.length;p++){let b=Go(t,r[p],p,r);n(_=>{h.includes(_)&<("Duplicate key on x-for",e),h.push(_)},{scope:{index:p,...b}}),c.push(b)}let u=[],d=[],f=[],g=[];for(let p=0;p<l.length;p++){let b=l[p];h.indexOf(b)===-1&&f.push(b)}l=l.filter(p=>!f.includes(p));let m="template";for(let p=0;p<h.length;p++){let b=h[p],_=l.indexOf(b);if(_===-1)l.splice(p,0,b),u.push([m,p]);else if(_!==p){let y=l.splice(p,1)[0],v=l.splice(_-1,1)[0];l.splice(p,0,v),l.splice(_,0,y),d.push([y,v])}else g.push(b);m=b}for(let p=0;p<f.length;p++){let b=f[p];b in a&&(V(()=>{Me(a[b]),a[b].remove()}),delete a[b])}for(let p=0;p<d.length;p++){let[b,_]=d[p],y=a[b],v=a[_],x=document.createElement("div");V(()=>{v||lt('x-for ":key" is undefined or invalid',o,_,a),v.after(x),y.after(v),v._x_currentIfEl&&v.after(v._x_currentIfEl),x.before(y),y._x_currentIfEl&&y.after(y._x_currentIfEl),x.remove()}),v._x_refreshXForScope(c[h.indexOf(_)])}for(let p=0;p<u.length;p++){let[b,_]=u[p],y=b==="template"?o:a[b];y._x_currentIfEl&&(y=y._x_currentIfEl);let v=c[_],x=h[_],w=document.importNode(o.content,!0).firstElementChild,M=ye(v);ei(w,M,o),w._x_refreshXForScope=k=>{Object.entries(k).forEach(([A,P])=>{M[A]=P})},V(()=>{y.after(w),Ft(()=>Mt(w))()}),typeof x=="object"&<("x-for key cannot be an object, it must be a string or an integer",o),a[x]=w}for(let p=0;p<g.length;p++)a[g[p]]._x_refreshXForScope(c[h.indexOf(g[p])]);o._x_prevKeys=h})}function hd(e){let t=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,i=/^\s*\(|\)\s*$/g,n=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,s=e.match(n);if(!s)return;let o={};o.items=s[2].trim();let r=s[1].replace(i,"").trim(),a=r.match(t);return a?(o.item=r.replace(t,"").trim(),o.index=a[1].trim(),a[2]&&(o.collection=a[2].trim())):o.item=r,o}function Go(e,t,i,n){let s={};return/^\[.*\]$/.test(e.item)&&Array.isArray(t)?e.item.replace("[","").replace("]","").split(",").map(r=>r.trim()).forEach((r,a)=>{s[r]=t[a]}):/^\{.*\}$/.test(e.item)&&!Array.isArray(t)&&typeof t=="object"?e.item.replace("{","").replace("}","").split(",").map(r=>r.trim()).forEach(r=>{s[r]=t[r]}):s[e.item]=t,e.index&&(s[e.index]=i),e.collection&&(s[e.collection]=n),s}function ud(e){return!Array.isArray(e)&&!isNaN(e)}function ca(){}ca.inline=(e,{expression:t},{cleanup:i})=>{let n=ji(e);n._x_refs||(n._x_refs={}),n._x_refs[t]=e,i(()=>delete n._x_refs[t])};U("ref",ca);U("if",(e,{expression:t},{effect:i,cleanup:n})=>{e.tagName.toLowerCase()!=="template"&<("x-if can only be used on a <template> tag",e);let s=et(e,t),o=()=>{if(e._x_currentIfEl)return e._x_currentIfEl;let a=e.content.cloneNode(!0).firstElementChild;return ei(a,{},e),V(()=>{e.after(a),Ft(()=>Mt(a))()}),e._x_currentIfEl=a,e._x_undoIf=()=>{V(()=>{Me(a),a.remove()}),delete e._x_currentIfEl},a},r=()=>{e._x_undoIf&&(e._x_undoIf(),delete e._x_undoIf)};i(()=>s(a=>{a?o():r()})),n(()=>e._x_undoIf&&e._x_undoIf())});U("id",(e,{expression:t},{evaluate:i})=>{i(t).forEach(s=>Ju(e,s))});Yi((e,t)=>{e._x_ids&&(t._x_ids=e._x_ids)});ps(mr("@",br(we("on:"))));U("on",Ft((e,{value:t,modifiers:i,expression:n},{cleanup:s})=>{let o=n?et(e,n):()=>{};e.tagName.toLowerCase()==="template"&&(e._x_forwardEvents||(e._x_forwardEvents=[]),e._x_forwardEvents.includes(t)||e._x_forwardEvents.push(t));let r=rs(e,t,i,a=>{o(()=>{},{scope:{$event:a},params:[a]})});s(()=>r())}));Gi("Collapse","collapse","collapse");Gi("Intersect","intersect","intersect");Gi("Focus","trap","focus");Gi("Mask","mask","mask");function Gi(e,t,i){U(t,n=>lt(`You can't use [x-${t}] without first installing the "${e}" plugin here: https://alpinejs.dev/plugins/${i}`,n))}ni.setEvaluator(dr);ni.setReactivityEngine({reactive:Cs,effect:vu,release:wu,raw:N});var dd=ni,Ji=dd;function fd(e){e.directive("collapse",t),t.inline=(i,{modifiers:n})=>{n.includes("min")&&(i._x_doShow=()=>{},i._x_doHide=()=>{})};function t(i,{modifiers:n}){let s=ha(n,"duration",250)/1e3,o=ha(n,"min",0),r=!n.includes("min");i._x_isShown||(i.style.height=`${o}px`),!i._x_isShown&&r&&(i.hidden=!0),i._x_isShown||(i.style.overflow="hidden");let a=(c,h)=>{let u=e.setStyles(c,h);return h.height?()=>{}:u},l={transitionProperty:"height",transitionDuration:`${s}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};i._x_transition={in(c=()=>{},h=()=>{}){r&&(i.hidden=!1),r&&(i.style.display=null);let u=i.getBoundingClientRect().height;i.style.height="auto";let d=i.getBoundingClientRect().height;u===d&&(u=o),e.transition(i,e.setStyles,{during:l,start:{height:u+"px"},end:{height:d+"px"}},()=>i._x_isShown=!0,()=>{Math.abs(i.getBoundingClientRect().height-d)<1&&(i.style.overflow=null)})},out(c=()=>{},h=()=>{}){let u=i.getBoundingClientRect().height;e.transition(i,a,{during:l,start:{height:u+"px"},end:{height:o+"px"}},()=>i.style.overflow="hidden",()=>{i._x_isShown=!1,i.style.height==`${o}px`&&r&&(i.style.display="none",i.hidden=!0)})}}}}function ha(e,t,i){if(e.indexOf(t)===-1)return i;let n=e[e.indexOf(t)+1];if(!n)return i;if(t==="duration"){let s=n.match(/([0-9]+)ms/);if(s)return s[1]}if(t==="min"){let s=n.match(/([0-9]+)px/);if(s)return s[1]}return n}var ua=fd;function gd(e){if(e.dataset.saveStateInBrowser==="true"){da(e);return}e.dataset.open==="true"?e.open=!0:e.open=!1}function da(e){let t=localStorage.getItem(`collapsible-open-${e.id}`);if(t!==null){e.open=t==="true";return}e.dataset.open==="true"?(e.open=!0,localStorage.setItem(`collapsible-open-${e.id}`,"true")):(e.open=!1,localStorage.setItem(`collapsible-open-${e.id}`,"false"))}function pd(e){e.dataset.saveStateInBrowser==="true"&&(e.addEventListener("toggle",()=>{localStorage.setItem(`collapsible-open-${e.id}`,e.open.toString())}),window.addEventListener("storage",({key:t})=>{t===`collapsible-open-${e.id}`&&da(e)}))}function md(e,t){e.action==="toggle"?t.open=!t.open:e.action==="open"?t.open=!0:e.action==="close"?t.open=!1:console.error(`Unknown action "${e.action}" for collapsible with id "${t.id}"`)}var bd={mounted(){gd(this.el),pd(this.el),this.handleEvent(`${this.el.id}-collapsible`,e=>{md(e,this.el)})}},fa=bd;var _d={mounted(){this.handleOpen=()=>{this.el.showModal(),this.el.classList.remove("hidden"),this.el.classList.add("flex")},this.handleClose=()=>{this.el.close(),this.el.classList.remove("flex"),this.el.classList.add("hidden"),this.el.hasAttribute("data-send-close-event")&&this.pushEvent("fullscreen-closed",{id:this.el.id})},this.el.addEventListener("open",this.handleOpen),this.el.addEventListener("close",this.handleClose),this.handleEvent(`${this.el.id}-open`,this.handleOpen),this.handleEvent(`${this.el.id}-close`,this.handleClose)}},ga=_d;var xd={mounted(){this.handleClick=()=>{switch(localStorage.theme){case"light":document.documentElement.classList.add("dark"),localStorage.theme="dark";break;case"dark":document.documentElement.classList.remove("dark"),localStorage.theme="light";break;default:break}},this.el.addEventListener("click",this.handleClick)},destroyed(){this.el.removeEventListener("click",this.handleClick)}},pa=xd;function Ps(e,t){let i=e.getBoundingClientRect(),n=t.getBoundingClientRect();switch(e.style.top="",e.style.left="",e.style.right="",e.style.bottom="",e.style.wordBreak="",t.dataset.position){case"top":e.style.top=`${n.top-i.height}px`,e.style.left=`${n.left}px`;break;case"bottom":e.style.top=`${n.bottom}px`,e.style.left=`${n.left}px`;break;case"left":e.style.left=`${n.left-i.width}px`,e.style.top=`${n.top+(n.height-i.height)/2}px`;break;case"right":e.style.left=`${n.right}px`,e.style.top=`${n.top+(n.height-i.height)/2}px`;break;case"top-center":e.style.top=`${n.top-i.height-5}px`,e.style.left=`${n.left+n.width/2-i.width/2}px`;break}["top","bottom","top-center"].includes(t.dataset.position)&&(e.clientWidth+20>window.innerWidth?(e.style.left="10px",e.style.right="10px",e.style.wordBreak="break-all"):n.left+e.clientWidth>window.innerWidth&&(e.style.right="10px",e.style.left="auto")),["left","right"].includes(t.dataset.position)&&n.top+i.height>window.innerHeight&&(e.style.top=`${window.innerHeight-i.height}px`),e.style.zIndex=100}var yd={mounted(){let e=document.querySelector("#tooltip");e.style.pointerEvents="none",this.handleMouseEnter=()=>{e.style.display="block",e.innerHTML=this.el.dataset.tooltip,Ps(e,this.el)},this.handleMouseLeave=()=>{e.style.display="none"},this.el.addEventListener("mouseenter",this.handleMouseEnter),this.el.addEventListener("mouseleave",this.handleMouseLeave)},destroyed(){document.querySelector("#tooltip").style.display="none",this.el.removeEventListener("mouseenter",this.handleMouseEnter),this.el.removeEventListener("mouseleave",this.handleMouseLeave)}},ma=yd;var vd={mounted(){let e=document.querySelector("#highlight-switch"),t={};this.pushHighlight=i=>{if(e.checked){let n=i.target.attributes;t={"search-attribute":n["phx-value-search-attribute"].value,"search-value":n["phx-value-search-value"].value,type:n["phx-value-type"].value,module:n["phx-value-module"].value,id:n["phx-value-id"].value},this.pushEvent("highlight",t)}},e&&(this.el.addEventListener("mouseenter",this.pushHighlight),this.el.addEventListener("mouseleave",this.pushHighlight))},destroyed(){this.el.removeEventListener("mouseenter",this.pushHighlight),this.el.removeEventListener("mouseleave",this.pushHighlight)}},ba=vd;var wd={mounted(){let e=this.el.id.replace("-live-dropdown-container","");this.contentId=`${e}-content`;function t(n){return n.classList.contains("hidden")}function i(n,s){return!s.contains(n.target)}this.handleClick=n=>{let s=document.getElementById(this.contentId);s&&!t(s)&&i(n,s)&&this.pushEventTo(`#${this.el.id}`,"close",{})},document.addEventListener("click",this.handleClick)},destroyed(){document.removeEventListener("click",this.handleClick)}},_a=wd;var Sd={mounted(){let e=5e3,t=e+500;setTimeout(()=>{this.el.classList.add("max-sm:animate-fade-out-mobile"),this.el.classList.add("sm:animate-fade-out")},e),this.timeOutId=setTimeout(()=>{this.pushEvent("lv:clear-flash")},t)},destroyed(){clearTimeout(this.timeOutId)}},xa=Sd;function Md(e){return e<1e3?e+" ms":(e/1e3).toFixed(2)+" s"}var kd={mounted(){let e=Date.now(),t=e,i=!1;this.intervalId=setInterval(()=>{t=Date.now()-e,this.el.textContent=Md(t)},16),this.handleEvent("stop-timer",()=>{i||(clearInterval(this.intervalId),this.el.closest("details").open=!1,i=!0)})},destroyed(){clearInterval(this.intervalId)}},ya=kd;function Ad(e){let t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy")}catch(i){console.error("Fallback: unable to copy",i)}document.body.removeChild(t)}var Cd={mounted(){let e=this.el.closest('[phx-hook="Tooltip"]'),t=document.getElementById("tooltip");this.el.addEventListener("click",()=>{window.location!==window.parent.location?Ad(this.el.dataset.value):navigator.clipboard.writeText(this.el.dataset.value),t.innerHTML=this.el.dataset.info,Ps(t,e)})}},va=Cd;function ne(e,t,i=!1){let n=CSS.highlights.get(e);if(n&&!i){let s=n.values().filter(({collapsed:o})=>!o);t=[...t,...s]}n=new Highlight(...t),CSS.highlights.set(e,n)}function si(e,t){let i="",n=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(;s.nextNode();){let a=s.currentNode;if(a.parentElement.dataset.text_item==="true"){let l=i.length;i+=a.nodeValue;let c=i.length;n.push({node:a,start:l,end:c})}}let o=new RegExp(RegExp.escape(t),"gi"),r=[];for(let a of i.matchAll(o)){let l=a.index,c=l+t.length;for(let{node:h,start:u,end:d}of n){if(d<=l)continue;if(u>=c)break;let f=h.parentElement.closest("details");for(;f;)f.dataset.open=!0,f.open=!0,f=f.parentElement.closest("details");let g=document.createRange();g.setStart(h,Math.max(0,l-u)),g.setEnd(h,Math.min(h.nodeValue.length,c-u)),r.push(g)}}return r}var Pd={mounted(){let e=this.el.dataset.search_phrase;if(e===void 0||e==="")return;let t=si(this.el,e);ne("traces-search-highlight",t)},updated(){let e=this.el.dataset.search_phrase;if(e===void 0||e==="")return;let t=si(this.el,e);ne("traces-search-highlight",t)}},wa=Pd;function Od(e,t){let i=[];for(let n of e.textContent.matchAll(t)){let s=new Range;s.setStart(e.firstChild,n.index),s.setEnd(e.firstChild,n.index+n[0].length),i.push(s)}return i}function Ma(e,t=150){return e.length>t?e.slice(0,t-3)+"...":e}function Td(e,t){let i=e.textContent.match(new RegExp(RegExp.escape(t),"i")),n=e.textContent;i&&i.index>15&&(n="..."+n.slice(i.index-12)),e.textContent=Ma(n)}function Sa(e,t){if(e===void 0||e===""){t.textContent=Ma(t.textContent);return}Td(t,e);let i=new RegExp(RegExp.escape(e),"gi"),n=Od(t,i);ne("traces-search-highlight",n)}var Dd={mounted(){Sa(this.el.dataset.search_phrase,this.el)},updated(){Sa(this.el.dataset.search_phrase,this.el)}},ka=Dd;function Aa(){let e=[],t=document.getElementById("assigns-display-fullscreen-container");[document.getElementById("assigns-display-container"),t].forEach(n=>{if(!n)return;let s=n.dataset.search_phrase;if(s&&s!==""){let o=si(n,s);e.push(...o)}}),ne("assigns-search-highlight",e,!0)}var Ed={mounted(){Aa()},updated(){Aa()}},Ca=Ed;var Ld={mounted(){this.el.hasAttribute("data-pulse")&&(this.el.removeAttribute("data-pulse"),this.el.classList.add("animate-diff-pulse"),this.timeout=setTimeout(()=>{this.el.classList.remove("animate-diff-pulse")},500))},updated(){this.el.hasAttribute("data-pulse")&&(clearTimeout(this.timeout),this.el.removeAttribute("data-pulse"),this.el.classList.remove("animate-diff-pulse"),setTimeout(()=>this.el.classList.add("animate-diff-pulse")),this.timeout=setTimeout(()=>{this.el.classList.remove("animate-diff-pulse")},500))},destroyed(){clearTimeout(this.timeout)}},Pa=Ld;function ai(e){return e+.5|0}var zt=(e,t,i)=>Math.max(Math.min(e,i),t);function oi(e){return zt(ai(e*2.55),0,255)}function Bt(e){return zt(ai(e*255),0,255)}function kt(e){return zt(ai(e/2.55)/100,0,1)}function Oa(e){return zt(ai(e*100),0,100)}var ct={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},Ts=[..."0123456789ABCDEF"],Rd=e=>Ts[e&15],Id=e=>Ts[(e&240)>>4]+Ts[e&15],Zi=e=>(e&240)>>4===(e&15),Fd=e=>Zi(e.r)&&Zi(e.g)&&Zi(e.b)&&Zi(e.a);function zd(e){var t=e.length,i;return e[0]==="#"&&(t===4||t===5?i={r:255&ct[e[1]]*17,g:255&ct[e[2]]*17,b:255&ct[e[3]]*17,a:t===5?ct[e[4]]*17:255}:(t===7||t===9)&&(i={r:ct[e[1]]<<4|ct[e[2]],g:ct[e[3]]<<4|ct[e[4]],b:ct[e[5]]<<4|ct[e[6]],a:t===9?ct[e[7]]<<4|ct[e[8]]:255})),i}var Bd=(e,t)=>e<255?t(e):"";function Nd(e){var t=Fd(e)?Rd:Id;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Bd(e.a,t):void 0}var Hd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function La(e,t,i){let n=t*Math.min(i,1-i),s=(o,r=(o+e/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Wd(e,t,i){let n=(s,o=(s+e/60)%6)=>i-i*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Vd(e,t,i){let n=La(e,1,.5),s;for(t+i>1&&(s=1/(t+i),t*=s,i*=s),s=0;s<3;s++)n[s]*=1-t-i,n[s]+=t;return n}function jd(e,t,i,n,s){return e===s?(t-i)/n+(t<i?6:0):t===s?(i-e)/n+2:(e-t)/n+4}function Ds(e){let i=e.r/255,n=e.g/255,s=e.b/255,o=Math.max(i,n,s),r=Math.min(i,n,s),a=(o+r)/2,l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=jd(i,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Es(e,t,i,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,n)).map(Bt)}function Ls(e,t,i){return Es(La,e,t,i)}function $d(e,t,i){return Es(Vd,e,t,i)}function Yd(e,t,i){return Es(Wd,e,t,i)}function Ra(e){return(e%360+360)%360}function Ud(e){let t=Hd.exec(e),i=255,n;if(!t)return;t[5]!==n&&(i=t[6]?oi(+t[5]):Bt(+t[5]));let s=Ra(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=$d(s,o,r):t[1]==="hsv"?n=Yd(s,o,r):n=Ls(s,o,r),{r:n[0],g:n[1],b:n[2],a:i}}function Kd(e,t){var i=Ds(e);i[0]=Ra(i[0]+t),i=Ls(i),e.r=i[0],e.g=i[1],e.b=i[2]}function Xd(e){if(!e)return;let t=Ds(e),i=t[0],n=Oa(t[1]),s=Oa(t[2]);return e.a<255?`hsla(${i}, ${n}%, ${s}%, ${kt(e.a)})`:`hsl(${i}, ${n}%, ${s}%)`}var Ta={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"},Da={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 qd(){let e={},t=Object.keys(Da),i=Object.keys(Ta),n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,Ta[o]);o=parseInt(Da[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}var Qi;function Gd(e){Qi||(Qi=qd(),Qi.transparent=[0,0,0,0]);let t=Qi[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var Jd=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Zd(e){let t=Jd.exec(e),i=255,n,s,o;if(t){if(t[7]!==n){let r=+t[7];i=t[8]?oi(r):zt(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?oi(n):zt(n,0,255)),s=255&(t[4]?oi(s):zt(s,0,255)),o=255&(t[6]?oi(o):zt(o,0,255)),{r:n,g:s,b:o,a:i}}}function Qd(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${kt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Os=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,ke=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function tf(e,t,i){let n=ke(kt(e.r)),s=ke(kt(e.g)),o=ke(kt(e.b));return{r:Bt(Os(n+i*(ke(kt(t.r))-n))),g:Bt(Os(s+i*(ke(kt(t.g))-s))),b:Bt(Os(o+i*(ke(kt(t.b))-o))),a:e.a+i*(t.a-e.a)}}function tn(e,t,i){if(e){let n=Ds(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*i,t===0?360:1)),n=Ls(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function Ia(e,t){return e&&Object.assign(t||{},e)}function Ea(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Bt(e[3]))):(t=Ia(e,{r:0,g:0,b:0,a:1}),t.a=Bt(t.a)),t}function ef(e){return e.charAt(0)==="r"?Zd(e):Ud(e)}var ri=class e{constructor(t){if(t instanceof e)return t;let i=typeof t,n;i==="object"?n=Ea(t):i==="string"&&(n=zd(t)||Gd(t)||ef(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Ia(this._rgb);return t&&(t.a=kt(t.a)),t}set rgb(t){this._rgb=Ea(t)}rgbString(){return this._valid?Qd(this._rgb):void 0}hexString(){return this._valid?Nd(this._rgb):void 0}hslString(){return this._valid?Xd(this._rgb):void 0}mix(t,i){if(t){let n=this.rgb,s=t.rgb,o,r=i===o?.5:i,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,i){return t&&(this._rgb=tf(this._rgb,t._rgb,i)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=Bt(t),this}clearer(t){let i=this._rgb;return i.a*=1-t,this}greyscale(){let t=this._rgb,i=ai(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=i,this}opaquer(t){let i=this._rgb;return i.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return tn(this._rgb,2,t),this}darken(t){return tn(this._rgb,2,-t),this}saturate(t){return tn(this._rgb,1,t),this}desaturate(t){return tn(this._rgb,1,-t),this}rotate(t){return Kd(this._rgb,t),this}};function xt(){}var Ua=(()=>{let e=0;return()=>e++})();function T(e){return e==null}function z(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function D(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function j(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function it(e,t){return j(e)?e:t}function C(e,t){return typeof e>"u"?t:e}var Ka=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,zs=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function F(e,t,i){if(e&&typeof e.call=="function")return e.apply(i,t)}function R(e,t,i,n){let s,o,r;if(z(e))if(o=e.length,n)for(s=o-1;s>=0;s--)t.call(i,e[s],s);else for(s=0;s<o;s++)t.call(i,e[s],s);else if(D(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(i,e[r[s]],r[s])}function hi(e,t){let i,n,s,o;if(!e||!t||e.length!==t.length)return!1;for(i=0,n=e.length;i<n;++i)if(s=e[i],o=t[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function on(e){if(z(e))return e.map(on);if(D(e)){let t=Object.create(null),i=Object.keys(e),n=i.length,s=0;for(;s<n;++s)t[i[s]]=on(e[i[s]]);return t}return e}function Xa(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function nf(e,t,i,n){if(!Xa(e))return;let s=t[e],o=i[e];D(s)&&D(o)?Ce(s,o,n):t[e]=on(o)}function Ce(e,t,i){let n=z(t)?t:[t],s=n.length;if(!D(e))return e;i=i||{};let o=i.merger||nf,r;for(let a=0;a<s;++a){if(r=n[a],!D(r))continue;let l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],e,r,i)}return e}function Oe(e,t){return Ce(e,t,{merger:sf})}function sf(e,t,i){if(!Xa(e))return;let n=t[e],s=i[e];D(n)&&D(s)?Oe(n,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=on(s))}var Fa={"":e=>e,x:e=>e.x,y:e=>e.y};function of(e){let t=e.split("."),i=[],n="";for(let s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}function rf(e){let t=of(e);return i=>{for(let n of t){if(n==="")break;i=i&&i[n]}return i}}function Pt(e,t){return(Fa[t]||(Fa[t]=rf(t)))(e)}function cn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Te=e=>typeof e<"u",At=e=>typeof e=="function",Bs=(e,t)=>{if(e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0};function qa(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}var L=Math.PI,B=2*L,af=B+L,rn=Number.POSITIVE_INFINITY,lf=L/180,$=L/2,se=L/4,za=L*2/3,Ct=Math.log10,pt=Math.sign;function De(e,t,i){return Math.abs(e-t)<i}function Ns(e){let t=Math.round(e);e=De(e,t,e/1e3)?t:e;let i=Math.pow(10,Math.floor(Ct(e))),n=e/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Ga(e){let t=[],i=Math.sqrt(e),n;for(n=1;n<i;n++)e%n===0&&(t.push(n),t.push(e/n));return i===(i|0)&&t.push(i),t.sort((s,o)=>s-o).pop(),t}function cf(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ae(e){return!cf(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Ja(e,t){let i=Math.round(e);return i-t<=e&&i+t>=e}function Hs(e,t,i){let n,s,o;for(n=0,s=e.length;n<s;n++)o=e[n][i],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ht(e){return e*(L/180)}function hn(e){return e*(180/L)}function Ws(e){if(!j(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function Vs(e,t){let i=t.x-e.x,n=t.y-e.y,s=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*L&&(o+=B),{angle:o,distance:s}}function an(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function hf(e,t){return(e-t+af)%B-L}function G(e){return(e%B+B)%B}function Ee(e,t,i,n){let s=G(e),o=G(t),r=G(i),a=G(o-s),l=G(r-s),c=G(s-o),h=G(s-r);return s===o||s===r||n&&o===r||a>l&&c<h}function X(e,t,i){return Math.max(t,Math.min(i,e))}function Za(e){return X(e,-32768,32767)}function yt(e,t,i,n=1e-6){return e>=Math.min(t,i)-n&&e<=Math.max(t,i)+n}function un(e,t,i){i=i||(r=>e[r]<t);let n=e.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,i(o)?s=o:n=o;return{lo:s,hi:n}}var bt=(e,t,i,n)=>un(e,i,n?s=>{let o=e[s][t];return o<i||o===i&&e[s+1][t]===i}:s=>e[s][t]<i),Qa=(e,t,i)=>un(e,i,n=>e[n][t]>=i);function tl(e,t,i){let n=0,s=e.length;for(;n<s&&e[n]<t;)n++;for(;s>n&&e[s-1]>i;)s--;return n>0||s<e.length?e.slice(n,s):e}var el=["push","pop","shift","splice","unshift"];function il(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),el.forEach(i=>{let n="_onData"+cn(i),s=e[i];Object.defineProperty(e,i,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function js(e,t){let i=e._chartjs;if(!i)return;let n=i.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(el.forEach(o=>{delete e[o]}),delete e._chartjs)}function $s(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var Ys=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function Us(e,t){let i=[],n=!1;return function(...s){i=s,n||(n=!0,Ys.call(window,()=>{n=!1,e.apply(t,i)}))}}function nl(e,t){let i;return function(...n){return t?(clearTimeout(i),i=setTimeout(e,t,n)):e.apply(this,n),t}}var dn=e=>e==="start"?"left":e==="end"?"right":"center",J=(e,t,i)=>e==="start"?t:e==="end"?i:(t+i)/2,sl=(e,t,i,n)=>e===(n?"left":"right")?i:e==="center"?(t+i)/2:t;function Ks(e,t,i){let n=t.length,s=0,o=n;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,h=r.axis,{min:u,max:d,minDefined:f,maxDefined:g}=r.getUserBounds();if(f){if(s=Math.min(bt(l,h,u).lo,i?n:bt(t,h,r.getPixelForValue(u)).lo),c){let m=l.slice(0,s+1).reverse().findIndex(p=>!T(p[a.axis]));s-=Math.max(0,m)}s=X(s,0,n-1)}if(g){let m=Math.max(bt(l,r.axis,d,!0).hi+1,i?0:bt(t,h,r.getPixelForValue(d),!0).hi+1);if(c){let p=l.slice(m-1).findIndex(b=>!T(b[a.axis]));m+=Math.max(0,p)}o=X(m,s,n)-s}else o=n-s}return{start:s,count:o}}function Xs(e){let{xScale:t,yScale:i,_scaleRanges:n}=e,s={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};if(!n)return e._scaleRanges=s,!0;let o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}var en=e=>e===0||e===1,Ba=(e,t,i)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*B/i)),Na=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*B/i)+1,Ae={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*$)+1,easeOutSine:e=>Math.sin(e*$),easeInOutSine:e=>-.5*(Math.cos(L*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=>en(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=>en(e)?e:Ba(e,.075,.3),easeOutElastic:e=>en(e)?e:Na(e,.075,.3),easeInOutElastic(e){return en(e)?e:e<.5?.5*Ba(e*2,.1125,.45):.5+.5*Na(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-Ae.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?Ae.easeInBounce(e*2)*.5:Ae.easeOutBounce(e*2-1)*.5+.5};function qs(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Gs(e){return qs(e)?e:new ri(e)}function Rs(e){return qs(e)?e:new ri(e).saturate(.5).darken(.1).hexString()}var uf=["x","y","borderWidth","radius","tension"],df=["color","borderColor","backgroundColor"];function ff(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:df},numbers:{type:"number",properties:uf}}),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 gf(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Ha=new Map;function pf(e,t){t=t||{};let i=e+JSON.stringify(t),n=Ha.get(i);return n||(n=new Intl.NumberFormat(e,t),Ha.set(i,n)),n}function Le(e,t,i){return pf(t,i).format(e)}var ol={values(e){return z(e)?e:""+e},numeric(e,t,i){if(e===0)return"0";let n=this.chart.options.locale,s,o=e;if(i.length>1){let c=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=mf(e,i)}let r=Ct(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Le(e,n,l)},logarithmic(e,t,i){if(e===0)return"0";let n=i[t].significand||e/Math.pow(10,Math.floor(Ct(e)));return[1,2,3,5,10,15].includes(n)||t>.8*i.length?ol.numeric.call(this,e,t,i):""}};function mf(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}var ui={formatters:ol};function bf(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,i)=>i.lineWidth,tickColor:(t,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:ui.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"})}var Wt=Object.create(null),fn=Object.create(null);function li(e,t){if(!t)return e;let i=t.split(".");for(let n=0,s=i.length;n<s;++n){let o=i[n];e=e[o]||(e[o]=Object.create(null))}return e}function Is(e,t,i){return typeof t=="string"?Ce(li(e,t),i):Ce(li(e,""),t)}var Fs=class{constructor(t,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=n=>n.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=(n,s)=>Rs(s.backgroundColor),this.hoverBorderColor=(n,s)=>Rs(s.borderColor),this.hoverColor=(n,s)=>Rs(s.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(i)}set(t,i){return Is(this,t,i)}get(t){return li(this,t)}describe(t,i){return Is(fn,t,i)}override(t,i){return Is(Wt,t,i)}route(t,i,n,s){let o=li(this,t),r=li(this,n),a="_"+i;Object.defineProperties(o,{[a]:{value:o[i],writable:!0},[i]:{enumerable:!0,get(){let l=this[a],c=r[s];return D(l)?Object.assign({},c,l):C(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(i=>i(this))}},H=new Fs({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ff,gf,bf]);function _f(e){return!e||T(e.size)||T(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ci(e,t,i,n,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,i.push(s)),o>n&&(n=o),n}function rl(e,t,i,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),e.save(),e.font=t;let r=0,a=i.length,l,c,h,u,d;for(l=0;l<a;l++)if(u=i[l],u!=null&&!z(u))r=ci(e,s,o,r,u);else if(z(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!z(d)&&(r=ci(e,s,o,r,d));e.restore();let f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function Vt(e,t,i){let n=e.currentDevicePixelRatio,s=i!==0?Math.max(i/2,.5):0;return Math.round((t-s)*n)/n+s}function Js(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function gn(e,t,i,n){Zs(e,t,i,n,null)}function Zs(e,t,i,n,s){let o,r,a,l,c,h,u,d,f=t.pointStyle,g=t.rotation,m=t.radius,p=(g||0)*lf;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(i,n),e.rotate(p),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),f){default:s?e.ellipse(i,n,s/2,m,0,0,B):e.arc(i,n,m,0,B),e.closePath();break;case"triangle":h=s?s/2:m,e.moveTo(i+Math.sin(p)*h,n-Math.cos(p)*m),p+=za,e.lineTo(i+Math.sin(p)*h,n-Math.cos(p)*m),p+=za,e.lineTo(i+Math.sin(p)*h,n-Math.cos(p)*m),e.closePath();break;case"rectRounded":c=m*.516,l=m-c,r=Math.cos(p+se)*l,u=Math.cos(p+se)*(s?s/2-c:l),a=Math.sin(p+se)*l,d=Math.sin(p+se)*(s?s/2-c:l),e.arc(i-u,n-a,c,p-L,p-$),e.arc(i+d,n-r,c,p-$,p),e.arc(i+u,n+a,c,p,p+$),e.arc(i-d,n+r,c,p+$,p+L),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,h=s?s/2:l,e.rect(i-h,n-l,2*h,2*l);break}p+=se;case"rectRot":u=Math.cos(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),e.moveTo(i-u,n-a),e.lineTo(i+d,n-r),e.lineTo(i+u,n+a),e.lineTo(i-d,n+r),e.closePath();break;case"crossRot":p+=se;case"cross":u=Math.cos(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+d,n-r),e.lineTo(i-d,n+r);break;case"star":u=Math.cos(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+d,n-r),e.lineTo(i-d,n+r),p+=se,u=Math.cos(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+d,n-r),e.lineTo(i-d,n+r);break;case"line":r=s?s/2:Math.cos(p)*m,a=Math.sin(p)*m,e.moveTo(i-r,n-a),e.lineTo(i+r,n+a);break;case"dash":e.moveTo(i,n),e.lineTo(i+Math.cos(p)*(s?s/2:m),n+Math.sin(p)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function _t(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function di(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function fi(e){e.restore()}function al(e,t,i,n,s){if(!t)return e.lineTo(i.x,i.y);if(s==="middle"){let o=(t.x+i.x)/2;e.lineTo(o,t.y),e.lineTo(o,i.y)}else s==="after"!=!!n?e.lineTo(t.x,i.y):e.lineTo(i.x,t.y);e.lineTo(i.x,i.y)}function ll(e,t,i,n){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function xf(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),T(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 yf(e,t,i,n,s){if(s.strikethrough||s.underline){let o=e.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,c=i+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,h),e.lineTo(a,h),e.stroke()}}function vf(e,t){let i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function jt(e,t,i,n,s,o={}){let r=z(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,xf(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&vf(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),T(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,i,n,o.maxWidth)),e.fillText(c,i,n,o.maxWidth),yf(e,i,n,c,o),n+=Number(s.lineHeight);e.restore()}function Re(e,t){let{x:i,y:n,w:s,h:o,radius:r}=t;e.arc(i+r.topLeft,n+r.topLeft,r.topLeft,1.5*L,L,!0),e.lineTo(i,n+o-r.bottomLeft),e.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,L,$,!0),e.lineTo(i+s-r.bottomRight,n+o),e.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,$,0,!0),e.lineTo(i+s,n+r.topRight),e.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-$,!0),e.lineTo(i+r.topLeft,n)}var wf=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Sf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Mf(e,t){let i=(""+e).match(wf);if(!i||i[1]==="normal")return t*1.2;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100;break}return t*e}var kf=e=>+e||0;function pn(e,t){let i={},n=D(t),s=n?Object.keys(t):t,o=D(e)?n?r=>C(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)i[r]=kf(o(r));return i}function Qs(e){return pn(e,{top:"y",right:"x",bottom:"y",left:"x"})}function $t(e){return pn(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Z(e){let t=Qs(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function K(e,t){e=e||{},t=t||H.font;let i=C(e.size,t.size);typeof i=="string"&&(i=parseInt(i,10));let n=C(e.style,t.style);n&&!(""+n).match(Sf)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:C(e.family,t.family),lineHeight:Mf(C(e.lineHeight,t.lineHeight),i),size:i,style:n,weight:C(e.weight,t.weight),string:""};return s.string=_f(s),s}function Ie(e,t,i,n){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),i!==void 0&&z(a)&&(a=a[i%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function cl(e,t,i){let{min:n,max:s}=e,o=zs(t,(s-n)/2),r=(a,l)=>i&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Ot(e,t){return Object.assign(Object.create(e),t)}function mn(e,t=[""],i,n,s=()=>e[0]){let o=i||e;typeof n>"u"&&(n=dl("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>mn([a,...e],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return hl(a,l,()=>Lf(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return Va(a).includes(l)},ownKeys(a){return Va(a)},set(a,l,c){let h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function re(e,t,i,n){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:to(e,n),setContext:o=>re(e,o,i,n),override:o=>re(e.override(o),t,i,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return hl(o,r,()=>Cf(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 to(e,t={scriptable:!0,indexable:!0}){let{_scriptable:i=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:i,indexable:n,isScriptable:At(i)?i:()=>i,isIndexable:At(n)?n:()=>n}}var Af=(e,t)=>e?e+cn(t):t,eo=(e,t)=>D(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function hl(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let n=i();return e[t]=n,n}function Cf(e,t,i){let{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=e,a=n[t];return At(a)&&r.isScriptable(t)&&(a=Pf(t,a,e,i)),z(a)&&a.length&&(a=Of(t,a,e,r.isIndexable)),eo(t,a)&&(a=re(a,s,o&&o[t],r)),a}function Pf(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||n);return a.delete(e),eo(e,l)&&(l=io(s._scopes,s,e,l)),l}function Of(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(typeof o.index<"u"&&n(e))return t[o.index%t.length];if(D(t[0])){let l=t,c=s._scopes.filter(h=>h!==l);t=[];for(let h of l){let u=io(c,s,e,h);t.push(re(u,o,r&&r[e],a))}}return t}function ul(e,t,i){return At(e)?e(t,i):e}var Tf=(e,t)=>e===!0?t:typeof e=="string"?Pt(t,e):void 0;function Df(e,t,i,n,s){for(let o of t){let r=Tf(i,o);if(r){e.add(r);let a=ul(r._fallback,i,s);if(typeof a<"u"&&a!==i&&a!==n)return a}else if(r===!1&&typeof n<"u"&&i!==n)return null}return!1}function io(e,t,i,n){let s=t._rootScopes,o=ul(t._fallback,i,n),r=[...e,...s],a=new Set;a.add(n);let l=Wa(a,r,i,o||i,n);return l===null||typeof o<"u"&&o!==i&&(l=Wa(a,r,o,l,n),l===null)?!1:mn(Array.from(a),[""],s,o,()=>Ef(t,i,n))}function Wa(e,t,i,n,s){for(;i;)i=Df(e,t,i,n,s);return i}function Ef(e,t,i){let n=e._getTarget();t in n||(n[t]={});let s=n[t];return z(s)&&D(i)?i:s||{}}function Lf(e,t,i,n){let s;for(let o of t)if(s=dl(Af(o,e),i),typeof s<"u")return eo(e,s)?io(i,n,e,s):s}function dl(e,t){for(let i of t){if(!i)continue;let n=i[e];if(typeof n<"u")return n}}function Va(e){let t=e._keys;return t||(t=e._keys=Rf(e._scopes)),t}function Rf(e){let t=new Set;for(let i of e)for(let n of Object.keys(i).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function no(e,t,i,n){let{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(n),a,l,c,h;for(a=0,l=n;a<l;++a)c=a+i,h=t[c],r[a]={r:s.parse(Pt(h,o),c)};return r}var If=Number.EPSILON||1e-14,Pe=(e,t)=>t<e.length&&!e[t].skip&&e[t],fl=e=>e==="x"?"y":"x";function Ff(e,t,i,n){let s=e.skip?t:e,o=t,r=i.skip?t:i,a=an(o,s),l=an(r,o),c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let u=n*c,d=n*h;return{previous:{x:o.x-u*(r.x-s.x),y:o.y-u*(r.y-s.y)},next:{x:o.x+d*(r.x-s.x),y:o.y+d*(r.y-s.y)}}}function zf(e,t,i){let n=e.length,s,o,r,a,l,c=Pe(e,0);for(let h=0;h<n-1;++h)if(l=c,c=Pe(e,h+1),!(!l||!c)){if(De(t[h],0,If)){i[h]=i[h+1]=0;continue}s=i[h]/t[h],o=i[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),i[h]=s*r*t[h],i[h+1]=o*r*t[h])}}function Bf(e,t,i="x"){let n=fl(i),s=e.length,o,r,a,l=Pe(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=Pe(e,c+1),!a)continue;let h=a[i],u=a[n];r&&(o=(h-r[i])/3,a[`cp1${i}`]=h-o,a[`cp1${n}`]=u-o*t[c]),l&&(o=(l[i]-h)/3,a[`cp2${i}`]=h+o,a[`cp2${n}`]=u+o*t[c])}}function Nf(e,t="x"){let i=fl(t),n=e.length,s=Array(n).fill(0),o=Array(n),r,a,l,c=Pe(e,0);for(r=0;r<n;++r)if(a=l,l=c,c=Pe(e,r+1),!!l){if(c){let h=c[t]-l[t];s[r]=h!==0?(c[i]-l[i])/h:0}o[r]=a?c?pt(s[r-1])!==pt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}zf(e,s,o),Bf(e,o,t)}function nn(e,t,i){return Math.max(Math.min(e,i),t)}function Hf(e,t){let i,n,s,o,r,a=_t(e[0],t);for(i=0,n=e.length;i<n;++i)r=o,o=a,a=i<n-1&&_t(e[i+1],t),o&&(s=e[i],r&&(s.cp1x=nn(s.cp1x,t.left,t.right),s.cp1y=nn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=nn(s.cp2x,t.left,t.right),s.cp2y=nn(s.cp2y,t.top,t.bottom)))}function gl(e,t,i,n,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Nf(e,s);else{let c=n?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=Ff(c,a,e[Math.min(o+1,r-(n?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Hf(e,i)}function bn(){return typeof window<"u"&&typeof document<"u"}function _n(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ln(e,t,i){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[i])):n=e,n}var xn=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Wf(e,t){return xn(e).getPropertyValue(t)}var Vf=["top","right","bottom","left"];function oe(e,t,i){let n={};i=i?"-"+i:"";for(let s=0;s<4;s++){let o=Vf[s];n[o]=parseFloat(e[t+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}var jf=(e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot);function $f(e,t){let i=e.touches,n=i&&i.length?i[0]:e,{offsetX:s,offsetY:o}=n,r=!1,a,l;if(jf(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Yt(e,t){if("native"in e)return e;let{canvas:i,currentDevicePixelRatio:n}=t,s=xn(i),o=s.boxSizing==="border-box",r=oe(s,"padding"),a=oe(s,"border","width"),{x:l,y:c,box:h}=$f(e,i),u=r.left+(h&&a.left),d=r.top+(h&&a.top),{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-u)/f*i.width/n),y:Math.round((c-d)/g*i.height/n)}}function Yf(e,t,i){let n,s;if(t===void 0||i===void 0){let o=e&&_n(e);if(!o)t=e.clientWidth,i=e.clientHeight;else{let r=o.getBoundingClientRect(),a=xn(o),l=oe(a,"border","width"),c=oe(a,"padding");t=r.width-c.width-l.width,i=r.height-c.height-l.height,n=ln(a.maxWidth,o,"clientWidth"),s=ln(a.maxHeight,o,"clientHeight")}}return{width:t,height:i,maxWidth:n||rn,maxHeight:s||rn}}var Ht=e=>Math.round(e*10)/10;function pl(e,t,i,n){let s=xn(e),o=oe(s,"margin"),r=ln(s.maxWidth,e,"clientWidth")||rn,a=ln(s.maxHeight,e,"clientHeight")||rn,l=Yf(e,t,i),{width:c,height:h}=l;if(s.boxSizing==="content-box"){let d=oe(s,"border","width"),f=oe(s,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Ht(Math.min(c,r,l.maxWidth)),h=Ht(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ht(c/2)),(t!==void 0||i!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Ht(Math.floor(h*n))),{width:c,height:h}}function so(e,t,i){let n=t||1,s=Ht(e.height*n),o=Ht(e.width*n);e.height=Ht(e.height),e.width=Ht(e.width);let r=e.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=n,r.height=s,r.width=o,e.ctx.setTransform(n,0,0,n,0,0),!0):!1}var ml=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};bn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function oo(e,t){let i=Wf(e,t),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Nt(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function bl(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:n==="middle"?i<.5?e.y:t.y:n==="after"?i<1?e.y:t.y:i>0?t.y:e.y}}function _l(e,t,i,n){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Nt(e,s,i),a=Nt(s,o,i),l=Nt(o,t,i),c=Nt(r,a,i),h=Nt(a,l,i);return Nt(c,h,i)}var Uf=function(e,t){return{x(i){return e+e+t-i},setWidth(i){t=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,n){return i-n},leftForLtr(i,n){return i-n}}},Kf=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function le(e,t,i){return e?Uf(t,i):Kf()}function ro(e,t){let i,n;(t==="ltr"||t==="rtl")&&(i=e.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=n)}function ao(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function xl(e){return e==="angle"?{between:Ee,compare:hf,normalize:G}:{between:yt,compare:(t,i)=>t-i,normalize:t=>t}}function ja({start:e,end:t,count:i,loop:n,style:s}){return{start:e%i,end:t%i,loop:n&&(t-e+1)%i===0,style:s}}function Xf(e,t,i){let{property:n,start:s,end:o}=i,{between:r,normalize:a}=xl(n),l=t.length,{start:c,end:h,loop:u}=e,d,f;if(u){for(c+=l,h+=l,d=0,f=l;d<f&&r(a(t[c%l][n]),s,o);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:e.style}}function lo(e,t,i){if(!i)return[e];let{property:n,start:s,end:o}=i,r=t.length,{compare:a,between:l,normalize:c}=xl(n),{start:h,end:u,loop:d,style:f}=Xf(e,t,i),g=[],m=!1,p=null,b,_,y,v=()=>l(s,y,b)&&a(s,y)!==0,x=()=>a(o,b)===0||l(o,y,b),w=()=>m||v(),M=()=>!m||x();for(let k=h,A=h;k<=u;++k)_=t[k%r],!_.skip&&(b=c(_[n]),b!==y&&(m=l(b,s,o),p===null&&w()&&(p=a(b,s)===0?k:A),p!==null&&M()&&(g.push(ja({start:p,end:k,loop:d,count:r,style:f})),p=null),A=k,y=b));return p!==null&&g.push(ja({start:p,end:u,loop:d,count:r,style:f})),g}function co(e,t){let i=[],n=e.segments;for(let s=0;s<n.length;s++){let o=lo(n[s],e.points,t);o.length&&i.push(...o)}return i}function qf(e,t,i,n){let s=0,o=t-1;if(i&&!n)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,i&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Gf(e,t,i,n){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=i;++l){let c=e[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function yl(e,t){let i=e.points,n=e.options.spanGaps,s=i.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=qf(i,s,o,n);if(n===!0)return $a(e,[{start:r,end:a,loop:o}],i,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return $a(e,Gf(i,r,l,c),i,t)}function $a(e,t,i,n){return!n||!n.setContext||!i?t:Jf(e,t,i,n)}function Jf(e,t,i,n){let s=e._chart.getContext(),o=Ya(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=i.length,c=[],h=o,u=t[0].start,d=u;function f(g,m,p,b){let _=a?-1:1;if(g!==m){for(g+=l;i[g%l].skip;)g-=_;for(;i[m%l].skip;)m+=_;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:p,style:b}),h=b,u=m%l)}}for(let g of t){u=a?u:g.start;let m=i[u%l],p;for(d=u+1;d<=g.end;d++){let b=i[d%l];p=Ya(n.setContext(Ot(s,{type:"segment",p0:m,p1:b,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),Zf(p,h)&&f(u,d-1,g.loop,h),m=b,h=p}u<d-1&&f(u,d-1,g.loop,h)}return c}function Ya(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Zf(e,t){if(!t)return!1;let i=[],n=function(s,o){return qs(o)?(i.includes(o)||i.push(o),i.indexOf(o)):o};return JSON.stringify(e,n)!==JSON.stringify(t,n)}function sn(e,t,i){return e.options.clip?e[i]:t[i]}function Qf(e,t){let{xScale:i,yScale:n}=e;return i&&n?{left:sn(i,t,"left"),right:sn(i,t,"right"),top:sn(n,t,"top"),bottom:sn(n,t,"bottom")}:t}function ho(e,t){let i=t._clip;if(i.disabled)return!1;let n=Qf(t,e.chartArea);return{left:i.left===!1?0:n.left-(i.left===!0?0:i.left),right:i.right===!1?e.width:n.right+(i.right===!0?0:i.right),top:i.top===!1?0:n.top-(i.top===!0?0:i.top),bottom:i.bottom===!1?e.height:n.bottom+(i.bottom===!0?0:i.bottom)}}var So=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,n,s){let o=i.listeners[s],r=i.duration;o.forEach(a=>a({chart:t,initial:i.initial,numSteps:r,currentStep:Math.min(n-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ys.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let i=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),i+=o.length}),this._lastDate=t,i===0&&(this._running=!1)}_getAnims(t){let i=this._charts,n=i.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,n)),n}listen(t,i,n){this._getAnims(t).listeners[i].push(n)}add(t,i){!i||!i.length||this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){let i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let i=this._charts.get(t);return!(!i||!i.running||!i.items.length)}stop(t){let i=this._charts.get(t);if(!i||!i.items.length)return;let n=i.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Tt=new So,vl="transparent",tg={boolean(e,t,i){return i>.5?t:e},color(e,t,i){let n=Gs(e||vl),s=n.valid&&Gs(t||vl);return s&&s.valid?s.mix(n,i).hexString():t},number(e,t,i){return e+(t-e)*i}},Mo=class{constructor(t,i,n,s){let o=i[n];s=Ie([t.to,s,o,t.from]);let r=Ie([t.from,o,s]);this._active=!0,this._fn=t.fn||tg[t.type||typeof r],this._easing=Ae[t.easing]||Ae.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,n){if(this._active){this._notify(!1);let s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ie([t.to,i,s,t.from]),this._from=Ie([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let i=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||i<n),!this._active){this._target[s]=a,this._notify(!0);return}if(i<0){this._target[s]=o;return}l=i/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((i,n)=>{t.push({res:i,rej:n})})}_notify(t){let i=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][i]()}},Pn=class{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!D(t))return;let i=Object.keys(H.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!D(o))return;let r={};for(let a of i)r[a]=o[a];(z(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,i){let n=i.options,s=ig(t,n);if(!s)return[];let o=this._createAnimations(s,n);return n.$shared&&eg(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,i){let n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(i),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,i));continue}let h=i[c],u=o[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}o[c]=u=new Mo(d,t,c,h),s.push(u)}return s}update(t,i){if(this._properties.size===0){Object.assign(t,i);return}let n=this._createAnimations(t,i);if(n.length)return Tt.add(this._chart,n),!0}};function eg(e,t){let i=[],n=Object.keys(t);for(let s=0;s<n.length;s++){let o=e[n[s]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}function ig(e,t){if(!t)return;let i=e.options;if(!i){e.options=t;return}return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}function wl(e,t){let i=e&&e.options||{},n=i.reverse,s=i.min===void 0?t:0,o=i.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function ng(e,t,i){if(i===!1)return!1;let n=wl(e,i),s=wl(t,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function sg(e){let t,i,n,s;return D(e)?(t=e.top,i=e.right,n=e.bottom,s=e.left):t=i=n=s=e,{top:t,right:i,bottom:n,left:s,disabled:e===!1}}function yc(e,t){let i=[],n=e._getSortedDatasetMetas(t),s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function Sl(e,t,i,n={}){let s=e.keys,o=n.mode==="single",r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===i){if(h=!0,n.all)continue;break}c=e.values[l],j(c)&&(o||t===0||pt(t)===pt(c))&&(t+=c)}return!h&&!n.all?0:t}function og(e,t){let{iScale:i,vScale:n}=t,s=i.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:e[h]};return a}function uo(e,t){let i=e&&e.options.stacked;return i||i===void 0&&t.stack!==void 0}function rg(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}function ag(e){let{min:t,max:i,minDefined:n,maxDefined:s}=e.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}function lg(e,t,i){let n=e[t]||(e[t]={});return n[i]||(n[i]={})}function Ml(e,t,i,n){for(let s of t.getMatchingVisibleMetas(n).reverse()){let o=e[s.index];if(i&&o>0||!i&&o<0)return s.index}return null}function kl(e,t){let{chart:i,_cachedMeta:n}=e,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=rg(o,r,n),u=t.length,d;for(let f=0;f<u;++f){let g=t[f],{[l]:m,[c]:p}=g,b=g._stacks||(g._stacks={});d=b[c]=lg(s,h,m),d[a]=p,d._top=Ml(d,r,!0,n.type),d._bottom=Ml(d,r,!1,n.type);let _=d._visualValues||(d._visualValues={});_[a]=p}}function fo(e,t){let i=e.scales;return Object.keys(i).filter(n=>i[n].axis===t).shift()}function cg(e,t){return Ot(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function hg(e,t,i){return Ot(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}function gi(e,t){let i=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(let s of t){let o=s._stacks;if(!o||o[n]===void 0||o[n][i]===void 0)return;delete o[n][i],o[n]._visualValues!==void 0&&o[n]._visualValues[i]!==void 0&&delete o[n]._visualValues[i]}}}var go=e=>e==="reset"||e==="none",Al=(e,t)=>t?e:Object.assign({},e),ug=(e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:yc(i,!0),values:null},rt=class{constructor(t,i){this.chart=t,this._ctx=t.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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=uo(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&&gi(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,i=this._cachedMeta,n=this.getDataset(),s=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,o=i.xAxisID=C(n.xAxisID,fo(t,"x")),r=i.yAxisID=C(n.yAxisID,fo(t,"y")),a=i.rAxisID=C(n.rAxisID,fo(t,"r")),l=i.indexAxis,c=i.iAxisID=s(l,o,r,a),h=i.vAxisID=s(l,r,o,a);i.xScale=this.getScaleForId(o),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(c),i.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&js(this._data,this),t._stacked&&gi(t)}_dataCheck(){let t=this.getDataset(),i=t.data||(t.data=[]),n=this._data;if(D(i)){let s=this._cachedMeta;this._data=og(i,s)}else if(n!==i){if(n){js(n,this);let s=this._cachedMeta;gi(s),s._parsed=[]}i&&Object.isExtensible(i)&&il(i,this),this._syncList=[],this._data=i}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let i=this._cachedMeta,n=this.getDataset(),s=!1;this._dataCheck();let o=i._stacked;i._stacked=uo(i.vScale,i),i.stack!==n.stack&&(s=!0,gi(i),i.stack=n.stack),this._resyncElements(t),(s||o!==i._stacked)&&(kl(this,i._parsed),i._stacked=uo(i.vScale,i))}configure(){let t=this.chart.config,i=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){let{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis,l=t===0&&i===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,u,d;if(this._parsing===!1)n._parsed=s,n._sorted=!0,d=s;else{z(s[t])?d=this.parseArrayData(n,s,t,i):D(s[t])?d=this.parseObjectData(n,s,t,i):d=this.parsePrimitiveData(n,s,t,i);let f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<i;++h)n._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);n._sorted=l}r&&kl(this,d)}parsePrimitiveData(t,i,n,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,u=new Array(s),d,f,g;for(d=0,f=s;d<f;++d)g=d+n,u[d]={[a]:h||o.parse(c[g],g),[l]:r.parse(i[g],g)};return u}parseArrayData(t,i,n,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,h,u;for(l=0,c=s;l<c;++l)h=l+n,u=i[h],a[l]={x:o.parse(u[0],h),y:r.parse(u[1],h)};return a}parseObjectData(t,i,n,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),h,u,d,f;for(h=0,u=s;h<u;++h)d=h+n,f=i[d],c[h]={x:o.parse(Pt(f,a),d),y:r.parse(Pt(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,n){let s=this.chart,o=this._cachedMeta,r=i[t.axis],a={keys:yc(s,!0),values:i._stacks[t.axis]._visualValues};return Sl(a,r,o.index,{mode:n})}updateRangeFromParsed(t,i,n,s){let o=n[i.axis],r=o===null?NaN:o,a=s&&n._stacks[i.axis];s&&a&&(s.values=a,r=Sl(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){let n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=ug(i,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=ag(a),d,f;function g(){f=s[d];let m=f[a.axis];return!j(f[t.axis])||h>m||u<m}for(d=0;d<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let i=this._cachedMeta._parsed,n=[],s,o,r;for(s=0,o=i.length;s<o;++s)r=i[s][t.axis],j(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let i=this._cachedMeta,n=i.iScale,s=i.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let i=this._cachedMeta;this.update(t||"default"),i._clip=sg(C(this.options.clip,ng(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,i=this.chart,n=this._cachedMeta,s=n.data||[],o=i.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,h;for(n.dataset&&n.dataset.draw(t,o,a,l),h=a;h<a+l;++h){let u=s[h];u.hidden||(u.active&&c?r.push(u):u.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,i){let n=i?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,i,n){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=hg(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=cg(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!i,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",n){let s=i==="active",o=this._cachedDataOpts,r=t+"-"+i,a=o[r],l=this.enableOptionSharing&&Te(n);if(a)return Al(a,l);let c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(H.elements[t]),g=()=>this.getContext(n,s,i),m=c.resolveNamedOptions(d,f,g,u);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(Al(m,l))),m}_resolveAnimations(t,i,n){let s=this.chart,o=this._cachedDataOpts,r=`animation-${i}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,i),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,n,i))}let c=new Pn(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||go(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){let n=this.resolveDataElementOptions(t,i),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(i,o)||o!==s;return this.updateSharedOptions(o,i,n),{sharedOptions:o,includeOptions:r}}updateElement(t,i,n,s){go(s)?Object.assign(t,n):this._resolveAnimations(i,s).update(t,n)}updateSharedOptions(t,i,n){t&&!go(i)&&this._resolveAnimations(void 0,i).update(t,n)}_setStyle(t,i,n,s){t.active=s;let o=this.getStyle(i,s);this._resolveAnimations(i,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,i,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,i,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let i=this._data,n=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=n.length,o=i.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,i,n=!0){let s=this._cachedMeta,o=s.data,r=t+i,a,l=c=>{for(c.length+=i,a=c.length-1;a>=r;a--)c[a]=c[a-i]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,i),n&&this.updateElements(o,t,i,"reset")}updateElements(t,i,n,s){}_removeElements(t,i){let n=this._cachedMeta;if(this._parsing){let s=n._parsed.splice(t,i);n._stacked&&gi(n,s)}n.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[i,n,s]=t;this[i](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let 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,i){i&&this._sync(["_removeElements",t,i]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};S(rt,"defaults",{}),S(rt,"datasetElementType",null),S(rt,"dataElementType",null);function dg(e,t){if(!e._cache.$bar){let i=e.getMatchingVisibleMetas(t),n=[];for(let s=0,o=i.length;s<o;s++)n=n.concat(i[s].controller.getAllParsedValues(e));e._cache.$bar=$s(n.sort((s,o)=>s-o))}return e._cache.$bar}function fg(e){let t=e.iScale,i=dg(t,e.type),n=t._length,s,o,r,a,l=()=>{r===32767||r===-32768||(Te(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=i.length;s<o;++s)r=t.getPixelForValue(i[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return n}function gg(e,t,i,n){let s=i.barThickness,o,r;return T(s)?(o=t.min*i.categoryPercentage,r=i.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:t.pixels[e]-o/2}}function pg(e,t,i,n){let s=t.pixels,o=s[e],r=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null,l=i.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:i.barPercentage,start:c}}function mg(e,t,i,n){let s=i.parse(e[0],n),o=i.parse(e[1],n),r=Math.min(s,o),a=Math.max(s,o),l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[i.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function vc(e,t,i,n){return z(e)?mg(e,t,i,n):t[i.axis]=i.parse(e,n),t}function Cl(e,t,i,n){let s=e.iScale,o=e.vScale,r=s.getLabels(),a=s===o,l=[],c,h,u,d;for(c=i,h=i+n;c<h;++c)d=t[c],u={},u[s.axis]=a||s.parse(r[c],c),l.push(vc(d,u,o,c));return l}function po(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function bg(e,t,i){return e!==0?pt(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}function _g(e){let t,i,n,s,o;return e.horizontal?(t=e.base>e.x,i="left",n="right"):(t=e.base<e.y,i="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:t,top:s,bottom:o}}function xg(e,t,i,n){let s=t.borderSkipped,o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:h}=_g(e);s==="middle"&&i&&(e.enableBorderRadius=!0,(i._top||0)===n?s=c:(i._bottom||0)===n?s=h:(o[Pl(h,r,a,l)]=!0,s=c)),o[Pl(s,r,a,l)]=!0,e.borderSkipped=o}function Pl(e,t,i,n){return n?(e=yg(e,t,i),e=Ol(e,i,t)):e=Ol(e,t,i),e}function yg(e,t,i){return e===t?i:e===i?t:e}function Ol(e,t,i){return e==="start"?t:e==="end"?i:e}function vg(e,{inflateAmount:t},i){e.inflateAmount=t==="auto"?i===1?.33:0:t}var ze=class extends rt{parsePrimitiveData(t,i,n,s){return Cl(t,i,n,s)}parseArrayData(t,i,n,s){return Cl(t,i,n,s)}parseObjectData(t,i,n,s){let{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,u=[],d,f,g,m;for(d=n,f=n+s;d<f;++d)m=i[d],g={},g[o.axis]=o.parse(Pt(m,c),d),u.push(vc(Pt(m,h),g,r,d));return u}updateRangeFromParsed(t,i,n,s){super.updateRangeFromParsed(t,i,n,s);let o=n._custom;o&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let i=this._cachedMeta,{iScale:n,vScale:s}=i,o=this.getParsed(t),r=o._custom,a=po(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,n,s){let o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(i,s);for(let f=i;f<i+n;f++){let g=this.getParsed(f),m=o||T(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),p=this._calculateBarIndexPixels(f,h),b=(g._stacks||{})[a.axis],_={horizontal:c,base:m.base,enableBorderRadius:!b||po(g._custom)||r===b._top||r===b._bottom,x:c?m.head:p.center,y:c?p.center:m.head,height:c?p.size:Math.abs(m.size),width:c?Math.abs(m.size):p.size};d&&(_.options=u||this.resolveDataElementOptions(f,t[f].active?"active":s));let y=_.options||t[f].options;xg(_,y,b,r),vg(_,y,h.ratio),this.updateElement(t[f],f,_,s)}}_getStacks(t,i){let{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(i),l=a&&a[n.axis],c=h=>{let u=h._parsed.find(f=>f[n.axis]===l),d=u&&u[h.vScale.axis];if(T(d)||isNaN(d))return!0};for(let h of s)if(!(i!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.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(){let t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===i).shift()}_getAxis(){let t={},i=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[C(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,n){let s=this._getStacks(t,n),o=i!==void 0?s.indexOf(i):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,i=this._cachedMeta,n=i.iScale,s=[],o,r;for(o=0,r=i.data.length;o<r;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));let a=t.barThickness;return{min:a||fg(i),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:i,_stacked:n,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=po(c),u=l[i.axis],d=0,f=n?this.applyStack(i,l,n):u,g,m;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&pt(u)!==pt(c.barEnd)&&(d=0),d+=u);let p=!T(o)&&!h?o:d,b=i.getPixelForValue(p);if(this.chart.getDataVisibility(t)?g=i.getPixelForValue(d+f):g=b,m=g-b,Math.abs(m)<r){m=bg(m,i,a)*r,u===a&&(b-=m/2);let _=i.getPixelForDecimal(0),y=i.getPixelForDecimal(1),v=Math.min(_,y),x=Math.max(_,y);b=Math.max(Math.min(b,x),v),g=b+m,n&&!h&&(l._stacks[i.axis]._visualValues[s]=i.getValueForPixel(g)-i.getValueForPixel(b))}if(b===i.getPixelForValue(a)){let _=pt(m)*i.getLineWidthForValue(a)/2;b+=_,m-=_}return{size:m,base:b,head:g,center:g+m/2}}_calculateBarIndexPixels(t,i){let n=i.scale,s=this.options,o=s.skipNull,r=C(s.maxBarThickness,1/0),a,l,c=this._getAxisCount();if(i.grouped){let h=o?this._getStackCount(t):i.stackCount,u=s.barThickness==="flex"?pg(t,i,s,h*c):gg(t,i,s,h*c),d=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(C(d,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;a=u.start+u.chunk*g+u.chunk/2,l=Math.min(r,u.chunk*u.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(r,i.min*i.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,i=t.vScale,n=t.data,s=n.length,o=0;for(;o<s;++o)this.getParsed(o)[i.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}};S(ze,"id","bar"),S(ze,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),S(ze,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});var Be=class extends rt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,i,n,s){let o=super.parsePrimitiveData(t,i,n,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+n).radius;return o}parseArrayData(t,i,n,s){let o=super.parseArrayData(t,i,n,s);for(let r=0;r<o.length;r++){let a=i[n+r];o[r]._custom=C(a[2],this.resolveDataElementOptions(r+n).radius)}return o}parseObjectData(t,i,n,s){let o=super.parseObjectData(t,i,n,s);for(let r=0;r<o.length;r++){let a=i[n+r];o[r]._custom=C(a&&a.r&&+a.r,this.resolveDataElementOptions(r+n).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,i=0;for(let n=t.length-1;n>=0;--n)i=Math.max(i,t[n].size(this.resolveDataElementOptions(n))/2);return i>0&&i}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=i,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:n[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){let i=this._cachedMeta.data;this.updateElements(i,0,i.length,t)}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(i,s),h=r.axis,u=a.axis;for(let d=i;d<i+n;d++){let f=t[d],g=!o&&this.getParsed(d),m={},p=m[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[h]),b=m[u]=o?a.getBasePixel():a.getPixelForValue(g[u]);m.skip=isNaN(p)||isNaN(b),c&&(m.options=l||this.resolveDataElementOptions(d,f.active?"active":s),o&&(m.options.radius=0)),this.updateElement(f,d,m,s)}}resolveDataElementOptions(t,i){let n=this.getParsed(t),s=super.resolveDataElementOptions(t,i);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return i!=="active"&&(s.radius=0),s.radius+=C(n&&n._custom,o),s}};S(Be,"id","bubble"),S(Be,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),S(Be,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function wg(e,t,i){let n=1,s=1,o=0,r=0;if(t<B){let a=e,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(y,v,x)=>Ee(y,a,l,!0)?1:Math.max(v,v*i,x,x*i),g=(y,v,x)=>Ee(y,a,l,!0)?-1:Math.min(v,v*i,x,x*i),m=f(0,c,u),p=f($,h,d),b=g(L,c,u),_=g(L+$,h,d);n=(m-b)/2,s=(p-_)/2,o=-(m+b)/2,r=-(p+_)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}var Et=class extends rt{constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){let n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(D(n[t])){let{key:l="value"}=this._parsing;o=c=>+Pt(n[c],l)}let r,a;for(r=t,a=t+i;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return ht(this.options.rotation-90)}_getCircumference(){return ht(this.options.circumference)}_getRotationExtents(){let t=B,i=-B;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),i=Math.max(i,o+r)}return{rotation:t,circumference:i-t}}update(t){let i=this.chart,{chartArea:n}=i,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(Ka(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:m}=wg(u,h,l),p=(n.width-r)/d,b=(n.height-r)/f,_=Math.max(Math.min(p,b)/2,0),y=zs(this.options.radius,_),v=Math.max(y*l,0),x=(y-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*y,this.offsetY=m*y,s.total=this.calculateTotal(),this.outerRadius=y-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,i){let n=this.options,s=this._cachedMeta,o=this._getCircumference();return i&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/B)}updateElements(t,i,n,s){let o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(i,s),b=this._getRotation(),_;for(_=0;_<i;++_)b+=this._circumference(_,o);for(_=i;_<i+n;++_){let y=this._circumference(_,o),v=t[_],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+y,circumference:y,outerRadius:g,innerRadius:f};p&&(x.options=m||this.resolveDataElementOptions(_,v.active?"active":s)),b+=y,this.updateElement(v,_,x,s)}}calculateTotal(){let t=this._cachedMeta,i=t.data,n=0,s;for(s=0;s<i.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!i[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){let i=this._cachedMeta.total;return i>0&&!isNaN(t)?B*(Math.abs(t)/i):0}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Le(i._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let i=0,n=this.chart,s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let n=0,s=t.length;n<s;++n){let o=this.resolveDataElementOptions(n);i=Math.max(i,o.offset||0,o.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(i+=this._getRingWeight(n));return i}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};S(Et,"id","doughnut"),S(Et,"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"}),S(Et,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),S(Et,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return i.labels.length&&i.datasets.length?i.labels.map((l,c)=>{let u=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||u.borderRadius),index:c}}):[]}},onClick(t,i,n){n.chart.toggleDataVisibility(i.index),n.chart.update()}}}});var Ne=class extends rt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let i=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=i,r=this.chart._animationsDisabled,{start:a,count:l}=Ks(i,s,r);this._drawStart=a,this._drawCount=l,Xs(i)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;let c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(i,s),d=r.axis,f=a.axis,{spanGaps:g,segment:m}=this.options,p=ae(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",_=i+n,y=t.length,v=i>0&&this.getParsed(i-1);for(let x=0;x<y;++x){let w=t[x],M=b?w:{};if(x<i||x>=_){M.skip=!0;continue}let k=this.getParsed(x),A=T(k[f]),P=M[d]=r.getPixelForValue(k[d],x),O=M[f]=o||A?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],x);M.skip=isNaN(P)||isNaN(O)||A,M.stop=x>0&&Math.abs(k[d]-v[d])>p,m&&(M.parsed=k,M.raw=c.data[x]),u&&(M.options=h||this.resolveDataElementOptions(x,w.active?"active":s)),b||this.updateElement(w,x,M,s),v=k}}getMaxOverflow(){let t=this._cachedMeta,i=t.dataset,n=i.options&&i.options.borderWidth||0,s=t.data||[];if(!s.length)return n;let o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};S(Ne,"id","line"),S(Ne,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),S(Ne,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});var fe=class extends rt{constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Le(i._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,i,n,s){return no.bind(this)(t,i,n,s)}update(t){let i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){let t=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<i.min&&(i.min=o),o>i.max&&(i.max=o))}),i}_updateRadius(){let t=this.chart,i=t.chartArea,n=t.options,s=Math.min(i.right-i.left,i.bottom-i.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,i,n,s){let o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*L,f=d,g,m=360/this.countVisibleElements();for(g=0;g<i;++g)f+=this._computeAngle(g,s,m);for(g=i;g<i+n;g++){let p=t[g],b=f,_=f+this._computeAngle(g,s,m),y=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=_,o&&(l.animateScale&&(y=0),l.animateRotate&&(b=_=d));let v={x:h,y:u,innerRadius:0,outerRadius:y,startAngle:b,endAngle:_,options:this.resolveDataElementOptions(g,p.active?"active":s)};this.updateElement(p,g,v,s)}}countVisibleElements(){let t=this._cachedMeta,i=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&i++}),i}_computeAngle(t,i,n){return this.chart.getDataVisibility(t)?ht(this.resolveDataElementOptions(t,i).angle||n):0}};S(fe,"id","polarArea"),S(fe,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),S(fe,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data;if(i.labels.length&&i.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return i.labels.map((o,r)=>{let l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,i,n){n.chart.toggleDataVisibility(i.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});var xi=class extends Et{};S(xi,"id","pie"),S(xi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});var He=class extends rt{getLabelAndValue(t){let i=this._cachedMeta.vScale,n=this.getParsed(t);return{label:i.getLabels()[t],value:""+i.getLabelForValue(n[i.axis])}}parseObjectData(t,i,n,s){return no.bind(this)(t,i,n,s)}update(t){let i=this._cachedMeta,n=i.dataset,s=i.data||[],o=i.iScale.getLabels();if(n.points=s,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,i,n,s){let o=this._cachedMeta.rScale,r=s==="reset";for(let a=i;a<i+n;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=o.getPointPositionForValue(a,this.getParsed(a).r),u=r?o.xCenter:h.x,d=r?o.yCenter:h.y,f={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,f,s)}}};S(He,"id","radar"),S(He,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),S(He,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});var We=class extends rt{getLabelAndValue(t){let i=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=i,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){let i=this._cachedMeta,{data:n=[]}=i,s=this.chart._animationsDisabled,{start:o,count:r}=Ks(i,n,s);if(this._drawStart=o,this._drawCount=r,Xs(i)&&(o=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:l}=i;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(n,o,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(i,s),u=this.getSharedOptions(h),d=this.includeOptions(s,u),f=r.axis,g=a.axis,{spanGaps:m,segment:p}=this.options,b=ae(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",y=i>0&&this.getParsed(i-1);for(let v=i;v<i+n;++v){let x=t[v],w=this.getParsed(v),M=_?x:{},k=T(w[g]),A=M[f]=r.getPixelForValue(w[f],v),P=M[g]=o||k?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,w,l):w[g],v);M.skip=isNaN(A)||isNaN(P)||k,M.stop=v>0&&Math.abs(w[f]-y[f])>b,p&&(M.parsed=w,M.raw=c.data[v]),d&&(M.options=u||this.resolveDataElementOptions(v,x.active?"active":s)),_||this.updateElement(x,v,M,s),y=w}this.updateSharedOptions(u,s,h)}getMaxOverflow(){let t=this._cachedMeta,i=t.data||[];if(!this.options.showLine){let a=0;for(let l=i.length-1;l>=0;--l)a=Math.max(a,i[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!i.length)return s;let 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}};S(We,"id","scatter"),S(We,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),S(We,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Sg=Object.freeze({__proto__:null,BarController:ze,BubbleController:Be,DoughnutController:Et,LineController:Ne,PieController:xi,PolarAreaController:fe,RadarController:He,ScatterController:We});function ce(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var ko=class e{constructor(t){S(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return ce()}parse(){return ce()}format(){return ce()}add(){return ce()}diff(){return ce()}startOf(){return ce()}endOf(){return ce()}},Mg={_date:ko};function kg(e,t,i,n){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?Qa:bt;if(n){if(s._sharedOptions){let h=o[0],u=typeof h.getRange=="function"&&h.getRange(t);if(u){let d=c(o,t,i-u),f=c(o,t,i+u);return{lo:d.lo,hi:f.hi}}}}else{let h=c(o,t,i);if(l){let{vScale:u}=s._cachedMeta,{_parsed:d}=e,f=d.slice(0,h.lo+1).reverse().findIndex(m=>!T(m[u.axis]));h.lo-=Math.max(0,f);let g=d.slice(h.hi).findIndex(m=>!T(m[u.axis]));h.hi+=Math.max(0,g)}return h}}return{lo:0,hi:o.length-1}}function Ti(e,t,i,n,s){let o=e.getSortedVisibleDatasetMetas(),r=i[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:h}=o[a],{lo:u,hi:d}=kg(o[a],t,r,s);for(let f=u;f<=d;++f){let g=h[f];g.skip||n(g,c,f)}}}function Ag(e){let t=e.indexOf("x")!==-1,i=e.indexOf("y")!==-1;return function(n,s){let o=t?Math.abs(n.x-s.x):0,r=i?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function mo(e,t,i,n,s){let o=[];return!s&&!e.isPointInArea(t)||Ti(e,i,t,function(a,l,c){!s&&!_t(a,e.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Cg(e,t,i,n){let s=[];function o(r,a,l){let{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],n),{angle:u}=Vs(r,{x:t.x,y:t.y});Ee(u,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Ti(e,i,t,o),s}function Pg(e,t,i,n,s,o){let r=[],a=Ag(i),l=Number.POSITIVE_INFINITY;function c(h,u,d){let f=h.inRange(t.x,t.y,s);if(n&&!f)return;let g=h.getCenterPoint(s);if(!(!!o||e.isPointInArea(g))&&!f)return;let p=a(t,g);p<l?(r=[{element:h,datasetIndex:u,index:d}],l=p):p===l&&r.push({element:h,datasetIndex:u,index:d})}return Ti(e,i,t,c),r}function bo(e,t,i,n,s,o){return!o&&!e.isPointInArea(t)?[]:i==="r"&&!n?Cg(e,t,i,s):Pg(e,t,i,n,s,o)}function Tl(e,t,i,n,s){let o=[],r=i==="x"?"inXRange":"inYRange",a=!1;return Ti(e,i,t,(l,c,h)=>{l[r]&&l[r](t[i],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var Og={evaluateInteractionItems:Ti,modes:{index(e,t,i,n){let s=Yt(t,e),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?mo(e,s,o,n,r):bo(e,s,o,!1,n,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(e,t,i,n){let s=Yt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1,a=i.intersect?mo(e,s,o,n,r):bo(e,s,o,!1,n,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(e,t,i,n){let s=Yt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return mo(e,s,o,n,r)},nearest(e,t,i,n){let s=Yt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return bo(e,s,o,i.intersect,n,r)},x(e,t,i,n){let s=Yt(t,e);return Tl(e,s,"x",i.intersect,n)},y(e,t,i,n){let s=Yt(t,e);return Tl(e,s,"y",i.intersect,n)}}},wc=["left","top","right","bottom"];function pi(e,t){return e.filter(i=>i.pos===t)}function Dl(e,t){return e.filter(i=>wc.indexOf(i.pos)===-1&&i.box.axis===t)}function mi(e,t){return e.sort((i,n)=>{let s=t?n:i,o=t?i:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Tg(e){let t=[],i,n,s,o,r,a;for(i=0,n=(e||[]).length;i<n;++i)s=e[i],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Dg(e){let t={};for(let i of e){let{stack:n,pos:s,stackWeight:o}=i;if(!n||!wc.includes(s))continue;let r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Eg(e,t){let i=Dg(e),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=i[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=h?h*s:l&&t.availableHeight)}return i}function Lg(e){let t=Tg(e),i=mi(t.filter(c=>c.box.fullSize),!0),n=mi(pi(t,"left"),!0),s=mi(pi(t,"right")),o=mi(pi(t,"top"),!0),r=mi(pi(t,"bottom")),a=Dl(t,"x"),l=Dl(t,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:pi(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function El(e,t,i,n){return Math.max(e[i],t[i])+Math.max(e[n],t[n])}function Sc(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 Rg(e,t,i,n){let{pos:s,box:o}=i,r=e.maxPadding;if(!D(s)){i.size&&(e[s]-=i.size);let u=n[i.stack]||{size:0,count:1};u.size=Math.max(u.size,i.horizontal?o.height:o.width),i.size=u.size/u.count,e[s]+=i.size}o.getPadding&&Sc(r,o.getPadding());let a=Math.max(0,t.outerWidth-El(r,e,"left","right")),l=Math.max(0,t.outerHeight-El(r,e,"top","bottom")),c=a!==e.w,h=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:c,other:h}:{same:h,other:c}}function Ig(e){let t=e.maxPadding;function i(n){let s=Math.max(t[n]-e[n],0);return e[n]+=s,s}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}function Fg(e,t){let i=t.maxPadding;function n(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],i[r])}),o}return n(e?["left","right"]:["top","bottom"])}function yi(e,t,i,n){let s=[],o,r,a,l,c,h;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Fg(a.horizontal,t));let{same:u,other:d}=Rg(t,i,a,n);c|=u&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&yi(s,t,i,n)||h}function yn(e,t,i,n,s){e.top=i,e.left=t,e.right=t+n,e.bottom=i+s,e.width=n,e.height=s}function Ll(e,t,i,n){let s=i.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){let u=t.w*h,d=c.size||l.height;Te(c.start)&&(r=c.start),l.fullSize?yn(l,s.left,r,i.outerWidth-s.right-s.left,d):yn(l,t.left+c.placed,r,u,d),c.start=r,c.placed+=u,r=l.bottom}else{let u=t.h*h,d=c.size||l.width;Te(c.start)&&(o=c.start),l.fullSize?yn(l,o,s.top,d,i.outerHeight-s.bottom-s.top):yn(l,o,t.top+c.placed,d,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=r}var tt={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(i){t.draw(i)}}]},e.boxes.push(t)},removeBox(e,t){let i=e.boxes?e.boxes.indexOf(t):-1;i!==-1&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,n){if(!e)return;let s=Z(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(i-s.height,0),a=Lg(e.boxes),l=a.vertical,c=a.horizontal;R(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});let h=l.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),d=Object.assign({},s);Sc(d,Z(n));let f=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),g=Eg(l.concat(c),u);yi(a.fullSize,f,u,g),yi(l,f,u,g),yi(c,f,u,g)&&yi(l,f,u,g),Ig(f),Ll(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,Ll(a.rightAndBottom,f,u,g),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},R(a.chartArea,m=>{let p=m.box;Object.assign(p,e.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},On=class{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,n){}removeEventListener(t,i,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,n,s){return i=Math.max(0,i||t.width),n=n||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):n)}}isAttached(t){return!0}updateConfig(t){}},Ao=class extends On{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},An="$chartjs",zg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Rl=e=>e===null||e==="";function Bg(e,t){let i=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[An]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Rl(s)){let o=oo(e,"width");o!==void 0&&(e.width=o)}if(Rl(n))if(e.style.height==="")e.height=e.width/(t||2);else{let o=oo(e,"height");o!==void 0&&(e.height=o)}return e}var Mc=ml?{passive:!0}:!1;function Ng(e,t,i){e&&e.addEventListener(t,i,Mc)}function Hg(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,Mc)}function Wg(e,t){let i=zg[e.type]||e.type,{x:n,y:s}=Yt(e,t);return{type:i,chart:t,native:e,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Tn(e,t){for(let i of e)if(i===t||i.contains(t))return!0}function Vg(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Tn(a.addedNodes,n),r=r&&!Tn(a.removedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function jg(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Tn(a.removedNodes,n),r=r&&!Tn(a.addedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}var Ci=new Map,Il=0;function kc(){let e=window.devicePixelRatio;e!==Il&&(Il=e,Ci.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function $g(e,t){Ci.size||window.addEventListener("resize",kc),Ci.set(e,t)}function Yg(e){Ci.delete(e),Ci.size||window.removeEventListener("resize",kc)}function Ug(e,t,i){let n=e.canvas,s=n&&_n(n);if(!s)return;let o=Us((a,l)=>{let c=s.clientWidth;i(a,l),c<s.clientWidth&&i()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),$g(e,o),r}function _o(e,t,i){i&&i.disconnect(),t==="resize"&&Yg(e)}function Kg(e,t,i){let n=e.canvas,s=Us(o=>{e.ctx!==null&&i(Wg(o,e))},e);return Ng(n,t,s),s}var Co=class extends On{acquireContext(t,i){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Bg(t,i),n):null}releaseContext(t){let i=t.canvas;if(!i[An])return!1;let n=i[An].initial;["height","width"].forEach(o=>{let r=n[o];T(r)?i.removeAttribute(o):i.setAttribute(o,r)});let s=n.style||{};return Object.keys(s).forEach(o=>{i.style[o]=s[o]}),i.width=i.width,delete i[An],!0}addEventListener(t,i,n){this.removeEventListener(t,i);let s=t.$proxies||(t.$proxies={}),r={attach:Vg,detach:jg,resize:Ug}[i]||Kg;s[i]=r(t,i,n)}removeEventListener(t,i){let n=t.$proxies||(t.$proxies={}),s=n[i];if(!s)return;({attach:_o,detach:_o,resize:_o}[i]||Hg)(t,i,s),n[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,n,s){return pl(t,i,n,s)}isAttached(t){let i=t&&_n(t);return!!(i&&i.isConnected)}};function Xg(e){return!bn()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Ao:Co}var at=class{constructor(){S(this,"x");S(this,"y");S(this,"active",!1);S(this,"options");S(this,"$animations")}tooltipPosition(t){let{x:i,y:n}=this.getProps(["x","y"],t);return{x:i,y:n}}hasValue(){return ae(this.x)&&ae(this.y)}getProps(t,i){let n=this.$animations;if(!i||!n)return this;let s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}};S(at,"defaults",{}),S(at,"defaultRoutes");function qg(e,t){let i=e.options.ticks,n=Gg(e),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?Zg(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Qg(t,c,o,r/s),c;let h=Jg(o,t,s);if(r>0){let u,d,f=r>1?Math.round((l-a)/(r-1)):null;for(vn(t,c,h,T(f)?0:a-f,a),u=0,d=r-1;u<d;u++)vn(t,c,h,o[u],o[u+1]);return vn(t,c,h,l,T(f)?t.length:l+f),c}return vn(t,c,h),c}function Gg(e){let t=e.options.offset,i=e._tickSize(),n=e._length/i+(t?0:1),s=e._maxLength/i;return Math.floor(Math.min(n,s))}function Jg(e,t,i){let n=tp(e),s=t.length/i;if(!n)return Math.max(s,1);let o=Ga(n);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function Zg(e){let t=[],i,n;for(i=0,n=e.length;i<n;i++)e[i].major&&t.push(i);return t}function Qg(e,t,i,n){let s=0,o=i[0],r;for(n=Math.ceil(n),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=i[s*n])}function vn(e,t,i,n,s){let o=C(n,0),r=Math.min(C(s,e.length),e.length),a=0,l,c,h;for(i=Math.ceil(i),s&&(l=s-n,i=l/Math.floor(l/i)),h=o;h<0;)a++,h=Math.round(o+a*i);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(e[c]),a++,h=Math.round(o+a*i))}function tp(e){let t=e.length,i,n;if(t<2)return!1;for(n=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==n)return!1;return n}var ep=e=>e==="left"?"right":e==="right"?"left":e,Fl=(e,t,i)=>t==="top"||t==="left"?e[t]+i:e[t]-i,zl=(e,t)=>Math.min(t||e,e);function Bl(e,t){let i=[],n=e.length/t,s=e.length,o=0;for(;o<s;o+=n)i.push(e[Math.floor(o)]);return i}function ip(e,t,i){let n=e.ticks.length,s=Math.min(t,n-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(i&&(n===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function np(e,t){R(e,i=>{let n=i.gc,s=n.length/2,o;if(s>t){for(o=0;o<s;++o)delete i.data[n[o]];n.splice(0,s)}})}function bi(e){return e.drawTicks?e.tickLength:0}function Nl(e,t){if(!e.display)return 0;let i=K(e.font,t),n=Z(e.padding);return(z(e.text)?e.text.length:1)*i.lineHeight+n.height}function sp(e,t){return Ot(e,{scale:t,type:"scale"})}function op(e,t,i){return Ot(e,{tick:i,index:t,type:"tick"})}function rp(e,t,i){let n=dn(e);return(i&&t!=="right"||!i&&t==="right")&&(n=ep(n)),n}function ap(e,t,i,n){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:h}=l,u=0,d,f,g,m=r-s,p=a-o;if(e.isHorizontal()){if(f=J(n,o,a),D(i)){let b=Object.keys(i)[0],_=i[b];g=h[b].getPixelForValue(_)+m-t}else i==="center"?g=(c.bottom+c.top)/2+m-t:g=Fl(e,i,t);d=a-o}else{if(D(i)){let b=Object.keys(i)[0],_=i[b];f=h[b].getPixelForValue(_)-p+t}else i==="center"?f=(c.left+c.right)/2-p+t:f=Fl(e,i,t);g=J(n,r,s),u=i==="left"?-$:$}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}var pe=class e extends at{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,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:n,_suggestedMax:s}=this;return t=it(t,Number.POSITIVE_INFINITY),i=it(i,Number.NEGATIVE_INFINITY),n=it(n,Number.POSITIVE_INFINITY),s=it(s,Number.NEGATIVE_INFINITY),{min:it(t,n),max:it(i,s),minDefined:j(t),maxDefined:j(i)}}getMinMax(t){let{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:i,max:n};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(i=Math.min(i,r.min)),o||(n=Math.max(n,r.max));return i=o&&i>n?n:i,n=s&&i>n?i:n,{min:it(i,it(n,i)),max:it(n,it(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let 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(){F(this.options.beforeUpdate,[this])}update(t,i,n){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=cl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Bl(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=qg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,i,n;this.isHorizontal()?(i=this.left,n=this.right):(i=this.top,n=this.bottom,t=!t),this._startPixel=i,this._endPixel=n,this._reversePixels=t,this._length=n-i,this._alignToPixels=this.options.alignToPixels}afterUpdate(){F(this.options.afterUpdate,[this])}beforeSetDimensions(){F(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(){F(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),F(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){F(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let i=this.options.ticks,n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=F(i.callback,[o.value,n,t],this)}afterTickToLabelConversion(){F(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){F(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,i=t.ticks,n=zl(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,o=i.maxRotation,r=s,a,l,c;if(!this._isVisible()||!i.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=X(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),u+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-bi(t.grid)-i.padding-Nl(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),r=hn(Math.min(Math.asin(X((h.highest.height+6)/a,-1,1)),Math.asin(X(l/c,-1,1))-Math.asin(X(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){F(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){F(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:i,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Nl(s,i.options.font);if(a?(t.width=this.maxWidth,t.height=bi(o)+l):(t.height=this.maxHeight,t.width=bi(o)+l),n.display&&this.ticks.length){let{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=n.padding*2,g=ht(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){let b=n.mirror?0:p*u.width+m*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=n.mirror?0:m*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,p,m)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,n,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;l?c?(d=s*t.width,f=n*i.height):(d=n*t.height,f=s*i.width):o==="start"?f=i.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,f=i.width/2),this.paddingLeft=Math.max((d-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+r)*this.width/(this.width-u),0)}else{let h=i.height/2,u=t.height/2;o==="start"?(h=0,u=t.height):o==="end"&&(h=i.height,u=0),this.paddingTop=h+r,this.paddingBottom=u+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(){F(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:i}=this.options;return i==="top"||i==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let i,n;for(i=0,n=t.length;i<n;i++)T(t[i].label)&&(t.splice(i,1),n--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let i=this.options.ticks.sampleSize,n=this.ticks;i<n.length&&(n=Bl(n,i)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,n){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(i/zl(i,n)),c=0,h=0,u,d,f,g,m,p,b,_,y,v,x;for(u=0;u<i;u+=l){if(g=t[u].label,m=this._resolveTickFontOptions(u),s.font=p=m.string,b=o[p]=o[p]||{data:{},gc:[]},_=m.lineHeight,y=v=0,!T(g)&&!z(g))y=ci(s,b.data,b.gc,y,g),v=_;else if(z(g))for(d=0,f=g.length;d<f;++d)x=g[d],!T(x)&&!z(x)&&(y=ci(s,b.data,b.gc,y,x),v+=_);r.push(y),a.push(v),c=Math.max(y,c),h=Math.max(v,h)}np(o,i);let w=r.indexOf(c),M=a.indexOf(h),k=A=>({width:r[A]||0,height:a[A]||0});return{first:k(0),last:k(i-1),widest:k(w),highest:k(M),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let i=this._startPixel+t*this._length;return Za(this._alignToPixels?Vt(this.chart,i,0):i)}getDecimalForPixel(t){let i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){let i=this.ticks||[];if(t>=0&&t<i.length){let n=i[t];return n.$context||(n.$context=op(this.getContext(),t,n))}return this.$context||(this.$context=sp(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,i=ht(this.labelRotation),n=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let i=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),d=bi(o),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,b=function(W){return Vt(n,W,m)},_,y,v,x,w,M,k,A,P,O,E,q;if(r==="top")_=b(this.bottom),M=this.bottom-d,A=_-p,O=b(t.top)+p,q=t.bottom;else if(r==="bottom")_=b(this.top),O=t.top,q=b(t.bottom)-p,M=_+p,A=this.top+d;else if(r==="left")_=b(this.right),w=this.right-d,k=_-p,P=b(t.left)+p,E=t.right;else if(r==="right")_=b(this.left),P=t.left,E=b(t.right)-p,w=_+p,k=this.left+d;else if(i==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(D(r)){let W=Object.keys(r)[0],Y=r[W];_=b(this.chart.scales[W].getPixelForValue(Y))}O=t.top,q=t.bottom,M=_+p,A=M+d}else if(i==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(D(r)){let W=Object.keys(r)[0],Y=r[W];_=b(this.chart.scales[W].getPixelForValue(Y))}w=_-p,k=w-d,P=t.left,E=t.right}let ot=C(s.ticks.maxTicksLimit,u),I=Math.max(1,Math.ceil(u/ot));for(y=0;y<u;y+=I){let W=this.getContext(y),Y=o.setContext(W),dt=a.setContext(W),Q=Y.lineWidth,me=Y.color,Di=dt.dash||[],be=dt.dashOffset,Ue=Y.tickWidth,Kt=Y.tickColor,Ke=Y.tickBorderDash||[],Xt=Y.tickBorderDashOffset;v=ip(this,y,l),v!==void 0&&(x=Vt(n,v,Q),c?w=k=P=E=x:M=A=O=q=x,f.push({tx1:w,ty1:M,tx2:k,ty2:A,x1:P,y1:O,x2:E,y2:q,width:Q,color:me,borderDash:Di,borderDashOffset:be,tickWidth:Ue,tickColor:Kt,tickBorderDash:Ke,tickBorderDashOffset:Xt}))}return this._ticksLength=u,this._borderValue=_,f}_computeLabelItems(t){let i=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=o,d=bi(n.grid),f=d+h,g=u?-h:f,m=-ht(this.labelRotation),p=[],b,_,y,v,x,w,M,k,A,P,O,E,q="middle";if(s==="top")w=this.bottom-g,M=this._getXAxisLabelAlignment();else if(s==="bottom")w=this.top+g,M=this._getXAxisLabelAlignment();else if(s==="left"){let I=this._getYAxisLabelAlignment(d);M=I.textAlign,x=I.x}else if(s==="right"){let I=this._getYAxisLabelAlignment(d);M=I.textAlign,x=I.x}else if(i==="x"){if(s==="center")w=(t.top+t.bottom)/2+f;else if(D(s)){let I=Object.keys(s)[0],W=s[I];w=this.chart.scales[I].getPixelForValue(W)+f}M=this._getXAxisLabelAlignment()}else if(i==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(D(s)){let I=Object.keys(s)[0],W=s[I];x=this.chart.scales[I].getPixelForValue(W)}M=this._getYAxisLabelAlignment(d).textAlign}i==="y"&&(l==="start"?q="top":l==="end"&&(q="bottom"));let ot=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){y=a[b],v=y.label;let I=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,A=this._resolveTickFontOptions(b),P=A.lineHeight,O=z(v)?v.length:1;let W=O/2,Y=I.color,dt=I.textStrokeColor,Q=I.textStrokeWidth,me=M;r?(x=k,M==="inner"&&(b===_-1?me=this.options.reverse?"left":"right":b===0?me=this.options.reverse?"right":"left":me="center"),s==="top"?c==="near"||m!==0?E=-O*P+P/2:c==="center"?E=-ot.highest.height/2-W*P+P:E=-ot.highest.height+P/2:c==="near"||m!==0?E=P/2:c==="center"?E=ot.highest.height/2-W*P:E=ot.highest.height-O*P,u&&(E*=-1),m!==0&&!I.showLabelBackdrop&&(x+=P/2*Math.sin(m))):(w=k,E=(1-O)*P/2);let Di;if(I.showLabelBackdrop){let be=Z(I.backdropPadding),Ue=ot.heights[b],Kt=ot.widths[b],Ke=E-be.top,Xt=0-be.left;switch(q){case"middle":Ke-=Ue/2;break;case"bottom":Ke-=Ue;break}switch(M){case"center":Xt-=Kt/2;break;case"right":Xt-=Kt;break;case"inner":b===_-1?Xt-=Kt:b>0&&(Xt-=Kt/2);break}Di={left:Xt,top:Ke,width:Kt+be.width,height:Ue+be.height,color:I.backdropColor}}p.push({label:v,font:A,textOffset:E,options:{rotation:m,color:Y,strokeColor:dt,strokeWidth:Q,textAlign:me,textBaseline:q,translation:[x,w],backdrop:Di}})}return p}_getXAxisLabelAlignment(){let{position:t,ticks:i}=this.options;if(-ht(this.labelRotation))return t==="top"?"left":"right";let s="center";return i.align==="start"?s="left":i.align==="end"?s="right":i.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:i,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,h;return i==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):i==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:i},left:n,top:s,width:o,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){let i=this.options.grid;if(!this._isVisible()||!i.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?i.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let i=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(i.display)for(o=0,r=s.length;o<r;++o){let l=s[o];i.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),i.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:i,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,u,d;this.isHorizontal()?(c=Vt(t,this.left,r)-r/2,h=Vt(t,this.right,a)+a/2,u=d=l):(u=Vt(t,this.top,r)-r/2,d=Vt(t,this.bottom,a)+a/2,c=h=l),i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.beginPath(),i.moveTo(c,u),i.lineTo(h,d),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,s=this._computeLabelArea();s&&di(n,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,h=r.textOffset;jt(n,c,0,h,l,a)}s&&fi(n)}drawTitle(){let{ctx:t,options:{position:i,title:n,reverse:s}}=this;if(!n.display)return;let o=K(n.font),r=Z(n.padding),a=n.align,l=o.lineHeight/2;i==="bottom"||i==="center"||D(i)?(l+=r.bottom,z(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;let{titleX:c,titleY:h,maxWidth:u,rotation:d}=ap(this,l,i,a);jt(t,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:d,textAlign:rp(a,i,s),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,i=t.ticks&&t.ticks.z||0,n=C(t.grid&&t.grid.z,-1),s=C(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:i,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let i=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[],o,r;for(o=0,r=i.length;o<r;++o){let a=i[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let i=this.options.ticks.setContext(this.getContext(t));return K(i.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},$e=class{constructor(t,i,n){this.type=t,this.scope=i,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let i=Object.getPrototypeOf(t),n;hp(i)&&(n=this.register(i));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,lp(t,r,n),this.override&&H.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let i=this.items,n=t.id,s=this.scope;n in i&&delete i[n],s&&n in H[s]&&(delete H[s][n],this.override&&delete Wt[n])}};function lp(e,t,i){let n=Ce(Object.create(null),[i?H.get(i):{},H.get(t),e.defaults]);H.set(t,n),e.defaultRoutes&&cp(t,e.defaultRoutes),e.descriptors&&H.describe(t,e.descriptors)}function cp(e,t){Object.keys(t).forEach(i=>{let n=i.split("."),s=n.pop(),o=[e].concat(n).join("."),r=t[i].split("."),a=r.pop(),l=r.join(".");H.route(o,s,l,a)})}function hp(e){return"id"in e&&"defaults"in e}var Po=class{constructor(){this.controllers=new $e(rt,"datasets",!0),this.elements=new $e(at,"elements"),this.plugins=new $e(Object,"plugins"),this.scales=new $e(pe,"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,i,n){[...i].forEach(s=>{let o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):R(s,r=>{let a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,i,n){let s=cn(t);F(n["before"+s],[],n),i[t](n),F(n["after"+s],[],n)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){let n=this._typedRegistries[i];if(n.isForType(t))return n}return this.plugins}_get(t,i,n){let s=i.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}},wt=new Po,Oo=class{constructor(){this._init=void 0}notify(t,i,n,s){if(i==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,i,n);return i==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,i,n,s){s=s||{};for(let o of t){let r=o.plugin,a=r[n],l=[i,s,o.options];if(F(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){T(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){let n=t&&t.config,s=C(n.options&&n.options.plugins,{}),o=up(n);return s===!1&&!i?[]:fp(t,o,s,i)}_notifyStateChanges(t){let i=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(i,n),t,"stop"),this._notify(s(n,i),t,"start")}};function up(e){let t={},i=[],n=Object.keys(wt.plugins.items);for(let o=0;o<n.length;o++)i.push(wt.getPlugin(n[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];i.indexOf(r)===-1&&(i.push(r),t[r.id]=!0)}return{plugins:i,localIds:t}}function dp(e,t){return!t&&e===!1?null:e===!0?{}:e}function fp(e,{plugins:t,localIds:i},n,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=dp(n[l],s);c!==null&&o.push({plugin:a,options:gp(e.config,{plugin:a,local:i[l]},c,r)})}return o}function gp(e,{plugin:t,local:i},n,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(n,o);return i&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function To(e,t){let i=H.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function pp(e,t){let i=e;return e==="_index_"?i=t:e==="_value_"&&(i=t==="x"?"y":"x"),i}function mp(e,t){return e===t?"_index_":"_value_"}function Hl(e){if(e==="x"||e==="y"||e==="r")return e}function bp(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Do(e,...t){if(Hl(e))return e;for(let i of t){let n=i.axis||bp(i.position)||e.length>1&&Hl(e[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Wl(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function _p(e,t){if(t.data&&t.data.datasets){let i=t.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(i.length)return Wl(e,"x",i[0])||Wl(e,"y",i[0])}return{}}function xp(e,t){let i=Wt[e.type]||{scales:{}},n=t.scales||{},s=To(e.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{let a=n[r];if(!D(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=Do(r,a,_p(r,e),H.scales[a.type]),c=mp(l,s),h=i.scales||{};o[r]=Oe(Object.create(null),[{axis:l},a,h[l],h[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||To(a,t),h=(Wt[a]||{}).scales||{};Object.keys(h).forEach(u=>{let d=pp(u,l),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),Oe(o[f],[{axis:d},n[f],h[u]])})}),Object.keys(o).forEach(r=>{let a=o[r];Oe(a,[H.scales[a.type],H.scale])}),o}function Ac(e){let t=e.options||(e.options={});t.plugins=C(t.plugins,{}),t.scales=xp(e,t)}function Cc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function yp(e){return e=e||{},e.data=Cc(e.data),Ac(e),e}var Vl=new Map,Pc=new Set;function wn(e,t){let i=Vl.get(e);return i||(i=t(),Vl.set(e,i),Pc.add(i)),i}var _i=(e,t,i)=>{let n=Pt(t,i);n!==void 0&&e.add(n)},Eo=class{constructor(t){this._config=yp(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=Cc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Ac(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return wn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,i){return wn(`${t}.transition.${i}`,()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,i){return wn(`${t}-${i}`,()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]])}pluginScopeKeys(t){let i=t.id,n=this.type;return wn(`${n}-plugin-${i}`,()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,i){let n=this._scopeCache,s=n.get(t);return(!s||i)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,i,n){let{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(i);if(a)return a;let l=new Set;i.forEach(h=>{t&&(l.add(t),h.forEach(u=>_i(l,t,u))),h.forEach(u=>_i(l,s,u)),h.forEach(u=>_i(l,Wt[o]||{},u)),h.forEach(u=>_i(l,H,u)),h.forEach(u=>_i(l,fn,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Pc.has(i)&&r.set(i,c),c}chartOptionScopes(){let{options:t,type:i}=this;return[t,Wt[i]||{},H.datasets[i]||{},{type:i},H,fn]}resolveNamedOptions(t,i,n,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=jl(this._resolverCache,t,s),l=r;if(wp(r,i)){o.$shared=!1,n=At(n)?n():n;let c=this.createResolver(t,n,a);l=re(r,n,c)}for(let c of i)o[c]=l[c];return o}createResolver(t,i,n=[""],s){let{resolver:o}=jl(this._resolverCache,t,n);return D(i)?re(o,i,void 0,s):o}};function jl(e,t,i){let n=e.get(t);n||(n=new Map,e.set(t,n));let s=i.join(),o=n.get(s);return o||(o={resolver:mn(t,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}var vp=e=>D(e)&&Object.getOwnPropertyNames(e).some(t=>At(e[t]));function wp(e,t){let{isScriptable:i,isIndexable:n}=to(e);for(let s of t){let o=i(s),r=n(s),a=(r||o)&&e[s];if(o&&(At(a)||vp(a))||r&&z(a))return!0}return!1}var Sp="4.5.1",Mp=["top","bottom","left","right","chartArea"];function $l(e,t){return e==="top"||e==="bottom"||Mp.indexOf(e)===-1&&t==="x"}function Yl(e,t){return function(i,n){return i[e]===n[e]?i[t]-n[t]:i[e]-n[e]}}function Ul(e){let t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),F(i&&i.onComplete,[e],t)}function kp(e){let t=e.chart,i=t.options.animation;F(i&&i.onProgress,[e],t)}function Oc(e){return bn()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var Cn={},Kl=e=>{let t=Oc(e);return Object.values(Cn).filter(i=>i.canvas===t).pop()};function Ap(e,t,i){let n=Object.keys(e);for(let s of n){let o=+s;if(o>=t){let r=e[s];delete e[s],(i>0||o>t)&&(e[o+i]=r)}}}function Cp(e,t,i,n){return!i||e.type==="mouseout"?null:n?t:e}var ut=class{static register(...t){wt.add(...t),Xl()}static unregister(...t){wt.remove(...t),Xl()}constructor(t,i){let n=this.config=new Eo(i),s=Oc(t),o=Kl(s);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.");let r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Xg(s)),this.platform.updateConfig(n);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Ua(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,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 Oo,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=nl(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],Cn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Tt.listen(this,"complete",Ul),Tt.listen(this,"progress",kp),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:i},width:n,height:s,_aspectRatio:o}=this;return T(t)?i&&o?o:s?n/s: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 wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():so(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Js(this.canvas,this.ctx),this}stop(){return Tt.stop(this),this}resize(t,i){Tt.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){let n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,i,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,so(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),F(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let i=this.options.scales||{};R(i,(n,s)=>{n.id=s})}buildOrUpdateScales(){let t=this.options,i=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{}),o=[];i&&(o=o.concat(Object.keys(i).map(r=>{let a=i[r],l=Do(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),R(o,r=>{let a=r.options,l=a.id,c=Do(l,a),h=C(a.type,r.dtype);(a.position===void 0||$l(a.position,c)!==$l(r.dposition))&&(a.position=r.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===h)u=n[l];else{let d=wt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(a,t)}),R(s,(r,a)=>{r||delete n[a]}),R(n,r=>{tt.configure(this,r,r.options),tt.addBox(this,r)})}_updateMetasets(){let t=this._metasets,i=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>i){for(let s=i;s<n;++s)this._destroyDatasetMeta(s);t.splice(i,n-i)}this._sortedMetasets=t.slice(0).sort(Yl("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((n,s)=>{i.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],i=this.data.datasets,n,s;for(this._removeUnreferencedMetasets(),n=0,s=i.length;n<s;n++){let o=i[n],r=this.getDatasetMeta(n),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||To(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{let l=wt.getController(a),{datasetElementType:c,dataElementType:h}=H.datasets[a];Object.assign(l,{dataElementType:wt.getElement(h),datasetElementType:c&&wt.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){R(this.data.datasets,(t,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let i=this.config;i.update();let n=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){let{controller:u}=this.getDatasetMeta(c),d=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(d),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||R(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Yl("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){R(this.scales,t=>{tt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,i=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Bs(i,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(let{method:n,start:s,count:o}of i){let r=n==="_removeElements"?-o:o;Ap(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let i=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;o<i;o++)if(!Bs(s,n(o)))return;return Array.from(s).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;tt.update(this,this.width,this.height,t);let i=this.chartArea,n=i.width<=0||i.height<=0;this._layers=[],R(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let i=0,n=this.data.datasets.length;i<n;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,n=this.data.datasets.length;i<n;++i)this._updateDataset(i,At(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){let n=this.getDatasetMeta(t),s={meta:n,index:t,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Tt.has(this)?this.attached&&!Tt.running(this)&&Tt.start(this):(this.draw(),Ul({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let i=this._sortedMetasets,n=[],s,o;for(s=0,o=i.length;s<o;++s){let r=i[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let i=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=ho(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&di(i,s),t.controller.draw(),s&&fi(i),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return _t(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,n,s){let o=Og.modes[i];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){let i=this.data.datasets[t],n=this._metasets,s=n.filter(o=>o&&o._dataset===i).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Ot(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let i=this.data.datasets[t];if(!i)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!i.hidden}setDatasetVisibility(t,i){let n=this.getDatasetMeta(t);n.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,n){let s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Te(i)?(o.data[i].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){let i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Tt.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Js(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete Cn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,i=this.platform,n=(o,r)=>{i.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};R(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,i=this.platform,n=(l,c)=>{i.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(i.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},i.isAttached(this.canvas)?a():r()}unbindEvents(){R(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},R(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,n){let s=n?"set":"remove",o,r,a,l;for(i==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let i=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!hi(n,i)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,i))}notifyPlugins(t,i,n){return this._plugins.notify(this,t,i,n)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,n){let s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),r=o(i,t),a=n?t:o(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,i){let n={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;let o=this._handleEvent(t,i,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,i,n){let{_active:s=[],options:o}=this,r=i,a=this._getActiveElements(t,s,n,r),l=qa(t),c=Cp(t,this._lastEvent,n,l);n&&(this._lastEvent=null,F(o.onHover,[t,a,this],this),l&&F(o.onClick,[t,a,this],this));let h=!hi(a,s);return(h||i)&&(this._active=a,this._updateHoverStyles(a,s,i)),this._lastEvent=c,h}_getActiveElements(t,i,n,s){if(t.type==="mouseout")return[];if(!n)return i;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};S(ut,"defaults",H),S(ut,"instances",Cn),S(ut,"overrides",Wt),S(ut,"registry",wt),S(ut,"version",Sp),S(ut,"getChart",Kl);function Xl(){return R(ut.instances,e=>e._plugins.invalidate())}function Pp(e,t,i){let{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,u=Math.min(c/r,G(n-i));if(e.beginPath(),e.arc(s,o,r-c/2,n+u/2,i-u/2),a>0){let d=Math.min(c/a,G(n-i));e.arc(s,o,a+c/2,i-d/2,n+d/2,!0)}else{let d=Math.min(c/2,r*G(n-i));if(h==="round")e.arc(s,o,d,i-L/2,n+L/2,!0);else if(h==="bevel"){let f=2*d*d,g=-f*Math.cos(i+L/2)+s,m=-f*Math.sin(i+L/2)+o,p=f*Math.cos(n+L/2)+s,b=f*Math.sin(n+L/2)+o;e.lineTo(g,m),e.lineTo(p,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Op(e,t,i){let{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t,c=s/a;e.beginPath(),e.arc(o,r,a,n-c,i+c),l>s?(c=s/l,e.arc(o,r,l,i+c,n-c,!0)):e.arc(o,r,s,i+$,n-$),e.closePath(),e.clip()}function Tp(e){return pn(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Dp(e,t,i,n){let s=Tp(e.options.borderRadius),o=(i-t)/2,r=Math.min(o,n*t/2),a=l=>{let c=(i-Math.min(o,l))*n/2;return X(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:X(s.innerStart,0,r),innerEnd:X(s.innerEnd,0,r)}}function Fe(e,t,i,n){return{x:i+e*Math.cos(t),y:n+e*Math.sin(t)}}function Dn(e,t,i,n,s,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+n+i-c,0),d=h>0?h+n+i+c:0,f=0,g=s-l;if(n){let I=h>0?h-n:0,W=u>0?u-n:0,Y=(I+W)/2,dt=Y!==0?g*Y/(Y+n):g;f=(g-dt)/2}let m=Math.max(.001,g*u-i/L)/u,p=(g-m)/2,b=l+p+f,_=s-p-f,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:w}=Dp(t,d,u,_-b),M=u-y,k=u-v,A=b+y/M,P=_-v/k,O=d+x,E=d+w,q=b+x/O,ot=_-w/E;if(e.beginPath(),o){let I=(A+P)/2;if(e.arc(r,a,u,A,I),e.arc(r,a,u,I,P),v>0){let Q=Fe(k,P,r,a);e.arc(Q.x,Q.y,v,P,_+$)}let W=Fe(E,_,r,a);if(e.lineTo(W.x,W.y),w>0){let Q=Fe(E,ot,r,a);e.arc(Q.x,Q.y,w,_+$,ot+Math.PI)}let Y=(_-w/d+(b+x/d))/2;if(e.arc(r,a,d,_-w/d,Y,!0),e.arc(r,a,d,Y,b+x/d,!0),x>0){let Q=Fe(O,q,r,a);e.arc(Q.x,Q.y,x,q+Math.PI,b-$)}let dt=Fe(M,b,r,a);if(e.lineTo(dt.x,dt.y),y>0){let Q=Fe(M,A,r,a);e.arc(Q.x,Q.y,y,b-$,A)}}else{e.moveTo(r,a);let I=Math.cos(A)*u+r,W=Math.sin(A)*u+a;e.lineTo(I,W);let Y=Math.cos(P)*u+r,dt=Math.sin(P)*u+a;e.lineTo(Y,dt)}e.closePath()}function Ep(e,t,i,n,s){let{fullCircles:o,startAngle:r,circumference:a}=t,l=t.endAngle;if(o){Dn(e,t,i,n,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%B||B))}return Dn(e,t,i,n,l,s),e.fill(),l}function Lp(e,t,i,n,s){let{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d,borderRadius:f}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(u||[]),e.lineDashOffset=d,g?(e.lineWidth=c*2,e.lineJoin=h||"round"):(e.lineWidth=c,e.lineJoin=h||"bevel");let m=t.endAngle;if(o){Dn(e,t,i,n,m,s);for(let p=0;p<o;++p)e.stroke();isNaN(a)||(m=r+(a%B||B))}g&&Op(e,t,m),l.selfJoin&&m-r>=L&&f===0&&h!=="miter"&&Pp(e,t,m),o||(Dn(e,t,i,n,m,s),e.stroke())}var ue=class extends at{constructor(i){super();S(this,"circumference");S(this,"endAngle");S(this,"fullCircles");S(this,"innerRadius");S(this,"outerRadius");S(this,"pixelMargin");S(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,n,s){let o=this.getProps(["x","y"],s),{angle:r,distance:a}=Vs(o,{x:i,y:n}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,g=C(d,c-l),m=Ee(r,l,c)&&l!==c,p=g>=B||m,b=yt(a,h+f,u+f);return p&&b}getCenterPoint(i){let{x:n,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:c,spacing:h}=this.options,u=(o+r)/2,d=(a+l+h+c)/2;return{x:n+Math.cos(u)*d,y:s+Math.sin(u)*d}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){let{options:n,circumference:s}=this,o=(n.offset||0)/4,r=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>B?Math.floor(s/B):0,s===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let l=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(l)*o,Math.sin(l)*o);let c=1-Math.sin(Math.min(L,s||0)),h=o*c;i.fillStyle=n.backgroundColor,i.strokeStyle=n.borderColor,Ep(i,this,h,r,a),Lp(i,this,h,r,a),i.restore()}};S(ue,"id","arc"),S(ue,"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}),S(ue,"defaultRoutes",{backgroundColor:"backgroundColor"}),S(ue,"descriptors",{_scriptable:!0,_indexable:i=>i!=="borderDash"});function Tc(e,t,i=t){e.lineCap=C(i.borderCapStyle,t.borderCapStyle),e.setLineDash(C(i.borderDash,t.borderDash)),e.lineDashOffset=C(i.borderDashOffset,t.borderDashOffset),e.lineJoin=C(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=C(i.borderWidth,t.borderWidth),e.strokeStyle=C(i.borderColor,t.borderColor)}function Rp(e,t,i){e.lineTo(i.x,i.y)}function Ip(e){return e.stepped?al:e.tension||e.cubicInterpolationMode==="monotone"?ll:Rp}function Dc(e,t,i={}){let n=e.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!h?n+c-l:c-l}}function Fp(e,t,i,n){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Dc(s,i,n),h=Ip(o),{move:u=!0,reverse:d}=n||{},f,g,m;for(f=0;f<=c;++f)g=s[(a+(d?c-f:f))%r],!g.skip&&(u?(e.moveTo(g.x,g.y),u=!1):h(e,m,g,d,o.stepped),m=g);return l&&(g=s[(a+(d?c:0))%r],h(e,m,g,d,o.stepped)),!!l}function zp(e,t,i,n){let s=t.points,{count:o,start:r,ilen:a}=Dc(s,i,n),{move:l=!0,reverse:c}=n||{},h=0,u=0,d,f,g,m,p,b,_=v=>(r+(c?a-v:v))%o,y=()=>{m!==p&&(e.lineTo(h,p),e.lineTo(h,m),e.lineTo(h,b))};for(l&&(f=s[_(0)],e.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[_(d)],f.skip)continue;let v=f.x,x=f.y,w=v|0;w===g?(x<m?m=x:x>p&&(p=x),h=(u*h+v)/++u):(y(),e.lineTo(v,x),g=w,u=0,m=p=x),b=x}y()}function Lo(e){let t=e.options,i=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!i?zp:Fp}function Bp(e){return e.stepped?bl:e.tension||e.cubicInterpolationMode==="monotone"?_l:Nt}function Np(e,t,i,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,i,n)&&s.closePath()),Tc(e,t.options),e.stroke(s)}function Hp(e,t,i,n){let{segments:s,options:o}=t,r=Lo(t);for(let a of s)Tc(e,o,a.style),e.beginPath(),r(e,t,a,{start:i,end:i+n-1})&&e.closePath(),e.stroke()}var Wp=typeof Path2D=="function";function Vp(e,t,i,n){Wp&&!t.options.segment?Np(e,t,i,n):Hp(e,t,i,n)}var St=class extends at{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,i){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let s=n.spanGaps?this._loop:this._fullLoop;gl(this._points,n,t,s,i),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=yl(this,this.options.segment))}first(){let t=this.segments,i=this.points;return t.length&&i[t[0].start]}last(){let t=this.segments,i=this.points,n=t.length;return n&&i[t[n-1].end]}interpolate(t,i){let n=this.options,s=t[i],o=this.points,r=co(this,{property:i,start:s,end:s});if(!r.length)return;let a=[],l=Bp(n),c,h;for(c=0,h=r.length;c<h;++c){let{start:u,end:d}=r[c],f=o[u],g=o[d];if(f===g){a.push(f);continue}let m=Math.abs((s-f[i])/(g[i]-f[i])),p=l(f,g,m,n.stepped);p[i]=t[i],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,i,n){return Lo(this)(t,this,i,n)}path(t,i,n){let s=this.segments,o=Lo(this),r=this._loop;i=i||0,n=n||this.points.length-i;for(let a of s)r&=o(t,this,a,{start:i,end:i+n-1});return!!r}draw(t,i,n,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Vp(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};S(St,"id","line"),S(St,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),S(St,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),S(St,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ql(e,t,i,n){let s=e.options,{[i]:o}=e.getProps([i],n);return Math.abs(t-o)<s.radius+s.hitRadius}var Ve=class extends at{constructor(i){super();S(this,"parsed");S(this,"skip");S(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,n,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(i-r,2)+Math.pow(n-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(i,n){return ql(this,i,"x",n)}inYRange(i,n){return ql(this,i,"y",n)}getCenterPoint(i){let{x:n,y:s}=this.getProps(["x","y"],i);return{x:n,y:s}}size(i){i=i||this.options||{};let n=i.radius||0;n=Math.max(n,n&&i.hoverRadius||0);let s=n&&i.borderWidth||0;return(n+s)*2}draw(i,n){let s=this.options;this.skip||s.radius<.1||!_t(this,n,this.size(s)/2)||(i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.fillStyle=s.backgroundColor,gn(i,s,this.x,this.y))}getRange(){let i=this.options||{};return i.radius+i.hitRadius}};S(Ve,"id","point"),S(Ve,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),S(Ve,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ec(e,t){let{x:i,y:n,base:s,width:o,height:r}=e.getProps(["x","y","base","width","height"],t),a,l,c,h,u;return e.horizontal?(u=r/2,a=Math.min(i,s),l=Math.max(i,s),c=n-u,h=n+u):(u=o/2,a=i-u,l=i+u,c=Math.min(n,s),h=Math.max(n,s)),{left:a,top:c,right:l,bottom:h}}function Ut(e,t,i,n){return e?0:X(t,i,n)}function jp(e,t,i){let n=e.options.borderWidth,s=e.borderSkipped,o=Qs(n);return{t:Ut(s.top,o.top,0,i),r:Ut(s.right,o.right,0,t),b:Ut(s.bottom,o.bottom,0,i),l:Ut(s.left,o.left,0,t)}}function $p(e,t,i){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=$t(s),r=Math.min(t,i),a=e.borderSkipped,l=n||D(s);return{topLeft:Ut(!l||a.top||a.left,o.topLeft,0,r),topRight:Ut(!l||a.top||a.right,o.topRight,0,r),bottomLeft:Ut(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:Ut(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Yp(e){let t=Ec(e),i=t.right-t.left,n=t.bottom-t.top,s=jp(e,i/2,n/2),o=$p(e,i/2,n/2);return{outer:{x:t.left,y:t.top,w:i,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function xo(e,t,i,n){let s=t===null,o=i===null,a=e&&!(s&&o)&&Ec(e,n);return a&&(s||yt(t,a.left,a.right))&&(o||yt(i,a.top,a.bottom))}function Up(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Kp(e,t){e.rect(t.x,t.y,t.w,t.h)}function yo(e,t,i={}){let n=e.x!==i.x?-t:0,s=e.y!==i.y?-t:0,o=(e.x+e.w!==i.x+i.w?t:0)-n,r=(e.y+e.h!==i.y+i.h?t:0)-s;return{x:e.x+n,y:e.y+s,w:e.w+o,h:e.h+r,radius:e.radius}}var je=class extends at{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){let{inflateAmount:i,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:r}=Yp(this),a=Up(r.radius)?Re:Kp;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,yo(r,i,o)),t.clip(),a(t,yo(o,-i,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,yo(o,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,n){return xo(this,t,i,n)}inXRange(t,i){return xo(this,t,null,i)}inYRange(t,i){return xo(this,null,t,i)}getCenterPoint(t){let{x:i,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(i+s)/2:i,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};S(je,"id","bar"),S(je,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),S(je,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Xp=Object.freeze({__proto__:null,ArcElement:ue,BarElement:je,LineElement:St,PointElement:Ve}),Ro=["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)"],Gl=Ro.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Lc(e){return Ro[e%Ro.length]}function Rc(e){return Gl[e%Gl.length]}function qp(e,t){return e.borderColor=Lc(t),e.backgroundColor=Rc(t),++t}function Gp(e,t){return e.backgroundColor=e.data.map(()=>Lc(t++)),t}function Jp(e,t){return e.backgroundColor=e.data.map(()=>Rc(t++)),t}function Zp(e){let t=0;return(i,n)=>{let s=e.getDatasetMeta(n).controller;s instanceof Et?t=Gp(i,t):s instanceof fe?t=Jp(i,t):s&&(t=qp(i,t))}}function Jl(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Qp(e){return e&&(e.borderColor||e.backgroundColor)}function tm(){return H.borderColor!=="rgba(0,0,0,0.1)"||H.backgroundColor!=="rgba(0,0,0,0.1)"}var em={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,i){if(!i.enabled)return;let{data:{datasets:n},options:s}=e.config,{elements:o}=s,r=Jl(n)||Qp(s)||o&&Jl(o)||tm();if(!i.forceOverride&&r)return;let a=Zp(e);n.forEach(a)}};function im(e,t,i,n,s){let o=s.samples||n;if(o>=i)return e.slice(t,t+i);let r=[],a=(i-2)/(o-2),l=0,c=t+i-1,h=t,u,d,f,g,m;for(r[l++]=e[h],u=0;u<o-2;u++){let p=0,b=0,_,y=Math.floor((u+1)*a)+1+t,v=Math.min(Math.floor((u+2)*a)+1,i)+t,x=v-y;for(_=y;_<v;_++)p+=e[_].x,b+=e[_].y;p/=x,b/=x;let w=Math.floor(u*a)+1+t,M=Math.min(Math.floor((u+1)*a)+1,i)+t,{x:k,y:A}=e[h];for(f=g=-1,_=w;_<M;_++)g=.5*Math.abs((k-p)*(e[_].y-A)-(k-e[_].x)*(b-A)),g>f&&(f=g,d=e[_],m=_);r[l++]=d,h=m}return r[l++]=e[c],r}function nm(e,t,i,n){let s=0,o=0,r,a,l,c,h,u,d,f,g,m,p=[],b=t+i-1,_=e[t].x,v=e[b].x-_;for(r=t;r<t+i;++r){a=e[r],l=(a.x-_)/v*n,c=a.y;let x=l|0;if(x===h)c<g?(g=c,u=r):c>m&&(m=c,d=r),s=(o*s+a.x)/++o;else{let w=r-1;if(!T(u)&&!T(d)){let M=Math.min(u,d),k=Math.max(u,d);M!==f&&M!==w&&p.push({...e[M],x:s}),k!==f&&k!==w&&p.push({...e[k],x:s})}r>0&&w!==f&&p.push(e[w]),p.push(a),h=x,o=0,g=m=c,u=d=f=r}}return p}function Ic(e){if(e._decimated){let t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Zl(e){e.data.datasets.forEach(t=>{Ic(t)})}function sm(e,t){let i=t.length,n=0,s,{iScale:o}=e,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=X(bt(t,o.axis,r).lo,0,i-1)),c?s=X(bt(t,o.axis,a).hi+1,n,i)-n:s=i-n,{start:n,count:s}}var om={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,i)=>{if(!i.enabled){Zl(e);return}let n=e.width;e.data.datasets.forEach((s,o)=>{let{_data:r,indexAxis:a}=s,l=e.getDatasetMeta(o),c=r||s.data;if(Ie([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=e.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||e.options.parsing)return;let{start:u,count:d}=sm(l,c),f=i.threshold||4*n;if(d<=f){Ic(s);return}T(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(i.algorithm){case"lttb":g=im(c,u,d,n,i);break;case"min-max":g=nm(c,u,d,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}s._decimated=g})},destroy(e){Zl(e)}};function rm(e,t,i){let n=e.segments,s=e.points,o=t.points,r=[];for(let a of n){let{start:l,end:c}=a;c=Rn(l,c,s);let h=Io(i,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}let u=co(t,h);for(let d of u){let f=Io(i,o[d.start],o[d.end],d.loop),g=lo(a,s,f);for(let m of g)r.push({source:m,target:d,start:{[i]:Ql(h,f,"start",Math.max)},end:{[i]:Ql(h,f,"end",Math.min)}})}}return r}function Io(e,t,i,n){if(n)return;let s=t[e],o=i[e];return e==="angle"&&(s=G(s),o=G(o)),{property:e,start:s,end:o}}function am(e,t){let{x:i=null,y:n=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Rn(r,a,s);let l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):i!==null&&(o.push({x:i,y:l.y}),o.push({x:i,y:c.y}))}),o}function Rn(e,t,i){for(;t>e;t--){let n=i[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Ql(e,t,i,n){return e&&t?n(e[i],t[i]):e?e[i]:t?t[i]:0}function Fc(e,t){let i=[],n=!1;return z(e)?(n=!0,i=e):i=am(e,t),i.length?new St({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function tc(e){return e&&e.fill!==!1}function lm(e,t,i){let s=e[t].fill,o=[t],r;if(!i)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!j(s))return s;if(r=e[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function cm(e,t,i){let n=fm(e);if(D(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return j(s)&&Math.floor(s)===s?hm(n[0],t,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function hm(e,t,i,n){return(e==="-"||e==="+")&&(i=t+i),i===t||i<0||i>=n?!1:i}function um(e,t){let i=null;return e==="start"?i=t.bottom:e==="end"?i=t.top:D(e)?i=t.getPixelForValue(e.value):t.getBasePixel&&(i=t.getBasePixel()),i}function dm(e,t,i){let n;return e==="start"?n=i:e==="end"?n=t.options.reverse?t.min:t.max:D(e)?n=e.value:n=t.getBaseValue(),n}function fm(e){let t=e.options,i=t.fill,n=C(i&&i.target,i);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function gm(e){let{scale:t,index:i,line:n}=e,s=[],o=n.segments,r=n.points,a=pm(t,i);a.push(Fc({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)mm(s,r[h],a)}return new St({points:s,options:{}})}function pm(e,t){let i=[],n=e.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){let o=n[s];if(o.index===t)break;o.hidden||i.unshift(o.dataset)}return i}function mm(e,t,i){let n=[];for(let s=0;s<i.length;s++){let o=i[s],{first:r,last:a,point:l}=bm(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(e.push(l),!a)break}}e.push(...n)}function bm(e,t,i){let n=e.interpolate(t,i);if(!n)return{};let s=n[i],o=e.segments,r=e.points,a=!1,l=!1;for(let c=0;c<o.length;c++){let h=o[c],u=r[h.start][i],d=r[h.end][i];if(yt(s,u,d)){a=s===u,l=s===d;break}}return{first:a,last:l,point:n}}var En=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,i,n){let{x:s,y:o,radius:r}=this;return i=i||{start:0,end:B},t.arc(s,o,r,i.end,i.start,!0),!n.bounds}interpolate(t){let{x:i,y:n,radius:s}=this,o=t.angle;return{x:i+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}};function _m(e){let{chart:t,fill:i,line:n}=e;if(j(i))return xm(t,i);if(i==="stack")return gm(e);if(i==="shape")return!0;let s=ym(e);return s instanceof En?s:Fc(s,n)}function xm(e,t){let i=e.getDatasetMeta(t);return i&&e.isDatasetVisible(t)?i.dataset:null}function ym(e){return(e.scale||{}).getPointPositionForValue?wm(e):vm(e)}function vm(e){let{scale:t={},fill:i}=e,n=um(i,t);if(j(n)){let s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function wm(e){let{scale:t,fill:i}=e,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=dm(i,t,o),a=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,o);return new En({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function vo(e,t,i){let n=_m(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,u=c.backgroundColor,{above:d=u,below:f=u}=h||{},g=s.getDatasetMeta(o),m=ho(s,g);n&&r.points.length&&(di(e,i),Sm(e,{line:r,target:n,above:d,below:f,area:i,scale:a,axis:l,clip:m}),fi(e))}function Sm(e,t){let{line:i,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=i._loop?"angle":t.axis;e.save();let h=o;o!==s&&(c==="x"?(ec(e,n,r.top),wo(e,{line:i,target:n,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),ec(e,n,r.bottom)):c==="y"&&(ic(e,n,r.left),wo(e,{line:i,target:n,color:o,scale:a,property:c,clip:l}),e.restore(),e.save(),ic(e,n,r.right),h=s)),wo(e,{line:i,target:n,color:h,scale:a,property:c,clip:l}),e.restore()}function ec(e,t,i){let{segments:n,points:s}=t,o=!0,r=!1;e.beginPath();for(let a of n){let{start:l,end:c}=a,h=s[l],u=s[Rn(l,c,s)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(h.x,i),e.lineTo(h.x,h.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(u.x,i)}e.lineTo(t.first().x,i),e.closePath(),e.clip()}function ic(e,t,i){let{segments:n,points:s}=t,o=!0,r=!1;e.beginPath();for(let a of n){let{start:l,end:c}=a,h=s[l],u=s[Rn(l,c,s)];o?(e.moveTo(h.x,h.y),o=!1):(e.lineTo(i,h.y),e.lineTo(h.x,h.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(i,u.y)}e.lineTo(i,t.first().y),e.closePath(),e.clip()}function wo(e,t){let{line:i,target:n,property:s,color:o,scale:r,clip:a}=t,l=rm(i,n,s);for(let{source:c,target:h,start:u,end:d}of l){let{style:{backgroundColor:f=o}={}}=c,g=n!==!0;e.save(),e.fillStyle=f,Mm(e,r,a,g&&Io(s,u,d)),e.beginPath();let m=!!i.pathSegment(e,c),p;if(g){m?e.closePath():nc(e,n,d,s);let b=!!n.pathSegment(e,h,{move:m,reverse:!0});p=m&&b,p||nc(e,n,u,s)}e.closePath(),e.fill(p?"evenodd":"nonzero"),e.restore()}}function Mm(e,t,i,n){let s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,h,u;o==="x"?(l=r,c=s.top,h=a,u=s.bottom):(l=s.left,c=r,h=s.right,u=a),e.beginPath(),i&&(l=Math.max(l,i.left),h=Math.min(h,i.right),c=Math.max(c,i.top),u=Math.min(u,i.bottom)),e.rect(l,c,h-l,u-c),e.clip()}}function nc(e,t,i,n){let s=t.interpolate(i,n);s&&e.lineTo(s.x,s.y)}var km={id:"filler",afterDatasetsUpdate(e,t,i){let n=(e.data.datasets||[]).length,s=[],o,r,a,l;for(r=0;r<n;++r)o=e.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof St&&(l={visible:e.isDatasetVisible(r),index:r,fill:cm(a,r,n),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=lm(s,r,i.propagate))},beforeDraw(e,t,i){let n=i.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=s.length-1;r>=0;--r){let a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&vo(e.ctx,a,o))}},beforeDatasetsDraw(e,t,i){if(i.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){let o=n[s].$filler;tc(o)&&vo(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,i){let n=t.meta.$filler;!tc(n)||i.drawTime!=="beforeDatasetDraw"||vo(e.ctx,n,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},sc=(e,t)=>{let{boxHeight:i=t,boxWidth:n=t}=e;return e.usePointStyle&&(i=Math.min(i,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(t,i)}},Am=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,Ln=class extends at{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,i,n){this.maxWidth=t,this.maxHeight=i,this._margins=n,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(){let t=this.options.labels||{},i=F(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter(n=>t.filter(n,this.chart.data))),t.sort&&(i=i.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){let{options:t,ctx:i}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,s=K(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=sc(n,o),c,h;i.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,i,n,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a,u=t;o.textAlign="left",o.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((g,m)=>{let p=n+i/2+o.measureText(g.text).width;(m===0||c[c.length-1]+p+2*a>r)&&(u+=h,c[c.length-(m>0?0:1)]=0,f+=h,d++),l[m]={left:0,top:f,row:d,width:p,height:s},c[c.length-1]+=p+a}),u}_fitCols(t,i,n,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t,u=a,d=0,f=0,g=0,m=0;return this.legendItems.forEach((p,b)=>{let{itemWidth:_,itemHeight:y}=Cm(n,i,o,p,s);b>0&&f+y+2*a>h&&(u+=d+a,c.push({width:d,height:f}),g+=d+a,m++,d=f=0),l[b]={left:g,top:f,col:m,width:_,height:y},d=Math.max(d,_),f+=y+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:n,labels:{padding:s},rtl:o}}=this,r=le(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=J(n,this.left+s,this.right-this.lineWidths[a]);for(let c of i)a!==c.row&&(a=c.row,l=J(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=J(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of i)c.col!==a&&(a=c.col,l=J(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;di(t,this),this._draw(),fi(t)}}_draw(){let{options:t,columnSizes:i,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=H.color,l=le(t.rtl,this.left,this.width),c=K(r.font),{padding:h}=r,u=c.size,d=u/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:g,boxHeight:m,itemHeight:p}=sc(r,u),b=function(w,M,k){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();let A=C(k.lineWidth,1);if(s.fillStyle=C(k.fillStyle,a),s.lineCap=C(k.lineCap,"butt"),s.lineDashOffset=C(k.lineDashOffset,0),s.lineJoin=C(k.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=C(k.strokeStyle,a),s.setLineDash(C(k.lineDash,[])),r.usePointStyle){let P={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:A},O=l.xPlus(w,g/2),E=M+d;Zs(s,P,O,E,r.pointStyleWidth&&g)}else{let P=M+Math.max((u-m)/2,0),O=l.leftForLtr(w,g),E=$t(k.borderRadius);s.beginPath(),Object.values(E).some(q=>q!==0)?Re(s,{x:O,y:P,w:g,h:m,radius:E}):s.rect(O,P,g,m),s.fill(),A!==0&&s.stroke()}s.restore()},_=function(w,M,k){jt(s,k.text,w,M+p/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},y=this.isHorizontal(),v=this._computeTitleHeight();y?f={x:J(o,this.left+h,this.right-n[0]),y:this.top+h+v,line:0}:f={x:this.left+h,y:J(o,this.top+v+h,this.bottom-i[0].height),line:0},ro(this.ctx,t.textDirection);let x=p+h;this.legendItems.forEach((w,M)=>{s.strokeStyle=w.fontColor,s.fillStyle=w.fontColor;let k=s.measureText(w.text).width,A=l.textAlign(w.textAlign||(w.textAlign=r.textAlign)),P=g+d+k,O=f.x,E=f.y;l.setWidth(this.width),y?M>0&&O+P+h>this.right&&(E=f.y+=x,f.line++,O=f.x=J(o,this.left+h,this.right-n[f.line])):M>0&&E+x>this.bottom&&(O=f.x=O+i[f.line].width+h,f.line++,E=f.y=J(o,this.top+v+h,this.bottom-i[f.line].height));let q=l.x(O);if(b(q,E,w),O=sl(A,O+g+d,y?O+P:this.right,t.rtl),_(l.x(O),E,w),y)f.x+=P+h;else if(typeof w.text!="string"){let ot=c.lineHeight;f.y+=zc(w,ot)+h}else f.y+=x}),ao(this.ctx,t.textDirection)}drawTitle(){let t=this.options,i=t.title,n=K(i.font),s=Z(i.padding);if(!i.display)return;let o=le(t.rtl,this.left,this.width),r=this.ctx,a=i.position,l=n.size/2,c=s.top+l,h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=J(t.align,u,this.right-d);else{let g=this.columnSizes.reduce((m,p)=>Math.max(m,p.height),0);h=c+J(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=J(a,u,u+d);r.textAlign=o.textAlign(dn(a)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=n.string,jt(r,i.text,f,h,n)}_computeTitleHeight(){let t=this.options.title,i=K(t.font),n=Z(t.padding);return t.display?i.lineHeight+n.height:0}_getLegendItemAt(t,i){let n,s,o;if(yt(t,this.left,this.right)&&yt(i,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],yt(t,s.left,s.left+s.width)&&yt(i,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){let i=this.options;if(!Tm(t.type,i))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=Am(s,n);s&&!o&&F(i.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&F(i.onHover,[t,n,this],this)}else n&&F(i.onClick,[t,n,this],this)}};function Cm(e,t,i,n,s){let o=Pm(n,e,t,i),r=Om(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Pm(e,t,i,n){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+i.size/2+n.measureText(s).width}function Om(e,t,i){let n=e;return typeof t.text!="string"&&(n=zc(t,i)),n}function zc(e,t){let i=e.text?e.text.length:0;return t*i}function Tm(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var Dm={id:"legend",_element:Ln,start(e,t,i){let n=e.legend=new Ln({ctx:e.ctx,options:i,chart:e});tt.configure(e,n,i),tt.addBox(e,n)},stop(e){tt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){let n=e.legend;tt.configure(e,n,i),n.options=i},afterUpdate(e){let 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,i){let n=t.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(i?0:void 0),h=Z(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.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)}}},Pi=class extends at{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,i){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=i;let s=z(n.text)?n.text.length:1;this._padding=Z(n.padding);let o=s*K(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:i,left:n,bottom:s,right:o,options:r}=this,a=r.align,l=0,c,h,u;return this.isHorizontal()?(h=J(a,n,o),u=i+t,c=o-n):(r.position==="left"?(h=n+t,u=J(a,s,i),l=L*-.5):(h=o-t,u=J(a,i,s),l=L*.5),c=s-i),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,i=this.options;if(!i.display)return;let n=K(i.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);jt(t,i.text,0,0,n,{color:i.color,maxWidth:l,rotation:c,textAlign:dn(i.align),textBaseline:"middle",translation:[r,a]})}};function Em(e,t){let i=new Pi({ctx:e.ctx,options:t,chart:e});tt.configure(e,i,t),tt.addBox(e,i),e.titleBlock=i}var Lm={id:"title",_element:Pi,start(e,t,i){Em(e,i)},stop(e){let t=e.titleBlock;tt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,i){let n=e.titleBlock;tt.configure(e,n,i),n.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}},Sn=new WeakMap,Rm={id:"subtitle",start(e,t,i){let n=new Pi({ctx:e.ctx,options:i,chart:e});tt.configure(e,n,i),tt.addBox(e,n),Sn.set(e,n)},stop(e){tt.removeBox(e,Sn.get(e)),Sn.delete(e)},beforeUpdate(e,t,i){let n=Sn.get(e);tt.configure(e,n,i),n.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}},vi={average(e){if(!e.length)return!1;let t,i,n=new Set,s=0,o=0;for(t=0,i=e.length;t<i;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let i=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=an(t,c);h<s&&(s=h,a=l)}}if(a){let l=a.tooltipPosition();i=l.x,n=l.y}return{x:i,y:n}}};function vt(e,t){return t&&(z(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Dt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
`)>-1?e.split(`
`):e}function Im(e,t){let{element:i,datasetIndex:n,index:s}=t,o=e.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function oc(e,t){let i=e.chart.ctx,{body:n,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=K(t.bodyFont),c=K(t.titleFont),h=K(t.footerFont),u=o.length,d=s.length,f=n.length,g=Z(t.padding),m=g.height,p=0,b=n.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}d&&(m+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let _=0,y=function(v){p=Math.max(p,i.measureText(v).width+_)};return i.save(),i.font=c.string,R(e.title,y),i.font=l.string,R(e.beforeBody.concat(e.afterBody),y),_=t.displayColors?r+2+t.boxPadding:0,R(n,v=>{R(v.before,y),R(v.lines,y),R(v.after,y)}),_=0,i.font=h.string,R(e.footer,y),i.restore(),p+=g.width,{width:p,height:m}}function Fm(e,t){let{y:i,height:n}=t;return i<n/2?"top":i>e.height-n/2?"bottom":"center"}function zm(e,t,i,n){let{x:s,width:o}=n,r=i.caretSize+i.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function Bm(e,t,i,n){let{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=e,c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),zm(c,e,t,i)&&(c="center"),c}function rc(e,t,i){let n=i.yAlign||t.yAlign||Fm(e,i);return{xAlign:i.xAlign||t.xAlign||Bm(e,t,i,n),yAlign:n}}function Nm(e,t){let{x:i,width:n}=e;return t==="right"?i-=n:t==="center"&&(i-=n/2),i}function Hm(e,t,i){let{y:n,height:s}=e;return t==="top"?n+=i:t==="bottom"?n-=s+i:n-=s/2,n}function ac(e,t,i,n){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=$t(r),g=Nm(t,a),m=Hm(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,d)+s:a==="right"&&(g+=Math.max(u,f)+s),{x:X(g,0,n.width-t.width),y:X(m,0,n.height-t.height)}}function Mn(e,t,i){let n=Z(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function lc(e){return vt([],Dt(e))}function Wm(e,t,i){return Ot(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function cc(e,t){let i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}var Bc={beforeTitle:xt,title(e){if(e.length>0){let t=e[0],i=t.chart.data.labels,n=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return i[t.dataIndex]}return""},afterTitle:xt,beforeBody:xt,beforeLabel:xt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let i=e.formattedValue;return T(i)||(t+=i),t},labelColor(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:xt,afterBody:xt,beforeFooter:xt,footer:xt,afterFooter:xt};function nt(e,t,i,n){let s=e[t].call(i,n);return typeof s>"u"?Bc[t].call(i,n):s}var Ai=class extends at{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(){let t=this._cachedAnimations;if(t)return t;let i=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&i.options.animation&&n.animations,o=new Pn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Wm(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){let{callbacks:n}=i,s=nt(n,"beforeTitle",this,t),o=nt(n,"title",this,t),r=nt(n,"afterTitle",this,t),a=[];return a=vt(a,Dt(s)),a=vt(a,Dt(o)),a=vt(a,Dt(r)),a}getBeforeBody(t,i){return lc(nt(i.callbacks,"beforeBody",this,t))}getBody(t,i){let{callbacks:n}=i,s=[];return R(t,o=>{let r={before:[],lines:[],after:[]},a=cc(n,o);vt(r.before,Dt(nt(a,"beforeLabel",this,o))),vt(r.lines,nt(a,"label",this,o)),vt(r.after,Dt(nt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,i){return lc(nt(i.callbacks,"afterBody",this,t))}getFooter(t,i){let{callbacks:n}=i,s=nt(n,"beforeFooter",this,t),o=nt(n,"footer",this,t),r=nt(n,"afterFooter",this,t),a=[];return a=vt(a,Dt(s)),a=vt(a,Dt(o)),a=vt(a,Dt(r)),a}_createItems(t){let i=this._active,n=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=i.length;l<c;++l)a.push(Im(this.chart,i[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,n))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,n))),R(a,h=>{let u=cc(t.callbacks,h);s.push(nt(u,"labelColor",this,h)),o.push(nt(u,"labelPointStyle",this,h)),r.push(nt(u,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,i){let n=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=vi[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);let l=this._size=oc(this,n),c=Object.assign({},a,l),h=rc(this.chart,n,c),u=ac(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,n,s){let o=this.getCaretPosition(t,n,s);i.lineTo(o.x1,o.y1),i.lineTo(o.x2,o.y2),i.lineTo(o.x3,o.y3)}getCaretPosition(t,i,n){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=$t(a),{x:d,y:f}=t,{width:g,height:m}=i,p,b,_,y,v,x;return o==="center"?(v=f+m/2,s==="left"?(p=d,b=p-r,y=v+r,x=v-r):(p=d+g,b=p+r,y=v-r,x=v+r),_=p):(s==="left"?b=d+Math.max(l,h)+r:s==="right"?b=d+g-Math.max(c,u)-r:b=this.caretX,o==="top"?(y=f,v=y-r,p=b-r,_=b+r):(y=f+m,v=y+r,p=b+r,_=b-r),x=y),{x1:p,x2:b,x3:_,y1:y,y2:v,y3:x}}drawTitle(t,i,n){let s=this.title,o=s.length,r,a,l;if(o){let c=le(n.rtl,this.x,this.width);for(t.x=Mn(this,n.titleAlign,n),i.textAlign=c.textAlign(n.titleAlign),i.textBaseline="middle",r=K(n.titleFont),a=n.titleSpacing,i.fillStyle=n.titleColor,i.font=r.string,l=0;l<o;++l)i.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,i,n,s,o){let r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,h=K(o.bodyFont),u=Mn(this,"left",o),d=s.x(u),f=l<h.lineHeight?(h.lineHeight-l)/2:0,g=i.y+f;if(o.usePointStyle){let m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=s.leftForLtr(d,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,gn(t,m,p,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,gn(t,m,p,b)}else{t.lineWidth=D(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let m=s.leftForLtr(d,c),p=s.leftForLtr(s.xPlus(d,1),c-2),b=$t(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Re(t,{x:m,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Re(t,{x:p,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,i,n){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,u=K(n.bodyFont),d=u.lineHeight,f=0,g=le(n.rtl,this.x,this.width),m=function(k){i.fillText(k,g.x(t.x+f),t.y+d/2),t.y+=d+o},p=g.textAlign(r),b,_,y,v,x,w,M;for(i.textAlign=r,i.textBaseline="middle",i.font=u.string,t.x=Mn(this,p,n),i.fillStyle=n.bodyColor,R(this.beforeBody,m),f=a&&p!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,w=s.length;v<w;++v){for(b=s[v],_=this.labelTextColors[v],i.fillStyle=_,R(b.before,m),y=b.lines,a&&y.length&&(this._drawColorBox(i,t,v,g,n),d=Math.max(u.lineHeight,l)),x=0,M=y.length;x<M;++x)m(y[x]),d=u.lineHeight;R(b.after,m)}f=0,d=u.lineHeight,R(this.afterBody,m),t.y-=o}drawFooter(t,i,n){let s=this.footer,o=s.length,r,a;if(o){let l=le(n.rtl,this.x,this.width);for(t.x=Mn(this,n.footerAlign,n),t.y+=n.footerMarginTop,i.textAlign=l.textAlign(n.footerAlign),i.textBaseline="middle",r=K(n.footerFont),i.fillStyle=n.footerColor,i.font=r.string,a=0;a<o;++a)i.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,i,n,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=n,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=$t(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(a+u,l),r==="top"&&this.drawCaret(t,i,n,s),i.lineTo(a+c-d,l),i.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,i,n,s),i.lineTo(a+c,l+h-g),i.quadraticCurveTo(a+c,l+h,a+c-g,l+h),r==="bottom"&&this.drawCaret(t,i,n,s),i.lineTo(a+f,l+h),i.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,i,n,s),i.lineTo(a,l+u),i.quadraticCurveTo(a,l,a+u,l),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){let i=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){let r=vi[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=oc(this,t),l=Object.assign({},r,this._size),c=rc(i,t,l),h=ac(t,l,c,i);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let i=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(i);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let r=Z(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,i),ro(t,i.textDirection),o.y+=r.top,this.drawTitle(o,t,i),this.drawBody(o,t,i),this.drawFooter(o,t,i),ao(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){let n=this._active,s=t.map(({datasetIndex:a,index:l})=>{let c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!hi(n,s),r=this._positionChanged(s,i);(o||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,n=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,i,n),a=this._positionChanged(r,t),l=i||!hi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,n,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,i){let{caretX:n,caretY:s,options:o}=this,r=vi[o.position].call(this,t,i);return r!==!1&&(n!==r.x||s!==r.y)}};S(Ai,"positioners",vi);var Vm={id:"tooltip",_element:Ai,positioners:vi,afterInit(e,t,i){i&&(e.tooltip=new Ai({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let i={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){let i=t.replay;e.tooltip.handleEvent(t.event,i,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:Bc},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"]},jm=Object.freeze({__proto__:null,Colors:em,Decimation:om,Filler:km,Legend:Dm,SubTitle:Rm,Title:Lm,Tooltip:Vm}),$m=(e,t,i,n)=>(typeof t=="string"?(i=e.push(t)-1,n.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);function Ym(e,t,i,n){let s=e.indexOf(t);if(s===-1)return $m(e,t,i,n);let o=e.lastIndexOf(t);return s!==o?i:s}var Um=(e,t)=>e===null?null:X(Math.round(e),0,t);function hc(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}var wi=class extends pe{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let i=this._addedLabels;if(i.length){let n=this.getLabels();for(let{index:s,label:o}of i)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(T(t))return null;let n=this.getLabels();return i=isFinite(i)&&n[i]===t?i:Ym(n,t,C(i,t),this._addedLabels),Um(i,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),i||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){let t=this.min,i=this.max,n=this.options.offset,s=[],o=this.getLabels();o=t===0&&i===o.length-1?o:o.slice(t,i+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=i;r++)s.push({value:r});return s}getLabelForValue(t){return hc.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){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};S(wi,"id","category"),S(wi,"defaults",{ticks:{callback:hc}});function Km(e,t){let i=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=e,f=o||1,g=h-1,{min:m,max:p}=t,b=!T(r),_=!T(a),y=!T(c),v=(p-m)/(u+1),x=Ns((p-m)/g/f)*f,w,M,k,A;if(x<1e-14&&!b&&!_)return[{value:m},{value:p}];A=Math.ceil(p/x)-Math.floor(m/x),A>g&&(x=Ns(A*x/g/f)*f),T(l)||(w=Math.pow(10,l),x=Math.ceil(x*w)/w),s==="ticks"?(M=Math.floor(m/x)*x,k=Math.ceil(p/x)*x):(M=m,k=p),b&&_&&o&&Ja((a-r)/o,x/1e3)?(A=Math.round(Math.min((a-r)/x,h)),x=(a-r)/A,M=r,k=a):y?(M=b?r:M,k=_?a:k,A=c-1,x=(k-M)/A):(A=(k-M)/x,De(A,Math.round(A),x/1e3)?A=Math.round(A):A=Math.ceil(A));let P=Math.max(Ws(x),Ws(M));w=Math.pow(10,T(l)?P:l),M=Math.round(M*w)/w,k=Math.round(k*w)/w;let O=0;for(b&&(d&&M!==r?(i.push({value:r}),M<r&&O++,De(Math.round((M+O*x)*w)/w,r,uc(r,v,e))&&O++):M<r&&O++);O<A;++O){let E=Math.round((M+O*x)*w)/w;if(_&&E>a)break;i.push({value:E})}return _&&d&&k!==a?i.length&&De(i[i.length-1].value,a,uc(a,v,e))?i[i.length-1].value=a:i.push({value:a}):(!_||k===a)&&i.push({value:k}),i}function uc(e,t,{horizontal:i,minRotation:n}){let s=ht(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}var Ye=class extends pe{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,i){return T(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:i,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=i?s:l,a=l=>o=n?o:l;if(t){let l=pt(s),c=pt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{maxTicksLimit:i,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),i=i||11),i&&(s=Math.min(i,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,i=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.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,r=Km(s,o);return t.bounds==="ticks"&&Hs(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(){let t=this.ticks,i=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let s=(n-i)/Math.max(t.length-1,1)/2;i-=s,n+=s}this._startValue=i,this._endValue=n,this._valueRange=n-i}getLabelForValue(t){return Le(t,this.chart.options.locale,this.options.ticks.format)}},Si=class extends Ye{determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=j(t)?t:0,this.max=j(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),i=t?this.width:this.height,n=ht(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}};S(Si,"id","linear"),S(Si,"defaults",{ticks:{callback:ui.formatters.numeric}});var Oi=e=>Math.floor(Ct(e)),he=(e,t)=>Math.pow(10,Oi(e)+t);function dc(e){return e/Math.pow(10,Oi(e))===1}function fc(e,t,i){let n=Math.pow(10,i),s=Math.floor(e/n);return Math.ceil(t/n)-s}function Xm(e,t){let i=t-e,n=Oi(i);for(;fc(e,t,n)>10;)n++;for(;fc(e,t,n)<10;)n--;return Math.min(n,Oi(e))}function qm(e,{min:t,max:i}){t=it(e.min,t);let n=[],s=Oi(t),o=Xm(t,i),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10,u=Math.floor((c-h)/Math.pow(10,o)),d=it(e.min,Math.round((l+h+u*Math.pow(10,o))*r)/r);for(;d<i;)n.push({value:d,major:dc(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),d=Math.round((l+h+u*Math.pow(10,o))*r)/r;let f=it(e.max,d);return n.push({value:f,major:dc(f),significand:u}),n}var Mi=class extends pe{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,i){let n=Ye.prototype.parse.apply(this,[t,i]);if(n===0){this._zero=!0;return}return j(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=j(t)?Math.max(0,t):null,this.max=j(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!j(this._userMin)&&(this.min=t===he(this.min,0)?he(this.min,-1):he(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),n=this.min,s=this.max,o=a=>n=t?n:a,r=a=>s=i?s:a;n===s&&(n<=0?(o(1),r(10)):(o(he(n,-1)),r(he(s,1)))),n<=0&&o(he(s,-1)),s<=0&&r(he(n,1)),this.min=n,this.max=s}buildTicks(){let t=this.options,i={min:this._userMin,max:this._userMax},n=qm(i,this);return t.bounds==="ticks"&&Hs(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":Le(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Ct(t),this._valueRange=Ct(this.max)-Ct(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ct(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let i=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+i*this._valueRange)}};S(Mi,"id","logarithmic"),S(Mi,"defaults",{ticks:{callback:ui.formatters.logarithmic,major:{enabled:!0}}});function Fo(e){let t=e.ticks;if(t.display&&e.display){let i=Z(t.backdropPadding);return C(t.font&&t.font.size,H.font.size)+i.height}return 0}function Gm(e,t,i){return i=z(i)?i:[i],{w:rl(e,t.string,i),h:i.length*t.lineHeight}}function gc(e,t,i,n,s){return e===n||e===s?{start:t-i/2,end:t+i/2}:e<n||e>s?{start:t-i,end:t}:{start:t,end:t+i}}function Jm(e){let 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},i=Object.assign({},t),n=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?L/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let h=e.getPointPosition(l,e.drawingArea+s[l],a),u=K(c.font),d=Gm(e.ctx,u,e._pointLabels[l]);n[l]=d;let f=G(e.getIndexAngle(l)+a),g=Math.round(hn(f)),m=gc(g,h.x,d.w,0,180),p=gc(g,h.y,d.h,90,270);Zm(i,t,f,m,p)}e.setCenterPoint(t.l-i.l,i.r-t.r,t.t-i.t,i.b-t.b),e._pointLabelItems=eb(e,n,s)}function Zm(e,t,i,n,s){let o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,e.l=Math.min(e.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function Qm(e,t,i){let n=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=e.getPointPosition(t,n+s+r,o),c=Math.round(hn(G(l.angle+$))),h=sb(l.y,a.h,c),u=ib(c),d=nb(l.x,a.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function tb(e,t){if(!t)return!0;let{left:i,top:n,right:s,bottom:o}=e;return!(_t({x:i,y:n},t)||_t({x:i,y:o},t)||_t({x:s,y:n},t)||_t({x:s,y:o},t))}function eb(e,t,i){let n=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Fo(o)/2,additionalAngle:r?L/s:0},c;for(let h=0;h<s;h++){l.padding=i[h],l.size=t[h];let u=Qm(e,h,l);n.push(u),a==="auto"&&(u.visible=tb(u,c),u.visible&&(c=u))}return n}function ib(e){return e===0||e===180?"center":e<180?"left":"right"}function nb(e,t,i){return i==="right"?e-=t:i==="center"&&(e-=t/2),e}function sb(e,t,i){return i===90||i===270?e-=t/2:(i>270||i<90)&&(e-=t),e}function ob(e,t,i){let{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=t;if(!T(a)){let l=$t(t.borderRadius),c=Z(t.backdropPadding);e.fillStyle=a;let h=n-c.left,u=s-c.top,d=o-n+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),Re(e,{x:h,y:u,w:d,h:f,radius:l}),e.fill()):e.fillRect(h,u,d,f)}}function rb(e,t){let{ctx:i,options:{pointLabels:n}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=n.setContext(e.getPointLabelContext(s));ob(i,r,o);let a=K(r.font),{x:l,y:c,textAlign:h}=o;jt(i,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Nc(e,t,i,n){let{ctx:s}=e;if(i)s.arc(e.xCenter,e.yCenter,t,0,B);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function ab(e,t,i,n,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Nc(e,i,r,n),o.closePath(),o.stroke(),o.restore())}function lb(e,t,i){return Ot(e,{label:i,index:t,type:"pointLabel"})}var de=class extends Ye{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=Z(Fo(this.options)/2),i=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+i/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(i,n)/2)}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!1);this.min=j(t)&&!isNaN(t)?t:0,this.max=j(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Fo(this.options))}generateTickLabels(t){Ye.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((i,n)=>{let s=F(this.options.pointLabels.callback,[i,n],this);return s||s===0?s:""}).filter((i,n)=>this.chart.getDataVisibility(n))}fit(){let t=this.options;t.display&&t.pointLabels.display?Jm(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,i,n,s){this.xCenter+=Math.floor((t-i)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,i,n,s))}getIndexAngle(t){let i=B/(this._pointLabels.length||1),n=this.options.startAngle||0;return G(t*i+ht(n))}getDistanceFromCenterForValue(t){if(T(t))return NaN;let i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*i:(t-this.min)*i}getValueForDistanceFromCenter(t){if(T(t))return NaN;let i=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(t){let i=this._pointLabels||[];if(t>=0&&t<i.length){let n=i[t];return lb(this.getContext(),t,n)}}getPointPosition(t,i,n=0){let s=this.getIndexAngle(t)-$+n;return{x:Math.cos(s)*i+this.xCenter,y:Math.sin(s)*i+this.yCenter,angle:s}}getPointPositionForValue(t,i){return this.getPointPosition(t,this.getDistanceFromCenterForValue(i))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:i,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:i,top:n,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:i}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),Nc(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){let t=this.ctx,i=this.options,{angleLines:n,grid:s,border:o}=i,r=this._pointLabels.length,a,l,c;if(i.pointLabels.display&&rb(this,r),s.display&&this.ticks.forEach((h,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let d=this.getContext(u),f=s.setContext(d),g=o.setContext(d);ab(this,f,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){let h=n.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:d}=h;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(i.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,i=this.options,n=i.ticks;if(!n.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!i.reverse)return;let c=n.setContext(this.getContext(l)),h=K(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let u=Z(c.backdropPadding);t.fillRect(-r/2-u.left,-o-h.size/2-u.top,r+u.width,h.size+u.height)}jt(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};S(de,"id","radialLinear"),S(de,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ui.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),S(de,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),S(de,"descriptors",{angleLines:{_fallback:"grid"}});var In={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(In);function pc(e,t){return e-t}function mc(e,t){if(T(t))return null;let i=e._adapter,{parser:n,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof n=="function"&&(r=n(r)),j(r)||(r=typeof n=="string"?i.parse(r,n):i.parse(r)),r===null?null:(s&&(r=s==="week"&&(ae(o)||o===!0)?i.startOf(r,"isoWeek",o):i.startOf(r,s)),+r)}function bc(e,t,i,n){let s=st.length;for(let o=st.indexOf(e);o<s-1;++o){let r=In[st[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((i-t)/(a*r.size))<=n)return st[o]}return st[s-1]}function cb(e,t,i,n,s){for(let o=st.length-1;o>=st.indexOf(i);o--){let r=st[o];if(In[r].common&&e._adapter.diff(s,n,r)>=t-1)return r}return st[i?st.indexOf(i):0]}function hb(e){for(let t=st.indexOf(e)+1,i=st.length;t<i;++t)if(In[st[t]].common)return st[t]}function _c(e,t,i){if(!i)e[t]=!0;else if(i.length){let{lo:n,hi:s}=un(i,t),o=i[n]>=t?i[n]:i[s];e[o]=!0}}function ub(e,t,i,n){let s=e._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=i[a],l>=0&&(t[l].major=!0);return t}function xc(e,t,i){let n=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!i?n:ub(e,n,s,i)}var ge=class extends pe{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,i={}){let n=t.time||(t.time={}),s=this._adapter=new Mg._date(t.adapters.date);s.init(i),Oe(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=i.normalized}parse(t,i){return t===void 0?null:mc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,i=this._adapter,n=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=j(s)&&!isNaN(s)?s:+i.startOf(Date.now(),n),o=j(o)&&!isNaN(o)?o:+i.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(i=t[0],n=t[t.length-1]),{min:i,max:n}}buildTicks(){let t=this.options,i=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=tl(s,o,r);return this._unit=i.unit||(n.autoSkip?bc(i.minUnit,this.min,this.max,this._getLabelCapacity(o)):cb(this,a.length,i.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:hb(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),xc(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let i=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?i=1-s:i=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;i=X(i,0,r),n=X(n,0,r),this._offsets={start:i,end:n,factor:1/(i+1+n)}}_generate(){let t=this._adapter,i=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||bc(o.minUnit,i,n,this._getLabelCapacity(i)),a=C(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=ae(l)||l===!0,h={},u=i,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":r),t.diff(n,i,r)>1e5*a)throw new Error(i+" and "+n+" are too far apart with stepSize of "+a+" "+r);let g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<n;d=+t.add(d,a,r),f++)_c(h,d,g);return(d===n||s.bounds==="ticks"||f===1)&&_c(h,d,g),Object.keys(h).sort(pc).map(m=>+m)}getLabelForValue(t){let i=this._adapter,n=this.options.time;return n.tooltipFormat?i.format(t,n.tooltipFormat):i.format(t,n.displayFormats.datetime)}format(t,i){let s=this.options.time.displayFormats,o=this._unit,r=i||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,i,n,s){let o=this.options,r=o.ticks.callback;if(r)return F(r,[t,i,n],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],u=c&&a[c],d=n[i],f=c&&u&&d&&d.major;return this._adapter.format(t,s||(f?u:h))}generateTickLabels(t){let i,n,s;for(i=0,n=t.length;i<n;++i)s=t[i],s.label=this._tickFormatFunction(s.value,i,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let i=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((i.start+n)*i.factor)}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let i=this.options.ticks,n=this.ctx.measureText(t).width,s=ht(this.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){let i=this.options.time,n=i.displayFormats,s=n[i.unit]||n.millisecond,o=this._tickFormatFunction(t,0,xc(this,[t],this._majorUnit),s),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||[],i,n;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(i=0,n=s.length;i<n;++i)t=t.concat(s[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],i,n;if(t.length)return t;let s=this.getLabels();for(i=0,n=s.length;i<n;++i)t.push(mc(this,s[i]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return $s(t.sort(pc))}};S(ge,"id","time"),S(ge,"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 kn(e,t,i){let n=0,s=e.length-1,o,r,a,l;i?(t>=e[n].pos&&t<=e[s].pos&&({lo:n,hi:s}=bt(e,"pos",t)),{pos:o,time:a}=e[n],{pos:r,time:l}=e[s]):(t>=e[n].time&&t<=e[s].time&&({lo:n,hi:s}=bt(e,"time",t)),{time:o,pos:a}=e[n],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var ki=class extends ge{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=kn(i,this.min),this._tableRange=kn(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:i,max:n}=this,s=[],o=[],r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=i&&c<=n&&s.push(c);if(s.length<2)return[{time:i,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r<a;++r)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,i=this.max,n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(i)||n.length===1)&&n.push(i),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let i=this.getDataTimestamps(),n=this.getLabelTimestamps();return i.length&&n.length?t=this.normalize(i.concat(n)):t=i.length?i:n,t=this._cache.all=t,t}getDecimalForValue(t){return(kn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return kn(this._table,n*this._tableRange+this._minPos,!0)}};S(ki,"id","timeseries"),S(ki,"defaults",ge.defaults);var db=Object.freeze({__proto__:null,CategoryScale:wi,LinearScale:Si,LogarithmicScale:Mi,RadialLinearScale:de,TimeScale:ge,TimeSeriesScale:ki}),Hc=[Sg,Xp,jm,db];ut.register(...Hc);var Wc=ut;var fb=50,Vc=[{key:"memory",label:"Memory",color:"blue",hidden:!1},{key:"total_heap_size",label:"Total Heap Size",color:"red",hidden:!0},{key:"heap_size",label:"Heap Size",color:"green",hidden:!0},{key:"stack_size",label:"Stack Size",color:"orange",hidden:!0},{key:"reductions",label:"Reductions",color:"purple",hidden:!0},{key:"message_queue_len",label:"Message Queue Length",color:"cyan",hidden:!0}],gb={mounted(){this.initializeChart(),this.setupEventHandlers()},setupEventHandlers(){this.handleEvent("update-chart",e=>{this.updateChartData(e)})},initializeChart(){let e=getComputedStyle(document.documentElement),t=e.getPropertyValue("--primary-text").trim(),i=e.getPropertyValue("--default-border").trim();this.chart=new Wc(this.el,{type:"line",data:{labels:[],datasets:this.createDatasets()},options:this.createChartOptions(t,i)})},createDatasets(){return Vc.map(({label:e,color:t,hidden:i})=>({label:e,backgroundColor:t,borderColor:t,hidden:i,data:[]}))},createChartOptions(e,t){return{responsive:!0,maintainAspectRatio:!1,animation:!1,plugins:{legend:{labels:{color:e}}},scales:{x:{ticks:{color:e},grid:{color:t}},y:{ticks:{color:e},grid:{color:t},beginAtZero:!0}}}},updateChartData(e){let t=this.formatTimestamp();this.chart.data.labels.push(t),Vc.forEach(({key:i},n)=>{let s=Number(e[i]);this.chart.data.datasets[n].data.push(s)}),this.trimOldDataIfNeeded(),this.chart.update("none")},formatTimestamp(){return new Date().toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})},trimOldDataIfNeeded(){this.chart.data.labels.length>fb&&(this.chart.data.labels.shift(),this.chart.data.datasets.forEach(e=>e.data.shift()))}},jc=gb;var pb={mounted(){let e=this.el.closest("details");this.handleEvent(`${this.el.id}-pulse`,()=>{e.open||(e.classList.add("animate-section-pulse"),setTimeout(()=>{e.classList.remove("animate-section-pulse")},500))})}},$c=pb;var zn=eh(Uc());Ji.start();Ji.plugin(ua);window.Alpine=Ji;zn.default.config({barColors:{0:"#29d"},shadowColor:"rgba(0, 0, 0, .3)"});window.addEventListener("phx:page-loading-start",e=>zn.default.show(300));window.addEventListener("phx:page-loading-stop",e=>zn.default.hide());function mb(){return{Collapsible:fa,Fullscreen:ga,Tooltip:ma,ToggleTheme:pa,Highlight:ba,LiveDropdown:_a,AutoClearFlash:xa,TraceExecutionTime:ya,CopyButton:va,TraceBodySearchHighlight:wa,TraceLabelSearchHighlight:ka,AssignsBodySearchHighlight:Ca,DiffPulse:Pa,ChartHook:jc,CollapsedSectionPulse:$c}}function bb(){return(e,t)=>{["DIALOG","DETAILS"].indexOf(e.tagName)>=0&&Array.from(e.attributes).forEach(i=>{t.setAttribute(i.name,i.value)})}}function _b(){switch(localStorage.theme){case"light":document.documentElement.classList.remove("dark");break;case"dark":document.documentElement.classList.add("dark");break;default:let e=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.classList.toggle("dark",e),localStorage.theme=e?"dark":"light";break}}function xb(){return document.querySelector("meta[name='csrf-token']").getAttribute("content")}function yb(e){e.key==="theme"&&document.documentElement.classList.toggle("dark",e.newValue==="dark")}window.addEventListener("storage",yb);window.createHooks=mb;window.setTheme=_b;window.getCsrfToken=xb;window.saveDialogAndDetailsState=bb;})();
/**
* @license MIT
* topbar 2.0.0, 2023-02-04
* https://buunguyen.github.io/topbar
* Copyright (c) 2021 Buu Nguyen
*/
/*! Bundled license information:
@kurkle/color/dist/color.esm.js:
(*!
* @kurkle/color v0.3.4
* https://github.com/kurkle/color#readme
* (c) 2024 Jukka Kurkela
* Released under the MIT License
*)
chart.js/dist/chunks/helpers.dataset.js:
(*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*)
chart.js/dist/chart.js:
(*!
* Chart.js v4.5.1
* https://www.chartjs.org
* (c) 2025 Chart.js Contributors
* Released under the MIT License
*)
*/