@prometa/sleek 0.0.12 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chartjs-chart.cjs +19 -11
- package/dist/chartjs-chart.js +3874 -3714
- package/dist/components/chartjs-chart.d.ts +22 -1
- package/dist/components/chartjs-chart.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/chartjs-chart.cjs
CHANGED
|
@@ -1,44 +1,52 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Cu=Object.defineProperty;var Ur=n=>{throw TypeError(n)};var Eu=(n,t,e)=>t in n?Cu(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var v=(n,t,e)=>Eu(n,typeof t!="symbol"?t+"":t,e),$s=(n,t,e)=>t.has(n)||Ur("Cannot "+e);var I=(n,t,e)=>($s(n,t,"read from private field"),e?e.call(n):t.get(n)),dt=(n,t,e)=>t.has(n)?Ur("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),bt=(n,t,e,i)=>($s(n,t,"write to private field"),i?i.call(n,e):t.set(n,e),e),An=(n,t,e)=>($s(n,t,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Jl=require("./utils.cjs");/*!
|
|
2
2
|
* @kurkle/color v0.3.4
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2024 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function
|
|
6
|
+
*/function xi(n){return n+.5|0}const pe=(n,t,e)=>Math.max(Math.min(n,e),t);function Vn(n){return pe(xi(n*2.55),0,255)}function we(n){return pe(xi(n*255),0,255)}function ae(n){return pe(xi(n/2.55)/100,0,1)}function qr(n){return pe(xi(n*100),0,100)}const Wt={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},go=[..."0123456789ABCDEF"],Au=n=>go[n&15],Iu=n=>go[(n&240)>>4]+go[n&15],Wi=n=>(n&240)>>4===(n&15),Lu=n=>Wi(n.r)&&Wi(n.g)&&Wi(n.b)&&Wi(n.a);function Ru(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Wt[n[1]]*17,g:255&Wt[n[2]]*17,b:255&Wt[n[3]]*17,a:t===5?Wt[n[4]]*17:255}:(t===7||t===9)&&(e={r:Wt[n[1]]<<4|Wt[n[2]],g:Wt[n[3]]<<4|Wt[n[4]],b:Wt[n[5]]<<4|Wt[n[6]],a:t===9?Wt[n[7]]<<4|Wt[n[8]]:255})),e}const Fu=(n,t)=>n<255?t(n):"";function Nu(n){var t=Lu(n)?Au:Iu;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Fu(n.a,t):void 0}const zu=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function tc(n,t,e){const i=t*Math.min(e,1-e),s=(o,r=(o+n/30)%12)=>e-i*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Wu(n,t,e){const i=(s,o=(s+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Hu(n,t,e){const i=tc(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function Bu(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function $o(n){const e=n.r/255,i=n.g/255,s=n.b/255,o=Math.max(e,i,s),r=Math.min(e,i,s),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Bu(e,i,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Go(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(we)}function Qo(n,t,e){return Go(tc,n,t,e)}function Yu(n,t,e){return Go(Hu,n,t,e)}function mo(n,t,e){return Go(Wu,n,t,e)}function ec(n){return(n%360+360)%360}function Vu(n){const t=zu.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Vn(+t[5]):we(+t[5]));const s=ec(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=Yu(s,o,r):t[1]==="hsv"?i=mo(s,o,r):i=Qo(s,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function ju(n,t){var e=$o(n);e[0]=ec(e[0]+t),e=Qo(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Xu(n){if(!n)return;const t=$o(n),e=t[0],i=qr(t[1]),s=qr(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${ae(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const $r={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"},Gr={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 Uu(){const n={},t=Object.keys(Gr),e=Object.keys($r);let i,s,o,r,a;for(i=0;i<t.length;i++){for(r=a=t[i],s=0;s<e.length;s++)o=e[s],a=a.replace(o,$r[o]);o=parseInt(Gr[r],16),n[a]=[o>>16&255,o>>8&255,o&255]}return n}let Hi;function qu(n){Hi||(Hi=Uu(),Hi.transparent=[0,0,0,0]);const t=Hi[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const $u=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Gu(n){const t=$u.exec(n);let e=255,i,s,o;if(t){if(t[7]!==i){const r=+t[7];e=t[8]?Vn(r):pe(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Vn(i):pe(i,0,255)),s=255&(t[4]?Vn(s):pe(s,0,255)),o=255&(t[6]?Vn(o):pe(o,0,255)),{r:i,g:s,b:o,a:e}}}function jn(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ae(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Gs=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,on=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Qu(n,t,e){const i=on(ae(n.r)),s=on(ae(n.g)),o=on(ae(n.b));return{r:we(Gs(i+e*(on(ae(t.r))-i))),g:we(Gs(s+e*(on(ae(t.g))-s))),b:we(Gs(o+e*(on(ae(t.b))-o))),a:n.a+e*(t.a-n.a)}}function Bi(n,t,e){if(n){let i=$o(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Qo(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function nc(n,t){return n&&Object.assign(t||{},n)}function Qr(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=we(n[3]))):(t=nc(n,{r:0,g:0,b:0,a:1}),t.a=we(t.a)),t}function Ku(n){return n.charAt(0)==="r"?Gu(n):Vu(n)}class oi{constructor(t){if(t instanceof oi)return t;const e=typeof t;let i;e==="object"?i=Qr(t):e==="string"&&(i=Ru(t)||qu(t)||Ku(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=nc(this._rgb);return t&&(t.a=ae(t.a)),t}set rgb(t){this._rgb=Qr(t)}rgbString(){return this._valid?jn(this._rgb):void 0}hexString(){return this._valid?Nu(this._rgb):void 0}hslString(){return this._valid?Xu(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=r*i.a+(1-r)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Qu(this._rgb,t._rgb,e)),this}clone(){return new oi(this.rgb)}alpha(t){return this._rgb.a=we(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=xi(t.r*.3+t.g*.59+t.b*.11);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 Bi(this._rgb,2,t),this}darken(t){return Bi(this._rgb,2,-t),this}saturate(t){return Bi(this._rgb,1,t),this}desaturate(t){return Bi(this._rgb,1,-t),this}rotate(t){return ju(this._rgb,t),this}}/*!
|
|
7
7
|
* Chart.js v4.4.8
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function ee(){}const Eu=(()=>{let n=0;return()=>n++})();function B(n){return n==null}function U(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function W(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function J(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Et(n,t){return J(n)?n:t}function R(n,t){return typeof n>"u"?t:n}const Au=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,zl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function L(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Y(n,t,e,i){let s,o,r;if(U(n))for(o=n.length,s=0;s<o;s++)t.call(e,n[s],s);else if(W(n))for(r=Object.keys(n),o=r.length,s=0;s<o;s++)t.call(e,n[r[s]],r[s])}function $i(n,t){let e,i,s,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Gi(n){if(U(n))return n.map(Gi);if(W(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Gi(n[e[s]]);return t}return n}function Wl(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Iu(n,t,e,i){if(!Wl(n))return;const s=t[n],o=e[n];W(s)&&W(o)?$n(s,o,i):t[n]=Gi(o)}function $n(n,t,e){const i=U(t)?t:[t],s=i.length;if(!W(n))return n;e=e||{};const o=e.merger||Iu;let r;for(let a=0;a<s;++a){if(r=i[a],!W(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],n,r,e)}return n}function Hn(n,t){return $n(n,t,{merger:Lu})}function Lu(n,t,e){if(!Wl(n))return;const i=t[n],s=e[n];W(i)&&W(s)?Hn(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Gi(s))}const Ar={"":n=>n,x:n=>n.x,y:n=>n.y};function Ru(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Fu(n){const t=Ru(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ve(n,t){return(Ar[t]||(Ar[t]=Fu(t)))(n)}function Eo(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ot=n=>typeof n<"u",Dt=n=>typeof n=="function",Ir=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Nu(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const V=Math.PI,$=2*V,zu=$+V,Qi=Number.POSITIVE_INFINITY,Ao=V/180,Q=V/2,Nt=V/4,Zi=V*2/3,me=Math.log10,zt=Math.sign;function We(n,t,e){return Math.abs(n-t)<e}function Lr(n){const t=Math.round(n);n=We(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(me(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Wu(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function Hu(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Me(n){return!Hu(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function Yu(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Hl(n,t,e){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ht(n){return n*(V/180)}function as(n){return n*(180/V)}function Rr(n){if(!J(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Ki(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*V&&(o+=$),{angle:o,distance:s}}function sn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Bu(n,t){return(n-t+zu)%$-V}function At(n){return(n%$+$)%$}function Gn(n,t,e,i){const s=At(n),o=At(t),r=At(e),a=At(o-s),l=At(r-s),c=At(s-o),h=At(s-r);return s===o||s===r||i&&o===r||a>l&&c<h}function pt(n,t,e){return Math.max(t,Math.min(e,n))}function Vu(n){return pt(n,-32768,32767)}function oe(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Io(n,t,e){e=e||(r=>n[r]<t);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return{lo:s,hi:i}}const re=(n,t,e,i)=>Io(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),ju=(n,t,e)=>Io(n,e,i=>n[i][t]>=e);function Xu(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Yl=["push","pop","shift","splice","unshift"];function Uu(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Yl.forEach(e=>{const i="_onData"+Eo(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Fr(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Yl.forEach(o=>{delete n[o]}),delete n._chartjs)}function Bl(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Vl=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function jl(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Vl.call(window,()=>{i=!1,n.apply(t,e)}))}}function qu(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Lo=n=>n==="start"?"left":n==="end"?"right":"center",xt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,$u=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Xl(n,t,e){const i=t.length;let s=0,o=i;if(n._sorted){const{iScale:r,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=r.axis,{min:u,max:d,minDefined:g,maxDefined:p}=r.getUserBounds();if(g){if(s=Math.min(re(l,h,u).lo,e?i:re(t,h,r.getPixelForValue(u)).lo),c){const b=l.slice(0,s+1).reverse().findIndex(x=>!B(x[a.axis]));s-=Math.max(0,b)}s=pt(s,0,i-1)}if(p){let b=Math.max(re(l,r.axis,d,!0).hi+1,e?0:re(t,h,r.getPixelForValue(d),!0).hi+1);if(c){const x=l.slice(b-1).findIndex(_=>!B(_[a.axis]));b+=Math.max(0,x)}o=pt(b,s,i)-s}else o=i-s}return{start:s,count:o}}function Ul(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}const ki=n=>n===0||n===1,Nr=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*$/e)),zr=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*$/e)+1,Yn={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Q)+1,easeOutSine:n=>Math.sin(n*Q),easeInOutSine:n=>-.5*(Math.cos(V*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>ki(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>ki(n)?n:Nr(n,.075,.3),easeOutElastic:n=>ki(n)?n:zr(n,.075,.3),easeInOutElastic(n){return ki(n)?n:n<.5?.5*Nr(n*2,.1125,.45):.5+.5*zr(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Yn.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Yn.easeInBounce(n*2)*.5:Yn.easeOutBounce(n*2-1)*.5+.5};function Ro(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Wr(n){return Ro(n)?n:new qn(n)}function Es(n){return Ro(n)?n:new qn(n).saturate(.5).darken(.1).hexString()}const Gu=["x","y","borderWidth","radius","tension"],Qu=["color","borderColor","backgroundColor"];function Zu(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Qu},numbers:{type:"number",properties:Gu}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ku(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Hr=new Map;function Ju(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Hr.get(e);return i||(i=new Intl.NumberFormat(n,t),Hr.set(e,i)),i}function ni(n,t,e){return Ju(t,e).format(n)}const ql={values(n){return U(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,o=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=td(n,e)}const r=me(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ni(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(me(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ql.numeric.call(this,n,t,e):""}};function td(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var ls={formatters:ql};function ed(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ls.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ye=Object.create(null),Qs=Object.create(null);function Bn(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function As(n,t,e){return typeof t=="string"?$n(Bn(n,t),e):$n(Bn(n,""),t)}class nd{constructor(t,e){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=i=>i.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=(i,s)=>Es(s.backgroundColor),this.hoverBorderColor=(i,s)=>Es(s.borderColor),this.hoverColor=(i,s)=>Es(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return As(this,t,e)}get(t){return Bn(this,t)}describe(t,e){return As(Qs,t,e)}override(t,e){return As(Ye,t,e)}route(t,e,i,s){const o=Bn(this,t),r=Bn(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return W(l)?Object.assign({},c,l):R(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new nd({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Zu,Ku,ed]);function id(n){return!n||B(n.size)||B(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Ji(n,t,e,i,s){let o=t[s];return o||(o=t[s]=n.measureText(s).width,e.push(s)),o>i&&(i=o),i}function sd(n,t,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let r=0;const a=e.length;let l,c,h,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&!U(u))r=Ji(n,s,o,r,u);else if(U(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!U(d)&&(r=Ji(n,s,o,r,d));n.restore();const g=o.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[o[l]];o.splice(0,g)}return r}function Ae(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Yr(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Zs(n,t,e,i){$l(n,t,e,i,null)}function $l(n,t,e,i,s){let o,r,a,l,c,h,u,d;const g=t.pointStyle,p=t.rotation,b=t.radius;let x=(p||0)*Ao;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(b)||b<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,b,0,0,$):n.arc(e,i,b,0,$),n.closePath();break;case"triangle":h=s?s/2:b,n.moveTo(e+Math.sin(x)*h,i-Math.cos(x)*b),x+=Zi,n.lineTo(e+Math.sin(x)*h,i-Math.cos(x)*b),x+=Zi,n.lineTo(e+Math.sin(x)*h,i-Math.cos(x)*b),n.closePath();break;case"rectRounded":c=b*.516,l=b-c,r=Math.cos(x+Nt)*l,u=Math.cos(x+Nt)*(s?s/2-c:l),a=Math.sin(x+Nt)*l,d=Math.sin(x+Nt)*(s?s/2-c:l),n.arc(e-u,i-a,c,x-V,x-Q),n.arc(e+d,i-r,c,x-Q,x),n.arc(e+u,i+a,c,x,x+Q),n.arc(e-d,i+r,c,x+Q,x+V),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*b,h=s?s/2:l,n.rect(e-h,i-l,2*h,2*l);break}x+=Nt;case"rectRot":u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+d,i-r),n.lineTo(e+u,i+a),n.lineTo(e-d,i+r),n.closePath();break;case"crossRot":x+=Nt;case"cross":u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r);break;case"star":u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r),x+=Nt,u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r);break;case"line":r=s?s/2:Math.cos(x)*b,a=Math.sin(x)*b,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:b),i+Math.sin(x)*b);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Qt(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function ii(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function si(n){n.restore()}function od(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function rd(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function ad(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),B(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function ld(n,t,e,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(r,h),n.lineTo(a,h),n.stroke()}}function cd(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Be(n,t,e,i,s,o={}){const r=U(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,ad(n,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&cd(n,o.backdrop),a&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),B(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(c,e,i,o.maxWidth)),n.fillText(c,e,i,o.maxWidth),ld(n,e,i,c,o),i+=Number(s.lineHeight);n.restore()}function on(n,t){const{x:e,y:i,w:s,h:o,radius:r}=t;n.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*V,V,!0),n.lineTo(e,i+o-r.bottomLeft),n.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,V,Q,!0),n.lineTo(e+s-r.bottomRight,i+o),n.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,Q,0,!0),n.lineTo(e+s,i+r.topRight),n.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-Q,!0),n.lineTo(e+r.topLeft,i)}const hd=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ud=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function dd(n,t){const e=(""+n).match(hd);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const fd=n=>+n||0;function Fo(n,t){const e={},i=W(t),s=i?Object.keys(t):t,o=W(n)?i?r=>R(n[r],n[t[r]]):r=>n[r]:()=>n;for(const r of s)e[r]=fd(o(r));return e}function Gl(n){return Fo(n,{top:"y",right:"x",bottom:"y",left:"x"})}function _e(n){return Fo(n,["topLeft","topRight","bottomLeft","bottomRight"])}function ut(n){const t=Gl(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function it(n,t){n=n||{},t=t||Z.font;let e=R(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=R(n.style,t.style);i&&!(""+i).match(ud)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:R(n.family,t.family),lineHeight:dd(R(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:R(n.weight,t.weight),string:""};return s.string=id(s),s}function Ln(n,t,e,i){let s,o,r;for(s=0,o=n.length;s<o;++s)if(r=n[s],r!==void 0&&r!==void 0)return r}function gd(n,t,e){const{min:i,max:s}=n,o=zl(t,(s-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function Te(n,t){return Object.assign(Object.create(n),t)}function No(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=Jl("_fallback",n));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>No([a,...n],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return Zl(a,l,()=>vd(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Vr(a).includes(l)},ownKeys(a){return Vr(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function rn(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ql(n,i),setContext:o=>rn(n,o,e,i),override:o=>rn(n.override(o),t,e,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete n[r],!0},get(o,r,a){return Zl(o,r,()=>pd(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(n,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,r)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,r){return Reflect.has(n,r)},ownKeys(){return Reflect.ownKeys(n)},set(o,r,a){return n[r]=a,delete o[r],!0}})}function Ql(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Dt(e)?e:()=>e,isIndexable:Dt(i)?i:()=>i}}const md=(n,t)=>n?n+Eo(t):t,zo=(n,t)=>W(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Zl(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function pd(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=n;let a=i[t];return Dt(a)&&r.isScriptable(t)&&(a=bd(t,a,n,e)),U(a)&&a.length&&(a=yd(t,a,n,r.isIndexable)),zo(t,a)&&(a=rn(a,s,o&&o[t],r)),a}function bd(n,t,e,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(o,r||i);return a.delete(n),zo(n,l)&&(l=Wo(s._scopes,s,n,l)),l}function yd(n,t,e,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(W(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=Wo(c,s,n,h);t.push(rn(u,o,r&&r[n],a))}}return t}function Kl(n,t,e){return Dt(n)?n(t,e):n}const xd=(n,t)=>n===!0?t:typeof n=="string"?ve(t,n):void 0;function _d(n,t,e,i,s){for(const o of t){const r=xd(e,o);if(r){n.add(r);const a=Kl(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function Wo(n,t,e,i){const s=t._rootScopes,o=Kl(t._fallback,e,i),r=[...n,...s],a=new Set;a.add(i);let l=Br(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=Br(a,r,o,l,i),l===null)?!1:No(Array.from(a),[""],s,o,()=>wd(t,e,i))}function Br(n,t,e,i,s){for(;e;)e=_d(n,t,e,i,s);return e}function wd(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return U(s)&&W(e)?e:s||{}}function vd(n,t,e,i){let s;for(const o of t)if(s=Jl(md(o,n),e),typeof s<"u")return zo(n,s)?Wo(e,i,n,s):s}function Jl(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Vr(n){let t=n._keys;return t||(t=n._keys=Md(n._scopes)),t}function Md(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function tc(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,h;for(a=0,l=i;a<l;++a)c=a+e,h=t[c],r[a]={r:s.parse(ve(h,o),c)};return r}const kd=Number.EPSILON||1e-14,an=(n,t)=>t<n.length&&!n[t].skip&&n[t],ec=n=>n==="x"?"y":"x";function Pd(n,t,e,i){const s=n.skip?t:n,o=t,r=e.skip?t:e,a=sn(o,s),l=sn(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=i*c,d=i*h;return{previous:{x:o.x-u*(r.x-s.x),y:o.y-u*(r.y-s.y)},next:{x:o.x+d*(r.x-s.x),y:o.y+d*(r.y-s.y)}}}function Td(n,t,e){const i=n.length;let s,o,r,a,l,c=an(n,0);for(let h=0;h<i-1;++h)if(l=c,c=an(n,h+1),!(!l||!c)){if(We(t[h],0,kd)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=s*r*t[h],e[h+1]=o*r*t[h])}}function Sd(n,t,e="x"){const i=ec(e),s=n.length;let o,r,a,l=an(n,0);for(let c=0;c<s;++c){if(r=a,a=l,l=an(n,c+1),!a)continue;const h=a[e],u=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=u-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=u+o*t[c])}}function Dd(n,t="x"){const e=ec(t),i=n.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=an(n,0);for(r=0;r<i;++r)if(a=l,l=c,c=an(n,r+1),!!l){if(c){const h=c[t]-l[t];s[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?zt(s[r-1])!==zt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Td(n,s,o),Sd(n,o,t)}function Pi(n,t,e){return Math.max(Math.min(n,e),t)}function Od(n,t){let e,i,s,o,r,a=Qt(n[0],t);for(e=0,i=n.length;e<i;++e)r=o,o=a,a=e<i-1&&Qt(n[e+1],t),o&&(s=n[e],r&&(s.cp1x=Pi(s.cp1x,t.left,t.right),s.cp1y=Pi(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Pi(s.cp2x,t.left,t.right),s.cp2y=Pi(s.cp2y,t.top,t.bottom)))}function Cd(n,t,e,i,s){let o,r,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Dd(n,s);else{let c=i?n[n.length-1]:n[0];for(o=0,r=n.length;o<r;++o)a=n[o],l=Pd(c,a,n[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Od(n,e)}function Ho(){return typeof window<"u"&&typeof document<"u"}function Yo(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ts(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const cs=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Ed(n,t){return cs(n).getPropertyValue(t)}const Ad=["top","right","bottom","left"];function He(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Ad[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Id=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Ld(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(Id(s,o,n.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function qt(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=cs(e),o=s.boxSizing==="border-box",r=He(s,"padding"),a=He(s,"border","width"),{x:l,y:c,box:h}=Ld(n,e),u=r.left+(h&&a.left),d=r.top+(h&&a.top);let{width:g,height:p}=t;return o&&(g-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-u)/g*e.width/i),y:Math.round((c-d)/p*e.height/i)}}function Rd(n,t,e){let i,s;if(t===void 0||e===void 0){const o=n&&Yo(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const r=o.getBoundingClientRect(),a=cs(o),l=He(a,"border","width"),c=He(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,i=ts(a.maxWidth,o,"clientWidth"),s=ts(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||Qi,maxHeight:s||Qi}}const Ti=n=>Math.round(n*10)/10;function Fd(n,t,e,i){const s=cs(n),o=He(s,"margin"),r=ts(s.maxWidth,n,"clientWidth")||Qi,a=ts(s.maxHeight,n,"clientHeight")||Qi,l=Rd(n,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const d=He(s,"border","width"),g=He(s,"padding");c-=g.width+d.width,h-=g.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=Ti(Math.min(c,r,l.maxWidth)),h=Ti(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ti(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=Ti(Math.floor(h*i))),{width:c,height:h}}function jr(n,t,e){const i=t||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const r=n.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${n.height}px`,r.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(n.currentDevicePixelRatio=i,r.height=s,r.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Nd=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Ho()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function Xr(n,t){const e=Ed(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Re(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function zd(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Wd(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},r=Re(n,s,e),a=Re(s,o,e),l=Re(o,t,e),c=Re(r,a,e),h=Re(a,l,e);return Re(c,h,e)}const Hd=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Yd=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function en(n,t,e){return n?Hd(t,e):Yd()}function nc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function ic(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function sc(n){return n==="angle"?{between:Gn,compare:Bu,normalize:At}:{between:oe,compare:(t,e)=>t-e,normalize:t=>t}}function Ur({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Bd(n,t,e){const{property:i,start:s,end:o}=e,{between:r,normalize:a}=sc(i),l=t.length;let{start:c,end:h,loop:u}=n,d,g;if(u){for(c+=l,h+=l,d=0,g=l;d<g&&r(a(t[c%l][i]),s,o);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:n.style}}function oc(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=sc(i),{start:h,end:u,loop:d,style:g}=Bd(n,t,e),p=[];let b=!1,x=null,_,w,k;const T=()=>l(s,k,_)&&a(s,k)!==0,P=()=>a(o,_)===0||l(o,k,_),O=()=>b||T(),C=()=>!b||P();for(let S=h,E=h;S<=u;++S)w=t[S%r],!w.skip&&(_=c(w[i]),_!==k&&(b=l(_,s,o),x===null&&O()&&(x=a(_,s)===0?S:E),x!==null&&C()&&(p.push(Ur({start:x,end:S,loop:d,count:r,style:g})),x=null),E=S,k=_));return x!==null&&p.push(Ur({start:x,end:u,loop:d,count:r,style:g})),p}function rc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=oc(i[s],n.points,t);o.length&&e.push(...o)}return e}function Vd(n,t,e,i){let s=0,o=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&n[o%t].skip;)o--;return o%=t,{start:s,end:o}}function jd(n,t,e,i){const s=n.length,o=[];let r=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function Xd(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:r,end:a}=Vd(e,s,o,i);if(i===!0)return qr(n,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+s:a,c=!!n._fullLoop&&r===0&&a===s-1;return qr(n,jd(e,r,l,c),e,t)}function qr(n,t,e,i){return!i||!i.setContext||!e?t:Ud(n,t,e,i)}function Ud(n,t,e,i){const s=n._chart.getContext(),o=$r(n.options),{_datasetIndex:r,options:{spanGaps:a}}=n,l=e.length,c=[];let h=o,u=t[0].start,d=u;function g(p,b,x,_){const w=a?-1:1;if(p!==b){for(p+=l;e[p%l].skip;)p-=w;for(;e[b%l].skip;)b+=w;p%l!==b%l&&(c.push({start:p%l,end:b%l,loop:x,style:_}),h=_,u=b%l)}}for(const p of t){u=a?u:p.start;let b=e[u%l],x;for(d=u+1;d<=p.end;d++){const _=e[d%l];x=$r(i.setContext(Te(s,{type:"segment",p0:b,p1:_,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),qd(x,h)&&g(u,d-1,p.loop,h),b=_,h=x}u<d-1&&g(u,d-1,p.loop,h)}return c}function $r(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function qd(n,t){if(!t)return!1;const e=[],i=function(s,o){return Ro(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
11
|
+
*/function se(){}const Zu=(()=>{let n=0;return()=>n++})();function V(n){return n==null}function q(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function H(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function et(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Lt(n,t){return et(n)?n:t}function F(n,t){return typeof n>"u"?t:n}const Ju=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,ic=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function R(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Y(n,t,e,i){let s,o,r;if(q(n))for(o=n.length,s=0;s<o;s++)t.call(e,n[s],s);else if(H(n))for(r=Object.keys(n),o=r.length,s=0;s<o;s++)t.call(e,n[r[s]],r[s])}function ds(n,t){let e,i,s,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function fs(n){if(q(n))return n.map(fs);if(H(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=fs(n[e[s]]);return t}return n}function sc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function td(n,t,e,i){if(!sc(n))return;const s=t[n],o=e[n];H(s)&&H(o)?ri(s,o,i):t[n]=fs(o)}function ri(n,t,e){const i=q(t)?t:[t],s=i.length;if(!H(n))return n;e=e||{};const o=e.merger||td;let r;for(let a=0;a<s;++a){if(r=i[a],!H(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],n,r,e)}return n}function Kn(n,t){return ri(n,t,{merger:ed})}function ed(n,t,e){if(!sc(n))return;const i=t[n],s=e[n];H(i)&&H(s)?Kn(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=fs(s))}const Kr={"":n=>n,x:n=>n.x,y:n=>n.y};function nd(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function id(n){const t=nd(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ke(n,t){return(Kr[t]||(Kr[t]=id(t)))(n)}function Ko(n){return n.charAt(0).toUpperCase()+n.slice(1)}const At=n=>typeof n<"u",Et=n=>typeof n=="function",Zr=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function sd(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const j=Math.PI,G=2*j,od=G+j,gs=Number.POSITIVE_INFINITY,Zo=j/180,K=j/2,Ht=j/4,ms=j*2/3,be=Math.log10,Bt=Math.sign;function Xe(n,t,e){return Math.abs(n-t)<e}function Jr(n){const t=Math.round(n);n=Xe(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(be(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function rd(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function ad(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function Pe(n){return!ad(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function ld(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function oc(n,t,e){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ft(n){return n*(j/180)}function Ps(n){return n*(180/j)}function ta(n){if(!et(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function ps(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*j&&(o+=G),{angle:o,distance:s}}function gn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function cd(n,t){return(n-t+od)%G-j}function Rt(n){return(n%G+G)%G}function ai(n,t,e,i){const s=Rt(n),o=Rt(t),r=Rt(e),a=Rt(o-s),l=Rt(r-s),c=Rt(s-o),h=Rt(s-r);return s===o||s===r||i&&o===r||a>l&&c<h}function yt(n,t,e){return Math.max(t,Math.min(e,n))}function hd(n){return yt(n,-32768,32767)}function le(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Jo(n,t,e){e=e||(r=>n[r]<t);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return{lo:s,hi:i}}const ce=(n,t,e,i)=>Jo(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),ud=(n,t,e)=>Jo(n,e,i=>n[i][t]>=e);function dd(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const rc=["push","pop","shift","splice","unshift"];function fd(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),rc.forEach(e=>{const i="_onData"+Ko(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function ea(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(rc.forEach(o=>{delete n[o]}),delete n._chartjs)}function ac(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const lc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function cc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,lc.call(window,()=>{i=!1,n.apply(t,e)}))}}function gd(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const tr=n=>n==="start"?"left":n==="end"?"right":"center",wt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,md=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function hc(n,t,e){const i=t.length;let s=0,o=i;if(n._sorted){const{iScale:r,vScale:a,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=r.axis,{min:u,max:d,minDefined:f,maxDefined:p}=r.getUserBounds();if(f){if(s=Math.min(ce(l,h,u).lo,e?i:ce(t,h,r.getPixelForValue(u)).lo),c){const b=l.slice(0,s+1).reverse().findIndex(x=>!V(x[a.axis]));s-=Math.max(0,b)}s=yt(s,0,i-1)}if(p){let b=Math.max(ce(l,r.axis,d,!0).hi+1,e?0:ce(t,h,r.getPixelForValue(d),!0).hi+1);if(c){const x=l.slice(b-1).findIndex(_=>!V(_[a.axis]));b+=Math.max(0,x)}o=yt(b,s,i)-s}else o=i-s}return{start:s,count:o}}function uc(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}const Yi=n=>n===0||n===1,na=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*G/e)),ia=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*G/e)+1,Zn={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*K)+1,easeOutSine:n=>Math.sin(n*K),easeInOutSine:n=>-.5*(Math.cos(j*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Yi(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Yi(n)?n:na(n,.075,.3),easeOutElastic:n=>Yi(n)?n:ia(n,.075,.3),easeInOutElastic(n){return Yi(n)?n:n<.5?.5*na(n*2,.1125,.45):.5+.5*ia(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-Zn.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?Zn.easeInBounce(n*2)*.5:Zn.easeOutBounce(n*2-1)*.5+.5};function er(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function sa(n){return er(n)?n:new oi(n)}function Qs(n){return er(n)?n:new oi(n).saturate(.5).darken(.1).hexString()}const pd=["x","y","borderWidth","radius","tension"],bd=["color","borderColor","backgroundColor"];function yd(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:bd},numbers:{type:"number",properties:pd}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function xd(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const oa=new Map;function _d(n,t){t=t||{};const e=n+JSON.stringify(t);let i=oa.get(e);return i||(i=new Intl.NumberFormat(n,t),oa.set(e,i)),i}function _i(n,t,e){return _d(t,e).format(n)}const dc={values(n){return q(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,o=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=wd(n,e)}const r=be(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),_i(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(be(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?dc.numeric.call(this,n,t,e):""}};function wd(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ts={formatters:dc};function vd(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ts.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const qe=Object.create(null),po=Object.create(null);function Jn(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function Ks(n,t,e){return typeof t=="string"?ri(Jn(n,t),e):ri(Jn(n,""),t)}class Md{constructor(t,e){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=i=>i.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=(i,s)=>Qs(s.backgroundColor),this.hoverBorderColor=(i,s)=>Qs(s.borderColor),this.hoverColor=(i,s)=>Qs(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ks(this,t,e)}get(t){return Jn(this,t)}describe(t,e){return Ks(po,t,e)}override(t,e){return Ks(qe,t,e)}route(t,e,i,s){const o=Jn(this,t),r=Jn(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return H(l)?Object.assign({},c,l):F(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new Md({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[yd,xd,vd]);function kd(n){return!n||V(n.size)||V(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function bs(n,t,e,i,s){let o=t[s];return o||(o=t[s]=n.measureText(s).width,e.push(s)),o>i&&(i=o),i}function Pd(n,t,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let r=0;const a=e.length;let l,c,h,u,d;for(l=0;l<a;l++)if(u=e[l],u!=null&&!q(u))r=bs(n,s,o,r,u);else if(q(u))for(c=0,h=u.length;c<h;c++)d=u[c],d!=null&&!q(d)&&(r=bs(n,s,o,r,d));n.restore();const f=o.length/2;if(f>e.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function Le(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function ra(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function bo(n,t,e,i){fc(n,t,e,i,null)}function fc(n,t,e,i,s){let o,r,a,l,c,h,u,d;const f=t.pointStyle,p=t.rotation,b=t.radius;let x=(p||0)*Zo;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(b)||b<=0)){switch(n.beginPath(),f){default:s?n.ellipse(e,i,s/2,b,0,0,G):n.arc(e,i,b,0,G),n.closePath();break;case"triangle":h=s?s/2:b,n.moveTo(e+Math.sin(x)*h,i-Math.cos(x)*b),x+=ms,n.lineTo(e+Math.sin(x)*h,i-Math.cos(x)*b),x+=ms,n.lineTo(e+Math.sin(x)*h,i-Math.cos(x)*b),n.closePath();break;case"rectRounded":c=b*.516,l=b-c,r=Math.cos(x+Ht)*l,u=Math.cos(x+Ht)*(s?s/2-c:l),a=Math.sin(x+Ht)*l,d=Math.sin(x+Ht)*(s?s/2-c:l),n.arc(e-u,i-a,c,x-j,x-K),n.arc(e+d,i-r,c,x-K,x),n.arc(e+u,i+a,c,x,x+K),n.arc(e-d,i+r,c,x+K,x+j),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*b,h=s?s/2:l,n.rect(e-h,i-l,2*h,2*l);break}x+=Ht;case"rectRot":u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+d,i-r),n.lineTo(e+u,i+a),n.lineTo(e-d,i+r),n.closePath();break;case"crossRot":x+=Ht;case"cross":u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r);break;case"star":u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r),x+=Ht,u=Math.cos(x)*(s?s/2:b),r=Math.cos(x)*b,a=Math.sin(x)*b,d=Math.sin(x)*(s?s/2:b),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r);break;case"line":r=s?s/2:Math.cos(x)*b,a=Math.sin(x)*b,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:b),i+Math.sin(x)*b);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Jt(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function wi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function vi(n){n.restore()}function Td(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Sd(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function Dd(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),V(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function Od(n,t,e,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(r,h),n.lineTo(a,h),n.stroke()}}function Cd(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function $e(n,t,e,i,s,o={}){const r=q(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,Dd(n,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Cd(n,o.backdrop),a&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),V(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(c,e,i,o.maxWidth)),n.fillText(c,e,i,o.maxWidth),Od(n,e,i,c,o),i+=Number(s.lineHeight);n.restore()}function mn(n,t){const{x:e,y:i,w:s,h:o,radius:r}=t;n.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*j,j,!0),n.lineTo(e,i+o-r.bottomLeft),n.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,j,K,!0),n.lineTo(e+s-r.bottomRight,i+o),n.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,K,0,!0),n.lineTo(e+s,i+r.topRight),n.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-K,!0),n.lineTo(e+r.topLeft,i)}const Ed=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ad=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Id(n,t){const e=(""+n).match(Ed);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Ld=n=>+n||0;function nr(n,t){const e={},i=H(t),s=i?Object.keys(t):t,o=H(n)?i?r=>F(n[r],n[t[r]]):r=>n[r]:()=>n;for(const r of s)e[r]=Ld(o(r));return e}function gc(n){return nr(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ve(n){return nr(n,["topLeft","topRight","bottomLeft","bottomRight"])}function gt(n){const t=gc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function ot(n,t){n=n||{},t=t||Z.font;let e=F(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=F(n.style,t.style);i&&!(""+i).match(Ad)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:F(n.family,t.family),lineHeight:Id(F(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:F(n.weight,t.weight),string:""};return s.string=kd(s),s}function Xn(n,t,e,i){let s,o,r;for(s=0,o=n.length;s<o;++s)if(r=n[s],r!==void 0&&r!==void 0)return r}function Rd(n,t,e){const{min:i,max:s}=n,o=ic(t,(s-i)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function De(n,t){return Object.assign(Object.create(n),t)}function ir(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=yc("_fallback",n));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>ir([a,...n],t,o,i)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return pc(a,l,()=>Vd(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return la(a).includes(l)},ownKeys(a){return la(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function pn(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:mc(n,i),setContext:o=>pn(n,o,e,i),override:o=>pn(n.override(o),t,e,i)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete n[r],!0},get(o,r,a){return pc(o,r,()=>Nd(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(n,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,r)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,r){return Reflect.has(n,r)},ownKeys(){return Reflect.ownKeys(n)},set(o,r,a){return n[r]=a,delete o[r],!0}})}function mc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Et(e)?e:()=>e,isIndexable:Et(i)?i:()=>i}}const Fd=(n,t)=>n?n+Ko(t):t,sr=(n,t)=>H(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function Nd(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=n;let a=i[t];return Et(a)&&r.isScriptable(t)&&(a=zd(t,a,n,e)),q(a)&&a.length&&(a=Wd(t,a,n,r.isIndexable)),sr(t,a)&&(a=pn(a,s,o&&o[t],r)),a}function zd(n,t,e,i){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(o,r||i);return a.delete(n),sr(n,l)&&(l=or(s._scopes,s,n,l)),l}function Wd(n,t,e,i){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(H(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=or(c,s,n,h);t.push(pn(u,o,r&&r[n],a))}}return t}function bc(n,t,e){return Et(n)?n(t,e):n}const Hd=(n,t)=>n===!0?t:typeof n=="string"?ke(t,n):void 0;function Bd(n,t,e,i,s){for(const o of t){const r=Hd(e,o);if(r){n.add(r);const a=bc(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(r===!1&&typeof i<"u"&&e!==i)return null}return!1}function or(n,t,e,i){const s=t._rootScopes,o=bc(t._fallback,e,i),r=[...n,...s],a=new Set;a.add(i);let l=aa(a,r,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=aa(a,r,o,l,i),l===null)?!1:ir(Array.from(a),[""],s,o,()=>Yd(t,e,i))}function aa(n,t,e,i,s){for(;e;)e=Bd(n,t,e,i,s);return e}function Yd(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return q(s)&&H(e)?e:s||{}}function Vd(n,t,e,i){let s;for(const o of t)if(s=yc(Fd(o,n),e),typeof s<"u")return sr(n,s)?or(e,i,n,s):s}function yc(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function la(n){let t=n._keys;return t||(t=n._keys=jd(n._scopes)),t}function jd(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function xc(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,r=new Array(i);let a,l,c,h;for(a=0,l=i;a<l;++a)c=a+e,h=t[c],r[a]={r:s.parse(ke(h,o),c)};return r}const Xd=Number.EPSILON||1e-14,bn=(n,t)=>t<n.length&&!n[t].skip&&n[t],_c=n=>n==="x"?"y":"x";function Ud(n,t,e,i){const s=n.skip?t:n,o=t,r=e.skip?t:e,a=gn(o,s),l=gn(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=i*c,d=i*h;return{previous:{x:o.x-u*(r.x-s.x),y:o.y-u*(r.y-s.y)},next:{x:o.x+d*(r.x-s.x),y:o.y+d*(r.y-s.y)}}}function qd(n,t,e){const i=n.length;let s,o,r,a,l,c=bn(n,0);for(let h=0;h<i-1;++h)if(l=c,c=bn(n,h+1),!(!l||!c)){if(Xe(t[h],0,Xd)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=s*r*t[h],e[h+1]=o*r*t[h])}}function $d(n,t,e="x"){const i=_c(e),s=n.length;let o,r,a,l=bn(n,0);for(let c=0;c<s;++c){if(r=a,a=l,l=bn(n,c+1),!a)continue;const h=a[e],u=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=u-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=u+o*t[c])}}function Gd(n,t="x"){const e=_c(t),i=n.length,s=Array(i).fill(0),o=Array(i);let r,a,l,c=bn(n,0);for(r=0;r<i;++r)if(a=l,l=c,c=bn(n,r+1),!!l){if(c){const h=c[t]-l[t];s[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?Bt(s[r-1])!==Bt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}qd(n,s,o),$d(n,o,t)}function Vi(n,t,e){return Math.max(Math.min(n,e),t)}function Qd(n,t){let e,i,s,o,r,a=Jt(n[0],t);for(e=0,i=n.length;e<i;++e)r=o,o=a,a=e<i-1&&Jt(n[e+1],t),o&&(s=n[e],r&&(s.cp1x=Vi(s.cp1x,t.left,t.right),s.cp1y=Vi(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Vi(s.cp2x,t.left,t.right),s.cp2y=Vi(s.cp2y,t.top,t.bottom)))}function Kd(n,t,e,i,s){let o,r,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Gd(n,s);else{let c=i?n[n.length-1]:n[0];for(o=0,r=n.length;o<r;++o)a=n[o],l=Ud(c,a,n[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Qd(n,e)}function rr(){return typeof window<"u"&&typeof document<"u"}function ar(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ys(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Ss=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Zd(n,t){return Ss(n).getPropertyValue(t)}const Jd=["top","right","bottom","left"];function Ue(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Jd[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const tf=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function ef(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let r=!1,a,l;if(tf(s,o,n.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Qt(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=Ss(e),o=s.boxSizing==="border-box",r=Ue(s,"padding"),a=Ue(s,"border","width"),{x:l,y:c,box:h}=ef(n,e),u=r.left+(h&&a.left),d=r.top+(h&&a.top);let{width:f,height:p}=t;return o&&(f-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-u)/f*e.width/i),y:Math.round((c-d)/p*e.height/i)}}function nf(n,t,e){let i,s;if(t===void 0||e===void 0){const o=n&&ar(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const r=o.getBoundingClientRect(),a=Ss(o),l=Ue(a,"border","width"),c=Ue(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,i=ys(a.maxWidth,o,"clientWidth"),s=ys(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||gs,maxHeight:s||gs}}const ji=n=>Math.round(n*10)/10;function sf(n,t,e,i){const s=Ss(n),o=Ue(s,"margin"),r=ys(s.maxWidth,n,"clientWidth")||gs,a=ys(s.maxHeight,n,"clientHeight")||gs,l=nf(n,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const d=Ue(s,"border","width"),f=Ue(s,"padding");c-=f.width+d.width,h-=f.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=ji(Math.min(c,r,l.maxWidth)),h=ji(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ji(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=ji(Math.floor(h*i))),{width:c,height:h}}function ca(n,t,e){const i=t||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const r=n.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${n.height}px`,r.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||r.height!==s||r.width!==o?(n.currentDevicePixelRatio=i,r.height=s,r.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const of=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};rr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function ha(n,t){const e=Zd(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ne(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function rf(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function af(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ne(n,s,e),a=Ne(s,o,e),l=Ne(o,t,e),c=Ne(r,a,e),h=Ne(a,l,e);return Ne(c,h,e)}const lf=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},cf=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function ln(n,t,e){return n?lf(t,e):cf()}function wc(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function vc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Mc(n){return n==="angle"?{between:ai,compare:cd,normalize:Rt}:{between:le,compare:(t,e)=>t-e,normalize:t=>t}}function ua({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function hf(n,t,e){const{property:i,start:s,end:o}=e,{between:r,normalize:a}=Mc(i),l=t.length;let{start:c,end:h,loop:u}=n,d,f;if(u){for(c+=l,h+=l,d=0,f=l;d<f&&r(a(t[c%l][i]),s,o);++d)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:n.style}}function kc(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=Mc(i),{start:h,end:u,loop:d,style:f}=hf(n,t,e),p=[];let b=!1,x=null,_,w,k;const T=()=>l(s,k,_)&&a(s,k)!==0,P=()=>a(o,_)===0||l(o,k,_),O=()=>b||T(),C=()=>!b||P();for(let S=h,E=h;S<=u;++S)w=t[S%r],!w.skip&&(_=c(w[i]),_!==k&&(b=l(_,s,o),x===null&&O()&&(x=a(_,s)===0?S:E),x!==null&&C()&&(p.push(ua({start:x,end:S,loop:d,count:r,style:f})),x=null),E=S,k=_));return x!==null&&p.push(ua({start:x,end:u,loop:d,count:r,style:f})),p}function Pc(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=kc(i[s],n.points,t);o.length&&e.push(...o)}return e}function uf(n,t,e,i){let s=0,o=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&n[o%t].skip;)o--;return o%=t,{start:s,end:o}}function df(n,t,e,i){const s=n.length,o=[];let r=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function ff(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:r,end:a}=uf(e,s,o,i);if(i===!0)return da(n,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+s:a,c=!!n._fullLoop&&r===0&&a===s-1;return da(n,df(e,r,l,c),e,t)}function da(n,t,e,i){return!i||!i.setContext||!e?t:gf(n,t,e,i)}function gf(n,t,e,i){const s=n._chart.getContext(),o=fa(n.options),{_datasetIndex:r,options:{spanGaps:a}}=n,l=e.length,c=[];let h=o,u=t[0].start,d=u;function f(p,b,x,_){const w=a?-1:1;if(p!==b){for(p+=l;e[p%l].skip;)p-=w;for(;e[b%l].skip;)b+=w;p%l!==b%l&&(c.push({start:p%l,end:b%l,loop:x,style:_}),h=_,u=b%l)}}for(const p of t){u=a?u:p.start;let b=e[u%l],x;for(d=u+1;d<=p.end;d++){const _=e[d%l];x=fa(i.setContext(De(s,{type:"segment",p0:b,p1:_,p0DataIndex:(d-1)%l,p1DataIndex:d%l,datasetIndex:r}))),mf(x,h)&&f(u,d-1,p.loop,h),b=_,h=x}u<d-1&&f(u,d-1,p.loop,h)}return c}function fa(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function mf(n,t){if(!t)return!1;const e=[],i=function(s,o){return er(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
|
|
12
12
|
* Chart.js v4.4.8
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class $d{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Vl.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 o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(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((i,s)=>Math.max(i,s._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 ne=new $d;const Gr="transparent",Gd={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Wr(n||Gr),s=i.valid&&Wr(t||Gr);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Qd{constructor(t,e,i,s){const o=e[i];s=Ln([t.to,s,o,t.from]);const r=Ln([t.from,o,s]);this._active=!0,this._fn=t.fn||Gd[t.type||typeof r],this._easing=Yn[t.easing]||Yn.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=r,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],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ln([t.to,e,s,t.from]),this._from=Ln([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,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){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]()}}class Bo{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!W(t))return;const e=Object.keys(Z.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!W(o))return;const r={};for(const a of e)r[a]=o[a];(U(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,s=Kd(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Zd(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let u=o[c];const d=i.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}o[c]=u=new Qd(d,t,c,h),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return ne.add(this._chart,i),!0}}function Zd(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Kd(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Qr(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Jd(n,t,e){if(e===!1)return!1;const i=Qr(n,e),s=Qr(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function tf(n){let t,e,i,s;return W(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function ac(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function Zr(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(h=!0,i.all)continue;break}c=n.values[l],J(c)&&(o||t===0||zt(t)===zt(c))&&(t+=c)}return!h&&!i.all?0:t}function ef(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(n),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:n[h]};return a}function Is(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function nf(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function sf(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function of(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Kr(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Jr(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,h=nf(o,r,i),u=t.length;let d;for(let g=0;g<u;++g){const p=t[g],{[l]:b,[c]:x}=p,_=p._stacks||(p._stacks={});d=_[c]=of(s,h,b),d[a]=x,d._top=Kr(d,r,!0,i.type),d._bottom=Kr(d,r,!1,i.type);const w=d._visualValues||(d._visualValues={});w[a]=x}}function Ls(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function rf(n,t){return Te(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function af(n,t,e){return Te(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function vn(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Rs=n=>n==="reset"||n==="none",ta=(n,t)=>t?n:Object.assign({},n),lf=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:ac(e,!0),values:null};class Yt{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.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Is(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&vn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(u,d,g,p)=>u==="x"?d:u==="r"?p:g,o=e.xAxisID=R(i.xAxisID,Ls(t,"x")),r=e.yAxisID=R(i.yAxisID,Ls(t,"y")),a=e.rAxisID=R(i.rAxisID,Ls(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),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&&Fr(this._data,this),t._stacked&&vn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(W(e)){const s=this._cachedMeta;this._data=ef(e,s)}else if(i!==e){if(i){Fr(i,this);const s=this._cachedMeta;vn(s),s._parsed=[]}e&&Object.isExtensible(e)&&Uu(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 o=e._stacked;e._stacked=Is(e.vScale,e),e.stack!==i.stack&&(s=!0,vn(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Jr(this,e._parsed),e._stacked=Is(e.vScale,e))}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,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,u,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{U(s[t])?d=this.parseArrayData(i,s,t,e):W(s[t])?d=this.parseObjectData(i,s,t,e):d=this.parsePrimitiveData(i,s,t,e);const g=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<e;++h)i._parsed[h+t]=u=d[h],l&&(g()&&(l=!1),c=u);i._sorted=l}r&&Jr(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,u=new Array(s);let d,g,p;for(d=0,g=s;d<g;++d)p=d+i,u[d]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return u}parseArrayData(t,e,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,u;for(l=0,c=s;l<c;++l)h=l+i,u=e[h],a[l]={x:o.parse(u[0],h),y:r.parse(u[1],h)};return a}parseObjectData(t,e,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,u,d,g;for(h=0,u=s;h<u;++h)d=h+i,g=e[d],c[h]={x:o.parse(ve(g,a),d),y:r.parse(ve(g,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:ac(s,!0),values:e._stacks[t.axis]._visualValues};return Zr(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let r=o===null?NaN:o;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,r=Zr(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=lf(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=sf(a);let d,g;function p(){g=s[d];const b=g[a.axis];return!J(g[t.axis])||h>b||u<b}for(d=0;d<r&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],J(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=tf(R(this.options.clip,Jd(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const u=s[h];u.hidden||(u.active&&c?r.push(u):u.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=af(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=rf(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}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=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&Ot(i);if(a)return ta(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),g=Object.keys(Z.elements[t]),p=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(d,g,p,u);return b.$shared&&(b.$shared=l,o[r]=Object.freeze(ta(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,i,e))}const c=new Bo(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Rs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,s){Rs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Rs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}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[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(o,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&&vn(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)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}v(Yt,"defaults",{}),v(Yt,"datasetElementType",null),v(Yt,"dataElementType",null);function cf(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Bl(i.sort((s,o)=>s-o))}return n._cache.$bar}function hf(n){const t=n.iScale,e=cf(t,n.type);let i=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(Ot(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function uf(n,t,e,i){const s=e.barThickness;let o,r;return B(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[n]-o/2}}function df(n,t,e,i){const s=t.pixels,o=s[n];let r=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function ff(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function lc(n,t,e,i){return U(n)?ff(n,t,e,i):t[e.axis]=e.parse(n,i),t}function ea(n,t,e,i){const s=n.iScale,o=n.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,u,d;for(c=e,h=e+i;c<h;++c)d=t[c],u={},u[s.axis]=a||s.parse(r[c],c),l.push(lc(d,u,o,c));return l}function Fs(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function gf(n,t,e){return n!==0?zt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function mf(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function pf(n,t,e,i){let s=t.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=mf(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=h:(o[na(h,r,a,l)]=!0,s=c)),o[na(s,r,a,l)]=!0,n.borderSkipped=o}function na(n,t,e,i){return i?(n=bf(n,t,e),n=ia(n,e,t)):n=ia(n,t,e),n}function bf(n,t,e){return n===t?e:n===e?t:n}function ia(n,t,e){return n==="start"?t:n==="end"?e:n}function yf(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ni extends Yt{parsePrimitiveData(t,e,i,s){return ea(t,e,i,s)}parseArrayData(t,e,i,s){return ea(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,u=[];let d,g,p,b;for(d=i,g=i+s;d<g;++d)b=e[d],p={},p[o.axis]=o.parse(ve(b,c),d),u.push(lc(ve(b,h),p,r,d));return u}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),r=o._custom,a=Fs(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}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 o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),b=o||B(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),x=this._calculateBarIndexPixels(g,h),_=(p._stacks||{})[a.axis],w={horizontal:c,base:b.base,enableBorderRadius:!_||Fs(p._custom)||r===_._top||r===_._bottom,x:c?b.head:x.center,y:c?x.center:b.head,height:c?x.size:Math.abs(b.size),width:c?Math.abs(b.size):x.size};d&&(w.options=u||this.resolveDataElementOptions(g,t[g].active?"active":s));const k=w.options||t[g].options;pf(w,k,_,r),yf(w,k,h.ratio),this.updateElement(t[g],g,w,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=h=>{const u=h._parsed.find(g=>g[i.axis]===l),d=u&&u[h.vScale.axis];if(B(d)||isNaN(d))return!0};for(const h of s)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||hf(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=Fs(c);let u=l[e.axis],d=0,g=i?this.applyStack(e,l,i):u,p,b;g!==u&&(d=g-u,g=u),h&&(u=c.barStart,g=c.barEnd-c.barStart,u!==0&&zt(u)!==zt(c.barEnd)&&(d=0),d+=u);const x=!B(o)&&!h?o:d;let _=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(d+g):p=_,b=p-_,Math.abs(b)<r){b=gf(b,e,a)*r,u===a&&(_-=b/2);const w=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),T=Math.min(w,k),P=Math.max(w,k);_=Math.max(Math.min(_,P),T),p=_+b,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(_))}if(_===e.getPixelForValue(a)){const w=zt(b)*e.getLineWidthForValue(a)/2;_+=w,b-=w}return{size:b,base:_,head:p,center:p+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,r=R(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?df(t,e,s,c):uf(t,e,s,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*u+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}v(Ni,"id","bar"),v(Ni,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),v(Ni,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class zi extends Yt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const o=super.parsePrimitiveData(t,e,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let r=0;r<o.length;r++){const a=e[i+r];o[r]._custom=R(a[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let r=0;r<o.length;r++){const a=e[i+r];o[r]._custom=R(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius)}return o}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,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=r.axis,u=a.axis;for(let d=e;d<e+i;d++){const g=t[d],p=!o&&this.getParsed(d),b={},x=b[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[h]),_=b[u]=o?a.getBasePixel():a.getPixelForValue(p[u]);b.skip=isNaN(x)||isNaN(_),c&&(b.options=l||this.resolveDataElementOptions(d,g.active?"active":s),o&&(b.options.radius=0)),this.updateElement(g,d,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=R(i&&i._custom,o),s}}v(zi,"id","bubble"),v(zi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),v(zi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function xf(n,t,e){let i=1,s=1,o=0,r=0;if(t<$){const a=n,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),g=(k,T,P)=>Gn(k,a,l,!0)?1:Math.max(T,T*e,P,P*e),p=(k,T,P)=>Gn(k,a,l,!0)?-1:Math.min(T,T*e,P,P*e),b=g(0,c,u),x=g(Q,h,d),_=p(V,c,u),w=p(V+Q,h,d);i=(b-_)/2,s=(x-w)/2,o=-(b+_)/2,r=-(x+w)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class pe extends Yt{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(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(W(i[t])){const{key:l="value"}=this._parsing;o=c=>+ve(i[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return ht(this.options.rotation-90)}_getCircumference(){return ht(this.options.circumference)}_getRotationExtents(){let t=$,e=-$;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(Au(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:g,offsetX:p,offsetY:b}=xf(u,h,l),x=(i.width-r)/d,_=(i.height-r)/g,w=Math.max(Math.min(x,_)/2,0),k=zl(this.options.radius,w),T=Math.max(k*l,0),P=(k-T)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=b*k,s.total=this.calculateTotal(),this.outerRadius=k-P*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-P*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/$)}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=o&&c.animateScale,g=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(e,s);let _=this._getRotation(),w;for(w=0;w<e;++w)_+=this._circumference(w,o);for(w=e;w<e+i;++w){const k=this._circumference(w,o),T=t[w],P={x:h+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+k,circumference:k,outerRadius:p,innerRadius:g};x&&(P.options=b||this.resolveDataElementOptions(w,T.active?"active":s)),_+=k,this.updateElement(T,w,P,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?$*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=ni(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.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(R(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}v(pe,"id","doughnut"),v(pe,"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"}),v(pe,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),v(pe,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Wi extends Yt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Xl(e,s,r);this._drawStart=a,this._drawCount=l,Ul(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),d=r.axis,g=a.axis,{spanGaps:p,segment:b}=this.options,x=Me(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",w=e+i,k=t.length;let T=e>0&&this.getParsed(e-1);for(let P=0;P<k;++P){const O=t[P],C=_?O:{};if(P<e||P>=w){C.skip=!0;continue}const S=this.getParsed(P),E=B(S[g]),I=C[d]=r.getPixelForValue(S[d],P),F=C[g]=o||E?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,S,l):S[g],P);C.skip=isNaN(I)||isNaN(F)||E,C.stop=P>0&&Math.abs(S[d]-T[d])>x,b&&(C.parsed=S,C.raw=c.data[P]),u&&(C.options=h||this.resolveDataElementOptions(P,O.active?"active":s)),_||this.updateElement(O,P,C,s),T=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}v(Wi,"id","line"),v(Wi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),v(Wi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Vn extends Yt{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||[],o=ni(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return tc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*V;let g=d,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,b);for(p=e;p<e+i;p++){const x=t[p];let _=g,w=g+this._computeAngle(p,s,b),k=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=w,o&&(l.animateScale&&(k=0),l.animateRotate&&(_=w=d));const T={x:h,y:u,innerRadius:0,outerRadius:k,startAngle:_,endAngle:w,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,T,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?ht(this.resolveDataElementOptions(t,e).angle||i):0}}v(Vn,"id","polarArea"),v(Vn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),v(Vn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ks extends pe{}v(Ks,"id","pie"),v(Ks,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Hi extends Yt{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return tc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=o.getPointPositionForValue(a,this.getParsed(a).r),u=r?o.xCenter:h.x,d=r?o.yCenter:h.y,g={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,g,s)}}}v(Hi,"id","radar"),v(Hi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),v(Hi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Yi extends Yt{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:r}=Xl(e,i,s);if(this._drawStart=o,this._drawCount=r,Ul(e)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(h),d=this.includeOptions(s,u),g=r.axis,p=a.axis,{spanGaps:b,segment:x}=this.options,_=Me(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none";let k=e>0&&this.getParsed(e-1);for(let T=e;T<e+i;++T){const P=t[T],O=this.getParsed(T),C=w?P:{},S=B(O[p]),E=C[g]=r.getPixelForValue(O[g],T),I=C[p]=o||S?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[p],T);C.skip=isNaN(E)||isNaN(I)||S,C.stop=T>0&&Math.abs(O[g]-k[g])>_,x&&(C.parsed=O,C.raw=c.data[T]),d&&(C.options=u||this.resolveDataElementOptions(T,P.active?"active":s)),w||this.updateElement(P,T,C,s),k=O}this.updateSharedOptions(u,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}}v(Yi,"id","scatter"),v(Yi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),v(Yi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var _f=Object.freeze({__proto__:null,BarController:Ni,BubbleController:zi,DoughnutController:pe,LineController:Wi,PieController:Ks,PolarAreaController:Vn,RadarController:Hi,ScatterController:Yi});function Ie(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Vo{constructor(t){v(this,"options");this.options=t||{}}static override(t){Object.assign(Vo.prototype,t)}init(){}formats(){return Ie()}parse(){return Ie()}format(){return Ie()}add(){return Ie()}diff(){return Ie()}startOf(){return Ie()}endOf(){return Ie()}}var cc={_date:Vo};function wf(n,t,e,i){const{controller:s,data:o,_sorted:r}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?ju:re;if(i){if(s._sharedOptions){const h=o[0],u=typeof h.getRange=="function"&&h.getRange(t);if(u){const d=c(o,t,e-u),g=c(o,t,e+u);return{lo:d.lo,hi:g.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:u}=s._cachedMeta,{_parsed:d}=n,g=d.slice(0,h.lo+1).reverse().findIndex(b=>!B(b[u.axis]));h.lo-=Math.max(0,g);const p=d.slice(h.hi).findIndex(b=>!B(b[u.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function hs(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:u,hi:d}=wf(o[a],t,r,s);for(let g=u;g<=d;++g){const p=h[g];p.skip||i(p,c,g)}}}function vf(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function Ns(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||hs(n,e,t,function(a,l,c){!s&&!Qt(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Mf(n,t,e,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:u}=Ki(r,{x:t.x,y:t.y});Gn(u,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return hs(n,e,t,o),s}function kf(n,t,e,i,s,o){let r=[];const a=vf(e);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const g=h.inRange(t.x,t.y,s);if(i&&!g)return;const p=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(p))&&!g)return;const x=a(t,p);x<l?(r=[{element:h,datasetIndex:u,index:d}],l=x):x===l&&r.push({element:h,datasetIndex:u,index:d})}return hs(n,e,t,c),r}function zs(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Mf(n,t,e,s):kf(n,t,e,i,s,o)}function sa(n,t,e,i,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return hs(n,e,t,(l,c,h)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Pf={modes:{index(n,t,e,i){const s=qt(t,n),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Ns(n,s,o,i,r):zs(n,s,o,!1,i,r),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(n,t,e,i){const s=qt(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Ns(n,s,o,i,r):zs(n,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(n,t,e,i){const s=qt(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return Ns(n,s,o,i,r)},nearest(n,t,e,i){const s=qt(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return zs(n,s,o,e.intersect,i,r)},x(n,t,e,i){const s=qt(t,n);return sa(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=qt(t,n);return sa(n,s,"y",e.intersect,i)}}};const hc=["left","top","right","bottom"];function Mn(n,t){return n.filter(e=>e.pos===t)}function oa(n,t){return n.filter(e=>hc.indexOf(e.pos)===-1&&e.box.axis===t)}function kn(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Tf(n){const t=[];let e,i,s,o,r,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Sf(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!hc.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Df(n,t){const e=Sf(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=n.length;o<r;++o){a=n[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=h?h*s:l&&t.availableHeight)}return e}function Of(n){const t=Tf(n),e=kn(t.filter(c=>c.box.fullSize),!0),i=kn(Mn(t,"left"),!0),s=kn(Mn(t,"right")),o=kn(Mn(t,"top"),!0),r=kn(Mn(t,"bottom")),a=oa(t,"x"),l=oa(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Mn(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function ra(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function uc(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Cf(n,t,e,i){const{pos:s,box:o}=e,r=n.maxPadding;if(!W(s)){e.size&&(n[s]-=e.size);const u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,n[s]+=e.size}o.getPadding&&uc(r,o.getPadding());const a=Math.max(0,t.outerWidth-ra(r,n,"left","right")),l=Math.max(0,t.outerHeight-ra(r,n,"top","bottom")),c=a!==n.w,h=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ef(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Af(n,t){const e=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(n?["left","right"]:["top","bottom"])}function Rn(n,t,e,i){const s=[];let o,r,a,l,c,h;for(o=0,r=n.length,c=0;o<r;++o){a=n[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Af(a.horizontal,t));const{same:u,other:d}=Cf(t,e,a,i);c|=u&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&Rn(s,t,e,i)||h}function Si(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function aa(n,t,e,i){const s=e.padding;let{x:o,y:r}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const u=t.w*h,d=c.size||l.height;Ot(c.start)&&(r=c.start),l.fullSize?Si(l,s.left,r,e.outerWidth-s.right-s.left,d):Si(l,t.left+c.placed,r,u,d),c.start=r,c.placed+=u,r=l.bottom}else{const u=t.h*h,d=c.size||l.width;Ot(c.start)&&(o=c.start),l.fullSize?Si(l,o,s.top,d,e.outerHeight-s.bottom-s.top):Si(l,o,t.top+c.placed,d,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=r}var _t={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=ut(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=Of(n.boxes),l=a.vertical,c=a.horizontal;Y(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const h=l.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),d=Object.assign({},s);uc(d,ut(i));const g=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),p=Df(l.concat(c),u);Rn(a.fullSize,g,u,p),Rn(l,g,u,p),Rn(c,g,u,p)&&Rn(l,g,u,p),Ef(g),aa(a.leftAndTop,g,u,p),g.x+=g.w,g.y+=g.h,aa(a.rightAndBottom,g,u,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},Y(a.chartArea,b=>{const x=b.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class dc{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 If extends dc{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Bi="$chartjs",Lf={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},la=n=>n===null||n==="";function Rf(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Bi]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",la(s)){const o=Xr(n,"width");o!==void 0&&(n.width=o)}if(la(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=Xr(n,"height");o!==void 0&&(n.height=o)}return n}const fc=Nd?{passive:!0}:!1;function Ff(n,t,e){n&&n.addEventListener(t,e,fc)}function Nf(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,fc)}function zf(n,t){const e=Lf[n.type]||n.type,{x:i,y:s}=qt(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function es(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Wf(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||es(a.addedNodes,i),r=r&&!es(a.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Hf(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||es(a.removedNodes,i),r=r&&!es(a.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Qn=new Map;let ca=0;function gc(){const n=window.devicePixelRatio;n!==ca&&(ca=n,Qn.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Yf(n,t){Qn.size||window.addEventListener("resize",gc),Qn.set(n,t)}function Bf(n){Qn.delete(n),Qn.size||window.removeEventListener("resize",gc)}function Vf(n,t,e){const i=n.canvas,s=i&&Yo(i);if(!s)return;const o=jl((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),Yf(n,o),r}function Ws(n,t,e){e&&e.disconnect(),t==="resize"&&Bf(n)}function jf(n,t,e){const i=n.canvas,s=jl(o=>{n.ctx!==null&&e(zf(o,n))},n);return Ff(i,t,s),s}class Xf extends dc{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Rf(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Bi])return!1;const i=e[Bi].initial;["height","width"].forEach(o=>{const r=i[o];B(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Bi],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:Wf,detach:Hf,resize:Vf}[e]||jf;s[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Ws,detach:Ws,resize:Ws}[e]||Nf)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Fd(t,e,i,s)}isAttached(t){const e=t&&Yo(t);return!!(e&&e.isConnected)}}function Uf(n){return!Ho()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?If:Xf}class bt{constructor(){v(this,"x");v(this,"y");v(this,"active",!1);v(this,"options");v(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Me(this.x)&&Me(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}v(bt,"defaults",{}),v(bt,"defaultRoutes");function qf(n,t){const e=n.options.ticks,i=$f(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Qf(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Zf(t,c,o,r/s),c;const h=Gf(o,t,s);if(r>0){let u,d;const g=r>1?Math.round((l-a)/(r-1)):null;for(Di(t,c,h,B(g)?0:a-g,a),u=0,d=r-1;u<d;u++)Di(t,c,h,o[u],o[u+1]);return Di(t,c,h,l,B(g)?t.length:l+g),c}return Di(t,c,h),c}function $f(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Gf(n,t,e){const i=Kf(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Wu(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function Qf(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Zf(n,t,e,i){let s=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<n.length;r++)r===o&&(t.push(n[r]),s++,o=e[s*i])}function Di(n,t,e,i,s){const o=R(i,0),r=Math.min(R(s,n.length),n.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(n[c]),a++,h=Math.round(o+a*e))}function Kf(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Jf=n=>n==="left"?"right":n==="right"?"left":n,ha=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,ua=(n,t)=>Math.min(t||n,n);function da(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function tg(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function eg(n,t){Y(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function Pn(n){return n.drawTicks?n.tickLength:0}function fa(n,t){if(!n.display)return 0;const e=it(n.font,t),i=ut(n.padding);return(U(n.text)?n.text.length:1)*e.lineHeight+i.height}function ng(n,t){return Te(n,{scale:t,type:"scale"})}function ig(n,t,e){return Te(n,{tick:e,index:t,type:"tick"})}function sg(n,t,e){let i=Lo(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Jf(i)),i}function og(n,t,e,i){const{top:s,left:o,bottom:r,right:a,chart:l}=n,{chartArea:c,scales:h}=l;let u=0,d,g,p;const b=r-s,x=a-o;if(n.isHorizontal()){if(g=xt(i,o,a),W(e)){const _=Object.keys(e)[0],w=e[_];p=h[_].getPixelForValue(w)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=ha(n,e,t);d=a-o}else{if(W(e)){const _=Object.keys(e)[0],w=e[_];g=h[_].getPixelForValue(w)-x+t}else e==="center"?g=(c.left+c.right)/2-x+t:g=ha(n,e,t);p=xt(i,r,s),u=e==="left"?-Q:Q}return{titleX:g,titleY:p,maxWidth:d,rotation:u}}class je extends bt{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=Et(t,Number.POSITIVE_INFINITY),e=Et(e,Number.NEGATIVE_INFINITY),i=Et(i,Number.POSITIVE_INFINITY),s=Et(s,Number.NEGATIVE_INFINITY),{min:Et(t,i),max:Et(e,s),minDefined:J(t),maxDefined:J(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:Et(e,Et(i,e)),max:Et(i,Et(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){L(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.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=gd(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?da(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=qf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){L(this.options.afterUpdate,[this])}beforeSetDimensions(){L(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(){L(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),L(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){L(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=L(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){L(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){L(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=ua(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,g=pt(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),u+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-Pn(t.grid)-e.padding-fa(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),r=as(Math.min(Math.asin(pt((h.highest.height+6)/a,-1,1)),Math.asin(pt(l/c,-1,1))-Math.asin(pt(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){L(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){L(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=fa(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Pn(o)+l):(t.height=this.maxHeight,t.width=Pn(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),g=i.padding*2,p=ht(this.labelRotation),b=Math.cos(p),x=Math.sin(p);if(a){const _=i.mirror?0:x*u.width+b*d.height;t.height=Math.min(this.maxHeight,t.height+_+g)}else{const _=i.mirror?0:b*u.width+x*d.height;t.width=Math.min(this.maxWidth,t.width+_+g)}this._calculatePadding(c,h,x,b)}}this._handleMargins(),a?(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:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,g=0;l?c?(d=s*t.width,g=i*e.height):(d=i*t.height,g=s*e.width):o==="start"?g=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,g=e.width/2),this.paddingLeft=Math.max((d-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((g-u+r)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;o==="start"?(h=0,u=t.height):o==="end"&&(h=e.height,u=0),this.paddingTop=h+r,this.paddingBottom=u+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){L(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)B(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=da(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/ua(e,i));let c=0,h=0,u,d,g,p,b,x,_,w,k,T,P;for(u=0;u<e;u+=l){if(p=t[u].label,b=this._resolveTickFontOptions(u),s.font=x=b.string,_=o[x]=o[x]||{data:{},gc:[]},w=b.lineHeight,k=T=0,!B(p)&&!U(p))k=Ji(s,_.data,_.gc,k,p),T=w;else if(U(p))for(d=0,g=p.length;d<g;++d)P=p[d],!B(P)&&!U(P)&&(k=Ji(s,_.data,_.gc,k,P),T+=w);r.push(k),a.push(T),c=Math.max(k,c),h=Math.max(T,h)}eg(o,e);const O=r.indexOf(c),C=a.indexOf(h),S=E=>({width:r[E]||0,height:a[E]||0});return{first:S(0),last:S(e-1),widest:S(O),highest:S(C),widths:r,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 Vu(this._alignToPixels?Ae(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=ig(this.getContext(),t,i))}return this.$context||(this.$context=ng(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ht(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),d=Pn(o),g=[],p=a.setContext(this.getContext()),b=p.display?p.width:0,x=b/2,_=function(G){return Ae(i,G,b)};let w,k,T,P,O,C,S,E,I,F,z,tt;if(r==="top")w=_(this.bottom),C=this.bottom-d,E=w-x,F=_(t.top)+x,tt=t.bottom;else if(r==="bottom")w=_(this.top),F=t.top,tt=_(t.bottom)-x,C=w+x,E=this.top+d;else if(r==="left")w=_(this.right),O=this.right-d,S=w-x,I=_(t.left)+x,z=t.right;else if(r==="right")w=_(this.left),I=t.left,z=_(t.right)-x,O=w+x,S=this.left+d;else if(e==="x"){if(r==="center")w=_((t.top+t.bottom)/2+.5);else if(W(r)){const G=Object.keys(r)[0],K=r[G];w=_(this.chart.scales[G].getPixelForValue(K))}F=t.top,tt=t.bottom,C=w+x,E=C+d}else if(e==="y"){if(r==="center")w=_((t.left+t.right)/2);else if(W(r)){const G=Object.keys(r)[0],K=r[G];w=_(this.chart.scales[G].getPixelForValue(K))}O=w-x,S=O-d,I=t.left,z=t.right}const rt=R(s.ticks.maxTicksLimit,u),X=Math.max(1,Math.ceil(u/rt));for(k=0;k<u;k+=X){const G=this.getContext(k),K=o.setContext(G),Ct=a.setContext(G),dt=K.lineWidth,le=K.color,Qe=Ct.dash||[],It=Ct.dashOffset,Se=K.tickWidth,Wt=K.tickColor,De=K.tickBorderDash||[],Kt=K.tickBorderDashOffset;T=tg(this,k,l),T!==void 0&&(P=Ae(i,T,dt),c?O=S=I=z=P:C=E=F=tt=P,g.push({tx1:O,ty1:C,tx2:S,ty2:E,x1:I,y1:F,x2:z,y2:tt,width:dt,color:le,borderDash:Qe,borderDashOffset:It,tickWidth:Se,tickColor:Wt,tickBorderDash:De,tickBorderDashOffset:Kt}))}return this._ticksLength=u,this._borderValue=w,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=o,d=Pn(i.grid),g=d+h,p=u?-h:g,b=-ht(this.labelRotation),x=[];let _,w,k,T,P,O,C,S,E,I,F,z,tt="middle";if(s==="top")O=this.bottom-p,C=this._getXAxisLabelAlignment();else if(s==="bottom")O=this.top+p,C=this._getXAxisLabelAlignment();else if(s==="left"){const X=this._getYAxisLabelAlignment(d);C=X.textAlign,P=X.x}else if(s==="right"){const X=this._getYAxisLabelAlignment(d);C=X.textAlign,P=X.x}else if(e==="x"){if(s==="center")O=(t.top+t.bottom)/2+g;else if(W(s)){const X=Object.keys(s)[0],G=s[X];O=this.chart.scales[X].getPixelForValue(G)+g}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")P=(t.left+t.right)/2-g;else if(W(s)){const X=Object.keys(s)[0],G=s[X];P=this.chart.scales[X].getPixelForValue(G)}C=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?tt="top":l==="end"&&(tt="bottom"));const rt=this._getLabelSizes();for(_=0,w=a.length;_<w;++_){k=a[_],T=k.label;const X=o.setContext(this.getContext(_));S=this.getPixelForTick(_)+o.labelOffset,E=this._resolveTickFontOptions(_),I=E.lineHeight,F=U(T)?T.length:1;const G=F/2,K=X.color,Ct=X.textStrokeColor,dt=X.textStrokeWidth;let le=C;r?(P=S,C==="inner"&&(_===w-1?le=this.options.reverse?"left":"right":_===0?le=this.options.reverse?"right":"left":le="center"),s==="top"?c==="near"||b!==0?z=-F*I+I/2:c==="center"?z=-rt.highest.height/2-G*I+I:z=-rt.highest.height+I/2:c==="near"||b!==0?z=I/2:c==="center"?z=rt.highest.height/2-G*I:z=rt.highest.height-F*I,u&&(z*=-1),b!==0&&!X.showLabelBackdrop&&(P+=I/2*Math.sin(b))):(O=S,z=(1-F)*I/2);let Qe;if(X.showLabelBackdrop){const It=ut(X.backdropPadding),Se=rt.heights[_],Wt=rt.widths[_];let De=z-It.top,Kt=0-It.left;switch(tt){case"middle":De-=Se/2;break;case"bottom":De-=Se;break}switch(C){case"center":Kt-=Wt/2;break;case"right":Kt-=Wt;break;case"inner":_===w-1?Kt-=Wt:_>0&&(Kt-=Wt/2);break}Qe={left:Kt,top:De,width:Wt+It.width,height:Se+It.height,color:X.backdropColor}}x.push({label:T,font:E,textOffset:z,options:{rotation:b,color:K,strokeColor:Ct,strokeWidth:dt,textAlign:le,textBaseline:tt,translation:[P,O],backdrop:Qe}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ht(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const l=s[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,u,d;this.isHorizontal()?(c=Ae(t,this.left,r)-r/2,h=Ae(t,this.right,a)+a/2,u=d=l):(u=Ae(t,this.top,r)-r/2,d=Ae(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,u),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&ii(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Be(i,c,0,h,l,a)}s&&si(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=it(i.font),r=ut(i.padding),a=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||W(e)?(l+=r.bottom,U(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=og(this,l,e,a);Be(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:d,textAlign:sg(a,e,s),textBaseline:"middle",translation:[c,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=R(t.grid&&t.grid.z,-1),s=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==je.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];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 it(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Oi{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;lg(e)&&(i=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,rg(t,r,i),this.override&&Z.override(t.id,t.overrides)),r}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 Z[s]&&(delete Z[s][i],this.override&&delete Ye[i])}}function rg(n,t,e){const i=$n(Object.create(null),[e?Z.get(e):{},Z.get(t),n.defaults]);Z.set(t,i),n.defaultRoutes&&ag(t,n.defaultRoutes),n.descriptors&&Z.describe(t,n.descriptors)}function ag(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");Z.route(o,s,l,a)})}function lg(n){return"id"in n&&"defaults"in n}class cg{constructor(){this.controllers=new Oi(Yt,"datasets",!0),this.elements=new Oi(bt,"elements"),this.plugins=new Oi(Object,"plugins"),this.scales=new Oi(je,"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(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Y(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const s=Eo(t);L(i["before"+s],[],i),e[t](i),L(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(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ut=new cg;class hg{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[e,s,o.options];if(L(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){B(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=R(i.options&&i.options.plugins,{}),o=ug(i);return s===!1&&!e?[]:fg(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function ug(n){const t={},e=[],i=Object.keys(Ut.plugins.items);for(let o=0;o<i.length;o++)e.push(Ut.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function dg(n,t){return!t&&n===!1?null:n===!0?{}:n}function fg(n,{plugins:t,localIds:e},i,s){const o=[],r=n.getContext();for(const a of t){const l=a.id,c=dg(i[l],s);c!==null&&o.push({plugin:a,options:gg(n.config,{plugin:a,local:e[l]},c,r)})}return o}function gg(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),r=n.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),n.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Js(n,t){const e=Z.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function mg(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function pg(n,t){return n===t?"_index_":"_value_"}function ga(n){if(n==="x"||n==="y"||n==="r")return n}function bg(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function to(n,...t){if(ga(n))return n;for(const e of t){const i=e.axis||bg(e.position)||n.length>1&&ga(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function ma(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function yg(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return ma(n,"x",e[0])||ma(n,"y",e[0])}return{}}function xg(n,t){const e=Ye[n.type]||{scales:{}},i=t.scales||{},s=Js(n.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!W(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=to(r,a,yg(r,n),Z.scales[a.type]),c=pg(l,s),h=e.scales||{};o[r]=Hn(Object.create(null),[{axis:l},a,h[l],h[c]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,l=r.indexAxis||Js(a,t),h=(Ye[a]||{}).scales||{};Object.keys(h).forEach(u=>{const d=mg(u,l),g=r[d+"AxisID"]||d;o[g]=o[g]||Object.create(null),Hn(o[g],[{axis:d},i[g],h[u]])})}),Object.keys(o).forEach(r=>{const a=o[r];Hn(a,[Z.scales[a.type],Z.scale])}),o}function mc(n){const t=n.options||(n.options={});t.plugins=R(t.plugins,{}),t.scales=xg(n,t)}function pc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function _g(n){return n=n||{},n.data=pc(n.data),mc(n),n}const pa=new Map,bc=new Set;function Ci(n,t){let e=pa.get(n);return e||(e=t(),pa.set(n,e),bc.add(e)),e}const Tn=(n,t,e)=>{const i=ve(t,e);i!==void 0&&n.add(i)};class wg{constructor(t){this._config=_g(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=pc(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(),mc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ci(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ci(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ci(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ci(`${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:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Tn(l,t,u))),h.forEach(u=>Tn(l,s,u)),h.forEach(u=>Tn(l,Ye[o]||{},u)),h.forEach(u=>Tn(l,Z,u)),h.forEach(u=>Tn(l,Qs,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),bc.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ye[e]||{},Z.datasets[e]||{},{type:e},Z,Qs]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=ba(this._resolverCache,t,s);let l=r;if(Mg(r,e)){o.$shared=!1,i=Dt(i)?i():i;const c=this.createResolver(t,i,a);l=rn(r,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=ba(this._resolverCache,t,i);return W(e)?rn(o,e,void 0,s):o}}function ba(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);return o||(o={resolver:No(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const vg=n=>W(n)&&Object.getOwnPropertyNames(n).some(t=>Dt(n[t]));function Mg(n,t){const{isScriptable:e,isIndexable:i}=Ql(n);for(const s of t){const o=e(s),r=i(s),a=(r||o)&&n[s];if(o&&(Dt(a)||vg(a))||r&&U(a))return!0}return!1}var kg="4.4.8";const Pg=["top","bottom","left","right","chartArea"];function ya(n,t){return n==="top"||n==="bottom"||Pg.indexOf(n)===-1&&t==="x"}function xa(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function _a(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),L(e&&e.onComplete,[n],t)}function Tg(n){const t=n.chart,e=t.options.animation;L(e&&e.onProgress,[n],t)}function yc(n){return Ho()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Vi={},wa=n=>{const t=yc(n);return Object.values(Vi).filter(e=>e.canvas===t).pop()};function Sg(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r)}}}function Dg(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Ei(n,t,e){return n.options.clip?n[e]:t[e]}function Og(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ei(e,t,"left"),right:Ei(e,t,"right"),top:Ei(i,t,"top"),bottom:Ei(i,t,"bottom")}:t}class Mt{static register(...t){Ut.add(...t),va()}static unregister(...t){Ut.remove(...t),va()}constructor(t,e){const i=this.config=new wg(e),s=yc(t),o=wa(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Uf(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Eu(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new hg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=qu(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],Vi[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ne.listen(this,"complete",_a),ne.listen(this,"progress",Tg),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return B(t)?e&&o?o: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}get registry(){return Ut}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():jr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Yr(this.canvas,this.ctx),this}stop(){return ne.stop(this),this}resize(t,e){ne.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,jr(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),L(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Y(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=to(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),Y(o,r=>{const a=r.options,l=a.id,c=to(l,a),h=R(a.type,r.dtype);(a.position===void 0||ya(a.position,c)!==ya(r.dposition))&&(a.position=r.dposition),s[l]=!0;let u=null;if(l in i&&i[l].type===h)u=i[l];else{const d=Ut.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),Y(s,(r,a)=>{r||delete i[a]}),Y(i,r=>{_t.configure(this,r,r.options),_t.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(xa("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||Js(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=Ut.getController(a),{datasetElementType:c,dataElementType:h}=Z.datasets[a];Object.assign(l,{dataElementType:Ut.getElement(h),datasetElementType:c&&Ut.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){Y(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()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),d=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(d),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||Y(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(xa("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Y(this.scales,t=>{_t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ir(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e){const r=i==="_removeElements"?-o:o;Sg(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!Ir(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;_t.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Y(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Dt(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};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ne.has(this)?this.attached&&!ne.running(this)&&ne.start(this):(this.draw(),_a({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)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,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)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,o=Og(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&ii(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&si(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Qt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Pf.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._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=Te(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 typeof i.hidden=="boolean"?!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",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Ot(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.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(),ne.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Yr(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Vi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};Y(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){Y(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Y(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!$i(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),l=Nu(t),c=Dg(t,this._lastEvent,i,l);i&&(this._lastEvent=null,L(o.onHover,[t,a,this],this),l&&L(o.onClick,[t,a,this],this));const h=!$i(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}v(Mt,"defaults",Z),v(Mt,"instances",Vi),v(Mt,"overrides",Ye),v(Mt,"registry",Ut),v(Mt,"version",kg),v(Mt,"getChart",wa);function va(){return Y(Mt.instances,n=>n._plugins.invalidate())}function Cg(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(o,r,a,i-c,e+c),l>s?(c=s/l,n.arc(o,r,l,e+c,i-c,!0)):n.arc(o,r,s,e+Q,i-Q),n.closePath(),n.clip()}function Eg(n){return Fo(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ag(n,t,e,i){const s=Eg(n.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(e-Math.min(o,l))*i/2;return pt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:pt(s.innerStart,0,r),innerEnd:pt(s.innerEnd,0,r)}}function Je(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function ns(n,t,e,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+i+e-c,0),d=h>0?h+i+e+c:0;let g=0;const p=s-l;if(i){const X=h>0?h-i:0,G=u>0?u-i:0,K=(X+G)/2,Ct=K!==0?p*K/(K+i):p;g=(p-Ct)/2}const b=Math.max(.001,p*u-e/V)/u,x=(p-b)/2,_=l+x+g,w=s-x-g,{outerStart:k,outerEnd:T,innerStart:P,innerEnd:O}=Ag(t,d,u,w-_),C=u-k,S=u-T,E=_+k/C,I=w-T/S,F=d+P,z=d+O,tt=_+P/F,rt=w-O/z;if(n.beginPath(),o){const X=(E+I)/2;if(n.arc(r,a,u,E,X),n.arc(r,a,u,X,I),T>0){const dt=Je(S,I,r,a);n.arc(dt.x,dt.y,T,I,w+Q)}const G=Je(z,w,r,a);if(n.lineTo(G.x,G.y),O>0){const dt=Je(z,rt,r,a);n.arc(dt.x,dt.y,O,w+Q,rt+Math.PI)}const K=(w-O/d+(_+P/d))/2;if(n.arc(r,a,d,w-O/d,K,!0),n.arc(r,a,d,K,_+P/d,!0),P>0){const dt=Je(F,tt,r,a);n.arc(dt.x,dt.y,P,tt+Math.PI,_-Q)}const Ct=Je(C,_,r,a);if(n.lineTo(Ct.x,Ct.y),k>0){const dt=Je(C,E,r,a);n.arc(dt.x,dt.y,k,_-Q,E)}}else{n.moveTo(r,a);const X=Math.cos(E)*u+r,G=Math.sin(E)*u+a;n.lineTo(X,G);const K=Math.cos(I)*u+r,Ct=Math.sin(I)*u+a;n.lineTo(K,Ct)}n.closePath()}function Ig(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){ns(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(a)||(l=r+(a%$||$))}return ns(n,t,e,i,l,s),n.fill(),l}function Lg(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(u||[]),n.lineDashOffset=d,g?(n.lineWidth=c*2,n.lineJoin=h||"round"):(n.lineWidth=c,n.lineJoin=h||"bevel");let p=t.endAngle;if(o){ns(n,t,e,i,p,s);for(let b=0;b<o;++b)n.stroke();isNaN(a)||(p=r+(a%$||$))}g&&Cg(n,t,p),o||(ns(n,t,e,i,p,s),n.stroke())}class Fn extends bt{constructor(e){super();v(this,"circumference");v(this,"endAngle");v(this,"fullCircles");v(this,"innerRadius");v(this,"outerRadius");v(this,"pixelMargin");v(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.getProps(["x","y"],s),{angle:r,distance:a}=Ki(o,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,p=R(d,c-l),b=Gn(r,l,c)&&l!==c,x=p>=$||b,_=oe(a,h+g,u+g);return x&&_}getCenterPoint(e){const{x:i,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,u=(o+r)/2,d=(a+l+h+c)/2;return{x:i+Math.cos(u)*d,y:s+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>$?Math.floor(s/$):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(V,s||0)),h=o*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Ig(e,this,h,r,a),Lg(e,this,h,r,a),e.restore()}}v(Fn,"id","arc"),v(Fn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),v(Fn,"defaultRoutes",{backgroundColor:"backgroundColor"}),v(Fn,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function xc(n,t,e=t){n.lineCap=R(e.borderCapStyle,t.borderCapStyle),n.setLineDash(R(e.borderDash,t.borderDash)),n.lineDashOffset=R(e.borderDashOffset,t.borderDashOffset),n.lineJoin=R(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=R(e.borderWidth,t.borderWidth),n.strokeStyle=R(e.borderColor,t.borderColor)}function Rg(n,t,e){n.lineTo(e.x,e.y)}function Fg(n){return n.stepped?od:n.tension||n.cubicInterpolationMode==="monotone"?rd:Rg}function _c(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Ng(n,t,e,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=_c(s,e,i),h=Fg(o);let{move:u=!0,reverse:d}=i||{},g,p,b;for(g=0;g<=c;++g)p=s[(a+(d?c-g:g))%r],!p.skip&&(u?(n.moveTo(p.x,p.y),u=!1):h(n,b,p,d,o.stepped),b=p);return l&&(p=s[(a+(d?c:0))%r],h(n,b,p,d,o.stepped)),!!l}function zg(n,t,e,i){const s=t.points,{count:o,start:r,ilen:a}=_c(s,e,i),{move:l=!0,reverse:c}=i||{};let h=0,u=0,d,g,p,b,x,_;const w=T=>(r+(c?a-T:T))%o,k=()=>{b!==x&&(n.lineTo(h,x),n.lineTo(h,b),n.lineTo(h,_))};for(l&&(g=s[w(0)],n.moveTo(g.x,g.y)),d=0;d<=a;++d){if(g=s[w(d)],g.skip)continue;const T=g.x,P=g.y,O=T|0;O===p?(P<b?b=P:P>x&&(x=P),h=(u*h+T)/++u):(k(),n.lineTo(T,P),p=O,u=0,b=x=P),_=P}k()}function eo(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?zg:Ng}function Wg(n){return n.stepped?zd:n.tension||n.cubicInterpolationMode==="monotone"?Wd:Re}function Hg(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),xc(n,t.options),n.stroke(s)}function Yg(n,t,e,i){const{segments:s,options:o}=t,r=eo(t);for(const a of s)xc(n,o,a.style),n.beginPath(),r(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Bg=typeof Path2D=="function";function Vg(n,t,e,i){Bg&&!t.options.segment?Hg(n,t,e,i):Yg(n,t,e,i)}class be extends bt{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||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Cd(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=Xd(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],o=this.points,r=rc(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=Wg(i);let c,h;for(c=0,h=r.length;c<h;++c){const{start:u,end:d}=r[c],g=o[u],p=o[d];if(g===p){a.push(g);continue}const b=Math.abs((s-g[e])/(p[e]-g[e])),x=l(g,p,b,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return eo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=eo(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Vg(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}v(be,"id","line"),v(be,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),v(be,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),v(be,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ma(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class ji extends bt{constructor(e){super();v(this,"parsed");v(this,"skip");v(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(e-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Ma(this,e,"x",i)}inYRange(e,i){return Ma(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Qt(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Zs(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}v(ji,"id","point"),v(ji,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),v(ji,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function wc(n,t){const{x:e,y:i,base:s,width:o,height:r}=n.getProps(["x","y","base","width","height"],t);let a,l,c,h,u;return n.horizontal?(u=r/2,a=Math.min(e,s),l=Math.max(e,s),c=i-u,h=i+u):(u=o/2,a=e-u,l=e+u,c=Math.min(i,s),h=Math.max(i,s)),{left:a,top:c,right:l,bottom:h}}function ye(n,t,e,i){return n?0:pt(t,e,i)}function jg(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Gl(i);return{t:ye(s.top,o.top,0,e),r:ye(s.right,o.right,0,t),b:ye(s.bottom,o.bottom,0,e),l:ye(s.left,o.left,0,t)}}function Xg(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=_e(s),r=Math.min(t,e),a=n.borderSkipped,l=i||W(s);return{topLeft:ye(!l||a.top||a.left,o.topLeft,0,r),topRight:ye(!l||a.top||a.right,o.topRight,0,r),bottomLeft:ye(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:ye(!l||a.bottom||a.right,o.bottomRight,0,r)}}function Ug(n){const t=wc(n),e=t.right-t.left,i=t.bottom-t.top,s=jg(n,e/2,i/2),o=Xg(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Hs(n,t,e,i){const s=t===null,o=e===null,a=n&&!(s&&o)&&wc(n,i);return a&&(s||oe(t,a.left,a.right))&&(o||oe(e,a.top,a.bottom))}function qg(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function $g(n,t){n.rect(t.x,t.y,t.w,t.h)}function Ys(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,r=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+r,radius:n.radius}}class Xi extends bt{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:o,outer:r}=Ug(this),a=qg(r.radius)?on:$g;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Ys(r,e,o)),t.clip(),a(t,Ys(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,Ys(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Hs(this,t,e,i)}inXRange(t,e){return Hs(this,t,null,e)}inYRange(t,e){return Hs(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}v(Xi,"id","bar"),v(Xi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),v(Xi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Gg=Object.freeze({__proto__:null,ArcElement:Fn,BarElement:Xi,LineElement:be,PointElement:ji});const no=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ka=no.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function vc(n){return no[n%no.length]}function Mc(n){return ka[n%ka.length]}function Qg(n,t){return n.borderColor=vc(t),n.backgroundColor=Mc(t),++t}function Zg(n,t){return n.backgroundColor=n.data.map(()=>vc(t++)),t}function Kg(n,t){return n.backgroundColor=n.data.map(()=>Mc(t++)),t}function Jg(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof pe?t=Zg(e,t):s instanceof Vn?t=Kg(e,t):s&&(t=Qg(e,t))}}function Pa(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function tm(n){return n&&(n.borderColor||n.backgroundColor)}function em(){return Z.borderColor!=="rgba(0,0,0,0.1)"||Z.backgroundColor!=="rgba(0,0,0,0.1)"}var nm={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s,r=Pa(i)||tm(s)||o&&Pa(o)||em();if(!e.forceOverride&&r)return;const a=Jg(n);i.forEach(a)}};function im(n,t,e,i,s){const o=s.samples||i;if(o>=e)return n.slice(t,t+e);const r=[],a=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,u,d,g,p,b;for(r[l++]=n[h],u=0;u<o-2;u++){let x=0,_=0,w;const k=Math.floor((u+1)*a)+1+t,T=Math.min(Math.floor((u+2)*a)+1,e)+t,P=T-k;for(w=k;w<T;w++)x+=n[w].x,_+=n[w].y;x/=P,_/=P;const O=Math.floor(u*a)+1+t,C=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:S,y:E}=n[h];for(g=p=-1,w=O;w<C;w++)p=.5*Math.abs((S-x)*(n[w].y-E)-(S-n[w].x)*(_-E)),p>g&&(g=p,d=n[w],b=w);r[l++]=d,h=b}return r[l++]=n[c],r}function sm(n,t,e,i){let s=0,o=0,r,a,l,c,h,u,d,g,p,b;const x=[],_=t+e-1,w=n[t].x,T=n[_].x-w;for(r=t;r<t+e;++r){a=n[r],l=(a.x-w)/T*i,c=a.y;const P=l|0;if(P===h)c<p?(p=c,u=r):c>b&&(b=c,d=r),s=(o*s+a.x)/++o;else{const O=r-1;if(!B(u)&&!B(d)){const C=Math.min(u,d),S=Math.max(u,d);C!==g&&C!==O&&x.push({...n[C],x:s}),S!==g&&S!==O&&x.push({...n[S],x:s})}r>0&&O!==g&&x.push(n[O]),x.push(a),h=P,o=0,p=b=c,u=d=g=r}}return x}function kc(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ta(n){n.data.datasets.forEach(t=>{kc(t)})}function om(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=pt(re(t,o.axis,r).lo,0,e-1)),c?s=pt(re(t,o.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var rm={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Ta(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=n.getDatasetMeta(o),c=r||s.data;if(Ln([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=n.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:u,count:d}=om(l,c);const g=e.threshold||4*i;if(d<=g){kc(s);return}B(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let p;switch(e.algorithm){case"lttb":p=im(c,u,d,i,e);break;case"min-max":p=sm(c,u,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Ta(n)}};function am(n,t,e){const i=n.segments,s=n.points,o=t.points,r=[];for(const a of i){let{start:l,end:c}=a;c=jo(l,c,s);const h=io(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const u=rc(t,h);for(const d of u){const g=io(e,o[d.start],o[d.end],d.loop),p=oc(a,s,g);for(const b of p)r.push({source:b,target:d,start:{[e]:Sa(h,g,"start",Math.max)},end:{[e]:Sa(h,g,"end",Math.min)}})}}return r}function io(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=At(s),o=At(o)),{property:n,start:s,end:o}}function lm(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=jo(r,a,s);const l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function jo(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Sa(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Pc(n,t){let e=[],i=!1;return U(n)?(i=!0,e=n):e=lm(n,t),e.length?new be({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Da(n){return n&&n.fill!==!1}function cm(n,t,e){let s=n[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!J(s))return s;if(r=n[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function hm(n,t,e){const i=gm(n);if(W(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return J(s)&&Math.floor(s)===s?um(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function um(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function dm(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:W(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function fm(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:W(n)?i=n.value:i=t.getBaseValue(),i}function gm(n){const t=n.options,e=t.fill;let i=R(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function mm(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,r=i.points,a=pm(t,e);a.push(Pc({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)bm(s,r[h],a)}return new be({points:s,options:{}})}function pm(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function bm(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=ym(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function ym(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,r=n.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],u=r[h.start][e],d=r[h.end][e];if(oe(s,u,d)){a=s===u,l=s===d;break}}return{first:a,last:l,point:i}}class Tc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:$},t.arc(s,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function xm(n){const{chart:t,fill:e,line:i}=n;if(J(e))return _m(t,e);if(e==="stack")return mm(n);if(e==="shape")return!0;const s=wm(n);return s instanceof Tc?s:Pc(s,i)}function _m(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function wm(n){return(n.scale||{}).getPointPositionForValue?Mm(n):vm(n)}function vm(n){const{scale:t={},fill:e}=n,i=dm(e,t);if(J(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Mm(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=fm(e,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Tc({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function Bs(n,t,e){const i=xm(t),{line:s,scale:o,axis:r}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:u=c}=l||{};i&&s.points.length&&(ii(n,e),km(n,{line:s,target:i,above:h,below:u,area:e,scale:o,axis:r}),si(n))}function km(n,t){const{line:e,target:i,above:s,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&o!==s&&(Oa(n,i,r.top),Ca(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),Oa(n,i,r.bottom)),Ca(n,{line:e,target:i,color:o,scale:a,property:l}),n.restore()}function Oa(n,t,e){const{segments:i,points:s}=t;let o=!0,r=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,h=s[l],u=s[jo(l,c,s)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),r=!!t.pathSegment(n,a,{move:r}),r?n.closePath():n.lineTo(u.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Ca(n,t){const{line:e,target:i,property:s,color:o,scale:r}=t,a=am(e,i,s);for(const{source:l,target:c,start:h,end:u}of a){const{style:{backgroundColor:d=o}={}}=l,g=i!==!0;n.save(),n.fillStyle=d,Pm(n,r,g&&io(s,h,u)),n.beginPath();const p=!!e.pathSegment(n,l);let b;if(g){p?n.closePath():Ea(n,i,u,s);const x=!!i.pathSegment(n,c,{move:p,reverse:!0});b=p&&x,b||Ea(n,i,h,s)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function Pm(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(n.beginPath(),n.rect(r,i,a-r,s-i),n.clip())}function Ea(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Tm={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<i;++r)o=n.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof be&&(l={visible:n.isDatasetVisible(r),index:r,fill:hm(a,r,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=cm(s,r,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&Bs(n.ctx,a,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Da(o)&&Bs(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Da(i)||e.drawTime!=="beforeDatasetDraw"||Bs(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Aa=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Sm=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Ia extends bt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=L(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=it(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Aa(i,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let u=t;o.textAlign="left",o.textBaseline="middle";let d=-1,g=-h;return this.legendItems.forEach((p,b)=>{const x=i+e/2+o.measureText(p.text).width;(b===0||c[c.length-1]+x+2*a>r)&&(u+=h,c[c.length-(b>0?0:1)]=0,g+=h,d++),l[b]={left:0,top:g,row:d,width:x,height:s},c[c.length-1]+=x+a}),u}_fitCols(t,e,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let u=a,d=0,g=0,p=0,b=0;return this.legendItems.forEach((x,_)=>{const{itemWidth:w,itemHeight:k}=Dm(i,e,o,x,s);_>0&&g+k+2*a>h&&(u+=d+a,c.push({width:d,height:g}),p+=d+a,b++,d=g=0),l[_]={left:p,top:g,col:b,width:w,height:k},d=Math.max(d,w),g+=k+a}),u+=d,c.push({width:d,height:g}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=en(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=xt(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=xt(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=xt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=xt(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ii(t,this),this._draw(),si(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Z.color,l=en(t.rtl,this.left,this.width),c=it(r.font),{padding:h}=r,u=c.size,d=u/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:b,itemHeight:x}=Aa(r,u),_=function(O,C,S){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const E=R(S.lineWidth,1);if(s.fillStyle=R(S.fillStyle,a),s.lineCap=R(S.lineCap,"butt"),s.lineDashOffset=R(S.lineDashOffset,0),s.lineJoin=R(S.lineJoin,"miter"),s.lineWidth=E,s.strokeStyle=R(S.strokeStyle,a),s.setLineDash(R(S.lineDash,[])),r.usePointStyle){const I={radius:b*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:E},F=l.xPlus(O,p/2),z=C+d;$l(s,I,F,z,r.pointStyleWidth&&p)}else{const I=C+Math.max((u-b)/2,0),F=l.leftForLtr(O,p),z=_e(S.borderRadius);s.beginPath(),Object.values(z).some(tt=>tt!==0)?on(s,{x:F,y:I,w:p,h:b,radius:z}):s.rect(F,I,p,b),s.fill(),E!==0&&s.stroke()}s.restore()},w=function(O,C,S){Be(s,S.text,O,C+x/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},k=this.isHorizontal(),T=this._computeTitleHeight();k?g={x:xt(o,this.left+h,this.right-i[0]),y:this.top+h+T,line:0}:g={x:this.left+h,y:xt(o,this.top+T+h,this.bottom-e[0].height),line:0},nc(this.ctx,t.textDirection);const P=x+h;this.legendItems.forEach((O,C)=>{s.strokeStyle=O.fontColor,s.fillStyle=O.fontColor;const S=s.measureText(O.text).width,E=l.textAlign(O.textAlign||(O.textAlign=r.textAlign)),I=p+d+S;let F=g.x,z=g.y;l.setWidth(this.width),k?C>0&&F+I+h>this.right&&(z=g.y+=P,g.line++,F=g.x=xt(o,this.left+h,this.right-i[g.line])):C>0&&z+P>this.bottom&&(F=g.x=F+e[g.line].width+h,g.line++,z=g.y=xt(o,this.top+T+h,this.bottom-e[g.line].height));const tt=l.x(F);if(_(tt,z,O),F=$u(E,F+p+d,k?F+I:this.right,t.rtl),w(l.x(F),z,O),k)g.x+=I+h;else if(typeof O.text!="string"){const rt=c.lineHeight;g.y+=Sc(O,rt)+h}else g.y+=P}),ic(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=it(e.font),s=ut(e.padding);if(!e.display)return;const o=en(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=xt(t.align,u,this.right-d);else{const p=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);h=c+xt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=xt(a,u,u+d);r.textAlign=o.textAlign(Lo(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Be(r,e.text,g,h,i)}_computeTitleHeight(){const t=this.options.title,e=it(t.font),i=ut(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(oe(t,this.left,this.right)&&oe(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],oe(t,s.left,s.left+s.width)&&oe(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Em(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Sm(s,i);s&&!o&&L(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&L(e.onHover,[t,i,this],this)}else i&&L(e.onClick,[t,i,this],this)}}function Dm(n,t,e,i,s){const o=Om(i,n,t,e),r=Cm(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Om(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(s).width}function Cm(n,t,e){let i=n;return typeof t.text!="string"&&(i=Sc(t,e)),i}function Sc(n,t){const e=n.text?n.text.length:0;return t*e}function Em(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Am={id:"legend",_element:Ia,start(n,t,e){const i=n.legend=new Ia({ctx:n.ctx,options:e,chart:n});_t.configure(n,i,e),_t.addBox(n,i)},stop(n){_t.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;_t.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=ut(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Xo extends bt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=U(i.text)?i.text.length:1;this._padding=ut(i.padding);const o=s*it(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,h,u;return this.isHorizontal()?(h=xt(a,i,o),u=e+t,c=o-i):(r.position==="left"?(h=i+t,u=xt(a,s,e),l=V*-.5):(h=o-t,u=xt(a,e,s),l=V*.5),c=s-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=it(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Be(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Lo(e.align),textBaseline:"middle",translation:[r,a]})}}function Im(n,t){const e=new Xo({ctx:n.ctx,options:t,chart:n});_t.configure(n,e,t),_t.addBox(n,e),n.titleBlock=e}var Lm={id:"title",_element:Xo,start(n,t,e){Im(n,e)},stop(n){const t=n.titleBlock;_t.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;_t.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ai=new WeakMap;var Rm={id:"subtitle",start(n,t,e){const i=new Xo({ctx:n.ctx,options:e,chart:n});_t.configure(n,i,e),_t.addBox(n,i),Ai.set(n,i)},stop(n){_t.removeBox(n,Ai.get(n)),Ai.delete(n)},beforeUpdate(n,t,e){const i=Ai.get(n);_t.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Nn={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,o=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=n.length;o<r;++o){const l=n[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=sn(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Xt(n,t){return t&&(U(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ie(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class pf{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const o=e.listeners[s],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=lc.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 o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(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((i,s)=>Math.max(i,s._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 oe=new pf;const ga="transparent",bf={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=sa(n||ga),s=i.valid&&sa(t||ga);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class yf{constructor(t,e,i,s){const o=e[i];s=Xn([t.to,s,o,t.from]);const r=Xn([t.from,o,s]);this._active=!0,this._fn=t.fn||bf[t.type||typeof r],this._easing=Zn[t.easing]||Zn.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=r,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],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Xn([t.to,e,s,t.from]),this._from=Xn([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,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){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]()}}class lr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!H(t))return;const e=Object.keys(Z.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!H(o))return;const r={};for(const a of e)r[a]=o[a];(q(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,s=_f(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&xf(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let u=o[c];const d=i.get(c);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[c]=h;continue}o[c]=u=new yf(d,t,c,h),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return oe.add(this._chart,i),!0}}function xf(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function _f(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function ma(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function wf(n,t,e){if(e===!1)return!1;const i=ma(n,e),s=ma(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function vf(n){let t,e,i,s;return H(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function Tc(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function pa(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===e){if(h=!0,i.all)continue;break}c=n.values[l],et(c)&&(o||t===0||Bt(t)===Bt(c))&&(t+=c)}return!h&&!i.all?0:t}function Mf(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",r=Object.keys(n),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[s]:h,[o]:n[h]};return a}function Zs(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function kf(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Pf(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Tf(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function ba(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function ya(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,h=kf(o,r,i),u=t.length;let d;for(let f=0;f<u;++f){const p=t[f],{[l]:b,[c]:x}=p,_=p._stacks||(p._stacks={});d=_[c]=Tf(s,h,b),d[a]=x,d._top=ba(d,r,!0,i.type),d._bottom=ba(d,r,!1,i.type);const w=d._visualValues||(d._visualValues={});w[a]=x}}function Js(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Sf(n,t){return De(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Df(n,t,e){return De(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function In(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const to=n=>n==="reset"||n==="none",xa=(n,t)=>t?n:Object.assign({},n),Of=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Tc(e,!0),values:null};class jt{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.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Zs(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&In(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(u,d,f,p)=>u==="x"?d:u==="r"?p:f,o=e.xAxisID=F(i.xAxisID,Js(t,"x")),r=e.yAxisID=F(i.yAxisID,Js(t,"y")),a=e.rAxisID=F(i.rAxisID,Js(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),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&&ea(this._data,this),t._stacked&&In(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(H(e)){const s=this._cachedMeta;this._data=Mf(e,s)}else if(i!==e){if(i){ea(i,this);const s=this._cachedMeta;In(s),s._parsed=[]}e&&Object.isExtensible(e)&&fd(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 o=e._stacked;e._stacked=Zs(e.vScale,e),e.stack!==i.stack&&(s=!0,In(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&(ya(this,e._parsed),e._stacked=Zs(e.vScale,e))}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,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,u,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{q(s[t])?d=this.parseArrayData(i,s,t,e):H(s[t])?d=this.parseObjectData(i,s,t,e):d=this.parsePrimitiveData(i,s,t,e);const f=()=>u[a]===null||c&&u[a]<c[a];for(h=0;h<e;++h)i._parsed[h+t]=u=d[h],l&&(f()&&(l=!1),c=u);i._sorted=l}r&&ya(this,d)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,u=new Array(s);let d,f,p;for(d=0,f=s;d<f;++d)p=d+i,u[d]={[a]:h||o.parse(c[p],p),[l]:r.parse(e[p],p)};return u}parseArrayData(t,e,i,s){const{xScale:o,yScale:r}=t,a=new Array(s);let l,c,h,u;for(l=0,c=s;l<c;++l)h=l+i,u=e[h],a[l]={x:o.parse(u[0],h),y:r.parse(u[1],h)};return a}parseObjectData(t,e,i,s){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,u,d,f;for(h=0,u=s;h<u;++h)d=h+i,f=e[d],c[h]={x:o.parse(ke(f,a),d),y:r.parse(ke(f,l),d)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Tc(s,!0),values:e._stacks[t.axis]._visualValues};return pa(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let r=o===null?NaN:o;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,r=pa(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),l=Of(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=Pf(a);let d,f;function p(){f=s[d];const b=f[a.axis];return!et(f[t.axis])||h>b||u<b}for(d=0;d<r&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++d);if(o){for(d=r-1;d>=0;--d)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],et(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=vf(F(this.options.clip,wf(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const u=s[h];u.hidden||(u.active&&c?r.push(u):u.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Df(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Sf(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,o}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=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&At(i);if(a)return xa(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=c.getOptionScopes(this.getDataset(),h),f=Object.keys(Z.elements[t]),p=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(d,f,p,u);return b.$shared&&(b.$shared=l,o[r]=Object.freeze(xa(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(d,this.getContext(t,i,e))}const c=new lr(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||to(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,s){to(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!to(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}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[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(o,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&&In(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)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}v(jt,"defaults",{}),v(jt,"datasetElementType",null),v(jt,"dataElementType",null);function Cf(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=ac(i.sort((s,o)=>s-o))}return n._cache.$bar}function Ef(n){const t=n.iScale,e=Cf(t,n.type);let i=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(At(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(s=0,o=e.length;s<o;++s)r=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return i}function Af(n,t,e,i){const s=e.barThickness;let o,r;return V(s)?(o=t.min*e.categoryPercentage,r=e.barPercentage):(o=s*i,r=1),{chunk:o/i,ratio:r,start:t.pixels[n]-o/2}}function If(n,t,e,i){const s=t.pixels,o=s[n];let r=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);const c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/i,ratio:e.barPercentage,start:c}}function Lf(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),r=Math.min(s,o),a=Math.max(s,o);let l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function Sc(n,t,e,i){return q(n)?Lf(n,t,e,i):t[e.axis]=e.parse(n,i),t}function _a(n,t,e,i){const s=n.iScale,o=n.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,u,d;for(c=e,h=e+i;c<h;++c)d=t[c],u={},u[s.axis]=a||s.parse(r[c],c),l.push(Sc(d,u,o,c));return l}function eo(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Rf(n,t,e){return n!==0?Bt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Ff(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function Nf(n,t,e,i){let s=t.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:r,end:a,reverse:l,top:c,bottom:h}=Ff(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=h:(o[wa(h,r,a,l)]=!0,s=c)),o[wa(s,r,a,l)]=!0,n.borderSkipped=o}function wa(n,t,e,i){return i?(n=zf(n,t,e),n=va(n,e,t)):n=va(n,t,e),n}function zf(n,t,e){return n===t?e:n===e?t:n}function va(n,t,e){return n==="start"?t:n==="end"?e:n}function Wf(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class es extends jt{parsePrimitiveData(t,e,i,s){return _a(t,e,i,s)}parseArrayData(t,e,i,s){return _a(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,h=r.axis==="x"?a:l,u=[];let d,f,p,b;for(d=i,f=i+s;d<f;++d)b=e[d],p={},p[o.axis]=o.parse(ke(b,c),d),u.push(Sc(ke(b,h),p,r,d));return u}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const o=i._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,o=this.getParsed(t),r=o._custom,a=eo(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:a}}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 o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s);for(let f=e;f<e+i;f++){const p=this.getParsed(f),b=o||V(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),x=this._calculateBarIndexPixels(f,h),_=(p._stacks||{})[a.axis],w={horizontal:c,base:b.base,enableBorderRadius:!_||eo(p._custom)||r===_._top||r===_._bottom,x:c?b.head:x.center,y:c?x.center:b.head,height:c?x.size:Math.abs(b.size),width:c?Math.abs(b.size):x.size};d&&(w.options=u||this.resolveDataElementOptions(f,t[f].active?"active":s));const k=w.options||t[f].options;Nf(w,k,_,r),Wf(w,k,h.ratio),this.updateElement(t[f],f,w,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=h=>{const u=h._parsed.find(f=>f[i.axis]===l),d=u&&u[h.vScale.axis];if(V(d)||isNaN(d))return!0};for(const h of s)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o<r;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const a=t.barThickness;return{min:a||Ef(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,h=eo(c);let u=l[e.axis],d=0,f=i?this.applyStack(e,l,i):u,p,b;f!==u&&(d=f-u,f=u),h&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&Bt(u)!==Bt(c.barEnd)&&(d=0),d+=u);const x=!V(o)&&!h?o:d;let _=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(d+f):p=_,b=p-_,Math.abs(b)<r){b=Rf(b,e,a)*r,u===a&&(_-=b/2);const w=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),T=Math.min(w,k),P=Math.max(w,k);_=Math.max(Math.min(_,P),T),p=_+b,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(_))}if(_===e.getPixelForValue(a)){const w=Bt(b)*e.getLineWidthForValue(a)/2;_+=w,b-=w}return{size:b,base:_,head:p,center:p+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,r=F(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?If(t,e,s,c):Af(t,e,s,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);a=h.start+h.chunk*u+h.chunk/2,l=Math.min(r,h.chunk*h.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(r,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}v(es,"id","bar"),v(es,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),v(es,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ns extends jt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const o=super.parsePrimitiveData(t,e,i,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+i).radius;return o}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let r=0;r<o.length;r++){const a=e[i+r];o[r]._custom=F(a[2],this.resolveDataElementOptions(r+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let r=0;r<o.length;r++){const a=e[i+r];o[r]._custom=F(a&&a.r&&+a.r,this.resolveDataElementOptions(r+i).radius)}return o}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,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=r.axis,u=a.axis;for(let d=e;d<e+i;d++){const f=t[d],p=!o&&this.getParsed(d),b={},x=b[h]=o?r.getPixelForDecimal(.5):r.getPixelForValue(p[h]),_=b[u]=o?a.getBasePixel():a.getPixelForValue(p[u]);b.skip=isNaN(x)||isNaN(_),c&&(b.options=l||this.resolveDataElementOptions(d,f.active?"active":s),o&&(b.options.radius=0)),this.updateElement(f,d,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=F(i&&i._custom,o),s}}v(ns,"id","bubble"),v(ns,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),v(ns,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Hf(n,t,e){let i=1,s=1,o=0,r=0;if(t<G){const a=n,l=a+t,c=Math.cos(a),h=Math.sin(a),u=Math.cos(l),d=Math.sin(l),f=(k,T,P)=>ai(k,a,l,!0)?1:Math.max(T,T*e,P,P*e),p=(k,T,P)=>ai(k,a,l,!0)?-1:Math.min(T,T*e,P,P*e),b=f(0,c,u),x=f(K,h,d),_=p(j,c,u),w=p(j+K,h,d);i=(b-_)/2,s=(x-w)/2,o=-(b+_)/2,r=-(x+w)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}class ye extends jt{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(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(H(i[t])){const{key:l="value"}=this._parsing;o=c=>+ke(i[c],l)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return ft(this.options.rotation-90)}_getCircumference(){return ft(this.options.circumference)}_getRotationExtents(){let t=G,e=-G;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),e=Math.max(e,o+r)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-r)/2,0),l=Math.min(Ju(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:p,offsetY:b}=Hf(u,h,l),x=(i.width-r)/d,_=(i.height-r)/f,w=Math.max(Math.min(x,_)/2,0),k=ic(this.options.radius,w),T=Math.max(k*l,0),P=(k-T)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=b*k,s.total=this.calculateTotal(),this.outerRadius=k-P*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-P*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/G)}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=o&&c.animateScale,f=d?0:this.innerRadius,p=d?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(e,s);let _=this._getRotation(),w;for(w=0;w<e;++w)_+=this._circumference(w,o);for(w=e;w<e+i;++w){const k=this._circumference(w,o),T=t[w],P={x:h+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+k,circumference:k,outerRadius:p,innerRadius:f};x&&(P.options=b||this.resolveDataElementOptions(w,T.active?"active":s)),_+=k,this.updateElement(T,w,P,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?G*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=_i(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){r=i.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.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(F(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}v(ye,"id","doughnut"),v(ye,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),v(ye,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),v(ye,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class is extends jt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=hc(e,s,r);this._drawStart=a,this._drawCount=l,uc(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),d=r.axis,f=a.axis,{spanGaps:p,segment:b}=this.options,x=Pe(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",w=e+i,k=t.length;let T=e>0&&this.getParsed(e-1);for(let P=0;P<k;++P){const O=t[P],C=_?O:{};if(P<e||P>=w){C.skip=!0;continue}const S=this.getParsed(P),E=V(S[f]),L=C[d]=r.getPixelForValue(S[d],P),N=C[f]=o||E?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,S,l):S[f],P);C.skip=isNaN(L)||isNaN(N)||E,C.stop=P>0&&Math.abs(S[d]-T[d])>x,b&&(C.parsed=S,C.raw=c.data[P]),u&&(C.options=h||this.resolveDataElementOptions(P,O.active?"active":s)),_||this.updateElement(O,P,C,s),T=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}v(is,"id","line"),v(is,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),v(is,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ti extends jt{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||[],o=_i(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return xc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,d=c.getIndexAngle(0)-.5*j;let f=d,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)f+=this._computeAngle(p,s,b);for(p=e;p<e+i;p++){const x=t[p];let _=f,w=f+this._computeAngle(p,s,b),k=r.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=w,o&&(l.animateScale&&(k=0),l.animateRotate&&(_=w=d));const T={x:h,y:u,innerRadius:0,outerRadius:k,startAngle:_,endAngle:w,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,T,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?ft(this.resolveDataElementOptions(t,e).angle||i):0}}v(ti,"id","polarArea"),v(ti,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),v(ti,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class yo extends ye{}v(yo,"id","pie"),v(yo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ss extends jt{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return xc.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),h=o.getPointPositionForValue(a,this.getParsed(a).r),u=r?o.xCenter:h.x,d=r?o.yCenter:h.y,f={x:u,y:d,angle:h.angle,skip:isNaN(u)||isNaN(d),options:c};this.updateElement(l,a,f,s)}}}v(ss,"id","radar"),v(ss,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),v(ss,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class os extends jt{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:r}=hc(e,i,s);if(this._drawStart=o,this._drawCount=r,uc(e)&&(o=0,r=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(h),d=this.includeOptions(s,u),f=r.axis,p=a.axis,{spanGaps:b,segment:x}=this.options,_=Pe(b)?b:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||o||s==="none";let k=e>0&&this.getParsed(e-1);for(let T=e;T<e+i;++T){const P=t[T],O=this.getParsed(T),C=w?P:{},S=V(O[p]),E=C[f]=r.getPixelForValue(O[f],T),L=C[p]=o||S?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,O,l):O[p],T);C.skip=isNaN(E)||isNaN(L)||S,C.stop=T>0&&Math.abs(O[f]-k[f])>_,x&&(C.parsed=O,C.raw=c.data[T]),d&&(C.options=u||this.resolveDataElementOptions(T,P.active?"active":s)),w||this.updateElement(P,T,C,s),k=O}this.updateSharedOptions(u,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}}v(os,"id","scatter"),v(os,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),v(os,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Bf=Object.freeze({__proto__:null,BarController:es,BubbleController:ns,DoughnutController:ye,LineController:is,PieController:yo,PolarAreaController:ti,RadarController:ss,ScatterController:os});function Re(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class cr{constructor(t){v(this,"options");this.options=t||{}}static override(t){Object.assign(cr.prototype,t)}init(){}formats(){return Re()}parse(){return Re()}format(){return Re()}add(){return Re()}diff(){return Re()}startOf(){return Re()}endOf(){return Re()}}var Dc={_date:cr};function Yf(n,t,e,i){const{controller:s,data:o,_sorted:r}=n,a=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?ud:ce;if(i){if(s._sharedOptions){const h=o[0],u=typeof h.getRange=="function"&&h.getRange(t);if(u){const d=c(o,t,e-u),f=c(o,t,e+u);return{lo:d.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:u}=s._cachedMeta,{_parsed:d}=n,f=d.slice(0,h.lo+1).reverse().findIndex(b=>!V(b[u.axis]));h.lo-=Math.max(0,f);const p=d.slice(h.hi).findIndex(b=>!V(b[u.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function Ds(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:u,hi:d}=Yf(o[a],t,r,s);for(let f=u;f<=d;++f){const p=h[f];p.skip||i(p,c,f)}}}function Vf(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,r=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function no(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||Ds(n,e,t,function(a,l,c){!s&&!Jt(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function jf(n,t,e,i){let s=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:u}=ps(r,{x:t.x,y:t.y});ai(u,c,h)&&s.push({element:r,datasetIndex:a,index:l})}return Ds(n,e,t,o),s}function Xf(n,t,e,i,s,o){let r=[];const a=Vf(e);let l=Number.POSITIVE_INFINITY;function c(h,u,d){const f=h.inRange(t.x,t.y,s);if(i&&!f)return;const p=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(p))&&!f)return;const x=a(t,p);x<l?(r=[{element:h,datasetIndex:u,index:d}],l=x):x===l&&r.push({element:h,datasetIndex:u,index:d})}return Ds(n,e,t,c),r}function io(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?jf(n,t,e,s):Xf(n,t,e,i,s,o)}function Ma(n,t,e,i,s){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Ds(n,e,t,(l,c,h)=>{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Uf={modes:{index(n,t,e,i){const s=Qt(t,n),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?no(n,s,o,i,r):io(n,s,o,!1,i,r),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(n,t,e,i){const s=Qt(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?no(n,s,o,i,r):io(n,s,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(n,t,e,i){const s=Qt(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return no(n,s,o,i,r)},nearest(n,t,e,i){const s=Qt(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return io(n,s,o,e.intersect,i,r)},x(n,t,e,i){const s=Qt(t,n);return Ma(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Qt(t,n);return Ma(n,s,"y",e.intersect,i)}}};const Oc=["left","top","right","bottom"];function Ln(n,t){return n.filter(e=>e.pos===t)}function ka(n,t){return n.filter(e=>Oc.indexOf(e.pos)===-1&&e.box.axis===t)}function Rn(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function qf(n){const t=[];let e,i,s,o,r,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function $f(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!Oc.includes(s))continue;const r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Gf(n,t){const e=$f(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,r,a;for(o=0,r=n.length;o<r;++o){a=n[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=h?h*s:l&&t.availableHeight)}return e}function Qf(n){const t=qf(n),e=Rn(t.filter(c=>c.box.fullSize),!0),i=Rn(Ln(t,"left"),!0),s=Rn(Ln(t,"right")),o=Rn(Ln(t,"top"),!0),r=Rn(Ln(t,"bottom")),a=ka(t,"x"),l=ka(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Ln(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Pa(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Cc(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function Kf(n,t,e,i){const{pos:s,box:o}=e,r=n.maxPadding;if(!H(s)){e.size&&(n[s]-=e.size);const u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,n[s]+=e.size}o.getPadding&&Cc(r,o.getPadding());const a=Math.max(0,t.outerWidth-Pa(r,n,"left","right")),l=Math.max(0,t.outerHeight-Pa(r,n,"top","bottom")),c=a!==n.w,h=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Zf(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Jf(n,t){const e=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(n?["left","right"]:["top","bottom"])}function Un(n,t,e,i){const s=[];let o,r,a,l,c,h;for(o=0,r=n.length,c=0;o<r;++o){a=n[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Jf(a.horizontal,t));const{same:u,other:d}=Kf(t,e,a,i);c|=u&&s.length,h=h||d,l.fullSize||s.push(a)}return c&&Un(s,t,e,i)||h}function Xi(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Ta(n,t,e,i){const s=e.padding;let{x:o,y:r}=t;for(const a of n){const l=a.box,c=i[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const u=t.w*h,d=c.size||l.height;At(c.start)&&(r=c.start),l.fullSize?Xi(l,s.left,r,e.outerWidth-s.right-s.left,d):Xi(l,t.left+c.placed,r,u,d),c.start=r,c.placed+=u,r=l.bottom}else{const u=t.h*h,d=c.size||l.width;At(c.start)&&(o=c.start),l.fullSize?Xi(l,o,s.top,d,e.outerHeight-s.bottom-s.top):Xi(l,o,t.top+c.placed,d,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=r}var vt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=gt(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=Qf(n.boxes),l=a.vertical,c=a.horizontal;Y(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const h=l.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),d=Object.assign({},s);Cc(d,gt(i));const f=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),p=Gf(l.concat(c),u);Un(a.fullSize,f,u,p),Un(l,f,u,p),Un(c,f,u,p)&&Un(l,f,u,p),Zf(f),Ta(a.leftAndTop,f,u,p),f.x+=f.w,f.y+=f.h,Ta(a.rightAndBottom,f,u,p),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Y(a.chartArea,b=>{const x=b.box;Object.assign(x,n.chartArea),x.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Ec{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 tg extends Ec{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rs="$chartjs",eg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Sa=n=>n===null||n==="";function ng(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[rs]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Sa(s)){const o=ha(n,"width");o!==void 0&&(n.width=o)}if(Sa(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=ha(n,"height");o!==void 0&&(n.height=o)}return n}const Ac=of?{passive:!0}:!1;function ig(n,t,e){n&&n.addEventListener(t,e,Ac)}function sg(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Ac)}function og(n,t){const e=eg[n.type]||n.type,{x:i,y:s}=Qt(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function xs(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function rg(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||xs(a.addedNodes,i),r=r&&!xs(a.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function ag(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||xs(a.removedNodes,i),r=r&&!xs(a.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const li=new Map;let Da=0;function Ic(){const n=window.devicePixelRatio;n!==Da&&(Da=n,li.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function lg(n,t){li.size||window.addEventListener("resize",Ic),li.set(n,t)}function cg(n){li.delete(n),li.size||window.removeEventListener("resize",Ic)}function hg(n,t,e){const i=n.canvas,s=i&&ar(i);if(!s)return;const o=cc((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),lg(n,o),r}function so(n,t,e){e&&e.disconnect(),t==="resize"&&cg(n)}function ug(n,t,e){const i=n.canvas,s=cc(o=>{n.ctx!==null&&e(og(o,n))},n);return ig(i,t,s),s}class dg extends Ec{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ng(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[rs])return!1;const i=e[rs].initial;["height","width"].forEach(o=>{const r=i[o];V(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[rs],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:rg,detach:ag,resize:hg}[e]||ug;s[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:so,detach:so,resize:so}[e]||sg)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return sf(t,e,i,s)}isAttached(t){const e=t&&ar(t);return!!(e&&e.isConnected)}}function fg(n){return!rr()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?tg:dg}class xt{constructor(){v(this,"x");v(this,"y");v(this,"active",!1);v(this,"options");v(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Pe(this.x)&&Pe(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}v(xt,"defaults",{}),v(xt,"defaultRoutes");function gg(n,t){const e=n.options.ticks,i=mg(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?bg(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return yg(t,c,o,r/s),c;const h=pg(o,t,s);if(r>0){let u,d;const f=r>1?Math.round((l-a)/(r-1)):null;for(Ui(t,c,h,V(f)?0:a-f,a),u=0,d=r-1;u<d;u++)Ui(t,c,h,o[u],o[u+1]);return Ui(t,c,h,l,V(f)?t.length:l+f),c}return Ui(t,c,h),c}function mg(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function pg(n,t,e){const i=xg(n),s=t.length/e;if(!i)return Math.max(s,1);const o=rd(i);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>s)return l}return Math.max(s,1)}function bg(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function yg(n,t,e,i){let s=0,o=e[0],r;for(i=Math.ceil(i),r=0;r<n.length;r++)r===o&&(t.push(n[r]),s++,o=e[s*i])}function Ui(n,t,e,i,s){const o=F(i,0),r=Math.min(F(s,n.length),n.length);let a=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(n[c]),a++,h=Math.round(o+a*e))}function xg(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const _g=n=>n==="left"?"right":n==="right"?"left":n,Oa=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Ca=(n,t)=>Math.min(t||n,n);function Ea(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function wg(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,r-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function vg(n,t){Y(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function Fn(n){return n.drawTicks?n.tickLength:0}function Aa(n,t){if(!n.display)return 0;const e=ot(n.font,t),i=gt(n.padding);return(q(n.text)?n.text.length:1)*e.lineHeight+i.height}function Mg(n,t){return De(n,{scale:t,type:"scale"})}function kg(n,t,e){return De(n,{tick:e,index:t,type:"tick"})}function Pg(n,t,e){let i=tr(n);return(e&&t!=="right"||!e&&t==="right")&&(i=_g(i)),i}function Tg(n,t,e,i){const{top:s,left:o,bottom:r,right:a,chart:l}=n,{chartArea:c,scales:h}=l;let u=0,d,f,p;const b=r-s,x=a-o;if(n.isHorizontal()){if(f=wt(i,o,a),H(e)){const _=Object.keys(e)[0],w=e[_];p=h[_].getPixelForValue(w)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=Oa(n,e,t);d=a-o}else{if(H(e)){const _=Object.keys(e)[0],w=e[_];f=h[_].getPixelForValue(w)-x+t}else e==="center"?f=(c.left+c.right)/2-x+t:f=Oa(n,e,t);p=wt(i,r,s),u=e==="left"?-K:K}return{titleX:f,titleY:p,maxWidth:d,rotation:u}}class Qe extends xt{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=Lt(t,Number.POSITIVE_INFINITY),e=Lt(e,Number.NEGATIVE_INFINITY),i=Lt(i,Number.POSITIVE_INFINITY),s=Lt(s,Number.NEGATIVE_INFINITY),{min:Lt(t,i),max:Lt(e,s),minDefined:et(t),maxDefined:et(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,r.min)),o||(i=Math.max(i,r.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:Lt(e,Lt(i,e)),max:Lt(i,Lt(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){R(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.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=Rd(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Ea(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=gg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){R(this.options.afterUpdate,[this])}beforeSetDimensions(){R(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(){R(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),R(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){R(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=R(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){R(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){R(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Ca(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let r=s,a,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=yt(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),u+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-Fn(t.grid)-e.padding-Aa(t.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),r=Ps(Math.min(Math.asin(yt((h.highest.height+6)/a,-1,1)),Math.asin(yt(l/c,-1,1))-Math.asin(yt(d/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){R(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){R(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Aa(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Fn(o)+l):(t.height=this.maxHeight,t.width=Fn(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:d}=this._getLabelSizes(),f=i.padding*2,p=ft(this.labelRotation),b=Math.cos(p),x=Math.sin(p);if(a){const _=i.mirror?0:x*u.width+b*d.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=i.mirror?0:b*u.width+x*d.height;t.width=Math.min(this.maxWidth,t.width+_+f)}this._calculatePadding(c,h,x,b)}}this._handleMargins(),a?(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:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,f=0;l?c?(d=s*t.width,f=i*e.height):(d=i*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,f=e.width/2),this.paddingLeft=Math.max((d-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-u+r)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;o==="start"?(h=0,u=t.height):o==="end"&&(h=e.height,u=0),this.paddingTop=h+r,this.paddingBottom=u+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){R(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)V(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=Ea(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Ca(e,i));let c=0,h=0,u,d,f,p,b,x,_,w,k,T,P;for(u=0;u<e;u+=l){if(p=t[u].label,b=this._resolveTickFontOptions(u),s.font=x=b.string,_=o[x]=o[x]||{data:{},gc:[]},w=b.lineHeight,k=T=0,!V(p)&&!q(p))k=bs(s,_.data,_.gc,k,p),T=w;else if(q(p))for(d=0,f=p.length;d<f;++d)P=p[d],!V(P)&&!q(P)&&(k=bs(s,_.data,_.gc,k,P),T+=w);r.push(k),a.push(T),c=Math.max(k,c),h=Math.max(T,h)}vg(o,e);const O=r.indexOf(c),C=a.indexOf(h),S=E=>({width:r[E]||0,height:a[E]||0});return{first:S(0),last:S(e-1),widest:S(O),highest:S(C),widths:r,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 hd(this._alignToPixels?Le(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=kg(this.getContext(),t,i))}return this.$context||(this.$context=Mg(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ft(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),d=Fn(o),f=[],p=a.setContext(this.getContext()),b=p.display?p.width:0,x=b/2,_=function(Q){return Le(i,Q,b)};let w,k,T,P,O,C,S,E,L,N,W,nt;if(r==="top")w=_(this.bottom),C=this.bottom-d,E=w-x,N=_(t.top)+x,nt=t.bottom;else if(r==="bottom")w=_(this.top),N=t.top,nt=_(t.bottom)-x,C=w+x,E=this.top+d;else if(r==="left")w=_(this.right),O=this.right-d,S=w-x,L=_(t.left)+x,W=t.right;else if(r==="right")w=_(this.left),L=t.left,W=_(t.right)-x,O=w+x,S=this.left+d;else if(e==="x"){if(r==="center")w=_((t.top+t.bottom)/2+.5);else if(H(r)){const Q=Object.keys(r)[0],J=r[Q];w=_(this.chart.scales[Q].getPixelForValue(J))}N=t.top,nt=t.bottom,C=w+x,E=C+d}else if(e==="y"){if(r==="center")w=_((t.left+t.right)/2);else if(H(r)){const Q=Object.keys(r)[0],J=r[Q];w=_(this.chart.scales[Q].getPixelForValue(J))}O=w-x,S=O-d,L=t.left,W=t.right}const lt=F(s.ticks.maxTicksLimit,u),U=Math.max(1,Math.ceil(u/lt));for(k=0;k<u;k+=U){const Q=this.getContext(k),J=o.setContext(Q),It=a.setContext(Q),mt=J.lineWidth,ue=J.color,nn=It.dash||[],Ft=It.dashOffset,Oe=J.tickWidth,Yt=J.tickColor,Ce=J.tickBorderDash||[],ee=J.tickBorderDashOffset;T=wg(this,k,l),T!==void 0&&(P=Le(i,T,mt),c?O=S=L=W=P:C=E=N=nt=P,f.push({tx1:O,ty1:C,tx2:S,ty2:E,x1:L,y1:N,x2:W,y2:nt,width:mt,color:ue,borderDash:nn,borderDashOffset:Ft,tickWidth:Oe,tickColor:Yt,tickBorderDash:Ce,tickBorderDashOffset:ee}))}return this._ticksLength=u,this._borderValue=w,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=o,d=Fn(i.grid),f=d+h,p=u?-h:f,b=-ft(this.labelRotation),x=[];let _,w,k,T,P,O,C,S,E,L,N,W,nt="middle";if(s==="top")O=this.bottom-p,C=this._getXAxisLabelAlignment();else if(s==="bottom")O=this.top+p,C=this._getXAxisLabelAlignment();else if(s==="left"){const U=this._getYAxisLabelAlignment(d);C=U.textAlign,P=U.x}else if(s==="right"){const U=this._getYAxisLabelAlignment(d);C=U.textAlign,P=U.x}else if(e==="x"){if(s==="center")O=(t.top+t.bottom)/2+f;else if(H(s)){const U=Object.keys(s)[0],Q=s[U];O=this.chart.scales[U].getPixelForValue(Q)+f}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")P=(t.left+t.right)/2-f;else if(H(s)){const U=Object.keys(s)[0],Q=s[U];P=this.chart.scales[U].getPixelForValue(Q)}C=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(l==="start"?nt="top":l==="end"&&(nt="bottom"));const lt=this._getLabelSizes();for(_=0,w=a.length;_<w;++_){k=a[_],T=k.label;const U=o.setContext(this.getContext(_));S=this.getPixelForTick(_)+o.labelOffset,E=this._resolveTickFontOptions(_),L=E.lineHeight,N=q(T)?T.length:1;const Q=N/2,J=U.color,It=U.textStrokeColor,mt=U.textStrokeWidth;let ue=C;r?(P=S,C==="inner"&&(_===w-1?ue=this.options.reverse?"left":"right":_===0?ue=this.options.reverse?"right":"left":ue="center"),s==="top"?c==="near"||b!==0?W=-N*L+L/2:c==="center"?W=-lt.highest.height/2-Q*L+L:W=-lt.highest.height+L/2:c==="near"||b!==0?W=L/2:c==="center"?W=lt.highest.height/2-Q*L:W=lt.highest.height-N*L,u&&(W*=-1),b!==0&&!U.showLabelBackdrop&&(P+=L/2*Math.sin(b))):(O=S,W=(1-N)*L/2);let nn;if(U.showLabelBackdrop){const Ft=gt(U.backdropPadding),Oe=lt.heights[_],Yt=lt.widths[_];let Ce=W-Ft.top,ee=0-Ft.left;switch(nt){case"middle":Ce-=Oe/2;break;case"bottom":Ce-=Oe;break}switch(C){case"center":ee-=Yt/2;break;case"right":ee-=Yt;break;case"inner":_===w-1?ee-=Yt:_>0&&(ee-=Yt/2);break}nn={left:ee,top:Ce,width:Yt+Ft.width,height:Oe+Ft.height,color:U.backdropColor}}x.push({label:T,font:E,textOffset:W,options:{rotation:b,color:J,strokeColor:It,strokeWidth:mt,textAlign:ue,textBaseline:nt,translation:[P,O],backdrop:nn}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){const l=s[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,u,d;this.isHorizontal()?(c=Le(t,this.left,r)-r/2,h=Le(t,this.right,a)+a/2,u=d=l):(u=Le(t,this.top,r)-r/2,d=Le(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,u),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&wi(i,s);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;$e(i,c,0,h,l,a)}s&&vi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=ot(i.font),r=gt(i.padding),a=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||H(e)?(l+=r.bottom,q(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:u,rotation:d}=Tg(this,l,e,a);$e(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:d,textAlign:Pg(a,e,s),textBaseline:"middle",translation:[c,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=F(t.grid&&t.grid.z,-1),s=F(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Qe.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];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 ot(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class qi{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;Og(e)&&(i=this.register(e));const s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Sg(t,r,i),this.override&&Z.override(t.id,t.overrides)),r}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 Z[s]&&(delete Z[s][i],this.override&&delete qe[i])}}function Sg(n,t,e){const i=ri(Object.create(null),[e?Z.get(e):{},Z.get(t),n.defaults]);Z.set(t,i),n.defaultRoutes&&Dg(t,n.defaultRoutes),n.descriptors&&Z.describe(t,n.descriptors)}function Dg(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");Z.route(o,s,l,a)})}function Og(n){return"id"in n&&"defaults"in n}class Cg{constructor(){this.controllers=new qi(jt,"datasets",!0),this.elements=new qi(xt,"elements"),this.plugins=new qi(Object,"plugins"),this.scales=new qi(Qe,"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(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Y(s,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const s=Ko(t);R(i["before"+s],[],i),e[t](i),R(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(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Gt=new Cg;class Eg{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,i,s){s=s||{};for(const o of t){const r=o.plugin,a=r[i],l=[e,s,o.options];if(R(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){V(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=F(i.options&&i.options.plugins,{}),o=Ag(i);return s===!1&&!e?[]:Lg(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Ag(n){const t={},e=[],i=Object.keys(Gt.plugins.items);for(let o=0;o<i.length;o++)e.push(Gt.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Ig(n,t){return!t&&n===!1?null:n===!0?{}:n}function Lg(n,{plugins:t,localIds:e},i,s){const o=[],r=n.getContext();for(const a of t){const l=a.id,c=Ig(i[l],s);c!==null&&o.push({plugin:a,options:Rg(n.config,{plugin:a,local:e[l]},c,r)})}return o}function Rg(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),r=n.getOptionScopes(i,o);return e&&t.defaults&&r.push(t.defaults),n.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function xo(n,t){const e=Z.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Fg(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Ng(n,t){return n===t?"_index_":"_value_"}function Ia(n){if(n==="x"||n==="y"||n==="r")return n}function zg(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function _o(n,...t){if(Ia(n))return n;for(const e of t){const i=e.axis||zg(e.position)||n.length>1&&Ia(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function La(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Wg(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return La(n,"x",e[0])||La(n,"y",e[0])}return{}}function Hg(n,t){const e=qe[n.type]||{scales:{}},i=t.scales||{},s=xo(n.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!H(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=_o(r,a,Wg(r,n),Z.scales[a.type]),c=Ng(l,s),h=e.scales||{};o[r]=Kn(Object.create(null),[{axis:l},a,h[l],h[c]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,l=r.indexAxis||xo(a,t),h=(qe[a]||{}).scales||{};Object.keys(h).forEach(u=>{const d=Fg(u,l),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),Kn(o[f],[{axis:d},i[f],h[u]])})}),Object.keys(o).forEach(r=>{const a=o[r];Kn(a,[Z.scales[a.type],Z.scale])}),o}function Lc(n){const t=n.options||(n.options={});t.plugins=F(t.plugins,{}),t.scales=Hg(n,t)}function Rc(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Bg(n){return n=n||{},n.data=Rc(n.data),Lc(n),n}const Ra=new Map,Fc=new Set;function $i(n,t){let e=Ra.get(n);return e||(e=t(),Ra.set(n,e),Fc.add(e)),e}const Nn=(n,t,e)=>{const i=ke(t,e);i!==void 0&&n.add(i)};class Yg{constructor(t){this._config=Bg(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=Rc(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(),Lc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $i(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return $i(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return $i(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return $i(`${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:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Nn(l,t,u))),h.forEach(u=>Nn(l,s,u)),h.forEach(u=>Nn(l,qe[o]||{},u)),h.forEach(u=>Nn(l,Z,u)),h.forEach(u=>Nn(l,po,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Fc.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,qe[e]||{},Z.datasets[e]||{},{type:e},Z,po]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Fa(this._resolverCache,t,s);let l=r;if(jg(r,e)){o.$shared=!1,i=Et(i)?i():i;const c=this.createResolver(t,i,a);l=pn(r,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Fa(this._resolverCache,t,i);return H(e)?pn(o,e,void 0,s):o}}function Fa(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);return o||(o={resolver:ir(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}const Vg=n=>H(n)&&Object.getOwnPropertyNames(n).some(t=>Et(n[t]));function jg(n,t){const{isScriptable:e,isIndexable:i}=mc(n);for(const s of t){const o=e(s),r=i(s),a=(r||o)&&n[s];if(o&&(Et(a)||Vg(a))||r&&q(a))return!0}return!1}var Xg="4.4.8";const Ug=["top","bottom","left","right","chartArea"];function Na(n,t){return n==="top"||n==="bottom"||Ug.indexOf(n)===-1&&t==="x"}function za(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Wa(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),R(e&&e.onComplete,[n],t)}function qg(n){const t=n.chart,e=t.options.animation;R(e&&e.onProgress,[n],t)}function Nc(n){return rr()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const as={},Ha=n=>{const t=Nc(n);return Object.values(as).filter(e=>e.canvas===t).pop()};function $g(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r)}}}function Gg(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Gi(n,t,e){return n.options.clip?n[e]:t[e]}function Qg(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Gi(e,t,"left"),right:Gi(e,t,"right"),top:Gi(i,t,"top"),bottom:Gi(i,t,"bottom")}:t}class Pt{static register(...t){Gt.add(...t),Ba()}static unregister(...t){Gt.remove(...t),Ba()}constructor(t,e){const i=this.config=new Yg(e),s=Nc(t),o=Ha(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||fg(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Zu(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Eg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=gd(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],as[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}oe.listen(this,"complete",Wa),oe.listen(this,"progress",qg),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return V(t)?e&&o?o: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}get registry(){return Gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ca(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ra(this.canvas,this.ctx),this}stop(){return oe.stop(this),this}resize(t,e){oe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ca(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),R(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Y(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=_o(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),Y(o,r=>{const a=r.options,l=a.id,c=_o(l,a),h=F(a.type,r.dtype);(a.position===void 0||Na(a.position,c)!==Na(r.dposition))&&(a.position=r.dposition),s[l]=!0;let u=null;if(l in i&&i[l].type===h)u=i[l];else{const d=Gt.getScale(h);u=new d({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),Y(s,(r,a)=>{r||delete i[a]}),Y(i,r=>{vt.configure(this,r,r.options),vt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(za("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let r=this.getDatasetMeta(i);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(i),r=this.getDatasetMeta(i)),r.type=a,r.indexAxis=o.indexAxis||xo(a,this.options),r.order=o.order||0,r.index=i,r.label=""+o.label,r.visible=this.isDatasetVisible(i),r.controller)r.controller.updateIndex(i),r.controller.linkScales();else{const l=Gt.getController(a),{datasetElementType:c,dataElementType:h}=Z.datasets[a];Object.assign(l,{dataElementType:Gt.getElement(h),datasetElementType:c&&Gt.getElement(c)}),r.controller=new l(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){Y(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()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),d=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(d),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=i.layout.autoPadding?r:0,this._updateLayout(r),s||Y(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(za("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Y(this.scales,t=>{vt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Zr(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e){const r=i==="_removeElements"?-o:o;$g(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!Zr(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Y(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Et(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};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(oe.has(this)?this.attached&&!oe.running(this)&&oe.start(this):(this.draw(),Wa({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)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,o;for(s=0,o=e.length;s<o;++s){const r=e[s];(!t||r.visible)&&i.push(r)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)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,o=Qg(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&wi(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&vi(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Jt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Uf.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._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=De(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 typeof i.hidden=="boolean"?!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",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);At(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.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(),oe.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ra(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete as[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};Y(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){Y(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Y(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!ds(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),l=sd(t),c=Gg(t,this._lastEvent,i,l);i&&(this._lastEvent=null,R(o.onHover,[t,a,this],this),l&&R(o.onClick,[t,a,this],this));const h=!ds(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}v(Pt,"defaults",Z),v(Pt,"instances",as),v(Pt,"overrides",qe),v(Pt,"registry",Gt),v(Pt,"version",Xg),v(Pt,"getChart",Ha);function Ba(){return Y(Pt.instances,n=>n._plugins.invalidate())}function Kg(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(o,r,a,i-c,e+c),l>s?(c=s/l,n.arc(o,r,l,e+c,i-c,!0)):n.arc(o,r,s,e+K,i-K),n.closePath(),n.clip()}function Zg(n){return nr(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Jg(n,t,e,i){const s=Zg(n.options.borderRadius),o=(e-t)/2,r=Math.min(o,i*t/2),a=l=>{const c=(e-Math.min(o,l))*i/2;return yt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:yt(s.innerStart,0,r),innerEnd:yt(s.innerEnd,0,r)}}function rn(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function _s(n,t,e,i,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+i+e-c,0),d=h>0?h+i+e+c:0;let f=0;const p=s-l;if(i){const U=h>0?h-i:0,Q=u>0?u-i:0,J=(U+Q)/2,It=J!==0?p*J/(J+i):p;f=(p-It)/2}const b=Math.max(.001,p*u-e/j)/u,x=(p-b)/2,_=l+x+f,w=s-x-f,{outerStart:k,outerEnd:T,innerStart:P,innerEnd:O}=Jg(t,d,u,w-_),C=u-k,S=u-T,E=_+k/C,L=w-T/S,N=d+P,W=d+O,nt=_+P/N,lt=w-O/W;if(n.beginPath(),o){const U=(E+L)/2;if(n.arc(r,a,u,E,U),n.arc(r,a,u,U,L),T>0){const mt=rn(S,L,r,a);n.arc(mt.x,mt.y,T,L,w+K)}const Q=rn(W,w,r,a);if(n.lineTo(Q.x,Q.y),O>0){const mt=rn(W,lt,r,a);n.arc(mt.x,mt.y,O,w+K,lt+Math.PI)}const J=(w-O/d+(_+P/d))/2;if(n.arc(r,a,d,w-O/d,J,!0),n.arc(r,a,d,J,_+P/d,!0),P>0){const mt=rn(N,nt,r,a);n.arc(mt.x,mt.y,P,nt+Math.PI,_-K)}const It=rn(C,_,r,a);if(n.lineTo(It.x,It.y),k>0){const mt=rn(C,E,r,a);n.arc(mt.x,mt.y,k,_-K,E)}}else{n.moveTo(r,a);const U=Math.cos(E)*u+r,Q=Math.sin(E)*u+a;n.lineTo(U,Q);const J=Math.cos(L)*u+r,It=Math.sin(L)*u+a;n.lineTo(J,It)}n.closePath()}function tm(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){_s(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(a)||(l=r+(a%G||G))}return _s(n,t,e,i,l,s),n.fill(),l}function em(n,t,e,i,s){const{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:d}=l,f=l.borderAlign==="inner";if(!c)return;n.setLineDash(u||[]),n.lineDashOffset=d,f?(n.lineWidth=c*2,n.lineJoin=h||"round"):(n.lineWidth=c,n.lineJoin=h||"bevel");let p=t.endAngle;if(o){_s(n,t,e,i,p,s);for(let b=0;b<o;++b)n.stroke();isNaN(a)||(p=r+(a%G||G))}f&&Kg(n,t,p),o||(_s(n,t,e,i,p,s),n.stroke())}class qn extends xt{constructor(e){super();v(this,"circumference");v(this,"endAngle");v(this,"fullCircles");v(this,"innerRadius");v(this,"outerRadius");v(this,"pixelMargin");v(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.getProps(["x","y"],s),{angle:r,distance:a}=ps(o,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,p=F(d,c-l),b=ai(r,l,c)&&l!==c,x=p>=G||b,_=le(a,h+f,u+f);return x&&_}getCenterPoint(e){const{x:i,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,u=(o+r)/2,d=(a+l+h+c)/2;return{x:i+Math.cos(u)*d,y:s+Math.sin(u)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,o=(i.offset||0)/4,r=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>G?Math.floor(s/G):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(j,s||0)),h=o*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,tm(e,this,h,r,a),em(e,this,h,r,a),e.restore()}}v(qn,"id","arc"),v(qn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),v(qn,"defaultRoutes",{backgroundColor:"backgroundColor"}),v(qn,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function zc(n,t,e=t){n.lineCap=F(e.borderCapStyle,t.borderCapStyle),n.setLineDash(F(e.borderDash,t.borderDash)),n.lineDashOffset=F(e.borderDashOffset,t.borderDashOffset),n.lineJoin=F(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=F(e.borderWidth,t.borderWidth),n.strokeStyle=F(e.borderColor,t.borderColor)}function nm(n,t,e){n.lineTo(e.x,e.y)}function im(n){return n.stepped?Td:n.tension||n.cubicInterpolationMode==="monotone"?Sd:nm}function Wc(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function sm(n,t,e,i){const{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Wc(s,e,i),h=im(o);let{move:u=!0,reverse:d}=i||{},f,p,b;for(f=0;f<=c;++f)p=s[(a+(d?c-f:f))%r],!p.skip&&(u?(n.moveTo(p.x,p.y),u=!1):h(n,b,p,d,o.stepped),b=p);return l&&(p=s[(a+(d?c:0))%r],h(n,b,p,d,o.stepped)),!!l}function om(n,t,e,i){const s=t.points,{count:o,start:r,ilen:a}=Wc(s,e,i),{move:l=!0,reverse:c}=i||{};let h=0,u=0,d,f,p,b,x,_;const w=T=>(r+(c?a-T:T))%o,k=()=>{b!==x&&(n.lineTo(h,x),n.lineTo(h,b),n.lineTo(h,_))};for(l&&(f=s[w(0)],n.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[w(d)],f.skip)continue;const T=f.x,P=f.y,O=T|0;O===p?(P<b?b=P:P>x&&(x=P),h=(u*h+T)/++u):(k(),n.lineTo(T,P),p=O,u=0,b=x=P),_=P}k()}function wo(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?om:sm}function rm(n){return n.stepped?rf:n.tension||n.cubicInterpolationMode==="monotone"?af:Ne}function am(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),zc(n,t.options),n.stroke(s)}function lm(n,t,e,i){const{segments:s,options:o}=t,r=wo(t);for(const a of s)zc(n,o,a.style),n.beginPath(),r(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const cm=typeof Path2D=="function";function hm(n,t,e,i){cm&&!t.options.segment?am(n,t,e,i):lm(n,t,e,i)}class xe extends xt{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||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Kd(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=ff(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],o=this.points,r=Pc(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=rm(i);let c,h;for(c=0,h=r.length;c<h;++c){const{start:u,end:d}=r[c],f=o[u],p=o[d];if(f===p){a.push(f);continue}const b=Math.abs((s-f[e])/(p[e]-f[e])),x=l(f,p,b,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return wo(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=wo(this);let r=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),hm(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}v(xe,"id","line"),v(xe,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),v(xe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),v(xe,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ya(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class ls extends xt{constructor(e){super();v(this,"parsed");v(this,"skip");v(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(e-r,2)+Math.pow(i-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return Ya(this,e,"x",i)}inYRange(e,i){return Ya(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Jt(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,bo(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}v(ls,"id","point"),v(ls,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),v(ls,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hc(n,t){const{x:e,y:i,base:s,width:o,height:r}=n.getProps(["x","y","base","width","height"],t);let a,l,c,h,u;return n.horizontal?(u=r/2,a=Math.min(e,s),l=Math.max(e,s),c=i-u,h=i+u):(u=o/2,a=e-u,l=e+u,c=Math.min(i,s),h=Math.max(i,s)),{left:a,top:c,right:l,bottom:h}}function _e(n,t,e,i){return n?0:yt(t,e,i)}function um(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=gc(i);return{t:_e(s.top,o.top,0,e),r:_e(s.right,o.right,0,t),b:_e(s.bottom,o.bottom,0,e),l:_e(s.left,o.left,0,t)}}function dm(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=ve(s),r=Math.min(t,e),a=n.borderSkipped,l=i||H(s);return{topLeft:_e(!l||a.top||a.left,o.topLeft,0,r),topRight:_e(!l||a.top||a.right,o.topRight,0,r),bottomLeft:_e(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:_e(!l||a.bottom||a.right,o.bottomRight,0,r)}}function fm(n){const t=Hc(n),e=t.right-t.left,i=t.bottom-t.top,s=um(n,e/2,i/2),o=dm(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function oo(n,t,e,i){const s=t===null,o=e===null,a=n&&!(s&&o)&&Hc(n,i);return a&&(s||le(t,a.left,a.right))&&(o||le(e,a.top,a.bottom))}function gm(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function mm(n,t){n.rect(t.x,t.y,t.w,t.h)}function ro(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,r=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+r,radius:n.radius}}class cs extends xt{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:o,outer:r}=fm(this),a=gm(r.radius)?mn:mm;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,ro(r,e,o)),t.clip(),a(t,ro(o,-e,r)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,ro(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return oo(this,t,e,i)}inXRange(t,e){return oo(this,t,null,e)}inYRange(t,e){return oo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}v(cs,"id","bar"),v(cs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),v(cs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var pm=Object.freeze({__proto__:null,ArcElement:qn,BarElement:cs,LineElement:xe,PointElement:ls});const vo=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Va=vo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Bc(n){return vo[n%vo.length]}function Yc(n){return Va[n%Va.length]}function bm(n,t){return n.borderColor=Bc(t),n.backgroundColor=Yc(t),++t}function ym(n,t){return n.backgroundColor=n.data.map(()=>Bc(t++)),t}function xm(n,t){return n.backgroundColor=n.data.map(()=>Yc(t++)),t}function _m(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof ye?t=ym(e,t):s instanceof ti?t=xm(e,t):s&&(t=bm(e,t))}}function ja(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function wm(n){return n&&(n.borderColor||n.backgroundColor)}function vm(){return Z.borderColor!=="rgba(0,0,0,0.1)"||Z.backgroundColor!=="rgba(0,0,0,0.1)"}var Mm={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s,r=ja(i)||wm(s)||o&&ja(o)||vm();if(!e.forceOverride&&r)return;const a=_m(n);i.forEach(a)}};function km(n,t,e,i,s){const o=s.samples||i;if(o>=e)return n.slice(t,t+e);const r=[],a=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,u,d,f,p,b;for(r[l++]=n[h],u=0;u<o-2;u++){let x=0,_=0,w;const k=Math.floor((u+1)*a)+1+t,T=Math.min(Math.floor((u+2)*a)+1,e)+t,P=T-k;for(w=k;w<T;w++)x+=n[w].x,_+=n[w].y;x/=P,_/=P;const O=Math.floor(u*a)+1+t,C=Math.min(Math.floor((u+1)*a)+1,e)+t,{x:S,y:E}=n[h];for(f=p=-1,w=O;w<C;w++)p=.5*Math.abs((S-x)*(n[w].y-E)-(S-n[w].x)*(_-E)),p>f&&(f=p,d=n[w],b=w);r[l++]=d,h=b}return r[l++]=n[c],r}function Pm(n,t,e,i){let s=0,o=0,r,a,l,c,h,u,d,f,p,b;const x=[],_=t+e-1,w=n[t].x,T=n[_].x-w;for(r=t;r<t+e;++r){a=n[r],l=(a.x-w)/T*i,c=a.y;const P=l|0;if(P===h)c<p?(p=c,u=r):c>b&&(b=c,d=r),s=(o*s+a.x)/++o;else{const O=r-1;if(!V(u)&&!V(d)){const C=Math.min(u,d),S=Math.max(u,d);C!==f&&C!==O&&x.push({...n[C],x:s}),S!==f&&S!==O&&x.push({...n[S],x:s})}r>0&&O!==f&&x.push(n[O]),x.push(a),h=P,o=0,p=b=c,u=d=f=r}}return x}function Vc(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Xa(n){n.data.datasets.forEach(t=>{Vc(t)})}function Tm(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=yt(ce(t,o.axis,r).lo,0,e-1)),c?s=yt(ce(t,o.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Sm={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Xa(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=n.getDatasetMeta(o),c=r||s.data;if(Xn([a,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=n.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:u,count:d}=Tm(l,c);const f=e.threshold||4*i;if(d<=f){Vc(s);return}V(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let p;switch(e.algorithm){case"lttb":p=km(c,u,d,i,e);break;case"min-max":p=Pm(c,u,d,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){Xa(n)}};function Dm(n,t,e){const i=n.segments,s=n.points,o=t.points,r=[];for(const a of i){let{start:l,end:c}=a;c=hr(l,c,s);const h=Mo(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const u=Pc(t,h);for(const d of u){const f=Mo(e,o[d.start],o[d.end],d.loop),p=kc(a,s,f);for(const b of p)r.push({source:b,target:d,start:{[e]:Ua(h,f,"start",Math.max)},end:{[e]:Ua(h,f,"end",Math.min)}})}}return r}function Mo(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=Rt(s),o=Rt(o)),{property:n,start:s,end:o}}function Om(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=hr(r,a,s);const l=s[r],c=s[a];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function hr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Ua(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function jc(n,t){let e=[],i=!1;return q(n)?(i=!0,e=n):e=Om(n,t),e.length?new xe({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function qa(n){return n&&n.fill!==!1}function Cm(n,t,e){let s=n[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!et(s))return s;if(r=n[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function Em(n,t,e){const i=Rm(n);if(H(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return et(s)&&Math.floor(s)===s?Am(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Am(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Im(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:H(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Lm(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:H(n)?i=n.value:i=t.getBaseValue(),i}function Rm(n){const t=n.options,e=t.fill;let i=F(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Fm(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,r=i.points,a=Nm(t,e);a.push(jc({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)zm(s,r[h],a)}return new xe({points:s,options:{}})}function Nm(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function zm(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:r,last:a,point:l}=Wm(o,t,"x");if(!(!l||r&&a)){if(r)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function Wm(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,r=n.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],u=r[h.start][e],d=r[h.end][e];if(le(s,u,d)){a=s===u,l=s===d;break}}return{first:a,last:l,point:i}}class Xc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:r}=this;return e=e||{start:0,end:G},t.arc(s,o,r,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Hm(n){const{chart:t,fill:e,line:i}=n;if(et(e))return Bm(t,e);if(e==="stack")return Fm(n);if(e==="shape")return!0;const s=Ym(n);return s instanceof Xc?s:jc(s,i)}function Bm(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Ym(n){return(n.scale||{}).getPointPositionForValue?jm(n):Vm(n)}function Vm(n){const{scale:t={},fill:e}=n,i=Im(e,t);if(et(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function jm(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,r=Lm(e,t,o),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Xc({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function ao(n,t,e){const i=Hm(t),{line:s,scale:o,axis:r}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:h=c,below:u=c}=l||{};i&&s.points.length&&(wi(n,e),Xm(n,{line:s,target:i,above:h,below:u,area:e,scale:o,axis:r}),vi(n))}function Xm(n,t){const{line:e,target:i,above:s,below:o,area:r,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&o!==s&&($a(n,i,r.top),Ga(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),$a(n,i,r.bottom)),Ga(n,{line:e,target:i,color:o,scale:a,property:l}),n.restore()}function $a(n,t,e){const{segments:i,points:s}=t;let o=!0,r=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,h=s[l],u=s[hr(l,c,s)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),r=!!t.pathSegment(n,a,{move:r}),r?n.closePath():n.lineTo(u.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Ga(n,t){const{line:e,target:i,property:s,color:o,scale:r}=t,a=Dm(e,i,s);for(const{source:l,target:c,start:h,end:u}of a){const{style:{backgroundColor:d=o}={}}=l,f=i!==!0;n.save(),n.fillStyle=d,Um(n,r,f&&Mo(s,h,u)),n.beginPath();const p=!!e.pathSegment(n,l);let b;if(f){p?n.closePath():Qa(n,i,u,s);const x=!!i.pathSegment(n,c,{move:p,reverse:!0});b=p&&x,b||Qa(n,i,h,s)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function Um(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:o,start:r,end:a}=e||{};o==="x"&&(n.beginPath(),n.rect(r,i,a-r,s-i),n.clip())}function Qa(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var qm={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,r,a,l;for(r=0;r<i;++r)o=n.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof xe&&(l={visible:n.isDatasetVisible(r),index:r,fill:Em(a,r,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<i;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=Cm(s,r,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let r=s.length-1;r>=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),i&&a.fill&&ao(n.ctx,a,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;qa(o)&&ao(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!qa(i)||e.drawTime!=="beforeDatasetDraw"||ao(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ka=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},$m=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Za extends xt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=R(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=ot(i.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Ka(i,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let u=t;o.textAlign="left",o.textBaseline="middle";let d=-1,f=-h;return this.legendItems.forEach((p,b)=>{const x=i+e/2+o.measureText(p.text).width;(b===0||c[c.length-1]+x+2*a>r)&&(u+=h,c[c.length-(b>0?0:1)]=0,f+=h,d++),l[b]={left:0,top:f,row:d,width:x,height:s},c[c.length-1]+=x+a}),u}_fitCols(t,e,i,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let u=a,d=0,f=0,p=0,b=0;return this.legendItems.forEach((x,_)=>{const{itemWidth:w,itemHeight:k}=Gm(i,e,o,x,s);_>0&&f+k+2*a>h&&(u+=d+a,c.push({width:d,height:f}),p+=d+a,b++,d=f=0),l[_]={left:p,top:f,col:b,width:w,height:k},d=Math.max(d,w),f+=k+a}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,r=ln(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=wt(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=wt(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=wt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=wt(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;wi(t,this),this._draw(),vi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:r}=t,a=Z.color,l=ln(t.rtl,this.left,this.width),c=ot(r.font),{padding:h}=r,u=c.size,d=u/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:b,itemHeight:x}=Ka(r,u),_=function(O,C,S){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const E=F(S.lineWidth,1);if(s.fillStyle=F(S.fillStyle,a),s.lineCap=F(S.lineCap,"butt"),s.lineDashOffset=F(S.lineDashOffset,0),s.lineJoin=F(S.lineJoin,"miter"),s.lineWidth=E,s.strokeStyle=F(S.strokeStyle,a),s.setLineDash(F(S.lineDash,[])),r.usePointStyle){const L={radius:b*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:E},N=l.xPlus(O,p/2),W=C+d;fc(s,L,N,W,r.pointStyleWidth&&p)}else{const L=C+Math.max((u-b)/2,0),N=l.leftForLtr(O,p),W=ve(S.borderRadius);s.beginPath(),Object.values(W).some(nt=>nt!==0)?mn(s,{x:N,y:L,w:p,h:b,radius:W}):s.rect(N,L,p,b),s.fill(),E!==0&&s.stroke()}s.restore()},w=function(O,C,S){$e(s,S.text,O,C+x/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},k=this.isHorizontal(),T=this._computeTitleHeight();k?f={x:wt(o,this.left+h,this.right-i[0]),y:this.top+h+T,line:0}:f={x:this.left+h,y:wt(o,this.top+T+h,this.bottom-e[0].height),line:0},wc(this.ctx,t.textDirection);const P=x+h;this.legendItems.forEach((O,C)=>{s.strokeStyle=O.fontColor,s.fillStyle=O.fontColor;const S=s.measureText(O.text).width,E=l.textAlign(O.textAlign||(O.textAlign=r.textAlign)),L=p+d+S;let N=f.x,W=f.y;l.setWidth(this.width),k?C>0&&N+L+h>this.right&&(W=f.y+=P,f.line++,N=f.x=wt(o,this.left+h,this.right-i[f.line])):C>0&&W+P>this.bottom&&(N=f.x=N+e[f.line].width+h,f.line++,W=f.y=wt(o,this.top+T+h,this.bottom-e[f.line].height));const nt=l.x(N);if(_(nt,W,O),N=md(E,N+p+d,k?N+L:this.right,t.rtl),w(l.x(N),W,O),k)f.x+=L+h;else if(typeof O.text!="string"){const lt=c.lineHeight;f.y+=Uc(O,lt)+h}else f.y+=P}),vc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=ot(e.font),s=gt(e.padding);if(!e.display)return;const o=ln(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let h,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),h=this.top+c,u=wt(t.align,u,this.right-d);else{const p=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);h=c+wt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=wt(a,u,u+d);r.textAlign=o.textAlign(tr(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,$e(r,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=ot(t.font),i=gt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(le(t,this.left,this.right)&&le(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],le(t,s.left,s.left+s.width)&&le(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Zm(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=$m(s,i);s&&!o&&R(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&R(e.onHover,[t,i,this],this)}else i&&R(e.onClick,[t,i,this],this)}}function Gm(n,t,e,i,s){const o=Qm(i,n,t,e),r=Km(s,i,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Qm(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+i.measureText(s).width}function Km(n,t,e){let i=n;return typeof t.text!="string"&&(i=Uc(t,e)),i}function Uc(n,t){const e=n.text?n.text.length:0;return t*e}function Zm(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Jm={id:"legend",_element:Za,start(n,t,e){const i=n.legend=new Za({ctx:n.ctx,options:e,chart:n});vt.configure(n,i,e),vt.addBox(n,i)},stop(n){vt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;vt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=gt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ur extends xt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=q(i.text)?i.text.length:1;this._padding=gt(i.padding);const o=s*ot(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,h,u;return this.isHorizontal()?(h=wt(a,i,o),u=e+t,c=o-i):(r.position==="left"?(h=i+t,u=wt(a,s,e),l=j*-.5):(h=o-t,u=wt(a,e,s),l=j*.5),c=s-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=ot(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);$e(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:tr(e.align),textBaseline:"middle",translation:[r,a]})}}function tp(n,t){const e=new ur({ctx:n.ctx,options:t,chart:n});vt.configure(n,e,t),vt.addBox(n,e),n.titleBlock=e}var ep={id:"title",_element:ur,start(n,t,e){tp(n,e)},stop(n){const t=n.titleBlock;vt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;vt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qi=new WeakMap;var np={id:"subtitle",start(n,t,e){const i=new ur({ctx:n.ctx,options:e,chart:n});vt.configure(n,i,e),vt.addBox(n,i),Qi.set(n,i)},stop(n){vt.removeBox(n,Qi.get(n)),Qi.delete(n)},beforeUpdate(n,t,e){const i=Qi.get(n);vt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const $n={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,o=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=n.length;o<r;++o){const l=n[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=gn(t,c);h<s&&(s=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function $t(n,t){return t&&(q(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function re(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function Fm(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:n,label:r,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function La(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,l=it(t.bodyFont),c=it(t.titleFont),h=it(t.footerFont),u=o.length,d=s.length,g=i.length,p=ut(t.padding);let b=p.height,x=0,_=i.reduce((T,P)=>T+P.before.length+P.lines.length+P.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,u&&(b+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),_){const T=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*T+(_-g)*l.lineHeight+(_-1)*t.bodySpacing}d&&(b+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let w=0;const k=function(T){x=Math.max(x,e.measureText(T).width+w)};return e.save(),e.font=c.string,Y(n.title,k),e.font=l.string,Y(n.beforeBody.concat(n.afterBody),k),w=t.displayColors?r+2+t.boxPadding:0,Y(i,T=>{Y(T.before,k),Y(T.lines,k),Y(T.after,k)}),w=0,e.font=h.string,Y(n.footer,k),e.restore(),x+=p.width,{width:x,height:b}}function Nm(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function zm(n,t,e,i){const{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(n==="left"&&s+o+r>t.width||n==="right"&&s-o-r<0)return!0}function Wm(n,t,e,i){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),zm(c,n,t,e)&&(c="center"),c}function Ra(n,t,e){const i=e.yAlign||t.yAlign||Nm(n,e);return{xAlign:e.xAlign||t.xAlign||Wm(n,t,e,i),yAlign:i}}function Hm(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Ym(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Fa(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:g}=_e(r);let p=Hm(t,a);const b=Ym(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,d)+s:a==="right"&&(p+=Math.max(u,g)+s),{x:pt(p,0,i.width-t.width),y:pt(b,0,i.height-t.height)}}function Ii(n,t,e){const i=ut(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Na(n){return Xt([],ie(n))}function Bm(n,t,e){return Te(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function za(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Dc={beforeTitle:ee,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:ee,beforeBody:ee,beforeLabel:ee,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return B(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ee,afterBody:ee,beforeFooter:ee,footer:ee,afterFooter:ee};function Pt(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Dc[t].call(e,i):s}class so extends bt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new Bo(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Bm(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=Pt(i,"beforeTitle",this,t),o=Pt(i,"title",this,t),r=Pt(i,"afterTitle",this,t);let a=[];return a=Xt(a,ie(s)),a=Xt(a,ie(o)),a=Xt(a,ie(r)),a}getBeforeBody(t,e){return Na(Pt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Y(t,o=>{const r={before:[],lines:[],after:[]},a=za(i,o);Xt(r.before,ie(Pt(a,"beforeLabel",this,o))),Xt(r.lines,Pt(a,"label",this,o)),Xt(r.after,ie(Pt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return Na(Pt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=Pt(i,"beforeFooter",this,t),o=Pt(i,"footer",this,t),r=Pt(i,"afterFooter",this,t);let a=[];return a=Xt(a,ie(s)),a=Xt(a,ie(o)),a=Xt(a,ie(r)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Fm(this.chart,e[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,i))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,i))),Y(a,h=>{const u=za(t.callbacks,h);s.push(Pt(u,"labelColor",this,h)),o.push(Pt(u,"labelPointStyle",this,h)),r.push(Pt(u,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=Nn[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=La(this,i),c=Object.assign({},a,l),h=Ra(this.chart,i,c),u=Fa(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=_e(a),{x:d,y:g}=t,{width:p,height:b}=e;let x,_,w,k,T,P;return o==="center"?(T=g+b/2,s==="left"?(x=d,_=x-r,k=T+r,P=T-r):(x=d+p,_=x+r,k=T-r,P=T+r),w=x):(s==="left"?_=d+Math.max(l,h)+r:s==="right"?_=d+p-Math.max(c,u)-r:_=this.caretX,o==="top"?(k=g,T=k-r,x=_-r,w=_+r):(k=g+b,T=k+r,x=_+r,w=_-r),P=k),{x1:x,x2:_,x3:w,y1:k,y2:T,y3:P}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=en(i.rtl,this.x,this.width);for(t.x=Ii(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=it(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=it(o.bodyFont),u=Ii(this,"left",o),d=s.x(u),g=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+g;if(o.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(d,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Zs(t,b,x,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Zs(t,b,x,_)}else{t.lineWidth=W(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const b=s.leftForLtr(d,c),x=s.leftForLtr(s.xPlus(d,1),c-2),_=_e(r.borderRadius);Object.values(_).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,on(t,{x:b,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),on(t,{x,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,u=it(i.bodyFont);let d=u.lineHeight,g=0;const p=en(i.rtl,this.x,this.width),b=function(S){e.fillText(S,p.x(t.x+g),t.y+d/2),t.y+=d+o},x=p.textAlign(r);let _,w,k,T,P,O,C;for(e.textAlign=r,e.textBaseline="middle",e.font=u.string,t.x=Ii(this,x,i),e.fillStyle=i.bodyColor,Y(this.beforeBody,b),g=a&&x!=="right"?r==="center"?c/2+h:c+2+h:0,T=0,O=s.length;T<O;++T){for(_=s[T],w=this.labelTextColors[T],e.fillStyle=w,Y(_.before,b),k=_.lines,a&&k.length&&(this._drawColorBox(e,t,T,p,i),d=Math.max(u.lineHeight,l)),P=0,C=k.length;P<C;++P)b(k[P]),d=u.lineHeight;Y(_.after,b)}g=0,d=u.lineHeight,Y(this.afterBody,b),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let r,a;if(o){const l=en(i.rtl,this.x,this.width);for(t.x=Ii(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=it(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=i,{topLeft:u,topRight:d,bottomLeft:g,bottomRight:p}=_e(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+u,l),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+h),e.quadraticCurveTo(a,l+h,a,l+h-g),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=Nn[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=La(this,t),l=Object.assign({},r,this._size),c=Ra(e,t,l),h=Fa(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){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},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=ut(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),nc(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),ic(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!$i(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!$i(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,r=Nn[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}}v(so,"positioners",Nn);var Vm={id:"tooltip",_element:so,positioners:Nn,afterInit(n,t,e){e&&(n.tooltip=new so({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Dc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},jm=Object.freeze({__proto__:null,Colors:nm,Decimation:rm,Filler:Tm,Legend:Am,SubTitle:Rm,Title:Lm,Tooltip:Vm});const Xm=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Um(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Xm(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const qm=(n,t)=>n===null?null:pt(Math.round(n),0,t);function Wa(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class oo extends je{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(B(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Um(i,t,R(e,t),this._addedLabels),qm(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(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 o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return Wa.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}v(oo,"id","category"),v(oo,"defaults",{ticks:{callback:Wa}});function $m(n,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=n,g=o||1,p=h-1,{min:b,max:x}=t,_=!B(r),w=!B(a),k=!B(c),T=(x-b)/(u+1);let P=Lr((x-b)/p/g)*g,O,C,S,E;if(P<1e-14&&!_&&!w)return[{value:b},{value:x}];E=Math.ceil(x/P)-Math.floor(b/P),E>p&&(P=Lr(E*P/p/g)*g),B(l)||(O=Math.pow(10,l),P=Math.ceil(P*O)/O),s==="ticks"?(C=Math.floor(b/P)*P,S=Math.ceil(x/P)*P):(C=b,S=x),_&&w&&o&&Yu((a-r)/o,P/1e3)?(E=Math.round(Math.min((a-r)/P,h)),P=(a-r)/E,C=r,S=a):k?(C=_?r:C,S=w?a:S,E=c-1,P=(S-C)/E):(E=(S-C)/P,We(E,Math.round(E),P/1e3)?E=Math.round(E):E=Math.ceil(E));const I=Math.max(Rr(P),Rr(C));O=Math.pow(10,B(l)?I:l),C=Math.round(C*O)/O,S=Math.round(S*O)/O;let F=0;for(_&&(d&&C!==r?(e.push({value:r}),C<r&&F++,We(Math.round((C+F*P)*O)/O,r,Ha(r,T,n))&&F++):C<r&&F++);F<E;++F){const z=Math.round((C+F*P)*O)/O;if(w&&z>a)break;e.push({value:z})}return w&&d&&S!==a?e.length&&We(e[e.length-1].value,a,Ha(a,T,n))?e[e.length-1].value=a:e.push({value:a}):(!w||S===a)&&e.push({value:S}),e}function Ha(n,t,{horizontal:e,minRotation:i}){const s=ht(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}class is extends je{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 B(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=i?o:l;if(t){const l=zt(s),c=zt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}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:e.includeBounds!==!1},o=this._range||this,r=$m(s,o);return t.bounds==="ticks"&&Hl(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let 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 ni(t,this.chart.options.locale,this.options.ticks.format)}}class ro extends is{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=ht(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}v(ro,"id","linear"),v(ro,"defaults",{ticks:{callback:ls.formatters.numeric}});const Zn=n=>Math.floor(me(n)),Le=(n,t)=>Math.pow(10,Zn(n)+t);function Ya(n){return n/Math.pow(10,Zn(n))===1}function Ba(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Gm(n,t){const e=t-n;let i=Zn(e);for(;Ba(n,t,i)>10;)i++;for(;Ba(n,t,i)<10;)i--;return Math.min(i,Zn(n))}function Qm(n,{min:t,max:e}){t=Et(n.min,t);const i=[],s=Zn(t);let o=Gm(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let u=Math.floor((c-h)/Math.pow(10,o)),d=Et(n.min,Math.round((l+h+u*Math.pow(10,o))*r)/r);for(;d<e;)i.push({value:d,major:Ya(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),d=Math.round((l+h+u*Math.pow(10,o))*r)/r;const g=Et(n.max,d);return i.push({value:g,major:Ya(g),significand:u}),i}class ao extends je{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=is.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return J(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?Math.max(0,t):null,this.max=J(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!J(this._userMin)&&(this.min=t===Le(this.min,0)?Le(this.min,-1):Le(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Le(i,-1)),r(Le(s,1)))),i<=0&&o(Le(s,-1)),s<=0&&r(Le(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Qm(e,this);return t.bounds==="ticks"&&Hl(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 t===void 0?"0":ni(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=me(t),this._valueRange=me(this.max)-me(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(me(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}v(ao,"id","logarithmic"),v(ao,"defaults",{ticks:{callback:ls.formatters.logarithmic,major:{enabled:!0}}});function lo(n){const t=n.ticks;if(t.display&&n.display){const e=ut(t.backdropPadding);return R(t.font&&t.font.size,Z.font.size)+e.height}return 0}function Zm(n,t,e){return e=U(e)?e:[e],{w:sd(n,t.string,e),h:e.length*t.lineHeight}}function Va(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function Km(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,r=n.options.pointLabels,a=r.centerPointLabels?V/o:0;for(let l=0;l<o;l++){const c=r.setContext(n.getPointLabelContext(l));s[l]=c.padding;const h=n.getPointPosition(l,n.drawingArea+s[l],a),u=it(c.font),d=Zm(n.ctx,u,n._pointLabels[l]);i[l]=d;const g=At(n.getIndexAngle(l)+a),p=Math.round(as(g)),b=Va(p,h.x,d.w,0,180),x=Va(p,h.y,d.h,90,270);Jm(e,t,g,b,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=np(n,i,s)}function Jm(n,t,e,i,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+l))}function tp(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=n.getPointPosition(t,i+s+r,o),c=Math.round(as(At(l.angle+Q))),h=op(l.y,a.h,c),u=ip(c),d=sp(l.x,a.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function ep(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Qt({x:e,y:i},t)||Qt({x:e,y:o},t)||Qt({x:s,y:i},t)||Qt({x:s,y:o},t))}function np(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:lo(o)/2,additionalAngle:r?V/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const u=tp(n,h,l);i.push(u),a==="auto"&&(u.visible=ep(u,c),u.visible&&(c=u))}return i}function ip(n){return n===0||n===180?"center":n<180?"left":"right"}function sp(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function op(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function rp(n,t,e){const{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!B(a)){const l=_e(t.borderRadius),c=ut(t.backdropPadding);n.fillStyle=a;const h=i-c.left,u=s-c.top,d=o-i+c.width,g=r-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),on(n,{x:h,y:u,w:d,h:g,radius:l}),n.fill()):n.fillRect(h,u,d,g)}}function ap(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(n.getPointLabelContext(s));rp(e,r,o);const a=it(r.font),{x:l,y:c,textAlign:h}=o;Be(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Oc(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,$);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=n.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function lp(n,t,e,i,s){const o=n.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Oc(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function cp(n,t,e){return Te(n,{label:e,index:t,type:"pointLabel"})}class zn extends is{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=ut(lo(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=J(t)&&!isNaN(t)?t:0,this.max=J(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/lo(this.options))}generateTickLabels(t){is.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=L(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?Km(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=$/(this._pointLabels.length||1),i=this.options.startAngle||0;return At(t*e+ht(i))}getDistanceFromCenterForValue(t){if(B(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(B(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 cp(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Q+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}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:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Oc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&ap(this,r),s.display&&this.ticks.forEach((h,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(u),g=s.setContext(d),p=o.setContext(d);lp(this,g,l,r,p)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const h=i.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:d}=h;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),h=it(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const u=ut(c.backdropPadding);t.fillRect(-r/2-u.left,-o-h.size/2-u.top,r+u.width,h.size+u.height)}Be(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}v(zn,"id","radialLinear"),v(zn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ls.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),v(zn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),v(zn,"descriptors",{angleLines:{_fallback:"grid"}});const us={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},St=Object.keys(us);function ja(n,t){return n-t}function Xa(n,t){if(B(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),J(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Me(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Ua(n,t,e,i){const s=St.length;for(let o=St.indexOf(n);o<s-1;++o){const r=us[St[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return St[o]}return St[s-1]}function hp(n,t,e,i,s){for(let o=St.length-1;o>=St.indexOf(e);o--){const r=St[o];if(us[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return St[e?St.indexOf(e):0]}function up(n){for(let t=St.indexOf(n)+1,e=St.length;t<e;++t)if(us[St[t]].common)return St[t]}function qa(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Io(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function dp(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function $a(n,t,e){const i=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!e?i:dp(n,i,s,e)}class Kn extends je{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 cc._date(t.adapters.date);s.init(e),Hn(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 t===void 0?null:Xa(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:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=J(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=J(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_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=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=Xu(s,o,r);return this._unit=e.unit||(i.autoSkip?Ua(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):hp(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:up(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),$a(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=pt(e,0,r),i=pt(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Ua(o.minUnit,e,i,this._getLabelCapacity(e)),a=R(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Me(l)||l===!0,h={};let u=e,d,g;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(d=u,g=0;d<i;d=+t.add(d,a,r),g++)qa(h,d,p);return(d===i||s.bounds==="ticks"||g===1)&&qa(h,d,p),Object.keys(h).sort(ja).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.ticks.callback;if(r)return L(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],u=c&&a[c],d=i[e],g=c&&u&&d&&d.major;return this._adapter.format(t,s||(g?u:h))}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 t===null?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=ht(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,$a(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}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(Xa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Bl(t.sort(ja))}}v(Kn,"id","time"),v(Kn,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Li(n,t,e){let i=0,s=n.length-1,o,r,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=re(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=re(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:l}=n[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class co extends Kn{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=Li(e,this.min),this._tableRange=Li(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Li(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Li(this._table,i*this._tableRange+this._minPos,!0)}}v(co,"id","timeseries"),v(co,"defaults",Kn.defaults);var fp=Object.freeze({__proto__:null,CategoryScale:oo,LinearScale:ro,LogarithmicScale:ao,RadialLinearScale:zn,TimeScale:Kn,TimeSeriesScale:co});const gp=[_f,Gg,jm,fp];Mt.register(...gp);const Cc=6048e5,mp=864e5,oi=6e4,ri=36e5,pp=1e3,Ga=Symbol.for("constructDateFrom");function st(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Ga in n?n[Ga](t):n instanceof Date?new n.constructor(t):new Date(t)}function N(n,t){return st(t||n,n)}function ds(n,t,e){const i=N(n,e==null?void 0:e.in);return isNaN(t)?st((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Uo(n,t,e){const i=N(n,e==null?void 0:e.in);if(isNaN(t))return st(n,NaN);if(!t)return i;const s=i.getDate(),o=st(n,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function qo(n,t,e){return st(n,+N(n)+t)}function bp(n,t,e){return qo(n,t*ri)}let yp={};function Xe(){return yp}function Zt(n,t){var a,l,c,h;const e=Xe(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((h=(c=e.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,s=N(n,t==null?void 0:t.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function ln(n,t){return Zt(n,{...t,weekStartsOn:1})}function Ec(n,t){const e=N(n,t==null?void 0:t.in),i=e.getFullYear(),s=st(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=ln(s),r=st(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=ln(r);return e.getTime()>=o.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function ss(n){const t=N(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Ue(n,...t){const e=st.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ho(n,t){const e=N(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Ac(n,t,e){const[i,s]=Ue(e==null?void 0:e.in,n,t),o=ho(i),r=ho(s),a=+o-ss(o),l=+r-ss(r);return Math.round((a-l)/mp)}function xp(n,t){const e=Ec(n,t),i=st(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ln(i)}function _p(n,t,e){const i=N(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*oi),i}function wp(n,t,e){return Uo(n,t*3,e)}function vp(n,t,e){return qo(n,t*1e3)}function Mp(n,t,e){return ds(n,t*7,e)}function kp(n,t,e){return Uo(n,t*12,e)}function jn(n,t){const e=+N(n)-+N(t);return e<0?-1:e>0?1:e}function Pp(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Ic(n){return!(!Pp(n)&&typeof n!="number"||isNaN(+N(n)))}function Tp(n,t,e){const[i,s]=Ue(e==null?void 0:e.in,n,t),o=i.getFullYear()-s.getFullYear(),r=i.getMonth()-s.getMonth();return o*12+r}function Sp(n,t,e){const[i,s]=Ue(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Lc(n,t,e){const[i,s]=Ue(e==null?void 0:e.in,n,t),o=Qa(i,s),r=Math.abs(Ac(i,s));i.setDate(i.getDate()-o*r);const a=+(Qa(i,s)===-o),l=o*(r-a);return l===0?0:l}function Qa(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function ai(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function Dp(n,t,e){const[i,s]=Ue(e==null?void 0:e.in,n,t),o=(+i-+s)/ri;return ai(e==null?void 0:e.roundingMethod)(o)}function $o(n,t){return+N(n)-+N(t)}function Op(n,t,e){const i=$o(n,t)/oi;return ai(e==null?void 0:e.roundingMethod)(i)}function Rc(n,t){const e=N(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Fc(n,t){const e=N(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Cp(n,t){const e=N(n,t==null?void 0:t.in);return+Rc(e,t)==+Fc(e,t)}function Nc(n,t,e){const[i,s,o]=Ue(e==null?void 0:e.in,n,n,t),r=jn(s,o),a=Math.abs(Tp(s,o));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*a);let l=jn(s,o)===-r;Cp(i)&&a===1&&jn(i,o)===1&&(l=!1);const c=r*(a-+l);return c===0?0:c}function Ep(n,t,e){const i=Nc(n,t,e)/3;return ai(e==null?void 0:e.roundingMethod)(i)}function Ap(n,t,e){const i=$o(n,t)/1e3;return ai(e==null?void 0:e.roundingMethod)(i)}function Ip(n,t,e){const i=Lc(n,t,e)/7;return ai(e==null?void 0:e.roundingMethod)(i)}function Lp(n,t,e){const[i,s]=Ue(e==null?void 0:e.in,n,t),o=jn(i,s),r=Math.abs(Sp(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=jn(i,s)===-o,l=o*(r-+a);return l===0?0:l}function Rp(n,t){const e=N(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function Fp(n,t){const e=N(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function Np(n,t){const e=N(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function zc(n,t){const e=N(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function zp(n,t){const e=N(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function Wp(n,t){var a,l;const e=Xe(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=N(n,t==null?void 0:t.in),o=s.getDay(),r=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+r),s.setHours(23,59,59,999),s}function Hp(n,t){const e=N(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function Yp(n,t){const e=N(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function Bp(n,t){const e=N(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const Vp={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},jp=(n,t,e)=>{let i;const s=Vp[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Vs(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Xp={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Up={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},qp={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},$p={date:Vs({formats:Xp,defaultWidth:"full"}),time:Vs({formats:Up,defaultWidth:"full"}),dateTime:Vs({formats:qp,defaultWidth:"full"})},Gp={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qp=(n,t,e,i)=>Gp[n];function Sn(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const r=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):r;s=n.formattingValues[a]||n.formattingValues[r]}else{const r=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[r]}const o=n.argumentCallback?n.argumentCallback(t):t;return s[o]}}const Zp={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Kp={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Jp={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},eb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},nb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ib=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},sb={ordinalNumber:ib,era:Sn({values:Zp,defaultWidth:"wide"}),quarter:Sn({values:Kp,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Sn({values:Jp,defaultWidth:"wide"}),day:Sn({values:tb,defaultWidth:"wide"}),dayPeriod:Sn({values:eb,defaultWidth:"wide",formattingValues:nb,defaultFormattingWidth:"wide"})};function Dn(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?rb(a,u=>u.test(r)):ob(a,u=>u.test(r));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const h=t.slice(r.length);return{value:c,rest:h}}}function ob(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function rb(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function ab(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],o=t.match(n.parsePattern);if(!o)return null;let r=n.valueCallback?n.valueCallback(o[0]):o[0];r=e.valueCallback?e.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const lb=/^(\d+)(th|st|nd|rd)?/i,cb=/\d+/i,hb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ub={any:[/^b/i,/^(a|c)/i]},db={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fb={any:[/1/i,/2/i,/3/i,/4/i]},gb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},mb={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},pb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},bb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},yb={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},xb={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},_b={ordinalNumber:ab({matchPattern:lb,parsePattern:cb,valueCallback:n=>parseInt(n,10)}),era:Dn({matchPatterns:hb,defaultMatchWidth:"wide",parsePatterns:ub,defaultParseWidth:"any"}),quarter:Dn({matchPatterns:db,defaultMatchWidth:"wide",parsePatterns:fb,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Dn({matchPatterns:gb,defaultMatchWidth:"wide",parsePatterns:mb,defaultParseWidth:"any"}),day:Dn({matchPatterns:pb,defaultMatchWidth:"wide",parsePatterns:bb,defaultParseWidth:"any"}),dayPeriod:Dn({matchPatterns:yb,defaultMatchWidth:"any",parsePatterns:xb,defaultParseWidth:"any"})},Wc={code:"en-US",formatDistance:jp,formatLong:$p,formatRelative:Qp,localize:sb,match:_b,options:{weekStartsOn:0,firstWeekContainsDate:1}};function wb(n,t){const e=N(n,t==null?void 0:t.in);return Ac(e,zc(e))+1}function Hc(n,t){const e=N(n,t==null?void 0:t.in),i=+ln(e)-+xp(e);return Math.round(i/Cc)+1}function Go(n,t){var h,u,d,g;const e=N(n,t==null?void 0:t.in),i=e.getFullYear(),s=Xe(),o=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(d=s.locale)==null?void 0:d.options)==null?void 0:g.firstWeekContainsDate)??1,r=st((t==null?void 0:t.in)||n,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=Zt(r,t),l=st((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=Zt(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function vb(n,t){var a,l,c,h;const e=Xe(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((h=(c=e.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,s=Go(n,t),o=st((t==null?void 0:t.in)||n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),Zt(o,t)}function Yc(n,t){const e=N(n,t==null?void 0:t.in),i=+Zt(e,t)-+vb(e,t);return Math.round(i/Cc)+1}function q(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const de={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return q(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):q(e+1,2)},d(n,t){return q(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return q(n.getHours()%12||12,t.length)},H(n,t){return q(n.getHours(),t.length)},m(n,t){return q(n.getMinutes(),t.length)},s(n,t){return q(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return q(s,t.length)}},tn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Za={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return de.y(n,t)},Y:function(n,t,e,i){const s=Go(n,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return q(r,2)}return t==="Yo"?e.ordinalNumber(o,{unit:"year"}):q(o,t.length)},R:function(n,t){const e=Ec(n);return q(e,t.length)},u:function(n,t){const e=n.getFullYear();return q(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return q(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return q(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return de.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return q(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Yc(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):q(s,t.length)},I:function(n,t,e){const i=Hc(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):q(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):de.d(n,t)},D:function(n,t,e){const i=wb(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):q(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return q(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return q(o,t.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return q(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=tn.noon:i===0?s=tn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=tn.evening:i>=12?s=tn.afternoon:i>=4?s=tn.morning:s=tn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return de.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):de.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):q(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):q(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):de.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):de.s(n,t)},S:function(n,t){return de.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ja(i);case"XXXX":case"XX":return Fe(i);case"XXXXX":case"XXX":default:return Fe(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Ja(i);case"xxxx":case"xx":return Fe(i);case"xxxxx":case"xxx":default:return Fe(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ka(i,":");case"OOOO":default:return"GMT"+Fe(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ka(i,":");case"zzzz":default:return"GMT"+Fe(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return q(i,t.length)},T:function(n,t,e){return q(+n,t.length)}};function Ka(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),o=i%60;return o===0?e+String(s):e+String(s)+t+q(o,2)}function Ja(n,t){return n%60===0?(n>0?"-":"+")+q(Math.abs(n)/60,2):Fe(n,t)}function Fe(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=q(Math.trunc(i/60),2),o=q(i%60,2);return e+s+t+o}const tl=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Bc=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Mb=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return tl(n,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",tl(i,t)).replace("{{time}}",Bc(s,t))},uo={p:Bc,P:Mb},kb=/^D+$/,Pb=/^Y+$/,Tb=["D","DD","YY","YYYY"];function Vc(n){return kb.test(n)}function jc(n){return Pb.test(n)}function fo(n,t,e){const i=Sb(n,t,e);if(console.warn(i),Tb.includes(n))throw new RangeError(i)}function Sb(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Db=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ob=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Cb=/^'([^]*?)'?$/,Eb=/''/g,Ab=/[a-zA-Z]/;function Ib(n,t,e){var h,u,d,g,p,b,x,_;const i=Xe(),s=(e==null?void 0:e.locale)??i.locale??Wc,o=(e==null?void 0:e.firstWeekContainsDate)??((u=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(d=i.locale)==null?void 0:d.options)==null?void 0:g.firstWeekContainsDate)??1,r=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((_=(x=i.locale)==null?void 0:x.options)==null?void 0:_.weekStartsOn)??0,a=N(n,e==null?void 0:e.in);if(!Ic(a))throw new RangeError("Invalid time value");let l=t.match(Ob).map(w=>{const k=w[0];if(k==="p"||k==="P"){const T=uo[k];return T(w,s.formatLong)}return w}).join("").match(Db).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const k=w[0];if(k==="'")return{isToken:!1,value:Lb(w)};if(Za[k])return{isToken:!0,value:w};if(k.match(Ab))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:w}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(w=>{if(!w.isToken)return w.value;const k=w.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&jc(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Vc(k))&&fo(k,t,String(n));const T=Za[k[0]];return T(a,k,s.localize,c)}).join("")}function Lb(n){const t=n.match(Cb);return t?t[1].replace(Eb,"'"):n}function Rb(){return Object.assign({},Xe())}function Fb(n,t){const e=N(n,t==null?void 0:t.in).getDay();return e===0?7:e}function Nb(n,t){const e=zb(t)?new t(0):st(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function zb(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const Wb=10;class Xc{constructor(){v(this,"subPriority",0)}validate(t,e){return!0}}class Hb extends Xc{constructor(t,e,i,s,o){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class Yb extends Xc{constructor(e,i){super();v(this,"priority",Wb);v(this,"subPriority",-1);this.context=e||(s=>st(i,s))}set(e,i){return i.timestampIsSet?e:st(e,Nb(e,this.context))}}class j{run(t,e,i,s){const o=this.parse(t,e,i,s);return o?{setter:new Hb(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,i){return!0}}class Bb extends j{constructor(){super(...arguments);v(this,"priority",140);v(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const at={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},$t={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function lt(n,t){return n&&{value:t(n.value),rest:n.rest}}function et(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Gt(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,o=e[3]?parseInt(e[3],10):0,r=e[5]?parseInt(e[5],10):0;return{value:i*(s*ri+o*oi+r*pp),rest:t.slice(e[0].length)}}function Uc(n){return et(at.anyDigitsSigned,n)}function ot(n,t){switch(n){case 1:return et(at.singleDigit,t);case 2:return et(at.twoDigits,t);case 3:return et(at.threeDigits,t);case 4:return et(at.fourDigits,t);default:return et(new RegExp("^\\d{1,"+n+"}"),t)}}function os(n,t){switch(n){case 1:return et(at.singleDigitSigned,t);case 2:return et(at.twoDigitsSigned,t);case 3:return et(at.threeDigitsSigned,t);case 4:return et(at.fourDigitsSigned,t);default:return et(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Qo(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function qc(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const o=i+50,r=Math.trunc(o/100)*100,a=n>=o%100;s=n+r-(a?100:0)}return e?s:1-s}function $c(n){return n%400===0||n%4===0&&n%100!==0}class Vb extends j{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const o=r=>({year:r,isTwoDigitYear:i==="yy"});switch(i){case"y":return lt(ot(4,e),o);case"yo":return lt(s.ordinalNumber(e,{unit:"year"}),o);default:return lt(ot(i.length,e),o)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const o=e.getFullYear();if(s.isTwoDigitYear){const a=qc(s.year,o);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const r=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}class jb extends j{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const o=r=>({year:r,isTwoDigitYear:i==="YY"});switch(i){case"Y":return lt(ot(4,e),o);case"Yo":return lt(s.ordinalNumber(e,{unit:"year"}),o);default:return lt(ot(i.length,e),o)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,o){const r=Go(e,o);if(s.isTwoDigitYear){const l=qc(s.year,r);return e.setFullYear(l,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),Zt(e,o)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),Zt(e,o)}}class Xb extends j{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return os(i==="R"?4:i.length,e)}set(e,i,s){const o=st(e,0);return o.setFullYear(s,0,4),o.setHours(0,0,0,0),ln(o)}}class Ub extends j{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return os(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class qb extends j{constructor(){super(...arguments);v(this,"priority",120);v(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return ot(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class $b extends j{constructor(){super(...arguments);v(this,"priority",120);v(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return ot(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class Gb extends j{constructor(){super(...arguments);v(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);v(this,"priority",110)}parse(e,i,s){const o=r=>r-1;switch(i){case"M":return lt(et(at.month,e),o);case"MM":return lt(ot(2,e),o);case"Mo":return lt(s.ordinalNumber(e,{unit:"month"}),o);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class Qb extends j{constructor(){super(...arguments);v(this,"priority",110);v(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const o=r=>r-1;switch(i){case"L":return lt(et(at.month,e),o);case"LL":return lt(ot(2,e),o);case"Lo":return lt(s.ordinalNumber(e,{unit:"month"}),o);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function Zb(n,t,e){const i=N(n,e==null?void 0:e.in),s=Yc(i,e)-t;return i.setDate(i.getDate()-s*7),N(i,e==null?void 0:e.in)}class Kb extends j{constructor(){super(...arguments);v(this,"priority",100);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return et(at.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return ot(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,o){return Zt(Zb(e,s,o),o)}}function Jb(n,t,e){const i=N(n,e==null?void 0:e.in),s=Hc(i,e)-t;return i.setDate(i.getDate()-s*7),i}class ty extends j{constructor(){super(...arguments);v(this,"priority",100);v(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return et(at.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return ot(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return ln(Jb(e,s))}}const ey=[31,28,31,30,31,30,31,31,30,31,30,31],ny=[31,29,31,30,31,30,31,31,30,31,30,31];class iy extends j{constructor(){super(...arguments);v(this,"priority",90);v(this,"subPriority",1);v(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return et(at.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return ot(i.length,e)}}validate(e,i){const s=e.getFullYear(),o=$c(s),r=e.getMonth();return o?i>=1&&i<=ny[r]:i>=1&&i<=ey[r]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class sy extends j{constructor(){super(...arguments);v(this,"priority",90);v(this,"subpriority",1);v(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return et(at.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return ot(i.length,e)}}validate(e,i){const s=e.getFullYear();return $c(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Zo(n,t,e){var u,d,g,p;const i=Xe(),s=(e==null?void 0:e.weekStartsOn)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,o=N(n,e==null?void 0:e.in),r=o.getDay(),l=(t%7+7)%7,c=7-s,h=t<0||t>6?t-(r+c)%7:(l+c)%7-(r+c)%7;return ds(o,h,e)}class oy extends j{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,o){return e=Zo(e,s,o),e.setHours(0,0,0,0),e}}class ry extends j{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,o){const r=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return lt(ot(i.length,e),r);case"eo":return lt(s.ordinalNumber(e,{unit:"day"}),r);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,o){return e=Zo(e,s,o),e.setHours(0,0,0,0),e}}class ay extends j{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,o){const r=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return lt(ot(i.length,e),r);case"co":return lt(s.ordinalNumber(e,{unit:"day"}),r);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,o){return e=Zo(e,s,o),e.setHours(0,0,0,0),e}}function ly(n,t,e){const i=N(n,e==null?void 0:e.in),s=Fb(i,e),o=t-s;return ds(i,o,e)}class cy extends j{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const o=r=>r===0?7:r;switch(i){case"i":case"ii":return ot(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return lt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),o);case"iiiii":return lt(s.day(e,{width:"narrow",context:"formatting"}),o);case"iiiiii":return lt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),o);case"iiii":default:return lt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),o)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=ly(e,s),e.setHours(0,0,0,0),e}}class hy extends j{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Qo(s),0,0,0),e}}class uy extends j{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Qo(s),0,0,0),e}}class dy extends j{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Qo(s),0,0,0),e}}class fy extends j{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return et(at.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return ot(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const o=e.getHours()>=12;return o&&s<12?e.setHours(s+12,0,0,0):!o&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class gy extends j{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return et(at.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return ot(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class my extends j{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return et(at.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return ot(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class py extends j{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return et(at.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return ot(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const o=s<=24?s%24:s;return e.setHours(o,0,0,0),e}}class by extends j{constructor(){super(...arguments);v(this,"priority",60);v(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return et(at.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return ot(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class yy extends j{constructor(){super(...arguments);v(this,"priority",50);v(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return et(at.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return ot(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class xy extends j{constructor(){super(...arguments);v(this,"priority",30);v(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=o=>Math.trunc(o*Math.pow(10,-i.length+3));return lt(ot(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class _y extends j{constructor(){super(...arguments);v(this,"priority",10);v(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Gt($t.basicOptionalMinutes,e);case"XX":return Gt($t.basic,e);case"XXXX":return Gt($t.basicOptionalSeconds,e);case"XXXXX":return Gt($t.extendedOptionalSeconds,e);case"XXX":default:return Gt($t.extended,e)}}set(e,i,s){return i.timestampIsSet?e:st(e,e.getTime()-ss(e)-s)}}class wy extends j{constructor(){super(...arguments);v(this,"priority",10);v(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Gt($t.basicOptionalMinutes,e);case"xx":return Gt($t.basic,e);case"xxxx":return Gt($t.basicOptionalSeconds,e);case"xxxxx":return Gt($t.extendedOptionalSeconds,e);case"xxx":default:return Gt($t.extended,e)}}set(e,i,s){return i.timestampIsSet?e:st(e,e.getTime()-ss(e)-s)}}class vy extends j{constructor(){super(...arguments);v(this,"priority",40);v(this,"incompatibleTokens","*")}parse(e){return Uc(e)}set(e,i,s){return[st(e,s*1e3),{timestampIsSet:!0}]}}class My extends j{constructor(){super(...arguments);v(this,"priority",20);v(this,"incompatibleTokens","*")}parse(e){return Uc(e)}set(e,i,s){return[st(e,s),{timestampIsSet:!0}]}}const ky={G:new Bb,y:new Vb,Y:new jb,R:new Xb,u:new Ub,Q:new qb,q:new $b,M:new Gb,L:new Qb,w:new Kb,I:new ty,d:new iy,D:new sy,E:new oy,e:new ry,c:new ay,i:new cy,a:new hy,b:new uy,B:new dy,h:new fy,H:new gy,K:new my,k:new py,m:new by,s:new yy,S:new xy,X:new _y,x:new wy,t:new vy,T:new My},Py=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ty=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Sy=/^'([^]*?)'?$/,Dy=/''/g,Oy=/\S/,Cy=/[a-zA-Z]/;function Ey(n,t,e,i){var x,_,w,k,T,P,O,C;const s=()=>st((i==null?void 0:i.in)||e,NaN),o=Rb(),r=(i==null?void 0:i.locale)??o.locale??Wc,a=(i==null?void 0:i.firstWeekContainsDate)??((_=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:_.firstWeekContainsDate)??o.firstWeekContainsDate??((k=(w=o.locale)==null?void 0:w.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((P=(T=i==null?void 0:i.locale)==null?void 0:T.options)==null?void 0:P.weekStartsOn)??o.weekStartsOn??((C=(O=o.locale)==null?void 0:O.options)==null?void 0:C.weekStartsOn)??0;if(!t)return n?s():N(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:r},h=[new Yb(i==null?void 0:i.in,e)],u=t.match(Ty).map(S=>{const E=S[0];if(E in uo){const I=uo[E];return I(S,r.formatLong)}return S}).join("").match(Py),d=[];for(let S of u){!(i!=null&&i.useAdditionalWeekYearTokens)&&jc(S)&&fo(S,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Vc(S)&&fo(S,t,n);const E=S[0],I=ky[E];if(I){const{incompatibleTokens:F}=I;if(Array.isArray(F)){const tt=d.find(rt=>F.includes(rt.token)||rt.token===E);if(tt)throw new RangeError(`The format string mustn't contain \`${tt.fullToken}\` and \`${S}\` at the same time`)}else if(I.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);d.push({token:E,fullToken:S});const z=I.run(n,S,r.match,c);if(!z)return s();h.push(z.setter),n=z.rest}else{if(E.match(Cy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");if(S==="''"?S="'":E==="'"&&(S=Ay(S)),n.indexOf(S)===0)n=n.slice(S.length);else return s()}}if(n.length>0&&Oy.test(n))return s();const g=h.map(S=>S.priority).sort((S,E)=>E-S).filter((S,E,I)=>I.indexOf(S)===E).map(S=>h.filter(E=>E.priority===S).sort((E,I)=>I.subPriority-E.subPriority)).map(S=>S[0]);let p=N(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const S of g){if(!S.validate(p,c))return s();const E=S.set(p,b,c);Array.isArray(E)?(p=E[0],Object.assign(b,E[1])):p=E}return p}function Ay(n){return n.match(Sy)[1].replace(Dy,"'")}function Iy(n,t){const e=N(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function Ly(n,t){const e=N(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Ry(n,t){const e=N(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Fy(n,t){const e=()=>st(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Hy(n);let o;if(s.date){const c=Yy(s.date,i);o=By(c.restDateString,c.year)}if(!o||isNaN(+o))return e();const r=+o;let a=0,l;if(s.time&&(a=Vy(s.time),isNaN(a)))return e();if(s.timezone){if(l=jy(s.timezone),isNaN(l))return e()}else{const c=new Date(r+a),h=N(0,t==null?void 0:t.in);return h.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),h.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),h}return N(r+a+l,t==null?void 0:t.in)}const Ri={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ny=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,zy=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Wy=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Hy(n){const t={},e=n.split(Ri.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Ri.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Ri.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Ri.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Yy(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:n.slice((i[1]||i[2]).length)}}function By(n,t){if(t===null)return new Date(NaN);const e=n.match(Ny);if(!e)return new Date(NaN);const i=!!e[4],s=On(e[1]),o=On(e[2])-1,r=On(e[3]),a=On(e[4]),l=On(e[5])-1;if(i)return Gy(t,a,l)?Xy(t,a,l):new Date(NaN);{const c=new Date(0);return!qy(t,o,r)||!$y(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}}function On(n){return n?parseInt(n):1}function Vy(n){const t=n.match(zy);if(!t)return NaN;const e=js(t[1]),i=js(t[2]),s=js(t[3]);return Qy(e,i,s)?e*ri+i*oi+s*1e3:NaN}function js(n){return n&&parseFloat(n.replace(",","."))||0}function jy(n){if(n==="Z")return 0;const t=n.match(Wy);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Zy(i,s)?e*(i*ri+s*oi):NaN}function Xy(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Uy=[31,null,31,30,31,30,31,31,30,31,30,31];function Gc(n){return n%400===0||n%4===0&&n%100!==0}function qy(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Uy[t]||(Gc(n)?29:28))}function $y(n,t){return t>=1&&t<=(Gc(n)?366:365)}function Gy(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Qy(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Zy(n,t){return t>=0&&t<=59}/*!
|
|
18
|
+
`):n}function ip(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:n,label:r,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Ja(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,l=ot(t.bodyFont),c=ot(t.titleFont),h=ot(t.footerFont),u=o.length,d=s.length,f=i.length,p=gt(t.padding);let b=p.height,x=0,_=i.reduce((T,P)=>T+P.before.length+P.lines.length+P.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,u&&(b+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),_){const T=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=f*T+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}d&&(b+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let w=0;const k=function(T){x=Math.max(x,e.measureText(T).width+w)};return e.save(),e.font=c.string,Y(n.title,k),e.font=l.string,Y(n.beforeBody.concat(n.afterBody),k),w=t.displayColors?r+2+t.boxPadding:0,Y(i,T=>{Y(T.before,k),Y(T.lines,k),Y(T.after,k)}),w=0,e.font=h.string,Y(n.footer,k),e.restore(),x+=p.width,{width:x,height:b}}function sp(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function op(n,t,e,i){const{x:s,width:o}=i,r=e.caretSize+e.caretPadding;if(n==="left"&&s+o+r>t.width||n==="right"&&s-o-r<0)return!0}function rp(n,t,e,i){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),op(c,n,t,e)&&(c="center"),c}function tl(n,t,e){const i=e.yAlign||t.yAlign||sp(n,e);return{xAlign:e.xAlign||t.xAlign||rp(n,t,e,i),yAlign:i}}function ap(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function lp(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function el(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=ve(r);let p=ap(t,a);const b=lp(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,d)+s:a==="right"&&(p+=Math.max(u,f)+s),{x:yt(p,0,i.width-t.width),y:yt(b,0,i.height-t.height)}}function Ki(n,t,e){const i=gt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function nl(n){return $t([],re(n))}function cp(n,t,e){return De(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function il(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const qc={beforeTitle:se,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:se,beforeBody:se,beforeLabel:se,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return V(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:se,afterBody:se,beforeFooter:se,footer:se,afterFooter:se};function St(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?qc[t].call(e,i):s}class ko extends xt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new lr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=cp(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=St(i,"beforeTitle",this,t),o=St(i,"title",this,t),r=St(i,"afterTitle",this,t);let a=[];return a=$t(a,re(s)),a=$t(a,re(o)),a=$t(a,re(r)),a}getBeforeBody(t,e){return nl(St(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return Y(t,o=>{const r={before:[],lines:[],after:[]},a=il(i,o);$t(r.before,re(St(a,"beforeLabel",this,o))),$t(r.lines,St(a,"label",this,o)),$t(r.after,re(St(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return nl(St(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=St(i,"beforeFooter",this,t),o=St(i,"footer",this,t),r=St(i,"afterFooter",this,t);let a=[];return a=$t(a,re(s)),a=$t(a,re(o)),a=$t(a,re(r)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(ip(this.chart,e[l]));return t.filter&&(a=a.filter((h,u,d)=>t.filter(h,u,d,i))),t.itemSort&&(a=a.sort((h,u)=>t.itemSort(h,u,i))),Y(a,h=>{const u=il(t.callbacks,h);s.push(St(u,"labelColor",this,h)),o.push(St(u,"labelPointStyle",this,h)),r.push(St(u,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=$n[i.position].call(this,s,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=Ja(this,i),c=Object.assign({},a,l),h=tl(this.chart,i,c),u=el(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=ve(a),{x:d,y:f}=t,{width:p,height:b}=e;let x,_,w,k,T,P;return o==="center"?(T=f+b/2,s==="left"?(x=d,_=x-r,k=T+r,P=T-r):(x=d+p,_=x+r,k=T-r,P=T+r),w=x):(s==="left"?_=d+Math.max(l,h)+r:s==="right"?_=d+p-Math.max(c,u)-r:_=this.caretX,o==="top"?(k=f,T=k-r,x=_-r,w=_+r):(k=f+b,T=k+r,x=_+r,w=_-r),P=k),{x1:x,x2:_,x3:w,y1:k,y2:T,y3:P}}drawTitle(t,e,i){const s=this.title,o=s.length;let r,a,l;if(o){const c=ln(i.rtl,this.x,this.width);for(t.x=Ki(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=ot(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){const r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=ot(o.bodyFont),u=Ki(this,"left",o),d=s.x(u),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},x=s.leftForLtr(d,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,bo(t,b,x,_),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,bo(t,b,x,_)}else{t.lineWidth=H(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const b=s.leftForLtr(d,c),x=s.leftForLtr(s.xPlus(d,1),c-2),_=ve(r.borderRadius);Object.values(_).some(w=>w!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,mn(t,{x:b,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),mn(t,{x,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,u=ot(i.bodyFont);let d=u.lineHeight,f=0;const p=ln(i.rtl,this.x,this.width),b=function(S){e.fillText(S,p.x(t.x+f),t.y+d/2),t.y+=d+o},x=p.textAlign(r);let _,w,k,T,P,O,C;for(e.textAlign=r,e.textBaseline="middle",e.font=u.string,t.x=Ki(this,x,i),e.fillStyle=i.bodyColor,Y(this.beforeBody,b),f=a&&x!=="right"?r==="center"?c/2+h:c+2+h:0,T=0,O=s.length;T<O;++T){for(_=s[T],w=this.labelTextColors[T],e.fillStyle=w,Y(_.before,b),k=_.lines,a&&k.length&&(this._drawColorBox(e,t,T,p,i),d=Math.max(u.lineHeight,l)),P=0,C=k.length;P<C;++P)b(k[P]),d=u.lineHeight;Y(_.after,b)}f=0,d=u.lineHeight,Y(this.afterBody,b),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let r,a;if(o){const l=ln(i.rtl,this.x,this.width);for(t.x=Ki(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",r=ot(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=ve(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+u,l),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-d,l),e.quadraticCurveTo(a+c,l,a+c,l+d),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+h-p),e.quadraticCurveTo(a+c,l+h,a+c-p,l+h),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,l+h),e.quadraticCurveTo(a,l+h,a,l+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+u),e.quadraticCurveTo(a,l,a+u,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const r=$n[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Ja(this,t),l=Object.assign({},r,this._size),c=tl(e,t,l),h=el(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){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},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=gt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,e),wc(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),vc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!ds(i,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!ds(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,r=$n[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}}v(ko,"positioners",$n);var hp={id:"tooltip",_element:ko,positioners:$n,afterInit(n,t,e){e&&(n.tooltip=new ko({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:qc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},up=Object.freeze({__proto__:null,Colors:Mm,Decimation:Sm,Filler:qm,Legend:Jm,SubTitle:np,Title:ep,Tooltip:hp});const dp=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function fp(n,t,e,i){const s=n.indexOf(t);if(s===-1)return dp(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const gp=(n,t)=>n===null?null:yt(Math.round(n),0,t);function sl(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Po extends Qe{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(V(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:fp(i,t,F(e,t),this._addedLabels),gp(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(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 o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let r=t;r<=e;r++)s.push({value:r});return s}getLabelForValue(t){return sl.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const 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}}v(Po,"id","category"),v(Po,"defaults",{ticks:{callback:sl}});function mp(n,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:d}=n,f=o||1,p=h-1,{min:b,max:x}=t,_=!V(r),w=!V(a),k=!V(c),T=(x-b)/(u+1);let P=Jr((x-b)/p/f)*f,O,C,S,E;if(P<1e-14&&!_&&!w)return[{value:b},{value:x}];E=Math.ceil(x/P)-Math.floor(b/P),E>p&&(P=Jr(E*P/p/f)*f),V(l)||(O=Math.pow(10,l),P=Math.ceil(P*O)/O),s==="ticks"?(C=Math.floor(b/P)*P,S=Math.ceil(x/P)*P):(C=b,S=x),_&&w&&o&&ld((a-r)/o,P/1e3)?(E=Math.round(Math.min((a-r)/P,h)),P=(a-r)/E,C=r,S=a):k?(C=_?r:C,S=w?a:S,E=c-1,P=(S-C)/E):(E=(S-C)/P,Xe(E,Math.round(E),P/1e3)?E=Math.round(E):E=Math.ceil(E));const L=Math.max(ta(P),ta(C));O=Math.pow(10,V(l)?L:l),C=Math.round(C*O)/O,S=Math.round(S*O)/O;let N=0;for(_&&(d&&C!==r?(e.push({value:r}),C<r&&N++,Xe(Math.round((C+N*P)*O)/O,r,ol(r,T,n))&&N++):C<r&&N++);N<E;++N){const W=Math.round((C+N*P)*O)/O;if(w&&W>a)break;e.push({value:W})}return w&&d&&S!==a?e.length&&Xe(e[e.length-1].value,a,ol(a,T,n))?e[e.length-1].value=a:e.push({value:a}):(!w||S===a)&&e.push({value:S}),e}function ol(n,t,{horizontal:e,minRotation:i}){const s=ft(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}class ws extends Qe{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 V(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=i?o:l;if(t){const l=Bt(s),c=Bt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}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:e.includeBounds!==!1},o=this._range||this,r=mp(s,o);return t.bounds==="ticks"&&oc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let 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 _i(t,this.chart.options.locale,this.options.ticks.format)}}class To extends ws{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=et(t)?t:0,this.max=et(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=ft(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}v(To,"id","linear"),v(To,"defaults",{ticks:{callback:Ts.formatters.numeric}});const ci=n=>Math.floor(be(n)),Fe=(n,t)=>Math.pow(10,ci(n)+t);function rl(n){return n/Math.pow(10,ci(n))===1}function al(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function pp(n,t){const e=t-n;let i=ci(e);for(;al(n,t,i)>10;)i++;for(;al(n,t,i)<10;)i--;return Math.min(i,ci(n))}function bp(n,{min:t,max:e}){t=Lt(n.min,t);const i=[],s=ci(t);let o=pp(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let u=Math.floor((c-h)/Math.pow(10,o)),d=Lt(n.min,Math.round((l+h+u*Math.pow(10,o))*r)/r);for(;d<e;)i.push({value:d,major:rl(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),d=Math.round((l+h+u*Math.pow(10,o))*r)/r;const f=Lt(n.max,d);return i.push({value:f,major:rl(f),significand:u}),i}class So extends Qe{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=ws.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return et(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=et(t)?Math.max(0,t):null,this.max=et(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!et(this._userMin)&&(this.min=t===Fe(this.min,0)?Fe(this.min,-1):Fe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=a=>i=t?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(Fe(i,-1)),r(Fe(s,1)))),i<=0&&o(Fe(s,-1)),s<=0&&r(Fe(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=bp(e,this);return t.bounds==="ticks"&&oc(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 t===void 0?"0":_i(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=be(t),this._valueRange=be(this.max)-be(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(be(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}v(So,"id","logarithmic"),v(So,"defaults",{ticks:{callback:Ts.formatters.logarithmic,major:{enabled:!0}}});function Do(n){const t=n.ticks;if(t.display&&n.display){const e=gt(t.backdropPadding);return F(t.font&&t.font.size,Z.font.size)+e.height}return 0}function yp(n,t,e){return e=q(e)?e:[e],{w:Pd(n,t.string,e),h:e.length*t.lineHeight}}function ll(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function xp(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,r=n.options.pointLabels,a=r.centerPointLabels?j/o:0;for(let l=0;l<o;l++){const c=r.setContext(n.getPointLabelContext(l));s[l]=c.padding;const h=n.getPointPosition(l,n.drawingArea+s[l],a),u=ot(c.font),d=yp(n.ctx,u,n._pointLabels[l]);i[l]=d;const f=Rt(n.getIndexAngle(l)+a),p=Math.round(Ps(f)),b=ll(p,h.x,d.w,0,180),x=ll(p,h.y,d.h,90,270);_p(e,t,f,b,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Mp(n,i,s)}function _p(n,t,e,i,s){const o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+l))}function wp(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=n.getPointPosition(t,i+s+r,o),c=Math.round(Ps(Rt(l.angle+K))),h=Tp(l.y,a.h,c),u=kp(c),d=Pp(l.x,a.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function vp(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Jt({x:e,y:i},t)||Jt({x:e,y:o},t)||Jt({x:s,y:i},t)||Jt({x:s,y:o},t))}function Mp(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Do(o)/2,additionalAngle:r?j/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const u=wp(n,h,l);i.push(u),a==="auto"&&(u.visible=vp(u,c),u.visible&&(c=u))}return i}function kp(n){return n===0||n===180?"center":n<180?"left":"right"}function Pp(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Tp(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Sp(n,t,e){const{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!V(a)){const l=ve(t.borderRadius),c=gt(t.backdropPadding);n.fillStyle=a;const h=i-c.left,u=s-c.top,d=o-i+c.width,f=r-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),mn(n,{x:h,y:u,w:d,h:f,radius:l}),n.fill()):n.fillRect(h,u,d,f)}}function Dp(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const r=i.setContext(n.getPointLabelContext(s));Sp(e,r,o);const a=ot(r.font),{x:l,y:c,textAlign:h}=o;$e(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function $c(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,G);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<i;r++)o=n.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function Op(n,t,e,i,s){const o=n.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!i||!a||!l||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),$c(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function Cp(n,t,e){return De(n,{label:e,index:t,type:"pointLabel"})}class Gn extends ws{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=gt(Do(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=et(t)&&!isNaN(t)?t:0,this.max=et(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Do(this.options))}generateTickLabels(t){ws.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=R(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?xp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=G/(this._pointLabels.length||1),i=this.options.startAngle||0;return Rt(t*e+ft(i))}getDistanceFromCenterForValue(t){if(V(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(V(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 Cp(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-K+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}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:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),$c(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&Dp(this,r),s.display&&this.ticks.forEach((h,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const d=this.getContext(u),f=s.setContext(d),p=o.setContext(d);Op(this,f,l,r,p)}}),i.display){for(t.save(),a=r-1;a>=0;a--){const h=i.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:d}=h;!d||!u||(t.lineWidth=d,t.strokeStyle=u,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),h=ot(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const u=gt(c.backdropPadding);t.fillRect(-r/2-u.left,-o-h.size/2-u.top,r+u.width,h.size+u.height)}$e(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}v(Gn,"id","radialLinear"),v(Gn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ts.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),v(Gn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),v(Gn,"descriptors",{angleLines:{_fallback:"grid"}});const Os={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}},Ct=Object.keys(Os);function cl(n,t){return n-t}function hl(n,t){if(V(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),et(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Pe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function ul(n,t,e,i){const s=Ct.length;for(let o=Ct.indexOf(n);o<s-1;++o){const r=Os[Ct[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return Ct[o]}return Ct[s-1]}function Ep(n,t,e,i,s){for(let o=Ct.length-1;o>=Ct.indexOf(e);o--){const r=Ct[o];if(Os[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return Ct[e?Ct.indexOf(e):0]}function Ap(n){for(let t=Ct.indexOf(n)+1,e=Ct.length;t<e;++t)if(Os[Ct[t]].common)return Ct[t]}function dl(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Jo(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function Ip(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function fl(n,t,e){const i=[],s={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,i.push({value:a,major:!1});return o===0||!e?i:Ip(n,i,s,e)}class hi extends Qe{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 Dc._date(t.adapters.date);s.init(e),Kn(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 t===void 0?null:hl(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:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=et(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=et(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_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=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,r=this.max,a=dd(s,o,r);return this._unit=e.unit||(i.autoSkip?ul(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Ep(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Ap(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),fl(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=yt(e,0,r),i=yt(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||ul(o.minUnit,e,i,this._getLabelCapacity(e)),a=F(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Pe(l)||l===!0,h={};let u=e,d,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<i;d=+t.add(d,a,r),f++)dl(h,d,p);return(d===i||s.bounds==="ticks"||f===1)&&dl(h,d,p),Object.keys(h).sort(cl).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){const o=this.options,r=o.ticks.callback;if(r)return R(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],u=c&&a[c],d=i[e],f=c&&u&&d&&d.major;return this._adapter.format(t,s||(f?u:h))}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 t===null?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=ft(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*o+a*r,h:i*r+a*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,fl(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}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(hl(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ac(t.sort(cl))}}v(hi,"id","time"),v(hi,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Zi(n,t,e){let i=0,s=n.length-1,o,r,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=ce(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=ce(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:l}=n[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Oo extends hi{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=Zi(e,this.min),this._tableRange=Zi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=s.length;r<a;++r)h=s[r+1],l=s[r-1],c=s[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Zi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Zi(this._table,i*this._tableRange+this._minPos,!0)}}v(Oo,"id","timeseries"),v(Oo,"defaults",hi.defaults);var Lp=Object.freeze({__proto__:null,CategoryScale:Po,LinearScale:To,LogarithmicScale:So,RadialLinearScale:Gn,TimeScale:hi,TimeSeriesScale:Oo});const Rp=[Bf,pm,up,Lp];Pt.register(...Rp);const Gc=6048e5,Fp=864e5,Mi=6e4,ki=36e5,Np=1e3,gl=Symbol.for("constructDateFrom");function rt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&gl in n?n[gl](t):n instanceof Date?new n.constructor(t):new Date(t)}function z(n,t){return rt(t||n,n)}function Cs(n,t,e){const i=z(n,e==null?void 0:e.in);return isNaN(t)?rt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function dr(n,t,e){const i=z(n,e==null?void 0:e.in);if(isNaN(t))return rt(n,NaN);if(!t)return i;const s=i.getDate(),o=rt(n,i.getTime());o.setMonth(i.getMonth()+t+1,0);const r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function fr(n,t,e){return rt(n,+z(n)+t)}function zp(n,t,e){return fr(n,t*ki)}let Wp={};function Ke(){return Wp}function te(n,t){var a,l,c,h;const e=Ke(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((h=(c=e.locale)==null?void 0:c.options)==null?void 0:h.weekStartsOn)??0,s=z(n,t==null?void 0:t.in),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function yn(n,t){return te(n,{...t,weekStartsOn:1})}function Qc(n,t){const e=z(n,t==null?void 0:t.in),i=e.getFullYear(),s=rt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=yn(s),r=rt(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);const a=yn(r);return e.getTime()>=o.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function vs(n){const t=z(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Ze(n,...t){const e=rt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Co(n,t){const e=z(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function Kc(n,t,e){const[i,s]=Ze(e==null?void 0:e.in,n,t),o=Co(i),r=Co(s),a=+o-vs(o),l=+r-vs(r);return Math.round((a-l)/Fp)}function Hp(n,t){const e=Qc(n,t),i=rt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),yn(i)}function Bp(n,t,e){const i=z(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*Mi),i}function Yp(n,t,e){return dr(n,t*3,e)}function Vp(n,t,e){return fr(n,t*1e3)}function jp(n,t,e){return Cs(n,t*7,e)}function Xp(n,t,e){return dr(n,t*12,e)}function ei(n,t){const e=+z(n)-+z(t);return e<0?-1:e>0?1:e}function Up(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Zc(n){return!(!Up(n)&&typeof n!="number"||isNaN(+z(n)))}function qp(n,t,e){const[i,s]=Ze(e==null?void 0:e.in,n,t),o=i.getFullYear()-s.getFullYear(),r=i.getMonth()-s.getMonth();return o*12+r}function $p(n,t,e){const[i,s]=Ze(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function Jc(n,t,e){const[i,s]=Ze(e==null?void 0:e.in,n,t),o=ml(i,s),r=Math.abs(Kc(i,s));i.setDate(i.getDate()-o*r);const a=+(ml(i,s)===-o),l=o*(r-a);return l===0?0:l}function ml(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Pi(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function Gp(n,t,e){const[i,s]=Ze(e==null?void 0:e.in,n,t),o=(+i-+s)/ki;return Pi(e==null?void 0:e.roundingMethod)(o)}function gr(n,t){return+z(n)-+z(t)}function Qp(n,t,e){const i=gr(n,t)/Mi;return Pi(e==null?void 0:e.roundingMethod)(i)}function th(n,t){const e=z(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function eh(n,t){const e=z(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function Kp(n,t){const e=z(n,t==null?void 0:t.in);return+th(e,t)==+eh(e,t)}function nh(n,t,e){const[i,s,o]=Ze(e==null?void 0:e.in,n,n,t),r=ei(s,o),a=Math.abs(qp(s,o));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*a);let l=ei(s,o)===-r;Kp(i)&&a===1&&ei(i,o)===1&&(l=!1);const c=r*(a-+l);return c===0?0:c}function Zp(n,t,e){const i=nh(n,t,e)/3;return Pi(e==null?void 0:e.roundingMethod)(i)}function Jp(n,t,e){const i=gr(n,t)/1e3;return Pi(e==null?void 0:e.roundingMethod)(i)}function tb(n,t,e){const i=Jc(n,t,e)/7;return Pi(e==null?void 0:e.roundingMethod)(i)}function eb(n,t,e){const[i,s]=Ze(e==null?void 0:e.in,n,t),o=ei(i,s),r=Math.abs($p(i,s));i.setFullYear(1584),s.setFullYear(1584);const a=ei(i,s)===-o,l=o*(r-+a);return l===0?0:l}function nb(n,t){const e=z(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function ib(n,t){const e=z(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function sb(n,t){const e=z(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function ih(n,t){const e=z(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function ob(n,t){const e=z(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function rb(n,t){var a,l;const e=Ke(),i=e.weekStartsOn??((l=(a=e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??0,s=z(n,t==null?void 0:t.in),o=s.getDay(),r=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+r),s.setHours(23,59,59,999),s}function ab(n,t){const e=z(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function lb(n,t){const e=z(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function cb(n,t){const e=z(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const hb={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ub=(n,t,e)=>{let i;const s=hb[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function lo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const db={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mb={date:lo({formats:db,defaultWidth:"full"}),time:lo({formats:fb,defaultWidth:"full"}),dateTime:lo({formats:gb,defaultWidth:"full"})},pb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},bb=(n,t,e,i)=>pb[n];function zn(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const r=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):r;s=n.formattingValues[a]||n.formattingValues[r]}else{const r=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[r]}const o=n.argumentCallback?n.argumentCallback(t):t;return s[o]}}const yb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},xb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_b={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},wb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},vb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Mb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},kb=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},Pb={ordinalNumber:kb,era:zn({values:yb,defaultWidth:"wide"}),quarter:zn({values:xb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:zn({values:_b,defaultWidth:"wide"}),day:zn({values:wb,defaultWidth:"wide"}),dayPeriod:zn({values:vb,defaultWidth:"wide",formattingValues:Mb,defaultFormattingWidth:"wide"})};function Wn(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=t.match(s);if(!o)return null;const r=o[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?Sb(a,u=>u.test(r)):Tb(a,u=>u.test(r));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const h=t.slice(r.length);return{value:c,rest:h}}}function Tb(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Sb(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Db(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],o=t.match(n.parsePattern);if(!o)return null;let r=n.valueCallback?n.valueCallback(o[0]):o[0];r=e.valueCallback?e.valueCallback(r):r;const a=t.slice(s.length);return{value:r,rest:a}}}const Ob=/^(\d+)(th|st|nd|rd)?/i,Cb=/\d+/i,Eb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ab={any:[/^b/i,/^(a|c)/i]},Ib={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Lb={any:[/1/i,/2/i,/3/i,/4/i]},Rb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Fb={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Nb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},zb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Wb={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Hb={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Bb={ordinalNumber:Db({matchPattern:Ob,parsePattern:Cb,valueCallback:n=>parseInt(n,10)}),era:Wn({matchPatterns:Eb,defaultMatchWidth:"wide",parsePatterns:Ab,defaultParseWidth:"any"}),quarter:Wn({matchPatterns:Ib,defaultMatchWidth:"wide",parsePatterns:Lb,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Wn({matchPatterns:Rb,defaultMatchWidth:"wide",parsePatterns:Fb,defaultParseWidth:"any"}),day:Wn({matchPatterns:Nb,defaultMatchWidth:"wide",parsePatterns:zb,defaultParseWidth:"any"}),dayPeriod:Wn({matchPatterns:Wb,defaultMatchWidth:"any",parsePatterns:Hb,defaultParseWidth:"any"})},sh={code:"en-US",formatDistance:ub,formatLong:mb,formatRelative:bb,localize:Pb,match:Bb,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Yb(n,t){const e=z(n,t==null?void 0:t.in);return Kc(e,ih(e))+1}function oh(n,t){const e=z(n,t==null?void 0:t.in),i=+yn(e)-+Hp(e);return Math.round(i/Gc)+1}function mr(n,t){var h,u,d,f;const e=z(n,t==null?void 0:t.in),i=e.getFullYear(),s=Ke(),o=(t==null?void 0:t.firstWeekContainsDate)??((u=(h=t==null?void 0:t.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((f=(d=s.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,r=rt((t==null?void 0:t.in)||n,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);const a=te(r,t),l=rt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=te(l,t);return+e>=+a?i+1:+e>=+c?i:i-1}function Vb(n,t){var a,l,c,h;const e=Ke(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((h=(c=e.locale)==null?void 0:c.options)==null?void 0:h.firstWeekContainsDate)??1,s=mr(n,t),o=rt((t==null?void 0:t.in)||n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),te(o,t)}function rh(n,t){const e=z(n,t==null?void 0:t.in),i=+te(e,t)-+Vb(e,t);return Math.round(i/Gc)+1}function $(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const ge={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return $(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):$(e+1,2)},d(n,t){return $(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return $(n.getHours()%12||12,t.length)},H(n,t){return $(n.getHours(),t.length)},m(n,t){return $(n.getMinutes(),t.length)},s(n,t){return $(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return $(s,t.length)}},an={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},pl={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return ge.y(n,t)},Y:function(n,t,e,i){const s=mr(n,i),o=s>0?s:1-s;if(t==="YY"){const r=o%100;return $(r,2)}return t==="Yo"?e.ordinalNumber(o,{unit:"year"}):$(o,t.length)},R:function(n,t){const e=Qc(n);return $(e,t.length)},u:function(n,t){const e=n.getFullYear();return $(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return $(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return $(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return ge.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return $(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=rh(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):$(s,t.length)},I:function(n,t,e){const i=oh(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):$(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):ge.d(n,t)},D:function(n,t,e){const i=Yb(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):$(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return $(o,2);case"eo":return e.ordinalNumber(o,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return $(o,t.length);case"co":return e.ordinalNumber(o,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return $(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=an.noon:i===0?s=an.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=an.evening:i>=12?s=an.afternoon:i>=4?s=an.morning:s=an.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return ge.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):ge.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):$(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):$(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):ge.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):ge.s(n,t)},S:function(n,t){return ge.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return yl(i);case"XXXX":case"XX":return ze(i);case"XXXXX":case"XXX":default:return ze(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return yl(i);case"xxxx":case"xx":return ze(i);case"xxxxx":case"xxx":default:return ze(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+bl(i,":");case"OOOO":default:return"GMT"+ze(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+bl(i,":");case"zzzz":default:return"GMT"+ze(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return $(i,t.length)},T:function(n,t,e){return $(+n,t.length)}};function bl(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),o=i%60;return o===0?e+String(s):e+String(s)+t+$(o,2)}function yl(n,t){return n%60===0?(n>0?"-":"+")+$(Math.abs(n)/60,2):ze(n,t)}function ze(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=$(Math.trunc(i/60),2),o=$(i%60,2);return e+s+t+o}const xl=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},ah=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},jb=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return xl(n,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",xl(i,t)).replace("{{time}}",ah(s,t))},Eo={p:ah,P:jb},Xb=/^D+$/,Ub=/^Y+$/,qb=["D","DD","YY","YYYY"];function lh(n){return Xb.test(n)}function ch(n){return Ub.test(n)}function Ao(n,t,e){const i=$b(n,t,e);if(console.warn(i),qb.includes(n))throw new RangeError(i)}function $b(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Gb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Kb=/^'([^]*?)'?$/,Zb=/''/g,Jb=/[a-zA-Z]/;function ty(n,t,e){var h,u,d,f,p,b,x,_;const i=Ke(),s=(e==null?void 0:e.locale)??i.locale??sh,o=(e==null?void 0:e.firstWeekContainsDate)??((u=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:u.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(d=i.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,r=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((_=(x=i.locale)==null?void 0:x.options)==null?void 0:_.weekStartsOn)??0,a=z(n,e==null?void 0:e.in);if(!Zc(a))throw new RangeError("Invalid time value");let l=t.match(Qb).map(w=>{const k=w[0];if(k==="p"||k==="P"){const T=Eo[k];return T(w,s.formatLong)}return w}).join("").match(Gb).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const k=w[0];if(k==="'")return{isToken:!1,value:ey(w)};if(pl[k])return{isToken:!0,value:w};if(k.match(Jb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:w}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return l.map(w=>{if(!w.isToken)return w.value;const k=w.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ch(k)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&lh(k))&&Ao(k,t,String(n));const T=pl[k[0]];return T(a,k,s.localize,c)}).join("")}function ey(n){const t=n.match(Kb);return t?t[1].replace(Zb,"'"):n}function ny(){return Object.assign({},Ke())}function iy(n,t){const e=z(n,t==null?void 0:t.in).getDay();return e===0?7:e}function sy(n,t){const e=oy(t)?new t(0):rt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function oy(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const ry=10;class hh{constructor(){v(this,"subPriority",0)}validate(t,e){return!0}}class ay extends hh{constructor(t,e,i,s,o){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class ly extends hh{constructor(e,i){super();v(this,"priority",ry);v(this,"subPriority",-1);this.context=e||(s=>rt(i,s))}set(e,i){return i.timestampIsSet?e:rt(e,sy(e,this.context))}}class X{run(t,e,i,s){const o=this.parse(t,e,i,s);return o?{setter:new ay(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,i){return!0}}class cy extends X{constructor(){super(...arguments);v(this,"priority",140);v(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const ct={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Kt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function ht(n,t){return n&&{value:t(n.value),rest:n.rest}}function it(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Zt(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,o=e[3]?parseInt(e[3],10):0,r=e[5]?parseInt(e[5],10):0;return{value:i*(s*ki+o*Mi+r*Np),rest:t.slice(e[0].length)}}function uh(n){return it(ct.anyDigitsSigned,n)}function at(n,t){switch(n){case 1:return it(ct.singleDigit,t);case 2:return it(ct.twoDigits,t);case 3:return it(ct.threeDigits,t);case 4:return it(ct.fourDigits,t);default:return it(new RegExp("^\\d{1,"+n+"}"),t)}}function Ms(n,t){switch(n){case 1:return it(ct.singleDigitSigned,t);case 2:return it(ct.twoDigitsSigned,t);case 3:return it(ct.threeDigitsSigned,t);case 4:return it(ct.fourDigitsSigned,t);default:return it(new RegExp("^-?\\d{1,"+n+"}"),t)}}function pr(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function dh(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const o=i+50,r=Math.trunc(o/100)*100,a=n>=o%100;s=n+r-(a?100:0)}return e?s:1-s}function fh(n){return n%400===0||n%4===0&&n%100!==0}class hy extends X{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const o=r=>({year:r,isTwoDigitYear:i==="yy"});switch(i){case"y":return ht(at(4,e),o);case"yo":return ht(s.ordinalNumber(e,{unit:"year"}),o);default:return ht(at(i.length,e),o)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const o=e.getFullYear();if(s.isTwoDigitYear){const a=dh(s.year,o);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const r=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}class uy extends X{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const o=r=>({year:r,isTwoDigitYear:i==="YY"});switch(i){case"Y":return ht(at(4,e),o);case"Yo":return ht(s.ordinalNumber(e,{unit:"year"}),o);default:return ht(at(i.length,e),o)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,o){const r=mr(e,o);if(s.isTwoDigitYear){const l=dh(s.year,r);return e.setFullYear(l,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),te(e,o)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,o.firstWeekContainsDate),e.setHours(0,0,0,0),te(e,o)}}class dy extends X{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Ms(i==="R"?4:i.length,e)}set(e,i,s){const o=rt(e,0);return o.setFullYear(s,0,4),o.setHours(0,0,0,0),yn(o)}}class fy extends X{constructor(){super(...arguments);v(this,"priority",130);v(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Ms(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class gy extends X{constructor(){super(...arguments);v(this,"priority",120);v(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return at(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class my extends X{constructor(){super(...arguments);v(this,"priority",120);v(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return at(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class py extends X{constructor(){super(...arguments);v(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);v(this,"priority",110)}parse(e,i,s){const o=r=>r-1;switch(i){case"M":return ht(it(ct.month,e),o);case"MM":return ht(at(2,e),o);case"Mo":return ht(s.ordinalNumber(e,{unit:"month"}),o);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class by extends X{constructor(){super(...arguments);v(this,"priority",110);v(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const o=r=>r-1;switch(i){case"L":return ht(it(ct.month,e),o);case"LL":return ht(at(2,e),o);case"Lo":return ht(s.ordinalNumber(e,{unit:"month"}),o);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function yy(n,t,e){const i=z(n,e==null?void 0:e.in),s=rh(i,e)-t;return i.setDate(i.getDate()-s*7),z(i,e==null?void 0:e.in)}class xy extends X{constructor(){super(...arguments);v(this,"priority",100);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return it(ct.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return at(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,o){return te(yy(e,s,o),o)}}function _y(n,t,e){const i=z(n,e==null?void 0:e.in),s=oh(i,e)-t;return i.setDate(i.getDate()-s*7),i}class wy extends X{constructor(){super(...arguments);v(this,"priority",100);v(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return it(ct.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return at(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return yn(_y(e,s))}}const vy=[31,28,31,30,31,30,31,31,30,31,30,31],My=[31,29,31,30,31,30,31,31,30,31,30,31];class ky extends X{constructor(){super(...arguments);v(this,"priority",90);v(this,"subPriority",1);v(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return it(ct.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return at(i.length,e)}}validate(e,i){const s=e.getFullYear(),o=fh(s),r=e.getMonth();return o?i>=1&&i<=My[r]:i>=1&&i<=vy[r]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Py extends X{constructor(){super(...arguments);v(this,"priority",90);v(this,"subpriority",1);v(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return it(ct.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return at(i.length,e)}}validate(e,i){const s=e.getFullYear();return fh(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function br(n,t,e){var u,d,f,p;const i=Ke(),s=(e==null?void 0:e.weekStartsOn)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??i.weekStartsOn??((p=(f=i.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,o=z(n,e==null?void 0:e.in),r=o.getDay(),l=(t%7+7)%7,c=7-s,h=t<0||t>6?t-(r+c)%7:(l+c)%7-(r+c)%7;return Cs(o,h,e)}class Ty extends X{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,o){return e=br(e,s,o),e.setHours(0,0,0,0),e}}class Sy extends X{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,o){const r=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return ht(at(i.length,e),r);case"eo":return ht(s.ordinalNumber(e,{unit:"day"}),r);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,o){return e=br(e,s,o),e.setHours(0,0,0,0),e}}class Dy extends X{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,o){const r=a=>{const l=Math.floor((a-1)/7)*7;return(a+o.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return ht(at(i.length,e),r);case"co":return ht(s.ordinalNumber(e,{unit:"day"}),r);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,o){return e=br(e,s,o),e.setHours(0,0,0,0),e}}function Oy(n,t,e){const i=z(n,e==null?void 0:e.in),s=iy(i,e),o=t-s;return Cs(i,o,e)}class Cy extends X{constructor(){super(...arguments);v(this,"priority",90);v(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const o=r=>r===0?7:r;switch(i){case"i":case"ii":return at(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return ht(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),o);case"iiiii":return ht(s.day(e,{width:"narrow",context:"formatting"}),o);case"iiiiii":return ht(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),o);case"iiii":default:return ht(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),o)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=Oy(e,s),e.setHours(0,0,0,0),e}}class Ey extends X{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(pr(s),0,0,0),e}}class Ay extends X{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(pr(s),0,0,0),e}}class Iy extends X{constructor(){super(...arguments);v(this,"priority",80);v(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(pr(s),0,0,0),e}}class Ly extends X{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return it(ct.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return at(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const o=e.getHours()>=12;return o&&s<12?e.setHours(s+12,0,0,0):!o&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class Ry extends X{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return it(ct.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return at(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class Fy extends X{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return it(ct.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return at(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class Ny extends X{constructor(){super(...arguments);v(this,"priority",70);v(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return it(ct.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return at(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const o=s<=24?s%24:s;return e.setHours(o,0,0,0),e}}class zy extends X{constructor(){super(...arguments);v(this,"priority",60);v(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return it(ct.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return at(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class Wy extends X{constructor(){super(...arguments);v(this,"priority",50);v(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return it(ct.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return at(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class Hy extends X{constructor(){super(...arguments);v(this,"priority",30);v(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=o=>Math.trunc(o*Math.pow(10,-i.length+3));return ht(at(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class By extends X{constructor(){super(...arguments);v(this,"priority",10);v(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Zt(Kt.basicOptionalMinutes,e);case"XX":return Zt(Kt.basic,e);case"XXXX":return Zt(Kt.basicOptionalSeconds,e);case"XXXXX":return Zt(Kt.extendedOptionalSeconds,e);case"XXX":default:return Zt(Kt.extended,e)}}set(e,i,s){return i.timestampIsSet?e:rt(e,e.getTime()-vs(e)-s)}}class Yy extends X{constructor(){super(...arguments);v(this,"priority",10);v(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Zt(Kt.basicOptionalMinutes,e);case"xx":return Zt(Kt.basic,e);case"xxxx":return Zt(Kt.basicOptionalSeconds,e);case"xxxxx":return Zt(Kt.extendedOptionalSeconds,e);case"xxx":default:return Zt(Kt.extended,e)}}set(e,i,s){return i.timestampIsSet?e:rt(e,e.getTime()-vs(e)-s)}}class Vy extends X{constructor(){super(...arguments);v(this,"priority",40);v(this,"incompatibleTokens","*")}parse(e){return uh(e)}set(e,i,s){return[rt(e,s*1e3),{timestampIsSet:!0}]}}class jy extends X{constructor(){super(...arguments);v(this,"priority",20);v(this,"incompatibleTokens","*")}parse(e){return uh(e)}set(e,i,s){return[rt(e,s),{timestampIsSet:!0}]}}const Xy={G:new cy,y:new hy,Y:new uy,R:new dy,u:new fy,Q:new gy,q:new my,M:new py,L:new by,w:new xy,I:new wy,d:new ky,D:new Py,E:new Ty,e:new Sy,c:new Dy,i:new Cy,a:new Ey,b:new Ay,B:new Iy,h:new Ly,H:new Ry,K:new Fy,k:new Ny,m:new zy,s:new Wy,S:new Hy,X:new By,x:new Yy,t:new Vy,T:new jy},Uy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$y=/^'([^]*?)'?$/,Gy=/''/g,Qy=/\S/,Ky=/[a-zA-Z]/;function Zy(n,t,e,i){var x,_,w,k,T,P,O,C;const s=()=>rt((i==null?void 0:i.in)||e,NaN),o=ny(),r=(i==null?void 0:i.locale)??o.locale??sh,a=(i==null?void 0:i.firstWeekContainsDate)??((_=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:_.firstWeekContainsDate)??o.firstWeekContainsDate??((k=(w=o.locale)==null?void 0:w.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((P=(T=i==null?void 0:i.locale)==null?void 0:T.options)==null?void 0:P.weekStartsOn)??o.weekStartsOn??((C=(O=o.locale)==null?void 0:O.options)==null?void 0:C.weekStartsOn)??0;if(!t)return n?s():z(e,i==null?void 0:i.in);const c={firstWeekContainsDate:a,weekStartsOn:l,locale:r},h=[new ly(i==null?void 0:i.in,e)],u=t.match(qy).map(S=>{const E=S[0];if(E in Eo){const L=Eo[E];return L(S,r.formatLong)}return S}).join("").match(Uy),d=[];for(let S of u){!(i!=null&&i.useAdditionalWeekYearTokens)&&ch(S)&&Ao(S,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&lh(S)&&Ao(S,t,n);const E=S[0],L=Xy[E];if(L){const{incompatibleTokens:N}=L;if(Array.isArray(N)){const nt=d.find(lt=>N.includes(lt.token)||lt.token===E);if(nt)throw new RangeError(`The format string mustn't contain \`${nt.fullToken}\` and \`${S}\` at the same time`)}else if(L.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${S}\` and any other token at the same time`);d.push({token:E,fullToken:S});const W=L.run(n,S,r.match,c);if(!W)return s();h.push(W.setter),n=W.rest}else{if(E.match(Ky))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");if(S==="''"?S="'":E==="'"&&(S=Jy(S)),n.indexOf(S)===0)n=n.slice(S.length);else return s()}}if(n.length>0&&Qy.test(n))return s();const f=h.map(S=>S.priority).sort((S,E)=>E-S).filter((S,E,L)=>L.indexOf(S)===E).map(S=>h.filter(E=>E.priority===S).sort((E,L)=>L.subPriority-E.subPriority)).map(S=>S[0]);let p=z(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const S of f){if(!S.validate(p,c))return s();const E=S.set(p,b,c);Array.isArray(E)?(p=E[0],Object.assign(b,E[1])):p=E}return p}function Jy(n){return n.match($y)[1].replace(Gy,"'")}function t0(n,t){const e=z(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function e0(n,t){const e=z(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function n0(n,t){const e=z(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function i0(n,t){const e=()=>rt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=a0(n);let o;if(s.date){const c=l0(s.date,i);o=c0(c.restDateString,c.year)}if(!o||isNaN(+o))return e();const r=+o;let a=0,l;if(s.time&&(a=h0(s.time),isNaN(a)))return e();if(s.timezone){if(l=u0(s.timezone),isNaN(l))return e()}else{const c=new Date(r+a),h=z(0,t==null?void 0:t.in);return h.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),h.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),h}return z(r+a+l,t==null?void 0:t.in)}const Ji={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},s0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,o0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,r0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function a0(n){const t={},e=n.split(Ji.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Ji.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Ji.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Ji.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function l0(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:n.slice((i[1]||i[2]).length)}}function c0(n,t){if(t===null)return new Date(NaN);const e=n.match(s0);if(!e)return new Date(NaN);const i=!!e[4],s=Hn(e[1]),o=Hn(e[2])-1,r=Hn(e[3]),a=Hn(e[4]),l=Hn(e[5])-1;if(i)return p0(t,a,l)?d0(t,a,l):new Date(NaN);{const c=new Date(0);return!g0(t,o,r)||!m0(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,r)),c)}}function Hn(n){return n?parseInt(n):1}function h0(n){const t=n.match(o0);if(!t)return NaN;const e=co(t[1]),i=co(t[2]),s=co(t[3]);return b0(e,i,s)?e*ki+i*Mi+s*1e3:NaN}function co(n){return n&&parseFloat(n.replace(",","."))||0}function u0(n){if(n==="Z")return 0;const t=n.match(r0);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return y0(i,s)?e*(i*ki+s*Mi):NaN}function d0(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const f0=[31,null,31,30,31,30,31,31,30,31,30,31];function gh(n){return n%400===0||n%4===0&&n%100!==0}function g0(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(f0[t]||(gh(n)?29:28))}function m0(n,t){return t>=1&&t<=(gh(n)?366:365)}function p0(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function b0(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function y0(n,t){return t>=0&&t<=59}/*!
|
|
19
19
|
* chartjs-adapter-date-fns v3.0.0
|
|
20
20
|
* https://www.chartjs.org
|
|
21
21
|
* (c) 2022 chartjs-adapter-date-fns Contributors
|
|
22
22
|
* Released under the MIT license
|
|
23
|
-
*/const
|
|
23
|
+
*/const x0={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Dc._date.override({_id:"date-fns",formats:function(){return x0},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=z(n):e==="string"&&(typeof t=="string"?n=Zy(n,t,new Date,this.options):n=i0(n,this.options)),Zc(n)?n.getTime():null},format:function(n,t){return ty(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return fr(n,t);case"second":return Vp(n,t);case"minute":return Bp(n,t);case"hour":return zp(n,t);case"day":return Cs(n,t);case"week":return jp(n,t);case"month":return dr(n,t);case"quarter":return Yp(n,t);case"year":return Xp(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return gr(n,t);case"second":return Jp(n,t);case"minute":return Qp(n,t);case"hour":return Gp(n,t);case"day":return Jc(n,t);case"week":return tb(n,t);case"month":return nh(n,t);case"quarter":return Zp(n,t);case"year":return eb(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return n0(n);case"minute":return e0(n);case"hour":return t0(n);case"day":return Co(n);case"week":return te(n);case"isoWeek":return te(n,{weekStartsOn:+e});case"month":return ib(n);case"quarter":return nb(n);case"year":return ih(n);default:return n}},endOf:function(n,t){switch(t){case"second":return cb(n);case"minute":return ab(n);case"hour":return ob(n);case"day":return th(n);case"week":return rb(n);case"month":return eh(n);case"quarter":return lb(n);case"year":return sb(n);default:return n}}});/*!
|
|
24
24
|
* chartjs-plugin-autocolors v0.3.1
|
|
25
25
|
* https://github.com/kurkle/chartjs-plugin-autocolors#readme
|
|
26
26
|
* (c) 2024 Jukka Kurkela <jukka.kurkela@gmail.com>
|
|
27
27
|
* Released under the MIT license
|
|
28
|
-
*/function*
|
|
28
|
+
*/function*_0(){for(yield 0;;)for(let n=1;n<10;n++){const t=1<<n;for(let e=1;e<=t;e+=2)yield e/t}}function*w0(n=1){const t=_0();let e=t.next();for(;!e.done;){let i=mo(Math.round(e.value*360),.6,.8);for(let s=0;s<n;s++)yield{background:jn({r:i[0],g:i[1],b:i[2],a:192}),border:jn({r:i[0],g:i[1],b:i[2],a:144})};i=mo(Math.round(e.value*360),.6,.5);for(let s=0;s<n;s++)yield{background:jn({r:i[0],g:i[1],b:i[2],a:192}),border:jn({r:i[0],g:i[1],b:i[2],a:144})};e=t.next()}}function Io(n,t,e,i){return i==="data"?(n.backgroundColor=t,n.border=e):(n.backgroundColor=n.backgroundColor||t,n.borderColor=n.borderColor||e),n.backgroundColor===t&&n.borderColor===e}function hs(n,t,e){const i=n.next().value;return typeof t=="function"?t(Object.assign({colors:i},e)):i}function v0(n,t,e,i){const s=i==="dataset";let o=hs(t,e,{chart:n,datasetIndex:0,dataIndex:s?void 0:0});for(const r of n.data.datasets)if(s)Io(r,o.background,o.border,i)&&(o=hs(t,e,{chart:n,datasetIndex:r.index}));else{const a=[],l=[];for(let c=0;c<r.data.length;c++)a.push(o.background),l.push(o.border),o=hs(t,e,{chart:n,datasetIndex:r.index,dataIndex:c});Io(r,a,l,i)}}function M0(n,t,e,i){const s={};for(const o of n.data.datasets){const r=o.label??"";s[r]||(s[r]=hs(t,e,{chart:n,datasetIndex:0,dataIndex:void 0,label:r}));const a=s[r];Io(o,a.background,a.border,i)}}const k0={id:"autocolors",beforeUpdate(n,t,e){const{mode:i="dataset",enabled:s=!0,customize:o,repeat:r}=e;if(!s)return;const a=w0(r);if(e.offset)for(let l=0;l<e.offset;l++)a.next();return i==="label"?M0(n,a,o,i):v0(n,a,o,i)}};/*!
|
|
29
29
|
* chartjs-plugin-annotation v3.1.0
|
|
30
30
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
31
31
|
* (c) 2024 chartjs-plugin-annotation Contributors
|
|
32
32
|
* Released under the MIT License
|
|
33
|
-
*/const el={modes:{point(n,t){return qi(n,t,{intersect:!0})},nearest(n,t,e){return r0(n,t,e)},x(n,t,e){return qi(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return qi(n,t,{intersect:e.intersect,axis:"y"})}}};function Ko(n,t,e){return(el.modes[e.mode]||el.modes.nearest)(n,t,e)}function s0(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function o0(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function qi(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):s0(i,t,e.axis))}function r0(n,t,e){let i=Number.POSITIVE_INFINITY;return qi(n,t,e).reduce((s,o)=>{const r=o.getCenterPoint(),a=o0(t,r,e.axis),l=sn(t,a);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function qe(n,t,e){const i=Math.cos(e),s=Math.sin(e),o=t.x,r=t.y;return{x:o+i*(n.x-o)-s*(n.y-r),y:r+s*(n.x-o)+i*(n.y-r)}}const a0=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Ne=.001,fs=(n,t,e)=>Math.min(e,Math.max(t,n)),Qc=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function l0(n,t,e){for(const i of Object.keys(n))n[i]=fs(n[i],t,e);return n}function c0(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Zc(n,{x:t,y:e,x2:i,y2:s},o,{borderWidth:r,hitTolerance:a}){const l=(r+a)/2,c=n.x>=t-l-Ne&&n.x<=i+l+Ne,h=n.y>=e-l-Ne&&n.y<=s+l+Ne;return o==="x"?c:(o==="y"||c)&&h}function Kc(n,{rect:t,center:e},i,{rotation:s,borderWidth:o,hitTolerance:r}){const a=qe(n,e,ht(-s));return Zc(a,t,i,{borderWidth:o,hitTolerance:r})}function $e(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function h0(n,t,e,i=!0){const s=e.split(".");let o=0;for(const r of t.split(".")){const a=s[o++];if(parseInt(r,10)<parseInt(a,10))break;if(a0(a,r)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Jc=n=>typeof n=="string"&&n.endsWith("%"),th=n=>parseFloat(n)/100,eh=n=>fs(th(n),0,1),Cn=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),u0={box:n=>Cn(n.centerX,n.centerY),doughnutLabel:n=>Cn(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Cn(n.centerX,n.centerY),line:n=>Cn(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Cn(n.centerX,n.centerY)};function Jo(n,t){return t==="start"?0:t==="end"?n:Jc(t)?eh(t)*n:n/2}function ke(n,t,e=!0){return typeof t=="number"?t:Jc(t)?(e?eh(t):th(t))*n:n}function d0(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function nh(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:o},r){const a=W(r),l=t.width+(a?r.width:0)+e,c=t.height+(a?r.height:0)+e,h=tr(i),u=nl(n.x,l,s,h.x),d=nl(n.y,c,o,h.y);return{x:u,y:d,x2:u+l,y2:d+c,width:l,height:c,centerX:u+l/2,centerY:d+c/2}}function tr(n,t="center"){return W(n)?{x:R(n.x,t),y:R(n.y,t)}:(n=R(n,t),{x:n,y:n})}const ih=(n,t)=>n&&n.autoFit&&t<1;function sh(n,t){const e=n.font,i=U(e)?e:[e];return ih(n,t)?i.map(function(s){const o=it(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,it(o)}):i.map(s=>it(s))}function oh(n){return n&&(Ot(n.xValue)||Ot(n.yValue))}function nl(n,t,e=0,i){return n-Jo(t,i)+e}function hn(n,t,e){const i=e.init;if(i){if(i===!0)return ah(t,e)}else return;return f0(n,t,e)}function rh(n,t,e){let i=!1;return t.forEach(s=>{Dt(n[s])?(i=!0,e[s]=n[s]):Ot(e[s])&&delete e[s]}),i}function ah(n,t){const e=t.type||"line";return u0[e](n)}function f0(n,t,e){const i=L(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return ah(t,e);if(W(i))return i}const Xs=new Map,g0=n=>isNaN(n)||n<=0,m0=n=>n.reduce(function(t,e){return t+=e.string,t},"");function gs(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function ms(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(ht(i)),n.translate(-t,-e))}function ae(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function un(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function ps(n,t){const e=t.content;if(gs(e))return{width:ke(e.width,t.width),height:ke(e.height,t.height)};const i=sh(t),s=t.textStrokeWidth,o=U(e)?e:[e],r=o.join()+m0(i)+s+(n._measureText?"-spriting":"");return Xs.has(r)||Xs.set(r,x0(n,o,i,s)),Xs.get(r)}function lh(n,t,e){const{x:i,y:s,width:o,height:r}=t;n.save(),un(n,e);const a=ae(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),on(n,{x:i,y:s,w:o,h:r,radius:l0(_e(e.borderRadius),0,Math.min(o,r)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function ch(n,t,e,i){const s=e.content;if(gs(s)){n.save(),n.globalAlpha=v0(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const o=U(s)?s:[s],r=sh(e,i),a=e.color,l=U(a)?a:[a],c=d0(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,p0(n,e)&&_0(n,{x:c,y:h},o,r),w0(n,{x:c,y:h},o,{fonts:r,colors:l}),n.restore()}function p0(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function b0(n,t,e,i){const{radius:s,options:o}=t,r=o.pointStyle,a=o.rotation;let l=(a||0)*Ao;if(gs(r)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),n.restore();return}g0(s)||y0(n,{x:e,y:i,radius:s,rotation:a,style:r,rad:l})}function y0(n,{x:t,y:e,radius:i,rotation:s,style:o,rad:r}){let a,l,c,h;switch(n.beginPath(),o){default:n.arc(t,e,i,0,$),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(r)*i,e-Math.cos(r)*i),r+=Zi,n.lineTo(t+Math.sin(r)*i,e-Math.cos(r)*i),r+=Zi,n.lineTo(t+Math.sin(r)*i,e-Math.cos(r)*i),n.closePath();break;case"rectRounded":h=i*.516,c=i-h,a=Math.cos(r+Nt)*c,l=Math.sin(r+Nt)*c,n.arc(t-a,e-l,h,r-V,r-Q),n.arc(t+l,e-a,h,r-Q,r),n.arc(t+a,e+l,h,r,r+Q),n.arc(t-l,e+a,h,r+Q,r+V),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}r+=Nt;case"rectRot":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":r+=Nt;case"cross":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),r+=Nt,a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(r)*i,e+Math.sin(r)*i);break}n.fill()}function x0(n,t,e,i){n.save();const s=t.length;let o=0,r=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];o=Math.max(o,n.measureText(c).width+i),r+=l.lineHeight}return n.restore(),{width:o,height:r}}function _0(n,{x:t,y:e},i,s){n.beginPath();let o=0;i.forEach(function(r,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(r,t,e+c/2+o),o+=c}),n.stroke()}function w0(n,{x:t,y:e},i,{fonts:s,colors:o}){let r=0;i.forEach(function(a,l){const c=o[Math.min(l,o.length-1)],h=s[Math.min(l,s.length-1)],u=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=c,n.fillText(a,t,e+u/2+r),r+=u,n.fill()})}function v0(n,t){const e=Me(n)?n:t;return Me(e)?fs(e,0,1):1}const hh=["left","bottom","top","right"];function M0(n,t){const{pointX:e,pointY:i,options:s}=t,o=s.callout,r=o&&o.display&&D0(t,o);if(!r||C0(t,o,r))return;if(n.save(),n.beginPath(),!ae(n,o))return n.restore();const{separatorStart:l,separatorEnd:c}=k0(t,r),{sideStart:h,sideEnd:u}=T0(t,r,l);(o.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(h.x,h.y),n.lineTo(u.x,u.y);const d=qe({x:e,y:i},t.getCenterPoint(),ht(-t.rotation));n.lineTo(d.x,d.y),n.stroke(),n.restore()}function k0(n,t){const{x:e,y:i,x2:s,y2:o}=n,r=P0(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+r,y:i},l={x:a.x,y:o}):(a={x:e,y:i+r},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function P0(n,t){const{width:e,height:i,options:s}=n,o=s.callout.margin+s.borderWidth/2;return t==="right"?e+o:t==="bottom"?i+o:-o}function T0(n,t,e){const{y:i,width:s,height:o,options:r}=n,a=r.callout.start,l=S0(t,r.callout);let c,h;return t==="left"||t==="right"?(c={x:e.x,y:i+ke(o,a)},h={x:c.x+l,y:c.y}):(c={x:e.x+ke(s,a),y:e.y},h={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:h}}function S0(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function D0(n,t){const e=t.position;return hh.includes(e)?e:O0(n,t)}function O0(n,t){const{x:e,y:i,x2:s,y2:o,width:r,height:a,pointX:l,pointY:c,centerX:h,centerY:u,rotation:d}=n,g={x:h,y:u},p=t.start,b=ke(r,p),x=ke(a,p),_=[e,e+b,e+b,s],w=[i+x,o,i,o],k=[];for(let T=0;T<4;T++){const P=qe({x:_[T],y:w[T]},g,ht(d));k.push({position:hh[T],distance:sn(P,{x:l,y:c})})}return k.sort((T,P)=>T.distance-P.distance)[0].position}function C0(n,t,e){const{pointX:i,pointY:s}=n,o=t.margin;let r=i,a=s;return e==="left"?r+=o:e==="right"?r-=o:e==="top"?a+=o:e==="bottom"&&(a-=o),n.inRange(r,a)}const il={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function cn(n,t,e){return t=typeof t=="number"?t:n.parse(t),J(t)?n.getPixelForValue(t):e}function Ve(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),o=Object.values(n).filter(r=>r.axis&&r.axis===s);return o.length?o[0].id:s}function uh(n,t){if(n){const e=n.options.reverse,i=cn(n,t.min,e?t.end:t.start),s=cn(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function dh(n,t){const{chartArea:e,scales:i}=n,s=i[Ve(i,t,"xScaleID")],o=i[Ve(i,t,"yScaleID")];let r=e.width/2,a=e.height/2;return s&&(r=cn(s,t.xValue,s.left+s.width/2)),o&&(a=cn(o,t.yValue,o.top+o.height/2)),{x:r,y:a}}function er(n,t){const e=n.scales,i=e[Ve(e,t,"xScaleID")],s=e[Ve(e,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:r}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=sl(i,{min:t.xMin,max:t.xMax,start:o,end:r});o=c.start,r=c.end;const h=sl(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=h.start,l=h.end,{x:o,y:a,x2:r,y2:l,width:r-o,height:l-a,centerX:o+(r-o)/2,centerY:a+(l-a)/2}}function fh(n,t){if(!oh(t)){const e=er(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,o=e.centerX+t.xAdjust,r=e.centerY+t.yAdjust;return{x:o-i,y:r-i,x2:o+i,y2:r+i,centerX:o,centerY:r,width:s,height:s,radius:i}}return A0(n,t)}function E0(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?I0(s,o,t):L0(e,o,t),o}function gh(n,t){const e=er(n,t);return e.initProperties=hn(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:N0(n,e,t),initProperties:e.initProperties}],e}function A0(n,t){const e=dh(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function sl(n,t){const e=uh(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function I0(n,t,e){const i=cn(n,e.value,NaN),s=cn(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function L0(n,t,e){for(const i of Object.keys(il)){const s=n[Ve(n,e,i)];if(s){const{min:o,max:r,start:a,end:l,startProp:c,endProp:h}=il[i],u=uh(s,{min:e[o],max:e[r],start:s[a],end:s[l]});t[c]=u.start,t[h]=u.end}}}function R0({properties:n,options:t},e,i,s){const{x:o,x2:r,width:a}=n;return mh({start:o,end:r,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function F0({properties:n,options:t},e,i,s){const{y:o,y2:r,height:a}=n;return mh({start:o,end:r,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function mh(n,t){const{start:e,end:i,borderWidth:s}=n,{position:o,padding:{start:r,end:a},adjust:l}=t,c=i-s-e-r-a-t.size;return e+s/2+l+Jo(c,o)}function N0(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=tr(i.position),o=ut(i.padding),r=ps(n.ctx,i),a=R0({properties:t,options:e},r,s,o),l=F0({properties:t,options:e},r,s,o),c=r.width+o.width,h=r.height+o.height;return{x:a,y:l,x2:a+c,y2:l+h,width:c,height:h,centerX:a+c/2,centerY:l+h/2,rotation:i.rotation}}const mo=["enter","leave"],nr=mo.concat("click");function z0(n,t,e){t.listened=rh(e,nr,t.listeners),t.moveListened=!1,mo.forEach(i=>{Dt(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Dt(i.click)&&(t.listened=!0),t.moveListened||mo.forEach(s=>{Dt(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function W0(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return H0(n,t,e);case"click":return Y0(n,t,e)}}function H0(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Ko(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const o={state:n,event:t};let r=ol(o,"leave",s,i);return ol(o,"enter",i,s)||r}function ol({state:n,event:t},e,i,s){let o;for(const r of i)s.indexOf(r)<0&&(o=ph(r.options[e]||n.listeners[e],r,t)||o);return o}function Y0(n,t,e){const i=n.listeners,s=Ko(n.visibleElements,t,e.interaction);let o;for(const r of s)o=ph(r.options.click||i.click,r,t)||o;return o}function ph(n,t,e){return L(n,[t.$context,e])===!0}const rs=["afterDraw","beforeDraw"];function B0(n,t,e){const i=t.visibleElements;t.hooked=rh(e,rs,t.hooks),t.hooked||i.forEach(s=>{t.hooked||rs.forEach(o=>{Dt(s.options[o])&&(t.hooked=!0)})})}function rl(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return L(i,[t.$context])}}function V0(n,t,e){const i=$0(n.scales,t,e);let s=al(t,i,"min","suggestedMin");s=al(t,i,"max","suggestedMax")||s,s&&Dt(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function j0(n,t){for(const e of n)U0(e,t)}function al(n,t,e,i){if(J(t[e])&&!X0(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function X0(n,t,e){return Ot(n[t])||Ot(n[e])}function U0(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Ve(t,n,e);i&&!t[i]&&q0(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function q0(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(Ot(n[e+i]))return!0;return!1}function $0(n,t,e){const i=t.axis,s=t.id,o=i+"ScaleID",r={min:R(t.min,Number.NEGATIVE_INFINITY),max:R(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?ll(a,t,["value","endValue"],r):Ve(n,a,o)===s&&ll(a,t,[i+"Min",i+"Max",i+"Value"],r);return r}function ll(n,t,e,i){for(const s of e){const o=n[s];if(Ot(o)){const r=t.parse(o);i.min=Math.min(i.min,r),i.max=Math.max(i.max,r)}}}class dn extends bt{inRange(t,e,i,s){const{x:o,y:r}=qe({x:t,y:e},this.getCenterPoint(s),ht(-this.options.rotation));return Zc({x:o,y:r},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return $e(this,t)}draw(t){t.save(),ms(t,this.getCenterPoint(),this.options.rotation),lh(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return gh(t,e)}}dn.id="boxAnnotation";dn.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};dn.defaultRoutes={borderColor:"color",backgroundColor:"color"};dn.descriptors={label:{_fallback:!0}};class bs extends bt{inRange(t,e,i,s){return Kc({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return $e(this,t)}draw(t){const e=this.options;!e.display||!e.content||(tx(t,this),t.save(),ms(t,this.getCenterPoint(),this.rotation),ch(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=G0(t,e);if(!i)return{};const{controllerMeta:s,point:o,radius:r}=Z0(t,e,i);let a=ps(t.ctx,e);const l=K0(a,r);ih(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:h,yAdjust:u}=e,d=nh(o,a,{borderWidth:0,position:c,xAdjust:h,yAdjust:u});return{initProperties:hn(t,d,e),...d,...s,rotation:e.rotation,_fitRatio:l}}}bs.id="doughnutLabelAnnotation";bs.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0};bs.defaultRoutes={};function G0(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof pe&&Q0(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function Q0(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function Z0({chartArea:n},t,e){const{left:i,top:s,right:o,bottom:r}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,h=(i+o)/2+l,u=(s+r)/2+c,d={left:Math.max(h-a,i),right:Math.min(h+a,o),top:Math.max(u-a,s),bottom:Math.min(u+a,r)},g={x:(d.left+d.right)/2,y:(d.top+d.bottom)/2},p=t.spacing+t.borderWidth/2,b=a-p,x=g.y>u,_=x?s+p:r-p,w=J0(_,h,u,b);return{controllerMeta:{_centerX:h,_centerY:u,_radius:b,_counterclockwise:x,...w},point:g,radius:Math.min(a,Math.min(d.right-d.left,d.bottom-d.top)/2)}}function K0({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function J0(n,t,e,i){const s=Math.pow(e-n,2),o=Math.pow(i,2),r=t*-2,a=Math.pow(t,2)+s-o,l=Math.pow(r,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:$};const c=(-r-Math.sqrt(l))/2,h=(-r+Math.sqrt(l))/2;return{_startAngle:Ki({x:t,y:e},{x:c,y:n}).angle,_endAngle:Ki({x:t,y:e},{x:h,y:n}).angle}}function tx(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:o,_endAngle:r,_counterclockwise:a,options:l}=t;n.save();const c=ae(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,o,r,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class li extends bt{inRange(t,e,i,s){return Kc({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return $e(this,t)}draw(t){const e=this.options,i=!Ot(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),ms(t,this.getCenterPoint(),this.rotation),M0(t,this),lh(t,this,e),ch(t,ex(this),e),t.restore())}resolveElementProperties(t,e){let i;if(oh(e))i=dh(t,e);else{const{centerX:a,centerY:l}=er(t,e);i={x:a,y:l}}const s=ut(e.padding),o=ps(t.ctx,e),r=nh(i,o,e,s);return{initProperties:hn(t,r,e),pointX:i.x,pointY:i.y,...r,rotation:e.rotation}}}li.id="labelAnnotation";li.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};li.defaultRoutes={borderColor:"color"};function ex({x:n,y:t,width:e,height:i,options:s}){const o=s.borderWidth/2,r=ut(s.padding);return{x:n+r.left+o,y:t+r.top+o,width:e-r.left-r.right-s.borderWidth,height:i-r.top-r.bottom-s.borderWidth}}const ir=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),po=(n,t,e)=>ir(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,cl=(n,t,e)=>ir(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Wn=n=>n*n,nx=(n,t,{x:e,y:i,x2:s,y2:o},r)=>r==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},hl=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,bo=(n,t,e,i)=>({x:hl(n.x,t.x,e.x,i),y:hl(n.y,t.y,e.y,i)}),ul=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),dl=(n,t,e,i)=>-Math.atan2(ul(n.x,t.x,e.x,i),ul(n.y,t.y,e.y,i))+.5*V;class ci extends bt{inRange(t,e,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const r={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){ae(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,u=t*h.currentDevicePixelRatio,d=e*h.currentDevicePixelRatio,g=l.isPointInStroke(a,u,d)||yo(this,r,s);return l.restore(),g}const c=Wn(o);return rx(this,r,c,s)||yo(this,r,s)}return ix(this,{mouseX:t,mouseY:e},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return $e(this,t)}draw(t){const{x:e,y:i,x2:s,y2:o,cp:r,options:a}=this;if(t.save(),!ae(t,a))return t.restore();un(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(o-i,2));if(a.curve&&r)return gx(t,this,r,l),t.restore();const{startOpts:c,endOpts:h,startAdjust:u,endAdjust:d}=bh(this),g=Math.atan2(o-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+u,0),t.lineTo(l-d,0),t.shadowColor=a.borderShadowColor,t.stroke(),xo(t,0,u,c),xo(t,l,-d,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=E0(t,e),{x:s,y:o,x2:r,y2:a}=i,l=sx(i,t.chartArea),c=l?ox({x:s,y:o},{x:r,y:a},t.chartArea):{x:s,y:o,x2:r,y2:a,width:Math.abs(r-s),height:Math.abs(a-o)};if(c.centerX=(r+s)/2,c.centerY=(a+o)/2,c.initProperties=hn(t,c,e),e.curve){const u={x:c.x,y:c.y},d={x:c.x2,y:c.y2};c.cp=fx(c,e,sn(u,d))}const h=ax(t,c,e.label);return h._visible=l,c.elements=[{type:"label",optionScope:"label",properties:h,initProperties:c.initProperties}],c}}ci.id="lineAnnotation";const fl={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ci.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},fl),fill:!1,length:12,start:Object.assign({},fl),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},li.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};ci.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};ci.defaultRoutes={borderColor:"color"};function ix(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:o}){const r=nx(t,e,n.getProps(["x","y","x2","y2"],o),i);return Qc(r,s)||yo(n,{mouseX:t,mouseY:e},o,i)}function sx({x:n,y:t,x2:e,y2:i},{top:s,right:o,bottom:r,left:a}){return!(n<a&&e<a||n>o&&e>o||t<s&&i<s||t>r&&i>r)}function gl({x:n,y:t},e,{top:i,right:s,bottom:o,left:r}){return n<r&&(t=cl(r,{x:n,y:t},e),n=r),n>s&&(t=cl(s,{x:n,y:t},e),n=s),t<i&&(n=po(i,{x:n,y:t},e),t=i),t>o&&(n=po(o,{x:n,y:t},e),t=o),{x:n,y:t}}function ox(n,t,e){const{x:i,y:s}=gl(n,t,e),{x:o,y:r}=gl(t,n,e);return{x:i,y:s,x2:o,y2:r,width:Math.abs(o-i),height:Math.abs(r-s)}}function rx(n,{mouseX:t,mouseY:e},i=Ne,s){const{x:o,y:r,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-o,h=l-r,u=Wn(c)+Wn(h),d=u===0?-1:((t-o)*c+(e-r)*h)/u;let g,p;return d<0?(g=o,p=r):d>1?(g=a,p=l):(g=o+d*c,p=r+d*h),Wn(t-g)+Wn(e-p)<=i}function yo(n,{mouseX:t,mouseY:e},i,s){const o=n.label;return o.options.display&&o.inRange(t,e,s,i)}function ax(n,t,e){const i=e.borderWidth,s=ut(e.padding),o=ps(n.ctx,e),r=o.width+s.width+i,a=o.height+s.height+i;return cx(t,e,{width:r,height:a,padding:s},n.chartArea)}function lx(n){const{x:t,y:e,x2:i,y2:s}=n,o=Math.atan2(s-e,i-t);return o>V/2?o-V:o<V/-2?o+V:o}function cx(n,t,e,i){const{width:s,height:o,padding:r}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},h={x:n.x2,y:n.y2},u=t.rotation==="auto"?lx(n):ht(t.rotation),d=hx(s,o,u),g=ux(n,t,{labelSize:d,padding:r},i),p=n.cp?bo(c,n.cp,h,g):ir(c,h,g),b={size:d.w,min:i.left,max:i.right,padding:r.left},x={size:d.h,min:i.top,max:i.bottom,padding:r.top},_=pl(p.x,b)+a,w=pl(p.y,x)+l;return{x:_-s/2,y:w-o/2,x2:_+s/2,y2:w+o/2,centerX:_,centerY:w,pointX:p.x,pointY:p.y,width:s,height:o,rotation:as(u)}}function hx(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function ux(n,t,e,i){let s;const o=dx(n,i);return t.position==="start"?s=ml({w:n.x2-n.x,h:n.y2-n.y},e,t,o):t.position==="end"?s=1-ml({w:n.x-n.x2,h:n.y-n.y2},e,t,o):s=Jo(1,t.position),s}function ml(n,t,e,i){const{labelSize:s,padding:o}=t,r=n.w*i.dx,a=n.h*i.dy,l=r>0&&(s.w/2+o.left-i.x)/r,c=a>0&&(s.h/2+o.top-i.y)/a;return fs(Math.max(l,c),0,.25)}function dx(n,t){const{x:e,x2:i,y:s,y2:o}=n,r=Math.min(s,o)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(r,l),dx:a<=c?1:-1,dy:r<=l?1:-1}}function pl(n,t){const{size:e,min:i,max:s,padding:o}=t,r=e/2;return e>s-i?(s+i)/2:(i>=n-o-r&&(n=i+o+r),s<=n+o+r&&(n=s-o-r),n)}function bh(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:bl(n,e),endAdjust:bl(n,i)}}function bl(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,o={x:e,y:i+s};return Math.abs(po(0,o,{x:0,y:s}))}function xo(n,t,e,i){if(!i||!i.display)return;const{length:s,width:o,fill:r,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),un(n,i),ae(n,i),n.moveTo(c,-o),n.lineTo(t+e,0),n.lineTo(c,o),r===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function fx(n,t,e){const{x:i,y:s,x2:o,y2:r,centerX:a,centerY:l}=n,c=Math.atan2(r-s,o-i),h=tr(t.controlPoint,0),u={x:a+ke(e,h.x,!1),y:l+ke(e,h.y,!1)};return qe(u,{x:a,y:l},c)}function yl(n,{x:t,y:e},{angle:i,adjust:s},o){!o||!o.display||(n.save(),n.translate(t,e),n.rotate(i),xo(n,0,-s,o),n.restore())}function gx(n,t,e,i){const{x:s,y:o,x2:r,y2:a,options:l}=t,{startOpts:c,endOpts:h,startAdjust:u,endAdjust:d}=bh(t),g={x:s,y:o},p={x:r,y:a},b=dl(g,e,p,0),x=dl(g,e,p,1)-V,_=bo(g,e,p,u/i),w=bo(g,e,p,1-d/i),k=new Path2D;n.beginPath(),k.moveTo(_.x,_.y),k.quadraticCurveTo(e.x,e.y,w.x,w.y),n.shadowColor=l.borderShadowColor,n.stroke(k),t.path=k,t.ctx=n,yl(n,_,{angle:b,adjust:u},c),yl(n,w,{angle:x,adjust:d},h)}class hi extends bt{inRange(t,e,i,s){const o=this.options.rotation,r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return mx({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),o,r);const{x:a,y:l,x2:c,y2:h}=this.getProps(["x","y","x2","y2"],s),u=i==="y"?{start:l,end:h}:{start:a,end:c},d=qe({x:t,y:e},this.getCenterPoint(s),ht(-o));return d[i]>=u.start-r-Ne&&d[i]<=u.end+r+Ne}getCenterPoint(t){return $e(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:o,options:r}=this;t.save(),ms(t,this.getCenterPoint(),r.rotation),un(t,this.options),t.beginPath(),t.fillStyle=r.backgroundColor;const a=ae(t,r);t.ellipse(s,o,i/2,e/2,V/2,0,2*V),t.fill(),a&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return gh(t,e)}}hi.id="ellipseAnnotation";hi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},dn.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};hi.defaultRoutes={borderColor:"color",backgroundColor:"color"};hi.descriptors={label:{_fallback:!0}};function mx(n,t,e,i){const{width:s,height:o,centerX:r,centerY:a}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const h=ht(e||0),u=Math.cos(h),d=Math.sin(h),g=Math.pow(u*(n.x-r)+d*(n.y-a),2),p=Math.pow(d*(n.x-r)-u*(n.y-a),2);return g/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class ys extends bt{inRange(t,e,i,s){const{x:o,y:r,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),h=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?c0({x:t,y:e},this.getCenterPoint(s),c/2,h):Qc(i==="y"?{start:r,end:l,value:e}:{start:o,end:a,value:t},h)}getCenterPoint(t){return $e(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,un(t,e);const s=ae(t,e);b0(t,this,this.centerX,this.centerY),s&&!gs(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=fh(t,e);return i.initProperties=hn(t,i,e),i}}ys.id="pointAnnotation";ys.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};ys.defaultRoutes={borderColor:"color",backgroundColor:"color"};class xs extends bt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&bx(this.elements,t,e,s);const o=qe({x:t,y:e},this.getCenterPoint(s),ht(-this.options.rotation)),r=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...r),l=Math.max(...r);return o[i]>=a&&o[i]<=l}getCenterPoint(t){return $e(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,un(t,i);const s=ae(t,i);let o=!0;for(const r of e)o?(t.moveTo(r.x,r.y),o=!1):t.lineTo(r.x,r.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=fh(t,e),{sides:s,rotation:o}=e,r=[],a=2*V/s;let l=o*Ao;for(let c=0;c<s;c++,l+=a){const h=px(i,e,l);h.initProperties=hn(t,i,e),r.push(h)}return i.elements=r,i}}xs.id="polygonAnnotation";xs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};xs.defaultRoutes={borderColor:"color",backgroundColor:"color"};function px({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},o){const r=(i+s)/2,a=Math.sin(o),l=Math.cos(o),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+r),bY:t-l*(e+r)}}}function bx(n,t,e,i){let s=!1,o=n[n.length-1].getProps(["bX","bY"],i);for(const r of n){const a=r.getProps(["bX","bY"],i);a.bY>e!=o.bY>e&&t<(o.bX-a.bX)*(e-a.bY)/(o.bY-a.bY)+a.bX&&(s=!s),o=a}return s}const we={box:dn,doughnutLabel:bs,ellipse:hi,label:li,line:ci,point:ys,polygon:xs};Object.keys(we).forEach(n=>{Z.describe(`elements.${we[n].id}`,{_fallback:"plugins.annotation.common"})});const yx={update:Object.assign},xx=nr.concat(rs),xl=(n,t)=>W(t)?wo(n,t):n,_o=n=>n==="color"||n==="font";function sr(n="line"){return we[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function _x(n,t,e,i){const s=vx(n,e.animations,i),o=t.annotations,r=Px(t.elements,o);for(let a=0;a<o.length;a++){const l=o[a],c=yh(r,a,l.type),h=l.setContext(kx(n,c,r,l)),u=c.resolveElementProperties(n,h);u.skip=wx(u),"elements"in u&&(Mx(c,u.elements,h,s),delete u.elements),Ot(c.x)||Object.assign(c,u),Object.assign(c,u.initProperties),u.options=xh(h),s.update(c,u)}}function wx(n){return isNaN(n.x)||isNaN(n.y)}function vx(n,t,e){return e==="reset"||e==="none"||e==="resize"?yx:new Bo(n,t)}function Mx(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const r=t[o],a=r.properties,l=yh(s,o,r.type,r.initProperties),c=e[r.optionScope].override(r);a.options=xh(c),i.update(l,a)}}function yh(n,t,e,i){const s=we[sr(e)];let o=n[t];return(!o||!(o instanceof s))&&(o=n[t]=new s,Object.assign(o,i)),o}function xh(n){const t=we[sr(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,wo(n,t.defaults),wo(n,t.defaultRoutes));for(const i of xx)e[i]=n[i];return e}function wo(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],o=n[i];_o(i)&&U(o)?e[i]=o.map(r=>xl(r,s)):e[i]=xl(o,s)}return e}function kx(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function Px(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var Tx="3.1.0";const fe=new Map,_l=n=>n.type!=="doughnutLabel",Sx=nr.concat(rs);var Dx={id:"annotation",version:Tx,beforeRegister(){h0("chart.js","4.0",Mt.version)},afterRegister(){Mt.register(we)},afterUnregister(){Mt.unregister(we)},beforeInit(n){fe.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=fe.get(n),s=i.annotations=[];let o=e.annotations;W(o)?Object.keys(o).forEach(r=>{const a=o[r];W(a)&&(a.id=r,s.push(a))}):U(o)&&s.push(...o),j0(s.filter(_l),n.scales)},afterDataLimits(n,t){const e=fe.get(n);V0(n,t.scale,e.annotations.filter(_l).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=fe.get(n);z0(n,i,e),_x(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),B0(n,i,e)},beforeDatasetsDraw(n,t,e){En(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){En(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){En(n,t.index,e.clip)},beforeDraw(n,t,e){En(n,"beforeDraw",e.clip)},afterDraw(n,t,e){En(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=fe.get(n);W0(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){fe.delete(n)},getAnnotations(n){const t=fe.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return Ko(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!Sx.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${we[sr(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:_o,_fallback:!0},_indexable:_o}},additionalOptionScopes:[""]};function En(n,t,e){const{ctx:i,chartArea:s}=n,o=fe.get(n);e&&ii(i,s);const r=Ox(o.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of r)Cx(i,s,o,a);e&&si(i)}function Ox(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Cx(n,t,e,i){const s=i.element;i.main?(rl(e,s,"beforeDraw"),s.draw(n,t),rl(e,s,"afterDraw")):s.draw(n,t)}function Ex(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Us={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
33
|
+
*/const _l={modes:{point(n,t){return us(n,t,{intersect:!0})},nearest(n,t,e){return S0(n,t,e)},x(n,t,e){return us(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return us(n,t,{intersect:e.intersect,axis:"y"})}}};function yr(n,t,e){return(_l.modes[e.mode]||_l.modes.nearest)(n,t,e)}function P0(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function T0(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function us(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):P0(i,t,e.axis))}function S0(n,t,e){let i=Number.POSITIVE_INFINITY;return us(n,t,e).reduce((s,o)=>{const r=o.getCenterPoint(),a=T0(t,r,e.axis),l=gn(t,a);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function Je(n,t,e){const i=Math.cos(e),s=Math.sin(e),o=t.x,r=t.y;return{x:o+i*(n.x-o)-s*(n.y-r),y:r+s*(n.x-o)+i*(n.y-r)}}const D0=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,We=.001,Es=(n,t,e)=>Math.min(e,Math.max(t,n)),mh=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function O0(n,t,e){for(const i of Object.keys(n))n[i]=Es(n[i],t,e);return n}function C0(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function ph(n,{x:t,y:e,x2:i,y2:s},o,{borderWidth:r,hitTolerance:a}){const l=(r+a)/2,c=n.x>=t-l-We&&n.x<=i+l+We,h=n.y>=e-l-We&&n.y<=s+l+We;return o==="x"?c:(o==="y"||c)&&h}function bh(n,{rect:t,center:e},i,{rotation:s,borderWidth:o,hitTolerance:r}){const a=Je(n,e,ft(-s));return ph(a,t,i,{borderWidth:o,hitTolerance:r})}function tn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function E0(n,t,e,i=!0){const s=e.split(".");let o=0;for(const r of t.split(".")){const a=s[o++];if(parseInt(r,10)<parseInt(a,10))break;if(D0(a,r)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const yh=n=>typeof n=="string"&&n.endsWith("%"),xh=n=>parseFloat(n)/100,_h=n=>Es(xh(n),0,1),Bn=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),A0={box:n=>Bn(n.centerX,n.centerY),doughnutLabel:n=>Bn(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Bn(n.centerX,n.centerY),line:n=>Bn(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Bn(n.centerX,n.centerY)};function xr(n,t){return t==="start"?0:t==="end"?n:yh(t)?_h(t)*n:n/2}function Te(n,t,e=!0){return typeof t=="number"?t:yh(t)?(e?_h(t):xh(t))*n:n}function I0(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function wh(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:o},r){const a=H(r),l=t.width+(a?r.width:0)+e,c=t.height+(a?r.height:0)+e,h=_r(i),u=wl(n.x,l,s,h.x),d=wl(n.y,c,o,h.y);return{x:u,y:d,x2:u+l,y2:d+c,width:l,height:c,centerX:u+l/2,centerY:d+c/2}}function _r(n,t="center"){return H(n)?{x:F(n.x,t),y:F(n.y,t)}:(n=F(n,t),{x:n,y:n})}const vh=(n,t)=>n&&n.autoFit&&t<1;function Mh(n,t){const e=n.font,i=q(e)?e:[e];return vh(n,t)?i.map(function(s){const o=ot(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,ot(o)}):i.map(s=>ot(s))}function kh(n){return n&&(At(n.xValue)||At(n.yValue))}function wl(n,t,e=0,i){return n-xr(t,i)+e}function wn(n,t,e){const i=e.init;if(i){if(i===!0)return Th(t,e)}else return;return L0(n,t,e)}function Ph(n,t,e){let i=!1;return t.forEach(s=>{Et(n[s])?(i=!0,e[s]=n[s]):At(e[s])&&delete e[s]}),i}function Th(n,t){const e=t.type||"line";return A0[e](n)}function L0(n,t,e){const i=R(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Th(t,e);if(H(i))return i}const ho=new Map,R0=n=>isNaN(n)||n<=0,F0=n=>n.reduce(function(t,e){return t+=e.string,t},"");function As(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Is(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(ft(i)),n.translate(-t,-e))}function he(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function vn(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Ls(n,t){const e=t.content;if(As(e))return{width:Te(e.width,t.width),height:Te(e.height,t.height)};const i=Mh(t),s=t.textStrokeWidth,o=q(e)?e:[e],r=o.join()+F0(i)+s+(n._measureText?"-spriting":"");return ho.has(r)||ho.set(r,H0(n,o,i,s)),ho.get(r)}function Sh(n,t,e){const{x:i,y:s,width:o,height:r}=t;n.save(),vn(n,e);const a=he(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),mn(n,{x:i,y:s,w:o,h:r,radius:O0(ve(e.borderRadius),0,Math.min(o,r)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function Dh(n,t,e,i){const s=e.content;if(As(s)){n.save(),n.globalAlpha=V0(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const o=q(s)?s:[s],r=Mh(e,i),a=e.color,l=q(a)?a:[a],c=I0(t,e),h=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,N0(n,e)&&B0(n,{x:c,y:h},o,r),Y0(n,{x:c,y:h},o,{fonts:r,colors:l}),n.restore()}function N0(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function z0(n,t,e,i){const{radius:s,options:o}=t,r=o.pointStyle,a=o.rotation;let l=(a||0)*Zo;if(As(r)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(r,-r.width/2,-r.height/2,r.width,r.height),n.restore();return}R0(s)||W0(n,{x:e,y:i,radius:s,rotation:a,style:r,rad:l})}function W0(n,{x:t,y:e,radius:i,rotation:s,style:o,rad:r}){let a,l,c,h;switch(n.beginPath(),o){default:n.arc(t,e,i,0,G),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(r)*i,e-Math.cos(r)*i),r+=ms,n.lineTo(t+Math.sin(r)*i,e-Math.cos(r)*i),r+=ms,n.lineTo(t+Math.sin(r)*i,e-Math.cos(r)*i),n.closePath();break;case"rectRounded":h=i*.516,c=i-h,a=Math.cos(r+Ht)*c,l=Math.sin(r+Ht)*c,n.arc(t-a,e-l,h,r-j,r-K),n.arc(t+l,e-a,h,r-K,r),n.arc(t+a,e+l,h,r,r+K),n.arc(t-l,e+a,h,r+K,r+j),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}r+=Ht;case"rectRot":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":r+=Ht;case"cross":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),r+=Ht,a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(r)*i,l=Math.sin(r)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(r)*i,e+Math.sin(r)*i);break}n.fill()}function H0(n,t,e,i){n.save();const s=t.length;let o=0,r=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];o=Math.max(o,n.measureText(c).width+i),r+=l.lineHeight}return n.restore(),{width:o,height:r}}function B0(n,{x:t,y:e},i,s){n.beginPath();let o=0;i.forEach(function(r,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(r,t,e+c/2+o),o+=c}),n.stroke()}function Y0(n,{x:t,y:e},i,{fonts:s,colors:o}){let r=0;i.forEach(function(a,l){const c=o[Math.min(l,o.length-1)],h=s[Math.min(l,s.length-1)],u=h.lineHeight;n.beginPath(),n.font=h.string,n.fillStyle=c,n.fillText(a,t,e+u/2+r),r+=u,n.fill()})}function V0(n,t){const e=Pe(n)?n:t;return Pe(e)?Es(e,0,1):1}const Oh=["left","bottom","top","right"];function j0(n,t){const{pointX:e,pointY:i,options:s}=t,o=s.callout,r=o&&o.display&&G0(t,o);if(!r||K0(t,o,r))return;if(n.save(),n.beginPath(),!he(n,o))return n.restore();const{separatorStart:l,separatorEnd:c}=X0(t,r),{sideStart:h,sideEnd:u}=q0(t,r,l);(o.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(h.x,h.y),n.lineTo(u.x,u.y);const d=Je({x:e,y:i},t.getCenterPoint(),ft(-t.rotation));n.lineTo(d.x,d.y),n.stroke(),n.restore()}function X0(n,t){const{x:e,y:i,x2:s,y2:o}=n,r=U0(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+r,y:i},l={x:a.x,y:o}):(a={x:e,y:i+r},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function U0(n,t){const{width:e,height:i,options:s}=n,o=s.callout.margin+s.borderWidth/2;return t==="right"?e+o:t==="bottom"?i+o:-o}function q0(n,t,e){const{y:i,width:s,height:o,options:r}=n,a=r.callout.start,l=$0(t,r.callout);let c,h;return t==="left"||t==="right"?(c={x:e.x,y:i+Te(o,a)},h={x:c.x+l,y:c.y}):(c={x:e.x+Te(s,a),y:e.y},h={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:h}}function $0(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function G0(n,t){const e=t.position;return Oh.includes(e)?e:Q0(n,t)}function Q0(n,t){const{x:e,y:i,x2:s,y2:o,width:r,height:a,pointX:l,pointY:c,centerX:h,centerY:u,rotation:d}=n,f={x:h,y:u},p=t.start,b=Te(r,p),x=Te(a,p),_=[e,e+b,e+b,s],w=[i+x,o,i,o],k=[];for(let T=0;T<4;T++){const P=Je({x:_[T],y:w[T]},f,ft(d));k.push({position:Oh[T],distance:gn(P,{x:l,y:c})})}return k.sort((T,P)=>T.distance-P.distance)[0].position}function K0(n,t,e){const{pointX:i,pointY:s}=n,o=t.margin;let r=i,a=s;return e==="left"?r+=o:e==="right"?r-=o:e==="top"?a+=o:e==="bottom"&&(a-=o),n.inRange(r,a)}const vl={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function xn(n,t,e){return t=typeof t=="number"?t:n.parse(t),et(t)?n.getPixelForValue(t):e}function Ge(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),o=Object.values(n).filter(r=>r.axis&&r.axis===s);return o.length?o[0].id:s}function Ch(n,t){if(n){const e=n.options.reverse,i=xn(n,t.min,e?t.end:t.start),s=xn(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function Eh(n,t){const{chartArea:e,scales:i}=n,s=i[Ge(i,t,"xScaleID")],o=i[Ge(i,t,"yScaleID")];let r=e.width/2,a=e.height/2;return s&&(r=xn(s,t.xValue,s.left+s.width/2)),o&&(a=xn(o,t.yValue,o.top+o.height/2)),{x:r,y:a}}function wr(n,t){const e=n.scales,i=e[Ge(e,t,"xScaleID")],s=e[Ge(e,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:r}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=Ml(i,{min:t.xMin,max:t.xMax,start:o,end:r});o=c.start,r=c.end;const h=Ml(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=h.start,l=h.end,{x:o,y:a,x2:r,y2:l,width:r-o,height:l-a,centerX:o+(r-o)/2,centerY:a+(l-a)/2}}function Ah(n,t){if(!kh(t)){const e=wr(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,o=e.centerX+t.xAdjust,r=e.centerY+t.yAdjust;return{x:o-i,y:r-i,x2:o+i,y2:r+i,centerX:o,centerY:r,width:s,height:s,radius:i}}return J0(n,t)}function Z0(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?tx(s,o,t):ex(e,o,t),o}function Ih(n,t){const e=wr(n,t);return e.initProperties=wn(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:sx(n,e,t),initProperties:e.initProperties}],e}function J0(n,t){const e=Eh(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Ml(n,t){const e=Ch(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function tx(n,t,e){const i=xn(n,e.value,NaN),s=xn(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function ex(n,t,e){for(const i of Object.keys(vl)){const s=n[Ge(n,e,i)];if(s){const{min:o,max:r,start:a,end:l,startProp:c,endProp:h}=vl[i],u=Ch(s,{min:e[o],max:e[r],start:s[a],end:s[l]});t[c]=u.start,t[h]=u.end}}}function nx({properties:n,options:t},e,i,s){const{x:o,x2:r,width:a}=n;return Lh({start:o,end:r,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function ix({properties:n,options:t},e,i,s){const{y:o,y2:r,height:a}=n;return Lh({start:o,end:r,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Lh(n,t){const{start:e,end:i,borderWidth:s}=n,{position:o,padding:{start:r,end:a},adjust:l}=t,c=i-s-e-r-a-t.size;return e+s/2+l+xr(c,o)}function sx(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=_r(i.position),o=gt(i.padding),r=Ls(n.ctx,i),a=nx({properties:t,options:e},r,s,o),l=ix({properties:t,options:e},r,s,o),c=r.width+o.width,h=r.height+o.height;return{x:a,y:l,x2:a+c,y2:l+h,width:c,height:h,centerX:a+c/2,centerY:l+h/2,rotation:i.rotation}}const Lo=["enter","leave"],vr=Lo.concat("click");function ox(n,t,e){t.listened=Ph(e,vr,t.listeners),t.moveListened=!1,Lo.forEach(i=>{Et(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Et(i.click)&&(t.listened=!0),t.moveListened||Lo.forEach(s=>{Et(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function rx(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return ax(n,t,e);case"click":return lx(n,t,e)}}function ax(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=yr(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const o={state:n,event:t};let r=kl(o,"leave",s,i);return kl(o,"enter",i,s)||r}function kl({state:n,event:t},e,i,s){let o;for(const r of i)s.indexOf(r)<0&&(o=Rh(r.options[e]||n.listeners[e],r,t)||o);return o}function lx(n,t,e){const i=n.listeners,s=yr(n.visibleElements,t,e.interaction);let o;for(const r of s)o=Rh(r.options.click||i.click,r,t)||o;return o}function Rh(n,t,e){return R(n,[t.$context,e])===!0}const ks=["afterDraw","beforeDraw"];function cx(n,t,e){const i=t.visibleElements;t.hooked=Ph(e,ks,t.hooks),t.hooked||i.forEach(s=>{t.hooked||ks.forEach(o=>{Et(s.options[o])&&(t.hooked=!0)})})}function Pl(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return R(i,[t.$context])}}function hx(n,t,e){const i=mx(n.scales,t,e);let s=Tl(t,i,"min","suggestedMin");s=Tl(t,i,"max","suggestedMax")||s,s&&Et(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function ux(n,t){for(const e of n)fx(e,t)}function Tl(n,t,e,i){if(et(t[e])&&!dx(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function dx(n,t,e){return At(n[t])||At(n[e])}function fx(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Ge(t,n,e);i&&!t[i]&&gx(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function gx(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(At(n[e+i]))return!0;return!1}function mx(n,t,e){const i=t.axis,s=t.id,o=i+"ScaleID",r={min:F(t.min,Number.NEGATIVE_INFINITY),max:F(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Sl(a,t,["value","endValue"],r):Ge(n,a,o)===s&&Sl(a,t,[i+"Min",i+"Max",i+"Value"],r);return r}function Sl(n,t,e,i){for(const s of e){const o=n[s];if(At(o)){const r=t.parse(o);i.min=Math.min(i.min,r),i.max=Math.max(i.max,r)}}}class Mn extends xt{inRange(t,e,i,s){const{x:o,y:r}=Je({x:t,y:e},this.getCenterPoint(s),ft(-this.options.rotation));return ph({x:o,y:r},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return tn(this,t)}draw(t){t.save(),Is(t,this.getCenterPoint(),this.options.rotation),Sh(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Ih(t,e)}}Mn.id="boxAnnotation";Mn.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Mn.defaultRoutes={borderColor:"color",backgroundColor:"color"};Mn.descriptors={label:{_fallback:!0}};class Rs extends xt{inRange(t,e,i,s){return bh({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return tn(this,t)}draw(t){const e=this.options;!e.display||!e.content||(wx(t,this),t.save(),Is(t,this.getCenterPoint(),this.rotation),Dh(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=px(t,e);if(!i)return{};const{controllerMeta:s,point:o,radius:r}=yx(t,e,i);let a=Ls(t.ctx,e);const l=xx(a,r);vh(e,l)&&(a={width:a.width*l,height:a.height*l});const{position:c,xAdjust:h,yAdjust:u}=e,d=wh(o,a,{borderWidth:0,position:c,xAdjust:h,yAdjust:u});return{initProperties:wn(t,d,e),...d,...s,rotation:e.rotation,_fitRatio:l}}}Rs.id="doughnutLabelAnnotation";Rs.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0};Rs.defaultRoutes={};function px(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof ye&&bx(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function bx(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function yx({chartArea:n},t,e){const{left:i,top:s,right:o,bottom:r}=n,{innerRadius:a,offsetX:l,offsetY:c}=e.controller,h=(i+o)/2+l,u=(s+r)/2+c,d={left:Math.max(h-a,i),right:Math.min(h+a,o),top:Math.max(u-a,s),bottom:Math.min(u+a,r)},f={x:(d.left+d.right)/2,y:(d.top+d.bottom)/2},p=t.spacing+t.borderWidth/2,b=a-p,x=f.y>u,_=x?s+p:r-p,w=_x(_,h,u,b);return{controllerMeta:{_centerX:h,_centerY:u,_radius:b,_counterclockwise:x,...w},point:f,radius:Math.min(a,Math.min(d.right-d.left,d.bottom-d.top)/2)}}function xx({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function _x(n,t,e,i){const s=Math.pow(e-n,2),o=Math.pow(i,2),r=t*-2,a=Math.pow(t,2)+s-o,l=Math.pow(r,2)-4*a;if(l<=0)return{_startAngle:0,_endAngle:G};const c=(-r-Math.sqrt(l))/2,h=(-r+Math.sqrt(l))/2;return{_startAngle:ps({x:t,y:e},{x:c,y:n}).angle,_endAngle:ps({x:t,y:e},{x:h,y:n}).angle}}function wx(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:o,_endAngle:r,_counterclockwise:a,options:l}=t;n.save();const c=he(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,o,r,a),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Ti extends xt{inRange(t,e,i,s){return bh({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return tn(this,t)}draw(t){const e=this.options,i=!At(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Is(t,this.getCenterPoint(),this.rotation),j0(t,this),Sh(t,this,e),Dh(t,vx(this),e),t.restore())}resolveElementProperties(t,e){let i;if(kh(e))i=Eh(t,e);else{const{centerX:a,centerY:l}=wr(t,e);i={x:a,y:l}}const s=gt(e.padding),o=Ls(t.ctx,e),r=wh(i,o,e,s);return{initProperties:wn(t,r,e),pointX:i.x,pointY:i.y,...r,rotation:e.rotation}}}Ti.id="labelAnnotation";Ti.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Ti.defaultRoutes={borderColor:"color"};function vx({x:n,y:t,width:e,height:i,options:s}){const o=s.borderWidth/2,r=gt(s.padding);return{x:n+r.left+o,y:t+r.top+o,width:e-r.left-r.right-s.borderWidth,height:i-r.top-r.bottom-s.borderWidth}}const Mr=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Ro=(n,t,e)=>Mr(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Dl=(n,t,e)=>Mr(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Qn=n=>n*n,Mx=(n,t,{x:e,y:i,x2:s,y2:o},r)=>r==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},Ol=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Fo=(n,t,e,i)=>({x:Ol(n.x,t.x,e.x,i),y:Ol(n.y,t.y,e.y,i)}),Cl=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),El=(n,t,e,i)=>-Math.atan2(Cl(n.x,t.x,e.x,i),Cl(n.y,t.y,e.y,i))+.5*j;class Si extends xt{inRange(t,e,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const r={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){he(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:h}=this.$context,u=t*h.currentDevicePixelRatio,d=e*h.currentDevicePixelRatio,f=l.isPointInStroke(a,u,d)||No(this,r,s);return l.restore(),f}const c=Qn(o);return Sx(this,r,c,s)||No(this,r,s)}return kx(this,{mouseX:t,mouseY:e},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return tn(this,t)}draw(t){const{x:e,y:i,x2:s,y2:o,cp:r,options:a}=this;if(t.save(),!he(t,a))return t.restore();vn(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(o-i,2));if(a.curve&&r)return Rx(t,this,r,l),t.restore();const{startOpts:c,endOpts:h,startAdjust:u,endAdjust:d}=Fh(this),f=Math.atan2(o-i,s-e);t.translate(e,i),t.rotate(f),t.beginPath(),t.moveTo(0+u,0),t.lineTo(l-d,0),t.shadowColor=a.borderShadowColor,t.stroke(),zo(t,0,u,c),zo(t,l,-d,h),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=Z0(t,e),{x:s,y:o,x2:r,y2:a}=i,l=Px(i,t.chartArea),c=l?Tx({x:s,y:o},{x:r,y:a},t.chartArea):{x:s,y:o,x2:r,y2:a,width:Math.abs(r-s),height:Math.abs(a-o)};if(c.centerX=(r+s)/2,c.centerY=(a+o)/2,c.initProperties=wn(t,c,e),e.curve){const u={x:c.x,y:c.y},d={x:c.x2,y:c.y2};c.cp=Lx(c,e,gn(u,d))}const h=Dx(t,c,e.label);return h._visible=l,c.elements=[{type:"label",optionScope:"label",properties:h,initProperties:c.initProperties}],c}}Si.id="lineAnnotation";const Al={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};Si.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Al),fill:!1,length:12,start:Object.assign({},Al),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},Ti.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Si.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}};Si.defaultRoutes={borderColor:"color"};function kx(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:o}){const r=Mx(t,e,n.getProps(["x","y","x2","y2"],o),i);return mh(r,s)||No(n,{mouseX:t,mouseY:e},o,i)}function Px({x:n,y:t,x2:e,y2:i},{top:s,right:o,bottom:r,left:a}){return!(n<a&&e<a||n>o&&e>o||t<s&&i<s||t>r&&i>r)}function Il({x:n,y:t},e,{top:i,right:s,bottom:o,left:r}){return n<r&&(t=Dl(r,{x:n,y:t},e),n=r),n>s&&(t=Dl(s,{x:n,y:t},e),n=s),t<i&&(n=Ro(i,{x:n,y:t},e),t=i),t>o&&(n=Ro(o,{x:n,y:t},e),t=o),{x:n,y:t}}function Tx(n,t,e){const{x:i,y:s}=Il(n,t,e),{x:o,y:r}=Il(t,n,e);return{x:i,y:s,x2:o,y2:r,width:Math.abs(o-i),height:Math.abs(r-s)}}function Sx(n,{mouseX:t,mouseY:e},i=We,s){const{x:o,y:r,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-o,h=l-r,u=Qn(c)+Qn(h),d=u===0?-1:((t-o)*c+(e-r)*h)/u;let f,p;return d<0?(f=o,p=r):d>1?(f=a,p=l):(f=o+d*c,p=r+d*h),Qn(t-f)+Qn(e-p)<=i}function No(n,{mouseX:t,mouseY:e},i,s){const o=n.label;return o.options.display&&o.inRange(t,e,s,i)}function Dx(n,t,e){const i=e.borderWidth,s=gt(e.padding),o=Ls(n.ctx,e),r=o.width+s.width+i,a=o.height+s.height+i;return Cx(t,e,{width:r,height:a,padding:s},n.chartArea)}function Ox(n){const{x:t,y:e,x2:i,y2:s}=n,o=Math.atan2(s-e,i-t);return o>j/2?o-j:o<j/-2?o+j:o}function Cx(n,t,e,i){const{width:s,height:o,padding:r}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},h={x:n.x2,y:n.y2},u=t.rotation==="auto"?Ox(n):ft(t.rotation),d=Ex(s,o,u),f=Ax(n,t,{labelSize:d,padding:r},i),p=n.cp?Fo(c,n.cp,h,f):Mr(c,h,f),b={size:d.w,min:i.left,max:i.right,padding:r.left},x={size:d.h,min:i.top,max:i.bottom,padding:r.top},_=Rl(p.x,b)+a,w=Rl(p.y,x)+l;return{x:_-s/2,y:w-o/2,x2:_+s/2,y2:w+o/2,centerX:_,centerY:w,pointX:p.x,pointY:p.y,width:s,height:o,rotation:Ps(u)}}function Ex(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function Ax(n,t,e,i){let s;const o=Ix(n,i);return t.position==="start"?s=Ll({w:n.x2-n.x,h:n.y2-n.y},e,t,o):t.position==="end"?s=1-Ll({w:n.x-n.x2,h:n.y-n.y2},e,t,o):s=xr(1,t.position),s}function Ll(n,t,e,i){const{labelSize:s,padding:o}=t,r=n.w*i.dx,a=n.h*i.dy,l=r>0&&(s.w/2+o.left-i.x)/r,c=a>0&&(s.h/2+o.top-i.y)/a;return Es(Math.max(l,c),0,.25)}function Ix(n,t){const{x:e,x2:i,y:s,y2:o}=n,r=Math.min(s,o)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(r,l),dx:a<=c?1:-1,dy:r<=l?1:-1}}function Rl(n,t){const{size:e,min:i,max:s,padding:o}=t,r=e/2;return e>s-i?(s+i)/2:(i>=n-o-r&&(n=i+o+r),s<=n+o+r&&(n=s-o-r),n)}function Fh(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Fl(n,e),endAdjust:Fl(n,i)}}function Fl(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,o={x:e,y:i+s};return Math.abs(Ro(0,o,{x:0,y:s}))}function zo(n,t,e,i){if(!i||!i.display)return;const{length:s,width:o,fill:r,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),vn(n,i),he(n,i),n.moveTo(c,-o),n.lineTo(t+e,0),n.lineTo(c,o),r===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Lx(n,t,e){const{x:i,y:s,x2:o,y2:r,centerX:a,centerY:l}=n,c=Math.atan2(r-s,o-i),h=_r(t.controlPoint,0),u={x:a+Te(e,h.x,!1),y:l+Te(e,h.y,!1)};return Je(u,{x:a,y:l},c)}function Nl(n,{x:t,y:e},{angle:i,adjust:s},o){!o||!o.display||(n.save(),n.translate(t,e),n.rotate(i),zo(n,0,-s,o),n.restore())}function Rx(n,t,e,i){const{x:s,y:o,x2:r,y2:a,options:l}=t,{startOpts:c,endOpts:h,startAdjust:u,endAdjust:d}=Fh(t),f={x:s,y:o},p={x:r,y:a},b=El(f,e,p,0),x=El(f,e,p,1)-j,_=Fo(f,e,p,u/i),w=Fo(f,e,p,1-d/i),k=new Path2D;n.beginPath(),k.moveTo(_.x,_.y),k.quadraticCurveTo(e.x,e.y,w.x,w.y),n.shadowColor=l.borderShadowColor,n.stroke(k),t.path=k,t.ctx=n,Nl(n,_,{angle:b,adjust:u},c),Nl(n,w,{angle:x,adjust:d},h)}class Di extends xt{inRange(t,e,i,s){const o=this.options.rotation,r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Fx({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),o,r);const{x:a,y:l,x2:c,y2:h}=this.getProps(["x","y","x2","y2"],s),u=i==="y"?{start:l,end:h}:{start:a,end:c},d=Je({x:t,y:e},this.getCenterPoint(s),ft(-o));return d[i]>=u.start-r-We&&d[i]<=u.end+r+We}getCenterPoint(t){return tn(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:o,options:r}=this;t.save(),Is(t,this.getCenterPoint(),r.rotation),vn(t,this.options),t.beginPath(),t.fillStyle=r.backgroundColor;const a=he(t,r);t.ellipse(s,o,i/2,e/2,j/2,0,2*j),t.fill(),a&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Ih(t,e)}}Di.id="ellipseAnnotation";Di.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Mn.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0};Di.defaultRoutes={borderColor:"color",backgroundColor:"color"};Di.descriptors={label:{_fallback:!0}};function Fx(n,t,e,i){const{width:s,height:o,centerX:r,centerY:a}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const h=ft(e||0),u=Math.cos(h),d=Math.sin(h),f=Math.pow(u*(n.x-r)+d*(n.y-a),2),p=Math.pow(d*(n.x-r)-u*(n.y-a),2);return f/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class Fs extends xt{inRange(t,e,i,s){const{x:o,y:r,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),h=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?C0({x:t,y:e},this.getCenterPoint(s),c/2,h):mh(i==="y"?{start:r,end:l,value:e}:{start:o,end:a,value:t},h)}getCenterPoint(t){return tn(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,vn(t,e);const s=he(t,e);z0(t,this,this.centerX,this.centerY),s&&!As(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=Ah(t,e);return i.initProperties=wn(t,i,e),i}}Fs.id="pointAnnotation";Fs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Fs.defaultRoutes={borderColor:"color",backgroundColor:"color"};class Ns extends xt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&zx(this.elements,t,e,s);const o=Je({x:t,y:e},this.getCenterPoint(s),ft(-this.options.rotation)),r=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...r),l=Math.max(...r);return o[i]>=a&&o[i]<=l}getCenterPoint(t){return tn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,vn(t,i);const s=he(t,i);let o=!0;for(const r of e)o?(t.moveTo(r.x,r.y),o=!1):t.lineTo(r.x,r.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=Ah(t,e),{sides:s,rotation:o}=e,r=[],a=2*j/s;let l=o*Zo;for(let c=0;c<s;c++,l+=a){const h=Nx(i,e,l);h.initProperties=wn(t,i,e),r.push(h)}return i.elements=r,i}}Ns.id="polygonAnnotation";Ns.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0};Ns.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Nx({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},o){const r=(i+s)/2,a=Math.sin(o),l=Math.cos(o),c={x:n+a*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+a*(e+r),bY:t-l*(e+r)}}}function zx(n,t,e,i){let s=!1,o=n[n.length-1].getProps(["bX","bY"],i);for(const r of n){const a=r.getProps(["bX","bY"],i);a.bY>e!=o.bY>e&&t<(o.bX-a.bX)*(e-a.bY)/(o.bY-a.bY)+a.bX&&(s=!s),o=a}return s}const Me={box:Mn,doughnutLabel:Rs,ellipse:Di,label:Ti,line:Si,point:Fs,polygon:Ns};Object.keys(Me).forEach(n=>{Z.describe(`elements.${Me[n].id}`,{_fallback:"plugins.annotation.common"})});const Wx={update:Object.assign},Hx=vr.concat(ks),zl=(n,t)=>H(t)?Ho(n,t):n,Wo=n=>n==="color"||n==="font";function kr(n="line"){return Me[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function Bx(n,t,e,i){const s=Vx(n,e.animations,i),o=t.annotations,r=Ux(t.elements,o);for(let a=0;a<o.length;a++){const l=o[a],c=Nh(r,a,l.type),h=l.setContext(Xx(n,c,r,l)),u=c.resolveElementProperties(n,h);u.skip=Yx(u),"elements"in u&&(jx(c,u.elements,h,s),delete u.elements),At(c.x)||Object.assign(c,u),Object.assign(c,u.initProperties),u.options=zh(h),s.update(c,u)}}function Yx(n){return isNaN(n.x)||isNaN(n.y)}function Vx(n,t,e){return e==="reset"||e==="none"||e==="resize"?Wx:new lr(n,t)}function jx(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const r=t[o],a=r.properties,l=Nh(s,o,r.type,r.initProperties),c=e[r.optionScope].override(r);a.options=zh(c),i.update(l,a)}}function Nh(n,t,e,i){const s=Me[kr(e)];let o=n[t];return(!o||!(o instanceof s))&&(o=n[t]=new s,Object.assign(o,i)),o}function zh(n){const t=Me[kr(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Ho(n,t.defaults),Ho(n,t.defaultRoutes));for(const i of Hx)e[i]=n[i];return e}function Ho(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],o=n[i];Wo(i)&&q(o)?e[i]=o.map(r=>zl(r,s)):e[i]=zl(o,s)}return e}function Xx(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function Ux(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var qx="3.1.0";const me=new Map,Wl=n=>n.type!=="doughnutLabel",$x=vr.concat(ks);var Gx={id:"annotation",version:qx,beforeRegister(){E0("chart.js","4.0",Pt.version)},afterRegister(){Pt.register(Me)},afterUnregister(){Pt.unregister(Me)},beforeInit(n){me.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=me.get(n),s=i.annotations=[];let o=e.annotations;H(o)?Object.keys(o).forEach(r=>{const a=o[r];H(a)&&(a.id=r,s.push(a))}):q(o)&&s.push(...o),ux(s.filter(Wl),n.scales)},afterDataLimits(n,t){const e=me.get(n);hx(n,t.scale,e.annotations.filter(Wl).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=me.get(n);ox(n,i,e),Bx(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),cx(n,i,e)},beforeDatasetsDraw(n,t,e){Yn(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Yn(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Yn(n,t.index,e.clip)},beforeDraw(n,t,e){Yn(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Yn(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=me.get(n);rx(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){me.delete(n)},getAnnotations(n){const t=me.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return yr(n,t,e)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!$x.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Me[kr(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Wo,_fallback:!0},_indexable:Wo}},additionalOptionScopes:[""]};function Yn(n,t,e){const{ctx:i,chartArea:s}=n,o=me.get(n);e&&wi(i,s);const r=Qx(o.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of r)Kx(i,s,o,a);e&&vi(i)}function Qx(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Kx(n,t,e,i){const s=i.element;i.main?(Pl(e,s,"beforeDraw"),s.draw(n,t),Pl(e,s,"afterDraw")):s.draw(n,t)}function Zx(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var uo={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
34
34
|
* http://hammerjs.github.io/
|
|
35
35
|
*
|
|
36
36
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
37
|
-
* Licensed under the MIT license */var
|
|
37
|
+
* Licensed under the MIT license */var Hl;function Jx(){return Hl||(Hl=1,function(n){(function(t,e,i,s){var o=["","webkit","Moz","MS","ms","o"],r=e.createElement("div"),a="function",l=Math.round,c=Math.abs,h=Date.now;function u(g,m,y){return setTimeout(k(g,y),m)}function d(g,m,y){return Array.isArray(g)?(f(g,y[m],y),!0):!1}function f(g,m,y){var M;if(g)if(g.forEach)g.forEach(m,y);else if(g.length!==s)for(M=0;M<g.length;)m.call(y,g[M],M,g),M++;else for(M in g)g.hasOwnProperty(M)&&m.call(y,g[M],M,g)}function p(g,m,y){var M="DEPRECATED METHOD: "+m+`
|
|
38
38
|
`+y+` AT
|
|
39
|
-
`;return function(){var D=new Error("get-stack-trace"),A=D&&D.stack?D.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",H=t.console&&(t.console.warn||t.console.log);return H&&H.call(t.console,M,A),f.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(m){if(m===s||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var y=Object(m),M=1;M<arguments.length;M++){var D=arguments[M];if(D!==s&&D!==null)for(var A in D)D.hasOwnProperty(A)&&(y[A]=D[A])}return y}:b=Object.assign;var x=p(function(m,y,M){for(var D=Object.keys(y),A=0;A<D.length;)(!M||M&&m[D[A]]===s)&&(m[D[A]]=y[D[A]]),A++;return m},"extend","Use `assign`."),_=p(function(m,y){return x(m,y,!0)},"merge","Use `assign`.");function w(f,m,y){var M=m.prototype,D;D=f.prototype=Object.create(M),D.constructor=f,D._super=M,y&&b(D,y)}function k(f,m){return function(){return f.apply(m,arguments)}}function T(f,m){return typeof f==a?f.apply(m&&m[0]||s,m):f}function P(f,m){return f===s?m:f}function O(f,m,y){g(I(m),function(M){f.addEventListener(M,y,!1)})}function C(f,m,y){g(I(m),function(M){f.removeEventListener(M,y,!1)})}function S(f,m){for(;f;){if(f==m)return!0;f=f.parentNode}return!1}function E(f,m){return f.indexOf(m)>-1}function I(f){return f.trim().split(/\s+/g)}function F(f,m,y){if(f.indexOf&&!y)return f.indexOf(m);for(var M=0;M<f.length;){if(y&&f[M][y]==m||!y&&f[M]===m)return M;M++}return-1}function z(f){return Array.prototype.slice.call(f,0)}function tt(f,m,y){for(var M=[],D=[],A=0;A<f.length;){var H=f[A][m];F(D,H)<0&&M.push(f[A]),D[A]=H,A++}return M=M.sort(function(yt,vt){return yt[m]>vt[m]}),M}function rt(f,m){for(var y,M,D=m[0].toUpperCase()+m.slice(1),A=0;A<o.length;){if(y=o[A],M=y?y+D:m,M in f)return M;A++}return s}var X=1;function G(){return X++}function K(f){var m=f.ownerDocument||f;return m.defaultView||m.parentWindow||t}var Ct=/mobile|tablet|ip(ad|hone|od)|android/i,dt="ontouchstart"in t,le=rt(t,"PointerEvent")!==s,Qe=dt&&Ct.test(navigator.userAgent),It="touch",Se="pen",Wt="mouse",De="kinect",Kt=25,wt=1,Oe=2,ct=4,kt=8,ui=1,gn=2,mn=4,pn=8,bn=16,Bt=gn|mn,Ce=pn|bn,ar=Bt|Ce,lr=["x","y"],di=["clientX","clientY"];function Lt(f,m){var y=this;this.manager=f,this.callback=m,this.element=f.element,this.target=f.options.inputTarget,this.domHandler=function(M){T(f.options.enable,[f])&&y.handler(M)},this.init()}Lt.prototype={handler:function(){},init:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(K(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(K(this.element),this.evWin,this.domHandler)}};function Fh(f){var m,y=f.options.inputClass;return y?m=y:le?m=ws:Qe?m=mi:dt?m=vs:m=gi,new m(f,Nh)}function Nh(f,m,y){var M=y.pointers.length,D=y.changedPointers.length,A=m&wt&&M-D===0,H=m&(ct|kt)&&M-D===0;y.isFirst=!!A,y.isFinal=!!H,A&&(f.session={}),y.eventType=m,zh(f,y),f.emit("hammer.input",y),f.recognize(y),f.session.prevInput=y}function zh(f,m){var y=f.session,M=m.pointers,D=M.length;y.firstInput||(y.firstInput=cr(m)),D>1&&!y.firstMultiple?y.firstMultiple=cr(m):D===1&&(y.firstMultiple=!1);var A=y.firstInput,H=y.firstMultiple,ft=H?H.center:A.center,yt=m.center=hr(M);m.timeStamp=h(),m.deltaTime=m.timeStamp-A.timeStamp,m.angle=_s(ft,yt),m.distance=fi(ft,yt),Wh(y,m),m.offsetDirection=dr(m.deltaX,m.deltaY);var vt=ur(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=vt.x,m.overallVelocityY=vt.y,m.overallVelocity=c(vt.x)>c(vt.y)?vt.x:vt.y,m.scale=H?Bh(H.pointers,M):1,m.rotation=H?Yh(H.pointers,M):0,m.maxPointers=y.prevInput?m.pointers.length>y.prevInput.maxPointers?m.pointers.length:y.prevInput.maxPointers:m.pointers.length,Hh(y,m);var jt=f.element;S(m.srcEvent.target,jt)&&(jt=m.srcEvent.target),m.target=jt}function Wh(f,m){var y=m.center,M=f.offsetDelta||{},D=f.prevDelta||{},A=f.prevInput||{};(m.eventType===wt||A.eventType===ct)&&(D=f.prevDelta={x:A.deltaX||0,y:A.deltaY||0},M=f.offsetDelta={x:y.x,y:y.y}),m.deltaX=D.x+(y.x-M.x),m.deltaY=D.y+(y.y-M.y)}function Hh(f,m){var y=f.lastInterval||m,M=m.timeStamp-y.timeStamp,D,A,H,ft;if(m.eventType!=kt&&(M>Kt||y.velocity===s)){var yt=m.deltaX-y.deltaX,vt=m.deltaY-y.deltaY,jt=ur(M,yt,vt);A=jt.x,H=jt.y,D=c(jt.x)>c(jt.y)?jt.x:jt.y,ft=dr(yt,vt),f.lastInterval=m}else D=y.velocity,A=y.velocityX,H=y.velocityY,ft=y.direction;m.velocity=D,m.velocityX=A,m.velocityY=H,m.direction=ft}function cr(f){for(var m=[],y=0;y<f.pointers.length;)m[y]={clientX:l(f.pointers[y].clientX),clientY:l(f.pointers[y].clientY)},y++;return{timeStamp:h(),pointers:m,center:hr(m),deltaX:f.deltaX,deltaY:f.deltaY}}function hr(f){var m=f.length;if(m===1)return{x:l(f[0].clientX),y:l(f[0].clientY)};for(var y=0,M=0,D=0;D<m;)y+=f[D].clientX,M+=f[D].clientY,D++;return{x:l(y/m),y:l(M/m)}}function ur(f,m,y){return{x:m/f||0,y:y/f||0}}function dr(f,m){return f===m?ui:c(f)>=c(m)?f<0?gn:mn:m<0?pn:bn}function fi(f,m,y){y||(y=lr);var M=m[y[0]]-f[y[0]],D=m[y[1]]-f[y[1]];return Math.sqrt(M*M+D*D)}function _s(f,m,y){y||(y=lr);var M=m[y[0]]-f[y[0]],D=m[y[1]]-f[y[1]];return Math.atan2(D,M)*180/Math.PI}function Yh(f,m){return _s(m[1],m[0],di)+_s(f[1],f[0],di)}function Bh(f,m){return fi(m[0],m[1],di)/fi(f[0],f[1],di)}var Vh={mousedown:wt,mousemove:Oe,mouseup:ct},jh="mousedown",Xh="mousemove mouseup";function gi(){this.evEl=jh,this.evWin=Xh,this.pressed=!1,Lt.apply(this,arguments)}w(gi,Lt,{handler:function(m){var y=Vh[m.type];y&wt&&m.button===0&&(this.pressed=!0),y&Oe&&m.which!==1&&(y=ct),this.pressed&&(y&ct&&(this.pressed=!1),this.callback(this.manager,y,{pointers:[m],changedPointers:[m],pointerType:Wt,srcEvent:m}))}});var Uh={pointerdown:wt,pointermove:Oe,pointerup:ct,pointercancel:kt,pointerout:kt},qh={2:It,3:Se,4:Wt,5:De},fr="pointerdown",gr="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(fr="MSPointerDown",gr="MSPointerMove MSPointerUp MSPointerCancel");function ws(){this.evEl=fr,this.evWin=gr,Lt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(ws,Lt,{handler:function(m){var y=this.store,M=!1,D=m.type.toLowerCase().replace("ms",""),A=Uh[D],H=qh[m.pointerType]||m.pointerType,ft=H==It,yt=F(y,m.pointerId,"pointerId");A&wt&&(m.button===0||ft)?yt<0&&(y.push(m),yt=y.length-1):A&(ct|kt)&&(M=!0),!(yt<0)&&(y[yt]=m,this.callback(this.manager,A,{pointers:y,changedPointers:[m],pointerType:H,srcEvent:m}),M&&y.splice(yt,1))}});var $h={touchstart:wt,touchmove:Oe,touchend:ct,touchcancel:kt},Gh="touchstart",Qh="touchstart touchmove touchend touchcancel";function mr(){this.evTarget=Gh,this.evWin=Qh,this.started=!1,Lt.apply(this,arguments)}w(mr,Lt,{handler:function(m){var y=$h[m.type];if(y===wt&&(this.started=!0),!!this.started){var M=Zh.call(this,m,y);y&(ct|kt)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,y,{pointers:M[0],changedPointers:M[1],pointerType:It,srcEvent:m})}}});function Zh(f,m){var y=z(f.touches),M=z(f.changedTouches);return m&(ct|kt)&&(y=tt(y.concat(M),"identifier")),[y,M]}var Kh={touchstart:wt,touchmove:Oe,touchend:ct,touchcancel:kt},Jh="touchstart touchmove touchend touchcancel";function mi(){this.evTarget=Jh,this.targetIds={},Lt.apply(this,arguments)}w(mi,Lt,{handler:function(m){var y=Kh[m.type],M=tu.call(this,m,y);M&&this.callback(this.manager,y,{pointers:M[0],changedPointers:M[1],pointerType:It,srcEvent:m})}});function tu(f,m){var y=z(f.touches),M=this.targetIds;if(m&(wt|Oe)&&y.length===1)return M[y[0].identifier]=!0,[y,y];var D,A,H=z(f.changedTouches),ft=[],yt=this.target;if(A=y.filter(function(vt){return S(vt.target,yt)}),m===wt)for(D=0;D<A.length;)M[A[D].identifier]=!0,D++;for(D=0;D<H.length;)M[H[D].identifier]&&ft.push(H[D]),m&(ct|kt)&&delete M[H[D].identifier],D++;if(ft.length)return[tt(A.concat(ft),"identifier"),ft]}var eu=2500,pr=25;function vs(){Lt.apply(this,arguments);var f=k(this.handler,this);this.touch=new mi(this.manager,f),this.mouse=new gi(this.manager,f),this.primaryTouch=null,this.lastTouches=[]}w(vs,Lt,{handler:function(m,y,M){var D=M.pointerType==It,A=M.pointerType==Wt;if(!(A&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(D)nu.call(this,y,M);else if(A&&iu.call(this,M))return;this.callback(m,y,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function nu(f,m){f&wt?(this.primaryTouch=m.changedPointers[0].identifier,br.call(this,m)):f&(ct|kt)&&br.call(this,m)}function br(f){var m=f.changedPointers[0];if(m.identifier===this.primaryTouch){var y={x:m.clientX,y:m.clientY};this.lastTouches.push(y);var M=this.lastTouches,D=function(){var A=M.indexOf(y);A>-1&&M.splice(A,1)};setTimeout(D,eu)}}function iu(f){for(var m=f.srcEvent.clientX,y=f.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var D=this.lastTouches[M],A=Math.abs(m-D.x),H=Math.abs(y-D.y);if(A<=pr&&H<=pr)return!0}return!1}var yr=rt(r.style,"touchAction"),xr=yr!==s,_r="compute",wr="auto",Ms="manipulation",Ee="none",yn="pan-x",xn="pan-y",pi=ou();function ks(f,m){this.manager=f,this.set(m)}ks.prototype={set:function(f){f==_r&&(f=this.compute()),xr&&this.manager.element.style&&pi[f]&&(this.manager.element.style[yr]=f),this.actions=f.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var f=[];return g(this.manager.recognizers,function(m){T(m.options.enable,[m])&&(f=f.concat(m.getTouchAction()))}),su(f.join(" "))},preventDefaults:function(f){var m=f.srcEvent,y=f.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var M=this.actions,D=E(M,Ee)&&!pi[Ee],A=E(M,xn)&&!pi[xn],H=E(M,yn)&&!pi[yn];if(D){var ft=f.pointers.length===1,yt=f.distance<2,vt=f.deltaTime<250;if(ft&&yt&&vt)return}if(!(H&&A)&&(D||A&&y&Bt||H&&y&Ce))return this.preventSrc(m)},preventSrc:function(f){this.manager.session.prevented=!0,f.preventDefault()}};function su(f){if(E(f,Ee))return Ee;var m=E(f,yn),y=E(f,xn);return m&&y?Ee:m||y?m?yn:xn:E(f,Ms)?Ms:wr}function ou(){if(!xr)return!1;var f={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(y){f[y]=m?t.CSS.supports("touch-action",y):!0}),f}var bi=1,Rt=2,Ze=4,ce=8,Jt=ce,_n=16,Vt=32;function te(f){this.options=b({},this.defaults,f||{}),this.id=G(),this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=bi,this.simultaneous={},this.requireFail=[]}te.prototype={defaults:{},set:function(f){return b(this.options,f),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(f){if(d(f,"recognizeWith",this))return this;var m=this.simultaneous;return f=yi(f,this),m[f.id]||(m[f.id]=f,f.recognizeWith(this)),this},dropRecognizeWith:function(f){return d(f,"dropRecognizeWith",this)?this:(f=yi(f,this),delete this.simultaneous[f.id],this)},requireFailure:function(f){if(d(f,"requireFailure",this))return this;var m=this.requireFail;return f=yi(f,this),F(m,f)===-1&&(m.push(f),f.requireFailure(this)),this},dropRequireFailure:function(f){if(d(f,"dropRequireFailure",this))return this;f=yi(f,this);var m=F(this.requireFail,f);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(f){return!!this.simultaneous[f.id]},emit:function(f){var m=this,y=this.state;function M(D){m.manager.emit(D,f)}y<ce&&M(m.options.event+vr(y)),M(m.options.event),f.additionalEvent&&M(f.additionalEvent),y>=ce&&M(m.options.event+vr(y))},tryEmit:function(f){if(this.canEmit())return this.emit(f);this.state=Vt},canEmit:function(){for(var f=0;f<this.requireFail.length;){if(!(this.requireFail[f].state&(Vt|bi)))return!1;f++}return!0},recognize:function(f){var m=b({},f);if(!T(this.options.enable,[this,m])){this.reset(),this.state=Vt;return}this.state&(Jt|_n|Vt)&&(this.state=bi),this.state=this.process(m),this.state&(Rt|Ze|ce|_n)&&this.tryEmit(m)},process:function(f){},getTouchAction:function(){},reset:function(){}};function vr(f){return f&_n?"cancel":f&ce?"end":f&Ze?"move":f&Rt?"start":""}function Mr(f){return f==bn?"down":f==pn?"up":f==gn?"left":f==mn?"right":""}function yi(f,m){var y=m.manager;return y?y.get(f):f}function Ht(){te.apply(this,arguments)}w(Ht,te,{defaults:{pointers:1},attrTest:function(f){var m=this.options.pointers;return m===0||f.pointers.length===m},process:function(f){var m=this.state,y=f.eventType,M=m&(Rt|Ze),D=this.attrTest(f);return M&&(y&kt||!D)?m|_n:M||D?y&ct?m|ce:m&Rt?m|Ze:Rt:Vt}});function xi(){Ht.apply(this,arguments),this.pX=null,this.pY=null}w(xi,Ht,{defaults:{event:"pan",threshold:10,pointers:1,direction:ar},getTouchAction:function(){var f=this.options.direction,m=[];return f&Bt&&m.push(xn),f&Ce&&m.push(yn),m},directionTest:function(f){var m=this.options,y=!0,M=f.distance,D=f.direction,A=f.deltaX,H=f.deltaY;return D&m.direction||(m.direction&Bt?(D=A===0?ui:A<0?gn:mn,y=A!=this.pX,M=Math.abs(f.deltaX)):(D=H===0?ui:H<0?pn:bn,y=H!=this.pY,M=Math.abs(f.deltaY))),f.direction=D,y&&M>m.threshold&&D&m.direction},attrTest:function(f){return Ht.prototype.attrTest.call(this,f)&&(this.state&Rt||!(this.state&Rt)&&this.directionTest(f))},emit:function(f){this.pX=f.deltaX,this.pY=f.deltaY;var m=Mr(f.direction);m&&(f.additionalEvent=this.options.event+m),this._super.emit.call(this,f)}});function Ps(){Ht.apply(this,arguments)}w(Ps,Ht,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(f){return this._super.attrTest.call(this,f)&&(Math.abs(f.scale-1)>this.options.threshold||this.state&Rt)},emit:function(f){if(f.scale!==1){var m=f.scale<1?"in":"out";f.additionalEvent=this.options.event+m}this._super.emit.call(this,f)}});function Ts(){te.apply(this,arguments),this._timer=null,this._input=null}w(Ts,te,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[wr]},process:function(f){var m=this.options,y=f.pointers.length===m.pointers,M=f.distance<m.threshold,D=f.deltaTime>m.time;if(this._input=f,!M||!y||f.eventType&(ct|kt)&&!D)this.reset();else if(f.eventType&wt)this.reset(),this._timer=u(function(){this.state=Jt,this.tryEmit()},m.time,this);else if(f.eventType&ct)return Jt;return Vt},reset:function(){clearTimeout(this._timer)},emit:function(f){this.state===Jt&&(f&&f.eventType&ct?this.manager.emit(this.options.event+"up",f):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function Ss(){Ht.apply(this,arguments)}w(Ss,Ht,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ee]},attrTest:function(f){return this._super.attrTest.call(this,f)&&(Math.abs(f.rotation)>this.options.threshold||this.state&Rt)}});function Ds(){Ht.apply(this,arguments)}w(Ds,Ht,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Bt|Ce,pointers:1},getTouchAction:function(){return xi.prototype.getTouchAction.call(this)},attrTest:function(f){var m=this.options.direction,y;return m&(Bt|Ce)?y=f.overallVelocity:m&Bt?y=f.overallVelocityX:m&Ce&&(y=f.overallVelocityY),this._super.attrTest.call(this,f)&&m&f.offsetDirection&&f.distance>this.options.threshold&&f.maxPointers==this.options.pointers&&c(y)>this.options.velocity&&f.eventType&ct},emit:function(f){var m=Mr(f.offsetDirection);m&&this.manager.emit(this.options.event+m,f),this.manager.emit(this.options.event,f)}});function _i(){te.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(_i,te,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ms]},process:function(f){var m=this.options,y=f.pointers.length===m.pointers,M=f.distance<m.threshold,D=f.deltaTime<m.time;if(this.reset(),f.eventType&wt&&this.count===0)return this.failTimeout();if(M&&D&&y){if(f.eventType!=ct)return this.failTimeout();var A=this.pTime?f.timeStamp-this.pTime<m.interval:!0,H=!this.pCenter||fi(this.pCenter,f.center)<m.posThreshold;this.pTime=f.timeStamp,this.pCenter=f.center,!H||!A?this.count=1:this.count+=1,this._input=f;var ft=this.count%m.taps;if(ft===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=Jt,this.tryEmit()},m.interval,this),Rt):Jt}return Vt},failTimeout:function(){return this._timer=u(function(){this.state=Vt},this.options.interval,this),Vt},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Jt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function he(f,m){return m=m||{},m.recognizers=P(m.recognizers,he.defaults.preset),new Os(f,m)}he.VERSION="2.0.7",he.defaults={domEvents:!1,touchAction:_r,enable:!0,inputTarget:null,inputClass:null,preset:[[Ss,{enable:!1}],[Ps,{enable:!1},["rotate"]],[Ds,{direction:Bt}],[xi,{direction:Bt},["swipe"]],[_i],[_i,{event:"doubletap",taps:2},["tap"]],[Ts]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var ru=1,kr=2;function Os(f,m){this.options=b({},he.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||f,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=f,this.input=Fh(this),this.touchAction=new ks(this,this.options.touchAction),Pr(this,!0),g(this.options.recognizers,function(y){var M=this.add(new y[0](y[1]));y[2]&&M.recognizeWith(y[2]),y[3]&&M.requireFailure(y[3])},this)}Os.prototype={set:function(f){return b(this.options,f),f.touchAction&&this.touchAction.update(),f.inputTarget&&(this.input.destroy(),this.input.target=f.inputTarget,this.input.init()),this},stop:function(f){this.session.stopped=f?kr:ru},recognize:function(f){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(f);var y,M=this.recognizers,D=m.curRecognizer;(!D||D&&D.state&Jt)&&(D=m.curRecognizer=null);for(var A=0;A<M.length;)y=M[A],m.stopped!==kr&&(!D||y==D||y.canRecognizeWith(D))?y.recognize(f):y.reset(),!D&&y.state&(Rt|Ze|ce)&&(D=m.curRecognizer=y),A++}},get:function(f){if(f instanceof te)return f;for(var m=this.recognizers,y=0;y<m.length;y++)if(m[y].options.event==f)return m[y];return null},add:function(f){if(d(f,"add",this))return this;var m=this.get(f.options.event);return m&&this.remove(m),this.recognizers.push(f),f.manager=this,this.touchAction.update(),f},remove:function(f){if(d(f,"remove",this))return this;if(f=this.get(f),f){var m=this.recognizers,y=F(m,f);y!==-1&&(m.splice(y,1),this.touchAction.update())}return this},on:function(f,m){if(f!==s&&m!==s){var y=this.handlers;return g(I(f),function(M){y[M]=y[M]||[],y[M].push(m)}),this}},off:function(f,m){if(f!==s){var y=this.handlers;return g(I(f),function(M){m?y[M]&&y[M].splice(F(y[M],m),1):delete y[M]}),this}},emit:function(f,m){this.options.domEvents&&au(f,m);var y=this.handlers[f]&&this.handlers[f].slice();if(!(!y||!y.length)){m.type=f,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var M=0;M<y.length;)y[M](m),M++}},destroy:function(){this.element&&Pr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Pr(f,m){var y=f.element;if(y.style){var M;g(f.options.cssProps,function(D,A){M=rt(y.style,A),m?(f.oldCssProps[M]=y.style[M],y.style[M]=D):y.style[M]=f.oldCssProps[M]||""}),m||(f.oldCssProps={})}}function au(f,m){var y=e.createEvent("Event");y.initEvent(f,!0,!0),y.gesture=m,m.target.dispatchEvent(y)}b(he,{INPUT_START:wt,INPUT_MOVE:Oe,INPUT_END:ct,INPUT_CANCEL:kt,STATE_POSSIBLE:bi,STATE_BEGAN:Rt,STATE_CHANGED:Ze,STATE_ENDED:ce,STATE_RECOGNIZED:Jt,STATE_CANCELLED:_n,STATE_FAILED:Vt,DIRECTION_NONE:ui,DIRECTION_LEFT:gn,DIRECTION_RIGHT:mn,DIRECTION_UP:pn,DIRECTION_DOWN:bn,DIRECTION_HORIZONTAL:Bt,DIRECTION_VERTICAL:Ce,DIRECTION_ALL:ar,Manager:Os,Input:Lt,TouchAction:ks,TouchInput:mi,MouseInput:gi,PointerEventInput:ws,TouchMouseInput:vs,SingleTouchInput:mr,Recognizer:te,AttrRecognizer:Ht,Tap:_i,Pan:xi,Swipe:Ds,Pinch:Ps,Rotate:Ss,Press:Ts,on:O,off:C,each:g,merge:_,extend:x,assign:b,inherit:w,bindFn:k,prefixed:rt});var lu=typeof t<"u"?t:typeof self<"u"?self:{};lu.Hammer=he,n.exports?n.exports=he:t[i]=he})(window,document,"Hammer")}(Us)),Us.exports}var Ix=Ax();const Xn=Ex(Ix);/*!
|
|
39
|
+
`;return function(){var D=new Error("get-stack-trace"),A=D&&D.stack?D.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",B=t.console&&(t.console.warn||t.console.log);return B&&B.call(t.console,M,A),g.apply(this,arguments)}}var b;typeof Object.assign!="function"?b=function(m){if(m===s||m===null)throw new TypeError("Cannot convert undefined or null to object");for(var y=Object(m),M=1;M<arguments.length;M++){var D=arguments[M];if(D!==s&&D!==null)for(var A in D)D.hasOwnProperty(A)&&(y[A]=D[A])}return y}:b=Object.assign;var x=p(function(m,y,M){for(var D=Object.keys(y),A=0;A<D.length;)(!M||M&&m[D[A]]===s)&&(m[D[A]]=y[D[A]]),A++;return m},"extend","Use `assign`."),_=p(function(m,y){return x(m,y,!0)},"merge","Use `assign`.");function w(g,m,y){var M=m.prototype,D;D=g.prototype=Object.create(M),D.constructor=g,D._super=M,y&&b(D,y)}function k(g,m){return function(){return g.apply(m,arguments)}}function T(g,m){return typeof g==a?g.apply(m&&m[0]||s,m):g}function P(g,m){return g===s?m:g}function O(g,m,y){f(L(m),function(M){g.addEventListener(M,y,!1)})}function C(g,m,y){f(L(m),function(M){g.removeEventListener(M,y,!1)})}function S(g,m){for(;g;){if(g==m)return!0;g=g.parentNode}return!1}function E(g,m){return g.indexOf(m)>-1}function L(g){return g.trim().split(/\s+/g)}function N(g,m,y){if(g.indexOf&&!y)return g.indexOf(m);for(var M=0;M<g.length;){if(y&&g[M][y]==m||!y&&g[M]===m)return M;M++}return-1}function W(g){return Array.prototype.slice.call(g,0)}function nt(g,m,y){for(var M=[],D=[],A=0;A<g.length;){var B=g[A][m];N(D,B)<0&&M.push(g[A]),D[A]=B,A++}return M=M.sort(function(_t,kt){return _t[m]>kt[m]}),M}function lt(g,m){for(var y,M,D=m[0].toUpperCase()+m.slice(1),A=0;A<o.length;){if(y=o[A],M=y?y+D:m,M in g)return M;A++}return s}var U=1;function Q(){return U++}function J(g){var m=g.ownerDocument||g;return m.defaultView||m.parentWindow||t}var It=/mobile|tablet|ip(ad|hone|od)|android/i,mt="ontouchstart"in t,ue=lt(t,"PointerEvent")!==s,nn=mt&&It.test(navigator.userAgent),Ft="touch",Oe="pen",Yt="mouse",Ce="kinect",ee=25,Mt=1,Ee=2,ut=4,Tt=8,Oi=1,Pn=2,Tn=4,Sn=8,Dn=16,Xt=Pn|Tn,Ae=Sn|Dn,Sr=Xt|Ae,Dr=["x","y"],Ci=["clientX","clientY"];function Nt(g,m){var y=this;this.manager=g,this.callback=m,this.element=g.element,this.target=g.options.inputTarget,this.domHandler=function(M){T(g.options.enable,[g])&&y.handler(M)},this.init()}Nt.prototype={handler:function(){},init:function(){this.evEl&&O(this.element,this.evEl,this.domHandler),this.evTarget&&O(this.target,this.evTarget,this.domHandler),this.evWin&&O(J(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&C(this.element,this.evEl,this.domHandler),this.evTarget&&C(this.target,this.evTarget,this.domHandler),this.evWin&&C(J(this.element),this.evWin,this.domHandler)}};function iu(g){var m,y=g.options.inputClass;return y?m=y:ue?m=Ws:nn?m=Ii:mt?m=Hs:m=Ai,new m(g,su)}function su(g,m,y){var M=y.pointers.length,D=y.changedPointers.length,A=m&Mt&&M-D===0,B=m&(ut|Tt)&&M-D===0;y.isFirst=!!A,y.isFinal=!!B,A&&(g.session={}),y.eventType=m,ou(g,y),g.emit("hammer.input",y),g.recognize(y),g.session.prevInput=y}function ou(g,m){var y=g.session,M=m.pointers,D=M.length;y.firstInput||(y.firstInput=Or(m)),D>1&&!y.firstMultiple?y.firstMultiple=Or(m):D===1&&(y.firstMultiple=!1);var A=y.firstInput,B=y.firstMultiple,pt=B?B.center:A.center,_t=m.center=Cr(M);m.timeStamp=h(),m.deltaTime=m.timeStamp-A.timeStamp,m.angle=zs(pt,_t),m.distance=Ei(pt,_t),ru(y,m),m.offsetDirection=Ar(m.deltaX,m.deltaY);var kt=Er(m.deltaTime,m.deltaX,m.deltaY);m.overallVelocityX=kt.x,m.overallVelocityY=kt.y,m.overallVelocity=c(kt.x)>c(kt.y)?kt.x:kt.y,m.scale=B?cu(B.pointers,M):1,m.rotation=B?lu(B.pointers,M):0,m.maxPointers=y.prevInput?m.pointers.length>y.prevInput.maxPointers?m.pointers.length:y.prevInput.maxPointers:m.pointers.length,au(y,m);var qt=g.element;S(m.srcEvent.target,qt)&&(qt=m.srcEvent.target),m.target=qt}function ru(g,m){var y=m.center,M=g.offsetDelta||{},D=g.prevDelta||{},A=g.prevInput||{};(m.eventType===Mt||A.eventType===ut)&&(D=g.prevDelta={x:A.deltaX||0,y:A.deltaY||0},M=g.offsetDelta={x:y.x,y:y.y}),m.deltaX=D.x+(y.x-M.x),m.deltaY=D.y+(y.y-M.y)}function au(g,m){var y=g.lastInterval||m,M=m.timeStamp-y.timeStamp,D,A,B,pt;if(m.eventType!=Tt&&(M>ee||y.velocity===s)){var _t=m.deltaX-y.deltaX,kt=m.deltaY-y.deltaY,qt=Er(M,_t,kt);A=qt.x,B=qt.y,D=c(qt.x)>c(qt.y)?qt.x:qt.y,pt=Ar(_t,kt),g.lastInterval=m}else D=y.velocity,A=y.velocityX,B=y.velocityY,pt=y.direction;m.velocity=D,m.velocityX=A,m.velocityY=B,m.direction=pt}function Or(g){for(var m=[],y=0;y<g.pointers.length;)m[y]={clientX:l(g.pointers[y].clientX),clientY:l(g.pointers[y].clientY)},y++;return{timeStamp:h(),pointers:m,center:Cr(m),deltaX:g.deltaX,deltaY:g.deltaY}}function Cr(g){var m=g.length;if(m===1)return{x:l(g[0].clientX),y:l(g[0].clientY)};for(var y=0,M=0,D=0;D<m;)y+=g[D].clientX,M+=g[D].clientY,D++;return{x:l(y/m),y:l(M/m)}}function Er(g,m,y){return{x:m/g||0,y:y/g||0}}function Ar(g,m){return g===m?Oi:c(g)>=c(m)?g<0?Pn:Tn:m<0?Sn:Dn}function Ei(g,m,y){y||(y=Dr);var M=m[y[0]]-g[y[0]],D=m[y[1]]-g[y[1]];return Math.sqrt(M*M+D*D)}function zs(g,m,y){y||(y=Dr);var M=m[y[0]]-g[y[0]],D=m[y[1]]-g[y[1]];return Math.atan2(D,M)*180/Math.PI}function lu(g,m){return zs(m[1],m[0],Ci)+zs(g[1],g[0],Ci)}function cu(g,m){return Ei(m[0],m[1],Ci)/Ei(g[0],g[1],Ci)}var hu={mousedown:Mt,mousemove:Ee,mouseup:ut},uu="mousedown",du="mousemove mouseup";function Ai(){this.evEl=uu,this.evWin=du,this.pressed=!1,Nt.apply(this,arguments)}w(Ai,Nt,{handler:function(m){var y=hu[m.type];y&Mt&&m.button===0&&(this.pressed=!0),y&Ee&&m.which!==1&&(y=ut),this.pressed&&(y&ut&&(this.pressed=!1),this.callback(this.manager,y,{pointers:[m],changedPointers:[m],pointerType:Yt,srcEvent:m}))}});var fu={pointerdown:Mt,pointermove:Ee,pointerup:ut,pointercancel:Tt,pointerout:Tt},gu={2:Ft,3:Oe,4:Yt,5:Ce},Ir="pointerdown",Lr="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Ir="MSPointerDown",Lr="MSPointerMove MSPointerUp MSPointerCancel");function Ws(){this.evEl=Ir,this.evWin=Lr,Nt.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}w(Ws,Nt,{handler:function(m){var y=this.store,M=!1,D=m.type.toLowerCase().replace("ms",""),A=fu[D],B=gu[m.pointerType]||m.pointerType,pt=B==Ft,_t=N(y,m.pointerId,"pointerId");A&Mt&&(m.button===0||pt)?_t<0&&(y.push(m),_t=y.length-1):A&(ut|Tt)&&(M=!0),!(_t<0)&&(y[_t]=m,this.callback(this.manager,A,{pointers:y,changedPointers:[m],pointerType:B,srcEvent:m}),M&&y.splice(_t,1))}});var mu={touchstart:Mt,touchmove:Ee,touchend:ut,touchcancel:Tt},pu="touchstart",bu="touchstart touchmove touchend touchcancel";function Rr(){this.evTarget=pu,this.evWin=bu,this.started=!1,Nt.apply(this,arguments)}w(Rr,Nt,{handler:function(m){var y=mu[m.type];if(y===Mt&&(this.started=!0),!!this.started){var M=yu.call(this,m,y);y&(ut|Tt)&&M[0].length-M[1].length===0&&(this.started=!1),this.callback(this.manager,y,{pointers:M[0],changedPointers:M[1],pointerType:Ft,srcEvent:m})}}});function yu(g,m){var y=W(g.touches),M=W(g.changedTouches);return m&(ut|Tt)&&(y=nt(y.concat(M),"identifier")),[y,M]}var xu={touchstart:Mt,touchmove:Ee,touchend:ut,touchcancel:Tt},_u="touchstart touchmove touchend touchcancel";function Ii(){this.evTarget=_u,this.targetIds={},Nt.apply(this,arguments)}w(Ii,Nt,{handler:function(m){var y=xu[m.type],M=wu.call(this,m,y);M&&this.callback(this.manager,y,{pointers:M[0],changedPointers:M[1],pointerType:Ft,srcEvent:m})}});function wu(g,m){var y=W(g.touches),M=this.targetIds;if(m&(Mt|Ee)&&y.length===1)return M[y[0].identifier]=!0,[y,y];var D,A,B=W(g.changedTouches),pt=[],_t=this.target;if(A=y.filter(function(kt){return S(kt.target,_t)}),m===Mt)for(D=0;D<A.length;)M[A[D].identifier]=!0,D++;for(D=0;D<B.length;)M[B[D].identifier]&&pt.push(B[D]),m&(ut|Tt)&&delete M[B[D].identifier],D++;if(pt.length)return[nt(A.concat(pt),"identifier"),pt]}var vu=2500,Fr=25;function Hs(){Nt.apply(this,arguments);var g=k(this.handler,this);this.touch=new Ii(this.manager,g),this.mouse=new Ai(this.manager,g),this.primaryTouch=null,this.lastTouches=[]}w(Hs,Nt,{handler:function(m,y,M){var D=M.pointerType==Ft,A=M.pointerType==Yt;if(!(A&&M.sourceCapabilities&&M.sourceCapabilities.firesTouchEvents)){if(D)Mu.call(this,y,M);else if(A&&ku.call(this,M))return;this.callback(m,y,M)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Mu(g,m){g&Mt?(this.primaryTouch=m.changedPointers[0].identifier,Nr.call(this,m)):g&(ut|Tt)&&Nr.call(this,m)}function Nr(g){var m=g.changedPointers[0];if(m.identifier===this.primaryTouch){var y={x:m.clientX,y:m.clientY};this.lastTouches.push(y);var M=this.lastTouches,D=function(){var A=M.indexOf(y);A>-1&&M.splice(A,1)};setTimeout(D,vu)}}function ku(g){for(var m=g.srcEvent.clientX,y=g.srcEvent.clientY,M=0;M<this.lastTouches.length;M++){var D=this.lastTouches[M],A=Math.abs(m-D.x),B=Math.abs(y-D.y);if(A<=Fr&&B<=Fr)return!0}return!1}var zr=lt(r.style,"touchAction"),Wr=zr!==s,Hr="compute",Br="auto",Bs="manipulation",Ie="none",On="pan-x",Cn="pan-y",Li=Tu();function Ys(g,m){this.manager=g,this.set(m)}Ys.prototype={set:function(g){g==Hr&&(g=this.compute()),Wr&&this.manager.element.style&&Li[g]&&(this.manager.element.style[zr]=g),this.actions=g.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var g=[];return f(this.manager.recognizers,function(m){T(m.options.enable,[m])&&(g=g.concat(m.getTouchAction()))}),Pu(g.join(" "))},preventDefaults:function(g){var m=g.srcEvent,y=g.offsetDirection;if(this.manager.session.prevented){m.preventDefault();return}var M=this.actions,D=E(M,Ie)&&!Li[Ie],A=E(M,Cn)&&!Li[Cn],B=E(M,On)&&!Li[On];if(D){var pt=g.pointers.length===1,_t=g.distance<2,kt=g.deltaTime<250;if(pt&&_t&&kt)return}if(!(B&&A)&&(D||A&&y&Xt||B&&y&Ae))return this.preventSrc(m)},preventSrc:function(g){this.manager.session.prevented=!0,g.preventDefault()}};function Pu(g){if(E(g,Ie))return Ie;var m=E(g,On),y=E(g,Cn);return m&&y?Ie:m||y?m?On:Cn:E(g,Bs)?Bs:Br}function Tu(){if(!Wr)return!1;var g={},m=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(y){g[y]=m?t.CSS.supports("touch-action",y):!0}),g}var Ri=1,zt=2,sn=4,de=8,ne=de,En=16,Ut=32;function ie(g){this.options=b({},this.defaults,g||{}),this.id=Q(),this.manager=null,this.options.enable=P(this.options.enable,!0),this.state=Ri,this.simultaneous={},this.requireFail=[]}ie.prototype={defaults:{},set:function(g){return b(this.options,g),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(g){if(d(g,"recognizeWith",this))return this;var m=this.simultaneous;return g=Fi(g,this),m[g.id]||(m[g.id]=g,g.recognizeWith(this)),this},dropRecognizeWith:function(g){return d(g,"dropRecognizeWith",this)?this:(g=Fi(g,this),delete this.simultaneous[g.id],this)},requireFailure:function(g){if(d(g,"requireFailure",this))return this;var m=this.requireFail;return g=Fi(g,this),N(m,g)===-1&&(m.push(g),g.requireFailure(this)),this},dropRequireFailure:function(g){if(d(g,"dropRequireFailure",this))return this;g=Fi(g,this);var m=N(this.requireFail,g);return m>-1&&this.requireFail.splice(m,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(g){return!!this.simultaneous[g.id]},emit:function(g){var m=this,y=this.state;function M(D){m.manager.emit(D,g)}y<de&&M(m.options.event+Yr(y)),M(m.options.event),g.additionalEvent&&M(g.additionalEvent),y>=de&&M(m.options.event+Yr(y))},tryEmit:function(g){if(this.canEmit())return this.emit(g);this.state=Ut},canEmit:function(){for(var g=0;g<this.requireFail.length;){if(!(this.requireFail[g].state&(Ut|Ri)))return!1;g++}return!0},recognize:function(g){var m=b({},g);if(!T(this.options.enable,[this,m])){this.reset(),this.state=Ut;return}this.state&(ne|En|Ut)&&(this.state=Ri),this.state=this.process(m),this.state&(zt|sn|de|En)&&this.tryEmit(m)},process:function(g){},getTouchAction:function(){},reset:function(){}};function Yr(g){return g&En?"cancel":g&de?"end":g&sn?"move":g&zt?"start":""}function Vr(g){return g==Dn?"down":g==Sn?"up":g==Pn?"left":g==Tn?"right":""}function Fi(g,m){var y=m.manager;return y?y.get(g):g}function Vt(){ie.apply(this,arguments)}w(Vt,ie,{defaults:{pointers:1},attrTest:function(g){var m=this.options.pointers;return m===0||g.pointers.length===m},process:function(g){var m=this.state,y=g.eventType,M=m&(zt|sn),D=this.attrTest(g);return M&&(y&Tt||!D)?m|En:M||D?y&ut?m|de:m&zt?m|sn:zt:Ut}});function Ni(){Vt.apply(this,arguments),this.pX=null,this.pY=null}w(Ni,Vt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Sr},getTouchAction:function(){var g=this.options.direction,m=[];return g&Xt&&m.push(Cn),g&Ae&&m.push(On),m},directionTest:function(g){var m=this.options,y=!0,M=g.distance,D=g.direction,A=g.deltaX,B=g.deltaY;return D&m.direction||(m.direction&Xt?(D=A===0?Oi:A<0?Pn:Tn,y=A!=this.pX,M=Math.abs(g.deltaX)):(D=B===0?Oi:B<0?Sn:Dn,y=B!=this.pY,M=Math.abs(g.deltaY))),g.direction=D,y&&M>m.threshold&&D&m.direction},attrTest:function(g){return Vt.prototype.attrTest.call(this,g)&&(this.state&zt||!(this.state&zt)&&this.directionTest(g))},emit:function(g){this.pX=g.deltaX,this.pY=g.deltaY;var m=Vr(g.direction);m&&(g.additionalEvent=this.options.event+m),this._super.emit.call(this,g)}});function Vs(){Vt.apply(this,arguments)}w(Vs,Vt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.scale-1)>this.options.threshold||this.state&zt)},emit:function(g){if(g.scale!==1){var m=g.scale<1?"in":"out";g.additionalEvent=this.options.event+m}this._super.emit.call(this,g)}});function js(){ie.apply(this,arguments),this._timer=null,this._input=null}w(js,ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Br]},process:function(g){var m=this.options,y=g.pointers.length===m.pointers,M=g.distance<m.threshold,D=g.deltaTime>m.time;if(this._input=g,!M||!y||g.eventType&(ut|Tt)&&!D)this.reset();else if(g.eventType&Mt)this.reset(),this._timer=u(function(){this.state=ne,this.tryEmit()},m.time,this);else if(g.eventType&ut)return ne;return Ut},reset:function(){clearTimeout(this._timer)},emit:function(g){this.state===ne&&(g&&g.eventType&ut?this.manager.emit(this.options.event+"up",g):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function Xs(){Vt.apply(this,arguments)}w(Xs,Vt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ie]},attrTest:function(g){return this._super.attrTest.call(this,g)&&(Math.abs(g.rotation)>this.options.threshold||this.state&zt)}});function Us(){Vt.apply(this,arguments)}w(Us,Vt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Xt|Ae,pointers:1},getTouchAction:function(){return Ni.prototype.getTouchAction.call(this)},attrTest:function(g){var m=this.options.direction,y;return m&(Xt|Ae)?y=g.overallVelocity:m&Xt?y=g.overallVelocityX:m&Ae&&(y=g.overallVelocityY),this._super.attrTest.call(this,g)&&m&g.offsetDirection&&g.distance>this.options.threshold&&g.maxPointers==this.options.pointers&&c(y)>this.options.velocity&&g.eventType&ut},emit:function(g){var m=Vr(g.offsetDirection);m&&this.manager.emit(this.options.event+m,g),this.manager.emit(this.options.event,g)}});function zi(){ie.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}w(zi,ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Bs]},process:function(g){var m=this.options,y=g.pointers.length===m.pointers,M=g.distance<m.threshold,D=g.deltaTime<m.time;if(this.reset(),g.eventType&Mt&&this.count===0)return this.failTimeout();if(M&&D&&y){if(g.eventType!=ut)return this.failTimeout();var A=this.pTime?g.timeStamp-this.pTime<m.interval:!0,B=!this.pCenter||Ei(this.pCenter,g.center)<m.posThreshold;this.pTime=g.timeStamp,this.pCenter=g.center,!B||!A?this.count=1:this.count+=1,this._input=g;var pt=this.count%m.taps;if(pt===0)return this.hasRequireFailures()?(this._timer=u(function(){this.state=ne,this.tryEmit()},m.interval,this),zt):ne}return Ut},failTimeout:function(){return this._timer=u(function(){this.state=Ut},this.options.interval,this),Ut},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ne&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function fe(g,m){return m=m||{},m.recognizers=P(m.recognizers,fe.defaults.preset),new qs(g,m)}fe.VERSION="2.0.7",fe.defaults={domEvents:!1,touchAction:Hr,enable:!0,inputTarget:null,inputClass:null,preset:[[Xs,{enable:!1}],[Vs,{enable:!1},["rotate"]],[Us,{direction:Xt}],[Ni,{direction:Xt},["swipe"]],[zi],[zi,{event:"doubletap",taps:2},["tap"]],[js]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Su=1,jr=2;function qs(g,m){this.options=b({},fe.defaults,m||{}),this.options.inputTarget=this.options.inputTarget||g,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=g,this.input=iu(this),this.touchAction=new Ys(this,this.options.touchAction),Xr(this,!0),f(this.options.recognizers,function(y){var M=this.add(new y[0](y[1]));y[2]&&M.recognizeWith(y[2]),y[3]&&M.requireFailure(y[3])},this)}qs.prototype={set:function(g){return b(this.options,g),g.touchAction&&this.touchAction.update(),g.inputTarget&&(this.input.destroy(),this.input.target=g.inputTarget,this.input.init()),this},stop:function(g){this.session.stopped=g?jr:Su},recognize:function(g){var m=this.session;if(!m.stopped){this.touchAction.preventDefaults(g);var y,M=this.recognizers,D=m.curRecognizer;(!D||D&&D.state&ne)&&(D=m.curRecognizer=null);for(var A=0;A<M.length;)y=M[A],m.stopped!==jr&&(!D||y==D||y.canRecognizeWith(D))?y.recognize(g):y.reset(),!D&&y.state&(zt|sn|de)&&(D=m.curRecognizer=y),A++}},get:function(g){if(g instanceof ie)return g;for(var m=this.recognizers,y=0;y<m.length;y++)if(m[y].options.event==g)return m[y];return null},add:function(g){if(d(g,"add",this))return this;var m=this.get(g.options.event);return m&&this.remove(m),this.recognizers.push(g),g.manager=this,this.touchAction.update(),g},remove:function(g){if(d(g,"remove",this))return this;if(g=this.get(g),g){var m=this.recognizers,y=N(m,g);y!==-1&&(m.splice(y,1),this.touchAction.update())}return this},on:function(g,m){if(g!==s&&m!==s){var y=this.handlers;return f(L(g),function(M){y[M]=y[M]||[],y[M].push(m)}),this}},off:function(g,m){if(g!==s){var y=this.handlers;return f(L(g),function(M){m?y[M]&&y[M].splice(N(y[M],m),1):delete y[M]}),this}},emit:function(g,m){this.options.domEvents&&Du(g,m);var y=this.handlers[g]&&this.handlers[g].slice();if(!(!y||!y.length)){m.type=g,m.preventDefault=function(){m.srcEvent.preventDefault()};for(var M=0;M<y.length;)y[M](m),M++}},destroy:function(){this.element&&Xr(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function Xr(g,m){var y=g.element;if(y.style){var M;f(g.options.cssProps,function(D,A){M=lt(y.style,A),m?(g.oldCssProps[M]=y.style[M],y.style[M]=D):y.style[M]=g.oldCssProps[M]||""}),m||(g.oldCssProps={})}}function Du(g,m){var y=e.createEvent("Event");y.initEvent(g,!0,!0),y.gesture=m,m.target.dispatchEvent(y)}b(fe,{INPUT_START:Mt,INPUT_MOVE:Ee,INPUT_END:ut,INPUT_CANCEL:Tt,STATE_POSSIBLE:Ri,STATE_BEGAN:zt,STATE_CHANGED:sn,STATE_ENDED:de,STATE_RECOGNIZED:ne,STATE_CANCELLED:En,STATE_FAILED:Ut,DIRECTION_NONE:Oi,DIRECTION_LEFT:Pn,DIRECTION_RIGHT:Tn,DIRECTION_UP:Sn,DIRECTION_DOWN:Dn,DIRECTION_HORIZONTAL:Xt,DIRECTION_VERTICAL:Ae,DIRECTION_ALL:Sr,Manager:qs,Input:Nt,TouchAction:Ys,TouchInput:Ii,MouseInput:Ai,PointerEventInput:Ws,TouchMouseInput:Hs,SingleTouchInput:Rr,Recognizer:ie,AttrRecognizer:Vt,Tap:zi,Pan:Ni,Swipe:Us,Pinch:Vs,Rotate:Xs,Press:js,on:O,off:C,each:f,merge:_,extend:x,assign:b,inherit:w,bindFn:k,prefixed:lt});var Ou=typeof t<"u"?t:typeof self<"u"?self:{};Ou.Hammer=fe,n.exports?n.exports=fe:t[i]=fe})(window,document,"Hammer")}(uo)),uo.exports}var t_=Jx();const ni=Zx(t_);/*!
|
|
40
40
|
* chartjs-plugin-zoom v2.2.0
|
|
41
41
|
* https://www.chartjs.org/chartjs-plugin-zoom/2.2.0/
|
|
42
42
|
* (c) 2016-2024 chartjs-plugin-zoom Contributors
|
|
43
43
|
* Released under the MIT License
|
|
44
|
-
*/const Jn=n=>n&&n.enabled&&n.modifierKey,_h=(n,t)=>n&&t[n+"Key"],or=(n,t)=>n&&!t[n+"Key"];function Pe(n,t,e){return n===void 0?!0:typeof n=="string"?n.indexOf(t)!==-1:typeof n=="function"?n({chart:e}).indexOf(t)!==-1:!1}function qs(n,t){return typeof n=="function"&&(n=n({chart:t})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function Lx(n,t){let e;return function(){return clearTimeout(e),e=setTimeout(n,t),t}}function Rx({x:n,y:t},e){const i=e.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){const r=i[s[o]];if(t>=r.top&&t<=r.bottom&&n>=r.left&&n<=r.right)return r}return null}function wh(n,t,e){const{mode:i="xy",scaleMode:s,overScaleMode:o}=n||{},r=Rx(t,e),a=qs(i,e),l=qs(s,e);if(o){const h=qs(o,e);for(const u of["x","y"])h[u]&&(l[u]=a[u],a[u]=!1)}if(r&&l[r.axis])return[r];const c=[];return Y(e.scales,function(h){a[h.axis]&&c.push(h)}),c}const vo=new WeakMap;function nt(n){let t=vo.get(n);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},vo.set(n,t)),t}function Fx(n){vo.delete(n)}function vh(n,t,e,i){const s=Math.max(0,Math.min(1,(n-t)/e||0)),o=1-s;return{min:i*s,max:i*o}}function Mh(n,t){const e=n.isHorizontal()?t.x:t.y;return n.getValueForPixel(e)}function kh(n,t,e){const i=n.max-n.min,s=i*(t-1),o=Mh(n,e);return vh(o,n.min,i,s)}function Nx(n,t,e){const i=Mh(n,e);if(i===void 0)return{min:n.min,max:n.max};const s=Math.log10(n.min),o=Math.log10(n.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=vh(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function zx(n,t){return t&&(t[n.id]||t[n.axis])||{}}function vl(n,t,e,i,s){let o=e[i];if(o==="original"){const r=n.originalScaleLimits[t.id][i];o=R(r.options,r.scale)}return R(o,s)}function Wx(n,t,e){const i=n.getValueForPixel(t),s=n.getValueForPixel(e);return{min:Math.min(i,s),max:Math.max(i,s)}}function Hx(n,{min:t,max:e,minLimit:i,maxLimit:s},o){const r=(n-e+t)/2;t-=r,e+=r;const a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=n/1e6;return We(t,a,c)&&(t=a),We(e,l,c)&&(e=l),t<i?(t=i,e=Math.min(i+n,s)):e>s&&(e=s,t=Math.max(s-n,i)),{min:t,max:e}}function Ge(n,{min:t,max:e},i,s=!1){const o=nt(n.chart),{options:r}=n,a=zx(n,i),{minRange:l=0}=a,c=vl(o,n,a,"min",-1/0),h=vl(o,n,a,"max",1/0);if(s==="pan"&&(t<c||e>h))return!0;const u=n.max-n.min,d=s?Math.max(e-t,l):u;if(s&&d===l&&u<=l)return!0;const g=Hx(d,{min:t,max:e,minLimit:c,maxLimit:h},o.originalScaleLimits[n.id]);return r.min=g.min,r.max=g.max,o.updatedScaleLimits[n.id]=g,n.parse(g.min)!==n.min||n.parse(g.max)!==n.max}function Yx(n,t,e,i){const s=kh(n,t,e),o={min:n.min+s.min,max:n.max-s.max};return Ge(n,o,i,!0)}function Bx(n,t,e,i){const s=Nx(n,t,e);return Ge(n,s,i,!0)}function Vx(n,t,e,i){Ge(n,Wx(n,t,e),i,!0)}const Ml=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function jx(n){const e=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<e&&(n.max+=1)}function Xx(n,t,e,i){const s=kh(n,t,e);n.min===n.max&&t<1&&jx(n);const o={min:n.min+Ml(s.min),max:n.max-Ml(s.max)};return Ge(n,o,i,!0)}function Ux(n){return n.isHorizontal()?n.width:n.height}function qx(n,t,e){const s=n.getLabels().length-1;let{min:o,max:r}=n;const a=Math.max(r-o,1),l=Math.round(Ux(n)/Math.max(a,10)),c=Math.round(Math.abs(t/l));let h;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,h=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,h=o===0),Ge(n,{min:o,max:r},e)||h}const $x={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function Ph(n,t,e,i=!1){const{min:s,max:o,options:r}=n,a=r.time&&r.time.round,l=$x[a]||0,c=n.getValueForPixel(n.getPixelForValue(s+l)-t),h=n.getValueForPixel(n.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(h)?!0:Ge(n,{min:c,max:h},e,i?"pan":!1)}function kl(n,t,e){return Ph(n,t,e,!0)}const Mo={category:Xx,default:Yx,logarithmic:Bx},ko={default:Vx},Po={category:qx,default:Ph,logarithmic:kl,timeseries:kl};function Gx(n,t,e){const{id:i,options:{min:s,max:o}}=n;if(!t[i]||!e[i])return!0;const r=e[i];return r.min!==s||r.max!==o}function Pl(n,t){Y(n,(e,i)=>{t[i]||delete n[i]})}function fn(n,t){const{scales:e}=n,{originalScaleLimits:i,updatedScaleLimits:s}=t;return Y(e,function(o){Gx(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),Pl(i,e),Pl(s,e),i}function Tl(n,t,e,i){const s=Mo[n.type]||Mo.default;L(s,[n,t,e,i])}function Sl(n,t,e,i){const s=ko[n.type]||ko.default;L(s,[n,t,e,i])}function Qx(n){const t=n.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function rr(n,t,e="none",i="api"){const{x:s=1,y:o=1,focalPoint:r=Qx(n)}=typeof t=="number"?{x:t,y:t}:t,a=nt(n),{options:{limits:l,zoom:c}}=a;fn(n,a);const h=s!==1,u=o!==1,d=wh(c,r,n);Y(d||n.scales,function(g){g.isHorizontal()&&h?Tl(g,s,r,l):!g.isHorizontal()&&u&&Tl(g,o,r,l)}),n.update(e),L(c.onZoom,[{chart:n,trigger:i}])}function Th(n,t,e,i="none",s="api"){const o=nt(n),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;fn(n,o);const c=Pe(l,"x",n),h=Pe(l,"y",n);Y(n.scales,function(u){u.isHorizontal()&&c?Sl(u,t.x,e.x,r):!u.isHorizontal()&&h&&Sl(u,t.y,e.y,r)}),n.update(i),L(a.onZoom,[{chart:n,trigger:s}])}function Zx(n,t,e,i="none",s="api"){var a;const o=nt(n);fn(n,o);const r=n.scales[t];Ge(r,e,void 0,!0),n.update(i),L((a=o.options.zoom)==null?void 0:a.onZoom,[{chart:n,trigger:s}])}function Kx(n,t="default"){const e=nt(n),i=fn(n,e);Y(n.scales,function(s){const o=s.options;i[s.id]?(o.min=i[s.id].min.options,o.max=i[s.id].max.options):(delete o.min,delete o.max),delete e.updatedScaleLimits[s.id]}),n.update(t),L(e.options.zoom.onZoomComplete,[{chart:n}])}function Jx(n,t){const e=n.originalScaleLimits[t];if(!e)return;const{min:i,max:s}=e;return R(s.options,s.scale)-R(i.options,i.scale)}function t_(n){const t=nt(n);let e=1,i=1;return Y(n.scales,function(s){const o=Jx(t,s.id);if(o){const r=Math.round(o/(s.max-s.min)*100)/100;e=Math.min(e,r),i=Math.max(i,r)}}),e<1?e:i}function Dl(n,t,e,i){const{panDelta:s}=i,o=s[n.id]||0;zt(o)===zt(t)&&(t+=o);const r=Po[n.type]||Po.default;L(r,[n,t,e])?s[n.id]=0:s[n.id]=t}function Sh(n,t,e,i="none"){const{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=nt(n),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};fn(n,r);const h=s!==0,u=o!==0;Y(e||n.scales,function(d){d.isHorizontal()&&h?Dl(d,s,l,r):!d.isHorizontal()&&u&&Dl(d,o,l,r)}),n.update(i),L(c,[{chart:n}])}function Dh(n){const t=nt(n);fn(n,t);const e={};for(const i of Object.keys(n.scales)){const{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};e[i]={min:s.scale,max:o.scale}}return e}function e_(n){const t=nt(n),e={};for(const i of Object.keys(n.scales))e[i]=t.updatedScaleLimits[i];return e}function n_(n){const t=Dh(n);for(const e of Object.keys(n.scales)){const{min:i,max:s}=t[e];if(i!==void 0&&n.scales[e].min!==i||s!==void 0&&n.scales[e].max!==s)return!0}return!1}function Ol(n){const t=nt(n);return t.panning||t.dragging}const Cl=(n,t,e)=>Math.min(e,Math.max(t,n));function Tt(n,t){const{handlers:e}=nt(n),i=e[t];i&&i.target&&(i.target.removeEventListener(t,i),delete e[t])}function Un(n,t,e,i){const{handlers:s,options:o}=nt(n),r=s[e];if(r&&r.target===t)return;Tt(n,e),s[e]=l=>i(n,l,o),s[e].target=t;const a=e==="wheel"?!1:void 0;t.addEventListener(e,s[e],{passive:a})}function i_(n,t){const e=nt(n);e.dragStart&&(e.dragging=!0,e.dragEnd=t,n.update("none"))}function s_(n,t){const e=nt(n);!e.dragStart||t.key!=="Escape"||(Tt(n,"keydown"),e.dragging=!1,e.dragStart=e.dragEnd=null,n.update("none"))}function To(n,t){if(n.target!==t.canvas){const e=t.canvas.getBoundingClientRect();return{x:n.clientX-e.left,y:n.clientY-e.top}}return qt(n,t)}function Oh(n,t,e){const{onZoomStart:i,onZoomRejected:s}=e;if(i){const o=To(t,n);if(L(i,[{chart:n,event:t,point:o}])===!1)return L(s,[{chart:n,event:t}]),!1}}function o_(n,t){if(n.legend){const o=qt(t,n);if(Qt(o,n.legend))return}const e=nt(n),{pan:i,zoom:s={}}=e.options;if(t.button!==0||_h(Jn(i),t)||or(Jn(s.drag),t))return L(s.onZoomRejected,[{chart:n,event:t}]);Oh(n,t,s)!==!1&&(e.dragStart=t,Un(n,n.canvas.ownerDocument,"mousemove",i_),Un(n,window.document,"keydown",s_))}function r_({begin:n,end:t},e){let i=t.x-n.x,s=t.y-n.y;const o=Math.abs(i/s);o>e?i=Math.sign(i)*Math.abs(s*e):o<e&&(s=Math.sign(s)*Math.abs(i/e)),t.x=n.x+i,t.y=n.y+s}function El(n,t,e,{min:i,max:s,prop:o}){n[i]=Cl(Math.min(e.begin[o],e.end[o]),t[i],t[s]),n[s]=Cl(Math.max(e.begin[o],e.end[o]),t[i],t[s])}function a_(n,t,e){const i={begin:To(t.dragStart,n),end:To(t.dragEnd,n)};if(e){const s=n.chartArea.width/n.chartArea.height;r_(i,s)}return i}function Ch(n,t,e,i){const s=Pe(t,"x",n),o=Pe(t,"y",n),{top:r,left:a,right:l,bottom:c,width:h,height:u}=n.chartArea,d={top:r,left:a,right:l,bottom:c},g=a_(n,e,i&&s&&o);s&&El(d,n.chartArea,g,{min:"left",max:"right",prop:"x"}),o&&El(d,n.chartArea,g,{min:"top",max:"bottom",prop:"y"});const p=d.right-d.left,b=d.bottom-d.top;return{...d,width:p,height:b,zoomX:s&&p?1+(h-p)/h:1,zoomY:o&&b?1+(u-b)/u:1}}function l_(n,t){const e=nt(n);if(!e.dragStart)return;Tt(n,"mousemove");const{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=e.options.zoom,a=Ch(n,i,{dragStart:e.dragStart,dragEnd:t},r),l=Pe(i,"x",n)?a.width:0,c=Pe(i,"y",n)?a.height:0,h=Math.sqrt(l*l+c*c);if(e.dragStart=e.dragEnd=null,h<=o){e.dragging=!1,n.update("none");return}Th(n,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),e.dragging=!1,e.filterNextClick=!0,L(s,[{chart:n}])}function c_(n,t,e){if(or(Jn(e.wheel),t)){L(e.onZoomRejected,[{chart:n,event:t}]);return}if(Oh(n,t,e)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function h_(n,t){const{handlers:{onZoomComplete:e},options:{zoom:i}}=nt(n);if(!c_(n,t,i))return;const s=t.target.getBoundingClientRect(),o=i.wheel.speed,r=t.deltaY>=0?2-1/(1-o):1+o,a={x:r,y:r,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}};rr(n,a,"zoom","wheel"),L(e,[{chart:n}])}function u_(n,t,e,i){e&&(nt(n).handlers[t]=Lx(()=>L(e,[{chart:n}]),i))}function d_(n,t){const e=n.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(Un(n,e,"wheel",h_),u_(n,"onZoomComplete",o,250)):Tt(n,"wheel"),s.enabled?(Un(n,e,"mousedown",o_),Un(n,e.ownerDocument,"mouseup",l_)):(Tt(n,"mousedown"),Tt(n,"mousemove"),Tt(n,"mouseup"),Tt(n,"keydown"))}function f_(n){Tt(n,"mousedown"),Tt(n,"mousemove"),Tt(n,"mouseup"),Tt(n,"wheel"),Tt(n,"click"),Tt(n,"keydown")}function g_(n,t){return function(e,i){const{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;const r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(or(Jn(s),r)||_h(Jn(o.drag),r))?(L(s.onPanRejected,[{chart:n,event:i}]),!1):!0}}function m_(n,t){const e=Math.abs(n.clientX-t.clientX),i=Math.abs(n.clientY-t.clientY),s=e/i;let o,r;return s>.3&&s<1.7?o=r=!0:e>i?o=!0:r=!0,{x:o,y:r}}function Eh(n,t,e){if(t.scale){const{center:i,pointers:s}=e,o=1/t.scale*e.scale,r=e.target.getBoundingClientRect(),a=m_(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Pe(l,"x",n)?o:1,y:a.y&&Pe(l,"y",n)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};rr(n,c,"zoom","pinch"),t.scale=e.scale}}function p_(n,t,e){if(t.options.zoom.pinch.enabled){const i=qt(e,n);L(t.options.zoom.onZoomStart,[{chart:n,event:e,point:i}])===!1?(t.scale=null,L(t.options.zoom.onZoomRejected,[{chart:n,event:e}])):t.scale=1}}function b_(n,t,e){t.scale&&(Eh(n,t,e),t.scale=null,L(t.options.zoom.onZoomComplete,[{chart:n}]))}function Ah(n,t,e){const i=t.delta;i&&(t.panning=!0,Sh(n,{x:e.deltaX-i.x,y:e.deltaY-i.y},t.panScales),t.delta={x:e.deltaX,y:e.deltaY})}function y_(n,t,e){const{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;const r=e.target.getBoundingClientRect(),a={x:e.center.x-r.left,y:e.center.y-r.top};if(L(s,[{chart:n,event:e,point:a}])===!1)return L(o,[{chart:n,event:e}]);t.panScales=wh(t.options.pan,a,n),t.delta={x:0,y:0},Ah(n,t,e)}function x_(n,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,L(t.options.pan.onPanComplete,[{chart:n}]))}const So=new WeakMap;function Al(n,t){const e=nt(n),i=n.canvas,{pan:s,zoom:o}=t,r=new Xn.Manager(i);o&&o.pinch.enabled&&(r.add(new Xn.Pinch),r.on("pinchstart",a=>p_(n,e,a)),r.on("pinch",a=>Eh(n,e,a)),r.on("pinchend",a=>b_(n,e,a))),s&&s.enabled&&(r.add(new Xn.Pan({threshold:s.threshold,enable:g_(n,e)})),r.on("panstart",a=>y_(n,e,a)),r.on("panmove",a=>Ah(n,e,a)),r.on("panend",()=>x_(n,e))),So.set(n,r)}function Il(n){const t=So.get(n);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),So.delete(n))}function __(n,t){var r,a,l,c;const{pan:e,zoom:i}=n,{pan:s,zoom:o}=t;return((a=(r=i==null?void 0:i.zoom)==null?void 0:r.pinch)==null?void 0:a.enabled)!==((c=(l=o==null?void 0:o.zoom)==null?void 0:l.pinch)==null?void 0:c.enabled)||(e==null?void 0:e.enabled)!==(s==null?void 0:s.enabled)||(e==null?void 0:e.threshold)!==(s==null?void 0:s.threshold)}var w_="2.2.0";function Fi(n,t,e){const i=e.zoom.drag,{dragStart:s,dragEnd:o}=nt(n);if(i.drawTime!==t||!o)return;const{left:r,top:a,width:l,height:c}=Ch(n,e.zoom.mode,{dragStart:s,dragEnd:o},i.maintainAspectRatio),h=n.ctx;h.save(),h.beginPath(),h.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",h.fillRect(r,a,l,c),i.borderWidth>0&&(h.lineWidth=i.borderWidth,h.strokeStyle=i.borderColor||"rgba(225,225,225)",h.strokeRect(r,a,l,c)),h.restore()}var v_={id:"zoom",version:w_,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,t,e){const i=nt(n);i.options=e,Object.prototype.hasOwnProperty.call(e.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(e.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(e.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),Xn&&Al(n,e),n.pan=(s,o,r)=>Sh(n,s,o,r),n.zoom=(s,o)=>rr(n,s,o),n.zoomRect=(s,o,r)=>Th(n,s,o,r),n.zoomScale=(s,o,r)=>Zx(n,s,o,r),n.resetZoom=s=>Kx(n,s),n.getZoomLevel=()=>t_(n),n.getInitialScaleBounds=()=>Dh(n),n.getZoomedScaleBounds=()=>e_(n),n.isZoomedOrPanned=()=>n_(n),n.isZoomingOrPanning=()=>Ol(n)},beforeEvent(n,{event:t}){if(Ol(n))return!1;if(t.type==="click"||t.type==="mouseup"){const e=nt(n);if(e.filterNextClick)return e.filterNextClick=!1,!1}},beforeUpdate:function(n,t,e){const i=nt(n),s=i.options;i.options=e,__(s,e)&&(Il(n),Al(n,e)),d_(n,e)},beforeDatasetsDraw(n,t,e){Fi(n,"beforeDatasetsDraw",e)},afterDatasetsDraw(n,t,e){Fi(n,"afterDatasetsDraw",e)},beforeDraw(n,t,e){Fi(n,"beforeDraw",e)},afterDraw(n,t,e){Fi(n,"afterDraw",e)},stop:function(n){f_(n),Xn&&Il(n),Fx(n)},panFunctions:Po,zoomFunctions:Mo,zoomRectFunctions:ko};Mt.register(i0,v_,Dx);Mt.defaults.maintainAspectRatio=!1;Mt.defaults.datasets.line.spanGaps=!0;var mt,nn;class Ih extends HTMLElement{constructor(){super(...arguments);wn(this,mt,null);wn(this,nn,!1)}connectedCallback(){this.style.display="block",this.style.width="100%",this.style.height="100%";const e=document.createElement("canvas");this.appendChild(e);const i=this.getAttributeNames().filter(s=>s.startsWith("plugins")||s.startsWith("interaction")||s.startsWith("scales")||s==="labels"||s==="responsive").reduce((s,o)=>{const r=o.split("."),a=r.pop(),l=this.getAttribute(o),c=r.reduce((h,u)=>(u in h||(h[u]={}),h[u]),s);return c[a]=Ll.trySafeEval(l),s},{});ue(this,mt,new Mt(e,{type:this.getAttribute("type"),data:{datasets:[],labels:this.labels},options:i}))}get labels(){const e=this.getAttribute("labels");return e?JSON.parse(e):[]}set data(e){gt(this,mt).data=e,this.update()}set options(e){gt(this,mt).options=e}addOrReplaceDataset(e,i){const s=gt(this,mt).data.datasets.findIndex(e);s===-1?gt(this,mt).data.datasets=[...gt(this,mt).data.datasets,i]:gt(this,mt).data.datasets.splice(s,1,i),this.update()}removeDataset(e){gt(this,mt).data.datasets=gt(this,mt).data.datasets.filter(i=>!e(i)),this.update()}addOrReplaceAnnotation(e,i){gt(this,mt).options.plugins||(gt(this,mt).options.plugins={}),gt(this,mt).options.plugins.annotation||(gt(this,mt).options.plugins.annotation={annotations:{}});const s=gt(this,mt).options.plugins.annotation.annotations,o=Object.values(s).findIndex(e);if(o===-1){const r=Object.keys(s).length;s[r]=i}else{const r=Object.keys(s)[o];s[r]=i}}removeAnnotation(e){}update(){gt(this,nn)||(ue(this,nn,!0),setTimeout(()=>{gt(this,mt).update("none"),ue(this,nn,!1)},100))}}mt=new WeakMap,nn=new WeakMap;customElements.define("chartjs-chart",Ih);var ze,ti;class Lh extends HTMLElement{constructor(){super(...arguments);wn(this,ze);wn(this,ti,null)}connectedCallback(){if(this.getAttribute("included")==="false")return;ue(this,ze,this.closest("chartjs-chart")),this.syncDataset(),new MutationObserver(()=>this.syncDataset()).observe(this,{attributes:!0}),this.getAttribute("data-from")&&new MutationObserver(o=>{this.syncDataset()}).observe(this.closest("chartjs-chart"),{childList:!0,attributes:!0,subtree:!0})}disconnectedCallback(){var e;(e=gt(this,ze))==null||e.removeDataset(i=>i.owner===this),ue(this,ze,null)}syncDataset(){var s;const e=this.getAttributeNames().filter(o=>!o.startsWith("data")&&!o.startsWith(":")).map(o=>[M_(Rh(o)),this.getAttribute(o)]).reduce((o,[r,a])=>(o[r]=Ll.trySafeEval(a),o),{}),i=this.data;(s=gt(this,ze))==null||s.addOrReplaceDataset(o=>o.owner===this,{...e,data:i,owner:this})}get data(){const e=this.getAttribute("data");if(e)return ue(this,ti,JSON.parse(e));const i=this.getAttribute("data-from");if(i){const s=this.closest("chartjs-chart").querySelector(`chartjs-dataset${i}`);if(s)return ue(this,ti,s.data)}}}ze=new WeakMap,ti=new WeakMap;customElements.define("chartjs-dataset",Lh);function M_(n){return n==="xAxisId"?"xAxisID":n==="yAxisId"?"yAxisID":n}function Rh(n){return n.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace("-","").replace("_",""))}exports.ChartDataset=Lh;exports.ChartElement=Ih;exports.snakeToCamel=Rh;
|
|
44
|
+
*/const ui=n=>n&&n.enabled&&n.modifierKey,Wh=(n,t)=>n&&t[n+"Key"],Pr=(n,t)=>n&&!t[n+"Key"];function Se(n,t,e){return n===void 0?!0:typeof n=="string"?n.indexOf(t)!==-1:typeof n=="function"?n({chart:e}).indexOf(t)!==-1:!1}function fo(n,t){return typeof n=="function"&&(n=n({chart:t})),typeof n=="string"?{x:n.indexOf("x")!==-1,y:n.indexOf("y")!==-1}:{x:!1,y:!1}}function e_(n,t){let e;return function(){return clearTimeout(e),e=setTimeout(n,t),t}}function n_({x:n,y:t},e){const i=e.scales,s=Object.keys(i);for(let o=0;o<s.length;o++){const r=i[s[o]];if(t>=r.top&&t<=r.bottom&&n>=r.left&&n<=r.right)return r}return null}function Hh(n,t,e){const{mode:i="xy",scaleMode:s,overScaleMode:o}=n||{},r=n_(t,e),a=fo(i,e),l=fo(s,e);if(o){const h=fo(o,e);for(const u of["x","y"])h[u]&&(l[u]=a[u],a[u]=!1)}if(r&&l[r.axis])return[r];const c=[];return Y(e.scales,function(h){a[h.axis]&&c.push(h)}),c}const Bo=new WeakMap;function st(n){let t=Bo.get(n);return t||(t={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},Bo.set(n,t)),t}function i_(n){Bo.delete(n)}function Bh(n,t,e,i){const s=Math.max(0,Math.min(1,(n-t)/e||0)),o=1-s;return{min:i*s,max:i*o}}function Yh(n,t){const e=n.isHorizontal()?t.x:t.y;return n.getValueForPixel(e)}function Vh(n,t,e){const i=n.max-n.min,s=i*(t-1),o=Yh(n,e);return Bh(o,n.min,i,s)}function s_(n,t,e){const i=Yh(n,e);if(i===void 0)return{min:n.min,max:n.max};const s=Math.log10(n.min),o=Math.log10(n.max),r=Math.log10(i),a=o-s,l=a*(t-1),c=Bh(r,s,a,l);return{min:Math.pow(10,s+c.min),max:Math.pow(10,o-c.max)}}function o_(n,t){return t&&(t[n.id]||t[n.axis])||{}}function Bl(n,t,e,i,s){let o=e[i];if(o==="original"){const r=n.originalScaleLimits[t.id][i];o=F(r.options,r.scale)}return F(o,s)}function r_(n,t,e){const i=n.getValueForPixel(t),s=n.getValueForPixel(e);return{min:Math.min(i,s),max:Math.max(i,s)}}function a_(n,{min:t,max:e,minLimit:i,maxLimit:s},o){const r=(n-e+t)/2;t-=r,e+=r;const a=o.min.options??o.min.scale,l=o.max.options??o.max.scale,c=n/1e6;return Xe(t,a,c)&&(t=a),Xe(e,l,c)&&(e=l),t<i?(t=i,e=Math.min(i+n,s)):e>s&&(e=s,t=Math.max(s-n,i)),{min:t,max:e}}function en(n,{min:t,max:e},i,s=!1){const o=st(n.chart),{options:r}=n,a=o_(n,i),{minRange:l=0}=a,c=Bl(o,n,a,"min",-1/0),h=Bl(o,n,a,"max",1/0);if(s==="pan"&&(t<c||e>h))return!0;const u=n.max-n.min,d=s?Math.max(e-t,l):u;if(s&&d===l&&u<=l)return!0;const f=a_(d,{min:t,max:e,minLimit:c,maxLimit:h},o.originalScaleLimits[n.id]);return r.min=f.min,r.max=f.max,o.updatedScaleLimits[n.id]=f,n.parse(f.min)!==n.min||n.parse(f.max)!==n.max}function l_(n,t,e,i){const s=Vh(n,t,e),o={min:n.min+s.min,max:n.max-s.max};return en(n,o,i,!0)}function c_(n,t,e,i){const s=s_(n,t,e);return en(n,s,i,!0)}function h_(n,t,e,i){en(n,r_(n,t,e),i,!0)}const Yl=n=>n===0||isNaN(n)?0:n<0?Math.min(Math.round(n),-1):Math.max(Math.round(n),1);function u_(n){const e=n.getLabels().length-1;n.min>0&&(n.min-=1),n.max<e&&(n.max+=1)}function d_(n,t,e,i){const s=Vh(n,t,e);n.min===n.max&&t<1&&u_(n);const o={min:n.min+Yl(s.min),max:n.max-Yl(s.max)};return en(n,o,i,!0)}function f_(n){return n.isHorizontal()?n.width:n.height}function g_(n,t,e){const s=n.getLabels().length-1;let{min:o,max:r}=n;const a=Math.max(r-o,1),l=Math.round(f_(n)/Math.max(a,10)),c=Math.round(Math.abs(t/l));let h;return t<-l?(r=Math.min(r+c,s),o=a===1?r:r-a,h=r===s):t>l&&(o=Math.max(0,o-c),r=a===1?o:o+a,h=o===0),en(n,{min:o,max:r},e)||h}const m_={second:500,minute:30*1e3,hour:30*60*1e3,day:12*60*60*1e3,week:3.5*24*60*60*1e3,month:15*24*60*60*1e3,quarter:60*24*60*60*1e3,year:182*24*60*60*1e3};function jh(n,t,e,i=!1){const{min:s,max:o,options:r}=n,a=r.time&&r.time.round,l=m_[a]||0,c=n.getValueForPixel(n.getPixelForValue(s+l)-t),h=n.getValueForPixel(n.getPixelForValue(o+l)-t);return isNaN(c)||isNaN(h)?!0:en(n,{min:c,max:h},e,i?"pan":!1)}function Vl(n,t,e){return jh(n,t,e,!0)}const Yo={category:d_,default:l_,logarithmic:c_},Vo={default:h_},jo={category:g_,default:jh,logarithmic:Vl,timeseries:Vl};function p_(n,t,e){const{id:i,options:{min:s,max:o}}=n;if(!t[i]||!e[i])return!0;const r=e[i];return r.min!==s||r.max!==o}function jl(n,t){Y(n,(e,i)=>{t[i]||delete n[i]})}function kn(n,t){const{scales:e}=n,{originalScaleLimits:i,updatedScaleLimits:s}=t;return Y(e,function(o){p_(o,i,s)&&(i[o.id]={min:{scale:o.min,options:o.options.min},max:{scale:o.max,options:o.options.max}})}),jl(i,e),jl(s,e),i}function Xl(n,t,e,i){const s=Yo[n.type]||Yo.default;R(s,[n,t,e,i])}function Ul(n,t,e,i){const s=Vo[n.type]||Vo.default;R(s,[n,t,e,i])}function b_(n){const t=n.chartArea;return{x:(t.left+t.right)/2,y:(t.top+t.bottom)/2}}function Tr(n,t,e="none",i="api"){const{x:s=1,y:o=1,focalPoint:r=b_(n)}=typeof t=="number"?{x:t,y:t}:t,a=st(n),{options:{limits:l,zoom:c}}=a;kn(n,a);const h=s!==1,u=o!==1,d=Hh(c,r,n);Y(d||n.scales,function(f){f.isHorizontal()&&h?Xl(f,s,r,l):!f.isHorizontal()&&u&&Xl(f,o,r,l)}),n.update(e),R(c.onZoom,[{chart:n,trigger:i}])}function Xh(n,t,e,i="none",s="api"){const o=st(n),{options:{limits:r,zoom:a}}=o,{mode:l="xy"}=a;kn(n,o);const c=Se(l,"x",n),h=Se(l,"y",n);Y(n.scales,function(u){u.isHorizontal()&&c?Ul(u,t.x,e.x,r):!u.isHorizontal()&&h&&Ul(u,t.y,e.y,r)}),n.update(i),R(a.onZoom,[{chart:n,trigger:s}])}function y_(n,t,e,i="none",s="api"){var a;const o=st(n);kn(n,o);const r=n.scales[t];en(r,e,void 0,!0),n.update(i),R((a=o.options.zoom)==null?void 0:a.onZoom,[{chart:n,trigger:s}])}function x_(n,t="default"){const e=st(n),i=kn(n,e);Y(n.scales,function(s){const o=s.options;i[s.id]?(o.min=i[s.id].min.options,o.max=i[s.id].max.options):(delete o.min,delete o.max),delete e.updatedScaleLimits[s.id]}),n.update(t),R(e.options.zoom.onZoomComplete,[{chart:n}])}function __(n,t){const e=n.originalScaleLimits[t];if(!e)return;const{min:i,max:s}=e;return F(s.options,s.scale)-F(i.options,i.scale)}function w_(n){const t=st(n);let e=1,i=1;return Y(n.scales,function(s){const o=__(t,s.id);if(o){const r=Math.round(o/(s.max-s.min)*100)/100;e=Math.min(e,r),i=Math.max(i,r)}}),e<1?e:i}function ql(n,t,e,i){const{panDelta:s}=i,o=s[n.id]||0;Bt(o)===Bt(t)&&(t+=o);const r=jo[n.type]||jo.default;R(r,[n,t,e])?s[n.id]=0:s[n.id]=t}function Uh(n,t,e,i="none"){const{x:s=0,y:o=0}=typeof t=="number"?{x:t,y:t}:t,r=st(n),{options:{pan:a,limits:l}}=r,{onPan:c}=a||{};kn(n,r);const h=s!==0,u=o!==0;Y(e||n.scales,function(d){d.isHorizontal()&&h?ql(d,s,l,r):!d.isHorizontal()&&u&&ql(d,o,l,r)}),n.update(i),R(c,[{chart:n}])}function qh(n){const t=st(n);kn(n,t);const e={};for(const i of Object.keys(n.scales)){const{min:s,max:o}=t.originalScaleLimits[i]||{min:{},max:{}};e[i]={min:s.scale,max:o.scale}}return e}function v_(n){const t=st(n),e={};for(const i of Object.keys(n.scales))e[i]=t.updatedScaleLimits[i];return e}function M_(n){const t=qh(n);for(const e of Object.keys(n.scales)){const{min:i,max:s}=t[e];if(i!==void 0&&n.scales[e].min!==i||s!==void 0&&n.scales[e].max!==s)return!0}return!1}function $l(n){const t=st(n);return t.panning||t.dragging}const Gl=(n,t,e)=>Math.min(e,Math.max(t,n));function Ot(n,t){const{handlers:e}=st(n),i=e[t];i&&i.target&&(i.target.removeEventListener(t,i),delete e[t])}function ii(n,t,e,i){const{handlers:s,options:o}=st(n),r=s[e];if(r&&r.target===t)return;Ot(n,e),s[e]=l=>i(n,l,o),s[e].target=t;const a=e==="wheel"?!1:void 0;t.addEventListener(e,s[e],{passive:a})}function k_(n,t){const e=st(n);e.dragStart&&(e.dragging=!0,e.dragEnd=t,n.update("none"))}function P_(n,t){const e=st(n);!e.dragStart||t.key!=="Escape"||(Ot(n,"keydown"),e.dragging=!1,e.dragStart=e.dragEnd=null,n.update("none"))}function Xo(n,t){if(n.target!==t.canvas){const e=t.canvas.getBoundingClientRect();return{x:n.clientX-e.left,y:n.clientY-e.top}}return Qt(n,t)}function $h(n,t,e){const{onZoomStart:i,onZoomRejected:s}=e;if(i){const o=Xo(t,n);if(R(i,[{chart:n,event:t,point:o}])===!1)return R(s,[{chart:n,event:t}]),!1}}function T_(n,t){if(n.legend){const o=Qt(t,n);if(Jt(o,n.legend))return}const e=st(n),{pan:i,zoom:s={}}=e.options;if(t.button!==0||Wh(ui(i),t)||Pr(ui(s.drag),t))return R(s.onZoomRejected,[{chart:n,event:t}]);$h(n,t,s)!==!1&&(e.dragStart=t,ii(n,n.canvas.ownerDocument,"mousemove",k_),ii(n,window.document,"keydown",P_))}function S_({begin:n,end:t},e){let i=t.x-n.x,s=t.y-n.y;const o=Math.abs(i/s);o>e?i=Math.sign(i)*Math.abs(s*e):o<e&&(s=Math.sign(s)*Math.abs(i/e)),t.x=n.x+i,t.y=n.y+s}function Ql(n,t,e,{min:i,max:s,prop:o}){n[i]=Gl(Math.min(e.begin[o],e.end[o]),t[i],t[s]),n[s]=Gl(Math.max(e.begin[o],e.end[o]),t[i],t[s])}function D_(n,t,e){const i={begin:Xo(t.dragStart,n),end:Xo(t.dragEnd,n)};if(e){const s=n.chartArea.width/n.chartArea.height;S_(i,s)}return i}function Gh(n,t,e,i){const s=Se(t,"x",n),o=Se(t,"y",n),{top:r,left:a,right:l,bottom:c,width:h,height:u}=n.chartArea,d={top:r,left:a,right:l,bottom:c},f=D_(n,e,i&&s&&o);s&&Ql(d,n.chartArea,f,{min:"left",max:"right",prop:"x"}),o&&Ql(d,n.chartArea,f,{min:"top",max:"bottom",prop:"y"});const p=d.right-d.left,b=d.bottom-d.top;return{...d,width:p,height:b,zoomX:s&&p?1+(h-p)/h:1,zoomY:o&&b?1+(u-b)/u:1}}function O_(n,t){const e=st(n);if(!e.dragStart)return;Ot(n,"mousemove");const{mode:i,onZoomComplete:s,drag:{threshold:o=0,maintainAspectRatio:r}}=e.options.zoom,a=Gh(n,i,{dragStart:e.dragStart,dragEnd:t},r),l=Se(i,"x",n)?a.width:0,c=Se(i,"y",n)?a.height:0,h=Math.sqrt(l*l+c*c);if(e.dragStart=e.dragEnd=null,h<=o){e.dragging=!1,n.update("none");return}Xh(n,{x:a.left,y:a.top},{x:a.right,y:a.bottom},"zoom","drag"),e.dragging=!1,e.filterNextClick=!0,R(s,[{chart:n}])}function C_(n,t,e){if(Pr(ui(e.wheel),t)){R(e.onZoomRejected,[{chart:n,event:t}]);return}if($h(n,t,e)!==!1&&(t.cancelable&&t.preventDefault(),t.deltaY!==void 0))return!0}function E_(n,t){const{handlers:{onZoomComplete:e},options:{zoom:i}}=st(n);if(!C_(n,t,i))return;const s=t.target.getBoundingClientRect(),o=i.wheel.speed,r=t.deltaY>=0?2-1/(1-o):1+o,a={x:r,y:r,focalPoint:{x:t.clientX-s.left,y:t.clientY-s.top}};Tr(n,a,"zoom","wheel"),R(e,[{chart:n}])}function A_(n,t,e,i){e&&(st(n).handlers[t]=e_(()=>R(e,[{chart:n}]),i))}function I_(n,t){const e=n.canvas,{wheel:i,drag:s,onZoomComplete:o}=t.zoom;i.enabled?(ii(n,e,"wheel",E_),A_(n,"onZoomComplete",o,250)):Ot(n,"wheel"),s.enabled?(ii(n,e,"mousedown",T_),ii(n,e.ownerDocument,"mouseup",O_)):(Ot(n,"mousedown"),Ot(n,"mousemove"),Ot(n,"mouseup"),Ot(n,"keydown"))}function L_(n){Ot(n,"mousedown"),Ot(n,"mousemove"),Ot(n,"mouseup"),Ot(n,"wheel"),Ot(n,"click"),Ot(n,"keydown")}function R_(n,t){return function(e,i){const{pan:s,zoom:o={}}=t.options;if(!s||!s.enabled)return!1;const r=i&&i.srcEvent;return r&&!t.panning&&i.pointerType==="mouse"&&(Pr(ui(s),r)||Wh(ui(o.drag),r))?(R(s.onPanRejected,[{chart:n,event:i}]),!1):!0}}function F_(n,t){const e=Math.abs(n.clientX-t.clientX),i=Math.abs(n.clientY-t.clientY),s=e/i;let o,r;return s>.3&&s<1.7?o=r=!0:e>i?o=!0:r=!0,{x:o,y:r}}function Qh(n,t,e){if(t.scale){const{center:i,pointers:s}=e,o=1/t.scale*e.scale,r=e.target.getBoundingClientRect(),a=F_(s[0],s[1]),l=t.options.zoom.mode,c={x:a.x&&Se(l,"x",n)?o:1,y:a.y&&Se(l,"y",n)?o:1,focalPoint:{x:i.x-r.left,y:i.y-r.top}};Tr(n,c,"zoom","pinch"),t.scale=e.scale}}function N_(n,t,e){if(t.options.zoom.pinch.enabled){const i=Qt(e,n);R(t.options.zoom.onZoomStart,[{chart:n,event:e,point:i}])===!1?(t.scale=null,R(t.options.zoom.onZoomRejected,[{chart:n,event:e}])):t.scale=1}}function z_(n,t,e){t.scale&&(Qh(n,t,e),t.scale=null,R(t.options.zoom.onZoomComplete,[{chart:n}]))}function Kh(n,t,e){const i=t.delta;i&&(t.panning=!0,Uh(n,{x:e.deltaX-i.x,y:e.deltaY-i.y},t.panScales),t.delta={x:e.deltaX,y:e.deltaY})}function W_(n,t,e){const{enabled:i,onPanStart:s,onPanRejected:o}=t.options.pan;if(!i)return;const r=e.target.getBoundingClientRect(),a={x:e.center.x-r.left,y:e.center.y-r.top};if(R(s,[{chart:n,event:e,point:a}])===!1)return R(o,[{chart:n,event:e}]);t.panScales=Hh(t.options.pan,a,n),t.delta={x:0,y:0},Kh(n,t,e)}function H_(n,t){t.delta=null,t.panning&&(t.panning=!1,t.filterNextClick=!0,R(t.options.pan.onPanComplete,[{chart:n}]))}const Uo=new WeakMap;function Kl(n,t){const e=st(n),i=n.canvas,{pan:s,zoom:o}=t,r=new ni.Manager(i);o&&o.pinch.enabled&&(r.add(new ni.Pinch),r.on("pinchstart",a=>N_(n,e,a)),r.on("pinch",a=>Qh(n,e,a)),r.on("pinchend",a=>z_(n,e,a))),s&&s.enabled&&(r.add(new ni.Pan({threshold:s.threshold,enable:R_(n,e)})),r.on("panstart",a=>W_(n,e,a)),r.on("panmove",a=>Kh(n,e,a)),r.on("panend",()=>H_(n,e))),Uo.set(n,r)}function Zl(n){const t=Uo.get(n);t&&(t.remove("pinchstart"),t.remove("pinch"),t.remove("pinchend"),t.remove("panstart"),t.remove("pan"),t.remove("panend"),t.destroy(),Uo.delete(n))}function B_(n,t){var r,a,l,c;const{pan:e,zoom:i}=n,{pan:s,zoom:o}=t;return((a=(r=i==null?void 0:i.zoom)==null?void 0:r.pinch)==null?void 0:a.enabled)!==((c=(l=o==null?void 0:o.zoom)==null?void 0:l.pinch)==null?void 0:c.enabled)||(e==null?void 0:e.enabled)!==(s==null?void 0:s.enabled)||(e==null?void 0:e.threshold)!==(s==null?void 0:s.threshold)}var Y_="2.2.0";function ts(n,t,e){const i=e.zoom.drag,{dragStart:s,dragEnd:o}=st(n);if(i.drawTime!==t||!o)return;const{left:r,top:a,width:l,height:c}=Gh(n,e.zoom.mode,{dragStart:s,dragEnd:o},i.maintainAspectRatio),h=n.ctx;h.save(),h.beginPath(),h.fillStyle=i.backgroundColor||"rgba(225,225,225,0.3)",h.fillRect(r,a,l,c),i.borderWidth>0&&(h.lineWidth=i.borderWidth,h.strokeStyle=i.borderColor||"rgba(225,225,225)",h.strokeRect(r,a,l,c)),h.restore()}var V_={id:"zoom",version:Y_,defaults:{pan:{enabled:!1,mode:"xy",threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:"beforeDatasetsDraw",modifierKey:null},pinch:{enabled:!1},mode:"xy"}},start:function(n,t,e){const i=st(n);i.options=e,Object.prototype.hasOwnProperty.call(e.zoom,"enabled")&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(e.zoom,"overScaleMode")||Object.prototype.hasOwnProperty.call(e.pan,"overScaleMode"))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),ni&&Kl(n,e),n.pan=(s,o,r)=>Uh(n,s,o,r),n.zoom=(s,o)=>Tr(n,s,o),n.zoomRect=(s,o,r)=>Xh(n,s,o,r),n.zoomScale=(s,o,r)=>y_(n,s,o,r),n.resetZoom=s=>x_(n,s),n.getZoomLevel=()=>w_(n),n.getInitialScaleBounds=()=>qh(n),n.getZoomedScaleBounds=()=>v_(n),n.isZoomedOrPanned=()=>M_(n),n.isZoomingOrPanning=()=>$l(n)},beforeEvent(n,{event:t}){if($l(n))return!1;if(t.type==="click"||t.type==="mouseup"){const e=st(n);if(e.filterNextClick)return e.filterNextClick=!1,!1}},beforeUpdate:function(n,t,e){const i=st(n),s=i.options;i.options=e,B_(s,e)&&(Zl(n),Kl(n,e)),I_(n,e)},beforeDatasetsDraw(n,t,e){ts(n,"beforeDatasetsDraw",e)},afterDatasetsDraw(n,t,e){ts(n,"afterDatasetsDraw",e)},beforeDraw(n,t,e){ts(n,"beforeDraw",e)},afterDraw(n,t,e){ts(n,"afterDraw",e)},stop:function(n){L_(n),ni&&Zl(n),i_(n)},panFunctions:jo,zoomFunctions:Yo,zoomRectFunctions:Vo};Pt.register(k0,V_,Gx);Pt.defaults.maintainAspectRatio=!1;Pt.defaults.datasets.line.spanGaps=!0;var tt,Dt,fi,cn,hn,un,dn,gi,_n,Jh,tu;class Zh extends HTMLElement{constructor(){super(...arguments);dt(this,_n);dt(this,tt,null);dt(this,Dt,null);dt(this,fi,null);dt(this,cn,()=>this.update(!0));dt(this,hn,!1);dt(this,un,!1);dt(this,dn,!1);dt(this,gi)}connectedCallback(){this.style.display="block",this.style.width="100%",this.style.height="100%";const e=document.createElement("canvas");this.appendChild(e);const i=this.getAttributeNames().filter(s=>s.startsWith("plugins")||s.startsWith("interaction")||s.startsWith("scales")||s==="responsive").reduce((s,o)=>{const r=o.split("."),a=r.pop(),l=this.getAttribute(o),c=r.reduce((h,u)=>(u in h||(h[u]={}),h[u]),s);return c[a]=Jl.trySafeEval(l),s},{});bt(this,tt,new Pt(e,{type:this.getAttribute("type"),data:{datasets:[],labels:this.labels},options:i}))}disconnectedCallback(){var e;(e=I(this,Dt))==null||e.removeEventListener("change",I(this,cn)),bt(this,Dt,null)}get labels(){const e=this.getAttribute("labels");return e?JSON.parse(e):[]}set data(e){I(this,tt).data=e,this.update()}set options(e){I(this,tt).options=e}addOrReplaceDataset(e,i){const s=I(this,tt).data.datasets.findIndex(e);s===-1?I(this,tt).data.datasets=[...I(this,tt).data.datasets,i]:I(this,tt).data.datasets.splice(s,1,i),this.update()}removeDataset(e){I(this,tt).data.datasets=I(this,tt).data.datasets.filter(i=>!e(i)),this.update()}addOrReplaceAnnotation(e,i){I(this,tt).options.plugins||(I(this,tt).options.plugins={}),I(this,tt).options.plugins.annotation||(I(this,tt).options.plugins.annotation={annotations:{}});const s=I(this,tt).options.plugins.annotation.annotations,o=Object.values(s).findIndex(e);if(o===-1){const r=Object.keys(s).length;s[r]=i}else{const r=Object.keys(s)[o];s[r]=i}}removeAnnotation(e){}update(e=!1){I(this,un)||bt(this,un,e),!I(this,hn)&&(bt(this,hn,!0),setTimeout(()=>{const i=I(this,un);try{An(this,_n,Jh).call(this,i)||I(this,tt).update(i?void 0:"none")}finally{bt(this,hn,!1),bt(this,un,!1)}},100))}}tt=new WeakMap,Dt=new WeakMap,fi=new WeakMap,cn=new WeakMap,hn=new WeakMap,un=new WeakMap,dn=new WeakMap,gi=new WeakMap,_n=new WeakSet,Jh=function(e){var o,r;if(An(this,_n,tu).call(this),!I(this,Dt)){if(I(this,dn)){bt(this,dn,!1);const a=(o=I(this,tt).options.plugins)==null?void 0:o.legend;a&&(a.display=I(this,gi))}return!1}I(this,tt).data.datasets.forEach((a,l)=>{const c=a.legendKey,h=typeof c=="string"?c:a.label;if(typeof h!="string")return;const u=a.legendGroup,d=typeof u=="string"?u:"";if(!I(this,Dt).item(d,h)){I(this,tt).setDatasetVisibility(l,!0);return}a.backgroundColor??(a.backgroundColor=I(this,Dt).color(d,h)),a.borderColor??(a.borderColor=I(this,Dt).color(d,h)),I(this,tt).setDatasetVisibility(l,!I(this,Dt).isHidden(d,h))});const i=(r=I(this,tt).options).plugins??(r.plugins={}),s=i.legend??(i.legend={});return s.display!==!1&&bt(this,gi,s.display),bt(this,dn,!0),s.display=!1,I(this,tt).update(e?void 0:"none"),!0},tu=function(){var s,o;const e=this.getAttribute("legend");if((s=I(this,Dt))!=null&&s.isConnected&&e===I(this,fi)||((o=I(this,Dt))==null||o.removeEventListener("change",I(this,cn)),bt(this,Dt,null),bt(this,fi,e),!e))return;const i=document.querySelector(e);i instanceof di&&(bt(this,Dt,i),i.addEventListener("change",I(this,cn)))};customElements.define("chartjs-chart",Zh);var He,Be,Ye,Ve,fn,mi,pi,bi,qo;const si=class si extends HTMLElement{constructor(){super(...arguments);dt(this,bi);dt(this,He,document.createElement("div"));dt(this,Be,new Map);dt(this,Ye,new Set);dt(this,Ve,new Map);dt(this,fn,new Map);dt(this,mi,new MutationObserver(()=>this.refresh()))}connectedCallback(){const e=this.shadowRoot??this.attachShadow({mode:"open"});if(!e.contains(I(this,He))){const i=document.createElement("style");i.textContent=`
|
|
45
|
+
:host { display: block; }
|
|
46
|
+
[part="legend"] { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
|
|
47
|
+
[part="heading"] { margin-bottom: .25rem; font-size: .8125rem; font-weight: 600; }
|
|
48
|
+
[part="items"] { display: grid; gap: .1875rem; }
|
|
49
|
+
[part~="item"] { display: flex; align-items: center; gap: .375rem; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-size: .875rem; text-align: left; }
|
|
50
|
+
[part~="hidden"] { opacity: .45; text-decoration: line-through; }
|
|
51
|
+
[part="swatch"] { display: inline-block; flex: 0 0 1rem; height: .625rem; background-color: var(--chartjs-legend-color); }
|
|
52
|
+
`,I(this,He).setAttribute("part","legend"),e.replaceChildren(i,I(this,He))}I(this,mi).observe(this,{attributes:!0,attributeFilter:["key","label"],childList:!0,subtree:!0,characterData:!0}),this.refresh()}disconnectedCallback(){I(this,mi).disconnect()}refresh(){bt(this,Be,new Map(this.items.map(e=>[this.itemKey(e.group,e.key),e])));for(const e of I(this,Be).keys())I(this,Ve).has(e)||I(this,Ve).set(e,I(si,pi)[I(this,Ve).size%I(si,pi).length]);this.render(),this.dispatchEvent(new Event("change"))}get items(){return Array.from(this.querySelectorAll("chartjs-legend-group")).flatMap(e=>Array.from(e.querySelectorAll("chartjs-legend-label")).map(i=>{var s;return{key:i.getAttribute("key")??"",label:i.getAttribute("label")??((s=i.textContent)==null?void 0:s.trim())??"",group:e.getAttribute("key")??"",groupLabel:e.getAttribute("label")??""}}).filter(i=>i.key!==""&&i.label!==""))}item(e,i){return I(this,Be).get(this.itemKey(e,i))}color(e,i){return I(this,Ve).get(this.itemKey(e,i))}isHidden(e,i){return I(this,Ye).has(this.itemKey(e,i))}render(){I(this,fn).clear();const e=[...I(this,Be).values()].reduce((i,s)=>{const o=i.get(s.group)??[];return o.push(s),i.set(s.group,o),i},new Map);I(this,He).replaceChildren(...[...e].map(([i,s])=>{const o=document.createElement("section");if(o.setAttribute("part","group"),i!==""){const a=document.createElement("div");a.textContent=s[0].groupLabel,a.setAttribute("part","heading"),o.appendChild(a)}const r=document.createElement("div");return r.setAttribute("part","items"),r.append(...s.map(a=>{const l=document.createElement("button");l.type="button",An(this,bi,qo).call(this,l,a.group,a.key),l.addEventListener("click",()=>this.toggle(a.group,a.key)),I(this,fn).set(this.itemKey(a.group,a.key),l);const c=document.createElement("span");c.setAttribute("part","swatch"),c.style.setProperty("--chartjs-legend-color",this.color(a.group,a.key)??"transparent"),c.setAttribute("aria-hidden","true");const h=document.createElement("span");return h.setAttribute("part","label"),h.textContent=a.label,l.append(c,h),l})),o.appendChild(r),o}))}toggle(e,i){const s=this.itemKey(e,i);I(this,Ye).has(s)?I(this,Ye).delete(s):I(this,Ye).add(s);const o=I(this,fn).get(s);o&&An(this,bi,qo).call(this,o,e,i),this.dispatchEvent(new Event("change"))}itemKey(e,i){return`${e}|${i}`}};He=new WeakMap,Be=new WeakMap,Ye=new WeakMap,Ve=new WeakMap,fn=new WeakMap,mi=new WeakMap,pi=new WeakMap,bi=new WeakSet,qo=function(e,i,s){const o=this.isHidden(i,s);e.setAttribute("part",o?"item hidden":"item"),e.setAttribute("aria-pressed",String(!o))},dt(si,pi,["#5673b3","#b95f5f","#21c1b7","#669999","#a6cf6f","#88a264","#a276d1","#8064a2","#dbc174","#a69a6e","#6fcf89","#649e75"]);let di=si;customElements.define("chartjs-legend",di);customElements.define("chartjs-legend-group",class extends HTMLElement{});customElements.define("chartjs-legend-label",class extends HTMLElement{});var je,yi;class eu extends HTMLElement{constructor(){super(...arguments);dt(this,je);dt(this,yi,null)}connectedCallback(){if(this.getAttribute("included")==="false")return;bt(this,je,this.closest("chartjs-chart")),this.syncDataset(),new MutationObserver(()=>this.syncDataset()).observe(this,{attributes:!0}),this.getAttribute("data-from")&&new MutationObserver(o=>{this.syncDataset()}).observe(this.closest("chartjs-chart"),{childList:!0,attributes:!0,subtree:!0})}disconnectedCallback(){var e;(e=I(this,je))==null||e.removeDataset(i=>i.owner===this),bt(this,je,null)}syncDataset(){var s;const e=this.getAttributeNames().filter(o=>!o.startsWith("data")&&!o.startsWith(":")).map(o=>[j_(nu(o)),this.getAttribute(o)]).reduce((o,[r,a])=>(o[r]=r==="legendKey"||r==="legendGroup"?a:Jl.trySafeEval(a),o),{}),i=this.data;(s=I(this,je))==null||s.addOrReplaceDataset(o=>o.owner===this,{...e,data:i,owner:this})}get data(){const e=this.getAttribute("data");if(e)return bt(this,yi,JSON.parse(e));const i=this.getAttribute("data-from");if(i){const s=this.closest("chartjs-chart").querySelector(`chartjs-dataset${i}`);if(s)return bt(this,yi,s.data)}}}je=new WeakMap,yi=new WeakMap;customElements.define("chartjs-dataset",eu);function j_(n){return n==="xAxisId"?"xAxisID":n==="yAxisId"?"yAxisID":n}function nu(n){return n.replace(/([-_][a-z])/g,t=>t.toUpperCase().replace("-","").replace("_",""))}exports.ChartDataset=eu;exports.ChartElement=Zh;exports.ChartLegend=di;exports.snakeToCamel=nu;
|