(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["linkAnalytics"],{"03f6":function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));i("99af");var s=function(t){return"custom"===t.linkType?"".concat(t.linkType,"_").concat(t.url):"banner"===t.linkType?"".concat(t.linkType,"_").concat(t.bannerId):"".concat(t.linkType,"_").concat(t.username)}},"0c00":function(t,e,i){"use strict";i.d(e,"a",(function(){return g}));var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("canvas",{ref:"canvasEl"})},n=[],a=(i("96cf"),i("1da1")),o=i("a34a"),r=i.n(o),l=i("a6f4"),h=i("9b4a"),c=Object(l["c"])({name:"StatisticChart",props:{config:{type:Object,required:!0}},setup:function(t){var e=Object(l["o"])();return Object(l["j"])(Object(a["a"])(r.a.mark((function i(){return r.a.wrap((function(i){while(1)switch(i.prev=i.next){case 0:e.value&&new h["d"](e.value,t.config);case 1:case"end":return i.stop()}}),i)})))),{canvasEl:e}}}),d=c,u=i("2877"),f=Object(u["a"])(d,s,n,!1,null,null,null),g=f.exports},"0c9a":function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return M}));var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("base-page",{staticClass:"page-profile-analytics pa-4"},[i("page-title",[t._v(t._s(t.$t("Profile analytics")))]),i("div",{staticClass:"page-profile-analytics__stat d-flex mb-4"},[i("base-menu",{staticClass:"page-profile-analytics__menu",scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[i("div",{staticClass:"page-profile-analytics__menu-activator body-2 d-flex"},[i("div",{staticClass:"page-profile-analytics__menu-activator-description mr-2"},[t._v(t._s(t.$t("Date range:")))]),i("div",t._g({staticClass:"page-profile-analytics__menu-activator-date"},s),[t._v(" "+t._s(t.currentDateRange.title)+" "),i("base-icon",[t._v("sci-chevron-down")])],1)])]}}])},[i("base-list",t._l(t.dateRanges,(function(e){return i("base-list-item",{key:e.interval,on:{click:function(i){return t.onChangeDateRange(e)}}},[t._v(" "+t._s(e.title)+" ")])})),1)],1),i("div",{staticClass:"page-profile-analytics__time-range"},[t._v(" "+t._s(t.dateInterval)+" ")])],1),i("div",{staticClass:"page-profile-analytics__visits-stat pb-6"},[i("div",{staticClass:"page-profile-analytics__profile-visits"},[t._v(" "+t._s(t.$t("Profile visits"))+" ")]),i("div",{staticClass:"page-profile-analytics__clicks"},[t._v(" "+t._s(t.linksStat?t.linksStat.totalClicks:"")+" ")])]),t.computedChartData?i("statistic-chart",{staticClass:"page-profile-analytics__chart",attrs:{config:t.config}}):t._e()],1)},n=[],a=(i("99af"),i("d81d"),i("96cf"),i("1da1")),o=i("5530"),r=i("a34a"),l=i.n(r),h=i("a6f4"),c=i("9b4a"),d=i("4afc"),u=i("ff07"),f=i("76da"),g=i("f00d"),p=i("1031"),m=i("855c"),b=i("0c00"),x=i("75c7"),_=i("9058");c["d"].register({BarElement:c["b"],BarController:c["a"],LineElement:c["f"],LineController:c["e"],CategoryScale:c["c"],LinearScale:c["g"],Tooltip:c["i"],PointElement:c["h"]});var y=Object(h["c"])({name:"PageProfileAnalytics",components:{StatisticChart:b["a"],PageTitle:p["a"],BasePage:m["a"],BaseList:x["b"],BaseListItem:x["a"],BaseIcon:_["a"]},setup:function(){var t=Object(d["a"])(),e=t.authUserStrict,i=Object(h["o"])(),s=Object(h["o"])(g["b"][0]),n=Object(h["o"])(!1),r=Object(h["a"])((function(){var t,e,s=null!==(t=i.value)&&void 0!==t&&t.items[0].date?Object(f["format"])(new Date(null===(e=i.value)||void 0===e?void 0:e.items[0].date),"MM/dd/yy"):null,n=Object(f["format"])(new Date,"MM/dd/yy");return"".concat(s," - ").concat(n)})),c=Object(h["a"])((function(){var t,e,n,a,r={labels:null!==(t=null===(e=i.value)||void 0===e?void 0:e.items.map((function(t){return Object(f["format"])(new Date(t.date),"MM/dd")})))&&void 0!==t?t:[],datasets:[Object(o["a"])(Object(o["a"])({},g["a"].data.datasets[0]),{},{data:null!==(n=null===(a=i.value)||void 0===a?void 0:a.items.map((function(t){return t.clickCount})))&&void 0!==n?n:[]})]};return Object(o["a"])(Object(o["a"])({},g["a"]),{},{data:Object(o["a"])({},r),type:s.value.chartType})})),p=function(){var t=Object(a["a"])(l.a.mark((function t(n){var a;return l.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a={link:n,interval:s.value.interval,userId:e.value.id},t.next=3,u["a"].LinksStatsProvider.linksStat({data:a});case 3:i.value=t.sent;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),m=function(){var t=Object(a["a"])(l.a.mark((function t(){return l.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return n.value=!1,t.prev=1,t.next=4,p("profile_views_".concat(e.value.id));case 4:return t.prev=4,n.value=!0,t.finish(4);case 7:case"end":return t.stop()}}),t,null,[[1,,4,7]])})));return function(){return t.apply(this,arguments)}}(),b=function(){var t=Object(a["a"])(l.a.mark((function t(e){return l.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return s.value=e,t.next=3,m();case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();return m(),{linksStat:i,config:c,dateInterval:r,computedChartData:n,dateRanges:g["b"],currentDateRange:s,onSetChartByProfile:m,onChangeDateRange:b}}}),v=y,k=(i("1c68"),i("2877")),w=Object(k["a"])(v,s,n,!1,null,"73259af2",null),M=w.exports},"1c68":function(t,e,i){"use strict";i("2a6a")},"2a6a":function(t,e,i){},"901f":function(t,e,i){},"9b4a":function(t,e,i){"use strict";i.d(e,"a",(function(){return qs})),i.d(e,"b",(function(){return Uo})),i.d(e,"c",(function(){return gr})),i.d(e,"d",(function(){return ho})),i.d(e,"e",(function(){return Qs})),i.d(e,"f",(function(){return Eo})),i.d(e,"g",(function(){return xr})),i.d(e,"h",(function(){return Fo})),i.d(e,"i",(function(){return cr}));const s=function(){return"undefined"===typeof window?function(t){return t()}:window.requestAnimationFrame}();function n(t,e,i){const n=i||(t=>Array.prototype.slice.call(t));let a=!1,o=[];return function(...i){o=n(i),a||(a=!0,s.call(window,()=>{a=!1,t.apply(e,o)}))}}function a(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const o=t=>"start"===t?"left":"end"===t?"right":"center",r=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2;function l(){}const h=function(){let t=0;return function(){return t++}}();function c(t){return null===t||"undefined"===typeof t}function d(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function u(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const f=t=>("number"===typeof t||t instanceof Number)&&isFinite(+t);function g(t,e){return f(t)?t:e}function p(t,e){return"undefined"===typeof t?e:t}const m=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,b=(t,e)=>"string"===typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function x(t,e,i){if(t&&"function"===typeof t.call)return t.apply(i,e)}function _(t,e,i,s){let n,a,o;if(d(t))if(a=t.length,s)for(n=a-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;n<a;n++)e.call(i,t[n],n);else if(u(t))for(o=Object.keys(t),a=o.length,n=0;n<a;n++)e.call(i,t[o[n]],o[n])}function y(t,e){let i,s,n,a;if(!t||!e||t.length!==e.length)return!1;for(i=0,s=t.length;i<s;++i)if(n=t[i],a=e[i],n.datasetIndex!==a.datasetIndex||n.index!==a.index)return!1;return!0}function v(t){if(d(t))return t.map(v);if(u(t)){const e=Object.create(null),i=Object.keys(t),s=i.length;let n=0;for(;n<s;++n)e[i[n]]=v(t[i[n]]);return e}return t}function k(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function w(t,e,i,s){if(!k(t))return;const n=e[t],a=i[t];u(n)&&u(a)?M(n,a,s):e[t]=v(a)}function M(t,e,i){const s=d(e)?e:[e],n=s.length;if(!u(t))return t;i=i||{};const a=i.merger||w;for(let o=0;o<n;++o){if(e=s[o],!u(e))continue;const n=Object.keys(e);for(let s=0,o=n.length;s<o;++s)a(n[s],t,e,i)}return t}function S(t,e){return M(t,e,{merger:P})}function P(t,e,i){if(!k(t))return;const s=e[t],n=i[t];u(s)&&u(n)?S(s,n):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=v(n))}const O="",C=".";function D(t,e){const i=t.indexOf(C,e);return-1===i?t.length:i}function T(t,e){if(e===O)return t;let i=0,s=D(e,i);while(t&&s>i)t=t[e.substr(i,s-i)],i=s+1,s=D(e,i);return t}function L(t){return t.charAt(0).toUpperCase()+t.slice(1)}const A=t=>"undefined"!==typeof t,R=t=>"function"===typeof t,E=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0},I=Math.PI,F=2*I,z=F+I,V=Number.POSITIVE_INFINITY,j=I/180,B=I/2,N=I/4,W=2*I/3,H=Math.log10,$=Math.sign;function Y(t){const e=Math.round(t);t=q(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(H(t))),s=t/i,n=s<=1?1:s<=2?2:s<=5?5:10;return n*i}function U(t){const e=[],i=Math.sqrt(t);let s;for(s=1;s<i;s++)t%s===0&&(e.push(s),e.push(t/s));return i===(0|i)&&e.push(i),e.sort((t,e)=>t-e).pop(),e}function X(t){return!isNaN(parseFloat(t))&&isFinite(t)}function q(t,e,i){return Math.abs(t-e)<i}function K(t,e){const i=Math.round(t);return i-e<=t&&i+e>=t}function G(t,e,i){let s,n,a;for(s=0,n=t.length;s<n;s++)a=t[s][i],isNaN(a)||(e.min=Math.min(e.min,a),e.max=Math.max(e.max,a))}function Z(t){return t*(I/180)}function Q(t){return t*(180/I)}function J(t){if(!f(t))return;let e=1,i=0;while(Math.round(t*e)/e!==t)e*=10,i++;return i}function tt(t,e){const i=e.x-t.x,s=e.y-t.y,n=Math.sqrt(i*i+s*s);let a=Math.atan2(s,i);return a<-.5*I&&(a+=F),{angle:a,distance:n}}function et(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function it(t,e){return(t-e+z)%F-I}function st(t){return(t%F+F)%F}function nt(t,e,i,s){const n=st(t),a=st(e),o=st(i),r=st(a-n),l=st(o-n),h=st(n-a),c=st(n-o);return n===a||n===o||s&&a===o||r>l&&h<c}function at(t,e,i){return Math.max(e,Math.min(i,t))}function ot(t){return at(t,-32768,32767)}const rt=t=>0===t||1===t,lt=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*F/i),ht=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*F/i)+1,ct={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*B),easeOutSine:t=>Math.sin(t*B),easeInOutSine:t=>-.5*(Math.cos(I*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>rt(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>rt(t)?t:lt(t,.075,.3),easeOutElastic:t=>rt(t)?t:ht(t,.075,.3),easeInOutElastic(t){const e=.1125,i=.45;return rt(t)?t:t<.5?.5*lt(2*t,e,i):.5+.5*ht(2*t-1,e,i)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-ct.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*ct.easeInBounce(2*t):.5*ct.easeOutBounce(2*t-1)+.5},dt={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},ut="0123456789ABCDEF",ft=t=>ut[15&t],gt=t=>ut[(240&t)>>4]+ut[15&t],pt=t=>(240&t)>>4===(15&t);function mt(t){return pt(t.r)&&pt(t.g)&&pt(t.b)&&pt(t.a)}function bt(t){var e,i=t.length;return"#"===t[0]&&(4===i||5===i?e={r:255&17*dt[t[1]],g:255&17*dt[t[2]],b:255&17*dt[t[3]],a:5===i?17*dt[t[4]]:255}:7!==i&&9!==i||(e={r:dt[t[1]]<<4|dt[t[2]],g:dt[t[3]]<<4|dt[t[4]],b:dt[t[5]]<<4|dt[t[6]],a:9===i?dt[t[7]]<<4|dt[t[8]]:255})),e}function xt(t){var e=mt(t)?ft:gt;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function _t(t){return t+.5|0}const yt=(t,e,i)=>Math.max(Math.min(t,i),e);function vt(t){return yt(_t(2.55*t),0,255)}function kt(t){return yt(_t(255*t),0,255)}function wt(t){return yt(_t(t/2.55)/100,0,1)}function Mt(t){return yt(_t(100*t),0,100)}const St=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Pt(t){const e=St.exec(t);let i,s,n,a=255;if(e){if(e[7]!==i){const t=+e[7];a=255&(e[8]?vt(t):255*t)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?vt(i):i),s=255&(e[4]?vt(s):s),n=255&(e[6]?vt(n):n),{r:i,g:s,b:n,a:a}}}function Ot(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${wt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Ct=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Dt(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function Tt(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function Lt(t,e,i){const s=Dt(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function At(t){const e=255,i=t.r/e,s=t.g/e,n=t.b/e,a=Math.max(i,s,n),o=Math.min(i,s,n),r=(a+o)/2;let l,h,c;return a!==o&&(c=a-o,h=r>.5?c/(2-a-o):c/(a+o),l=a===i?(s-n)/c+(s<n?6:0):a===s?(n-i)/c+2:(i-s)/c+4,l=60*l+.5),[0|l,h||0,r]}function Rt(t,e,i,s){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,i,s)).map(kt)}function Et(t,e,i){return Rt(Dt,t,e,i)}function It(t,e,i){return Rt(Lt,t,e,i)}function Ft(t,e,i){return Rt(Tt,t,e,i)}function zt(t){return(t%360+360)%360}function Vt(t){const e=Ct.exec(t);let i,s=255;if(!e)return;e[5]!==i&&(s=e[6]?vt(+e[5]):kt(+e[5]));const n=zt(+e[2]),a=+e[3]/100,o=+e[4]/100;return i="hwb"===e[1]?It(n,a,o):"hsv"===e[1]?Ft(n,a,o):Et(n,a,o),{r:i[0],g:i[1],b:i[2],a:s}}function jt(t,e){var i=At(t);i[0]=zt(i[0]+e),i=Et(i),t.r=i[0],t.g=i[1],t.b=i[2]}function Bt(t){if(!t)return;const e=At(t),i=e[0],s=Mt(e[1]),n=Mt(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${wt(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}const Nt={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"},Wt={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 Ht(){const t={},e=Object.keys(Wt),i=Object.keys(Nt);let s,n,a,o,r;for(s=0;s<e.length;s++){for(o=r=e[s],n=0;n<i.length;n++)a=i[n],r=r.replace(a,Nt[a]);a=parseInt(Wt[o],16),t[r]=[a>>16&255,a>>8&255,255&a]}return t}let $t;function Yt(t){$t||($t=Ht(),$t.transparent=[0,0,0,0]);const e=$t[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function Ut(t,e,i){if(t){let s=At(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=Et(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function Xt(t,e){return t?Object.assign(e||{},t):t}function qt(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=kt(t[3]))):(e=Xt(t,{r:0,g:0,b:0,a:1}),e.a=kt(e.a)),e}function Kt(t){return"r"===t.charAt(0)?Pt(t):Vt(t)}class Gt{constructor(t){if(t instanceof Gt)return t;const e=typeof t;let i;"object"===e?i=qt(t):"string"===e&&(i=bt(t)||Yt(t)||Kt(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Xt(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=qt(t)}rgbString(){return this._valid?Ot(this._rgb):this._rgb}hexString(){return this._valid?xt(this._rgb):this._rgb}hslString(){return this._valid?Bt(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const s=i.rgb,n=t.rgb;let a;const o=e===a?.5:e,r=2*o-1,l=s.a-n.a,h=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;a=1-h,s.r=255&h*s.r+a*n.r+.5,s.g=255&h*s.g+a*n.g+.5,s.b=255&h*s.b+a*n.b+.5,s.a=o*s.a+(1-o)*n.a,i.rgb=s}return i}clone(){return new Gt(this.rgb)}alpha(t){return this._rgb.a=kt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=_t(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Ut(this._rgb,2,t),this}darken(t){return Ut(this._rgb,2,-t),this}saturate(t){return Ut(this._rgb,1,t),this}desaturate(t){return Ut(this._rgb,1,-t),this}rotate(t){return jt(this._rgb,t),this}}function Zt(t){return new Gt(t)}const Qt=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function Jt(t){return Qt(t)?t:Zt(t)}function te(t){return Qt(t)?t:Zt(t).saturate(.5).darken(.1).hexString()}const ee=Object.create(null),ie=Object.create(null);function se(t,e){if(!e)return t;const i=e.split(".");for(let s=0,n=i.length;s<n;++s){const e=i[s];t=t[e]||(t[e]=Object.create(null))}return t}function ne(t,e,i){return"string"===typeof e?M(se(t,e),i):M(se(t,""),e)}class ae{constructor(t){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=t=>t.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=(t,e)=>te(e.backgroundColor),this.hoverBorderColor=(t,e)=>te(e.borderColor),this.hoverColor=(t,e)=>te(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},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.describe(t)}set(t,e){return ne(this,t,e)}get(t){return se(this,t)}describe(t,e){return ne(ie,t,e)}override(t,e){return ne(ee,t,e)}route(t,e,i,s){const n=se(this,t),a=se(this,i),o="_"+e;Object.defineProperties(n,{[o]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[o],e=a[s];return u(t)?Object.assign({},e,t):p(t,e)},set(t){this[o]=t}}})}}var oe=new ae({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function re(t){return!t||c(t.size)||c(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function le(t,e,i,s,n){let a=e[n];return a||(a=e[n]=t.measureText(n).width,i.push(n)),a>s&&(s=a),s}function he(t,e,i,s){s=s||{};let n=s.data=s.data||{},a=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},a=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let o=0;const r=i.length;let l,h,c,u,f;for(l=0;l<r;l++)if(u=i[l],void 0!==u&&null!==u&&!0!==d(u))o=le(t,n,a,o,u);else if(d(u))for(h=0,c=u.length;h<c;h++)f=u[h],void 0===f||null===f||d(f)||(o=le(t,n,a,o,f));t.restore();const g=a.length/2;if(g>i.length){for(l=0;l<g;l++)delete n[a[l]];a.splice(0,g)}return o}function ce(t,e,i){const s=t.currentDevicePixelRatio,n=0!==i?Math.max(i/2,.5):0;return Math.round((e-n)*s)/s+n}function de(t,e){e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore()}function ue(t,e,i,s){let n,a,o,r,l;const h=e.pointStyle,c=e.rotation,d=e.radius;let u=(c||0)*j;if(h&&"object"===typeof h&&(n=h.toString(),"[object HTMLImageElement]"===n||"[object HTMLCanvasElement]"===n))return t.save(),t.translate(i,s),t.rotate(u),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),void t.restore();if(!(isNaN(d)||d<=0)){switch(t.beginPath(),h){default:t.arc(i,s,d,0,F),t.closePath();break;case"triangle":t.moveTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=W,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),u+=W,t.lineTo(i+Math.sin(u)*d,s-Math.cos(u)*d),t.closePath();break;case"rectRounded":l=.516*d,r=d-l,a=Math.cos(u+N)*r,o=Math.sin(u+N)*r,t.arc(i-a,s-o,l,u-I,u-B),t.arc(i+o,s-a,l,u-B,u),t.arc(i+a,s+o,l,u,u+B),t.arc(i-o,s+a,l,u+B,u+I),t.closePath();break;case"rect":if(!c){r=Math.SQRT1_2*d,t.rect(i-r,s-r,2*r,2*r);break}u+=N;case"rectRot":a=Math.cos(u)*d,o=Math.sin(u)*d,t.moveTo(i-a,s-o),t.lineTo(i+o,s-a),t.lineTo(i+a,s+o),t.lineTo(i-o,s+a),t.closePath();break;case"crossRot":u+=N;case"cross":a=Math.cos(u)*d,o=Math.sin(u)*d,t.moveTo(i-a,s-o),t.lineTo(i+a,s+o),t.moveTo(i+o,s-a),t.lineTo(i-o,s+a);break;case"star":a=Math.cos(u)*d,o=Math.sin(u)*d,t.moveTo(i-a,s-o),t.lineTo(i+a,s+o),t.moveTo(i+o,s-a),t.lineTo(i-o,s+a),u+=N,a=Math.cos(u)*d,o=Math.sin(u)*d,t.moveTo(i-a,s-o),t.lineTo(i+a,s+o),t.moveTo(i+o,s-a),t.lineTo(i-o,s+a);break;case"line":a=Math.cos(u)*d,o=Math.sin(u)*d,t.moveTo(i-a,s-o),t.lineTo(i+a,s+o);break;case"dash":t.moveTo(i,s),t.lineTo(i+Math.cos(u)*d,s+Math.sin(u)*d);break}t.fill(),e.borderWidth>0&&t.stroke()}}function fe(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.x<e.right+i&&t.y>e.top-i&&t.y<e.bottom+i}function ge(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function pe(t){t.restore()}function me(t,e,i,s,n){if(!e)return t.lineTo(i.x,i.y);if("middle"===n){const s=(e.x+i.x)/2;t.lineTo(s,e.y),t.lineTo(s,i.y)}else"after"===n!==!!s?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);t.lineTo(i.x,i.y)}function be(t,e,i,s){if(!e)return t.lineTo(i.x,i.y);t.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?i.cp2x:i.cp1x,s?i.cp2y:i.cp1y,i.x,i.y)}function xe(t,e,i,s,n,a={}){const o=d(e)?e:[e],r=a.strokeWidth>0&&""!==a.strokeColor;let l,h;for(t.save(),t.font=n.string,_e(t,a),l=0;l<o.length;++l)h=o[l],r&&(a.strokeColor&&(t.strokeStyle=a.strokeColor),c(a.strokeWidth)||(t.lineWidth=a.strokeWidth),t.strokeText(h,i,s,a.maxWidth)),t.fillText(h,i,s,a.maxWidth),ye(t,i,s,h,a),s+=n.lineHeight;t.restore()}function _e(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),c(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function ye(t,e,i,s,n){if(n.strikethrough||n.underline){const a=t.measureText(s),o=e-a.actualBoundingBoxLeft,r=e+a.actualBoundingBoxRight,l=i-a.actualBoundingBoxAscent,h=i+a.actualBoundingBoxDescent,c=n.strikethrough?(l+h)/2:h;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=n.decorationWidth||2,t.moveTo(o,c),t.lineTo(r,c),t.stroke()}}function ve(t,e){const{x:i,y:s,w:n,h:a,radius:o}=e;t.arc(i+o.topLeft,s+o.topLeft,o.topLeft,-B,I,!0),t.lineTo(i,s+a-o.bottomLeft),t.arc(i+o.bottomLeft,s+a-o.bottomLeft,o.bottomLeft,I,B,!0),t.lineTo(i+n-o.bottomRight,s+a),t.arc(i+n-o.bottomRight,s+a-o.bottomRight,o.bottomRight,B,0,!0),t.lineTo(i+n,s+o.topRight),t.arc(i+n-o.topRight,s+o.topRight,o.topRight,0,-B,!0),t.lineTo(i+o.topLeft,s)}const ke=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),we=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Me(t,e){const i=(""+t).match(ke);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100;break}return e*t}const Se=t=>+t||0;function Pe(t,e){const i={},s=u(e),n=s?Object.keys(e):e,a=u(t)?s?i=>p(t[i],t[e[i]]):e=>t[e]:()=>t;for(const o of n)i[o]=Se(a(o));return i}function Oe(t){return Pe(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Ce(t){return Pe(t,["topLeft","topRight","bottomLeft","bottomRight"])}function De(t){const e=Oe(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Te(t,e){t=t||{},e=e||oe.font;let i=p(t.size,e.size);"string"===typeof i&&(i=parseInt(i,10));let s=p(t.style,e.style);s&&!(""+s).match(we)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:p(t.family,e.family),lineHeight:Me(p(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:p(t.weight,e.weight),string:""};return n.string=re(n),n}function Le(t,e,i,s){let n,a,o,r=!0;for(n=0,a=t.length;n<a;++n)if(o=t[n],void 0!==o&&(void 0!==e&&"function"===typeof o&&(o=o(e),r=!1),void 0!==i&&d(o)&&(o=o[i%o.length],r=!1),void 0!==o))return s&&!r&&(s.cacheable=!1),o}function Ae(t,e,i){const{min:s,max:n}=t,a=b(e,(n-s)/2),o=(t,e)=>i&&0===t?0:t+e;return{min:o(s,-Math.abs(a)),max:o(n,a)}}function Re(t,e){return Object.assign(Object.create(t),e)}function Ee(t,e,i){i=i||(i=>t[i]<e);let s,n=t.length-1,a=0;while(n-a>1)s=a+n>>1,i(s)?a=s:n=s;return{lo:a,hi:n}}const Ie=(t,e,i)=>Ee(t,i,s=>t[s][e]<i),Fe=(t,e,i)=>Ee(t,i,s=>t[s][e]>=i);function ze(t,e,i){let s=0,n=t.length;while(s<n&&t[s]<e)s++;while(n>s&&t[n-1]>i)n--;return s>0||n<t.length?t.slice(s,n):t}const Ve=["push","pop","shift","splice","unshift"];function je(t,e){t._chartjs?t._chartjs.listeners.push(e):(Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Ve.forEach(e=>{const i="_onData"+L(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach(t=>{"function"===typeof t[i]&&t[i](...e)}),n}})}))}function Be(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(Ve.forEach(e=>{delete t[e]}),delete t._chartjs)}function Ne(t){const e=new Set;let i,s;for(i=0,s=t.length;i<s;++i)e.add(t[i]);return e.size===s?t:Array.from(e)}function We(t,e=[""],i=t,s,n=(()=>t[0])){A(s)||(s=ni("_fallback",t));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:n,override:n=>We([n,...t],e,i,s)};return new Proxy(a,{deleteProperty(e,i){return delete e[i],delete e._keys,delete t[0][i],!0},get(i,s){return Xe(i,s,()=>si(s,e,t,i))},getOwnPropertyDescriptor(t,e){return Reflect.getOwnPropertyDescriptor(t._scopes[0],e)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(t,e){return ai(t).includes(e)},ownKeys(t){return ai(t)},set(t,e,i){const s=t._storage||(t._storage=n());return s[e]=i,delete t[e],delete t._keys,!0}})}function He(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:$e(t,s),setContext:e=>He(t,e,i,s),override:n=>He(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty(e,i){return delete e[i],delete t[i],!0},get(t,e,i){return Xe(t,e,()=>qe(t,e,i))},getOwnPropertyDescriptor(e,i){return e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(e,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(e,i,s){return t[i]=s,delete e[i],!0}})}function $e(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:R(i)?i:()=>i,isIndexable:R(s)?s:()=>s}}const Ye=(t,e)=>t?t+L(e):e,Ue=(t,e)=>u(e)&&"adapters"!==t;function Xe(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function qe(t,e,i){const{_proxy:s,_context:n,_subProxy:a,_descriptors:o}=t;let r=s[e];return R(r)&&o.isScriptable(e)&&(r=Ke(e,r,t,i)),d(r)&&r.length&&(r=Ge(e,r,t,o.isIndexable)),Ue(e,r)&&(r=He(r,n,a&&a[e],o)),r}function Ke(t,e,i,s){const{_proxy:n,_context:a,_subProxy:o,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);return r.add(t),e=e(a,o||s),r.delete(t),u(e)&&(e=ti(n._scopes,n,t,e)),e}function Ge(t,e,i,s){const{_proxy:n,_context:a,_subProxy:o,_descriptors:r}=i;if(A(a.index)&&s(t))e=e[a.index%e.length];else if(u(e[0])){const i=e,s=n._scopes.filter(t=>t!==i);e=[];for(const l of i){const i=ti(s,n,t,l);e.push(He(i,a,o&&o[t],r))}}return e}function Ze(t,e,i){return R(t)?t(e,i):t}const Qe=(t,e)=>!0===t?e:"string"===typeof t?T(e,t):void 0;function Je(t,e,i,s){for(const n of e){const e=Qe(i,n);if(e){t.add(e);const n=Ze(e._fallback,i,e);if(A(n)&&n!==i&&n!==s)return n}else if(!1===e&&A(s)&&i!==s)return null}return!1}function ti(t,e,i,s){const n=e._rootScopes,a=Ze(e._fallback,i,s),o=[...t,...n],r=new Set;r.add(s);let l=ei(r,o,i,a||i);return null!==l&&((!A(a)||a===i||(l=ei(r,o,a,l),null!==l))&&We(Array.from(r),[""],n,a,()=>ii(e,i,s)))}function ei(t,e,i,s){while(i)i=Je(t,e,i,s);return i}function ii(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];return d(n)&&u(i)?i:n}function si(t,e,i,s){let n;for(const a of e)if(n=ni(Ye(a,t),i),A(n))return Ue(t,n)?ti(i,s,t,n):n}function ni(t,e){for(const i of e){if(!i)continue;const e=i[t];if(A(e))return e}}function ai(t){let e=t._keys;return e||(e=t._keys=oi(t._scopes)),e}function oi(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter(t=>!t.startsWith("_")))e.add(t);return Array.from(e)}const ri=Number.EPSILON||1e-14,li=(t,e)=>e<t.length&&!t[e].skip&&t[e],hi=t=>"x"===t?"y":"x";function ci(t,e,i,s){const n=t.skip?e:t,a=e,o=i.skip?e:i,r=et(a,n),l=et(o,a);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:a.x-d*(o.x-n.x),y:a.y-d*(o.y-n.y)},next:{x:a.x+u*(o.x-n.x),y:a.y+u*(o.y-n.y)}}}function di(t,e,i){const s=t.length;let n,a,o,r,l,h=li(t,0);for(let c=0;c<s-1;++c)l=h,h=li(t,c+1),l&&h&&(q(e[c],0,ri)?i[c]=i[c+1]=0:(n=i[c]/e[c],a=i[c+1]/e[c],r=Math.pow(n,2)+Math.pow(a,2),r<=9||(o=3/Math.sqrt(r),i[c]=n*o*e[c],i[c+1]=a*o*e[c])))}function ui(t,e,i="x"){const s=hi(i),n=t.length;let a,o,r,l=li(t,0);for(let h=0;h<n;++h){if(o=r,r=l,l=li(t,h+1),!r)continue;const n=r[i],c=r[s];o&&(a=(n-o[i])/3,r[`cp1${i}`]=n-a,r[`cp1${s}`]=c-a*e[h]),l&&(a=(l[i]-n)/3,r[`cp2${i}`]=n+a,r[`cp2${s}`]=c+a*e[h])}}function fi(t,e="x"){const i=hi(e),s=t.length,n=Array(s).fill(0),a=Array(s);let o,r,l,h=li(t,0);for(o=0;o<s;++o)if(r=l,l=h,h=li(t,o+1),l){if(h){const t=h[e]-l[e];n[o]=0!==t?(h[i]-l[i])/t:0}a[o]=r?h?$(n[o-1])!==$(n[o])?0:(n[o-1]+n[o])/2:n[o-1]:n[o]}di(t,n,a),ui(t,a,e)}function gi(t,e,i){return Math.max(Math.min(t,i),e)}function pi(t,e){let i,s,n,a,o,r=fe(t[0],e);for(i=0,s=t.length;i<s;++i)o=a,a=r,r=i<s-1&&fe(t[i+1],e),a&&(n=t[i],o&&(n.cp1x=gi(n.cp1x,e.left,e.right),n.cp1y=gi(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=gi(n.cp2x,e.left,e.right),n.cp2y=gi(n.cp2y,e.top,e.bottom)))}function mi(t,e,i,s,n){let a,o,r,l;if(e.spanGaps&&(t=t.filter(t=>!t.skip)),"monotone"===e.cubicInterpolationMode)fi(t,n);else{let i=s?t[t.length-1]:t[0];for(a=0,o=t.length;a<o;++a)r=t[a],l=ci(i,r,t[Math.min(a+1,o-(s?0:1))%o],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,i=r}e.capBezierPoints&&pi(t,i)}function bi(){return"undefined"!==typeof window&&"undefined"!==typeof document}function xi(t){let e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e}function _i(t,e,i){let s;return"string"===typeof t?(s=parseInt(t,10),-1!==t.indexOf("%")&&(s=s/100*e.parentNode[i])):s=t,s}const yi=t=>window.getComputedStyle(t,null);function vi(t,e){return yi(t).getPropertyValue(e)}const ki=["top","right","bottom","left"];function wi(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const a=ki[n];s[a]=parseFloat(t[e+"-"+a+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Mi=(t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot);function Si(t,e){const i=t.native||t,s=i.touches,n=s&&s.length?s[0]:i,{offsetX:a,offsetY:o}=n;let r,l,h=!1;if(Mi(a,o,i.target))r=a,l=o;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,l=n.clientY-t.top,h=!0}return{x:r,y:l,box:h}}function Pi(t,e){const{canvas:i,currentDevicePixelRatio:s}=e,n=yi(i),a="border-box"===n.boxSizing,o=wi(n,"padding"),r=wi(n,"border","width"),{x:l,y:h,box:c}=Si(t,i),d=o.left+(c&&r.left),u=o.top+(c&&r.top);let{width:f,height:g}=e;return a&&(f-=o.width+r.width,g-=o.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}function Oi(t,e,i){let s,n;if(void 0===e||void 0===i){const a=xi(t);if(a){const t=a.getBoundingClientRect(),o=yi(a),r=wi(o,"border","width"),l=wi(o,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=_i(o.maxWidth,a,"clientWidth"),n=_i(o.maxHeight,a,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||V,maxHeight:n||V}}const Ci=t=>Math.round(10*t)/10;function Di(t,e,i,s){const n=yi(t),a=wi(n,"margin"),o=_i(n.maxWidth,t,"clientWidth")||V,r=_i(n.maxHeight,t,"clientHeight")||V,l=Oi(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=wi(n,"border","width"),e=wi(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-a.width),c=Math.max(0,s?Math.floor(h/s):c-a.height),h=Ci(Math.min(h,o,l.maxWidth)),c=Ci(Math.min(c,r,l.maxHeight)),h&&!c&&(c=Ci(h/2)),{width:h,height:c}}function Ti(t,e,i){const s=e||1,n=Math.floor(t.height*s),a=Math.floor(t.width*s);t.height=n/s,t.width=a/s;const o=t.canvas;return o.style&&(i||!o.style.height&&!o.style.width)&&(o.style.height=`${t.height}px`,o.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||o.height!==n||o.width!==a)&&(t.currentDevicePixelRatio=s,o.height=n,o.width=a,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Li=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}return t}();function Ai(t,e){const i=vi(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Ri(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ei(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function Ii(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},a={x:e.cp1x,y:e.cp1y},o=Ri(t,n,i),r=Ri(n,a,i),l=Ri(a,e,i),h=Ri(o,r,i),c=Ri(r,l,i);return Ri(h,c,i)}const Fi=new Map;function zi(t,e){e=e||{};const i=t+JSON.stringify(e);let s=Fi.get(i);return s||(s=new Intl.NumberFormat(t,e),Fi.set(i,s)),s}function Vi(t,e,i){return zi(e,i).format(t)}const ji=function(t,e){return{x(i){return t+t+e-i},setWidth(t){e=t},textAlign(t){return"center"===t?t:"right"===t?"left":"right"},xPlus(t,e){return t-e},leftForLtr(t,e){return t-e}}},Bi=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Ni(t,e,i){return t?ji(e,i):Bi()}function Wi(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function Hi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function $i(t){return"angle"===t?{between:nt,compare:it,normalize:st}:{between:(t,e,i)=>t>=Math.min(e,i)&&t<=Math.max(i,e),compare:(t,e)=>t-e,normalize:t=>t}}function Yi({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i===0,style:n}}function Ui(t,e,i){const{property:s,start:n,end:a}=i,{between:o,normalize:r}=$i(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;h<c;++h){if(!o(r(e[d%l][s]),n,a))break;d--,u--}d%=l,u%=l}return u<d&&(u+=l),{start:d,end:u,loop:f,style:t.style}}function Xi(t,e,i){if(!i)return[t];const{property:s,start:n,end:a}=i,o=e.length,{compare:r,between:l,normalize:h}=$i(s),{start:c,end:d,loop:u,style:f}=Ui(t,e,i),g=[];let p,m,b,x=!1,_=null;const y=()=>l(n,b,p)&&0!==r(n,b),v=()=>0===r(a,p)||l(a,b,p),k=()=>x||y(),w=()=>!x||v();for(let M=c,S=c;M<=d;++M)m=e[M%o],m.skip||(p=h(m[s]),p!==b&&(x=l(p,n,a),null===_&&k()&&(_=0===r(p,n)?M:S),null!==_&&w()&&(g.push(Yi({start:_,end:M,loop:u,count:o,style:f})),_=null),S=M,b=p));return null!==_&&g.push(Yi({start:_,end:d,loop:u,count:o,style:f})),g}function qi(t,e){const i=[],s=t.segments;for(let n=0;n<s.length;n++){const a=Xi(s[n],t.points,e);a.length&&i.push(...a)}return i}function Ki(t,e,i,s){let n=0,a=e-1;if(i&&!s)while(n<e&&!t[n].skip)n++;while(n<e&&t[n].skip)n++;n%=e,i&&(a+=n);while(a>n&&t[a%e].skip)a--;return a%=e,{start:n,end:a}}function Gi(t,e,i,s){const n=t.length,a=[];let o,r=e,l=t[e];for(o=e+1;o<=i;++o){const i=t[o%n];i.skip||i.stop?l.skip||(s=!1,a.push({start:e%n,end:(o-1)%n,loop:s}),e=r=i.stop?o:null):(r=o,l.skip&&(e=o)),l=i}return null!==r&&a.push({start:e%n,end:r%n,loop:s}),a}function Zi(t,e){const i=t.points,s=t.options.spanGaps,n=i.length;if(!n)return[];const a=!!t._loop,{start:o,end:r}=Ki(i,n,a,s);if(!0===s)return Qi(t,[{start:o,end:r,loop:a}],i,e);const l=r<o?r+n:r,h=!!t._fullLoop&&0===o&&r===n-1;return Qi(t,Gi(i,o,l,h),i,e)}function Qi(t,e,i,s){return s&&s.setContext&&i?Ji(t,e,i,s):e}function Ji(t,e,i,s){const n=t._chart.getContext(),a=ts(t.options),{_datasetIndex:o,options:{spanGaps:r}}=t,l=i.length,h=[];let c=a,d=e[0].start,u=d;function f(t,e,s,n){const a=r?-1:1;if(t!==e){t+=l;while(i[t%l].skip)t-=a;while(i[e%l].skip)e+=a;t%l!==e%l&&(h.push({start:t%l,end:e%l,loop:s,style:n}),c=n,d=e%l)}}for(const g of e){d=r?d:g.start;let t,e=i[d%l];for(u=d+1;u<=g.end;u++){const a=i[u%l];t=ts(s.setContext(Re(n,{type:"segment",p0:e,p1:a,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:o}))),es(t,c)&&f(d,u-1,g.loop,c),e=a,c=t}d<u-1&&f(d,u-1,g.loop,c)}return h}function ts(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function es(t,e){return e&&JSON.stringify(t)!==JSON.stringify(e)}
/*!
 * Chart.js v3.6.0
 * https://www.chartjs.org
 * (c) 2021 Chart.js Contributors
 * Released under the MIT License
 */class is{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],a=e.duration;n.forEach(s=>s({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=s.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let a,o=n.length-1,r=!1;for(;o>=0;--o)a=n[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(t),r=!0):(n[o]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length}),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((t,e)=>Math.max(t,e._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ss=new is;const ns="transparent",as={boolean(t,e,i){return i>.5?e:t},color(t,e,i){const s=Jt(t||ns),n=s.valid&&Jt(e||ns);return n&&n.valid?n.mix(s,i).hexString():e},number(t,e,i){return t+(e-t)*i}};class os{constructor(t,e,i,s){const n=e[i];s=Le([t.to,s,n,t.from]);const a=Le([t.from,n,s]);this._active=!0,this._fn=t.fn||as[t.type||typeof a],this._easing=ct[t.easing]||ct.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,a=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=Le([t.to,e,s,t.from]),this._from=Le([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,a=this._loop,o=this._to;let r;if(this._active=n!==o&&(a||e<i),!this._active)return this._target[s]=o,void this._notify(!0);e<0?this._target[s]=n:(r=e/i%2,r=a&&r>1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,o,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}const rs=["x","y","borderWidth","radius","tension"],ls=["color","borderColor","backgroundColor"];oe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const hs=Object.keys(oe.animation);oe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),oe.set("animations",{colors:{type:"color",properties:ls},numbers:{type:"number",properties:rs}}),oe.describe("animations",{_fallback:"animation"}),oe.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=>0|t}}}});class cs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!u(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const s=t[i];if(!u(s))return;const n={};for(const t of hs)n[t]=s[t];(d(s.properties)&&s.properties||[i]).forEach(t=>{t!==i&&e.has(t)||e.set(t,n)})})}_animateOptions(t,e){const i=e.options,s=us(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&ds(t.options.$animations,i).then(()=>{t.options=i},()=>{}),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),a=Object.keys(e),o=Date.now();let r;for(r=a.length-1;r>=0;--r){const l=a[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,o);continue}c.cancel()}d&&d.duration?(n[l]=c=new os(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(ss.add(this._chart,i),!0):void 0}}function ds(t,e){const i=[],s=Object.keys(e);for(let n=0;n<s.length;n++){const e=t[s[n]];e&&e.active()&&i.push(e.wait())}return Promise.all(i)}function us(t,e){if(!e)return;let i=t.options;if(i)return i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i;t.options=e}function fs(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,a=void 0===i.max?e:0;return{start:s?a:n,end:s?n:a}}function gs(t,e,i){if(!1===i)return!1;const s=fs(t,i),n=fs(e,i);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function ps(t){let e,i,s,n;return u(t)?(e=t.top,i=t.right,s=t.bottom,n=t.left):e=i=s=n=t,{top:e,right:i,bottom:s,left:n,disabled:!1===t}}function ms(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,a;for(n=0,a=s.length;n<a;++n)i.push(s[n].index);return i}function bs(t,e,i,s={}){const n=t.keys,a="single"===s.mode;let o,r,l,h;if(null!==e){for(o=0,r=n.length;o<r;++o){if(l=+n[o],l===i){if(s.all)continue;break}h=t.values[l],f(h)&&(a||0===e||$(e)===$(h))&&(e+=h)}return e}}function xs(t){const e=Object.keys(t),i=new Array(e.length);let s,n,a;for(s=0,n=e.length;s<n;++s)a=e[s],i[s]={x:a,y:t[a]};return i}function _s(t,e){const i=t&&t.options.stacked;return i||void 0===i&&void 0!==e.stack}function ys(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}function vs(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}function ks(t,e,i){const s=t[e]||(t[e]={});return s[i]||(s[i]={})}function ws(t,e,i,s){for(const n of e.getMatchingVisibleMetas(s).reverse()){const e=t[n.index];if(i&&e>0||!i&&e<0)return n.index}return null}function Ms(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:a,vScale:o,index:r}=s,l=a.axis,h=o.axis,c=ys(a,o,s),d=e.length;let u;for(let f=0;f<d;++f){const t=e[f],{[l]:i,[h]:a}=t,d=t._stacks||(t._stacks={});u=d[h]=ks(n,c,i),u[r]=a,u._top=ws(u,o,!0,s.type),u._bottom=ws(u,o,!1,s.type)}}function Ss(t,e){const i=t.scales;return Object.keys(i).filter(t=>i[t].axis===e).shift()}function Ps(t,e){return Re(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Os(t,e,i){return Re(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:i,index:e,mode:"default",type:"data"})}function Cs(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i]}}}const Ds=t=>"reset"===t||"none"===t,Ts=(t,e)=>e?t:Object.assign({},t),Ls=(t,e,i)=>t&&!e.hidden&&e._stacked&&{keys:ms(i,!0),values:null};class As{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,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.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=_s(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Cs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=p(i.xAxisID,Ss(t,"x")),a=e.yAxisID=p(i.yAxisID,Ss(t,"y")),o=e.rAxisID=p(i.rAxisID,Ss(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,n,a,o),h=e.vAxisID=s(r,a,n,o);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(l),e.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){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Be(this._data,this),t._stacked&&Cs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(u(e))this._data=xs(e);else if(i!==e){if(i){Be(i,this);const t=this._cachedMeta;Cs(t),t._parsed=[]}e&&Object.isExtensible(e)&&je(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const n=e._stacked;e._stacked=_s(e.vScale,e),e.stack!==i.stack&&(s=!0,Cs(e),e.stack=i.stack),this._resyncElements(t),(s||n!==e._stacked)&&Ms(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:n,_stacked:a}=i,o=n.axis;let r,l,h,c=0===t&&e===s.length||i._sorted,f=t>0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=d(s[t])?this.parseArrayData(i,s,t,e):u(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[o]||f&&l[o]<f[o];for(r=0;r<e;++r)i._parsed[r+t]=l=h[r],c&&(n()&&(c=!1),f=l);i._sorted=c}a&&Ms(this,h)}parsePrimitiveData(t,e,i,s){const{iScale:n,vScale:a}=t,o=n.axis,r=a.axis,l=n.getLabels(),h=n===a,c=new Array(s);let d,u,f;for(d=0,u=s;d<u;++d)f=d+i,c[d]={[o]:h||n.parse(l[f],f),[r]:a.parse(e[f],f)};return c}parseArrayData(t,e,i,s){const{xScale:n,yScale:a}=t,o=new Array(s);let r,l,h,c;for(r=0,l=s;r<l;++r)h=r+i,c=e[h],o[r]={x:n.parse(c[0],h),y:a.parse(c[1],h)};return o}parseObjectData(t,e,i,s){const{xScale:n,yScale:a}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l=new Array(s);let h,c,d,u;for(h=0,c=s;h<c;++h)d=h+i,u=e[d],l[h]={x:n.parse(T(u,o),d),y:a.parse(T(u,r),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,n=this._cachedMeta,a=e[t.axis],o={keys:ms(s,!0),values:e._stacks[t.axis]};return bs(o,a,n.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const n=i[e.axis];let a=null===n?NaN:n;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=bs(s,n,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,n=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),r=Ls(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=vs(o);let d,u;function g(){u=s[d];const e=u[o.axis];return!f(u[t.axis])||h>e||c<e}for(d=0;d<a;++d)if(!g()&&(this.updateRangeFromParsed(l,t,u,r),n))break;if(n)for(d=a-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,a;for(s=0,n=e.length;s<n;++s)a=e[s][t.axis],f(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,n=this.getParsed(t);return{label:i?""+i.getLabelForValue(n[i.axis]):"",value:s?""+s.getLabelForValue(n[s.axis]):""}}_update(t){const e=this._cachedMeta;this.configure(),this._cachedDataOpts={},this.update(t||"default"),e._clip=ps(p(this.options.clip,gs(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],n=e.chartArea,a=[],o=this._drawStart||0,r=this._drawCount||s.length-o;let l;for(i.dataset&&i.dataset.draw(t,n,o,r),l=o;l<o+r;++l){const e=s[l];e.hidden||(e.active?a.push(e):e.draw(t,n))}for(l=0;l<a.length;++l)a[l].draw(t,n)}getStyle(t,e){const i=e?"active":"default";return void 0===t&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let n;if(t>=0&&t<this._cachedMeta.data.length){const e=this._cachedMeta.data[t];n=e.$context||(e.$context=Os(this.getContext(),t,e)),n.parsed=this.getParsed(t),n.raw=s.data[t],n.index=n.dataIndex=t}else n=this.$context||(this.$context=Ps(this.chart.getContext(),this.index)),n.dataset=s,n.index=n.datasetIndex=this.index;return n.active=!!e,n.mode=i,n}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s="active"===e,n=this._cachedDataOpts,a=t+"-"+e,o=n[a],r=this.enableOptionSharing&&A(i);if(o)return Ts(o,r);const l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),c=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),u=Object.keys(oe.elements[t]),f=()=>this.getContext(i,s),g=l.resolveNamedOptions(d,u,f,c);return g.$shared&&(g.$shared=r,n[a]=Object.freeze(Ts(g,r))),g}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,a=`animation-${e}`,o=n[a];if(o)return o;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),a=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(a,this.getContext(t,i,e))}const l=new cs(s,r&&r.animations);return r&&r._cacheable&&(n[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ds(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){Ds(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Ds(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,r,l]of this._syncList)this[o](r,l);this._syncList=[];const s=i.length,n=e.length,a=Math.min(n,s);a&&this.parse(0,a),n>s?this._insertElements(s,n-s,t):n<s&&this._removeElements(n,s-n)}_insertElements(t,e,i=!0){const s=this._cachedMeta,n=s.data,a=t+e;let o;const r=t=>{for(t.length+=e,o=t.length-1;o>=a;o--)t[o]=t[o-e]};for(r(n),o=t;o<a;++o)n[o]=new this.dataElementType;this._parsing&&r(s._parsed),this.parse(t,e),i&&this.updateElements(n,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&Cs(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){this._sync(["_removeElements",t,e]),this._sync(["_insertElements",t,arguments.length-2])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function Rs(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;e<n;e++)s=s.concat(i[e].controller.getAllParsedValues(t));t._cache.$bar=Ne(s.sort((t,e)=>t-e))}return t._cache.$bar}function Es(t){const e=t.iScale,i=Rs(e,t.type);let s,n,a,o,r=e._length;const l=()=>{32767!==a&&-32768!==a&&(A(o)&&(r=Math.min(r,Math.abs(a-o)||r)),o=a)};for(s=0,n=i.length;s<n;++s)a=e.getPixelForValue(i[s]),l();for(o=void 0,s=0,n=e.ticks.length;s<n;++s)a=e.getPixelForTick(s),l();return r}function Is(t,e,i,s){const n=i.barThickness;let a,o;return c(n)?(a=e.min*i.categoryPercentage,o=i.barPercentage):(a=n*s,o=1),{chunk:a/s,ratio:o,start:e.pixels[t]-a/2}}function Fs(t,e,i,s){const n=e.pixels,a=n[t];let o=t>0?n[t-1]:null,r=t<n.length-1?n[t+1]:null;const l=i.categoryPercentage;null===o&&(o=a-(null===r?e.end-e.start:r-a)),null===r&&(r=a+a-o);const h=a-(a-Math.min(o,r))/2*l,c=Math.abs(r-o)/2*l;return{chunk:c/s,ratio:i.barPercentage,start:h}}function zs(t,e,i,s){const n=i.parse(t[0],s),a=i.parse(t[1],s),o=Math.min(n,a),r=Math.max(n,a);let l=o,h=r;Math.abs(o)>Math.abs(r)&&(l=r,h=o),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:a,min:o,max:r}}function Vs(t,e,i,s){return d(t)?zs(t,e,i,s):e[i.axis]=i.parse(t,s),e}function js(t,e,i,s){const n=t.iScale,a=t.vScale,o=n.getLabels(),r=n===a,l=[];let h,c,d,u;for(h=i,c=i+s;h<c;++h)u=e[h],d={},d[n.axis]=r||n.parse(o[h],h),l.push(Vs(u,d,a,h));return l}function Bs(t){return t&&void 0!==t.barStart&&void 0!==t.barEnd}function Ns(t,e,i){return 0!==t?$(t):(e.isHorizontal()?1:-1)*(e.min>=i?1:-1)}function Ws(t){let e,i,s,n,a;return t.horizontal?(e=t.base>t.x,i="left",s="right"):(e=t.base<t.y,i="bottom",s="top"),e?(n="end",a="start"):(n="start",a="end"),{start:i,end:s,reverse:e,top:n,bottom:a}}function Hs(t,e,i,s){let n=e.borderSkipped;const a={};if(!n)return void(t.borderSkipped=a);const{start:o,end:r,reverse:l,top:h,bottom:c}=Ws(t);"middle"===n&&i&&(t.enableBorderRadius=!0,(i._top||0)===s?n=h:(i._bottom||0)===s?n=c:(a[$s(c,o,r,l)]=!0,n=h)),a[$s(n,o,r,l)]=!0,t.borderSkipped=a}function $s(t,e,i,s){return s?(t=Ys(t,e,i),t=Us(t,i,e)):t=Us(t,e,i),t}function Ys(t,e,i){return t===e?i:t===i?e:t}function Us(t,e,i){return"start"===t?e:"end"===t?i:t}function Xs(t,{inflateAmount:e},i){t.inflateAmount="auto"===e?1===i?.33:0:e}As.defaults={},As.prototype.datasetElementType=null,As.prototype.dataElementType=null;class qs extends As{parsePrimitiveData(t,e,i,s){return js(t,e,i,s)}parseArrayData(t,e,i,s){return js(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:n,vScale:a}=t,{xAxisKey:o="x",yAxisKey:r="y"}=this._parsing,l="x"===n.axis?o:r,h="x"===a.axis?o:r,c=[];let d,u,f,g;for(d=i,u=i+s;d<u;++d)g=e[d],f={},f[n.axis]=n.parse(T(g,l),d),c.push(Vs(T(g,h),f,a,d));return c}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const n=i._custom;n&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,n.min),t.max=Math.max(t.max,n.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,n=this.getParsed(t),a=n._custom,o=Bs(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(n[s.axis]);return{label:""+i.getLabelForValue(n[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const n="reset"===s,{index:a,_cachedMeta:{vScale:o}}=this,r=o.getBasePixel(),l=o.isHorizontal(),h=this._getRuler(),d=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(d),f=this.includeOptions(s,u);this.updateSharedOptions(u,s,d);for(let g=e;g<e+i;g++){const e=this.getParsed(g),i=n||c(e[o.axis])?{base:r,head:r}:this._calculateBarValuePixels(g),d=this._calculateBarIndexPixels(g,h),p=(e._stacks||{})[o.axis],m={horizontal:l,base:i.base,enableBorderRadius:!p||Bs(e._custom)||a===p._top||a===p._bottom,x:l?i.head:d.center,y:l?d.center:i.head,height:l?d.size:Math.abs(i.size),width:l?Math.abs(i.size):d.size};f&&(m.options=u||this.resolveDataElementOptions(g,t[g].active?"active":s));const b=m.options||t[g].options;Hs(m,b,p,a),Xs(m,b,h.ratio),this.updateElement(t[g],g,m,s)}}_getStacks(t,e){const i=this._cachedMeta,s=i.iScale,n=s.getMatchingVisibleMetas(this._type),a=s.options.stacked,o=n.length,r=[];let l,h;for(l=0;l<o;++l)if(h=n[l],h.controller.options.grouped){if("undefined"!==typeof e){const t=h.controller.getParsed(e)[h.controller._cachedMeta.vScale.axis];if(c(t)||isNaN(t))continue}if((!1===a||-1===r.indexOf(h.stack)||void 0===a&&void 0===h.stack)&&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}_getStackIndex(t,e,i){const s=this._getStacks(t,i),n=void 0!==e?s.indexOf(e):-1;return-1===n?s.length-1:n}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let n,a;for(n=0,a=e.data.length;n<a;++n)s.push(i.getPixelForValue(this.getParsed(n)[i.axis],n));const o=t.barThickness,r=o||Es(e);return{min:r,pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i},options:{base:s,minBarLength:n}}=this,a=s||0,o=this.getParsed(t),r=o._custom,l=Bs(r);let h,d,u=o[e.axis],f=0,g=i?this.applyStack(e,o,i):u;g!==u&&(f=g-u,g=u),l&&(u=r.barStart,g=r.barEnd-r.barStart,0!==u&&$(u)!==$(r.barEnd)&&(f=0),f+=u);const p=c(s)||l?f:s;let m=e.getPixelForValue(p);if(h=this.chart.getDataVisibility(t)?e.getPixelForValue(f+g):m,d=h-m,Math.abs(d)<n&&(d=Ns(d,e,a)*n,u===a&&(m-=d/2),h=m+d),m===e.getPixelForValue(a)){const t=$(d)*e.getLineWidthForValue(a)/2;m+=t,d-=t}return{size:d,base:m,head:h,center:h+d/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,a=p(s.maxBarThickness,1/0);let o,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?Fs(t,e,s,i):Is(t,e,s,i),h=this._getStackIndex(this.index,this._cachedMeta.stack,n?t:void 0);o=l.start+l.chunk*h+l.chunk/2,r=Math.min(a,l.chunk*l.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),r=Math.min(a,e.min*e.ratio);return{base:o-r/2,head:o+r/2,center:o,size:r}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let n=0;for(;n<s;++n)null!==this.getParsed(n)[e.axis]&&i[n].draw(this._ctx)}}qs.id="bar",qs.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}},qs.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ks extends As{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const n=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<n.length;a++)n[a]._custom=this.resolveDataElementOptions(a+i).radius;return n}parseArrayData(t,e,i,s){const n=super.parseArrayData(t,e,i,s);for(let a=0;a<n.length;a++){const t=e[i+a];n[a]._custom=p(t[2],this.resolveDataElementOptions(a+i).radius)}return n}parseObjectData(t,e,i,s){const n=super.parseObjectData(t,e,i,s);for(let a=0;a<n.length;a++){const t=e[i+a];n[a]._custom=p(t&&t.r&&+t.r,this.resolveDataElementOptions(a+i).radius)}return n}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),a=i.getLabelForValue(n.x),o=s.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+a+", "+o+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:a,vScale:o}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(r),h=this.includeOptions(s,l),c=a.axis,d=o.axis;for(let u=e;u<e+i;u++){const e=t[u],i=!n&&this.getParsed(u),r={},l=r[c]=n?a.getPixelForDecimal(.5):a.getPixelForValue(i[c]),f=r[d]=n?o.getBasePixel():o.getPixelForValue(i[d]);r.skip=isNaN(l)||isNaN(f),h&&(r.options=this.resolveDataElementOptions(u,e.active?"active":s),n&&(r.options.radius=0)),this.updateElement(e,u,r,s)}this.updateSharedOptions(l,s,r)}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const n=s.radius;return"active"!==e&&(s.radius=0),s.radius+=p(i&&i._custom,n),s}}function Gs(t,e,i){let s=1,n=1,a=0,o=0;if(e<F){const r=t,l=r+e,h=Math.cos(r),c=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(t,e,s)=>nt(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>nt(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(B,c,u),b=g(I,h,d),x=g(I+B,c,u);s=(p-b)/2,n=(m-x)/2,a=-(p+b)/2,o=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:a,offsetY:o}}Ks.id="bubble",Ks.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}},Ks.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};class Zs extends As{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,a,o=t=>+i[t];if(u(i[t])){const{key:t="value"}=this._parsing;o=e=>+T(i[e],t)}for(n=t,a=t+e;n<a;++n)s._parsed[n]=o(n)}}_getRotation(){return Z(this.options.rotation-90)}_getCircumference(){return Z(this.options.circumference)}_getRotationExtents(){let t=F,e=-F;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)){const s=this.chart.getDatasetMeta(i).controller,n=s._getRotation(),a=s._getCircumference();t=Math.min(t,n),e=Math.max(e,n+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,n=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(n)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),r=Math.min(m(this.options.cutout,o),1),l=this._getRingWeight(this.index),{circumference:h,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:u,offsetX:f,offsetY:g}=Gs(c,h,r),p=(i.width-a)/d,x=(i.height-a)/u,_=Math.max(Math.min(p,x)/2,0),y=b(this.options.radius,_),v=Math.max(y*r,0),k=(y-v)/this._getVisibleDatasetWeightTotal();this.offsetX=f*y,this.offsetY=g*y,s.total=this.calculateTotal(),this.outerRadius=y-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/F)}updateElements(t,e,i,s){const n="reset"===s,a=this.chart,o=a.chartArea,r=a.options,l=r.animation,h=(o.left+o.right)/2,c=(o.top+o.bottom)/2,d=n&&l.animateScale,u=d?0:this.innerRadius,f=d?0:this.outerRadius,g=this.resolveDataElementOptions(e,s),p=this.getSharedOptions(g),m=this.includeOptions(s,p);let b,x=this._getRotation();for(b=0;b<e;++b)x+=this._circumference(b,n);for(b=e;b<e+i;++b){const e=this._circumference(b,n),i=t[b],a={x:h+this.offsetX,y:c+this.offsetY,startAngle:x,endAngle:x+e,circumference:e,outerRadius:f,innerRadius:u};m&&(a.options=p||this.resolveDataElementOptions(b,i.active?"active":s)),x+=e,this.updateElement(i,b,a,s)}this.updateSharedOptions(p,s,g)}calculateTotal(){const t=this._cachedMeta,e=t.data;let i,s=0;for(i=0;i<e.length;i++){const n=t._parsed[i];null===n||isNaN(n)||!this.chart.getDataVisibility(i)||e[i].hidden||(s+=Math.abs(n))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?F*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=Vi(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,a,o,r;if(!t)for(s=0,n=i.data.datasets.length;s<n;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller,o!==this&&o.configure();break}if(!t)return 0;for(s=0,n=t.length;s<n;++s)r=o.resolveDataElementOptions(s),"inner"!==r.borderAlign&&(e=Math.max(e,r.borderWidth||0,r.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const t=this.resolveDataElementOptions(i);e=Math.max(e,t.offset||0,t.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(p(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Zs.id="doughnut",Zs.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"},Zs.descriptors={_scriptable:t=>"spacing"!==t,_indexable:t=>"spacing"!==t},Zs.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,s)=>{const n=t.getDatasetMeta(0),a=n.controller.getStyle(s);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){let e=t.label;const i=": "+t.formattedValue;return d(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Qs extends As{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,a=this.chart._animationsDisabled;let{start:o,count:r}=Js(e,s,a);this._drawStart=o,this._drawCount=r,tn(e)&&(o=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:l},t),this.updateElements(s,o,r,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:a,vScale:o,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(h),u=this.includeOptions(s,d),f=a.axis,g=o.axis,{spanGaps:p,segment:m}=this.options,b=X(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||n||"none"===s;let _=e>0&&this.getParsed(e-1);for(let y=e;y<e+i;++y){const e=t[y],i=this.getParsed(y),h=x?e:{},p=c(i[g]),v=h[f]=a.getPixelForValue(i[f],y),k=h[g]=n||p?o.getBasePixel():o.getPixelForValue(r?this.applyStack(o,i,r):i[g],y);h.skip=isNaN(v)||isNaN(k)||p,h.stop=y>0&&i[f]-_[f]>b,m&&(h.parsed=i,h.raw=l.data[y]),u&&(h.options=d||this.resolveDataElementOptions(y,e.active?"active":s)),x||this.updateElement(e,y,h,s),_=i}this.updateSharedOptions(d,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Js(t,e,i){const s=e.length;let n=0,a=s;if(t._sorted){const{iScale:o,_parsed:r}=t,l=o.axis,{min:h,max:c,minDefined:d,maxDefined:u}=o.getUserBounds();d&&(n=at(Math.min(Ie(r,o.axis,h).lo,i?s:Ie(e,l,o.getPixelForValue(h)).lo),0,s-1)),a=u?at(Math.max(Ie(r,o.axis,c).hi+1,i?0:Ie(e,l,o.getPixelForValue(c)).hi+1),n,s)-n:s-n}return{start:n,count:a}}function tn(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const a=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),a}Qs.id="line",Qs.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Qs.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class en extends As{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=Vi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0),o=(n-a)/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,a=this.chart,o=this.getDataset(),r=a.options,l=r.animation,h=this._cachedMeta.rScale,c=h.xCenter,d=h.yCenter,u=h.getIndexAngle(0)-.5*I;let f,g=u;const p=360/this.countVisibleElements();for(f=0;f<e;++f)g+=this._computeAngle(f,s,p);for(f=e;f<e+i;f++){const e=t[f];let i=g,r=g+this._computeAngle(f,s,p),m=a.getDataVisibility(f)?h.getDistanceFromCenterForValue(o.data[f]):0;g=r,n&&(l.animateScale&&(m=0),l.animateRotate&&(i=r=u));const b={x:c,y:d,innerRadius:0,outerRadius:m,startAngle:i,endAngle:r,options:this.resolveDataElementOptions(f,e.active?"active":s)};this.updateElement(e,f,b,s)}}countVisibleElements(){const t=this.getDataset(),e=this._cachedMeta;let i=0;return e.data.forEach((e,s)=>{!isNaN(t.data[s])&&this.chart.getDataVisibility(s)&&i++}),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Z(this.resolveDataElementOptions(t,e).angle||i):0}}en.id="polarArea",en.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},en.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map((e,s)=>{const n=t.getDatasetMeta(0),a=n.controller.getStyle(s);return{text:e,fillStyle:a.backgroundColor,strokeStyle:a.borderColor,lineWidth:a.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title(){return""},label(t){return t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class sn extends Zs{}sn.id="pie",sn.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class nn extends As{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const a={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this.getDataset(),a=this._cachedMeta.rScale,o="reset"===s;for(let r=e;r<e+i;r++){const e=t[r],i=this.resolveDataElementOptions(r,e.active?"active":s),l=a.getPointPositionForValue(r,n.data[r]),h=o?a.xCenter:l.x,c=o?a.yCenter:l.y,d={x:h,y:c,angle:l.angle,skip:isNaN(h)||isNaN(c),options:i};this.updateElement(e,r,d,s)}}}nn.id="radar",nn.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}},nn.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class an extends Qs{}an.id="scatter",an.defaults={showLine:!1,fill:!1},an.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(t){return"("+t.label+", "+t.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function on(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class rn{constructor(t){this.options=t||{}}formats(){return on()}parse(t,e){return on()}format(t,e){return on()}add(t,e,i){return on()}diff(t,e,i){return on()}startOf(t,e,i){return on()}endOf(t,e){return on()}}rn.override=function(t){Object.assign(rn.prototype,t)};var ln={_date:rn};function hn(t,e){return"native"in t?{x:t.x,y:t.y}:Pi(t,e)}function cn(t,e){const i=t.getSortedVisibleDatasetMetas();let s,n,a;for(let o=0,r=i.length;o<r;++o){({index:s,data:n}=i[o]);for(let t=0,i=n.length;t<i;++t)a=n[t],a.skip||e(a,s,t)}}function dn(t,e,i,s){const{controller:n,data:a,_sorted:o}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&o&&a.length){const t=r._reversePixels?Fe:Ie;if(!s)return t(a,e,i);if(n._sharedOptions){const s=a[0],n="function"===typeof s.getRange&&s.getRange(e);if(n){const s=t(a,e,i-n),o=t(a,e,i+n);return{lo:s.lo,hi:o.hi}}}}return{lo:0,hi:a.length-1}}function un(t,e,i,s,n){const a=t.getSortedVisibleDatasetMetas(),o=i[e];for(let r=0,l=a.length;r<l;++r){const{index:t,data:i}=a[r],{lo:l,hi:h}=dn(a[r],e,o,n);for(let e=l;e<=h;++e){const n=i[e];n.skip||s(n,t,e)}}}function fn(t){const e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,s){const n=e?Math.abs(t.x-s.x):0,a=i?Math.abs(t.y-s.y):0;return Math.sqrt(Math.pow(n,2)+Math.pow(a,2))}}function gn(t,e,i,s){const n=[];if(!fe(e,t.chartArea,t._minPadding))return n;const a=function(t,i,a){t.inRange(e.x,e.y,s)&&n.push({element:t,datasetIndex:i,index:a})};return un(t,i,e,a,!0),n}function pn(t,e,i,s,n){const a=fn(i);let o=Number.POSITIVE_INFINITY,r=[];if(!fe(e,t.chartArea,t._minPadding))return r;const l=function(i,l,h){if(s&&!i.inRange(e.x,e.y,n))return;const c=i.getCenterPoint(n);if(!fe(c,t.chartArea,t._minPadding)&&!i.inRange(e.x,e.y,n))return;const d=a(e,c);d<o?(r=[{element:i,datasetIndex:l,index:h}],o=d):d===o&&r.push({element:i,datasetIndex:l,index:h})};return un(t,i,e,l),r}function mn(t,e,i,s){const n=hn(e,t),a=[],o=i.axis,r="x"===o?"inXRange":"inYRange";let l=!1;return cn(t,(t,e,i)=>{t[r](n[o],s)&&a.push({element:t,datasetIndex:e,index:i}),t.inRange(n.x,n.y,s)&&(l=!0)}),i.intersect&&!l?[]:a}var bn={modes:{index(t,e,i,s){const n=hn(e,t),a=i.axis||"x",o=i.intersect?gn(t,n,a,s):pn(t,n,a,!1,s),r=[];return o.length?(t.getSortedVisibleDatasetMetas().forEach(t=>{const e=o[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e})}),r):[]},dataset(t,e,i,s){const n=hn(e,t),a=i.axis||"xy";let o=i.intersect?gn(t,n,a,s):pn(t,n,a,!1,s);if(o.length>0){const e=o[0].datasetIndex,i=t.getDatasetMeta(e).data;o=[];for(let t=0;t<i.length;++t)o.push({element:i[t],datasetIndex:e,index:t})}return o},point(t,e,i,s){const n=hn(e,t),a=i.axis||"xy";return gn(t,n,a,s)},nearest(t,e,i,s){const n=hn(e,t),a=i.axis||"xy";return pn(t,n,a,i.intersect,s)},x(t,e,i,s){return i.axis="x",mn(t,e,i,s)},y(t,e,i,s){return i.axis="y",mn(t,e,i,s)}}};const xn=["left","top","right","bottom"];function _n(t,e){return t.filter(t=>t.pos===e)}function yn(t,e){return t.filter(t=>-1===xn.indexOf(t.pos)&&t.box.axis===e)}function vn(t,e){return t.sort((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight})}function kn(t){const e=[];let i,s,n,a,o,r;for(i=0,s=(t||[]).length;i<s;++i)n=t[i],({position:a,options:{stack:o,stackWeight:r=1}}=n),e.push({index:i,box:n,pos:a,horizontal:n.isHorizontal(),weight:n.weight,stack:o&&a+o,stackWeight:r});return e}function wn(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!xn.includes(s))continue;const a=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=n}return e}function Mn(t,e){const i=wn(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let a,o,r;for(a=0,o=t.length;a<o;++a){r=t[a];const{fullSize:o}=r.box,l=i[r.stack],h=l&&r.stackWeight/l.weight;r.horizontal?(r.width=h?h*s:o&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:o&&e.availableHeight)}return i}function Sn(t){const e=kn(t),i=vn(e.filter(t=>t.box.fullSize),!0),s=vn(_n(e,"left"),!0),n=vn(_n(e,"right")),a=vn(_n(e,"top"),!0),o=vn(_n(e,"bottom")),r=yn(e,"x"),l=yn(e,"y");return{fullSize:i,leftAndTop:s.concat(a),rightAndBottom:n.concat(l).concat(o).concat(r),chartArea:_n(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:a.concat(o).concat(r)}}function Pn(t,e,i,s){return Math.max(t[i],e[i])+Math.max(t[s],e[s])}function On(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function Cn(t,e,i,s){const{pos:n,box:a}=i,o=t.maxPadding;if(!u(n)){i.size&&(t[n]-=i.size);const e=s[i.stack]||{size:0,count:1};e.size=Math.max(e.size,i.horizontal?a.height:a.width),i.size=e.size/e.count,t[n]+=i.size}a.getPadding&&On(o,a.getPadding());const r=Math.max(0,e.outerWidth-Pn(o,t,"left","right")),l=Math.max(0,e.outerHeight-Pn(o,t,"top","bottom")),h=r!==t.w,c=l!==t.h;return t.w=r,t.h=l,i.horizontal?{same:h,other:c}:{same:c,other:h}}function Dn(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}function Tn(t,e){const i=e.maxPadding;function s(t){const s={left:0,top:0,right:0,bottom:0};return t.forEach(t=>{s[t]=Math.max(e[t],i[t])}),s}return s(t?["left","right"]:["top","bottom"])}function Ln(t,e,i,s){const n=[];let a,o,r,l,h,c;for(a=0,o=t.length,h=0;a<o;++a){r=t[a],l=r.box,l.update(r.width||e.w,r.height||e.h,Tn(r.horizontal,e));const{same:o,other:d}=Cn(e,i,r,s);h|=o&&n.length,c=c||d,l.fullSize||n.push(r)}return h&&Ln(n,e,i,s)||c}function An(t,e,i,s,n){t.top=i,t.left=e,t.right=e+s,t.bottom=i+n,t.width=s,t.height=n}function Rn(t,e,i,s){const n=i.padding;let{x:a,y:o}=e;for(const r of t){const t=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/l.weight||1;if(r.horizontal){const s=e.w*h,a=l.size||t.height;A(l.start)&&(o=l.start),t.fullSize?An(t,n.left,o,i.outerWidth-n.right-n.left,a):An(t,e.left+l.placed,o,s,a),l.start=o,l.placed+=s,o=t.bottom}else{const s=e.h*h,o=l.size||t.width;A(l.start)&&(a=l.start),t.fullSize?An(t,a,n.top,o,i.outerHeight-n.bottom-n.top):An(t,a,e.top+l.placed,o,s),l.start=a,l.placed+=s,a=t.right}}e.x=a,e.y=o}oe.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var En={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},t.boxes.push(e)},removeBox(t,e){const i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure(t,e,i){e.fullSize=i.fullSize,e.position=i.position,e.weight=i.weight},update(t,e,i,s){if(!t)return;const n=De(t.options.layout.padding),a=Math.max(e-n.width,0),o=Math.max(i-n.height,0),r=Sn(t.boxes),l=r.vertical,h=r.horizontal;_(t.boxes,t=>{"function"===typeof t.beforeLayout&&t.beforeLayout()});const c=l.reduce((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/c,hBoxMaxHeight:o/2}),u=Object.assign({},n);On(u,De(s));const f=Object.assign({maxPadding:u,w:a,h:o,x:n.left,y:n.top},n),g=Mn(l.concat(h),d);Ln(r.fullSize,f,d,g),Ln(l,f,d,g),Ln(h,f,d,g)&&Ln(l,f,d,g),Dn(f),Rn(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Rn(r.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},_(r.chartArea,e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h)})}};class In{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Fn extends In{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const zn="$chartjs",Vn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},jn=t=>null===t||""===t;function Bn(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t[zn]={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",jn(n)){const e=Ai(t,"width");void 0!==e&&(t.width=e)}if(jn(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Ai(t,"height");void 0!==e&&(t.height=e)}return t}const Nn=!!Li&&{passive:!0};function Wn(t,e,i){t.addEventListener(e,i,Nn)}function Hn(t,e,i){t.canvas.removeEventListener(e,i,Nn)}function $n(t,e){const i=Vn[t.type]||t.type,{x:s,y:n}=Pi(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}function Yn(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{for(const e of t)for(const t of e.addedNodes)if(t===s||t.contains(s))return i()});return n.observe(document,{childList:!0,subtree:!0}),n}function Un(t,e,i){const s=t.canvas,n=new MutationObserver(t=>{for(const e of t)for(const t of e.removedNodes)if(t===s||t.contains(s))return i()});return n.observe(document,{childList:!0,subtree:!0}),n}const Xn=new Map;let qn=0;function Kn(){const t=window.devicePixelRatio;t!==qn&&(qn=t,Xn.forEach((e,i)=>{i.currentDevicePixelRatio!==t&&e()}))}function Gn(t,e){Xn.size||window.addEventListener("resize",Kn),Xn.set(t,e)}function Zn(t){Xn.delete(t),Xn.size||window.removeEventListener("resize",Kn)}function Qn(t,e,i){const s=t.canvas,a=s&&xi(s);if(!a)return;const o=n((t,e)=>{const s=a.clientWidth;i(t,e),s<a.clientWidth&&i()},window),r=new ResizeObserver(t=>{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||o(i,s)});return r.observe(a),Gn(t,o),r}function Jn(t,e,i){i&&i.disconnect(),"resize"===e&&Zn(t)}function ta(t,e,i){const s=t.canvas,a=n(e=>{null!==t.ctx&&i($n(e,t))},t,t=>{const e=t[0];return[e,e.offsetX,e.offsetY]});return Wn(s,e,a),a}class ea extends In{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Bn(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[zn])return!1;const i=e[zn].initial;["height","width"].forEach(t=>{const s=i[t];c(s)?e.removeAttribute(t):e.setAttribute(t,s)});const s=i.style||{};return Object.keys(s).forEach(t=>{e.style[t]=s[t]}),e.width=e.width,delete e[zn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Yn,detach:Un,resize:Qn},a=n[e]||ta;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;const n={attach:Jn,detach:Jn,resize:Jn},a=n[e]||Hn;a(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Di(t,e,i,s)}isAttached(t){const e=xi(t);return!(!e||!e.isConnected)}}function ia(t){return!bi()||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Fn:ea}class sa{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return X(this.x)&&X(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(t=>{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]}),s}}sa.defaults={},sa.defaultRoutes=void 0;const na={values(t){return d(t)?t:""+t},numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,a=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),a=aa(t,i)}const o=H(Math.abs(a)),r=Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Vi(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(H(t)));return 1===s||2===s||5===s?na.numeric.call(this,t,e,i):""}};function aa(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t)),i}var oa={formatters:na};function ra(t,e){const i=t.options.ticks,s=i.maxTicksLimit||la(t),n=i.major.enabled?ca(e):[],a=n.length,o=n[0],r=n[a-1],l=[];if(a>s)return da(e,l,n,a/s),l;const h=ha(n,e,s);if(a>0){let t,i;const s=a>1?Math.round((r-o)/(a-1)):null;for(ua(e,l,h,c(s)?0:o-s,o),t=0,i=a-1;t<i;t++)ua(e,l,h,n[t],n[t+1]);return ua(e,l,h,r,c(s)?e.length:r+s),l}return ua(e,l,h),l}function la(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}function ha(t,e,i){const s=fa(t),n=e.length/i;if(!s)return Math.max(n,1);const a=U(s);for(let o=0,r=a.length-1;o<r;o++){const t=a[o];if(t>n)return t}return Math.max(n,1)}function ca(t){const e=[];let i,s;for(i=0,s=t.length;i<s;i++)t[i].major&&e.push(i);return e}function da(t,e,i,s){let n,a=0,o=i[0];for(s=Math.ceil(s),n=0;n<t.length;n++)n===o&&(e.push(t[n]),a++,o=i[a*s])}function ua(t,e,i,s,n){const a=p(s,0),o=Math.min(p(n,t.length),t.length);let r,l,h,c=0;i=Math.ceil(i),n&&(r=n-s,i=r/Math.floor(r/i)),h=a;while(h<0)c++,h=Math.round(a+c*i);for(l=Math.max(a,0);l<o;l++)l===h&&(e.push(t[l]),c++,h=Math.round(a+c*i))}function fa(t){const e=t.length;let i,s;if(e<2)return!1;for(s=t[0],i=1;i<e;++i)if(t[i]-t[i-1]!==s)return!1;return s}oe.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth: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:oa.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),oe.route("scale.ticks","color","","color"),oe.route("scale.grid","color","","borderColor"),oe.route("scale.grid","borderColor","","borderColor"),oe.route("scale.title","color","","color"),oe.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),oe.describe("scales",{_fallback:"scale"}),oe.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const ga=t=>"left"===t?"right":"right"===t?"left":t,pa=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function ma(t,e){const i=[],s=t.length/e,n=t.length;let a=0;for(;a<n;a+=s)i.push(t[Math.floor(a)]);return i}function ba(t,e,i){const s=t.ticks.length,n=Math.min(e,s-1),a=t._startPixel,o=t._endPixel,r=1e-6;let l,h=t.getPixelForTick(n);if(!(i&&(l=1===s?Math.max(h-a,o-h):0===e?(t.getPixelForTick(1)-h)/2:(h-t.getPixelForTick(n-1))/2,h+=n<e?l:-l,h<a-r||h>o+r)))return h}function xa(t,e){_(t,t=>{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n<s;++n)delete t.data[i[n]];i.splice(0,s)}})}function _a(t){return t.drawTicks?t.tickLength:0}function ya(t,e){if(!t.display)return 0;const i=Te(t.font,e),s=De(t.padding),n=d(t.text)?t.text.length:1;return n*i.lineHeight+s.height}function va(t,e){return Re(t,{scale:e,type:"scale"})}function ka(t,e,i){return Re(t,{tick:i,index:e,type:"tick"})}function wa(t,e,i){let s=o(t);return(i&&"right"!==e||!i&&"right"===e)&&(s=ga(s)),s}function Ma(t,e,i,s){const{top:n,left:a,bottom:o,right:l,chart:h}=t,{chartArea:c,scales:d}=h;let f,g,p,m=0;const b=o-n,x=l-a;if(t.isHorizontal()){if(g=r(s,a,l),u(i)){const t=Object.keys(i)[0],s=i[t];p=d[t].getPixelForValue(s)+b-e}else p="center"===i?(c.bottom+c.top)/2+b-e:pa(t,i,e);f=l-a}else{if(u(i)){const t=Object.keys(i)[0],s=i[t];g=d[t].getPixelForValue(s)-x+e}else g="center"===i?(c.left+c.right)/2-x+e:pa(t,i,e);p=r(s,o,n),m="left"===i?-B:B}return{titleX:g,titleY:p,maxWidth:f,rotation:m}}class Sa extends sa{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,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=g(t,Number.POSITIVE_INFINITY),e=g(e,Number.NEGATIVE_INFINITY),i=g(i,Number.POSITIVE_INFINITY),s=g(s,Number.NEGATIVE_INFINITY),{min:g(t,i),max:g(e,s),minDefined:f(t),maxDefined:f(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:a}=this.getUserBounds();if(n&&a)return{min:i,max:s};const o=this.getMatchingVisibleMetas();for(let r=0,l=o.length;r<l;++r)e=o[r].controller.getMinMax(this,t),n||(i=Math.min(i,e.min)),a||(s=Math.max(s,e.max));return i=a&&i>s?s:i,s=n&&i>s?i:s,{min:g(i,g(s,i)),max:g(s,g(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){x(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ae(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=o<this.ticks.length;this._convertTicksToLabels(r?ma(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||"auto"===a.source)&&(this.ticks=ra(this,this.ticks),this._labelSizes=null),r&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t,e,i=this.options.reverse;this.isHorizontal()?(t=this.left,e=this.right):(t=this.top,e=this.bottom,i=!i),this._startPixel=t,this._endPixel=e,this._reversePixels=i,this._length=e-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){x(this.options.afterUpdate,[this])}beforeSetDimensions(){x(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(){x(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),x(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){x(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,n;for(i=0,s=t.length;i<s;i++)n=t[i],n.label=x(e.callback,[n.value,i,t],this)}afterTickToLabelConversion(){x(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){x(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=this.ticks.length,s=e.minRotation||0,n=e.maxRotation;let a,o,r,l=s;if(!this._isVisible()||!e.display||s>=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=at(this.chart.width-c,0,this.maxWidth);a=t.offset?this.maxWidth/i:u/(i-1),c+6>a&&(a=u/(i-(t.offset?.5:1)),o=this.maxHeight-_a(t.grid)-e.padding-ya(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=Q(Math.min(Math.asin(at((h.highest.height+6)/a,-1,1)),Math.asin(at(o/r,-1,1))-Math.asin(at(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){x(this.options.afterCalculateLabelRotation,[this])}beforeFit(){x(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const a=ya(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=_a(n)+a):(t.height=this.maxHeight,t.width=_a(n)+a),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:a}=this._getLabelSizes(),r=2*i.padding,l=Z(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(o){const e=i.mirror?0:c*n.width+h*a.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*a.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:a},position:o}=this.options,r=0!==this.labelRotation,l="top"!==o&&"x"===this.axis;if(this.isHorizontal()){const o=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-h+a)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+a,this.paddingBottom=s+a}}_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(){x(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e<i;e++)c(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=ma(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length)}return t}_computeLabelSizes(t,e){const{ctx:i,_longestTextCache:s}=this,n=[],a=[];let o,r,l,h,u,f,g,p,m,b,x,_=0,y=0;for(o=0;o<e;++o){if(h=t[o].label,u=this._resolveTickFontOptions(o),i.font=f=u.string,g=s[f]=s[f]||{data:{},gc:[]},p=u.lineHeight,m=b=0,c(h)||d(h)){if(d(h))for(r=0,l=h.length;r<l;++r)x=h[r],c(x)||d(x)||(m=le(i,g.data,g.gc,m,x),b+=p)}else m=le(i,g.data,g.gc,m,h),b=p;n.push(m),a.push(b),_=Math.max(m,_),y=Math.max(b,y)}xa(s,e);const v=n.indexOf(_),k=a.indexOf(y),w=t=>({width:n[t]||0,height:a[t]||0});return{first:w(0),last:w(e-1),widest:w(v),highest:w(k),widths:n,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ot(this._alignToPixels?ce(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=ka(this.getContext(),t,i))}return this.$context||(this.$context=va(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Z(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),n=this._getLabelSizes(),a=t.autoSkipPadding||0,o=n?n.widest.width+a:0,r=n?n.highest.height+a:0;return this.isHorizontal()?r*i>o*s?o/i:r/s:r*s<o*i?r/i:o/s}_isVisible(){const t=this.options.display;return"auto"!==t?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:a}=s,o=n.offset,r=this.isHorizontal(),l=this.ticks,h=l.length+(o?1:0),c=_a(n),d=[],f=n.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,m=g/2,b=function(t){return ce(i,t,g)};let x,_,y,v,k,w,M,S,P,O,C,D;if("top"===a)x=b(this.bottom),w=this.bottom-c,S=x-m,O=b(t.top)+m,D=t.bottom;else if("bottom"===a)x=b(this.top),O=t.top,D=b(t.bottom)-m,w=x+m,S=this.top+c;else if("left"===a)x=b(this.right),k=this.right-c,M=x-m,P=b(t.left)+m,C=t.right;else if("right"===a)x=b(this.left),P=t.left,C=b(t.right)-m,k=x+m,M=this.left+c;else if("x"===e){if("center"===a)x=b((t.top+t.bottom)/2+.5);else if(u(a)){const t=Object.keys(a)[0],e=a[t];x=b(this.chart.scales[t].getPixelForValue(e))}O=t.top,D=t.bottom,w=x+m,S=w+c}else if("y"===e){if("center"===a)x=b((t.left+t.right)/2);else if(u(a)){const t=Object.keys(a)[0],e=a[t];x=b(this.chart.scales[t].getPixelForValue(e))}k=x-m,M=k-c,P=t.left,C=t.right}const T=p(s.ticks.maxTicksLimit,h),L=Math.max(1,Math.ceil(h/T));for(_=0;_<h;_+=L){const t=n.setContext(this.getContext(_)),e=t.lineWidth,s=t.color,a=n.borderDash||[],l=t.borderDashOffset,h=t.tickWidth,c=t.tickColor,u=t.tickBorderDash||[],f=t.tickBorderDashOffset;y=ba(this,_,o),void 0!==y&&(v=ce(i,y,e),r?k=M=P=C=v:w=S=O=D=v,d.push({tx1:k,ty1:w,tx2:M,ty2:S,x1:P,y1:O,x2:C,y2:D,width:e,color:s,borderDash:a,borderDashOffset:l,tickWidth:h,tickColor:c,tickBorderDash:u,tickBorderDashOffset:f}))}return this._ticksLength=h,this._borderValue=x,d}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:n}=i,a=this.isHorizontal(),o=this.ticks,{align:r,crossAlign:l,padding:h,mirror:c}=n,f=_a(i.grid),g=f+h,p=c?-h:g,m=-Z(this.labelRotation),b=[];let x,_,y,v,k,w,M,S,P,O,C,D,T="middle";if("top"===s)w=this.bottom-p,M=this._getXAxisLabelAlignment();else if("bottom"===s)w=this.top+p,M=this._getXAxisLabelAlignment();else if("left"===s){const t=this._getYAxisLabelAlignment(f);M=t.textAlign,k=t.x}else if("right"===s){const t=this._getYAxisLabelAlignment(f);M=t.textAlign,k=t.x}else if("x"===e){if("center"===s)w=(t.top+t.bottom)/2+g;else if(u(s)){const t=Object.keys(s)[0],e=s[t];w=this.chart.scales[t].getPixelForValue(e)+g}M=this._getXAxisLabelAlignment()}else if("y"===e){if("center"===s)k=(t.left+t.right)/2-g;else if(u(s)){const t=Object.keys(s)[0],e=s[t];k=this.chart.scales[t].getPixelForValue(e)}M=this._getYAxisLabelAlignment(f).textAlign}"y"===e&&("start"===r?T="top":"end"===r&&(T="bottom"));const L=this._getLabelSizes();for(x=0,_=o.length;x<_;++x){y=o[x],v=y.label;const t=n.setContext(this.getContext(x));S=this.getPixelForTick(x)+n.labelOffset,P=this._resolveTickFontOptions(x),O=P.lineHeight,C=d(v)?v.length:1;const e=C/2,i=t.color,r=t.textStrokeColor,h=t.textStrokeWidth;let u;if(a?(k=S,D="top"===s?"near"===l||0!==m?-C*O+O/2:"center"===l?-L.highest.height/2-e*O+O:-L.highest.height+O/2:"near"===l||0!==m?O/2:"center"===l?L.highest.height/2-e*O:L.highest.height-C*O,c&&(D*=-1)):(w=S,D=(1-C)*O/2),t.showLabelBackdrop){const e=De(t.backdropPadding),i=L.heights[x],s=L.widths[x];let n=w+D-e.top,a=k-e.left;switch(T){case"middle":n-=i/2;break;case"bottom":n-=i;break}switch(M){case"center":a-=s/2;break;case"right":a-=s;break}u={left:a,top:n,width:s+e.width,height:i+e.height,color:t.backdropColor}}b.push({rotation:m,label:v,font:P,color:i,strokeColor:r,strokeWidth:h,textOffset:D,textAlign:M,textBaseline:T,translation:[k,w],backdrop:u})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options,i=-Z(this.labelRotation);if(i)return"top"===t?"left":"right";let s="center";return"start"===e.align?s="left":"end"===e.align&&(s="right"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:n}}=this.options,a=this._getLabelSizes(),o=t+n,r=a.widest.width;let l,h;return"left"===e?s?(h=this.right+n,"near"===i?l="left":"center"===i?(l="center",h+=r/2):(l="right",h+=r)):(h=this.right-o,"near"===i?l="right":"center"===i?(l="center",h-=r/2):(l="left",h=this.left)):"right"===e?s?(h=this.left+n,"near"===i?l="right":"center"===i?(l="center",h-=r/2):(l="left",h-=r)):(h=this.left+o,"near"===i?l="left":"center"===i?(l="center",h+=r/2):(l="right",h=this.right)):l="right",{textAlign:l,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;return"left"===e||"right"===e?{top:0,left:this.left,bottom:t.height,right:this.right}:"top"===e||"bottom"===e?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:n,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,n,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks,s=i.findIndex(e=>e.value===t);if(s>=0){const t=e.setContext(this.getContext(s));return t.lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,a;const o=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,a=s.length;n<a;++n){const t=s[n];e.drawOnChartArea&&o({x:t.x1,y:t.y1},{x:t.x2,y:t.y2},t),e.drawTicks&&o({x:t.tx1,y:t.ty1},{x:t.tx2,y:t.ty2},{color:t.tickColor,width:t.tickWidth,borderDash:t.tickBorderDash,borderDashOffset:t.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{grid:i}}=this,s=i.setContext(this.getContext()),n=i.drawBorder?s.borderWidth:0;if(!n)return;const a=i.setContext(this.getContext(0)).lineWidth,o=this._borderValue;let r,l,h,c;this.isHorizontal()?(r=ce(t,this.left,n)-n/2,l=ce(t,this.right,a)+a/2,h=c=o):(h=ce(t,this.top,n)-n/2,c=ce(t,this.bottom,a)+a/2,r=l=o),e.save(),e.lineWidth=s.borderWidth,e.strokeStyle=s.borderColor,e.beginPath(),e.moveTo(r,h),e.lineTo(l,c),e.stroke(),e.restore()}drawLabels(t){const e=this.options.ticks;if(!e.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ge(i,s);const n=this._labelItems||(this._labelItems=this._computeLabelItems(t));let a,o;for(a=0,o=n.length;a<o;++a){const t=n[a],e=t.font,s=t.label;t.backdrop&&(i.fillStyle=t.backdrop.color,i.fillRect(t.backdrop.left,t.backdrop.top,t.backdrop.width,t.backdrop.height));let o=t.textOffset;xe(i,s,0,o,e,t)}s&&pe(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const n=Te(i.font),a=De(i.padding),o=i.align;let r=n.lineHeight/2;"bottom"===e||"center"===e||u(e)?(r+=a.bottom,d(i.text)&&(r+=n.lineHeight*(i.text.length-1))):r+=a.top;const{titleX:l,titleY:h,maxWidth:c,rotation:f}=Ma(this,r,e,o);xe(t,i.text,0,0,n,{color:i.color,maxWidth:c,rotation:f,textAlign:wa(o,e,s),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=p(t.grid&&t.grid.z,-1);return this._isVisible()&&this.draw===Sa.prototype.draw?[{z:i,draw:t=>{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,a;for(n=0,a=e.length;n<a;++n){const a=e[n];a[i]!==this.id||t&&a.type!==t||s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Te(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Pa{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Da(e)&&(i=this.register(e));const s=this.items,n=t.id,a=this.scope+"."+n;if(!n)throw new Error("class does not have id: "+t);return n in s?a:(s[n]=t,Oa(t,a,i),this.override&&oe.override(t.id,t.overrides),a)}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in oe[s]&&(delete oe[s][i],this.override&&delete ee[i])}}function Oa(t,e,i){const s=M(Object.create(null),[i?oe.get(i):{},oe.get(e),t.defaults]);oe.set(e,s),t.defaultRoutes&&Ca(e,t.defaultRoutes),t.descriptors&&oe.describe(e,t.descriptors)}function Ca(t,e){Object.keys(e).forEach(i=>{const s=i.split("."),n=s.pop(),a=[t].concat(s).join("."),o=e[i].split("."),r=o.pop(),l=o.join(".");oe.route(a,n,l,r)})}function Da(t){return"id"in t&&"defaults"in t}class Ta{constructor(){this.controllers=new Pa(As,"datasets",!0),this.elements=new Pa(sa,"elements"),this.plugins=new Pa(Object,"plugins"),this.scales=new Pa(Sa,"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,e,i){[...e].forEach(e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):_(e,e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)})})}_exec(t,e,i){const s=L(t);x(i["before"+s],[],i),e[t](i),x(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(void 0===s)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var La=new Ta;class Aa{constructor(){this._init=[]}notify(t,e,i,s){"beforeInit"===e&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const n=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(n,t,e,i);return"destroy"===e&&(this._notify(n,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const n of t){const t=n.plugin,a=t[i],o=[e,s,n.options];if(!1===x(a,o,t)&&s.cancelable)return!1}return!0}invalidate(){c(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=p(i.options&&i.options.plugins,{}),n=Ra(i);return!1!==s||e?Ia(t,n,s,e):[]}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(t,e)=>t.filter(t=>!e.some(e=>t.plugin.id===e.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Ra(t){const e=[],i=Object.keys(La.plugins.items);for(let n=0;n<i.length;n++)e.push(La.getPlugin(i[n]));const s=t.plugins||[];for(let n=0;n<s.length;n++){const t=s[n];-1===e.indexOf(t)&&e.push(t)}return e}function Ea(t,e){return e||!1!==t?!0===t?{}:t:null}function Ia(t,e,i,s){const n=[],a=t.getContext();for(let o=0;o<e.length;o++){const r=e[o],l=r.id,h=Ea(i[l],s);null!==h&&n.push({plugin:r,options:Fa(t.config,r,h,a)})}return n}function Fa(t,e,i,s){const n=t.pluginScopeKeys(e),a=t.getOptionScopes(i,n);return t.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function za(t,e){const i=oe.datasets[t]||{},s=(e.datasets||{})[t]||{};return s.indexAxis||e.indexAxis||i.indexAxis||"x"}function Va(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}function ja(t,e){return t===e?"_index_":"_value_"}function Ba(t){return"top"===t||"bottom"===t?"x":"left"===t||"right"===t?"y":void 0}function Na(t,e){return"x"===t||"y"===t?t:e.axis||Ba(e.position)||t.charAt(0).toLowerCase()}function Wa(t,e){const i=ee[t.type]||{scales:{}},s=e.scales||{},n=za(t.type,e),a=Object.create(null),o=Object.create(null);return Object.keys(s).forEach(t=>{const e=s[t];if(!u(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const r=Na(t,e),l=ja(r,n),h=i.scales||{};a[r]=a[r]||t,o[t]=S(Object.create(null),[{axis:r},e,h[r],h[l]])}),t.data.datasets.forEach(i=>{const n=i.type||t.type,r=i.indexAxis||za(n,e),l=ee[n]||{},h=l.scales||{};Object.keys(h).forEach(t=>{const e=Va(t,r),n=i[e+"AxisID"]||a[e]||e;o[n]=o[n]||Object.create(null),S(o[n],[{axis:e},s[n],h[t]])})}),Object.keys(o).forEach(t=>{const e=o[t];S(e,[oe.scales[e.type],oe.scale])}),o}function Ha(t){const e=t.options||(t.options={});e.plugins=p(e.plugins,{}),e.scales=Wa(t,e)}function $a(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Ya(t){return t=t||{},t.data=$a(t.data),Ha(t),t}const Ua=new Map,Xa=new Set;function qa(t,e){let i=Ua.get(t);return i||(i=e(),Ua.set(t,i),Xa.add(i)),i}const Ka=(t,e,i)=>{const s=T(e,i);void 0!==s&&t.add(s)};class Ga{constructor(t){this._config=Ya(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=$a(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ha(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return qa(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return qa(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return qa(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return qa(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const r=new Set;e.forEach(e=>{t&&(r.add(t),e.forEach(e=>Ka(r,t,e))),e.forEach(t=>Ka(r,s,t)),e.forEach(t=>Ka(r,ee[n]||{},t)),e.forEach(t=>Ka(r,oe,t)),e.forEach(t=>Ka(r,ie,t))});const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),Xa.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,ee[e]||{},oe.datasets[e]||{},{type:e},oe,ie]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:a,subPrefixes:o}=Za(this._resolverCache,t,s);let r=a;if(Ja(a,e)){n.$shared=!1,i=R(i)?i():i;const e=this.createResolver(t,i,o);r=He(a,i,e)}for(const l of e)n[l]=r[l];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Za(this._resolverCache,t,i);return u(e)?He(n,e,void 0,s):n}}function Za(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let a=s.get(n);if(!a){const t=We(e,i);a={resolver:t,subPrefixes:i.filter(t=>!t.toLowerCase().includes("hover"))},s.set(n,a)}return a}const Qa=t=>u(t)&&Object.getOwnPropertyNames(t).reduce((e,i)=>e||R(t[i]),!1);function Ja(t,e){const{isScriptable:i,isIndexable:s}=$e(t);for(const n of e){const e=i(n),a=s(n),o=(a||e)&&t[n];if(e&&(R(o)||Qa(o))||a&&d(o))return!0}return!1}var to="3.6.0";const eo=["top","bottom","left","right","chartArea"];function io(t,e){return"top"===t||"bottom"===t||-1===eo.indexOf(t)&&"x"===e}function so(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function no(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),x(i&&i.onComplete,[t],e)}function ao(t){const e=t.chart,i=e.options.animation;x(i&&i.onProgress,[t],e)}function oo(t){return bi()&&"string"===typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ro={},lo=t=>{const e=oo(t);return Object.values(ro).filter(t=>t.canvas===e).pop()};class ho{constructor(t,e){const i=this.config=new Ga(e),s=oo(t),n=lo(s);if(n)throw new Error("Canvas is already in use. Chart with ID '"+n.id+"' must be destroyed before the canvas can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||ia(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,o.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;this.id=h(),this.ctx=r,this.canvas=l,this.width=d,this.height=c,this._options=o,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 Aa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=a(t=>this.update(t),o.resizeDelay||0),ro[this.id]=this,r&&l?(ss.listen(this,"complete",no),ss.listen(this,"progress",ao),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return c(t)?e&&n?n:s?i/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}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ti(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return de(this.canvas,this.ctx),this}stop(){return ss.stop(this),this}resize(t,e){ss.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,n),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ti(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),x(i.onResize,[this,a],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){const t=this.options,e=t.scales||{};_(e,(t,e)=>{t.id=e})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((t,e)=>{return t[e]=!1,t},{});let n=[];e&&(n=n.concat(Object.keys(e).map(t=>{const i=e[t],s=Na(t,i),n="r"===s,a="x"===s;return{options:i,dposition:n?"chartArea":a?"bottom":"left",dtype:n?"radialLinear":a?"category":"linear"}}))),_(n,e=>{const n=e.options,a=n.id,o=Na(a,n),r=p(n.type,e.dtype);void 0!==n.position&&io(n.position,o)===io(e.dposition)||(n.position=e.dposition),s[a]=!0;let l=null;if(a in i&&i[a].type===r)l=i[a];else{const t=La.getScale(r);l=new t({id:a,type:r,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(n,t)}),_(s,(t,e)=>{t||delete i[e]}),_(i,t=>{En.configure(this,t,t.options),En.addBox(this,t)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((t,e)=>t.index-e.index),i>e){for(let t=e;t<i;++t)this._destroyDatasetMeta(t);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(so("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((t,i)=>{0===e.filter(e=>e===t._dataset).length&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const s=e[i];let n=this.getDatasetMeta(i);const a=s.type||this.config.type;if(n.type&&n.type!==a&&(this._destroyDatasetMeta(i),n=this.getDatasetMeta(i)),n.type=a,n.indexAxis=s.indexAxis||za(a,this.options),n.order=s.order||0,n.index=i,n.label=""+s.label,n.visible=this.isDatasetVisible(i),n.controller)n.controller.updateIndex(i),n.controller.linkScales();else{const e=La.getController(a),{datasetElementType:s,dataElementType:o}=oe.datasets[a];Object.assign(e.prototype,{dataElementType:La.getElement(o),datasetElementType:s&&La.getElement(s)}),n.controller=new e(this,i),t.push(n.controller)}}return this._updateMetasets(),t}_resetElements(){_(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext());_(this.scales,t=>{En.removeBox(this,t)});const s=this._animationsDisabled=!i.animation;this.ensureScalesHaveIDs(),this.buildOrUpdateScales();const n=new Set(Object.keys(this._listeners)),a=new Set(i.events);if(E(n,a)&&!!this._responsiveListeners===i.responsive||(this.unbindEvents(),this.bindEvents()),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let l=0,h=this.data.datasets.length;l<h;l++){const{controller:t}=this.getDatasetMeta(l),e=!s&&-1===o.indexOf(t);t.buildOrUpdateElements(e),r=Math.max(+t.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||_(o,t=>{t.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(so("z","_idx")),this._lastEvent&&this._eventHandler(this._lastEvent,!0),this.render()}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;En.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],_(this.boxes,t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))},this),this._layers.forEach((t,e)=>{t._idx=e}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,R(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetUpdate",s)&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){!1!==this.notifyPlugins("beforeRender",{cancelable:!0})&&(ss.has(this)?this.attached&&!ss.running(this)&&ss.start(this):(this.draw(),no({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:t,height:e}=this._resizeBeforeDraw;this._resize(t,e),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0)return;if(!1===this.notifyPlugins("beforeDraw",{cancelable:!0}))return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,n;for(s=0,n=e.length;s<n;++s){const n=e[s];t&&!n.visible||i.push(n)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(!1===this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0}))return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=this.chartArea,a={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",a)&&(s&&ge(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&pe(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}getElementsAtEventForMode(t,e,i,s){const n=bn.modes[e];return"function"===typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(t=>t&&t._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Re(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"===typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),a=n.controller._resolveAnimations(void 0,s);A(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(n,{visible:i}),this.update(e=>e.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ss.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),de(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete ro[this.id]}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};_(this.options.events,t=>i(t,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",n),i("detach",a)};a=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){_(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},_(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,a,o,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),o=0,r=t.length;o<r;++o){a=t[o];const e=a&&this.getDatasetMeta(a.datasetIndex).controller;e&&e[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:t,index:e})=>{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),s=!y(i,e);s&&(this._active=i,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter(t=>!e.some(e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)),a=n(e,t),o=i?t:n(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e){const{_active:i=[],options:s}=this,n=s.hover,a=e;let o=[],r=!1,l=null;return"mouseout"!==t.type&&(o=this.getElementsAtEventForMode(t,n.mode,n,a),l="click"===t.type?this._lastEvent:t),this._lastEvent=null,fe(t,this.chartArea,this._minPadding)&&(x(s.onHover,[t,o,this],this),"mouseup"!==t.type&&"click"!==t.type&&"contextmenu"!==t.type||x(s.onClick,[t,o,this],this)),r=!y(o,i),(r||e)&&(this._active=o,this._updateHoverStyles(o,i,e)),this._lastEvent=l,r}}const co=()=>_(ho.instances,t=>t._plugins.invalidate()),uo=!0;function fo(t,e,i){const{startAngle:s,pixelMargin:n,x:a,y:o,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(a,o,r,s-h,i+h),l>n?(h=n/l,t.arc(a,o,l,i+h,s-h,!0)):t.arc(a,o,n,i+B,s-B),t.closePath(),t.clip()}function go(t){return Pe(t,["outerStart","outerEnd","innerStart","innerEnd"])}function po(t,e,i,s){const n=go(t.options.borderRadius),a=(i-e)/2,o=Math.min(a,s*e/2),r=t=>{const e=(i-Math.min(a,t))*s/2;return at(t,0,Math.min(a,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:at(n.innerStart,0,o),innerEnd:at(n.innerEnd,0,o)}}function mo(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function bo(t,e,i,s,n){const{x:a,y:o,startAngle:r,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+s+i-l,0),d=h>0?h+s+i+l:0;let u=0;const f=n-r;if(s){const t=h>0?h-s:0,e=c>0?c-s:0,i=(t+e)/2,n=0!==i?f*i/(i+s):f;u=(f-n)/2}const g=Math.max(.001,f*c-i/I)/c,p=(f-g)/2,m=r+p+u,b=n-p-u,{outerStart:x,outerEnd:_,innerStart:y,innerEnd:v}=po(e,d,c,b-m),k=c-x,w=c-_,M=m+x/k,S=b-_/w,P=d+y,O=d+v,C=m+y/P,D=b-v/O;if(t.beginPath(),t.arc(a,o,c,M,S),_>0){const e=mo(w,S,a,o);t.arc(e.x,e.y,_,S,b+B)}const T=mo(O,b,a,o);if(t.lineTo(T.x,T.y),v>0){const e=mo(O,D,a,o);t.arc(e.x,e.y,v,b+B,D+Math.PI)}if(t.arc(a,o,d,b-v/d,m+y/d,!0),y>0){const e=mo(P,C,a,o);t.arc(e.x,e.y,y,C+Math.PI,m-B)}const L=mo(k,m,a,o);if(t.lineTo(L.x,L.y),x>0){const e=mo(k,M,a,o);t.arc(e.x,e.y,x,m-B,M)}t.closePath()}function xo(t,e,i,s){const{fullCircles:n,startAngle:a,circumference:o}=e;let r=e.endAngle;if(n){bo(t,e,i,s,a+F);for(let e=0;e<n;++e)t.fill();isNaN(o)||(r=a+o%F,o%F===0&&(r+=F))}return bo(t,e,i,s,r),t.fill(),r}function _o(t,e,i){const{x:s,y:n,startAngle:a,pixelMargin:o,fullCircles:r}=e,l=Math.max(e.outerRadius-o,0),h=e.innerRadius+o;let c;for(i&&fo(t,e,a+F),t.beginPath(),t.arc(s,n,h,a+F,a,!0),c=0;c<r;++c)t.stroke();for(t.beginPath(),t.arc(s,n,l,a,a+F),c=0;c<r;++c)t.stroke()}function yo(t,e,i,s,n){const{options:a}=e,o="inner"===a.borderAlign;a.borderWidth&&(o?(t.lineWidth=2*a.borderWidth,t.lineJoin="round"):(t.lineWidth=a.borderWidth,t.lineJoin="bevel"),e.fullCircles&&_o(t,e,o),o&&fo(t,e,n),bo(t,e,i,s,n),t.stroke())}Object.defineProperties(ho,{defaults:{enumerable:uo,value:oe},instances:{enumerable:uo,value:ro},overrides:{enumerable:uo,value:ee},registry:{enumerable:uo,value:La},version:{enumerable:uo,value:to},getChart:{enumerable:uo,value:lo},register:{enumerable:uo,value:(...t)=>{La.add(...t),co()}},unregister:{enumerable:uo,value:(...t)=>{La.remove(...t),co()}}});class vo extends sa{constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.getProps(["x","y"],i),{angle:n,distance:a}=tt(s,{x:t,y:e}),{startAngle:o,endAngle:r,innerRadius:l,outerRadius:h,circumference:c}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),d=this.options.spacing/2,u=c>=F||nt(n,o,r),f=a>=l+d&&a<=h+d;return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:a,outerRadius:o}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(a+o+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,n=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>F?Math.floor(i/F):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(s){a=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*a,Math.sin(e)*a),this.circumference>=I&&(a=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const o=xo(t,this,a,n);yo(t,this,a,n,o),t.restore()}}function ko(t,e,i=e){t.lineCap=p(i.borderCapStyle,e.borderCapStyle),t.setLineDash(p(i.borderDash,e.borderDash)),t.lineDashOffset=p(i.borderDashOffset,e.borderDashOffset),t.lineJoin=p(i.borderJoinStyle,e.borderJoinStyle),t.lineWidth=p(i.borderWidth,e.borderWidth),t.strokeStyle=p(i.borderColor,e.borderColor)}function wo(t,e,i){t.lineTo(i.x,i.y)}function Mo(t){return t.stepped?me:t.tension||"monotone"===t.cubicInterpolationMode?be:wo}function So(t,e,i={}){const s=t.length,{start:n=0,end:a=s-1}=i,{start:o,end:r}=e,l=Math.max(n,o),h=Math.min(a,r),c=n<o&&a<o||n>r&&a>r;return{count:s,start:l,loop:e.loop,ilen:h<l&&!c?s+h-l:h-l}}function Po(t,e,i,s){const{points:n,options:a}=e,{count:o,start:r,loop:l,ilen:h}=So(n,i,s),c=Mo(a);let d,u,f,{move:g=!0,reverse:p}=s||{};for(d=0;d<=h;++d)u=n[(r+(p?h-d:d))%o],u.skip||(g?(t.moveTo(u.x,u.y),g=!1):c(t,f,u,p,a.stepped),f=u);return l&&(u=n[(r+(p?h:0))%o],c(t,f,u,p,a.stepped)),!!l}function Oo(t,e,i,s){const n=e.points,{count:a,start:o,ilen:r}=So(n,i,s),{move:l=!0,reverse:h}=s||{};let c,d,u,f,g,p,m=0,b=0;const x=t=>(o+(h?r-t:t))%a,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[x(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[x(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(i<f?f=i:i>g&&(g=i),m=(b*m+e)/++b):(_(),t.lineTo(e,i),u=s,b=0,f=g=i),p=i}_()}function Co(t){const e=t.options,i=e.borderDash&&e.borderDash.length,s=!t._decimated&&!t._loop&&!e.tension&&"monotone"!==e.cubicInterpolationMode&&!e.stepped&&!i;return s?Oo:Po}function Do(t){return t.stepped?Ei:t.tension||"monotone"===t.cubicInterpolationMode?Ii:Ri}function To(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),ko(t,e.options),t.stroke(n)}function Lo(t,e,i,s){const{segments:n,options:a}=e,o=Co(e);for(const r of n)ko(t,a,r.style),t.beginPath(),o(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}vo.id="arc",vo.defaults={borderAlign:"center",borderColor:"#fff",borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},vo.defaultRoutes={backgroundColor:"backgroundColor"};const Ao="function"===typeof Path2D;function Ro(t,e,i,s){Ao&&!e.options.segment?To(t,e,i,s):Lo(t,e,i,s)}class Eo extends sa{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,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;mi(this._points,i,t,s,e),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=Zi(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,a=qi(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],r=Do(i);let l,h;for(l=0,h=a.length;l<h;++l){const{start:h,end:c}=a[l],d=n[h],u=n[c];if(d===u){o.push(d);continue}const f=Math.abs((s-d[e])/(u[e]-d[e])),g=r(d,u,f,i.stepped);g[e]=t[e],o.push(g)}return 1===o.length?o[0]:o}pathSegment(t,e,i){const s=Co(this);return s(t,this,e,i)}path(t,e,i){const s=this.segments,n=Co(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=n(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const n=this.options||{},a=this.points||[];a.length&&n.borderWidth&&(t.save(),Ro(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Io(t,e,i,s){const n=t.options,{[i]:a}=t.getProps([i],s);return Math.abs(e-a)<n.radius+n.hitRadius}Eo.id="line",Eo.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0},Eo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"},Eo.descriptors={_scriptable:!0,_indexable:t=>"borderDash"!==t&&"fill"!==t};class Fo extends sa{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:a}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return Io(this,t,"x",e)}inYRange(t,e){return Io(this,t,"y",e)}getCenterPoint(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const i=e&&t.borderWidth||0;return 2*(e+i)}draw(t,e){const i=this.options;this.skip||i.radius<.1||!fe(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ue(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function zo(t,e){const{x:i,y:s,base:n,width:a,height:o}=t.getProps(["x","y","base","width","height"],e);let r,l,h,c,d;return t.horizontal?(d=o/2,r=Math.min(i,n),l=Math.max(i,n),h=s-d,c=s+d):(d=a/2,r=i-d,l=i+d,h=Math.min(s,n),c=Math.max(s,n)),{left:r,top:h,right:l,bottom:c}}function Vo(t,e,i,s){return t?0:at(e,i,s)}function jo(t,e,i){const s=t.options.borderWidth,n=t.borderSkipped,a=Oe(s);return{t:Vo(n.top,a.top,0,i),r:Vo(n.right,a.right,0,e),b:Vo(n.bottom,a.bottom,0,i),l:Vo(n.left,a.left,0,e)}}function Bo(t,e,i){const{enableBorderRadius:s}=t.getProps(["enableBorderRadius"]),n=t.options.borderRadius,a=Ce(n),o=Math.min(e,i),r=t.borderSkipped,l=s||u(n);return{topLeft:Vo(!l||r.top||r.left,a.topLeft,0,o),topRight:Vo(!l||r.top||r.right,a.topRight,0,o),bottomLeft:Vo(!l||r.bottom||r.left,a.bottomLeft,0,o),bottomRight:Vo(!l||r.bottom||r.right,a.bottomRight,0,o)}}function No(t){const e=zo(t),i=e.right-e.left,s=e.bottom-e.top,n=jo(t,i/2,s/2),a=Bo(t,i/2,s/2);return{outer:{x:e.left,y:e.top,w:i,h:s,radius:a},inner:{x:e.left+n.l,y:e.top+n.t,w:i-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,a.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(n.b,n.r))}}}}function Wo(t,e,i,s){const n=null===e,a=null===i,o=n&&a,r=t&&!o&&zo(t,s);return r&&(n||e>=r.left&&e<=r.right)&&(a||i>=r.top&&i<=r.bottom)}function Ho(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function $o(t,e){t.rect(e.x,e.y,e.w,e.h)}function Yo(t,e,i={}){const s=t.x!==i.x?-e:0,n=t.y!==i.y?-e:0,a=(t.x+t.w!==i.x+i.w?e:0)-s,o=(t.y+t.h!==i.y+i.h?e:0)-n;return{x:t.x+s,y:t.y+n,w:t.w+a,h:t.h+o,radius:t.radius}}Fo.id="point",Fo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0},Fo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};class Uo extends sa{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:n,outer:a}=No(this),o=Ho(a.radius)?ve:$o;t.save(),a.w===n.w&&a.h===n.h||(t.beginPath(),o(t,Yo(a,e,n)),t.clip(),o(t,Yo(n,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,Yo(n,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Wo(this,t,e,i)}inXRange(t,e){return Wo(this,t,null,e)}inYRange(t,e){return Wo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:n}=this.getProps(["x","y","base","horizontal"],t);return{x:n?(e+s)/2:e,y:n?i:(i+s)/2}}getRange(t){return"x"===t?this.width/2:this.height/2}}Uo.id="bar",Uo.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0},Uo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};new WeakMap;const Xo={average(t){if(!t.length)return!1;let e,i,s=0,n=0,a=0;for(e=0,i=t.length;e<i;++e){const i=t[e].element;if(i&&i.hasValue()){const t=i.tooltipPosition();s+=t.x,n+=t.y,++a}}return{x:s/a,y:n/a}},nearest(t,e){if(!t.length)return!1;let i,s,n,a=e.x,o=e.y,r=Number.POSITIVE_INFINITY;for(i=0,s=t.length;i<s;++i){const s=t[i].element;if(s&&s.hasValue()){const t=s.getCenterPoint(),i=et(e,t);i<r&&(r=i,n=s)}}if(n){const t=n.tooltipPosition();a=t.x,o=t.y}return{x:a,y:o}}};function qo(t,e){return e&&(d(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Ko(t){return("string"===typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Go(t,e){const{element:i,datasetIndex:s,index:n}=e,a=t.getDatasetMeta(s).controller,{label:o,value:r}=a.getLabelAndValue(n);return{chart:t,label:o,parsed:a.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:a.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Zo(t,e){const i=t._chart.ctx,{body:s,footer:n,title:a}=t,{boxWidth:o,boxHeight:r}=e,l=Te(e.bodyFont),h=Te(e.titleFont),c=Te(e.footerFont),d=a.length,u=n.length,f=s.length,g=De(e.padding);let p=g.height,m=0,b=s.reduce((t,e)=>t+e.before.length+e.lines.length+e.after.length,0);if(b+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){const t=e.displayColors?Math.max(r,l.lineHeight):l.lineHeight;p+=f*t+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let x=0;const y=function(t){m=Math.max(m,i.measureText(t).width+x)};return i.save(),i.font=h.string,_(t.title,y),i.font=l.string,_(t.beforeBody.concat(t.afterBody),y),x=e.displayColors?o+2+e.boxPadding:0,_(s,t=>{_(t.before,y),_(t.lines,y),_(t.after,y)}),x=0,i.font=c.string,_(t.footer,y),i.restore(),m+=g.width,{width:m,height:p}}function Qo(t,e){const{y:i,height:s}=e;return i<s/2?"top":i>t.height-s/2?"bottom":"center"}function Jo(t,e,i,s){const{x:n,width:a}=s,o=i.caretSize+i.caretPadding;return"left"===t&&n+a+o>e.width||("right"===t&&n-a-o<0||void 0)}function tr(t,e,i,s){const{x:n,width:a}=i,{width:o,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=a/2?h="left":n>=o-a/2&&(h="right"),Jo(h,t,e,i)&&(h="center"),h}function er(t,e,i){const s=e.yAlign||Qo(t,i);return{xAlign:e.xAlign||tr(t,e,i,s),yAlign:s}}function ir(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}function sr(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}function nr(t,e,i,s){const{caretSize:n,caretPadding:a,cornerRadius:o}=t,{xAlign:r,yAlign:l}=i,h=n+a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Ce(o);let g=ir(e,r);const p=sr(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+a:"right"===r&&(g+=Math.max(d,f)+a),{x:at(g,0,s.width-e.width),y:at(p,0,s.height-e.height)}}function ar(t,e,i){const s=De(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function or(t){return qo([],Ko(t))}function rr(t,e,i){return Re(t,{tooltip:e,tooltipItems:i,type:"tooltip"})}function lr(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class hr extends sa{constructor(t){super(),this.opacity=0,this._active=[],this._chart=t._chart,this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this._chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new cs(this._chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=rr(this._chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),a=i.afterTitle.apply(this,[t]);let o=[];return o=qo(o,Ko(s)),o=qo(o,Ko(n)),o=qo(o,Ko(a)),o}getBeforeBody(t,e){return or(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return _(t,t=>{const e={before:[],lines:[],after:[]},n=lr(i,t);qo(e.before,Ko(n.beforeLabel.call(this,t))),qo(e.lines,n.label.call(this,t)),qo(e.after,Ko(n.afterLabel.call(this,t))),s.push(e)}),s}getAfterBody(t,e){return or(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),a=i.afterFooter.apply(this,[t]);let o=[];return o=qo(o,Ko(s)),o=qo(o,Ko(n)),o=qo(o,Ko(a)),o}_createItems(t){const e=this._active,i=this._chart.data,s=[],n=[],a=[];let o,r,l=[];for(o=0,r=e.length;o<r;++o)l.push(Go(this._chart,e[o]));return t.filter&&(l=l.filter((e,s,n)=>t.filter(e,s,n,i))),t.itemSort&&(l=l.sort((e,s)=>t.itemSort(e,s,i))),_(l,e=>{const i=lr(t.callbacks,e);s.push(i.labelColor.call(this,e)),n.push(i.labelPointStyle.call(this,e)),a.push(i.labelTextColor.call(this,e))}),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,a=[];if(s.length){const t=Xo[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const e=this._size=Zo(this,i),o=Object.assign({},t,e),r=er(this._chart,i,o),l=nr(i,o,r,this._chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=a,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this._chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=Ce(o),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,b,x,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-a,x=_+a,y=_-a):(p=d+f,m=p+a,x=_-a,y=_+a),b=p):(m="left"===s?d+Math.max(r,h)+a:"right"===s?d+f-Math.max(l,c)-a:this.caretX,"top"===n?(x=u,_=x-a,p=m-a,b=m+a):(x=u+g,_=x+a,p=m+a,b=m-a),y=x),{x1:p,x2:m,x3:b,y1:x,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let a,o,r;if(n){const l=Ni(i.rtl,this.x,this.width);for(t.x=ar(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",a=Te(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,r=0;r<n;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,r+1===n&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,n){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:r,boxWidth:l,boxPadding:h}=n,c=Te(n.bodyFont),d=ar(this,"left",n),u=s.x(d),f=r<c.lineHeight?(c.lineHeight-r)/2:0,g=e.y+f;if(n.usePointStyle){const e={radius:Math.min(l,r)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},i=s.leftForLtr(u,l)+l/2,h=g+r/2;t.strokeStyle=n.multiKeyBackground,t.fillStyle=n.multiKeyBackground,ue(t,e,i,h),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ue(t,e,i,h)}else{t.lineWidth=a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const e=s.leftForLtr(u,l-h),i=s.leftForLtr(s.xPlus(u,1),l-h-2),o=Ce(a.borderRadius);Object.values(o).some(t=>0!==t)?(t.beginPath(),t.fillStyle=n.multiKeyBackground,ve(t,{x:e,y:g,w:l,h:r,radius:o}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ve(t,{x:i,y:g+1,w:l-2,h:r-2,radius:o}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,l,r),t.strokeRect(e,g,l,r),t.fillStyle=a.backgroundColor,t.fillRect(i,g+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:a,displayColors:o,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=Te(i.bodyFont);let d=c.lineHeight,u=0;const f=Ni(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(a);let m,b,x,y,v,k,w;for(e.textAlign=a,e.textBaseline="middle",e.font=c.string,t.x=ar(this,p,i),e.fillStyle=i.bodyColor,_(this.beforeBody,g),u=o&&"right"!==p?"center"===a?l/2+h:l+2+h:0,y=0,k=s.length;y<k;++y){for(m=s[y],b=this.labelTextColors[y],e.fillStyle=b,_(m.before,g),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,y,f,i),d=Math.max(c.lineHeight,r)),v=0,w=x.length;v<w;++v)g(x[v]),d=c.lineHeight;_(m.after,g)}u=0,d=c.lineHeight,_(this.afterBody,g),t.y-=n}drawFooter(t,e,i){const s=this.footer,n=s.length;let a,o;if(n){const r=Ni(i.rtl,this.x,this.width);for(t.x=ar(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=r.textAlign(i.footerAlign),e.textBaseline="middle",a=Te(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<n;++o)e.fillText(s[o],r.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:n,yAlign:a}=this,{x:o,y:r}=t,{width:l,height:h}=i,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Ce(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+c,r),"top"===a&&this.drawCaret(t,e,i,s),e.lineTo(o+l-d,r),e.quadraticCurveTo(o+l,r,o+l,r+d),"center"===a&&"right"===n&&this.drawCaret(t,e,i,s),e.lineTo(o+l,r+h-f),e.quadraticCurveTo(o+l,r+h,o+l-f,r+h),"bottom"===a&&this.drawCaret(t,e,i,s),e.lineTo(o+u,r+h),e.quadraticCurveTo(o,r+h,o,r+h-u),"center"===a&&"left"===n&&this.drawCaret(t,e,i,s),e.lineTo(o,r+c),e.quadraticCurveTo(o,r,o+c,r),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this._chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Xo[t.position].call(this,this._active,this._eventPosition);if(!i)return;const a=this._size=Zo(this,t),o=Object.assign({},i,this._size),r=er(e,t,o),l=nr(t,o,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=a.width,this.height=a.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=De(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Wi(t,e.textDirection),n.y+=a.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),Hi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:t,index:e})=>{const i=this._chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}),n=!y(i,s),a=this._positionChanged(s,e);(n||a)&&(this._active=s,this._eventPosition=e,this.update(!0))}handleEvent(t,e){const i=this.options,s=this._active||[];let n=!1,a=[];"mouseout"!==t.type&&(a=this._chart.getElementsAtEventForMode(t,i.mode,i,e),i.reverse&&a.reverse());const o=this._positionChanged(a,t);return n=e||!y(a,s)||o,n&&(this._active=a,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),n}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,a=Xo[n.position].call(this,t,e);return!1!==a&&(i!==a.x||s!==a.y)}}hr.positioners=Xo;var cr={id:"tooltip",_element:hr,positioners:Xo,afterInit(t,e,i){i&&(t.tooltip=new hr({_chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:l,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return i[e.dataIndex]}return""},afterTitle:l,beforeBody:l,beforeLabel:l,label(t){if(this&&this.options&&"dataset"===this.options.mode)return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const i=t.formattedValue;return c(i)||(e+=i),e},labelColor(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const e=t.chart.getDatasetMeta(t.datasetIndex),i=e.controller.getStyle(t.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:l,afterBody:l,beforeFooter:l,footer:l,afterFooter:l}},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const dr=(t,e,i)=>"string"===typeof e?t.push(e)-1:isNaN(e)?null:i;function ur(t,e,i){const s=t.indexOf(e);if(-1===s)return dr(t,e,i);const n=t.lastIndexOf(e);return s!==n?i:s}const fr=(t,e)=>null===t?null:at(Math.round(t),0,e);class gr extends Sa{constructor(t){super(t),this._startValue=void 0,this._valueRange=0}parse(t,e){if(c(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:ur(i,t,p(e,t)),fr(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return"number"!==typeof t&&(t=this.parse(t)),null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function pr(t,e){const i=[],s=1e-14,{bounds:n,step:a,min:o,max:r,precision:l,count:h,maxTicks:d,maxDigits:u,includeBounds:f}=t,g=a||1,p=d-1,{min:m,max:b}=e,x=!c(o),_=!c(r),y=!c(h),v=(b-m)/(u+1);let k,w,M,S,P=Y((b-m)/p/g)*g;if(P<s&&!x&&!_)return[{value:m},{value:b}];S=Math.ceil(b/P)-Math.floor(m/P),S>p&&(P=Y(S*P/p/g)*g),c(l)||(k=Math.pow(10,l),P=Math.ceil(P*k)/k),"ticks"===n?(w=Math.floor(m/P)*P,M=Math.ceil(b/P)*P):(w=m,M=b),x&&_&&a&&K((r-o)/a,P/1e3)?(S=Math.round(Math.min((r-o)/P,d)),P=(r-o)/S,w=o,M=r):y?(w=x?o:w,M=_?r:M,S=h-1,P=(M-w)/S):(S=(M-w)/P,S=q(S,Math.round(S),P/1e3)?Math.round(S):Math.ceil(S));const O=Math.max(J(P),J(w));k=Math.pow(10,c(l)?O:l),w=Math.round(w*k)/k,M=Math.round(M*k)/k;let C=0;for(x&&(f&&w!==o?(i.push({value:o}),w<o&&C++,q(Math.round((w+C*P)*k)/k,o,mr(o,v,t))&&C++):w<o&&C++);C<S;++C)i.push({value:Math.round((w+C*P)*k)/k});return _&&f&&M!==r?i.length&&q(i[i.length-1].value,r,mr(r,v,t))?i[i.length-1].value=r:i.push({value:r}):_&&M!==r||i.push({value:M}),i}function mr(t,e,{horizontal:i,minRotation:s}){const n=Z(s),a=(i?Math.sin(n):Math.cos(n))||.001,o=.75*e*(""+t).length;return Math.min(e/a,o)}gr.id="category",gr.defaults={ticks:{callback:gr.prototype.getLabelForValue}};class br extends Sa{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,e){return c(t)?null:("number"===typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const a=t=>s=e?s:t,o=t=>n=i?n:t;if(t){const t=$(s),e=$(n);t<0&&e<0?o(0):t>0&&e>0&&a(0)}if(s===n){let e=1;(n>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*n)),o(n+e),t||a(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:!1!==e.includeBounds},n=this._range||this,a=pr(s,n);return"ticks"===t.bounds&&G(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Vi(t,this.chart.options.locale)}}class xr extends br{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=f(t)?t:0,this.max=f(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Z(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,n=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,n.lineHeight/s))}getPixelForValue(t){return null===t?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}function _r(t){const e=t/Math.pow(10,Math.floor(H(t)));return 1===e}function yr(t,e){const i=Math.floor(H(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),n=[];let a=g(t.min,Math.pow(10,Math.floor(H(e.min)))),o=Math.floor(H(a)),r=Math.floor(a/Math.pow(10,o)),l=o<0?Math.pow(10,Math.abs(o)):1;do{n.push({value:a,major:_r(a)}),++r,10===r&&(r=1,++o,l=o>=0?1:l),a=Math.round(r*Math.pow(10,o)*l)/l}while(o<i||o===i&&r<s);const h=g(t.max,a);return n.push({value:h,major:_r(a)}),n}xr.id="linear",xr.defaults={ticks:{callback:oa.formatters.numeric}};class vr extends Sa{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=br.prototype.parse.apply(this,[t,e]);if(0!==i)return f(i)&&i>0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=f(t)?Math.max(0,t):null,this.max=f(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,a=t=>s=e?s:t,o=(t,e)=>Math.pow(10,Math.floor(H(t))+e);i===s&&(i<=0?(n(1),a(10)):(n(o(i,-1)),a(o(s,1)))),i<=0&&n(o(s,-1)),s<=0&&a(o(i,1)),this._zero&&this.min!==this._suggestedMin&&i===o(this.min,0)&&n(o(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=yr(e,this);return"ticks"===t.bounds&&G(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return void 0===t?"0":Vi(t,this.chart.options.locale)}configure(){const t=this.min;super.configure(),this._startValue=H(t),this._valueRange=H(this.max)-H(t)}getPixelForValue(t){return void 0!==t&&0!==t||(t=this.min),null===t||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(H(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function kr(t){const e=t.ticks;if(e.display&&t.display){const t=De(e.backdropPadding);return p(e.font&&e.font.size,oe.font.size)+t.height}return 0}function wr(t,e,i){return i=d(i)?i:[i],{w:he(t,e.string,i),h:i.length*e.lineHeight}}function Mr(t,e,i,s,n){return t===s||t===n?{start:e-i/2,end:e+i/2}:t<s||t>n?{start:e-i,end:e}:{start:e,end:e+i}}function Sr(t){const e={l:0,r:t.width,t:0,b:t.height-t.paddingTop},i={},s=[],n=[],a=t.getLabels().length;for(let o=0;o<a;o++){const a=t.options.pointLabels.setContext(t.getPointLabelContext(o));n[o]=a.padding;const r=t.getPointPosition(o,t.drawingArea+n[o]),l=Te(a.font),h=wr(t.ctx,l,t._pointLabels[o]);s[o]=h;const c=t.getIndexAngle(o),d=Q(c),u=Mr(d,r.x,h.w,0,180),f=Mr(d,r.y,h.h,90,270);u.start<e.l&&(e.l=u.start,i.l=c),u.end>e.r&&(e.r=u.end,i.r=c),f.start<e.t&&(e.t=f.start,i.t=c),f.end>e.b&&(e.b=f.end,i.b=c)}t._setReductions(t.drawingArea,e,i),t._pointLabelItems=Pr(t,s,n)}function Pr(t,e,i){const s=[],n=t.getLabels().length,a=t.options,o=kr(a),r=t.getDistanceFromCenterForValue(a.ticks.reverse?t.min:t.max);for(let l=0;l<n;l++){const n=0===l?o/2:0,a=t.getPointPosition(l,r+n+i[l]),h=Q(t.getIndexAngle(l)),c=e[l],d=Dr(a.y,c.h,h),u=Or(h),f=Cr(a.x,c.w,u);s.push({x:a.x,y:d,textAlign:u,left:f,top:d,right:f+c.w,bottom:d+c.h})}return s}function Or(t){return 0===t||180===t?"center":t<180?"left":"right"}function Cr(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function Dr(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function Tr(t,e){const{ctx:i,options:{pointLabels:s}}=t;for(let n=e-1;n>=0;n--){const e=s.setContext(t.getPointLabelContext(n)),a=Te(e.font),{x:o,y:r,textAlign:l,left:h,top:d,right:u,bottom:f}=t._pointLabelItems[n],{backdropColor:g}=e;if(!c(g)){const t=De(e.backdropPadding);i.fillStyle=g,i.fillRect(h-t.left,d-t.top,u-h+t.width,f-d+t.height)}xe(i,t._pointLabels[n],o,r+a.lineHeight/2,a,{color:e.color,textAlign:l,textBaseline:"middle"})}}function Lr(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,F);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let a=1;a<s;a++)i=t.getPointPosition(a,e),n.lineTo(i.x,i.y)}}function Ar(t,e,i,s){const n=t.ctx,a=e.circular,{color:o,lineWidth:r}=e;!a&&!s||!o||!r||i<0||(n.save(),n.strokeStyle=o,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),Lr(t,i,a,s),n.closePath(),n.stroke(),n.restore())}function Rr(t){return X(t)?t:0}function Er(t,e,i){return Re(t,{label:i,index:e,type:"pointLabel"})}vr.id="logarithmic",vr.defaults={ticks:{callback:oa.formatters.logarithmic,major:{enabled:!0}}};class Ir extends br{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){this.width=this.maxWidth,this.height=this.maxHeight,this.paddingTop=kr(this.options)/2,this.xCenter=Math.floor(this.width/2),this.yCenter=Math.floor((this.height-this.paddingTop)/2),this.drawingArea=Math.min(this.height-this.paddingTop,this.width)/2}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=f(t)&&!isNaN(t)?t:0,this.max=f(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/kr(this.options))}generateTickLabels(t){br.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((t,e)=>{const i=x(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})}fit(){const t=this.options;t.display&&t.pointLabels.display?Sr(this):this.setCenterPoint(0,0,0,0)}_setReductions(t,e,i){let s=e.l/Math.sin(i.l),n=Math.max(e.r-this.width,0)/Math.sin(i.r),a=-e.t/Math.cos(i.t),o=-Math.max(e.b-(this.height-this.paddingTop),0)/Math.cos(i.b);s=Rr(s),n=Rr(n),a=Rr(a),o=Rr(o),this.drawingArea=Math.max(t/2,Math.min(Math.floor(t-(s+n)/2),Math.floor(t-(a+o)/2))),this.setCenterPoint(s,n,a,o)}setCenterPoint(t,e,i,s){const n=this.width-e-this.drawingArea,a=t+this.drawingArea,o=i+this.drawingArea,r=this.height-this.paddingTop-s-this.drawingArea;this.xCenter=Math.floor((a+n)/2+this.left),this.yCenter=Math.floor((o+r)/2+this.top+this.paddingTop)}getIndexAngle(t){const e=F/this.getLabels().length,i=this.options.startAngle||0;return st(t*e+Z(i))}getDistanceFromCenterForValue(t){if(c(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(c(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Er(this.getContext(),t,i)}}getPointPosition(t,e){const i=this.getIndexAngle(t)-B;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:n}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:n}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Lr(this,this.getDistanceFromCenterForValue(this._endValue),e,this.getLabels().length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s}=e,n=this.getLabels().length;let a,o,r;if(e.pointLabels.display&&Tr(this,n),s.display&&this.ticks.forEach((t,e)=>{if(0!==e){o=this.getDistanceFromCenterForValue(t.value);const i=s.setContext(this.getContext(e-1));Ar(this,i,o,n)}}),i.display){for(t.save(),a=this.getLabels().length-1;a>=0;a--){const s=i.setContext(this.getPointLabelContext(a)),{color:n,lineWidth:l}=s;l&&n&&(t.lineWidth=l,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,o=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),r=this.getPointPosition(a,o),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((s,o)=>{if(0===o&&!e.reverse)return;const r=i.setContext(this.getContext(o)),l=Te(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[o].value),r.showLabelBackdrop){t.font=l.string,a=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=De(r.backdropPadding);t.fillRect(-a/2-e.left,-n-l.size/2-e.top,a+e.width,l.size+e.height)}xe(t,s.label,0,-n,l,{color:r.color})}),t.restore()}drawTitle(){}}Ir.id="radialLinear",Ir.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:oa.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5}},Ir.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},Ir.descriptors={angleLines:{_fallback:"grid"}};const Fr={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}},zr=Object.keys(Fr);function Vr(t,e){return t-e}function jr(t,e){if(c(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:a}=t._parseOpts;let o=e;return"function"===typeof s&&(o=s(o)),f(o)||(o="string"===typeof s?i.parse(o,s):i.parse(o)),null===o?null:(n&&(o="week"!==n||!X(a)&&!0!==a?i.startOf(o,n):i.startOf(o,"isoWeek",a)),+o)}function Br(t,e,i,s){const n=zr.length;for(let a=zr.indexOf(t);a<n-1;++a){const t=Fr[zr[a]],n=t.steps?t.steps:Number.MAX_SAFE_INTEGER;if(t.common&&Math.ceil((i-e)/(n*t.size))<=s)return zr[a]}return zr[n-1]}function Nr(t,e,i,s,n){for(let a=zr.length-1;a>=zr.indexOf(i);a--){const i=zr[a];if(Fr[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return zr[i?zr.indexOf(i):0]}function Wr(t){for(let e=zr.indexOf(t)+1,i=zr.length;e<i;++e)if(Fr[zr[e]].common)return zr[e]}function Hr(t,e,i){if(i){if(i.length){const{lo:s,hi:n}=Ee(i,e),a=i[s]>=e?i[s]:i[n];t[a]=!0}}else t[e]=!0}function $r(t,e,i,s){const n=t._adapter,a=+n.startOf(e[0].value,s),o=e[e.length-1].value;let r,l;for(r=a;r<=o;r=+n.add(r,1,s))l=i[r],l>=0&&(e[l].major=!0);return e}function Yr(t,e,i){const s=[],n={},a=e.length;let o,r;for(o=0;o<a;++o)r=e[o],n[r]=o,s.push({value:r,major:!1});return 0!==a&&i?$r(t,s,n,i):s}class Ur extends Sa{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,e){const i=t.time||(t.time={}),s=this._adapter=new ln._date(t.adapters.date);S(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:jr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:a,maxDefined:o}=this.getUserBounds();function r(t){a||isNaN(t.min)||(s=Math.min(s,t.min)),o||isNaN(t.max)||(n=Math.max(n,t.max))}a&&o||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=f(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=f(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,a=this.max,o=ze(s,n,a);return this._unit=e.unit||(i.autoSkip?Br(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):Nr(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?Wr(this._unit):void 0,this.initOffsets(s),t.reverse&&o.reverse(),Yr(this,o,this._majorUnit)}initOffsets(t){let e,i,s=0,n=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),s=1===t.length?1-e:(this.getDecimalForValue(t[1])-e)/2,i=this.getDecimalForValue(t[t.length-1]),n=1===t.length?i:(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;s=at(s,0,a),n=at(n,0,a),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,n=s.time,a=n.unit||Br(n.minUnit,e,i,this._getLabelCapacity(e)),o=p(n.stepSize,1),r="week"===a&&n.isoWeekday,l=X(r)||!0===r,h={};let c,d,u=e;if(l&&(u=+t.startOf(u,"isoWeek",r)),u=+t.startOf(u,l?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;c<i;c=+t.add(c,o,a),d++)Hr(h,c,f);return c!==i&&"ticks"!==s.bounds&&1!==d||Hr(h,c,f),Object.keys(h).sort((t,e)=>t-e).map(t=>+t)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const n=this.options,a=n.time.displayFormats,o=this._unit,r=this._majorUnit,l=o&&a[o],h=r&&a[r],c=i[e],d=r&&h&&c&&c.major,u=this._adapter.format(t,s||(d?h:l)),f=n.ticks.callback;return f?x(f,[u,e,i],this):u}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return null===t?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Z(this.isHorizontal()?e.maxRotation:e.minRotation),n=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*n+o*a,h:i*a+o*n}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,n=this._tickFormatFunction(t,0,Yr(this,[t],this._majorUnit),s),a=this._getLabelSize(n),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t<e;++t)i=i.concat(s[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(i)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(jr(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ne(t.sort(Vr))}}function Xr(t,e,i){let s,n,a,o,r=0,l=t.length-1;i?(e>=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=Ie(t,"pos",e)),({pos:s,time:a}=t[r]),({pos:n,time:o}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=Ie(t,"time",e)),({time:s,pos:a}=t[r]),({time:n,pos:o}=t[l]));const h=n-s;return h?a+(o-a)*(e-s)/h:a}Ur.id="time",Ur.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class qr extends Ur{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Xr(e,this.min),this._tableRange=Xr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let a,o,r,l,h;for(a=0,o=t.length;a<o;++a)l=t[a],l>=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)h=s[a+1],r=s[a-1],l=s[a],Math.round((h+r)/2)!==l&&n.push({time:l,pos:a/(o-1)});return n}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return t=e.length&&i.length?this.normalize(e.concat(i)):e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Xr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Xr(this._table,i*this._tableRange+this._minPos,!0)}}qr.id="timeseries",qr.defaults=Ur.defaults},d738:function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return O}));var s=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("base-page",{staticClass:"page-link-analytics pa-4"},[i("page-title",[t._v(t._s(t.$t("Link analytics")))]),i("h3",{staticClass:"page-link-analytics__link-title"},[t._v(" "+t._s(t.getLinkTitle(t.linkButtons[t.currentLinkButtonIndex]))+" ")]),i("div",{staticClass:"page-link-analytics__stat d-flex mb-4"},[i("base-menu",{staticClass:"page-link-analytics__menu",scopedSlots:t._u([{key:"activator",fn:function(e){var s=e.on;return[i("div",{staticClass:"page-link-analytics__menu-activator body-2 d-flex"},[i("div",{staticClass:"page-link-analytics__menu-activator-description mr-2"},[t._v(t._s(t.$t("Date range:")))]),i("div",t._g({staticClass:"page-link-analytics__menu-activator-date"},s),[t._v(" "+t._s(t.currentDateRange.title)+" "),i("base-icon",[t._v("sci-chevron-down")])],1)])]}}])},[i("base-list",t._l(t.dateRanges,(function(e){return i("base-list-item",{key:e.interval,on:{click:function(i){return t.onChangeDateRange(e)}}},[t._v(" "+t._s(e.title)+" ")])})),1)],1),i("div",{staticClass:"page-link-analytics__clicks"},[t._v(" "+t._s(t.$t("Clicks {0}",[t.linksStat?t.linksStat.totalClicks:""]))+" ")])],1),t.computedChartData?i("statistic-chart",{staticClass:"page-link-analytics__chart",attrs:{config:t.config}}):t._e(),i("div",{staticClass:"page-link-analytics__subtitle mb-2"},[t._v(t._s(t.$t("Choose link to view analytics")))]),i("div",{staticClass:"page-link-analytics__list"},t._l(t.linkButtons,(function(e,s){return i("div",{key:s,staticClass:"page-link-analytics__list-item d-flex __align-center",class:{__active:t.currentLinkButtonIndex===s},on:{click:function(i){return t.onSetChartByLink(e,s)}}},[t._v(" "+t._s(t.getLinkTitle(e))+" ")])})),0)],1)},n=[],a=(i("4de4"),i("7db0"),i("d81d"),i("fb6a"),i("d3b7"),i("ddb0"),i("3835")),o=i("b85c"),r=(i("96cf"),i("1da1")),l=i("5530"),h=i("a34a"),c=i.n(h),d=i("a6f4"),u=i("9b4a"),f=i("4afc"),g=i("ff07"),p=i("76da"),m=i("03f6"),b=i("f00d"),x=i("1031"),_=i("855c"),y=i("0c00"),v=i("75c7"),k=i("9058");u["d"].register({BarElement:u["b"],BarController:u["a"],LineElement:u["f"],LineController:u["e"],CategoryScale:u["c"],LinearScale:u["g"],Tooltip:u["i"],PointElement:u["h"]});var w=Object(d["c"])({name:"PageLinkAnalytics",components:{StatisticChart:y["a"],PageTitle:x["a"],BasePage:_["a"],BaseList:v["b"],BaseListItem:v["a"],BaseIcon:k["a"]},setup:function(t,e){var i=e.root,s=Object(f["a"])(),n=s.authUserStrict,h=Object(d["o"])([]),u=Object(d["o"])(0),x=Object(d["o"])(),_=Object(d["o"])(b["b"][0]),y=Object(d["o"])(!1),v=Object(d["a"])((function(){var t,e,i,s,n={labels:null!==(t=null===(e=x.value)||void 0===e?void 0:e.items.map((function(t){return Object(p["format"])(new Date(t.date),"MM/dd")})))&&void 0!==t?t:[],datasets:[Object(l["a"])(Object(l["a"])({},b["a"].data.datasets[0]),{},{data:null!==(i=null===(s=x.value)||void 0===s?void 0:s.items.map((function(t){return t.clickCount})))&&void 0!==i?i:[]})]};return Object(l["a"])(Object(l["a"])({},b["a"]),{},{data:Object(l["a"])({},n),type:_.value.chartType})})),k=function(){var t=Object(r["a"])(c.a.mark((function t(){var e;return c.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,g["a"].QuestionaryInfoProvider.find({id:n.value.id});case 2:if(e=t.sent,e.fields["links"])try{h.value=JSON.parse(e.fields["links"]).buttons.filter((function(t){return"accordion"!==t.linkType}))}catch(i){}case 4:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),w=function(){var t=Object(r["a"])(c.a.mark((function t(e){var i;return c.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i={link:e,interval:_.value.interval,userId:n.value.id},t.next=3,g["a"].LinksStatsProvider.linksStat({data:i});case 3:x.value=t.sent;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),M=function(t){return t?"custom"===t.linkType||"banner"===t.linkType?t.title:t.linkType.charAt(0).toUpperCase()+t.linkType.slice(1):""},S=function(){var t=Object(r["a"])(c.a.mark((function t(e,i){return c.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return y.value=!1,u.value=i,t.prev=2,t.next=5,w(Object(m["a"])(e));case 5:return t.prev=5,y.value=!0,t.finish(5);case 8:case"end":return t.stop()}}),t,null,[[2,,5,8]])})));return function(e,i){return t.apply(this,arguments)}}(),P=function(){var t=Object(r["a"])(c.a.mark((function t(e){return c.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(_.value=e,!h.value[u.value]){t.next=4;break}return t.next=4,S(h.value[u.value],u.value);case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),O=function(){var t=Object(r["a"])(c.a.mark((function t(){var e,s,n,r,l,d;return c.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e=i.$route.params.linkId,t.next=3,k();case 3:s=Object(o["a"])(h.value.entries()),t.prev=4,s.s();case 6:if((n=s.n()).done){t.next=13;break}if(r=Object(a["a"])(n.value,2),l=r[0],d=r[1],Object(m["a"])(d)!==e){t.next=11;break}return u.value=l,t.abrupt("break",13);case 11:t.next=6;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t["catch"](4),s.e(t.t0);case 18:return t.prev=18,s.f(),t.finish(18);case 21:if(!h.value[u.value]){t.next=24;break}return t.next=24,S(h.value[u.value],u.value);case 24:case"end":return t.stop()}}),t,null,[[4,15,18,21]])})));return function(){return t.apply(this,arguments)}}();return O(),{linksStat:x,linkButtons:h,config:v,computedChartData:y,dateRanges:b["b"],currentLinkButtonIndex:u,currentDateRange:_,onSetChartByLink:S,getLinkTitle:M,onChangeDateRange:P}}}),M=w,S=(i("dde4"),i("2877")),P=Object(S["a"])(M,s,n,!1,null,"2c2e7c1c",null),O=P.exports},dde4:function(t,e,i){"use strict";i("901f")},f00d:function(t,e,i){"use strict";i.d(e,"a",(function(){return a})),i.d(e,"b",(function(){return o}));var s=i("78f9"),n=i("8186"),a={type:"bar",data:{datasets:[{borderColor:"#FF70D0",backgroundColor:"#FF70D0"}]},options:{scales:{y:{ticks:{maxTicksLimit:6}}},responsive:!0,plugins:{legend:{position:"top"}}}},o=[{title:Object(s["a"])("7 days"),interval:n["LinksStatInterval"].ONE_DAY,chartType:"bar"},{title:Object(s["a"])("30 days"),interval:n["LinksStatInterval"].FIVE_DAYS,chartType:"line"},{title:Object(s["a"])("Year"),interval:n["LinksStatInterval"].ONE_MONTH,chartType:"line"}]}}]);