diff options
Diffstat (limited to 'archive/assets/chart.js')
| -rw-r--r-- | archive/assets/chart.js | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/archive/assets/chart.js b/archive/assets/chart.js index b756ba4..7510e2e 100644 --- a/archive/assets/chart.js +++ b/archive/assets/chart.js @@ -1,29 +1,22 @@ -(()=>{function Pe(n){return n+.5|0}var Ot=(n,t,e)=>Math.max(Math.min(n,e),t);function De(n){return Ot(Pe(n*2.55),0,255)}function St(n){return Ot(Pe(n*255),0,255)}function bt(n){return Ot(Pe(n/2.55)/100,0,1)}function Ls(n){return Ot(Pe(n*100),0,100)}var st={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},Ni=[..."0123456789ABCDEF"],Ua=n=>Ni[n&15],Qa=n=>Ni[(n&240)>>4]+Ni[n&15],Ze=n=>(n&240)>>4===(n&15),Ga=n=>Ze(n.r)&&Ze(n.g)&&Ze(n.b)&&Ze(n.a);function Ka(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&st[n[1]]*17,g:255&st[n[2]]*17,b:255&st[n[3]]*17,a:t===5?st[n[4]]*17:255}:(t===7||t===9)&&(e={r:st[n[1]]<<4|st[n[2]],g:st[n[3]]<<4|st[n[4]],b:st[n[5]]<<4|st[n[6]],a:t===9?st[n[7]]<<4|st[n[8]]:255})),e}var Za=(n,t)=>n<255?t(n):"";function Ja(n){var t=Ga(n)?Ua:Qa;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Za(n.a,t):void 0}var tc=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fs(n,t,e){let 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 ec(n,t,e){let 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 nc(n,t,e){let i=Fs(n,1,.5),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 ic(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 Wi(n){let 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,c,l,h;return o!==r&&(h=o-r,l=a>.5?h/(2-o-r):h/(o+r),c=ic(e,i,s,h,o),c=c*60+.5),[c|0,l||0,a]}function zi(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(St)}function Bi(n,t,e){return zi(Fs,n,t,e)}function sc(n,t,e){return zi(nc,n,t,e)}function oc(n,t,e){return zi(ec,n,t,e)}function Ns(n){return(n%360+360)%360}function rc(n){let t=tc.exec(n),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?De(+t[5]):St(+t[5]));let s=Ns(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=sc(s,o,r):t[1]==="hsv"?i=oc(s,o,r):i=Bi(s,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function ac(n,t){var e=Wi(n);e[0]=Ns(e[0]+t),e=Bi(e),n.r=e[0],n.g=e[1],n.b=e[2]}function cc(n){if(!n)return;let t=Wi(n),e=t[0],i=Ls(t[1]),s=Ls(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${bt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}var Is={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"},Es={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 lc(){let n={},t=Object.keys(Es),e=Object.keys(Is),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,Is[o]);o=parseInt(Es[r],16),n[a]=[o>>16&255,o>>8&255,o&255]}return n}var Je;function hc(n){Je||(Je=lc(),Je.transparent=[0,0,0,0]);let t=Je[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var uc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function dc(n){let t=uc.exec(n),e=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];e=t[8]?De(r):Ot(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?De(i):Ot(i,0,255)),s=255&(t[4]?De(s):Ot(s,0,255)),o=255&(t[6]?De(o):Ot(o,0,255)),{r:i,g:s,b:o,a:e}}}function fc(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${bt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}var Fi=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Zt=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function pc(n,t,e){let i=Zt(bt(n.r)),s=Zt(bt(n.g)),o=Zt(bt(n.b));return{r:St(Fi(i+e*(Zt(bt(t.r))-i))),g:St(Fi(s+e*(Zt(bt(t.g))-s))),b:St(Fi(o+e*(Zt(bt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function tn(n,t,e){if(n){let i=Wi(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Bi(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ws(n,t){return n&&Object.assign(t||{},n)}function Rs(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=St(n[3]))):(t=Ws(n,{r:0,g:0,b:0,a:1}),t.a=St(t.a)),t}function gc(n){return n.charAt(0)==="r"?dc(n):rc(n)}var ve=class n{constructor(t){if(t instanceof n)return t;let e=typeof t,i;e==="object"?i=Rs(t):e==="string"&&(i=Ka(t)||hc(t)||gc(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ws(this._rgb);return t&&(t.a=bt(t.a)),t}set rgb(t){this._rgb=Rs(t)}rgbString(){return this._valid?fc(this._rgb):void 0}hexString(){return this._valid?Ja(this._rgb):void 0}hslString(){return this._valid?cc(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,s=t.rgb,o,r=e===o?.5:e,a=2*r-1,c=i.a-s.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,i.r=255&l*i.r+o*s.r+.5,i.g=255&l*i.g+o*s.g+.5,i.b=255&l*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=pc(this._rgb,t._rgb,e)),this}clone(){return new n(this.rgb)}alpha(t){return this._rgb.a=St(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=Pe(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return tn(this._rgb,2,t),this}darken(t){return tn(this._rgb,2,-t),this}saturate(t){return tn(this._rgb,1,t),this}desaturate(t){return tn(this._rgb,1,-t),this}rotate(t){return ac(this._rgb,t),this}};function ft(){}var Qs=(()=>{let n=0;return()=>n++})();function N(n){return n===null||typeof n>"u"}function W(n){if(Array.isArray&&Array.isArray(n))return!0;let t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function L(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function $(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function K(n,t){return $(n)?n:t}function R(n,t){return typeof n>"u"?t:n}var Gs=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,ji=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function z(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function E(n,t,e,i){let s,o,r;if(W(n))if(o=n.length,i)for(s=o-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;s<o;s++)t.call(e,n[s],s);else if(L(n))for(r=Object.keys(n),o=r.length,s=0;s<o;s++)t.call(e,n[r[s]],r[s])}function Te(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 on(n){if(W(n))return n.map(on);if(L(n)){let t=Object.create(null),e=Object.keys(n),i=e.length,s=0;for(;s<i;++s)t[e[s]]=on(n[e[s]]);return t}return n}function Ks(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function mc(n,t,e,i){if(!Ks(n))return;let s=t[n],o=e[n];L(s)&&L(o)?te(s,o,i):t[n]=on(o)}function te(n,t,e){let i=W(t)?t:[t],s=i.length;if(!L(n))return n;e=e||{};let o=e.merger||mc,r;for(let a=0;a<s;++a){if(r=i[a],!L(r))continue;let c=Object.keys(r);for(let l=0,h=c.length;l<h;++l)o(c[l],n,r,e)}return n}function ne(n,t){return te(n,t,{merger:bc})}function bc(n,t,e){if(!Ks(n))return;let i=t[n],s=e[n];L(i)&&L(s)?ne(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=on(s))}var zs={"":n=>n,x:n=>n.x,y:n=>n.y};function xc(n){let t=n.split("."),e=[],i="";for(let s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function yc(n){let t=xc(n);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function Vt(n,t){return(zs[t]||(zs[t]=yc(t)))(n)}function ln(n){return n.charAt(0).toUpperCase()+n.slice(1)}var Ce=n=>typeof n<"u",xt=n=>typeof n=="function",qi=(n,t)=>{if(n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0};function Zs(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}var B=Math.PI,X=2*B,_c=X+B,rn=Number.POSITIVE_INFINITY,wc=B/180,G=B/2,zt=B/4,Bs=B*2/3,yt=Math.log10,Ht=Math.sign;function ie(n,t,e){return Math.abs(n-t)<e}function $i(n){let t=Math.round(n);n=ie(n,t,n/1e3)?t:n;let e=Math.pow(10,Math.floor(yt(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Js(n){let t=[],e=Math.sqrt(n),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 se(n){return!isNaN(parseFloat(n))&&isFinite(n)}function to(n,t){let e=Math.round(n);return e-t<=n&&e+t>=n}function Xi(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 at(n){return n*(B/180)}function hn(n){return n*(180/B)}function Ui(n){if(!$(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function eo(n,t){let e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i),o=Math.atan2(i,e);return o<-.5*B&&(o+=X),{angle:o,distance:s}}function an(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Mc(n,t){return(n-t+_c)%X-B}function ot(n){return(n%X+X)%X}function Ae(n,t,e,i){let s=ot(n),o=ot(t),r=ot(e),a=ot(o-s),c=ot(r-s),l=ot(s-o),h=ot(s-r);return s===o||s===r||i&&o===r||a>c&&l<h}function rt(n,t,e){return Math.max(t,Math.min(e,n))}function no(n){return rt(n,-32768,32767)}function io(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function un(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}}var Ct=(n,t,e,i)=>un(n,e,i?s=>{let o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),so=(n,t,e)=>un(n,e,i=>n[i][t]>=e);function oo(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}var ro=["push","pop","shift","splice","unshift"];function ao(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ro.forEach(e=>{let i="_onData"+ln(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Qi(n,t){let e=n._chartjs;if(!e)return;let i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ro.forEach(o=>{delete n[o]}),delete n._chartjs)}function co(n){let t=new Set(n);return t.size===n.length?n:Array.from(t)}var Gi=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ki(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Gi.call(window,()=>{i=!1,n.apply(t,e)}))}}function lo(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}var ho=n=>n==="start"?"left":n==="end"?"right":"center",Zi=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2;function uo(n,t,e){let i=t.length,s=0,o=i;if(n._sorted){let{iScale:r,_parsed:a}=n,c=r.axis,{min:l,max:h,minDefined:u,maxDefined:d}=r.getUserBounds();u&&(s=rt(Math.min(Ct(a,c,l).lo,e?i:Ct(t,c,r.getPixelForValue(l)).lo),0,i-1)),d?o=rt(Math.max(Ct(a,r.axis,h,!0).hi+1,e?0:Ct(t,c,r.getPixelForValue(h),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function fo(n){let{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;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}var en=n=>n===0||n===1,Hs=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*X/e)),Ys=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*X/e)+1,Jt={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*G)+1,easeOutSine:n=>Math.sin(n*G),easeInOutSine:n=>-.5*(Math.cos(B*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=>en(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=>en(n)?n:Hs(n,.075,.3),easeOutElastic:n=>en(n)?n:Ys(n,.075,.3),easeInOutElastic(n){return en(n)?n:n<.5?.5*Hs(n*2,.1125,.45):.5+.5*Ys(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-Jt.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?Jt.easeInBounce(n*2)*.5:Jt.easeOutBounce(n*2-1)*.5+.5};function Ji(n){if(n&&typeof n=="object"){let t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ts(n){return Ji(n)?n:new ve(n)}function Hi(n){return Ji(n)?n:new ve(n).saturate(.5).darken(.1).hexString()}var kc=["x","y","borderWidth","radius","tension"],Dc=["color","borderColor","backgroundColor"];function vc(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:Dc},numbers:{type:"number",properties:kc}}),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 Pc(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Vs=new Map;function Oc(n,t){t=t||{};let e=n+JSON.stringify(t),i=Vs.get(e);return i||(i=new Intl.NumberFormat(n,t),Vs.set(e,i)),i}function oe(n,t,e){return Oc(t,e).format(n)}var po={values(n){return W(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";let i=this.chart.options.locale,s,o=n;if(e.length>1){let l=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(l<1e-4||l>1e15)&&(s="scientific"),o=Sc(n,e)}let r=yt(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),oe(n,i,c)},logarithmic(n,t,e){if(n===0)return"0";let i=e[t].significand||n/Math.pow(10,Math.floor(yt(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?po.numeric.call(this,n,t,e):""}};function Sc(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 Le={formatters:po};function Tc(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:Le.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"})}var At=Object.create(null),dn=Object.create(null);function Oe(n,t){if(!t)return n;let e=t.split(".");for(let i=0,s=e.length;i<s;++i){let o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function Yi(n,t,e){return typeof t=="string"?te(Oe(n,t),e):te(Oe(n,""),t)}var Vi=class{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)=>Hi(s.backgroundColor),this.hoverBorderColor=(i,s)=>Hi(s.borderColor),this.hoverColor=(i,s)=>Hi(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 Yi(this,t,e)}get(t){return Oe(this,t)}describe(t,e){return Yi(dn,t,e)}override(t,e){return Yi(At,t,e)}route(t,e,i,s){let o=Oe(this,t),r=Oe(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let c=this[a],l=r[s];return L(c)?Object.assign({},l,c):R(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(e=>e(this))}},H=new Vi({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vc,Pc,Tc]);function Cc(n){return!n||N(n.size)||N(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Se(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 go(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,a=e.length,c,l,h,u,d;for(c=0;c<a;c++)if(u=e[c],u!=null&&!W(u))r=Se(n,s,o,r,u);else if(W(u))for(l=0,h=u.length;l<h;l++)d=u[l],d!=null&&!W(d)&&(r=Se(n,s,o,r,d));n.restore();let f=o.length/2;if(f>e.length){for(c=0;c<f;c++)delete s[o[c]];o.splice(0,f)}return r}function Lt(n,t,e){let i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function es(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function fn(n,t,e,i){mo(n,t,e,i,null)}function mo(n,t,e,i,s){let o,r,a,c,l,h,u,d,f=t.pointStyle,m=t.rotation,p=t.radius,g=(m||0)*wc;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(g),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(p)||p<=0)){switch(n.beginPath(),f){default:s?n.ellipse(e,i,s/2,p,0,0,X):n.arc(e,i,p,0,X),n.closePath();break;case"triangle":h=s?s/2:p,n.moveTo(e+Math.sin(g)*h,i-Math.cos(g)*p),g+=Bs,n.lineTo(e+Math.sin(g)*h,i-Math.cos(g)*p),g+=Bs,n.lineTo(e+Math.sin(g)*h,i-Math.cos(g)*p),n.closePath();break;case"rectRounded":l=p*.516,c=p-l,r=Math.cos(g+zt)*c,u=Math.cos(g+zt)*(s?s/2-l:c),a=Math.sin(g+zt)*c,d=Math.sin(g+zt)*(s?s/2-l:c),n.arc(e-u,i-a,l,g-B,g-G),n.arc(e+d,i-r,l,g-G,g),n.arc(e+u,i+a,l,g,g+G),n.arc(e-d,i+r,l,g+G,g+B),n.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*p,h=s?s/2:c,n.rect(e-h,i-c,2*h,2*c);break}g+=zt;case"rectRot":u=Math.cos(g)*(s?s/2:p),r=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(s?s/2:p),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":g+=zt;case"cross":u=Math.cos(g)*(s?s/2:p),r=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(s?s/2:p),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(g)*(s?s/2:p),r=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(s?s/2:p),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r),g+=zt,u=Math.cos(g)*(s?s/2:p),r=Math.cos(g)*p,a=Math.sin(g)*p,d=Math.sin(g)*(s?s/2:p),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(g)*p,a=Math.sin(g)*p,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(g)*(s?s/2:p),i+Math.sin(g)*p);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function dt(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 ns(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function is(n){n.restore()}function bo(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){let 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 xo(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 Ac(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),N(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 Lc(n,t,e,i,s){if(s.strikethrough||s.underline){let o=n.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=e-o.actualBoundingBoxAscent,l=e+o.actualBoundingBoxDescent,h=s.strikethrough?(c+l)/2:l;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(r,h),n.lineTo(a,h),n.stroke()}}function Ic(n,t){let e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Ie(n,t,e,i,s,o={}){let r=W(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",c,l;for(n.save(),n.font=s.string,Ac(n,o),c=0;c<r.length;++c)l=r[c],o.backdrop&&Ic(n,o.backdrop),a&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),N(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(l,e,i,o.maxWidth)),n.fillText(l,e,i,o.maxWidth),Lc(n,e,i,l,o),i+=Number(s.lineHeight);n.restore()}function pn(n,t){let{x:e,y:i,w:s,h:o,radius:r}=t;n.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*B,B,!0),n.lineTo(e,i+o-r.bottomLeft),n.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,B,G,!0),n.lineTo(e+s-r.bottomRight,i+o),n.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,G,0,!0),n.lineTo(e+s,i+r.topRight),n.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-G,!0),n.lineTo(e+r.topLeft,i)}var Ec=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Rc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Fc(n,t){let e=(""+n).match(Ec);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}var Nc=n=>+n||0;function ss(n,t){let e={},i=L(t),s=i?Object.keys(t):t,o=L(n)?i?r=>R(n[r],n[t[r]]):r=>n[r]:()=>n;for(let r of s)e[r]=Nc(o(r));return e}function yo(n){return ss(n,{top:"y",right:"x",bottom:"y",left:"x"})}function re(n){return ss(n,["topLeft","topRight","bottomLeft","bottomRight"])}function nt(n){let t=yo(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Z(n,t){n=n||{},t=t||H.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(Rc)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:R(n.family,t.family),lineHeight:Fc(R(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:R(n.weight,t.weight),string:""};return s.string=Cc(s),s}function Ee(n,t,e,i){let s=!0,o,r,a;for(o=0,r=n.length;o<r;++o)if(a=n[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&W(a)&&(a=a[e%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function _o(n,t,e){let{min:i,max:s}=n,o=ji(t,(s-i)/2),r=(a,c)=>e&&a===0?0:a+c;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function _t(n,t){return Object.assign(Object.create(n),t)}function gn(n,t=[""],e,i,s=()=>n[0]){let o=e||n;typeof i>"u"&&(i=ko("_fallback",n));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>gn([a,...n],t,o,i)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete n[0][c],!0},get(a,c){return wo(a,c,()=>qc(c,t,n,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,c){return qs(a).includes(c)},ownKeys(a){return qs(a)},set(a,c,l){let h=a._storage||(a._storage=s());return a[c]=h[c]=l,delete a._keys,!0}})}function Yt(n,t,e,i){let s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:os(n,i),setContext:o=>Yt(n,o,e,i),override:o=>Yt(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 wo(o,r,()=>zc(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 os(n,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:xt(e)?e:()=>e,isIndexable:xt(i)?i:()=>i}}var Wc=(n,t)=>n?n+ln(t):t,rs=(n,t)=>L(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function wo(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];let i=e();return n[t]=i,i}function zc(n,t,e){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=n,a=i[t];return xt(a)&&r.isScriptable(t)&&(a=Bc(t,a,n,e)),W(a)&&a.length&&(a=Hc(t,a,n,r.isIndexable)),rs(t,a)&&(a=Yt(a,s,o&&o[t],r)),a}function Bc(n,t,e,i){let{_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 c=t(o,r||i);return a.delete(n),rs(n,c)&&(c=as(s._scopes,s,n,c)),c}function Hc(n,t,e,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(L(t[0])){let c=t,l=s._scopes.filter(h=>h!==c);t=[];for(let h of c){let u=as(l,s,n,h);t.push(Yt(u,o,r&&r[n],a))}}return t}function Mo(n,t,e){return xt(n)?n(t,e):n}var Yc=(n,t)=>n===!0?t:typeof n=="string"?Vt(t,n):void 0;function Vc(n,t,e,i,s){for(let o of t){let r=Yc(e,o);if(r){n.add(r);let a=Mo(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 as(n,t,e,i){let s=t._rootScopes,o=Mo(t._fallback,e,i),r=[...n,...s],a=new Set;a.add(i);let c=js(a,r,e,o||e,i);return c===null||typeof o<"u"&&o!==e&&(c=js(a,r,o,c,i),c===null)?!1:gn(Array.from(a),[""],s,o,()=>jc(t,e,i))}function js(n,t,e,i,s){for(;e;)e=Vc(n,t,e,i,s);return e}function jc(n,t,e){let i=n._getTarget();t in i||(i[t]={});let s=i[t];return W(s)&&L(e)?e:s||{}}function qc(n,t,e,i){let s;for(let o of t)if(s=ko(Wc(o,n),e),typeof s<"u")return rs(n,s)?as(e,i,n,s):s}function ko(n,t){for(let e of t){if(!e)continue;let i=e[n];if(typeof i<"u")return i}}function qs(n){let t=n._keys;return t||(t=n._keys=$c(n._scopes)),t}function $c(n){let t=new Set;for(let e of n)for(let i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Do(n,t,e,i){let{iScale:s}=n,{key:o="r"}=this._parsing,r=new Array(i),a,c,l,h;for(a=0,c=i;a<c;++a)l=a+e,h=t[l],r[a]={r:s.parse(Vt(h,o),l)};return r}var Xc=Number.EPSILON||1e-14,ee=(n,t)=>t<n.length&&!n[t].skip&&n[t],vo=n=>n==="x"?"y":"x";function Uc(n,t,e,i){let s=n.skip?t:n,o=t,r=e.skip?t:e,a=an(o,s),c=an(r,o),l=a/(a+c),h=c/(a+c);l=isNaN(l)?0:l,h=isNaN(h)?0:h;let u=i*l,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 Qc(n,t,e){let i=n.length,s,o,r,a,c,l=ee(n,0);for(let h=0;h<i-1;++h)if(c=l,l=ee(n,h+1),!(!c||!l)){if(ie(t[h],0,Xc)){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 Gc(n,t,e="x"){let i=vo(e),s=n.length,o,r,a,c=ee(n,0);for(let l=0;l<s;++l){if(r=a,a=c,c=ee(n,l+1),!a)continue;let h=a[e],u=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=u-o*t[l]),c&&(o=(c[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=u+o*t[l])}}function Kc(n,t="x"){let e=vo(t),i=n.length,s=Array(i).fill(0),o=Array(i),r,a,c,l=ee(n,0);for(r=0;r<i;++r)if(a=c,c=l,l=ee(n,r+1),!!c){if(l){let h=l[t]-c[t];s[r]=h!==0?(l[e]-c[e])/h:0}o[r]=a?l?Ht(s[r-1])!==Ht(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Qc(n,s,o),Gc(n,o,t)}function nn(n,t,e){return Math.max(Math.min(n,e),t)}function Zc(n,t){let e,i,s,o,r,a=dt(n[0],t);for(e=0,i=n.length;e<i;++e)r=o,o=a,a=e<i-1&&dt(n[e+1],t),o&&(s=n[e],r&&(s.cp1x=nn(s.cp1x,t.left,t.right),s.cp1y=nn(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=nn(s.cp2x,t.left,t.right),s.cp2y=nn(s.cp2y,t.top,t.bottom)))}function Po(n,t,e,i,s){let o,r,a,c;if(t.spanGaps&&(n=n.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")Kc(n,s);else{let l=i?n[n.length-1]:n[0];for(o=0,r=n.length;o<r;++o)a=n[o],c=Uc(l,a,n[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&Zc(n,e)}function mn(){return typeof window<"u"&&typeof document<"u"}function bn(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function cn(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}var xn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Jc(n,t){return xn(n).getPropertyValue(t)}var tl=["top","right","bottom","left"];function Bt(n,t,e){let i={};e=e?"-"+e:"";for(let s=0;s<4;s++){let o=tl[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var el=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function nl(n,t){let e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i,r=!1,a,c;if(el(s,o,n.target))a=s,c=o;else{let l=t.getBoundingClientRect();a=i.clientX-l.left,c=i.clientY-l.top,r=!0}return{x:a,y:c,box:r}}function It(n,t){if("native"in n)return n;let{canvas:e,currentDevicePixelRatio:i}=t,s=xn(e),o=s.boxSizing==="border-box",r=Bt(s,"padding"),a=Bt(s,"border","width"),{x:c,y:l,box:h}=nl(n,e),u=r.left+(h&&a.left),d=r.top+(h&&a.top),{width:f,height:m}=t;return o&&(f-=r.width+a.width,m-=r.height+a.height),{x:Math.round((c-u)/f*e.width/i),y:Math.round((l-d)/m*e.height/i)}}function il(n,t,e){let i,s;if(t===void 0||e===void 0){let o=bn(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{let r=o.getBoundingClientRect(),a=xn(o),c=Bt(a,"border","width"),l=Bt(a,"padding");t=r.width-l.width-c.width,e=r.height-l.height-c.height,i=cn(a.maxWidth,o,"clientWidth"),s=cn(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||rn,maxHeight:s||rn}}var sn=n=>Math.round(n*10)/10;function Oo(n,t,e,i){let s=xn(n),o=Bt(s,"margin"),r=cn(s.maxWidth,n,"clientWidth")||rn,a=cn(s.maxHeight,n,"clientHeight")||rn,c=il(n,t,e),{width:l,height:h}=c;if(s.boxSizing==="content-box"){let d=Bt(s,"border","width"),f=Bt(s,"padding");l-=f.width+d.width,h-=f.height+d.height}return l=Math.max(0,l-o.width),h=Math.max(0,i?l/i:h-o.height),l=sn(Math.min(l,r,c.maxWidth)),h=sn(Math.min(h,a,c.maxHeight)),l&&!h&&(h=sn(l/2)),(t!==void 0||e!==void 0)&&i&&c.height&&h>c.height&&(h=c.height,l=sn(Math.floor(h*i))),{width:l,height:h}}function cs(n,t,e){let 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);let 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}var So=function(){let n=!1;try{let t={get passive(){return n=!0,!1}};mn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function ls(n,t){let e=Jc(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Tt(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function To(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 Co(n,t,e,i){let s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},r=Tt(n,s,e),a=Tt(s,o,e),c=Tt(o,t,e),l=Tt(r,a,e),h=Tt(a,c,e);return Tt(l,h,e)}var sl=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}}},ol=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function yn(n,t,e){return n?sl(t,e):ol()}function Ao(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 Lo(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Io(n){return n==="angle"?{between:Ae,compare:Mc,normalize:ot}:{between:io,compare:(t,e)=>t-e,normalize:t=>t}}function $s({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 rl(n,t,e){let{property:i,start:s,end:o}=e,{between:r,normalize:a}=Io(i),c=t.length,{start:l,end:h,loop:u}=n,d,f;if(u){for(l+=c,h+=c,d=0,f=c;d<f&&r(a(t[l%c][i]),s,o);++d)l--,h--;l%=c,h%=c}return h<l&&(h+=c),{start:l,end:h,loop:u,style:n.style}}function Eo(n,t,e){if(!e)return[n];let{property:i,start:s,end:o}=e,r=t.length,{compare:a,between:c,normalize:l}=Io(i),{start:h,end:u,loop:d,style:f}=rl(n,t,e),m=[],p=!1,g=null,b,_,w,M=()=>c(s,w,b)&&a(s,w)!==0,y=()=>a(o,b)===0||c(o,w,b),S=()=>p||M(),D=()=>!p||y();for(let v=h,C=h;v<=u;++v)_=t[v%r],!_.skip&&(b=l(_[i]),b!==w&&(p=c(b,s,o),g===null&&S()&&(g=a(b,s)===0?v:C),g!==null&&D()&&(m.push($s({start:g,end:v,loop:d,count:r,style:f})),g=null),C=v,w=b));return g!==null&&m.push($s({start:g,end:u,loop:d,count:r,style:f})),m}function Ro(n,t){let e=[],i=n.segments;for(let s=0;s<i.length;s++){let o=Eo(i[s],n.points,t);o.length&&e.push(...o)}return e}function al(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 cl(n,t,e,i){let s=n.length,o=[],r=t,a=n[t],c;for(c=t+1;c<=e;++c){let l=n[c%s];l.skip||l.stop?a.skip||(i=!1,o.push({start:t%s,end:(c-1)%s,loop:i}),t=r=l.stop?c:null):(r=c,a.skip&&(t=c)),a=l}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function Fo(n,t){let e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];let o=!!n._loop,{start:r,end:a}=al(e,s,o,i);if(i===!0)return Xs(n,[{start:r,end:a,loop:o}],e,t);let c=a<r?a+s:a,l=!!n._fullLoop&&r===0&&a===s-1;return Xs(n,cl(e,r,c,l),e,t)}function Xs(n,t,e,i){return!i||!i.setContext||!e?t:ll(n,t,e,i)}function ll(n,t,e,i){let s=n._chart.getContext(),o=Us(n.options),{_datasetIndex:r,options:{spanGaps:a}}=n,c=e.length,l=[],h=o,u=t[0].start,d=u;function f(m,p,g,b){let _=a?-1:1;if(m!==p){for(m+=c;e[m%c].skip;)m-=_;for(;e[p%c].skip;)p+=_;m%c!==p%c&&(l.push({start:m%c,end:p%c,loop:g,style:b}),h=b,u=p%c)}}for(let m of t){u=a?u:m.start;let p=e[u%c],g;for(d=u+1;d<=m.end;d++){let b=e[d%c];g=Us(i.setContext(_t(s,{type:"segment",p0:p,p1:b,p0DataIndex:(d-1)%c,p1DataIndex:d%c,datasetIndex:r}))),hl(g,h)&&f(u,d-1,m.loop,h),p=b,h=g}u<d-1&&f(u,d-1,m.loop,h)}return l}function Us(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function hl(n,t){if(!t)return!1;let e=[],i=function(s,o){return Ji(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}var gs=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let 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=Gi.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;let o=i.items,r=o.length-1,a=!1,c;for(;r>=0;--r)c=o[r],c._active?(c._total>i.duration&&(i.duration=c._total),c.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){let e=this._charts,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){let 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;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,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)}},wt=new gs,No="transparent",ul={boolean(n,t,e){return e>.5?t:n},color(n,t,e){let i=ts(n||No),s=i.valid&&ts(t||No);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}},ms=class{constructor(t,e,i,s){let o=e[i];s=Ee([t.to,s,o,t.from]);let r=Ee([t.from,o,s]);this._active=!0,this._fn=t.fn||ul[t.type||typeof r],this._easing=Jt[t.easing]||Jt.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);let 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=Ee([t.to,e,s,t.from]),this._from=Ee([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,c;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}c=e/i%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,a,c)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}},Tn=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!L(t))return;let e=Object.keys(H.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!L(o))return;let r={};for(let a of e)r[a]=o[a];(W(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){let i=e.options,s=fl(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&dl(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now(),c;for(c=r.length-1;c>=0;--c){let l=r[c];if(l.charAt(0)==="$")continue;if(l==="options"){s.push(...this._animateOptions(t,e));continue}let h=e[l],u=o[l],d=i.get(l);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[l]=h;continue}o[l]=u=new ms(d,t,l,h),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return wt.add(this._chart,i),!0}};function dl(n,t){let e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function fl(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 Wo(n,t){let 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 pl(n,t,e){if(e===!1)return!1;let i=Wo(n,e),s=Wo(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function gl(n){let t,e,i,s;return L(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 Tr(n,t){let e=[],i=n._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function zo(n,t,e,i={}){let s=n.keys,o=i.mode==="single",r,a,c,l;if(t!==null){for(r=0,a=s.length;r<a;++r){if(c=+s[r],c===e){if(i.all)continue;break}l=n.values[c],$(l)&&(o||t===0||Ht(t)===Ht(l))&&(t+=l)}return t}}function ml(n){let t=Object.keys(n),e=new Array(t.length),i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e[i]={x:o,y:n[o]};return e}function Bo(n,t){let e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function bl(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function xl(n){let{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function yl(n,t,e){let i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Ho(n,t,e,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Yo(n,t){let{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,c=o.axis,l=r.axis,h=bl(o,r,i),u=t.length,d;for(let f=0;f<u;++f){let m=t[f],{[c]:p,[l]:g}=m,b=m._stacks||(m._stacks={});d=b[l]=yl(s,h,p),d[a]=g,d._top=Ho(d,r,!0,i.type),d._bottom=Ho(d,r,!1,i.type);let _=d._visualValues||(d._visualValues={});_[a]=g}}function hs(n,t){let e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function _l(n,t){return _t(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function wl(n,t,e){return _t(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Re(n,t){let e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(let s of t){let 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]}}}var us=n=>n==="reset"||n==="none",Vo=(n,t)=>t?n:Object.assign({},n),Ml=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Tr(e,!0),values:null},ce=class{static defaults={};static datasetElementType=null;static dataElementType=null;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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Bo(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&&Re(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(u,d,f,m)=>u==="x"?d:u==="r"?m:f,o=e.xAxisID=R(i.xAxisID,hs(t,"x")),r=e.yAxisID=R(i.yAxisID,hs(t,"y")),a=e.rAxisID=R(i.rAxisID,hs(t,"r")),c=e.indexAxis,l=e.iAxisID=s(c,o,r,a),h=e.vAxisID=s(c,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Qi(this._data,this),t._stacked&&Re(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(L(e))this._data=ml(e);else if(i!==e){if(i){Qi(i,this);let s=this._cachedMeta;Re(s),s._parsed=[]}e&&Object.isExtensible(e)&&ao(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=e._stacked;e._stacked=Bo(e.vScale,e),e.stack!==i.stack&&(s=!0,Re(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&Yo(this,e._parsed)}configure(){let 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){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,c=t===0&&e===s.length?!0:i._sorted,l=t>0&&i._parsed[t-1],h,u,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{W(s[t])?d=this.parseArrayData(i,s,t,e):L(s[t])?d=this.parseObjectData(i,s,t,e):d=this.parsePrimitiveData(i,s,t,e);let f=()=>u[a]===null||l&&u[a]<l[a];for(h=0;h<e;++h)i._parsed[h+t]=u=d[h],c&&(f()&&(c=!1),l=u);i._sorted=c}r&&Yo(this,d)}parsePrimitiveData(t,e,i,s){let{iScale:o,vScale:r}=t,a=o.axis,c=r.axis,l=o.getLabels(),h=o===r,u=new Array(s),d,f,m;for(d=0,f=s;d<f;++d)m=d+i,u[d]={[a]:h||o.parse(l[m],m),[c]:r.parse(e[m],m)};return u}parseArrayData(t,e,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),c,l,h,u;for(c=0,l=s;c<l;++c)h=c+i,u=e[h],a[c]={x:o.parse(u[0],h),y:r.parse(u[1],h)};return a}parseObjectData(t,e,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(s),h,u,d,f;for(h=0,u=s;h<u;++h)d=h+i,f=e[d],l[h]={x:o.parse(Vt(f,a),d),y:r.parse(Vt(f,c),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Tr(s,!0),values:e._stacks[t.axis]._visualValues};return zo(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let o=i[e.axis],r=o===null?NaN:o,a=s&&i._stacks[e.axis];s&&a&&(s.values=a,r=zo(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),c=Ml(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=xl(a),d,f;function m(){f=s[d];let p=f[a.axis];return!$(f[t.axis])||h>p||u<p}for(d=0;d<r&&!(!m()&&(this.updateRangeFromParsed(l,t,f,c),o));++d);if(o){for(d=r-1;d>=0;--d)if(!m()){this.updateRangeFromParsed(l,t,f,c);break}}return l}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],$(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let 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){let e=this._cachedMeta;this.update(t||"default"),e._clip=gl(R(this.options.clip,pl(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,c=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(t,o,a,c),h=a;h<a+c;++h){let u=s[h];u.hidden||(u.active&&l?r.push(u):u.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){let i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=wl(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=_l(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){let s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],c=this.enableOptionSharing&&Ce(i);if(a)return Vo(a,c);let l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),f=Object.keys(H.elements[t]),m=()=>this.getContext(i,s,e),p=l.resolveNamedOptions(d,f,m,u);return p.$shared&&(p.$shared=c,o[r]=Object.freeze(Vo(p,c))),p}_resolveAnimations(t,e,i){let s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let c;if(s.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);c=h.createResolver(d,this.getContext(t,i,e))}let l=new Tn(s,c&&c.animations);return c&&c._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||us(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let 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){us(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!us(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let 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(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];let 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){let s=this._cachedMeta,o=s.data,r=t+e,a,c=l=>{for(l.length+=e,a=l.length-1;a>=r;a--)l[a]=l[a-e]};for(c(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&Re(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};function kl(n,t,e){let i=1,s=1,o=0,r=0;if(t<X){let a=n,c=a+t,l=Math.cos(a),h=Math.sin(a),u=Math.cos(c),d=Math.sin(c),f=(w,M,y)=>Ae(w,a,c,!0)?1:Math.max(M,M*e,y,y*e),m=(w,M,y)=>Ae(w,a,c,!0)?-1:Math.min(M,M*e,y,y*e),p=f(0,l,u),g=f(G,h,d),b=m(B,l,u),_=m(B+G,h,d);i=(p-b)/2,s=(g-_)/2,o=-(p+b)/2,r=-(g+_)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}var bs=class extends ce{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};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){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(L(i[t])){let{key:c="value"}=this._parsing;o=l=>+Vt(i[l],c)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return at(this.options.rotation-90)}_getCircumference(){return at(this.options.circumference)}_getRotationExtents(){let t=X,e=-X;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let 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){let 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),c=Math.min(Gs(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:m,offsetY:p}=kl(u,h,c),g=(i.width-r)/d,b=(i.height-r)/f,_=Math.max(Math.min(g,b)/2,0),w=ji(this.options.radius,_),M=Math.max(w*c,0),y=(w-M)/this._getVisibleDatasetWeightTotal();this.offsetX=m*w,this.offsetY=p*w,s.total=this.calculateTotal(),this.outerRadius=w-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){let 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/X)}updateElements(t,e,i,s){let o=s==="reset",r=this.chart,a=r.chartArea,l=r.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=o&&l.animateScale,f=d?0:this.innerRadius,m=d?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(e,s),b=this._getRotation(),_;for(_=0;_<e;++_)b+=this._circumference(_,o);for(_=e;_<e+i;++_){let w=this._circumference(_,o),M=t[_],y={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+w,circumference:w,outerRadius:m,innerRadius:f};g&&(y.options=p||this.resolveDataElementOptions(_,M.active?"active":s)),b+=w,this.updateElement(M,_,y,s)}}calculateTotal(){let t=this._cachedMeta,e=t.data,i=0,s;for(s=0;s<e.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?X*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=oe(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0,i=this.chart,s,o,r,a,c;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)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){let 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}},Cn=class extends ce{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled,{start:a,count:c}=uo(e,s,r);this._drawStart=a,this._drawCount=c,fo(e)&&(a=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(s,a,c,t)}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),d=r.axis,f=a.axis,{spanGaps:m,segment:p}=this.options,g=se(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",_=e+i,w=t.length,M=e>0&&this.getParsed(e-1);for(let y=0;y<w;++y){let S=t[y],D=b?S:{};if(y<e||y>=_){D.skip=!0;continue}let v=this.getParsed(y),C=N(v[f]),Y=D[d]=r.getPixelForValue(v[d],y),V=D[f]=o||C?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,v,c):v[f],y);D.skip=isNaN(Y)||isNaN(V)||C,D.stop=y>0&&Math.abs(v[d]-M[d])>g,p&&(D.parsed=v,D.raw=l.data[y]),u&&(D.options=h||this.resolveDataElementOptions(y,S.active?"active":s)),b||this.updateElement(S,y,D,s),M=v}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let 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(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},xs=class extends ce{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.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}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=oe(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return Do.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{let 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(){let 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){let o=s==="reset",r=this.chart,c=r.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,u=l.yCenter,d=l.getIndexAngle(0)-.5*B,f=d,m,p=360/this.countVisibleElements();for(m=0;m<e;++m)f+=this._computeAngle(m,s,p);for(m=e;m<e+i;m++){let g=t[m],b=f,_=f+this._computeAngle(m,s,p),w=r.getDataVisibility(m)?l.getDistanceFromCenterForValue(this.getParsed(m).r):0;f=_,o&&(c.animateScale&&(w=0),c.animateRotate&&(b=_=d));let M={x:h,y:u,innerRadius:0,outerRadius:w,startAngle:b,endAngle:_,options:this.resolveDataElementOptions(m,g.active?"active":s)};this.updateElement(g,m,M,s)}}countVisibleElements(){let t=this._cachedMeta,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)?at(this.resolveDataElementOptions(t,e).angle||i):0}};function jt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var ys=class n{static override(t){Object.assign(n.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return jt()}parse(){return jt()}format(){return jt()}add(){return jt()}diff(){return jt()}startOf(){return jt()}endOf(){return jt()}},Cs={_date:ys};function Dl(n,t,e,i){let{controller:s,data:o,_sorted:r}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?so:Ct;if(i){if(s._sharedOptions){let l=o[0],h=typeof l.getRange=="function"&&l.getRange(t);if(h){let u=c(o,t,e-h),d=c(o,t,e+h);return{lo:u.lo,hi:d.hi}}}}else return c(o,t,e)}return{lo:0,hi:o.length-1}}function je(n,t,e,i,s){let o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,c=o.length;a<c;++a){let{index:l,data:h}=o[a],{lo:u,hi:d}=Dl(o[a],t,r,s);for(let f=u;f<=d;++f){let m=h[f];m.skip||i(m,l,f)}}}function vl(n){let t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){let 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 ds(n,t,e,i,s){let o=[];return!s&&!n.isPointInArea(t)||je(n,e,t,function(a,c,l){!s&&!dt(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function Pl(n,t,e,i){let s=[];function o(r,a,c){let{startAngle:l,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:u}=eo(r,{x:t.x,y:t.y});Ae(u,l,h)&&s.push({element:r,datasetIndex:a,index:c})}return je(n,e,t,o),s}function Ol(n,t,e,i,s,o){let r=[],a=vl(e),c=Number.POSITIVE_INFINITY;function l(h,u,d){let f=h.inRange(t.x,t.y,s);if(i&&!f)return;let m=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(m))&&!f)return;let g=a(t,m);g<c?(r=[{element:h,datasetIndex:u,index:d}],c=g):g===c&&r.push({element:h,datasetIndex:u,index:d})}return je(n,e,t,l),r}function fs(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Pl(n,t,e,s):Ol(n,t,e,i,s,o)}function jo(n,t,e,i,s){let o=[],r=e==="x"?"inXRange":"inYRange",a=!1;return je(n,e,t,(c,l,h)=>{c[r](t[e],s)&&(o.push({element:c,datasetIndex:l,index:h}),a=a||c.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Sl={evaluateInteractionItems:je,modes:{index(n,t,e,i){let s=It(t,n),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ds(n,s,o,i,r):fs(n,s,o,!1,i,r),c=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(l=>{let h=a[0].index,u=l.data[h];u&&!u.skip&&c.push({element:u,datasetIndex:l.index,index:h})}),c):[]},dataset(n,t,e,i){let s=It(t,n),o=e.axis||"xy",r=e.includeInvisible||!1,a=e.intersect?ds(n,s,o,i,r):fs(n,s,o,!1,i,r);if(a.length>0){let c=a[0].datasetIndex,l=n.getDatasetMeta(c).data;a=[];for(let h=0;h<l.length;++h)a.push({element:l[h],datasetIndex:c,index:h})}return a},point(n,t,e,i){let s=It(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return ds(n,s,o,i,r)},nearest(n,t,e,i){let s=It(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return fs(n,s,o,e.intersect,i,r)},x(n,t,e,i){let s=It(t,n);return jo(n,s,"x",e.intersect,i)},y(n,t,e,i){let s=It(t,n);return jo(n,s,"y",e.intersect,i)}}},Cr=["left","top","right","bottom"];function Fe(n,t){return n.filter(e=>e.pos===t)}function qo(n,t){return n.filter(e=>Cr.indexOf(e.pos)===-1&&e.box.axis===t)}function Ne(n,t){return n.sort((e,i)=>{let s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Tl(n){let t=[],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 Cl(n){let t={};for(let e of n){let{stack:i,pos:s,stackWeight:o}=e;if(!i||!Cr.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Al(n,t){let e=Cl(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=n.length;o<r;++o){a=n[o];let{fullSize:c}=a.box,l=e[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*i:c&&t.availableWidth,a.height=s):(a.width=i,a.height=h?h*s:c&&t.availableHeight)}return e}function Ll(n){let t=Tl(n),e=Ne(t.filter(l=>l.box.fullSize),!0),i=Ne(Fe(t,"left"),!0),s=Ne(Fe(t,"right")),o=Ne(Fe(t,"top"),!0),r=Ne(Fe(t,"bottom")),a=qo(t,"x"),c=qo(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(r).concat(a),chartArea:Fe(t,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(r).concat(a)}}function $o(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ar(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 Il(n,t,e,i){let{pos:s,box:o}=e,r=n.maxPadding;if(!L(s)){e.size&&(n[s]-=e.size);let 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&&Ar(r,o.getPadding());let a=Math.max(0,t.outerWidth-$o(r,n,"left","right")),c=Math.max(0,t.outerHeight-$o(r,n,"top","bottom")),l=a!==n.w,h=c!==n.h;return n.w=a,n.h=c,e.horizontal?{same:l,other:h}:{same:h,other:l}}function El(n){let t=n.maxPadding;function e(i){let 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 Rl(n,t){let e=t.maxPadding;function i(s){let 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 Be(n,t,e,i){let s=[],o,r,a,c,l,h;for(o=0,r=n.length,l=0;o<r;++o){a=n[o],c=a.box,c.update(a.width||t.w,a.height||t.h,Rl(a.horizontal,t));let{same:u,other:d}=Il(t,e,a,i);l|=u&&s.length,h=h||d,c.fullSize||s.push(a)}return l&&Be(s,t,e,i)||h}function _n(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 Xo(n,t,e,i){let s=e.padding,{x:o,y:r}=t;for(let a of n){let c=a.box,l=i[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){let u=t.w*h,d=l.size||c.height;Ce(l.start)&&(r=l.start),c.fullSize?_n(c,s.left,r,e.outerWidth-s.right-s.left,d):_n(c,t.left+l.placed,r,u,d),l.start=r,l.placed+=u,r=c.bottom}else{let u=t.h*h,d=l.size||c.width;Ce(l.start)&&(o=l.start),c.fullSize?_n(c,o,s.top,d,e.outerHeight-s.bottom-s.top):_n(c,o,t.top+l.placed,d,u),l.start=o,l.placed+=u,o=c.right}}t.x=o,t.y=r}var wn={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){let 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;let s=nt(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=Ll(n.boxes),c=a.vertical,l=a.horizontal;E(n.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let h=c.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+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);Ar(d,nt(i));let f=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),m=Al(c.concat(l),u);Be(a.fullSize,f,u,m),Be(c,f,u,m),Be(l,f,u,m)&&Be(c,f,u,m),El(f),Xo(a.leftAndTop,f,u,m),f.x+=f.w,f.y+=f.h,Xo(a.rightAndBottom,f,u,m),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(a.chartArea,p=>{let g=p.box;Object.assign(g,n.chartArea),g.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},An=class{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){}},_s=class extends An{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},On="$chartjs",Fl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Uo=n=>n===null||n==="";function Nl(n,t){let e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[On]={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",Uo(s)){let o=ls(n,"width");o!==void 0&&(n.width=o)}if(Uo(i))if(n.style.height==="")n.height=n.width/(t||2);else{let o=ls(n,"height");o!==void 0&&(n.height=o)}return n}var Lr=So?{passive:!0}:!1;function Wl(n,t,e){n.addEventListener(t,e,Lr)}function zl(n,t,e){n.canvas.removeEventListener(t,e,Lr)}function Bl(n,t){let e=Fl[n.type]||n.type,{x:i,y:s}=It(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Ln(n,t){for(let e of n)if(e===t||e.contains(t))return!0}function Hl(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Ln(a.addedNodes,i),r=r&&!Ln(a.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Yl(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||Ln(a.removedNodes,i),r=r&&!Ln(a.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}var Ye=new Map,Qo=0;function Ir(){let n=window.devicePixelRatio;n!==Qo&&(Qo=n,Ye.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Vl(n,t){Ye.size||window.addEventListener("resize",Ir),Ye.set(n,t)}function jl(n){Ye.delete(n),Ye.size||window.removeEventListener("resize",Ir)}function ql(n,t,e){let i=n.canvas,s=i&&bn(i);if(!s)return;let o=Ki((a,c)=>{let l=s.clientWidth;e(a,c),l<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{let c=a[0],l=c.contentRect.width,h=c.contentRect.height;l===0&&h===0||o(l,h)});return r.observe(s),Vl(n,o),r}function ps(n,t,e){e&&e.disconnect(),t==="resize"&&jl(n)}function $l(n,t,e){let i=n.canvas,s=Ki(o=>{n.ctx!==null&&e(Bl(o,n))},n);return Wl(i,t,s),s}var ws=class extends An{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Nl(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[On])return!1;let i=e[On].initial;["height","width"].forEach(o=>{let r=i[o];N(r)?e.removeAttribute(o):e.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[On],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),r={attach:Hl,detach:Yl,resize:ql}[e]||$l;s[e]=r(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ps,detach:ps,resize:ps}[e]||zl)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Oo(t,e,i,s)}isAttached(t){let e=bn(t);return!!(e&&e.isConnected)}};function Xl(n){return!mn()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?_s:ws}var $t=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return se(this.x)&&se(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};function Ul(n,t){let e=n.options.ticks,i=Ql(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Kl(t):[],r=o.length,a=o[0],c=o[r-1],l=[];if(r>s)return Zl(t,l,o,r/s),l;let h=Gl(o,t,s);if(r>0){let u,d,f=r>1?Math.round((c-a)/(r-1)):null;for(Mn(t,l,h,N(f)?0:a-f,a),u=0,d=r-1;u<d;u++)Mn(t,l,h,o[u],o[u+1]);return Mn(t,l,h,c,N(f)?t.length:c+f),l}return Mn(t,l,h),l}function Ql(n){let 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 Gl(n,t,e){let i=Jl(n),s=t.length/e;if(!i)return Math.max(s,1);let o=Js(i);for(let r=0,a=o.length-1;r<a;r++){let c=o[r];if(c>s)return c}return Math.max(s,1)}function Kl(n){let t=[],e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Zl(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 Mn(n,t,e,i,s){let o=R(i,0),r=Math.min(R(s,n.length),n.length),a=0,c,l,h;for(e=Math.ceil(e),s&&(c=s-i,e=c/Math.floor(c/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(l=Math.max(o,0);l<r;l++)l===h&&(t.push(n[l]),a++,h=Math.round(o+a*e))}function Jl(n){let t=n.length,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}var th=n=>n==="left"?"right":n==="right"?"left":n,Go=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Ko=(n,t)=>Math.min(t||n,n);function Zo(n,t){let e=[],i=n.length/t,s=n.length,o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function eh(n,t,e){let i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,a=1e-6,c=n.getPixelForTick(s),l;if(!(e&&(i===1?l=Math.max(c-o,r-c):t===0?l=(n.getPixelForTick(1)-c)/2:l=(c-n.getPixelForTick(s-1))/2,c+=s<t?l:-l,c<o-a||c>r+a)))return c}function nh(n,t){E(n,e=>{let i=e.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function We(n){return n.drawTicks?n.tickLength:0}function Jo(n,t){if(!n.display)return 0;let e=Z(n.font,t),i=nt(n.padding);return(W(n.text)?n.text.length:1)*e.lineHeight+i.height}function ih(n,t){return _t(n,{scale:t,type:"scale"})}function sh(n,t,e){return _t(n,{tick:e,index:t,type:"tick"})}function oh(n,t,e){let i=ho(n);return(e&&t!=="right"||!e&&t==="right")&&(i=th(i)),i}function rh(n,t,e,i){let{top:s,left:o,bottom:r,right:a,chart:c}=n,{chartArea:l,scales:h}=c,u=0,d,f,m,p=r-s,g=a-o;if(n.isHorizontal()){if(f=Zi(i,o,a),L(e)){let b=Object.keys(e)[0],_=e[b];m=h[b].getPixelForValue(_)+p-t}else e==="center"?m=(l.bottom+l.top)/2+p-t:m=Go(n,e,t);d=a-o}else{if(L(e)){let b=Object.keys(e)[0],_=e[b];f=h[b].getPixelForValue(_)-g+t}else e==="center"?f=(l.left+l.right)/2-g+t:f=Go(n,e,t);m=Zi(i,r,s),u=e==="left"?-G:G}return{titleX:f,titleY:m,maxWidth:d,rotation:u}}var le=class n extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=K(t,Number.POSITIVE_INFINITY),e=K(e,Number.NEGATIVE_INFINITY),i=K(i,Number.POSITIVE_INFINITY),s=K(s,Number.NEGATIVE_INFINITY),{min:K(t,i),max:K(e,s),minDefined:$(t),maxDefined:$(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};let a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)r=a[c].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:K(e,K(i,e)),max:K(i,K(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(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(t,e,i){let{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=_o(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let c=a<this.ticks.length;this._convertTicksToLabels(c?Zo(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Ul(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,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(){z(this.options.afterUpdate,[this])}beforeSetDimensions(){z(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(){z(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),z(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){z(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=z(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){z(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){z(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,e=t.ticks,i=Ko(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation,r=s,a,c,l;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=rt(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)),c=this.maxHeight-We(t.grid)-e.padding-Jo(t.title,this.chart.options.font),l=Math.sqrt(u*u+d*d),r=hn(Math.min(Math.asin(rt((h.highest.height+6)/a,-1,1)),Math.asin(rt(c/l,-1,1))-Math.asin(rt(d/l,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let c=Jo(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=We(o)+c):(t.height=this.maxHeight,t.width=We(o)+c),i.display&&this.ticks.length){let{first:l,last:h,widest:u,highest:d}=this._getLabelSizes(),f=i.padding*2,m=at(this.labelRotation),p=Math.cos(m),g=Math.sin(m);if(a){let b=i.mirror?0:g*u.width+p*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=i.mirror?0:p*u.width+g*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(l,h,g,p)}}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){let{ticks:{align:o,padding:r},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;c?l?(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(){z(this.options.afterFit,[this])}isHorizontal(){let{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++)N(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=Zo(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],c=Math.floor(e/Ko(e,i)),l=0,h=0,u,d,f,m,p,g,b,_,w,M,y;for(u=0;u<e;u+=c){if(m=t[u].label,p=this._resolveTickFontOptions(u),s.font=g=p.string,b=o[g]=o[g]||{data:{},gc:[]},_=p.lineHeight,w=M=0,!N(m)&&!W(m))w=Se(s,b.data,b.gc,w,m),M=_;else if(W(m))for(d=0,f=m.length;d<f;++d)y=m[d],!N(y)&&!W(y)&&(w=Se(s,b.data,b.gc,w,y),M+=_);r.push(w),a.push(M),l=Math.max(w,l),h=Math.max(M,h)}nh(o,e);let S=r.indexOf(l),D=a.indexOf(h),v=C=>({width:r[C]||0,height:a[C]||0});return{first:v(0),last:v(e-1),widest:v(S),highest:v(D),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return no(this._alignToPixels?Lt(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=sh(this.getContext(),t,i))}return this.$context||(this.$context=ih(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=at(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,c=o?o.highest.height+r:0;return this.isHorizontal()?c*i>a*s?a/i:c/s:c*s<a*i?c/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,c=o.offset,l=this.isHorizontal(),u=this.ticks.length+(c?1:0),d=We(o),f=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,g=p/2,b=function(U){return Lt(i,U,p)},_,w,M,y,S,D,v,C,Y,V,q,ut;if(r==="top")_=b(this.bottom),D=this.bottom-d,C=_-g,V=b(t.top)+g,ut=t.bottom;else if(r==="bottom")_=b(this.top),V=t.top,ut=b(t.bottom)-g,D=_+g,C=this.top+d;else if(r==="left")_=b(this.right),S=this.right-d,v=_-g,Y=b(t.left)+g,q=t.right;else if(r==="right")_=b(this.left),Y=t.left,q=b(t.right)-g,S=_+g,v=this.left+d;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(L(r)){let U=Object.keys(r)[0],it=r[U];_=b(this.chart.scales[U].getPixelForValue(it))}V=t.top,ut=t.bottom,D=_+g,C=D+d}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(L(r)){let U=Object.keys(r)[0],it=r[U];_=b(this.chart.scales[U].getPixelForValue(it))}S=_-g,v=S-d,Y=t.left,q=t.right}let Pt=R(s.ticks.maxTicksLimit,u),j=Math.max(1,Math.ceil(u/Pt));for(w=0;w<u;w+=j){let U=this.getContext(w),it=o.setContext(U),Qe=a.setContext(U),Ge=it.lineWidth,Gt=it.color,Ke=Qe.dash||[],Kt=Qe.dashOffset,Me=it.tickWidth,Nt=it.tickColor,ke=it.tickBorderDash||[],Wt=it.tickBorderDashOffset;M=eh(this,w,c),M!==void 0&&(y=Lt(i,M,Ge),l?S=v=Y=q=y:D=C=V=ut=y,f.push({tx1:S,ty1:D,tx2:v,ty2:C,x1:Y,y1:V,x2:q,y2:ut,width:Ge,color:Gt,borderDash:Ke,borderDashOffset:Kt,tickWidth:Me,tickColor:Nt,tickBorderDash:ke,tickBorderDashOffset:Wt}))}return this._ticksLength=u,this._borderValue=_,f}_computeLabelItems(t){let e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:h,mirror:u}=o,d=We(i.grid),f=d+h,m=u?-h:f,p=-at(this.labelRotation),g=[],b,_,w,M,y,S,D,v,C,Y,V,q,ut="middle";if(s==="top")S=this.bottom-m,D=this._getXAxisLabelAlignment();else if(s==="bottom")S=this.top+m,D=this._getXAxisLabelAlignment();else if(s==="left"){let j=this._getYAxisLabelAlignment(d);D=j.textAlign,y=j.x}else if(s==="right"){let j=this._getYAxisLabelAlignment(d);D=j.textAlign,y=j.x}else if(e==="x"){if(s==="center")S=(t.top+t.bottom)/2+f;else if(L(s)){let j=Object.keys(s)[0],U=s[j];S=this.chart.scales[j].getPixelForValue(U)+f}D=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-f;else if(L(s)){let j=Object.keys(s)[0],U=s[j];y=this.chart.scales[j].getPixelForValue(U)}D=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(c==="start"?ut="top":c==="end"&&(ut="bottom"));let Pt=this._getLabelSizes();for(b=0,_=a.length;b<_;++b){w=a[b],M=w.label;let j=o.setContext(this.getContext(b));v=this.getPixelForTick(b)+o.labelOffset,C=this._resolveTickFontOptions(b),Y=C.lineHeight,V=W(M)?M.length:1;let U=V/2,it=j.color,Qe=j.textStrokeColor,Ge=j.textStrokeWidth,Gt=D;r?(y=v,D==="inner"&&(b===_-1?Gt=this.options.reverse?"left":"right":b===0?Gt=this.options.reverse?"right":"left":Gt="center"),s==="top"?l==="near"||p!==0?q=-V*Y+Y/2:l==="center"?q=-Pt.highest.height/2-U*Y+Y:q=-Pt.highest.height+Y/2:l==="near"||p!==0?q=Y/2:l==="center"?q=Pt.highest.height/2-U*Y:q=Pt.highest.height-V*Y,u&&(q*=-1),p!==0&&!j.showLabelBackdrop&&(y+=Y/2*Math.sin(p))):(S=v,q=(1-V)*Y/2);let Ke;if(j.showLabelBackdrop){let Kt=nt(j.backdropPadding),Me=Pt.heights[b],Nt=Pt.widths[b],ke=q-Kt.top,Wt=0-Kt.left;switch(ut){case"middle":ke-=Me/2;break;case"bottom":ke-=Me;break}switch(D){case"center":Wt-=Nt/2;break;case"right":Wt-=Nt;break;case"inner":b===_-1?Wt-=Nt:b>0&&(Wt-=Nt/2);break}Ke={left:Wt,top:ke,width:Nt+Kt.width,height:Me+Kt.height,color:j.backdropColor}}g.push({label:M,font:C,textOffset:q,options:{rotation:p,color:it,strokeColor:Qe,strokeWidth:Ge,textAlign:Gt,textBaseline:ut,translation:[y,S],backdrop:Ke}})}return g}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-at(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){let{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,c=r.widest.width,l,h;return e==="left"?s?(h=this.right+o,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h+=c)):(h=this.right-a,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h-=c)):(h=this.left+a,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h=this.right)):l="right",{textAlign:l,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let 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(){let{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){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(c,l,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(c.x,c.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){let c=s[o];e.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue,l,h,u,d;this.isHorizontal()?(l=Lt(t,this.left,r)-r/2,h=Lt(t,this.right,a)+a/2,u=d=c):(u=Lt(t,this.top,r)-r/2,d=Lt(t,this.bottom,a)+a/2,l=h=c),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,u),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&ns(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,c=r.font,l=r.label,h=r.textOffset;Ie(i,l,0,h,c,a)}s&&is(i)}drawTitle(){let{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;let o=Z(i.font),r=nt(i.padding),a=i.align,c=o.lineHeight/2;e==="bottom"||e==="center"||L(e)?(c+=r.bottom,W(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=r.top;let{titleX:l,titleY:h,maxWidth:u,rotation:d}=rh(this,c,e,a);Ie(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:d,textAlign:oh(a,e,s),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let 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!==n.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){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=e.length;o<r;++o){let a=e[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return Z(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},ae=class{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){let e=Object.getPrototypeOf(t),i;lh(e)&&(i=this.register(e));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,ah(t,r,i),this.override&&H.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in H[s]&&(delete H[s][i],this.override&&delete At[i])}};function ah(n,t,e){let i=te(Object.create(null),[e?H.get(e):{},H.get(t),n.defaults]);H.set(t,i),n.defaultRoutes&&ch(t,n.defaultRoutes),n.descriptors&&H.describe(t,n.descriptors)}function ch(n,t){Object.keys(t).forEach(e=>{let i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),a=r.pop(),c=r.join(".");H.route(o,s,c,a)})}function lh(n){return"id"in n&&"defaults"in n}var Ms=class{constructor(){this.controllers=new ae(ce,"datasets",!0),this.elements=new ae($t,"elements"),this.plugins=new ae(Object,"plugins"),this.scales=new ae(le,"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=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):E(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){let s=ln(t);z(i["before"+s],[],i),e[t](i),z(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},gt=new Ms,ks=class{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));let 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(let o of t){let r=o.plugin,a=r[i],c=[e,s,o.options];if(z(a,c,r)===!1&&s.cancelable)return!1}return!0}invalidate(){N(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,s=R(i.options&&i.options.plugins,{}),o=hh(i);return s===!1&&!e?[]:dh(t,o,s,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}};function hh(n){let t={},e=[],i=Object.keys(gt.plugins.items);for(let o=0;o<i.length;o++)e.push(gt.getPlugin(i[o]));let s=n.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function uh(n,t){return!t&&n===!1?null:n===!0?{}:n}function dh(n,{plugins:t,localIds:e},i,s){let o=[],r=n.getContext();for(let a of t){let c=a.id,l=uh(i[c],s);l!==null&&o.push({plugin:a,options:fh(n.config,{plugin:a,local:e[c]},l,r)})}return o}function fh(n,{plugin:t,local:e},i,s){let 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 Ds(n,t){let e=H.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function ph(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function gh(n,t){return n===t?"_index_":"_value_"}function tr(n){if(n==="x"||n==="y"||n==="r")return n}function mh(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function vs(n,...t){if(tr(n))return n;for(let e of t){let i=e.axis||mh(e.position)||n.length>1&&tr(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function er(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function bh(n,t){if(t.data&&t.data.datasets){let e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return er(n,"x",e[0])||er(n,"y",e[0])}return{}}function xh(n,t){let e=At[n.type]||{scales:{}},i=t.scales||{},s=Ds(n.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!L(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let c=vs(r,a,bh(r,n),H.scales[a.type]),l=gh(c,s),h=e.scales||{};o[r]=ne(Object.create(null),[{axis:c},a,h[c],h[l]])}),n.data.datasets.forEach(r=>{let a=r.type||n.type,c=r.indexAxis||Ds(a,t),h=(At[a]||{}).scales||{};Object.keys(h).forEach(u=>{let d=ph(u,c),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),ne(o[f],[{axis:d},i[f],h[u]])})}),Object.keys(o).forEach(r=>{let a=o[r];ne(a,[H.scales[a.type],H.scale])}),o}function Er(n){let t=n.options||(n.options={});t.plugins=R(t.plugins,{}),t.scales=xh(n,t)}function Rr(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function yh(n){return n=n||{},n.data=Rr(n.data),Er(n),n}var nr=new Map,Fr=new Set;function kn(n,t){let e=nr.get(n);return e||(e=t(),nr.set(n,e),Fr.add(e)),e}var ze=(n,t,e)=>{let i=Vt(t,e);i!==void 0&&n.add(i)},Ps=class{constructor(t){this._config=yh(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=Rr(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Er(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return kn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return kn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return kn(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;let c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(u=>ze(c,t,u))),h.forEach(u=>ze(c,s,u)),h.forEach(u=>ze(c,At[o]||{},u)),h.forEach(u=>ze(c,H,u)),h.forEach(u=>ze(c,dn,u))});let l=Array.from(c);return l.length===0&&l.push(Object.create(null)),Fr.has(e)&&r.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,At[e]||{},H.datasets[e]||{},{type:e},H,dn]}resolveNamedOptions(t,e,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=ir(this._resolverCache,t,s),c=r;if(wh(r,e)){o.$shared=!1,i=xt(i)?i():i;let l=this.createResolver(t,i,a);c=Yt(r,i,l)}for(let l of e)o[l]=c[l];return o}createResolver(t,e,i=[""],s){let{resolver:o}=ir(this._resolverCache,t,i);return L(e)?Yt(o,e,void 0,s):o}};function ir(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));let s=e.join(),o=i.get(s);return o||(o={resolver:gn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}var _h=n=>L(n)&&Object.getOwnPropertyNames(n).some(t=>xt(n[t]));function wh(n,t){let{isScriptable:e,isIndexable:i}=os(n);for(let s of t){let o=e(s),r=i(s),a=(r||o)&&n[s];if(o&&(xt(a)||_h(a))||r&&W(a))return!0}return!1}var Mh="4.4.1",kh=["top","bottom","left","right","chartArea"];function sr(n,t){return n==="top"||n==="bottom"||kh.indexOf(n)===-1&&t==="x"}function or(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function rr(n){let t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),z(e&&e.onComplete,[n],t)}function Dh(n){let t=n.chart,e=t.options.animation;z(e&&e.onProgress,[n],t)}function Nr(n){return mn()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}var Sn={},ar=n=>{let t=Nr(n);return Object.values(Sn).filter(e=>e.canvas===t).pop()};function vh(n,t,e){let i=Object.keys(n);for(let s of i){let o=+s;if(o>=t){let r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r)}}}function Ph(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Dn(n,t,e){return n.options.clip?n[e]:t[e]}function Oh(n,t){let{xScale:e,yScale:i}=n;return e&&i?{left:Dn(e,t,"left"),right:Dn(e,t,"right"),top:Dn(i,t,"top"),bottom:Dn(i,t,"bottom")}:t}var he=class{static defaults=H;static instances=Sn;static overrides=At;static registry=gt;static version=Mh;static getChart=ar;static register(...t){gt.add(...t),cr()}static unregister(...t){gt.remove(...t),cr()}constructor(t,e){let i=this.config=new Ps(e),s=Nr(t),o=ar(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Xl(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),c=a&&a.canvas,l=c&&c.height,h=c&&c.width;if(this.id=Qs(),this.ctx=a,this.canvas=c,this.width=h,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new ks,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=lo(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],Sn[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}wt.listen(this,"complete",rr),wt.listen(this,"progress",Dh),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return N(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():cs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return es(this.canvas,this.ctx),this}stop(){return wt.stop(this),this}resize(t,e){wt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let 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(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,cs(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(i.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};E(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];e&&(o=o.concat(Object.keys(e).map(r=>{let a=e[r],c=vs(r,a),l=c==="r",h=c==="x";return{options:a,dposition:l?"chartArea":h?"bottom":"left",dtype:l?"radialLinear":h?"category":"linear"}}))),E(o,r=>{let a=r.options,c=a.id,l=vs(c,a),h=R(a.type,r.dtype);(a.position===void 0||sr(a.position,l)!==sr(r.dposition))&&(a.position=r.dposition),s[c]=!0;let u=null;if(c in i&&i[c].type===h)u=i[c];else{let d=gt.getScale(h);u=new d({id:c,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),E(s,(r,a)=>{r||delete i[a]}),E(i,r=>{wn.configure(this,r,r.options),wn.addBox(this,r)})}_updateMetasets(){let 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(or("order","index"))}_removeUnreferencedMetasets(){let{_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(){let t=[],e=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){let o=e[i],r=this.getDatasetMeta(i),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||Ds(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{let c=gt.getController(a),{datasetElementType:l,dataElementType:h}=H.datasets[a];Object.assign(c,{dataElementType:gt.getElement(h),datasetElementType:l&>.getElement(l)}),r.controller=new c(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){E(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let 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;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let l=0,h=this.data.datasets.length;l<h;l++){let{controller:u}=this.getDatasetMeta(l),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||E(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(or("z","_idx"));let{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){E(this.scales,t=>{wn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!qi(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of e){let r=i==="_removeElements"?-o:o;vh(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let 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(!qi(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;wn.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],E(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,xt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let 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&&(wt.has(this)?this.attached&&!wt.running(this)&&wt.start(this):(this.draw(),rr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let 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){let e=this._sortedMetasets,i=[],s,o;for(s=0,o=e.length;s<o;++s){let 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;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i=t._clip,s=!i.disabled,o=Oh(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&ns(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&&is(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return dt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let o=Sl.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,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=_t(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let 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){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Ce(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){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),wt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),es(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Sn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,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)};E(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(c,l)=>{e.addEventListener(this,c,l),t[c]=l},s=(c,l)=>{t[c]&&(e.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)},r,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(){E(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},E(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s=i?"set":"remove",o,r,a,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){r=t[a];let l=r&&this.getDatasetMeta(r.datasetIndex).controller;l&&l[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Te(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){let s=this.options.hover,o=(c,l)=>c.filter(h=>!l.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){let 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;let 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){let{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),c=Zs(t),l=Ph(t,this._lastEvent,i,c);i&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),c&&z(o.onClick,[t,a,this],this));let h=!Te(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function cr(){return E(he.instances,n=>n._plugins.invalidate())}function Wr(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 Sh(n,t,e){n.lineTo(e.x,e.y)}function Th(n){return n.stepped?bo:n.tension||n.cubicInterpolationMode==="monotone"?xo:Sh}function zr(n,t,e={}){let i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=t,c=Math.max(s,r),l=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:i,start:c,loop:t.loop,ilen:l<c&&!h?i+l-c:l-c}}function Ch(n,t,e,i){let{points:s,options:o}=t,{count:r,start:a,loop:c,ilen:l}=zr(s,e,i),h=Th(o),{move:u=!0,reverse:d}=i||{},f,m,p;for(f=0;f<=l;++f)m=s[(a+(d?l-f:f))%r],!m.skip&&(u?(n.moveTo(m.x,m.y),u=!1):h(n,p,m,d,o.stepped),p=m);return c&&(m=s[(a+(d?l:0))%r],h(n,p,m,d,o.stepped)),!!c}function Ah(n,t,e,i){let s=t.points,{count:o,start:r,ilen:a}=zr(s,e,i),{move:c=!0,reverse:l}=i||{},h=0,u=0,d,f,m,p,g,b,_=M=>(r+(l?a-M:M))%o,w=()=>{p!==g&&(n.lineTo(h,g),n.lineTo(h,p),n.lineTo(h,b))};for(c&&(f=s[_(0)],n.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[_(d)],f.skip)continue;let M=f.x,y=f.y,S=M|0;S===m?(y<p?p=y:y>g&&(g=y),h=(u*h+M)/++u):(w(),n.lineTo(M,y),m=S,u=0,p=g=y),b=y}w()}function Os(n){let t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ah:Ch}function Lh(n){return n.stepped?To:n.tension||n.cubicInterpolationMode==="monotone"?Co:Tt}function Ih(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Wr(n,t.options),n.stroke(s)}function Eh(n,t,e,i){let{segments:s,options:o}=t,r=Os(t);for(let a of s)Wr(n,o,a.style),n.beginPath(),r(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}var Rh=typeof Path2D=="function";function Fh(n,t,e,i){Rh&&!t.options.segment?Ih(n,t,e,i):Eh(n,t,e,i)}var In=class extends $t{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;Po(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=Fo(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,s=t[e],o=this.points,r=Ro(this,{property:e,start:s,end:s});if(!r.length)return;let a=[],c=Lh(i),l,h;for(l=0,h=r.length;l<h;++l){let{start:u,end:d}=r[l],f=o[u],m=o[d];if(f===m){a.push(f);continue}let p=Math.abs((s-f[e])/(m[e]-f[e])),g=c(f,m,p,i.stepped);g[e]=t[e],a.push(g)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Os(this)(t,this,e,i)}path(t,e,i){let s=this.segments,o=Os(this),r=this._loop;e=e||0,i=i||this.points.length-e;for(let a of s)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Fh(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function lr(n,t,e,i){let s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}var En=class extends $t{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return lr(this,t,"x",e)}inYRange(t,e){return lr(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);let i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){let i=this.options;this.skip||i.radius<.1||!dt(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,fn(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};var Ss=["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)"],hr=Ss.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Br(n){return Ss[n%Ss.length]}function Hr(n){return hr[n%hr.length]}function Nh(n,t){return n.borderColor=Br(t),n.backgroundColor=Hr(t),++t}function Wh(n,t){return n.backgroundColor=n.data.map(()=>Br(t++)),t}function zh(n,t){return n.backgroundColor=n.data.map(()=>Hr(t++)),t}function Bh(n){let t=0;return(e,i)=>{let s=n.getDatasetMeta(i).controller;s instanceof bs?t=Wh(e,t):s instanceof xs?t=zh(e,t):s&&(t=Nh(e,t))}}function ur(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Hh(n){return n&&(n.borderColor||n.backgroundColor)}var Yr={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;let{data:{datasets:i},options:s}=n.config,{elements:o}=s;if(!e.forceOverride&&(ur(i)||Hh(s)||o&&ur(o)))return;let r=Bh(n);i.forEach(r)}};var He={average(n){if(!n.length)return!1;let t,e,i=0,s=0,o=0;for(t=0,e=n.length;t<e;++t){let r=n[t].element;if(r&&r.hasValue()){let a=r.tooltipPosition();i+=a.x,s+=a.y,++o}}return{x:i/o,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){let c=n[o].element;if(c&&c.hasValue()){let l=c.getCenterPoint(),h=an(t,l);h<s&&(s=h,a=c)}}if(a){let c=a.tooltipPosition();e=c.x,i=c.y}return{x:e,y:i}}};function pt(n,t){return t&&(W(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Mt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(` +(()=>{function Oe(n){return n+.5|0}var St=(n,t,e)=>Math.max(Math.min(n,e),t);function De(n){return St(Oe(n*2.55),0,255)}function Tt(n){return St(Oe(n*255),0,255)}function xt(n){return St(Oe(n/2.55)/100,0,1)}function Rs(n){return St(Oe(n*100),0,100)}var ot={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},Wi=[..."0123456789ABCDEF"],Ka=n=>Wi[n&15],Za=n=>Wi[(n&240)>>4]+Wi[n&15],tn=n=>(n&240)>>4===(n&15),Ja=n=>tn(n.r)&&tn(n.g)&&tn(n.b)&&tn(n.a);function tc(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&ot[n[1]]*17,g:255&ot[n[2]]*17,b:255&ot[n[3]]*17,a:t===5?ot[n[4]]*17:255}:(t===7||t===9)&&(e={r:ot[n[1]]<<4|ot[n[2]],g:ot[n[3]]<<4|ot[n[4]],b:ot[n[5]]<<4|ot[n[6]],a:t===9?ot[n[7]]<<4|ot[n[8]]:255})),e}var ec=(n,t)=>n<255?t(n):"";function nc(n){var t=Ja(n)?Ka:Za;return n?"#"+t(n.r)+t(n.g)+t(n.b)+ec(n.a,t):void 0}var ic=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Bs(n,t,e){let 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 sc(n,t,e){let 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 oc(n,t,e){let i=Bs(n,1,.5),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 rc(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 Ni(n){let 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,c,l,h;return o!==r&&(h=o-r,l=a>.5?h/(2-o-r):h/(o+r),c=rc(e,i,s,h,o),c=c*60+.5),[c|0,l||0,a]}function Bi(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Tt)}function Hi(n,t,e){return Bi(Bs,n,t,e)}function ac(n,t,e){return Bi(oc,n,t,e)}function cc(n,t,e){return Bi(sc,n,t,e)}function Hs(n){return(n%360+360)%360}function lc(n){let t=ic.exec(n),e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?De(+t[5]):Tt(+t[5]));let s=Hs(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?i=ac(s,o,r):t[1]==="hsv"?i=cc(s,o,r):i=Hi(s,o,r),{r:i[0],g:i[1],b:i[2],a:e}}function hc(n,t){var e=Ni(n);e[0]=Hs(e[0]+t),e=Hi(e),n.r=e[0],n.g=e[1],n.b=e[2]}function uc(n){if(!n)return;let t=Ni(n),e=t[0],i=Rs(t[1]),s=Rs(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${xt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}var zs={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"},Ws={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 dc(){let n={},t=Object.keys(Ws),e=Object.keys(zs),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,zs[o]);o=parseInt(Ws[r],16),n[a]=[o>>16&255,o>>8&255,o&255]}return n}var en;function fc(n){en||(en=dc(),en.transparent=[0,0,0,0]);let t=en[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var pc=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function gc(n){let t=pc.exec(n),e=255,i,s,o;if(t){if(t[7]!==i){let r=+t[7];e=t[8]?De(r):St(r*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?De(i):St(i,0,255)),s=255&(t[4]?De(s):St(s,0,255)),o=255&(t[6]?De(o):St(o,0,255)),{r:i,g:s,b:o,a:e}}}function mc(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${xt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}var zi=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Zt=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function bc(n,t,e){let i=Zt(xt(n.r)),s=Zt(xt(n.g)),o=Zt(xt(n.b));return{r:Tt(zi(i+e*(Zt(xt(t.r))-i))),g:Tt(zi(s+e*(Zt(xt(t.g))-s))),b:Tt(zi(o+e*(Zt(xt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function nn(n,t,e){if(n){let i=Ni(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Hi(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ys(n,t){return n&&Object.assign(t||{},n)}function Ns(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=Tt(n[3]))):(t=Ys(n,{r:0,g:0,b:0,a:1}),t.a=Tt(t.a)),t}function xc(n){return n.charAt(0)==="r"?gc(n):lc(n)}var Pe=class n{constructor(t){if(t instanceof n)return t;let e=typeof t,i;e==="object"?i=Ns(t):e==="string"&&(i=tc(t)||fc(t)||xc(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ys(this._rgb);return t&&(t.a=xt(t.a)),t}set rgb(t){this._rgb=Ns(t)}rgbString(){return this._valid?mc(this._rgb):void 0}hexString(){return this._valid?nc(this._rgb):void 0}hslString(){return this._valid?uc(this._rgb):void 0}mix(t,e){if(t){let i=this.rgb,s=t.rgb,o,r=e===o?.5:e,a=2*r-1,c=i.a-s.a,l=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;o=1-l,i.r=255&l*i.r+o*s.r+.5,i.g=255&l*i.g+o*s.g+.5,i.b=255&l*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=bc(this._rgb,t._rgb,e)),this}clone(){return new n(this.rgb)}alpha(t){return this._rgb.a=Tt(t),this}clearer(t){let e=this._rgb;return e.a*=1-t,this}greyscale(){let t=this._rgb,e=Oe(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){let e=this._rgb;return e.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return nn(this._rgb,2,t),this}darken(t){return nn(this._rgb,2,-t),this}saturate(t){return nn(this._rgb,1,t),this}desaturate(t){return nn(this._rgb,1,-t),this}rotate(t){return hc(this._rgb,t),this}};function pt(){}var Js=(()=>{let n=0;return()=>n++})();function R(n){return n==null}function N(n){if(Array.isArray&&Array.isArray(n))return!0;let t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function L(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function $(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function K(n,t){return $(n)?n:t}function F(n,t){return typeof n>"u"?t:n}var to=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,qi=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function B(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function E(n,t,e,i){let s,o,r;if(N(n))if(o=n.length,i)for(s=o-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;s<o;s++)t.call(e,n[s],s);else if(L(n))for(r=Object.keys(n),o=r.length,s=0;s<o;s++)t.call(e,n[r[s]],r[s])}function Ce(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 an(n){if(N(n))return n.map(an);if(L(n)){let t=Object.create(null),e=Object.keys(n),i=e.length,s=0;for(;s<i;++s)t[e[s]]=an(n[e[s]]);return t}return n}function eo(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function yc(n,t,e,i){if(!eo(n))return;let s=t[n],o=e[n];L(s)&&L(o)?te(s,o,i):t[n]=an(o)}function te(n,t,e){let i=N(t)?t:[t],s=i.length;if(!L(n))return n;e=e||{};let o=e.merger||yc,r;for(let a=0;a<s;++a){if(r=i[a],!L(r))continue;let c=Object.keys(r);for(let l=0,h=c.length;l<h;++l)o(c[l],n,r,e)}return n}function ne(n,t){return te(n,t,{merger:_c})}function _c(n,t,e){if(!eo(n))return;let i=t[n],s=e[n];L(i)&&L(s)?ne(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=an(s))}var Vs={"":n=>n,x:n=>n.x,y:n=>n.y};function wc(n){let t=n.split("."),e=[],i="";for(let s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Mc(n){let t=wc(n);return e=>{for(let i of t){if(i==="")break;e=e&&e[i]}return e}}function Vt(n,t){return(Vs[t]||(Vs[t]=Mc(t)))(n)}function un(n){return n.charAt(0).toUpperCase()+n.slice(1)}var Ae=n=>typeof n<"u",yt=n=>typeof n=="function",$i=(n,t)=>{if(n.size!==t.size)return!1;for(let e of n)if(!t.has(e))return!1;return!0};function no(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}var H=Math.PI,X=2*H,kc=X+H,cn=Number.POSITIVE_INFINITY,vc=H/180,G=H/2,Nt=H/4,js=H*2/3,_t=Math.log10,Ht=Math.sign;function ie(n,t,e){return Math.abs(n-t)<e}function Xi(n){let t=Math.round(n);n=ie(n,t,n/1e3)?t:n;let e=Math.pow(10,Math.floor(_t(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function io(n){let t=[],e=Math.sqrt(n),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 Dc(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function se(n){return!Dc(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function so(n,t){let e=Math.round(n);return e-t<=n&&e+t>=n}function Ui(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 ct(n){return n*(H/180)}function dn(n){return n*(180/H)}function Qi(n){if(!$(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function oo(n,t){let e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i),o=Math.atan2(i,e);return o<-.5*H&&(o+=X),{angle:o,distance:s}}function ln(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Pc(n,t){return(n-t+kc)%X-H}function rt(n){return(n%X+X)%X}function Le(n,t,e,i){let s=rt(n),o=rt(t),r=rt(e),a=rt(o-s),c=rt(r-s),l=rt(s-o),h=rt(s-r);return s===o||s===r||i&&o===r||a>c&&l<h}function at(n,t,e){return Math.max(t,Math.min(e,n))}function ro(n){return at(n,-32768,32767)}function ao(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function fn(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}}var At=(n,t,e,i)=>fn(n,e,i?s=>{let o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),co=(n,t,e)=>fn(n,e,i=>n[i][t]>=e);function lo(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}var ho=["push","pop","shift","splice","unshift"];function uo(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ho.forEach(e=>{let i="_onData"+un(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...o)}),r}})})}function Gi(n,t){let e=n._chartjs;if(!e)return;let i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ho.forEach(o=>{delete n[o]}),delete n._chartjs)}function fo(n){let t=new Set(n);return t.size===n.length?n:Array.from(t)}var Ki=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Zi(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Ki.call(window,()=>{i=!1,n.apply(t,e)}))}}function po(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}var go=n=>n==="start"?"left":n==="end"?"right":"center",Ji=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2;function mo(n,t,e){let i=t.length,s=0,o=i;if(n._sorted){let{iScale:r,vScale:a,_parsed:c}=n,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,h=r.axis,{min:u,max:d,minDefined:f,maxDefined:g}=r.getUserBounds();if(f){if(s=Math.min(At(c,h,u).lo,e?i:At(t,h,r.getPixelForValue(u)).lo),l){let m=c.slice(0,s+1).reverse().findIndex(p=>!R(p[a.axis]));s-=Math.max(0,m)}s=at(s,0,i-1)}if(g){let m=Math.max(At(c,r.axis,d,!0).hi+1,e?0:At(t,h,r.getPixelForValue(d),!0).hi+1);if(l){let p=c.slice(m-1).findIndex(b=>!R(b[a.axis]));m+=Math.max(0,p)}o=at(m,s,i)-s}else o=i-s}return{start:s,count:o}}function bo(n){let{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;let o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}var sn=n=>n===0||n===1,qs=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*X/e)),$s=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*X/e)+1,Jt={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*G)+1,easeOutSine:n=>Math.sin(n*G),easeInOutSine:n=>-.5*(Math.cos(H*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=>sn(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=>sn(n)?n:qs(n,.075,.3),easeOutElastic:n=>sn(n)?n:$s(n,.075,.3),easeInOutElastic(n){return sn(n)?n:n<.5?.5*qs(n*2,.1125,.45):.5+.5*$s(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-Jt.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?Jt.easeInBounce(n*2)*.5:Jt.easeOutBounce(n*2-1)*.5+.5};function ts(n){if(n&&typeof n=="object"){let t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function es(n){return ts(n)?n:new Pe(n)}function Yi(n){return ts(n)?n:new Pe(n).saturate(.5).darken(.1).hexString()}var Oc=["x","y","borderWidth","radius","tension"],Sc=["color","borderColor","backgroundColor"];function Tc(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:Sc},numbers:{type:"number",properties:Oc}}),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 Cc(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Xs=new Map;function Ac(n,t){t=t||{};let e=n+JSON.stringify(t),i=Xs.get(e);return i||(i=new Intl.NumberFormat(n,t),Xs.set(e,i)),i}function oe(n,t,e){return Ac(t,e).format(n)}var xo={values(n){return N(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";let i=this.chart.options.locale,s,o=n;if(e.length>1){let l=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(l<1e-4||l>1e15)&&(s="scientific"),o=Lc(n,e)}let r=_t(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),oe(n,i,c)},logarithmic(n,t,e){if(n===0)return"0";let i=e[t].significand||n/Math.pow(10,Math.floor(_t(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?xo.numeric.call(this,n,t,e):""}};function Lc(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 Ie={formatters:xo};function Ic(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:Ie.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"})}var It=Object.create(null),pn=Object.create(null);function Se(n,t){if(!t)return n;let e=t.split(".");for(let i=0,s=e.length;i<s;++i){let o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function Vi(n,t,e){return typeof t=="string"?te(Se(n,t),e):te(Se(n,""),t)}var ji=class{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)=>Yi(s.backgroundColor),this.hoverBorderColor=(i,s)=>Yi(s.borderColor),this.hoverColor=(i,s)=>Yi(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 Vi(this,t,e)}get(t){return Se(this,t)}describe(t,e){return Vi(pn,t,e)}override(t,e){return Vi(It,t,e)}route(t,e,i,s){let o=Se(this,t),r=Se(this,i),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let c=this[a],l=r[s];return L(c)?Object.assign({},l,c):F(c,l)},set(c){this[a]=c}}})}apply(t){t.forEach(e=>e(this))}},W=new ji({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Tc,Cc,Ic]);function Ec(n){return!n||R(n.size)||R(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Te(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 yo(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,a=e.length,c,l,h,u,d;for(c=0;c<a;c++)if(u=e[c],u!=null&&!N(u))r=Te(n,s,o,r,u);else if(N(u))for(l=0,h=u.length;l<h;l++)d=u[l],d!=null&&!N(d)&&(r=Te(n,s,o,r,d));n.restore();let f=o.length/2;if(f>e.length){for(c=0;c<f;c++)delete s[o[c]];o.splice(0,f)}return r}function Et(n,t,e){let i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function ns(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function gn(n,t,e,i){_o(n,t,e,i,null)}function _o(n,t,e,i,s){let o,r,a,c,l,h,u,d,f=t.pointStyle,g=t.rotation,m=t.radius,p=(g||0)*vc;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(p),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(m)||m<=0)){switch(n.beginPath(),f){default:s?n.ellipse(e,i,s/2,m,0,0,X):n.arc(e,i,m,0,X),n.closePath();break;case"triangle":h=s?s/2:m,n.moveTo(e+Math.sin(p)*h,i-Math.cos(p)*m),p+=js,n.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*m),p+=js,n.lineTo(e+Math.sin(p)*h,i-Math.cos(p)*m),n.closePath();break;case"rectRounded":l=m*.516,c=m-l,r=Math.cos(p+Nt)*c,u=Math.cos(p+Nt)*(s?s/2-l:c),a=Math.sin(p+Nt)*c,d=Math.sin(p+Nt)*(s?s/2-l:c),n.arc(e-u,i-a,l,p-H,p-G),n.arc(e+d,i-r,l,p-G,p),n.arc(e+u,i+a,l,p,p+G),n.arc(e-d,i+r,l,p+G,p+H),n.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*m,h=s?s/2:c,n.rect(e-h,i-c,2*h,2*c);break}p+=Nt;case"rectRot":u=Math.cos(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),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":p+=Nt;case"cross":u=Math.cos(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),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(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),n.moveTo(e-u,i-a),n.lineTo(e+u,i+a),n.moveTo(e+d,i-r),n.lineTo(e-d,i+r),p+=Nt,u=Math.cos(p)*(s?s/2:m),r=Math.cos(p)*m,a=Math.sin(p)*m,d=Math.sin(p)*(s?s/2:m),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(p)*m,a=Math.sin(p)*m,n.moveTo(e-r,i-a),n.lineTo(e+r,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(p)*(s?s/2:m),i+Math.sin(p)*m);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ft(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 is(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function ss(n){n.restore()}function wo(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){let 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 Mo(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 Fc(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),R(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 Rc(n,t,e,i,s){if(s.strikethrough||s.underline){let o=n.measureText(i),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,c=e-o.actualBoundingBoxAscent,l=e+o.actualBoundingBoxDescent,h=s.strikethrough?(c+l)/2:l;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(r,h),n.lineTo(a,h),n.stroke()}}function zc(n,t){let e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Ee(n,t,e,i,s,o={}){let r=N(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",c,l;for(n.save(),n.font=s.string,Fc(n,o),c=0;c<r.length;++c)l=r[c],o.backdrop&&zc(n,o.backdrop),a&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),R(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(l,e,i,o.maxWidth)),n.fillText(l,e,i,o.maxWidth),Rc(n,e,i,l,o),i+=Number(s.lineHeight);n.restore()}function mn(n,t){let{x:e,y:i,w:s,h:o,radius:r}=t;n.arc(e+r.topLeft,i+r.topLeft,r.topLeft,1.5*H,H,!0),n.lineTo(e,i+o-r.bottomLeft),n.arc(e+r.bottomLeft,i+o-r.bottomLeft,r.bottomLeft,H,G,!0),n.lineTo(e+s-r.bottomRight,i+o),n.arc(e+s-r.bottomRight,i+o-r.bottomRight,r.bottomRight,G,0,!0),n.lineTo(e+s,i+r.topRight),n.arc(e+s-r.topRight,i+r.topRight,r.topRight,0,-G,!0),n.lineTo(e+r.topLeft,i)}var Wc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Nc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Bc(n,t){let e=(""+n).match(Wc);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}var Hc=n=>+n||0;function os(n,t){let e={},i=L(t),s=i?Object.keys(t):t,o=L(n)?i?r=>F(n[r],n[t[r]]):r=>n[r]:()=>n;for(let r of s)e[r]=Hc(o(r));return e}function ko(n){return os(n,{top:"y",right:"x",bottom:"y",left:"x"})}function re(n){return os(n,["topLeft","topRight","bottomLeft","bottomRight"])}function it(n){let t=ko(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Z(n,t){n=n||{},t=t||W.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(Nc)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);let s={family:F(n.family,t.family),lineHeight:Bc(F(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:F(n.weight,t.weight),string:""};return s.string=Ec(s),s}function Fe(n,t,e,i){let s=!0,o,r,a;for(o=0,r=n.length;o<r;++o)if(a=n[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&N(a)&&(a=a[e%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function vo(n,t,e){let{min:i,max:s}=n,o=qi(t,(s-i)/2),r=(a,c)=>e&&a===0?0:a+c;return{min:r(i,-Math.abs(o)),max:r(s,o)}}function wt(n,t){return Object.assign(Object.create(n),t)}function bn(n,t=[""],e,i,s=()=>n[0]){let o=e||n;typeof i>"u"&&(i=Oo("_fallback",n));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:a=>bn([a,...n],t,o,i)};return new Proxy(r,{deleteProperty(a,c){return delete a[c],delete a._keys,delete n[0][c],!0},get(a,c){return Do(a,c,()=>Qc(c,t,n,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,c){return Qs(a).includes(c)},ownKeys(a){return Qs(a)},set(a,c,l){let h=a._storage||(a._storage=s());return a[c]=h[c]=l,delete a._keys,!0}})}function Yt(n,t,e,i){let s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:rs(n,i),setContext:o=>Yt(n,o,e,i),override:o=>Yt(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 Do(o,r,()=>Vc(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 rs(n,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:yt(e)?e:()=>e,isIndexable:yt(i)?i:()=>i}}var Yc=(n,t)=>n?n+un(t):t,as=(n,t)=>L(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Do(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];let i=e();return n[t]=i,i}function Vc(n,t,e){let{_proxy:i,_context:s,_subProxy:o,_descriptors:r}=n,a=i[t];return yt(a)&&r.isScriptable(t)&&(a=jc(t,a,n,e)),N(a)&&a.length&&(a=qc(t,a,n,r.isIndexable)),as(t,a)&&(a=Yt(a,s,o&&o[t],r)),a}function jc(n,t,e,i){let{_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 c=t(o,r||i);return a.delete(n),as(n,c)&&(c=cs(s._scopes,s,n,c)),c}function qc(n,t,e,i){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(L(t[0])){let c=t,l=s._scopes.filter(h=>h!==c);t=[];for(let h of c){let u=cs(l,s,n,h);t.push(Yt(u,o,r&&r[n],a))}}return t}function Po(n,t,e){return yt(n)?n(t,e):n}var $c=(n,t)=>n===!0?t:typeof n=="string"?Vt(t,n):void 0;function Xc(n,t,e,i,s){for(let o of t){let r=$c(e,o);if(r){n.add(r);let a=Po(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 cs(n,t,e,i){let s=t._rootScopes,o=Po(t._fallback,e,i),r=[...n,...s],a=new Set;a.add(i);let c=Us(a,r,e,o||e,i);return c===null||typeof o<"u"&&o!==e&&(c=Us(a,r,o,c,i),c===null)?!1:bn(Array.from(a),[""],s,o,()=>Uc(t,e,i))}function Us(n,t,e,i,s){for(;e;)e=Xc(n,t,e,i,s);return e}function Uc(n,t,e){let i=n._getTarget();t in i||(i[t]={});let s=i[t];return N(s)&&L(e)?e:s||{}}function Qc(n,t,e,i){let s;for(let o of t)if(s=Oo(Yc(o,n),e),typeof s<"u")return as(n,s)?cs(e,i,n,s):s}function Oo(n,t){for(let e of t){if(!e)continue;let i=e[n];if(typeof i<"u")return i}}function Qs(n){let t=n._keys;return t||(t=n._keys=Gc(n._scopes)),t}function Gc(n){let t=new Set;for(let e of n)for(let i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function So(n,t,e,i){let{iScale:s}=n,{key:o="r"}=this._parsing,r=new Array(i),a,c,l,h;for(a=0,c=i;a<c;++a)l=a+e,h=t[l],r[a]={r:s.parse(Vt(h,o),l)};return r}var Kc=Number.EPSILON||1e-14,ee=(n,t)=>t<n.length&&!n[t].skip&&n[t],To=n=>n==="x"?"y":"x";function Zc(n,t,e,i){let s=n.skip?t:n,o=t,r=e.skip?t:e,a=ln(o,s),c=ln(r,o),l=a/(a+c),h=c/(a+c);l=isNaN(l)?0:l,h=isNaN(h)?0:h;let u=i*l,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 Jc(n,t,e){let i=n.length,s,o,r,a,c,l=ee(n,0);for(let h=0;h<i-1;++h)if(c=l,l=ee(n,h+1),!(!c||!l)){if(ie(t[h],0,Kc)){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 tl(n,t,e="x"){let i=To(e),s=n.length,o,r,a,c=ee(n,0);for(let l=0;l<s;++l){if(r=a,a=c,c=ee(n,l+1),!a)continue;let h=a[e],u=a[i];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${i}`]=u-o*t[l]),c&&(o=(c[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${i}`]=u+o*t[l])}}function el(n,t="x"){let e=To(t),i=n.length,s=Array(i).fill(0),o=Array(i),r,a,c,l=ee(n,0);for(r=0;r<i;++r)if(a=c,c=l,l=ee(n,r+1),!!c){if(l){let h=l[t]-c[t];s[r]=h!==0?(l[e]-c[e])/h:0}o[r]=a?l?Ht(s[r-1])!==Ht(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Jc(n,s,o),tl(n,o,t)}function on(n,t,e){return Math.max(Math.min(n,e),t)}function nl(n,t){let e,i,s,o,r,a=ft(n[0],t);for(e=0,i=n.length;e<i;++e)r=o,o=a,a=e<i-1&&ft(n[e+1],t),o&&(s=n[e],r&&(s.cp1x=on(s.cp1x,t.left,t.right),s.cp1y=on(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=on(s.cp2x,t.left,t.right),s.cp2y=on(s.cp2y,t.top,t.bottom)))}function Co(n,t,e,i,s){let o,r,a,c;if(t.spanGaps&&(n=n.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")el(n,s);else{let l=i?n[n.length-1]:n[0];for(o=0,r=n.length;o<r;++o)a=n[o],c=Zc(l,a,n[Math.min(o+1,r-(i?0:1))%r],t.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,l=a}t.capBezierPoints&&nl(n,e)}function xn(){return typeof window<"u"&&typeof document<"u"}function yn(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function hn(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}var _n=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function il(n,t){return _n(n).getPropertyValue(t)}var sl=["top","right","bottom","left"];function Bt(n,t,e){let i={};e=e?"-"+e:"";for(let s=0;s<4;s++){let o=sl[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var ol=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function rl(n,t){let e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i,r=!1,a,c;if(ol(s,o,n.target))a=s,c=o;else{let l=t.getBoundingClientRect();a=i.clientX-l.left,c=i.clientY-l.top,r=!0}return{x:a,y:c,box:r}}function Ft(n,t){if("native"in n)return n;let{canvas:e,currentDevicePixelRatio:i}=t,s=_n(e),o=s.boxSizing==="border-box",r=Bt(s,"padding"),a=Bt(s,"border","width"),{x:c,y:l,box:h}=rl(n,e),u=r.left+(h&&a.left),d=r.top+(h&&a.top),{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((c-u)/f*e.width/i),y:Math.round((l-d)/g*e.height/i)}}function al(n,t,e){let i,s;if(t===void 0||e===void 0){let o=n&&yn(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{let r=o.getBoundingClientRect(),a=_n(o),c=Bt(a,"border","width"),l=Bt(a,"padding");t=r.width-l.width-c.width,e=r.height-l.height-c.height,i=hn(a.maxWidth,o,"clientWidth"),s=hn(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||cn,maxHeight:s||cn}}var Lt=n=>Math.round(n*10)/10;function Ao(n,t,e,i){let s=_n(n),o=Bt(s,"margin"),r=hn(s.maxWidth,n,"clientWidth")||cn,a=hn(s.maxHeight,n,"clientHeight")||cn,c=al(n,t,e),{width:l,height:h}=c;if(s.boxSizing==="content-box"){let d=Bt(s,"border","width"),f=Bt(s,"padding");l-=f.width+d.width,h-=f.height+d.height}return l=Math.max(0,l-o.width),h=Math.max(0,i?l/i:h-o.height),l=Lt(Math.min(l,r,c.maxWidth)),h=Lt(Math.min(h,a,c.maxHeight)),l&&!h&&(h=Lt(l/2)),(t!==void 0||e!==void 0)&&i&&c.height&&h>c.height&&(h=c.height,l=Lt(Math.floor(h*i))),{width:l,height:h}}function ls(n,t,e){let i=t||1,s=Lt(n.height*i),o=Lt(n.width*i);n.height=Lt(n.height),n.width=Lt(n.width);let 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}var Lo=(function(){let n=!1;try{let t={get passive(){return n=!0,!1}};xn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n})();function hs(n,t){let e=il(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ct(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Io(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 Eo(n,t,e,i){let s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ct(n,s,e),a=Ct(s,o,e),c=Ct(o,t,e),l=Ct(r,a,e),h=Ct(a,c,e);return Ct(l,h,e)}var cl=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}}},ll=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function wn(n,t,e){return n?cl(t,e):ll()}function Fo(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 Ro(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function zo(n){return n==="angle"?{between:Le,compare:Pc,normalize:rt}:{between:ao,compare:(t,e)=>t-e,normalize:t=>t}}function Gs({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 hl(n,t,e){let{property:i,start:s,end:o}=e,{between:r,normalize:a}=zo(i),c=t.length,{start:l,end:h,loop:u}=n,d,f;if(u){for(l+=c,h+=c,d=0,f=c;d<f&&r(a(t[l%c][i]),s,o);++d)l--,h--;l%=c,h%=c}return h<l&&(h+=c),{start:l,end:h,loop:u,style:n.style}}function Wo(n,t,e){if(!e)return[n];let{property:i,start:s,end:o}=e,r=t.length,{compare:a,between:c,normalize:l}=zo(i),{start:h,end:u,loop:d,style:f}=hl(n,t,e),g=[],m=!1,p=null,b,x,M,w=()=>c(s,M,b)&&a(s,M)!==0,y=()=>a(o,b)===0||c(o,M,b),P=()=>m||w(),v=()=>!m||y();for(let D=h,C=h;D<=u;++D)x=t[D%r],!x.skip&&(b=l(x[i]),b!==M&&(m=c(b,s,o),p===null&&P()&&(p=a(b,s)===0?D:C),p!==null&&v()&&(g.push(Gs({start:p,end:D,loop:d,count:r,style:f})),p=null),C=D,M=b));return p!==null&&g.push(Gs({start:p,end:u,loop:d,count:r,style:f})),g}function No(n,t){let e=[],i=n.segments;for(let s=0;s<i.length;s++){let o=Wo(i[s],n.points,t);o.length&&e.push(...o)}return e}function ul(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 dl(n,t,e,i){let s=n.length,o=[],r=t,a=n[t],c;for(c=t+1;c<=e;++c){let l=n[c%s];l.skip||l.stop?a.skip||(i=!1,o.push({start:t%s,end:(c-1)%s,loop:i}),t=r=l.stop?c:null):(r=c,a.skip&&(t=c)),a=l}return r!==null&&o.push({start:t%s,end:r%s,loop:i}),o}function Bo(n,t){let e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];let o=!!n._loop,{start:r,end:a}=ul(e,s,o,i);if(i===!0)return Ks(n,[{start:r,end:a,loop:o}],e,t);let c=a<r?a+s:a,l=!!n._fullLoop&&r===0&&a===s-1;return Ks(n,dl(e,r,c,l),e,t)}function Ks(n,t,e,i){return!i||!i.setContext||!e?t:fl(n,t,e,i)}function fl(n,t,e,i){let s=n._chart.getContext(),o=Zs(n.options),{_datasetIndex:r,options:{spanGaps:a}}=n,c=e.length,l=[],h=o,u=t[0].start,d=u;function f(g,m,p,b){let x=a?-1:1;if(g!==m){for(g+=c;e[g%c].skip;)g-=x;for(;e[m%c].skip;)m+=x;g%c!==m%c&&(l.push({start:g%c,end:m%c,loop:p,style:b}),h=b,u=m%c)}}for(let g of t){u=a?u:g.start;let m=e[u%c],p;for(d=u+1;d<=g.end;d++){let b=e[d%c];p=Zs(i.setContext(wt(s,{type:"segment",p0:m,p1:b,p0DataIndex:(d-1)%c,p1DataIndex:d%c,datasetIndex:r}))),pl(p,h)&&f(u,d-1,g.loop,h),m=b,h=p}u<d-1&&f(u,d-1,g.loop,h)}return l}function Zs(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function pl(n,t){if(!t)return!1;let e=[],i=function(s,o){return ts(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function rn(n,t,e){return n.options.clip?n[e]:t[e]}function gl(n,t){let{xScale:e,yScale:i}=n;return e&&i?{left:rn(e,t,"left"),right:rn(e,t,"right"),top:rn(i,t,"top"),bottom:rn(i,t,"bottom")}:t}function Ho(n,t){let e=t._clip;if(e.disabled)return!1;let i=gl(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}var bs=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){let 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=Ki.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;let o=i.items,r=o.length-1,a=!1,c;for(;r>=0;--r)c=o[r],c._active?(c._total>i.duration&&(i.duration=c._total),c.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){let e=this._charts,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){let 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;let e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let i=e.items,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)}},Mt=new bs,Yo="transparent",ml={boolean(n,t,e){return e>.5?t:n},color(n,t,e){let i=es(n||Yo),s=i.valid&&es(t||Yo);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}},xs=class{constructor(t,e,i,s){let o=e[i];s=Fe([t.to,s,o,t.from]);let r=Fe([t.from,o,s]);this._active=!0,this._fn=t.fn||ml[t.type||typeof r],this._easing=Jt[t.easing]||Jt.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);let 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=Fe([t.to,e,s,t.from]),this._from=Fe([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,i=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,c;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}c=e/i%2,c=r&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[s]=this._fn(o,a,c)}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){let e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}},Cn=class{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!L(t))return;let e=Object.keys(W.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!L(o))return;let r={};for(let a of e)r[a]=o[a];(N(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){let i=e.options,s=xl(t,i);if(!s)return[];let o=this._createAnimations(s,i);return i.$shared&&bl(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){let i=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now(),c;for(c=r.length-1;c>=0;--c){let l=r[c];if(l.charAt(0)==="$")continue;if(l==="options"){s.push(...this._animateOptions(t,e));continue}let h=e[l],u=o[l],d=i.get(l);if(u)if(d&&u.active()){u.update(d,h,a);continue}else u.cancel();if(!d||!d.duration){t[l]=h;continue}o[l]=u=new xs(d,t,l,h),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}let i=this._createAnimations(t,e);if(i.length)return Mt.add(this._chart,i),!0}};function bl(n,t){let e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){let o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function xl(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 Vo(n,t){let 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 yl(n,t,e){if(e===!1)return!1;let i=Vo(n,e),s=Vo(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function _l(n){let t,e,i,s;return L(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 Ir(n,t){let e=[],i=n._getSortedDatasetMetas(t),s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function jo(n,t,e,i={}){let s=n.keys,o=i.mode==="single",r,a,c,l;if(t===null)return;let h=!1;for(r=0,a=s.length;r<a;++r){if(c=+s[r],c===e){if(h=!0,i.all)continue;break}l=n.values[c],$(l)&&(o||t===0||Ht(t)===Ht(l))&&(t+=l)}return!h&&!i.all?0:t}function wl(n,t){let{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),c,l,h;for(c=0,l=r.length;c<l;++c)h=r[c],a[c]={[s]:h,[o]:n[h]};return a}function us(n,t){let e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Ml(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function kl(n){let{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function vl(n,t,e){let i=n[t]||(n[t]={});return i[e]||(i[e]={})}function qo(n,t,e,i){for(let s of t.getMatchingVisibleMetas(i).reverse()){let o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function $o(n,t){let{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,c=o.axis,l=r.axis,h=Ml(o,r,i),u=t.length,d;for(let f=0;f<u;++f){let g=t[f],{[c]:m,[l]:p}=g,b=g._stacks||(g._stacks={});d=b[l]=vl(s,h,m),d[a]=p,d._top=qo(d,r,!0,i.type),d._bottom=qo(d,r,!1,i.type);let x=d._visualValues||(d._visualValues={});x[a]=p}}function ds(n,t){let e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Dl(n,t){return wt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Pl(n,t,e){return wt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Re(n,t){let e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(let s of t){let 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]}}}var fs=n=>n==="reset"||n==="none",Xo=(n,t)=>t?n:Object.assign({},n),Ol=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Ir(e,!0),values:null},ce=class{static defaults={};static datasetElementType=null;static dataElementType=null;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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=us(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&&Re(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(u,d,f,g)=>u==="x"?d:u==="r"?g:f,o=e.xAxisID=F(i.xAxisID,ds(t,"x")),r=e.yAxisID=F(i.yAxisID,ds(t,"y")),a=e.rAxisID=F(i.rAxisID,ds(t,"r")),c=e.indexAxis,l=e.iAxisID=s(c,o,r,a),h=e.vAxisID=s(c,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Gi(this._data,this),t._stacked&&Re(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(L(e)){let s=this._cachedMeta;this._data=wl(e,s)}else if(i!==e){if(i){Gi(i,this);let s=this._cachedMeta;Re(s),s._parsed=[]}e&&Object.isExtensible(e)&&uo(e,this),this._syncList=[],this._data=e}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let e=this._cachedMeta,i=this.getDataset(),s=!1;this._dataCheck();let o=e._stacked;e._stacked=us(e.vScale,e),e.stack!==i.stack&&(s=!0,Re(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&($o(this,e._parsed),e._stacked=us(e.vScale,e))}configure(){let 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){let{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:r}=i,a=o.axis,c=t===0&&e===s.length?!0:i._sorted,l=t>0&&i._parsed[t-1],h,u,d;if(this._parsing===!1)i._parsed=s,i._sorted=!0,d=s;else{N(s[t])?d=this.parseArrayData(i,s,t,e):L(s[t])?d=this.parseObjectData(i,s,t,e):d=this.parsePrimitiveData(i,s,t,e);let f=()=>u[a]===null||l&&u[a]<l[a];for(h=0;h<e;++h)i._parsed[h+t]=u=d[h],c&&(f()&&(c=!1),l=u);i._sorted=c}r&&$o(this,d)}parsePrimitiveData(t,e,i,s){let{iScale:o,vScale:r}=t,a=o.axis,c=r.axis,l=o.getLabels(),h=o===r,u=new Array(s),d,f,g;for(d=0,f=s;d<f;++d)g=d+i,u[d]={[a]:h||o.parse(l[g],g),[c]:r.parse(e[g],g)};return u}parseArrayData(t,e,i,s){let{xScale:o,yScale:r}=t,a=new Array(s),c,l,h,u;for(c=0,l=s;c<l;++c)h=c+i,u=e[h],a[c]={x:o.parse(u[0],h),y:r.parse(u[1],h)};return a}parseObjectData(t,e,i,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:c="y"}=this._parsing,l=new Array(s),h,u,d,f;for(h=0,u=s;h<u;++h)d=h+i,f=e[d],l[h]={x:o.parse(Vt(f,a),d),y:r.parse(Vt(f,c),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){let s=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:Ir(s,!0),values:e._stacks[t.axis]._visualValues};return jo(a,r,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){let o=i[e.axis],r=o===null?NaN:o,a=s&&i._stacks[e.axis];s&&a&&(s.values=a,r=jo(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){let i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,r=s.length,a=this._getOtherScale(t),c=Ol(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=kl(a),d,f;function g(){f=s[d];let m=f[a.axis];return!$(f[t.axis])||h>m||u<m}for(d=0;d<r&&!(!g()&&(this.updateRangeFromParsed(l,t,f,c),o));++d);if(o){for(d=r-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(l,t,f,c);break}}return l}getAllParsedValues(t){let e=this._cachedMeta._parsed,i=[],s,o,r;for(s=0,o=e.length;s<o;++s)r=e[s][t.axis],$(r)&&i.push(r);return i}getMaxOverflow(){return!1}getLabelAndValue(t){let 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){let e=this._cachedMeta;this.update(t||"default"),e._clip=_l(F(this.options.clip,yl(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,r=[],a=this._drawStart||0,c=this._drawCount||s.length-a,l=this.options.drawActiveElementsOnTop,h;for(i.dataset&&i.dataset.draw(t,o,a,c),h=a;h<a+c;++h){let u=s[h];u.hidden||(u.active&&l?r.push(u):u.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){let i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=Pl(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=Dl(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){let s=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],c=this.enableOptionSharing&&Ae(i);if(a)return Xo(a,c);let l=this.chart.config,h=l.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),h),f=Object.keys(W.elements[t]),g=()=>this.getContext(i,s,e),m=l.resolveNamedOptions(d,f,g,u);return m.$shared&&(m.$shared=c,o[r]=Object.freeze(Xo(m,c))),m}_resolveAnimations(t,e,i){let s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let c;if(s.options.animation!==!1){let h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),d=h.getOptionScopes(this.getDataset(),u);c=h.createResolver(d,this.getContext(t,i,e))}let l=new Cn(s,c&&c.animations);return c&&c._cacheable&&(o[r]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||fs(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let 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){fs(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!fs(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;let 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(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,i=this._cachedMeta.data;for(let[a,c,l]of this._syncList)this[a](c,l);this._syncList=[];let 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){let s=this._cachedMeta,o=s.data,r=t+e,a,c=l=>{for(l.length+=e,a=l.length-1;a>=r;a--)l[a]=l[a-e]};for(c(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&c(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){let i=this._cachedMeta;if(this._parsing){let s=i._parsed.splice(t,e);i._stacked&&Re(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);let i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};function Sl(n,t,e){let i=1,s=1,o=0,r=0;if(t<X){let a=n,c=a+t,l=Math.cos(a),h=Math.sin(a),u=Math.cos(c),d=Math.sin(c),f=(M,w,y)=>Le(M,a,c,!0)?1:Math.max(w,w*e,y,y*e),g=(M,w,y)=>Le(M,a,c,!0)?-1:Math.min(w,w*e,y,y*e),m=f(0,l,u),p=f(G,h,d),b=g(H,l,u),x=g(H+G,h,d);i=(m-b)/2,s=(p-x)/2,o=-(m+b)/2,r=-(p+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:r}}var ys=class extends ce{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((c,l)=>{let u=t.getDatasetMeta(0).controller.getStyle(l);return{text:c,fillStyle:u.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(l),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:i,borderRadius:r&&(a||u.borderRadius),index:l}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}};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){let i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=c=>+i[c];if(L(i[t])){let{key:c="value"}=this._parsing;o=l=>+Vt(i[l],c)}let r,a;for(r=t,a=t+e;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return ct(this.options.rotation-90)}_getCircumference(){return ct(this.options.circumference)}_getRotationExtents(){let t=X,e=-X;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){let 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){let 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),c=Math.min(to(this.options.cutout,a),1),l=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:d,ratioY:f,offsetX:g,offsetY:m}=Sl(u,h,c),p=(i.width-r)/d,b=(i.height-r)/f,x=Math.max(Math.min(p,b)/2,0),M=qi(this.options.radius,x),w=Math.max(M*c,0),y=(M-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*M,this.offsetY=m*M,s.total=this.calculateTotal(),this.outerRadius=M-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){let 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/X)}updateElements(t,e,i,s){let o=s==="reset",r=this.chart,a=r.chartArea,l=r.options.animation,h=(a.left+a.right)/2,u=(a.top+a.bottom)/2,d=o&&l.animateScale,f=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:m,includeOptions:p}=this._getSharedOptions(e,s),b=this._getRotation(),x;for(x=0;x<e;++x)b+=this._circumference(x,o);for(x=e;x<e+i;++x){let M=this._circumference(x,o),w=t[x],y={x:h+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+M,circumference:M,outerRadius:g,innerRadius:f};p&&(y.options=m||this.resolveDataElementOptions(x,w.active?"active":s)),b+=M,this.updateElement(w,x,y,s)}}calculateTotal(){let t=this._cachedMeta,e=t.data,i=0,s;for(s=0;s<e.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){let e=this._cachedMeta.total;return e>0&&!isNaN(t)?X*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=oe(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0,i=this.chart,s,o,r,a,c;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)c=a.resolveDataElementOptions(s),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){let 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}},An=class extends ce{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled,{start:a,count:c}=mo(e,s,r);this._drawStart=a,this._drawCount=c,bo(e)&&(a=0,c=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;let l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:l},t),this.updateElements(s,a,c,t)}updateElements(t,e,i,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),d=r.axis,f=a.axis,{spanGaps:g,segment:m}=this.options,p=se(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",x=e+i,M=t.length,w=e>0&&this.getParsed(e-1);for(let y=0;y<M;++y){let P=t[y],v=b?P:{};if(y<e||y>=x){v.skip=!0;continue}let D=this.getParsed(y),C=R(D[f]),Y=v[d]=r.getPixelForValue(D[d],y),V=v[f]=o||C?a.getBasePixel():a.getPixelForValue(c?this.applyStack(a,D,c):D[f],y);v.skip=isNaN(Y)||isNaN(V)||C,v.stop=y>0&&Math.abs(D[d]-w[d])>p,m&&(v.parsed=D,v.raw=l.data[y]),u&&(v.options=h||this.resolveDataElementOptions(y,P.active?"active":s)),b||this.updateElement(P,y,v,s),w=D}}getMaxOverflow(){let t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;let 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(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}},_s=class extends ce{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:s,lineWidth:c.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}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=oe(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return So.bind(this)(t,e,i,s)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{let 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(){let 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){let o=s==="reset",r=this.chart,c=r.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,u=l.yCenter,d=l.getIndexAngle(0)-.5*H,f=d,g,m=360/this.countVisibleElements();for(g=0;g<e;++g)f+=this._computeAngle(g,s,m);for(g=e;g<e+i;g++){let p=t[g],b=f,x=f+this._computeAngle(g,s,m),M=r.getDataVisibility(g)?l.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=x,o&&(c.animateScale&&(M=0),c.animateRotate&&(b=x=d));let w={x:h,y:u,innerRadius:0,outerRadius:M,startAngle:b,endAngle:x,options:this.resolveDataElementOptions(g,p.active?"active":s)};this.updateElement(p,g,w,s)}}countVisibleElements(){let t=this._cachedMeta,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)?ct(this.resolveDataElementOptions(t,e).angle||i):0}};function jt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var ws=class n{static override(t){Object.assign(n.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return jt()}parse(){return jt()}format(){return jt()}add(){return jt()}diff(){return jt()}startOf(){return jt()}endOf(){return jt()}},Ls={_date:ws};function Tl(n,t,e,i){let{controller:s,data:o,_sorted:r}=n,a=s._cachedMeta.iScale,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let l=a._reversePixels?co:At;if(i){if(s._sharedOptions){let h=o[0],u=typeof h.getRange=="function"&&h.getRange(t);if(u){let d=l(o,t,e-u),f=l(o,t,e+u);return{lo:d.lo,hi:f.hi}}}}else{let h=l(o,t,e);if(c){let{vScale:u}=s._cachedMeta,{_parsed:d}=n,f=d.slice(0,h.lo+1).reverse().findIndex(m=>!R(m[u.axis]));h.lo-=Math.max(0,f);let g=d.slice(h.hi).findIndex(m=>!R(m[u.axis]));h.hi+=Math.max(0,g)}return h}}return{lo:0,hi:o.length-1}}function qe(n,t,e,i,s){let o=n.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,c=o.length;a<c;++a){let{index:l,data:h}=o[a],{lo:u,hi:d}=Tl(o[a],t,r,s);for(let f=u;f<=d;++f){let g=h[f];g.skip||i(g,l,f)}}}function Cl(n){let t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){let 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 ps(n,t,e,i,s){let o=[];return!s&&!n.isPointInArea(t)||qe(n,e,t,function(a,c,l){!s&&!ft(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&o.push({element:a,datasetIndex:c,index:l})},!0),o}function Al(n,t,e,i){let s=[];function o(r,a,c){let{startAngle:l,endAngle:h}=r.getProps(["startAngle","endAngle"],i),{angle:u}=oo(r,{x:t.x,y:t.y});Le(u,l,h)&&s.push({element:r,datasetIndex:a,index:c})}return qe(n,e,t,o),s}function Ll(n,t,e,i,s,o){let r=[],a=Cl(e),c=Number.POSITIVE_INFINITY;function l(h,u,d){let f=h.inRange(t.x,t.y,s);if(i&&!f)return;let g=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(g))&&!f)return;let p=a(t,g);p<c?(r=[{element:h,datasetIndex:u,index:d}],c=p):p===c&&r.push({element:h,datasetIndex:u,index:d})}return qe(n,e,t,l),r}function gs(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Al(n,t,e,s):Ll(n,t,e,i,s,o)}function Uo(n,t,e,i,s){let o=[],r=e==="x"?"inXRange":"inYRange",a=!1;return qe(n,e,t,(c,l,h)=>{c[r]&&c[r](t[e],s)&&(o.push({element:c,datasetIndex:l,index:h}),a=a||c.inRange(t.x,t.y,s))}),i&&!a?[]:o}var Il={evaluateInteractionItems:qe,modes:{index(n,t,e,i){let s=Ft(t,n),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?ps(n,s,o,i,r):gs(n,s,o,!1,i,r),c=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(l=>{let h=a[0].index,u=l.data[h];u&&!u.skip&&c.push({element:u,datasetIndex:l.index,index:h})}),c):[]},dataset(n,t,e,i){let s=Ft(t,n),o=e.axis||"xy",r=e.includeInvisible||!1,a=e.intersect?ps(n,s,o,i,r):gs(n,s,o,!1,i,r);if(a.length>0){let c=a[0].datasetIndex,l=n.getDatasetMeta(c).data;a=[];for(let h=0;h<l.length;++h)a.push({element:l[h],datasetIndex:c,index:h})}return a},point(n,t,e,i){let s=Ft(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return ps(n,s,o,i,r)},nearest(n,t,e,i){let s=Ft(t,n),o=e.axis||"xy",r=e.includeInvisible||!1;return gs(n,s,o,e.intersect,i,r)},x(n,t,e,i){let s=Ft(t,n);return Uo(n,s,"x",e.intersect,i)},y(n,t,e,i){let s=Ft(t,n);return Uo(n,s,"y",e.intersect,i)}}},Er=["left","top","right","bottom"];function ze(n,t){return n.filter(e=>e.pos===t)}function Qo(n,t){return n.filter(e=>Er.indexOf(e.pos)===-1&&e.box.axis===t)}function We(n,t){return n.sort((e,i)=>{let s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function El(n){let t=[],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 Fl(n){let t={};for(let e of n){let{stack:i,pos:s,stackWeight:o}=e;if(!i||!Er.includes(s))continue;let r=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Rl(n,t){let e=Fl(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=n.length;o<r;++o){a=n[o];let{fullSize:c}=a.box,l=e[a.stack],h=l&&a.stackWeight/l.weight;a.horizontal?(a.width=h?h*i:c&&t.availableWidth,a.height=s):(a.width=i,a.height=h?h*s:c&&t.availableHeight)}return e}function zl(n){let t=El(n),e=We(t.filter(l=>l.box.fullSize),!0),i=We(ze(t,"left"),!0),s=We(ze(t,"right")),o=We(ze(t,"top"),!0),r=We(ze(t,"bottom")),a=Qo(t,"x"),c=Qo(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(c).concat(r).concat(a),chartArea:ze(t,"chartArea"),vertical:i.concat(s).concat(c),horizontal:o.concat(r).concat(a)}}function Go(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Fr(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 Wl(n,t,e,i){let{pos:s,box:o}=e,r=n.maxPadding;if(!L(s)){e.size&&(n[s]-=e.size);let 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&&Fr(r,o.getPadding());let a=Math.max(0,t.outerWidth-Go(r,n,"left","right")),c=Math.max(0,t.outerHeight-Go(r,n,"top","bottom")),l=a!==n.w,h=c!==n.h;return n.w=a,n.h=c,e.horizontal?{same:l,other:h}:{same:h,other:l}}function Nl(n){let t=n.maxPadding;function e(i){let 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 Bl(n,t){let e=t.maxPadding;function i(s){let 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 He(n,t,e,i){let s=[],o,r,a,c,l,h;for(o=0,r=n.length,l=0;o<r;++o){a=n[o],c=a.box,c.update(a.width||t.w,a.height||t.h,Bl(a.horizontal,t));let{same:u,other:d}=Wl(t,e,a,i);l|=u&&s.length,h=h||d,c.fullSize||s.push(a)}return l&&He(s,t,e,i)||h}function Mn(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 Ko(n,t,e,i){let s=e.padding,{x:o,y:r}=t;for(let a of n){let c=a.box,l=i[a.stack]||{count:1,placed:0,weight:1},h=a.stackWeight/l.weight||1;if(a.horizontal){let u=t.w*h,d=l.size||c.height;Ae(l.start)&&(r=l.start),c.fullSize?Mn(c,s.left,r,e.outerWidth-s.right-s.left,d):Mn(c,t.left+l.placed,r,u,d),l.start=r,l.placed+=u,r=c.bottom}else{let u=t.h*h,d=l.size||c.width;Ae(l.start)&&(o=l.start),c.fullSize?Mn(c,o,s.top,d,e.outerHeight-s.bottom-s.top):Mn(c,o,t.top+l.placed,d,u),l.start=o,l.placed+=u,o=c.right}}t.x=o,t.y=r}var kn={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){let 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;let s=it(n.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(e-s.height,0),a=zl(n.boxes),c=a.vertical,l=a.horizontal;E(n.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});let h=c.reduce((m,p)=>p.box.options&&p.box.options.display===!1?m:m+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);Fr(d,it(i));let f=Object.assign({maxPadding:d,w:o,h:r,x:s.left,y:s.top},s),g=Rl(c.concat(l),u);He(a.fullSize,f,u,g),He(c,f,u,g),He(l,f,u,g)&&He(c,f,u,g),Nl(f),Ko(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,Ko(a.rightAndBottom,f,u,g),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(a.chartArea,m=>{let p=m.box;Object.assign(p,n.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},Ln=class{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){}},Ms=class extends Ln{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},Sn="$chartjs",Hl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zo=n=>n===null||n==="";function Yl(n,t){let e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Sn]={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",Zo(s)){let o=hs(n,"width");o!==void 0&&(n.width=o)}if(Zo(i))if(n.style.height==="")n.height=n.width/(t||2);else{let o=hs(n,"height");o!==void 0&&(n.height=o)}return n}var Rr=Lo?{passive:!0}:!1;function Vl(n,t,e){n&&n.addEventListener(t,e,Rr)}function jl(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Rr)}function ql(n,t){let e=Hl[n.type]||n.type,{x:i,y:s}=Ft(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function In(n,t){for(let e of n)if(e===t||e.contains(t))return!0}function $l(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||In(a.addedNodes,i),r=r&&!In(a.removedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Xl(n,t,e){let i=n.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||In(a.removedNodes,i),r=r&&!In(a.addedNodes,i);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}var Ve=new Map,Jo=0;function zr(){let n=window.devicePixelRatio;n!==Jo&&(Jo=n,Ve.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Ul(n,t){Ve.size||window.addEventListener("resize",zr),Ve.set(n,t)}function Ql(n){Ve.delete(n),Ve.size||window.removeEventListener("resize",zr)}function Gl(n,t,e){let i=n.canvas,s=i&&yn(i);if(!s)return;let o=Zi((a,c)=>{let l=s.clientWidth;e(a,c),l<s.clientWidth&&e()},window),r=new ResizeObserver(a=>{let c=a[0],l=c.contentRect.width,h=c.contentRect.height;l===0&&h===0||o(l,h)});return r.observe(s),Ul(n,o),r}function ms(n,t,e){e&&e.disconnect(),t==="resize"&&Ql(n)}function Kl(n,t,e){let i=n.canvas,s=Zi(o=>{n.ctx!==null&&e(ql(o,n))},n);return Vl(i,t,s),s}var ks=class extends Ln{acquireContext(t,e){let i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Yl(t,e),i):null}releaseContext(t){let e=t.canvas;if(!e[Sn])return!1;let i=e[Sn].initial;["height","width"].forEach(o=>{let r=i[o];R(r)?e.removeAttribute(o):e.setAttribute(o,r)});let s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Sn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);let s=t.$proxies||(t.$proxies={}),r={attach:$l,detach:Xl,resize:Gl}[e]||Kl;s[e]=r(t,e,i)}removeEventListener(t,e){let i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:ms,detach:ms,resize:ms}[e]||jl)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Ao(t,e,i,s)}isAttached(t){let e=t&&yn(t);return!!(e&&e.isConnected)}};function Zl(n){return!xn()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ms:ks}var $t=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return se(this.x)&&se(this.y)}getProps(t,e){let i=this.$animations;if(!e||!i)return this;let s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}};function Jl(n,t){let e=n.options.ticks,i=th(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?nh(t):[],r=o.length,a=o[0],c=o[r-1],l=[];if(r>s)return ih(t,l,o,r/s),l;let h=eh(o,t,s);if(r>0){let u,d,f=r>1?Math.round((c-a)/(r-1)):null;for(vn(t,l,h,R(f)?0:a-f,a),u=0,d=r-1;u<d;u++)vn(t,l,h,o[u],o[u+1]);return vn(t,l,h,c,R(f)?t.length:c+f),l}return vn(t,l,h),l}function th(n){let 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 eh(n,t,e){let i=sh(n),s=t.length/e;if(!i)return Math.max(s,1);let o=io(i);for(let r=0,a=o.length-1;r<a;r++){let c=o[r];if(c>s)return c}return Math.max(s,1)}function nh(n){let t=[],e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function ih(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 vn(n,t,e,i,s){let o=F(i,0),r=Math.min(F(s,n.length),n.length),a=0,c,l,h;for(e=Math.ceil(e),s&&(c=s-i,e=c/Math.floor(c/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(l=Math.max(o,0);l<r;l++)l===h&&(t.push(n[l]),a++,h=Math.round(o+a*e))}function sh(n){let t=n.length,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}var oh=n=>n==="left"?"right":n==="right"?"left":n,tr=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,er=(n,t)=>Math.min(t||n,n);function nr(n,t){let e=[],i=n.length/t,s=n.length,o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function rh(n,t,e){let i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,r=n._endPixel,a=1e-6,c=n.getPixelForTick(s),l;if(!(e&&(i===1?l=Math.max(c-o,r-c):t===0?l=(n.getPixelForTick(1)-c)/2:l=(c-n.getPixelForTick(s-1))/2,c+=s<t?l:-l,c<o-a||c>r+a)))return c}function ah(n,t){E(n,e=>{let i=e.gc,s=i.length/2,o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function Ne(n){return n.drawTicks?n.tickLength:0}function ir(n,t){if(!n.display)return 0;let e=Z(n.font,t),i=it(n.padding);return(N(n.text)?n.text.length:1)*e.lineHeight+i.height}function ch(n,t){return wt(n,{scale:t,type:"scale"})}function lh(n,t,e){return wt(n,{tick:e,index:t,type:"tick"})}function hh(n,t,e){let i=go(n);return(e&&t!=="right"||!e&&t==="right")&&(i=oh(i)),i}function uh(n,t,e,i){let{top:s,left:o,bottom:r,right:a,chart:c}=n,{chartArea:l,scales:h}=c,u=0,d,f,g,m=r-s,p=a-o;if(n.isHorizontal()){if(f=Ji(i,o,a),L(e)){let b=Object.keys(e)[0],x=e[b];g=h[b].getPixelForValue(x)+m-t}else e==="center"?g=(l.bottom+l.top)/2+m-t:g=tr(n,e,t);d=a-o}else{if(L(e)){let b=Object.keys(e)[0],x=e[b];f=h[b].getPixelForValue(x)-p+t}else e==="center"?f=(l.left+l.right)/2-p+t:f=tr(n,e,t);g=Ji(i,r,s),u=e==="left"?-G:G}return{titleX:f,titleY:g,maxWidth:d,rotation:u}}var le=class n extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=K(t,Number.POSITIVE_INFINITY),e=K(e,Number.NEGATIVE_INFINITY),i=K(i,Number.POSITIVE_INFINITY),s=K(s,Number.NEGATIVE_INFINITY),{min:K(t,i),max:K(e,s),minDefined:$(t),maxDefined:$(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:e,max:i};let a=this.getMatchingVisibleMetas();for(let c=0,l=a.length;c<l;++c)r=a[c].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:K(e,K(i,e)),max:K(i,K(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(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){B(this.options.beforeUpdate,[this])}update(t,e,i){let{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=vo(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let c=a<this.ticks.length;this._convertTicksToLabels(c?nr(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Jl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,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(){B(this.options.afterUpdate,[this])}beforeSetDimensions(){B(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(){B(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),B(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){B(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let e=this.options.ticks,i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=B(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){B(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){B(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,e=t.ticks,i=er(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation,r=s,a,c,l;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}let h=this._getLabelSizes(),u=h.widest.width,d=h.highest.height,f=at(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)),c=this.maxHeight-Ne(t.grid)-e.padding-ir(t.title,this.chart.options.font),l=Math.sqrt(u*u+d*d),r=dn(Math.min(Math.asin(at((h.highest.height+6)/a,-1,1)),Math.asin(at(c/l,-1,1))-Math.asin(at(d/l,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let c=ir(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ne(o)+c):(t.height=this.maxHeight,t.width=Ne(o)+c),i.display&&this.ticks.length){let{first:l,last:h,widest:u,highest:d}=this._getLabelSizes(),f=i.padding*2,g=ct(this.labelRotation),m=Math.cos(g),p=Math.sin(g);if(a){let b=i.mirror?0:p*u.width+m*d.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=i.mirror?0:m*u.width+p*d.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(l,h,p,m)}}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){let{ticks:{align:o,padding:r},position:a}=this.options,c=this.labelRotation!==0,l=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),d=0,f=0;c?l?(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(){B(this.options.afterFit,[this])}isHorizontal(){let{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++)R(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let e=this.options.ticks.sampleSize,i=this.ticks;e<i.length&&(i=nr(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],c=Math.floor(e/er(e,i)),l=0,h=0,u,d,f,g,m,p,b,x,M,w,y;for(u=0;u<e;u+=c){if(g=t[u].label,m=this._resolveTickFontOptions(u),s.font=p=m.string,b=o[p]=o[p]||{data:{},gc:[]},x=m.lineHeight,M=w=0,!R(g)&&!N(g))M=Te(s,b.data,b.gc,M,g),w=x;else if(N(g))for(d=0,f=g.length;d<f;++d)y=g[d],!R(y)&&!N(y)&&(M=Te(s,b.data,b.gc,M,y),w+=x);r.push(M),a.push(w),l=Math.max(M,l),h=Math.max(w,h)}ah(o,e);let P=r.indexOf(l),v=a.indexOf(h),D=C=>({width:r[C]||0,height:a[C]||0});return{first:D(0),last:D(e-1),widest:D(P),highest:D(v),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return ro(this._alignToPixels?Et(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&t<e.length){let i=e[t];return i.$context||(i.$context=lh(this.getContext(),t,i))}return this.$context||(this.$context=ch(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,e=ct(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,c=o?o.highest.height+r:0;return this.isHorizontal()?c*i>a*s?a/i:c/s:c*s<a*i?c/i:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let e=this.axis,i=this.chart,s=this.options,{grid:o,position:r,border:a}=s,c=o.offset,l=this.isHorizontal(),u=this.ticks.length+(c?1:0),d=Ne(o),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,p=m/2,b=function(U){return Et(i,U,m)},x,M,w,y,P,v,D,C,Y,V,q,dt;if(r==="top")x=b(this.bottom),v=this.bottom-d,C=x-p,V=b(t.top)+p,dt=t.bottom;else if(r==="bottom")x=b(this.top),V=t.top,dt=b(t.bottom)-p,v=x+p,C=this.top+d;else if(r==="left")x=b(this.right),P=this.right-d,D=x-p,Y=b(t.left)+p,q=t.right;else if(r==="right")x=b(this.left),Y=t.left,q=b(t.right)-p,P=x+p,D=this.left+d;else if(e==="x"){if(r==="center")x=b((t.top+t.bottom)/2+.5);else if(L(r)){let U=Object.keys(r)[0],st=r[U];x=b(this.chart.scales[U].getPixelForValue(st))}V=t.top,dt=t.bottom,v=x+p,C=v+d}else if(e==="y"){if(r==="center")x=b((t.left+t.right)/2);else if(L(r)){let U=Object.keys(r)[0],st=r[U];x=b(this.chart.scales[U].getPixelForValue(st))}P=x-p,D=P-d,Y=t.left,q=t.right}let Ot=F(s.ticks.maxTicksLimit,u),j=Math.max(1,Math.ceil(u/Ot));for(M=0;M<u;M+=j){let U=this.getContext(M),st=o.setContext(U),Ke=a.setContext(U),Ze=st.lineWidth,Gt=st.color,Je=Ke.dash||[],Kt=Ke.dashOffset,ke=st.tickWidth,zt=st.tickColor,ve=st.tickBorderDash||[],Wt=st.tickBorderDashOffset;w=rh(this,M,c),w!==void 0&&(y=Et(i,w,Ze),l?P=D=Y=q=y:v=C=V=dt=y,f.push({tx1:P,ty1:v,tx2:D,ty2:C,x1:Y,y1:V,x2:q,y2:dt,width:Ze,color:Gt,borderDash:Je,borderDashOffset:Kt,tickWidth:ke,tickColor:zt,tickBorderDash:ve,tickBorderDashOffset:Wt}))}return this._ticksLength=u,this._borderValue=x,f}_computeLabelItems(t){let e=this.axis,i=this.options,{position:s,ticks:o}=i,r=this.isHorizontal(),a=this.ticks,{align:c,crossAlign:l,padding:h,mirror:u}=o,d=Ne(i.grid),f=d+h,g=u?-h:f,m=-ct(this.labelRotation),p=[],b,x,M,w,y,P,v,D,C,Y,V,q,dt="middle";if(s==="top")P=this.bottom-g,v=this._getXAxisLabelAlignment();else if(s==="bottom")P=this.top+g,v=this._getXAxisLabelAlignment();else if(s==="left"){let j=this._getYAxisLabelAlignment(d);v=j.textAlign,y=j.x}else if(s==="right"){let j=this._getYAxisLabelAlignment(d);v=j.textAlign,y=j.x}else if(e==="x"){if(s==="center")P=(t.top+t.bottom)/2+f;else if(L(s)){let j=Object.keys(s)[0],U=s[j];P=this.chart.scales[j].getPixelForValue(U)+f}v=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")y=(t.left+t.right)/2-f;else if(L(s)){let j=Object.keys(s)[0],U=s[j];y=this.chart.scales[j].getPixelForValue(U)}v=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(c==="start"?dt="top":c==="end"&&(dt="bottom"));let Ot=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){M=a[b],w=M.label;let j=o.setContext(this.getContext(b));D=this.getPixelForTick(b)+o.labelOffset,C=this._resolveTickFontOptions(b),Y=C.lineHeight,V=N(w)?w.length:1;let U=V/2,st=j.color,Ke=j.textStrokeColor,Ze=j.textStrokeWidth,Gt=v;r?(y=D,v==="inner"&&(b===x-1?Gt=this.options.reverse?"left":"right":b===0?Gt=this.options.reverse?"right":"left":Gt="center"),s==="top"?l==="near"||m!==0?q=-V*Y+Y/2:l==="center"?q=-Ot.highest.height/2-U*Y+Y:q=-Ot.highest.height+Y/2:l==="near"||m!==0?q=Y/2:l==="center"?q=Ot.highest.height/2-U*Y:q=Ot.highest.height-V*Y,u&&(q*=-1),m!==0&&!j.showLabelBackdrop&&(y+=Y/2*Math.sin(m))):(P=D,q=(1-V)*Y/2);let Je;if(j.showLabelBackdrop){let Kt=it(j.backdropPadding),ke=Ot.heights[b],zt=Ot.widths[b],ve=q-Kt.top,Wt=0-Kt.left;switch(dt){case"middle":ve-=ke/2;break;case"bottom":ve-=ke;break}switch(v){case"center":Wt-=zt/2;break;case"right":Wt-=zt;break;case"inner":b===x-1?Wt-=zt:b>0&&(Wt-=zt/2);break}Je={left:Wt,top:ve,width:zt+Kt.width,height:ke+Kt.height,color:j.backdropColor}}p.push({label:w,font:C,textOffset:q,options:{rotation:m,color:st,strokeColor:Ke,strokeWidth:Ze,textAlign:Gt,textBaseline:dt,translation:[y,P],backdrop:Je}})}return p}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-ct(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){let{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,c=r.widest.width,l,h;return e==="left"?s?(h=this.right+o,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h+=c)):(h=this.right-a,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?l="right":i==="center"?(l="center",h-=c/2):(l="left",h-=c)):(h=this.left+a,i==="near"?l="left":i==="center"?(l="center",h+=c/2):(l="right",h=this.right)):l="right",{textAlign:l,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let 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(){let{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){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(c,l,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(c.x,c.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=s.length;o<r;++o){let c=s[o];e.drawOnChartArea&&a({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&a({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),r=i.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,c=this._borderValue,l,h,u,d;this.isHorizontal()?(l=Et(t,this.left,r)-r/2,h=Et(t,this.right,a)+a/2,u=d=c):(u=Et(t,this.top,r)-r/2,d=Et(t,this.bottom,a)+a/2,l=h=c),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,u),e.lineTo(h,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;let i=this.ctx,s=this._computeLabelArea();s&&is(i,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,c=r.font,l=r.label,h=r.textOffset;Ee(i,l,0,h,c,a)}s&&ss(i)}drawTitle(){let{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;let o=Z(i.font),r=it(i.padding),a=i.align,c=o.lineHeight/2;e==="bottom"||e==="center"||L(e)?(c+=r.bottom,N(i.text)&&(c+=o.lineHeight*(i.text.length-1))):c+=r.top;let{titleX:l,titleY:h,maxWidth:u,rotation:d}=uh(this,c,e,a);Ee(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:d,textAlign:hh(a,e,s),textBaseline:"middle",translation:[l,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let 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!==n.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){let e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[],o,r;for(o=0,r=e.length;o<r;++o){let a=e[o];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let e=this.options.ticks.setContext(this.getContext(t));return Z(e.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},ae=class{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){let e=Object.getPrototypeOf(t),i;ph(e)&&(i=this.register(e));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,dh(t,r,i),this.override&&W.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in W[s]&&(delete W[s][i],this.override&&delete It[i])}};function dh(n,t,e){let i=te(Object.create(null),[e?W.get(e):{},W.get(t),n.defaults]);W.set(t,i),n.defaultRoutes&&fh(t,n.defaultRoutes),n.descriptors&&W.describe(t,n.descriptors)}function fh(n,t){Object.keys(t).forEach(e=>{let i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),r=t[e].split("."),a=r.pop(),c=r.join(".");W.route(o,s,c,a)})}function ph(n){return"id"in n&&"defaults"in n}var vs=class{constructor(){this.controllers=new ae(ce,"datasets",!0),this.elements=new ae($t,"elements"),this.plugins=new ae(Object,"plugins"),this.scales=new ae(le,"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=>{let o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):E(s,r=>{let a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){let s=un(t);B(i["before"+s],[],i),e[t](i),B(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){let i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){let s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}},mt=new vs,Ds=class{constructor(){this._init=void 0}notify(t,e,i,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,i,s){s=s||{};for(let o of t){let r=o.plugin,a=r[i],c=[e,s,o.options];if(B(a,c,r)===!1&&s.cancelable)return!1}return!0}invalidate(){R(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){let i=t&&t.config,s=F(i.options&&i.options.plugins,{}),o=gh(i);return s===!1&&!e?[]:bh(t,o,s,e)}_notifyStateChanges(t){let e=this._oldCache||[],i=this._cache,s=(o,r)=>o.filter(a=>!r.some(c=>a.plugin.id===c.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}};function gh(n){let t={},e=[],i=Object.keys(mt.plugins.items);for(let o=0;o<i.length;o++)e.push(mt.getPlugin(i[o]));let s=n.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function mh(n,t){return!t&&n===!1?null:n===!0?{}:n}function bh(n,{plugins:t,localIds:e},i,s){let o=[],r=n.getContext();for(let a of t){let c=a.id,l=mh(i[c],s);l!==null&&o.push({plugin:a,options:xh(n.config,{plugin:a,local:e[c]},l,r)})}return o}function xh(n,{plugin:t,local:e},i,s){let 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 Ps(n,t){let e=W.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function yh(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function _h(n,t){return n===t?"_index_":"_value_"}function sr(n){if(n==="x"||n==="y"||n==="r")return n}function wh(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Os(n,...t){if(sr(n))return n;for(let e of t){let i=e.axis||wh(e.position)||n.length>1&&sr(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function or(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Mh(n,t){if(t.data&&t.data.datasets){let e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return or(n,"x",e[0])||or(n,"y",e[0])}return{}}function kh(n,t){let e=It[n.type]||{scales:{}},i=t.scales||{},s=Ps(n.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{let a=i[r];if(!L(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let c=Os(r,a,Mh(r,n),W.scales[a.type]),l=_h(c,s),h=e.scales||{};o[r]=ne(Object.create(null),[{axis:c},a,h[c],h[l]])}),n.data.datasets.forEach(r=>{let a=r.type||n.type,c=r.indexAxis||Ps(a,t),h=(It[a]||{}).scales||{};Object.keys(h).forEach(u=>{let d=yh(u,c),f=r[d+"AxisID"]||d;o[f]=o[f]||Object.create(null),ne(o[f],[{axis:d},i[f],h[u]])})}),Object.keys(o).forEach(r=>{let a=o[r];ne(a,[W.scales[a.type],W.scale])}),o}function Wr(n){let t=n.options||(n.options={});t.plugins=F(t.plugins,{}),t.scales=kh(n,t)}function Nr(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function vh(n){return n=n||{},n.data=Nr(n.data),Wr(n),n}var rr=new Map,Br=new Set;function Dn(n,t){let e=rr.get(n);return e||(e=t(),rr.set(n,e),Br.add(e)),e}var Be=(n,t,e)=>{let i=Vt(t,e);i!==void 0&&n.add(i)},Ss=class{constructor(t){this._config=vh(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=Nr(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Wr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Dn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Dn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Dn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id,i=this.type;return Dn(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let i=this._scopeCache,s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){let{options:s,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;let c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(u=>Be(c,t,u))),h.forEach(u=>Be(c,s,u)),h.forEach(u=>Be(c,It[o]||{},u)),h.forEach(u=>Be(c,W,u)),h.forEach(u=>Be(c,pn,u))});let l=Array.from(c);return l.length===0&&l.push(Object.create(null)),Br.has(e)&&r.set(e,l),l}chartOptionScopes(){let{options:t,type:e}=this;return[t,It[e]||{},W.datasets[e]||{},{type:e},W,pn]}resolveNamedOptions(t,e,i,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=ar(this._resolverCache,t,s),c=r;if(Ph(r,e)){o.$shared=!1,i=yt(i)?i():i;let l=this.createResolver(t,i,a);c=Yt(r,i,l)}for(let l of e)o[l]=c[l];return o}createResolver(t,e,i=[""],s){let{resolver:o}=ar(this._resolverCache,t,i);return L(e)?Yt(o,e,void 0,s):o}};function ar(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));let s=e.join(),o=i.get(s);return o||(o={resolver:bn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,o)),o}var Dh=n=>L(n)&&Object.getOwnPropertyNames(n).some(t=>yt(n[t]));function Ph(n,t){let{isScriptable:e,isIndexable:i}=rs(n);for(let s of t){let o=e(s),r=i(s),a=(r||o)&&n[s];if(o&&(yt(a)||Dh(a))||r&&N(a))return!0}return!1}var Oh="4.5.1",Sh=["top","bottom","left","right","chartArea"];function cr(n,t){return n==="top"||n==="bottom"||Sh.indexOf(n)===-1&&t==="x"}function lr(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function hr(n){let t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),B(e&&e.onComplete,[n],t)}function Th(n){let t=n.chart,e=t.options.animation;B(e&&e.onProgress,[n],t)}function Hr(n){return xn()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}var Tn={},ur=n=>{let t=Hr(n);return Object.values(Tn).filter(e=>e.canvas===t).pop()};function Ch(n,t,e){let i=Object.keys(n);for(let s of i){let o=+s;if(o>=t){let r=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=r)}}}function Ah(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}var he=class{static defaults=W;static instances=Tn;static overrides=It;static registry=mt;static version=Oh;static getChart=ur;static register(...t){mt.add(...t),dr()}static unregister(...t){mt.remove(...t),dr()}constructor(t,e){let i=this.config=new Ss(e),s=Hr(t),o=ur(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Zl(s)),this.platform.updateConfig(i);let a=this.platform.acquireContext(s,r.aspectRatio),c=a&&a.canvas,l=c&&c.height,h=c&&c.width;if(this.id=Js(),this.ctx=a,this.canvas=c,this.width=h,this.height=l,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ds,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=po(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],Tn[this.id]=this,!a||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Mt.listen(this,"complete",hr),Mt.listen(this,"progress",Th),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return R(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 mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ls(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ns(this.canvas,this.ctx),this}stop(){return Mt.stop(this),this}resize(t,e){Mt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let 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(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ls(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),B(i.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let e=this.options.scales||{};E(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){let t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{}),o=[];e&&(o=o.concat(Object.keys(e).map(r=>{let a=e[r],c=Os(r,a),l=c==="r",h=c==="x";return{options:a,dposition:l?"chartArea":h?"bottom":"left",dtype:l?"radialLinear":h?"category":"linear"}}))),E(o,r=>{let a=r.options,c=a.id,l=Os(c,a),h=F(a.type,r.dtype);(a.position===void 0||cr(a.position,l)!==cr(r.dposition))&&(a.position=r.dposition),s[c]=!0;let u=null;if(c in i&&i[c].type===h)u=i[c];else{let d=mt.getScale(h);u=new d({id:c,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(a,t)}),E(s,(r,a)=>{r||delete i[a]}),E(i,r=>{kn.configure(this,r,r.options),kn.addBox(this,r)})}_updateMetasets(){let 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(lr("order","index"))}_removeUnreferencedMetasets(){let{_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(){let t=[],e=this.data.datasets,i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){let o=e[i],r=this.getDatasetMeta(i),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||Ps(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{let c=mt.getController(a),{datasetElementType:l,dataElementType:h}=W.datasets[a];Object.assign(c,{dataElementType:mt.getElement(h),datasetElementType:l&&mt.getElement(l)}),r.controller=new c(this,i),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){E(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let 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;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let l=0,h=this.data.datasets.length;l<h;l++){let{controller:u}=this.getDatasetMeta(l),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||E(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(lr("z","_idx"));let{_active:a,_lastEvent:c}=this;c?this._eventHandler(c,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){E(this.scales,t=>{kn.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!$i(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:i,start:s,count:o}of e){let r=i==="_removeElements"?-o:o;Ch(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let 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(!$i(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;kn.update(this,this.width,this.height,t);let e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],E(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,yt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){let 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&&(Mt.has(this)?this.attached&&!Mt.running(this)&&Mt.start(this):(this.draw(),hr({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{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;let 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){let e=this._sortedMetasets,i=[],s,o;for(s=0,o=e.length;s<o;++s){let 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;let t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Ho(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&is(e,s),t.controller.draw(),s&&ss(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return ft(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){let o=Il.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){let e=this.data.datasets[t],i=this._metasets,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=wt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){let 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){let s=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);Ae(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){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Mt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ns(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Tn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,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)};E(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,i=(c,l)=>{e.addEventListener(this,c,l),t[c]=l},s=(c,l)=>{t[c]&&(e.removeEventListener(this,c,l),delete t[c])},o=(c,l)=>{this.canvas&&this.resize(c,l)},r,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(){E(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},E(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){let s=i?"set":"remove",o,r,a,c;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,c=t.length;a<c;++a){r=t[a];let l=r&&this.getDatasetMeta(r.datasetIndex).controller;l&&l[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let e=this._active||[],i=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ce(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){let s=this.options.hover,o=(c,l)=>c.filter(h=>!l.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){let 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;let 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){let{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,i,r),c=no(t),l=Ah(t,this._lastEvent,i,c);i&&(this._lastEvent=null,B(o.onHover,[t,a,this],this),c&&B(o.onClick,[t,a,this],this));let h=!Ce(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function dr(){return E(he.instances,n=>n._plugins.invalidate())}function Yr(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 Lh(n,t,e){n.lineTo(e.x,e.y)}function Ih(n){return n.stepped?wo:n.tension||n.cubicInterpolationMode==="monotone"?Mo:Lh}function Vr(n,t,e={}){let i=n.length,{start:s=0,end:o=i-1}=e,{start:r,end:a}=t,c=Math.max(s,r),l=Math.min(o,a),h=s<r&&o<r||s>a&&o>a;return{count:i,start:c,loop:t.loop,ilen:l<c&&!h?i+l-c:l-c}}function Eh(n,t,e,i){let{points:s,options:o}=t,{count:r,start:a,loop:c,ilen:l}=Vr(s,e,i),h=Ih(o),{move:u=!0,reverse:d}=i||{},f,g,m;for(f=0;f<=l;++f)g=s[(a+(d?l-f:f))%r],!g.skip&&(u?(n.moveTo(g.x,g.y),u=!1):h(n,m,g,d,o.stepped),m=g);return c&&(g=s[(a+(d?l:0))%r],h(n,m,g,d,o.stepped)),!!c}function Fh(n,t,e,i){let s=t.points,{count:o,start:r,ilen:a}=Vr(s,e,i),{move:c=!0,reverse:l}=i||{},h=0,u=0,d,f,g,m,p,b,x=w=>(r+(l?a-w:w))%o,M=()=>{m!==p&&(n.lineTo(h,p),n.lineTo(h,m),n.lineTo(h,b))};for(c&&(f=s[x(0)],n.moveTo(f.x,f.y)),d=0;d<=a;++d){if(f=s[x(d)],f.skip)continue;let w=f.x,y=f.y,P=w|0;P===g?(y<m?m=y:y>p&&(p=y),h=(u*h+w)/++u):(M(),n.lineTo(w,y),g=P,u=0,m=p=y),b=y}M()}function Ts(n){let t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Fh:Eh}function Rh(n){return n.stepped?Io:n.tension||n.cubicInterpolationMode==="monotone"?Eo:Ct}function zh(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Yr(n,t.options),n.stroke(s)}function Wh(n,t,e,i){let{segments:s,options:o}=t,r=Ts(t);for(let a of s)Yr(n,o,a.style),n.beginPath(),r(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}var Nh=typeof Path2D=="function";function Bh(n,t,e,i){Nh&&!t.options.segment?zh(n,t,e,i):Wh(n,t,e,i)}var En=class extends $t{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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){let i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){let s=i.spanGaps?this._loop:this._fullLoop;Co(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=Bo(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){let i=this.options,s=t[e],o=this.points,r=No(this,{property:e,start:s,end:s});if(!r.length)return;let a=[],c=Rh(i),l,h;for(l=0,h=r.length;l<h;++l){let{start:u,end:d}=r[l],f=o[u],g=o[d];if(f===g){a.push(f);continue}let m=Math.abs((s-f[e])/(g[e]-f[e])),p=c(f,g,m,i.stepped);p[e]=t[e],a.push(p)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Ts(this)(t,this,e,i)}path(t,e,i){let s=this.segments,o=Ts(this),r=this._loop;e=e||0,i=i||this.points.length-e;for(let a of s)r&=o(t,this,a,{start:e,end:e+i-1});return!!r}draw(t,e,i,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Bh(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};function fr(n,t,e,i){let s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}var Fn=class extends $t{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){let s=this.options,{x:o,y:r}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,e){return fr(this,t,"x",e)}inYRange(t,e){return fr(this,t,"y",e)}getCenterPoint(t){let{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);let i=e&&t.borderWidth||0;return(e+i)*2}draw(t,e){let i=this.options;this.skip||i.radius<.1||!ft(this,e,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,gn(t,i,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}};var Cs=["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)"],pr=Cs.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function jr(n){return Cs[n%Cs.length]}function qr(n){return pr[n%pr.length]}function Hh(n,t){return n.borderColor=jr(t),n.backgroundColor=qr(t),++t}function Yh(n,t){return n.backgroundColor=n.data.map(()=>jr(t++)),t}function Vh(n,t){return n.backgroundColor=n.data.map(()=>qr(t++)),t}function jh(n){let t=0;return(e,i)=>{let s=n.getDatasetMeta(i).controller;s instanceof ys?t=Yh(e,t):s instanceof _s?t=Vh(e,t):s&&(t=Hh(e,t))}}function gr(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function qh(n){return n&&(n.borderColor||n.backgroundColor)}function $h(){return W.borderColor!=="rgba(0,0,0,0.1)"||W.backgroundColor!=="rgba(0,0,0,0.1)"}var $r={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;let{data:{datasets:i},options:s}=n.config,{elements:o}=s,r=gr(i)||qh(s)||o&&gr(o)||$h();if(!e.forceOverride&&r)return;let a=jh(n);i.forEach(a)}};var Ye={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){let a=n[t].element;if(a&&a.hasValue()){let c=a.tooltipPosition();i.add(c.x),s+=c.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((a,c)=>a+c)/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){let c=n[o].element;if(c&&c.hasValue()){let l=c.getCenterPoint(),h=ln(t,l);h<s&&(s=h,a=c)}}if(a){let c=a.tooltipPosition();e=c.x,i=c.y}return{x:e,y:i}}};function gt(n,t){return t&&(N(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function kt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(` `)>-1?n.split(` -`):n}function Yh(n,t){let{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 dr(n,t){let e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,c=Z(t.bodyFont),l=Z(t.titleFont),h=Z(t.footerFont),u=o.length,d=s.length,f=i.length,m=nt(t.padding),p=m.height,g=0,b=i.reduce((M,y)=>M+y.before.length+y.lines.length+y.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,u&&(p+=u*l.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let M=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;p+=f*M+(b-f)*c.lineHeight+(b-1)*t.bodySpacing}d&&(p+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let _=0,w=function(M){g=Math.max(g,e.measureText(M).width+_)};return e.save(),e.font=l.string,E(n.title,w),e.font=c.string,E(n.beforeBody.concat(n.afterBody),w),_=t.displayColors?r+2+t.boxPadding:0,E(i,M=>{E(M.before,w),E(M.lines,w),E(M.after,w)}),_=0,e.font=h.string,E(n.footer,w),e.restore(),g+=m.width,{width:g,height:p}}function Vh(n,t){let{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function jh(n,t,e,i){let{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 qh(n,t,e,i){let{x:s,width:o}=e,{width:r,chartArea:{left:a,right:c}}=n,l="center";return i==="center"?l=s<=(a+c)/2?"left":"right":s<=o/2?l="left":s>=r-o/2&&(l="right"),jh(l,n,t,e)&&(l="center"),l}function fr(n,t,e){let i=e.yAlign||t.yAlign||Vh(n,e);return{xAlign:e.xAlign||t.xAlign||qh(n,t,e,i),yAlign:i}}function $h(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Xh(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function pr(n,t,e,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:c}=e,l=s+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=re(r),m=$h(t,a),p=Xh(t,c,l);return c==="center"?a==="left"?m+=l:a==="right"&&(m-=l):a==="left"?m-=Math.max(h,d)+s:a==="right"&&(m+=Math.max(u,f)+s),{x:rt(m,0,i.width-t.width),y:rt(p,0,i.height-t.height)}}function vn(n,t,e){let i=nt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function gr(n){return pt([],Mt(n))}function Uh(n,t,e){return _t(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function mr(n,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}var Vr={beforeTitle:ft,title(n){if(n.length>0){let 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:ft,beforeBody:ft,beforeLabel:ft,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");let e=n.formattedValue;return N(e)||(t+=e),t},labelColor(n){let 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){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:ft,afterBody:ft,beforeFooter:ft,footer:ft,afterFooter:ft};function J(n,t,e,i){let s=n[t].call(e,i);return typeof s>"u"?Vr[t].call(e,i):s}var Rn=class extends $t{static positioners=He;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new Tn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Uh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,s=J(i,"beforeTitle",this,t),o=J(i,"title",this,t),r=J(i,"afterTitle",this,t),a=[];return a=pt(a,Mt(s)),a=pt(a,Mt(o)),a=pt(a,Mt(r)),a}getBeforeBody(t,e){return gr(J(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:i}=e,s=[];return E(t,o=>{let r={before:[],lines:[],after:[]},a=mr(i,o);pt(r.before,Mt(J(a,"beforeLabel",this,o))),pt(r.lines,J(a,"label",this,o)),pt(r.after,Mt(J(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return gr(J(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:i}=e,s=J(i,"beforeFooter",this,t),o=J(i,"footer",this,t),r=J(i,"afterFooter",this,t),a=[];return a=pt(a,Mt(s)),a=pt(a,Mt(o)),a=pt(a,Mt(r)),a}_createItems(t){let e=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],c,l;for(c=0,l=e.length;c<l;++c)a.push(Yh(this.chart,e[c]));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))),E(a,h=>{let u=mr(t.callbacks,h);s.push(J(u,"labelColor",this,h)),o.push(J(u,"labelPointStyle",this,h)),r.push(J(u,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=He[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);let c=this._size=dr(this,i),l=Object.assign({},a,c),h=fr(this.chart,i,l),u=pr(i,l,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let 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){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:c,topRight:l,bottomLeft:h,bottomRight:u}=re(a),{x:d,y:f}=t,{width:m,height:p}=e,g,b,_,w,M,y;return o==="center"?(M=f+p/2,s==="left"?(g=d,b=g-r,w=M+r,y=M-r):(g=d+m,b=g+r,w=M-r,y=M+r),_=g):(s==="left"?b=d+Math.max(c,h)+r:s==="right"?b=d+m-Math.max(l,u)-r:b=this.caretX,o==="top"?(w=f,M=w-r,g=b-r,_=b+r):(w=f+p,M=w+r,g=b+r,_=b-r),y=w),{x1:g,x2:b,x3:_,y1:w,y2:M,y3:y}}drawTitle(t,e,i){let s=this.title,o=s.length,r,a,c;if(o){let l=yn(i.rtl,this.x,this.width);for(t.x=vn(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=Z(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,c=0;c<o;++c)e.fillText(s[c],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,c+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:c,boxWidth:l}=o,h=Z(o.bodyFont),u=vn(this,"left",o),d=s.x(u),f=c<h.lineHeight?(h.lineHeight-c)/2:0,m=e.y+f;if(o.usePointStyle){let p={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},g=s.leftForLtr(d,l)+l/2,b=m+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,fn(t,p,g,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,fn(t,p,g,b)}else{t.lineWidth=L(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let p=s.leftForLtr(d,l),g=s.leftForLtr(s.xPlus(d,1),l-2),b=re(r.borderRadius);Object.values(b).some(_=>_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,pn(t,{x:p,y:m,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),pn(t,{x:g,y:m+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,m,l,c),t.strokeRect(p,m,l,c),t.fillStyle=r.backgroundColor,t.fillRect(g,m+1,l-2,c-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:h}=i,u=Z(i.bodyFont),d=u.lineHeight,f=0,m=yn(i.rtl,this.x,this.width),p=function(v){e.fillText(v,m.x(t.x+f),t.y+d/2),t.y+=d+o},g=m.textAlign(r),b,_,w,M,y,S,D;for(e.textAlign=r,e.textBaseline="middle",e.font=u.string,t.x=vn(this,g,i),e.fillStyle=i.bodyColor,E(this.beforeBody,p),f=a&&g!=="right"?r==="center"?l/2+h:l+2+h:0,M=0,S=s.length;M<S;++M){for(b=s[M],_=this.labelTextColors[M],e.fillStyle=_,E(b.before,p),w=b.lines,a&&w.length&&(this._drawColorBox(e,t,M,m,i),d=Math.max(u.lineHeight,c)),y=0,D=w.length;y<D;++y)p(w[y]),d=u.lineHeight;E(b.after,p)}f=0,d=u.lineHeight,E(this.afterBody,p),t.y-=o}drawFooter(t,e,i){let s=this.footer,o=s.length,r,a;if(o){let c=yn(i.rtl,this.x,this.width);for(t.x=vn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=c.textAlign(i.footerAlign),e.textBaseline="middle",r=Z(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:c}=t,{width:l,height:h}=i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:m}=re(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+u,c),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+l-d,c),e.quadraticCurveTo(a+l,c,a+l,c+d),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+l,c+h-m),e.quadraticCurveTo(a+l,c+h,a+l-m,c+h),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,c+h),e.quadraticCurveTo(a,c+h,a,c+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,c+u),e.quadraticCurveTo(a,c,a+u,c),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=He[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=dr(this,t),c=Object.assign({},r,this._size),l=fr(e,t,c),h=pr(t,c,l,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let r=nt(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),Ao(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Lo(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:a,index:c})=>{let l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!Te(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;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),c=e||!Te(r,o)||a;return c&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_getActiveElements(t,e,i,s){let 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);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){let{caretX:i,caretY:s,options:o}=this,r=He[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}},jr={id:"tooltip",_element:Rn,positioners:He,afterInit(n,t,e){e&&(n.tooltip=new Rn({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){let t=n.tooltip;if(t&&t._willRender()){let 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){let 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:Vr},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"]};function Qh(n,t){let e=[],{bounds:s,step:o,min:r,max:a,precision:c,count:l,maxTicks:h,maxDigits:u,includeBounds:d}=n,f=o||1,m=h-1,{min:p,max:g}=t,b=!N(r),_=!N(a),w=!N(l),M=(g-p)/(u+1),y=$i((g-p)/m/f)*f,S,D,v,C;if(y<1e-14&&!b&&!_)return[{value:p},{value:g}];C=Math.ceil(g/y)-Math.floor(p/y),C>m&&(y=$i(C*y/m/f)*f),N(c)||(S=Math.pow(10,c),y=Math.ceil(y*S)/S),s==="ticks"?(D=Math.floor(p/y)*y,v=Math.ceil(g/y)*y):(D=p,v=g),b&&_&&o&&to((a-r)/o,y/1e3)?(C=Math.round(Math.min((a-r)/y,h)),y=(a-r)/C,D=r,v=a):w?(D=b?r:D,v=_?a:v,C=l-1,y=(v-D)/C):(C=(v-D)/y,ie(C,Math.round(C),y/1e3)?C=Math.round(C):C=Math.ceil(C));let Y=Math.max(Ui(y),Ui(D));S=Math.pow(10,N(c)?Y:c),D=Math.round(D*S)/S,v=Math.round(v*S)/S;let V=0;for(b&&(d&&D!==r?(e.push({value:r}),D<r&&V++,ie(Math.round((D+V*y)*S)/S,r,br(r,M,n))&&V++):D<r&&V++);V<C;++V){let q=Math.round((D+V*y)*S)/S;if(_&&q>a)break;e.push({value:q})}return _&&d&&v!==a?e.length&&ie(e[e.length-1].value,a,br(a,M,n))?e[e.length-1].value=a:e.push({value:a}):(!_||v===a)&&e.push({value:v}),e}function br(n,t,{horizontal:e,minRotation:i}){let s=at(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}var ue=class extends le{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 N(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=c=>s=e?s:c,a=c=>o=i?o:c;if(t){let c=Ht(s),l=Ht(o);c<0&&l<0?a(0):c>0&&l>0&&r(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||r(s-c)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{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(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let 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=Qh(s,o);return t.bounds==="ticks"&&Xi(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let 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 oe(t,this.chart.options.locale,this.options.ticks.format)}},Fn=class extends ue{static id="linear";static defaults={ticks:{callback:Le.formatters.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=at(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}},Ve=n=>Math.floor(yt(n)),qt=(n,t)=>Math.pow(10,Ve(n)+t);function xr(n){return n/Math.pow(10,Ve(n))===1}function yr(n,t,e){let i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Gh(n,t){let e=t-n,i=Ve(e);for(;yr(n,t,i)>10;)i++;for(;yr(n,t,i)<10;)i--;return Math.min(i,Ve(n))}function Kh(n,{min:t,max:e}){t=K(n.min,t);let i=[],s=Ve(t),o=Gh(t,e),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),c=s>o?Math.pow(10,s):0,l=Math.round((t-c)*r)/r,h=Math.floor((t-c)/a/10)*a*10,u=Math.floor((l-h)/Math.pow(10,o)),d=K(n.min,Math.round((c+h+u*Math.pow(10,o))*r)/r);for(;d<e;)i.push({value:d,major:xr(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),d=Math.round((c+h+u*Math.pow(10,o))*r)/r;let f=K(n.max,d);return i.push({value:f,major:xr(f),significand:u}),i}var _r=class extends le{static id="logarithmic";static defaults={ticks:{callback:Le.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=ue.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return $(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?Math.max(0,t):null,this.max=$(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$(this._userMin)&&(this.min=t===qt(this.min,0)?qt(this.min,-1):qt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(qt(i,-1)),r(qt(s,1)))),i<=0&&o(qt(s,-1)),s<=0&&r(qt(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=Kh(e,this);return t.bounds==="ticks"&&Xi(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":oe(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=yt(t),this._valueRange=yt(this.max)-yt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(yt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};function Ts(n){let t=n.ticks;if(t.display&&n.display){let e=nt(t.backdropPadding);return R(t.font&&t.font.size,H.font.size)+e.height}return 0}function Zh(n,t,e){return e=W(e)?e:[e],{w:go(n,t.string,e),h:e.length*t.lineHeight}}function wr(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 Jh(n){let 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?B/o:0;for(let c=0;c<o;c++){let l=r.setContext(n.getPointLabelContext(c));s[c]=l.padding;let h=n.getPointPosition(c,n.drawingArea+s[c],a),u=Z(l.font),d=Zh(n.ctx,u,n._pointLabels[c]);i[c]=d;let f=ot(n.getIndexAngle(c)+a),m=Math.round(hn(f)),p=wr(m,h.x,d.w,0,180),g=wr(m,h.y,d.h,90,270);tu(e,t,f,p,g)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=iu(n,i,s)}function tu(n,t,e,i,s){let o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),a=0,c=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?(c=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+c))}function eu(n,t,e){let i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,c=n.getPointPosition(t,i+s+r,o),l=Math.round(hn(ot(c.angle+G))),h=ru(c.y,a.h,l),u=su(l),d=ou(c.x,a.w,u);return{visible:!0,x:c.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function nu(n,t){if(!t)return!0;let{left:e,top:i,right:s,bottom:o}=n;return!(dt({x:e,y:i},t)||dt({x:e,y:o},t)||dt({x:s,y:i},t)||dt({x:s,y:o},t))}function iu(n,t,e){let i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:a}=o.pointLabels,c={extra:Ts(o)/2,additionalAngle:r?B/s:0},l;for(let h=0;h<s;h++){c.padding=e[h],c.size=t[h];let u=eu(n,h,c);i.push(u),a==="auto"&&(u.visible=nu(u,l),u.visible&&(l=u))}return i}function su(n){return n===0||n===180?"center":n<180?"left":"right"}function ou(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function ru(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function au(n,t,e){let{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!N(a)){let c=re(t.borderRadius),l=nt(t.backdropPadding);n.fillStyle=a;let h=i-l.left,u=s-l.top,d=o-i+l.width,f=r-s+l.height;Object.values(c).some(m=>m!==0)?(n.beginPath(),pn(n,{x:h,y:u,w:d,h:f,radius:c}),n.fill()):n.fillRect(h,u,d,f)}}function cu(n,t){let{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){let o=n._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(n.getPointLabelContext(s));au(e,r,o);let a=Z(r.font),{x:c,y:l,textAlign:h}=o;Ie(e,n._pointLabels[s],c,l+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function qr(n,t,e,i){let{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,X);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 lu(n,t,e,i,s){let o=n.ctx,r=t.circular,{color:a,lineWidth:c}=t;!r&&!i||!a||!c||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),qr(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function hu(n,t,e){return _t(n,{label:e,index:t,type:"pointLabel"})}var Mr=class extends ue{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Le.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=nt(Ts(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(){let{min:t,max:e}=this.getMinMax(!1);this.min=$(t)&&!isNaN(t)?t:0,this.max=$(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ts(this.options))}generateTickLabels(t){ue.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{let s=z(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?Jh(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){let e=X/(this._pointLabels.length||1),i=this.options.startAngle||0;return ot(t*e+at(i))}getDistanceFromCenterForValue(t){if(N(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(N(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return hu(this.getContext(),t,i)}}getPointPosition(t,e,i=0){let s=this.getIndexAngle(t)-G+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){let{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),qr(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length,a,c,l;if(e.pointLabels.display&&cu(this,r),s.display&&this.ticks.forEach((h,u)=>{if(u!==0){c=this.getDistanceFromCenterForValue(h.value);let d=this.getContext(u),f=s.setContext(d),m=o.setContext(d);lu(this,f,c,r,m)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let 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,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&!e.reverse)return;let l=i.setContext(this.getContext(c)),h=Z(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=l.backdropColor;let u=nt(l.backdropPadding);t.fillRect(-r/2-u.left,-o-h.size/2-u.top,r+u.width,h.size+u.height)}Ie(t,a.label,0,-o,h,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}},Nn={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}},tt=Object.keys(Nn);function kr(n,t){return n-t}function Dr(n,t){if(N(t))return null;let e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),$(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(se(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function vr(n,t,e,i){let s=tt.length;for(let o=tt.indexOf(n);o<s-1;++o){let r=Nn[tt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return tt[o]}return tt[s-1]}function uu(n,t,e,i,s){for(let o=tt.length-1;o>=tt.indexOf(e);o--){let r=tt[o];if(Nn[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return tt[e?tt.indexOf(e):0]}function du(n){for(let t=tt.indexOf(n)+1,e=tt.length;t<e;++t)if(Nn[tt[t]].common)return tt[t]}function Pr(n,t,e){if(!e)n[t]=!0;else if(e.length){let{lo:i,hi:s}=un(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function fu(n,t,e,i){let s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,a,c;for(a=o;a<=r;a=+s.add(a,1,i))c=e[a],c>=0&&(t[c].major=!0);return t}function Or(n,t,e){let i=[],s={},o=t.length,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:fu(n,i,s,e)}var de=class extends le{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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={}){let i=t.time||(t.time={}),s=this._adapter=new Cs._date(t.adapters.date);s.init(e),ne(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:Dr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function c(l){!r&&!isNaN(l.min)&&(s=Math.min(s,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!r||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=$(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=$(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(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let 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]);let o=this.min,r=this.max,a=oo(s,o,r);return this._unit=e.unit||(i.autoSkip?vr(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):uu(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:du(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Or(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);let r=t.length<3?.5:.25;e=rt(e,0,r),i=rt(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||vr(o.minUnit,e,i,this._getLabelCapacity(e)),a=R(s.ticks.stepSize,1),c=r==="week"?o.isoWeekday:!1,l=se(c)||c===!0,h={},u=e,d,f;if(l&&(u=+t.startOf(u,"isoWeek",c)),u=+t.startOf(u,l?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);let m=s.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<i;d=+t.add(d,a,r),f++)Pr(h,d,m);return(d===i||s.bounds==="ticks"||f===1)&&Pr(h,d,m),Object.keys(h).sort(kr).map(p=>+p)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){let o=this.options,r=o.ticks.callback;if(r)return z(r,[t,e,i],this);let a=o.time.displayFormats,c=this._unit,l=this._majorUnit,h=c&&a[c],u=l&&a[l],d=i[e],f=l&&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){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,s=at(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){let e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Or(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;let 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(){let t=this._cache.labels||[],e,i;if(t.length)return t;let s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Dr(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return co(t.sort(kr))}};function Pn(n,t,e){let i=0,s=n.length-1,o,r,a,c;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Ct(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:c}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Ct(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:c}=n[s]);let l=r-o;return l?a+(c-a)*(t-o)/l:a}var Sr=class extends de{static id="timeseries";static defaults=de.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Pn(e,this.min),this._tableRange=Pn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,s=[],o=[],r,a,c,l,h;for(r=0,a=t.length;r<a;++r)l=t[r],l>=e&&l<=i&&s.push(l);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],c=s[r-1],l=s[r],Math.round((h+c)/2)!==l&&o.push({time:l,pos:r/(a-1)});return o}_generate(){let t=this.min,e=this.max,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;let 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(Pn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Pn(this._table,i*this._tableRange+this._minPos,!0)}};function x(n){let t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function O(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function Et(n,t){let e=x(n);return isNaN(t)?O(n,NaN):(t&&e.setDate(e.getDate()+t),e)}function fe(n,t){let e=x(n);if(isNaN(t))return O(n,NaN);if(!t)return e;let i=e.getDate(),s=O(n,e.getTime());s.setMonth(e.getMonth()+t+1,0);let o=s.getDate();return i>=o?s:(e.setFullYear(s.getFullYear(),s.getMonth(),i),e)}function Rt(n,t){let e=+x(n);return O(n,e+t)}var pu=Math.pow(10,8)*24*60*60*1e3,qd=-pu,Wn=6048e5,$r=864e5,kt=6e4,Dt=36e5,Xr=1e3;var gu=3600;var Ur=gu*24,$d=Ur*7,mu=Ur*365.2425,bu=mu/12,Xd=bu*3;function Qr(n,t){return Rt(n,t*Dt)}var xu={};function et(){return xu}function Q(n,t){let e=et(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,s=x(n),o=s.getDay(),r=(o<i?7:0)+o-i;return s.setDate(s.getDate()-r),s.setHours(0,0,0,0),s}function ht(n){return Q(n,{weekStartsOn:1})}function zn(n){let t=x(n),e=t.getFullYear(),i=O(n,0);i.setFullYear(e+1,0,4),i.setHours(0,0,0,0);let s=ht(i),o=O(n,0);o.setFullYear(e,0,4),o.setHours(0,0,0,0);let r=ht(o);return t.getTime()>=s.getTime()?e+1:t.getTime()>=r.getTime()?e:e-1}function qe(n){let t=x(n);return t.setHours(0,0,0,0),t}function Xt(n){let t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),n.getTime()-t.getTime()}function Bn(n,t){let e=qe(n),i=qe(t),s=e.getTime()-Xt(e),o=i.getTime()-Xt(i);return Math.round((s-o)/$r)}function Gr(n){let t=zn(n),e=O(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),ht(e)}function Kr(n,t){return Rt(n,t*kt)}function Zr(n,t){let e=t*3;return fe(n,e)}function Jr(n,t){return Rt(n,t*1e3)}function ta(n,t){let e=t*7;return Et(n,e)}function ea(n,t){return fe(n,t*12)}function Ut(n,t){let e=x(n),i=x(t),s=e.getTime()-i.getTime();return s<0?-1:s>0?1:s}function na(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Hn(n){if(!na(n)&&typeof n!="number")return!1;let t=x(n);return!isNaN(Number(t))}function ia(n,t){let e=x(n),i=x(t),s=e.getFullYear()-i.getFullYear(),o=e.getMonth()-i.getMonth();return s*12+o}function sa(n,t){let e=x(n),i=x(t);return e.getFullYear()-i.getFullYear()}function Yn(n,t){let e=x(n),i=x(t),s=oa(e,i),o=Math.abs(Bn(e,i));e.setDate(e.getDate()-s*o);let r=+(oa(e,i)===-s),a=s*(o-r);return a===0?0:a}function oa(n,t){let 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 Ft(n,t){return x(n).getTime()-x(t).getTime()}function mt(n){return n?Math[n]:Math.trunc}function ra(n,t,e){let i=Ft(n,t)/Dt;return mt(e?.roundingMethod)(i)}function aa(n,t,e){let i=Ft(n,t)/kt;return mt(e?.roundingMethod)(i)}function Vn(n){let t=x(n);return t.setHours(23,59,59,999),t}function jn(n){let t=x(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function ca(n){let t=x(n);return+Vn(t)==+jn(t)}function qn(n,t){let e=x(n),i=x(t),s=Ut(e,i),o=Math.abs(ia(e,i)),r;if(o<1)r=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*o);let a=Ut(e,i)===-s;ca(x(n))&&o===1&&Ut(n,i)===1&&(a=!1),r=s*(o-Number(a))}return r===0?0:r}function la(n,t,e){let i=qn(n,t)/3;return mt(e?.roundingMethod)(i)}function ha(n,t,e){let i=Ft(n,t)/1e3;return mt(e?.roundingMethod)(i)}function ua(n,t,e){let i=Yn(n,t)/7;return mt(e?.roundingMethod)(i)}function da(n,t){let e=x(n),i=x(t),s=Ut(e,i),o=Math.abs(sa(e,i));e.setFullYear(1584),i.setFullYear(1584);let r=Ut(e,i)===-s,a=s*(o-+r);return a===0?0:a}function fa(n){let t=x(n);return t.setSeconds(0,0),t}function pa(n){let t=x(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function ga(n){let t=x(n);return t.setDate(1),t.setHours(0,0,0,0),t}function ma(n){let t=x(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function $n(n){let t=x(n),e=O(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function ba(n){let t=x(n);return t.setMinutes(59,59,999),t}function xa(n,t){let e=et(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,s=x(n),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 ya(n){let t=x(n);return t.setSeconds(59,999),t}function _a(n){let t=x(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function wa(n){let t=x(n);return t.setMilliseconds(999),t}var yu={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"}},Ma=(n,t,e)=>{let i,s=yu[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Xn(n){return(t={})=>{let e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}var _u={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Mu={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ka={date:Xn({formats:_u,defaultWidth:"full"}),time:Xn({formats:wu,defaultWidth:"full"}),dateTime:Xn({formats:Mu,defaultWidth:"full"})};var ku={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Da=(n,t,e,i)=>ku[n];function pe(n){return(t,e)=>{let i=e?.context?String(e.context):"standalone",s;if(i==="formatting"&&n.formattingValues){let r=n.defaultFormattingWidth||n.defaultWidth,a=e?.width?String(e.width):r;s=n.formattingValues[a]||n.formattingValues[r]}else{let r=n.defaultWidth,a=e?.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[r]}let o=n.argumentCallback?n.argumentCallback(t):t;return s[o]}}var Du={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},vu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Pu={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"]},Ou={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"]},Su={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"}},Tu={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"}},Cu=(n,t)=>{let 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"},va={ordinalNumber:Cu,era:pe({values:Du,defaultWidth:"wide"}),quarter:pe({values:vu,defaultWidth:"wide",argumentCallback:n=>n-1}),month:pe({values:Pu,defaultWidth:"wide"}),day:pe({values:Ou,defaultWidth:"wide"}),dayPeriod:pe({values:Su,defaultWidth:"wide",formattingValues:Tu,defaultFormattingWidth:"wide"})};function ge(n){return(t,e={})=>{let i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=t.match(s);if(!o)return null;let r=o[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(a)?Lu(a,u=>u.test(r)):Au(a,u=>u.test(r)),l;l=n.valueCallback?n.valueCallback(c):c,l=e.valueCallback?e.valueCallback(l):l;let h=t.slice(r.length);return{value:l,rest:h}}}function Au(n,t){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Lu(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Pa(n){return(t,e={})=>{let i=t.match(n.matchPattern);if(!i)return null;let 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;let a=t.slice(s.length);return{value:r,rest:a}}}var Iu=/^(\d+)(th|st|nd|rd)?/i,Eu=/\d+/i,Ru={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},Fu={any:[/^b/i,/^(a|c)/i]},Nu={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wu={any:[/1/i,/2/i,/3/i,/4/i]},zu={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},Bu={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]},Hu={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},Yu={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]},Vu={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},ju={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}},Oa={ordinalNumber:Pa({matchPattern:Iu,parsePattern:Eu,valueCallback:n=>parseInt(n,10)}),era:ge({matchPatterns:Ru,defaultMatchWidth:"wide",parsePatterns:Fu,defaultParseWidth:"any"}),quarter:ge({matchPatterns:Nu,defaultMatchWidth:"wide",parsePatterns:Wu,defaultParseWidth:"any",valueCallback:n=>n+1}),month:ge({matchPatterns:zu,defaultMatchWidth:"wide",parsePatterns:Bu,defaultParseWidth:"any"}),day:ge({matchPatterns:Hu,defaultMatchWidth:"wide",parsePatterns:Yu,defaultParseWidth:"any"}),dayPeriod:ge({matchPatterns:Vu,defaultMatchWidth:"any",parsePatterns:ju,defaultParseWidth:"any"})};var $e={code:"en-US",formatDistance:Ma,formatLong:ka,formatRelative:Da,localize:va,match:Oa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Sa(n){let t=x(n);return Bn(t,$n(t))+1}function Un(n){let t=x(n),e=ht(t).getTime()-Gr(t).getTime();return Math.round(e/Wn)+1}function me(n,t){let e=x(n),i=e.getFullYear(),s=et(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=O(n,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);let a=Q(r,t),c=O(n,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);let l=Q(c,t);return e.getTime()>=a.getTime()?i+1:e.getTime()>=l.getTime()?i:i-1}function Ta(n,t){let e=et(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,s=me(n,t),o=O(n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),Q(o,t)}function Qn(n,t){let e=x(n),i=Q(e,t).getTime()-Ta(e,t).getTime();return Math.round(i/Wn)+1}function I(n,t){let e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}var vt={y(n,t){let e=n.getFullYear(),i=e>0?e:1-e;return I(t==="yy"?i%100:i,t.length)},M(n,t){let e=n.getMonth();return t==="M"?String(e+1):I(e+1,2)},d(n,t){return I(n.getDate(),t.length)},a(n,t){let 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 I(n.getHours()%12||12,t.length)},H(n,t){return I(n.getHours(),t.length)},m(n,t){return I(n.getMinutes(),t.length)},s(n,t){return I(n.getSeconds(),t.length)},S(n,t){let e=t.length,i=n.getMilliseconds(),s=Math.floor(i*Math.pow(10,e-3));return I(s,t.length)}};var be={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},La={G:function(n,t,e){let 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"){let i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return vt.y(n,t)},Y:function(n,t,e,i){let s=me(n,i),o=s>0?s:1-s;if(t==="YY"){let r=o%100;return I(r,2)}return t==="Yo"?e.ordinalNumber(o,{unit:"year"}):I(o,t.length)},R:function(n,t){let e=zn(n);return I(e,t.length)},u:function(n,t){let e=n.getFullYear();return I(e,t.length)},Q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return I(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){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return I(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){let i=n.getMonth();switch(t){case"M":case"MM":return vt.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){let i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return I(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){let s=Qn(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):I(s,t.length)},I:function(n,t,e){let i=Un(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):I(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):vt.d(n,t)},D:function(n,t,e){let i=Sa(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):I(i,t.length)},E:function(n,t,e){let 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){let s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return I(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){let s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return I(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){let i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return I(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){let 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){let i=n.getHours(),s;switch(i===12?s=be.noon:i===0?s=be.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){let i=n.getHours(),s;switch(i>=17?s=be.evening:i>=12?s=be.afternoon:i>=4?s=be.morning:s=be.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 vt.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):vt.H(n,t)},K:function(n,t,e){let i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):I(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(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):vt.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):vt.s(n,t)},S:function(n,t){return vt.S(n,t)},X:function(n,t,e,i){let o=(i._originalDate||n).getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return Aa(o);case"XXXX":case"XX":return Qt(o);case"XXXXX":case"XXX":default:return Qt(o,":")}},x:function(n,t,e,i){let o=(i._originalDate||n).getTimezoneOffset();switch(t){case"x":return Aa(o);case"xxxx":case"xx":return Qt(o);case"xxxxx":case"xxx":default:return Qt(o,":")}},O:function(n,t,e,i){let o=(i._originalDate||n).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ca(o,":");case"OOOO":default:return"GMT"+Qt(o,":")}},z:function(n,t,e,i){let o=(i._originalDate||n).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ca(o,":");case"zzzz":default:return"GMT"+Qt(o,":")}},t:function(n,t,e,i){let s=i._originalDate||n,o=Math.floor(s.getTime()/1e3);return I(o,t.length)},T:function(n,t,e,i){let o=(i._originalDate||n).getTime();return I(o,t.length)}};function Ca(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),o=i%60;return o===0?e+String(s):e+String(s)+t+I(o,2)}function Aa(n,t){return n%60===0?(n>0?"-":"+")+I(Math.abs(n)/60,2):Qt(n,t)}function Qt(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),s=I(Math.floor(i/60),2),o=I(i%60,2);return e+s+t+o}var Ia=(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"})}},Ea=(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"})}},qu=(n,t)=>{let e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ia(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}}",Ia(i,t)).replace("{{time}}",Ea(s,t))},Xe={p:Ea,P:qu};var $u=/^D+$/,Xu=/^Y+$/,Uu=["D","DD","YY","YYYY"];function Gn(n){return $u.test(n)}function Kn(n){return Xu.test(n)}function xe(n,t,e){let i=Qu(n,t,e);if(console.warn(i),Uu.includes(n))throw new RangeError(i)}function Qu(n,t,e){let 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`}var Gu=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ku=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zu=/^'([^]*?)'?$/,Ju=/''/g,td=/[a-zA-Z]/;function Ra(n,t,e){let i=et(),s=e?.locale??i.locale??$e,o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=x(n);if(!Hn(a))throw new RangeError("Invalid time value");let c={firstWeekContainsDate:o,weekStartsOn:r,locale:s,_originalDate:a};return t.match(Ku).map(function(h){let u=h[0];if(u==="p"||u==="P"){let d=Xe[u];return d(h,s.formatLong)}return h}).join("").match(Gu).map(function(h){if(h==="''")return"'";let u=h[0];if(u==="'")return ed(h);let d=La[u];if(d)return!e?.useAdditionalWeekYearTokens&&Kn(h)&&xe(h,t,String(n)),!e?.useAdditionalDayOfYearTokens&&Gn(h)&&xe(h,t,String(n)),d(a,h,s.localize,c);if(u.match(td))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return h}).join("")}function ed(n){let t=n.match(Zu);return t?t[1].replace(Ju,"'"):n}function Fa(){return Object.assign({},et())}function Na(n){let e=x(n).getDay();return e===0&&(e=7),e}function Wa(n,t){let e=t instanceof Date?O(t,0):new t(0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}var nd=10,Zn=class{subPriority=0;validate(t,e){return!0}},Jn=class extends Zn{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)}},ti=class extends Zn{priority=nd;subPriority=-1;set(t,e){return e.timestampIsSet?t:O(t,Wa(t,Date))}};var k=class{run(t,e,i,s){let o=this.parse(t,e,i,s);return o?{setter:new Jn(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,i){return!0}};var ei=class extends k{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});case"GGGG":default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]};var A={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}/},ct={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 F(n,t){return n&&{value:t(n.value),rest:n.rest}}function T(n,t){let e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function lt(n,t){let e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};let 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*Dt+o*kt+r*Xr),rest:t.slice(e[0].length)}}function ni(n){return T(A.anyDigitsSigned,n)}function P(n,t){switch(n){case 1:return T(A.singleDigit,t);case 2:return T(A.twoDigits,t);case 3:return T(A.threeDigits,t);case 4:return T(A.fourDigits,t);default:return T(new RegExp("^\\d{1,"+n+"}"),t)}}function ye(n,t){switch(n){case 1:return T(A.singleDigitSigned,t);case 2:return T(A.twoDigitsSigned,t);case 3:return T(A.threeDigitsSigned,t);case 4:return T(A.fourDigitsSigned,t);default:return T(new RegExp("^-?\\d{1,"+n+"}"),t)}}function _e(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 ii(n,t){let e=t>0,i=e?t:1-t,s;if(i<=50)s=n||100;else{let o=i+50,r=Math.floor(o/100)*100,a=n>=o%100;s=n+r-(a?100:0)}return e?s:1-s}function si(n){return n%400===0||n%4===0&&n%100!==0}var oi=class extends k{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){let s=o=>({year:o,isTwoDigitYear:e==="yy"});switch(e){case"y":return F(P(4,t),s);case"yo":return F(i.ordinalNumber(t,{unit:"year"}),s);default:return F(P(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){let s=t.getFullYear();if(i.isTwoDigitYear){let r=ii(i.year,s);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}let o=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}};var ri=class extends k{priority=130;parse(t,e,i){let s=o=>({year:o,isTwoDigitYear:e==="YY"});switch(e){case"Y":return F(P(4,t),s);case"Yo":return F(i.ordinalNumber(t,{unit:"year"}),s);default:return F(P(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,s){let o=me(t,s);if(i.isTwoDigitYear){let a=ii(i.year,o);return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,s)}let r=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]};var ai=class extends k{priority=130;parse(t,e){return e==="R"?ye(4,t):ye(e.length,t)}set(t,e,i){let s=O(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),ht(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]};var ci=class extends k{priority=130;parse(t,e){return e==="u"?ye(4,t):ye(e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]};var li=class extends k{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return P(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]};var hi=class extends k{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return P(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]};var ui=class extends k{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){let s=o=>o-1;switch(e){case"M":return F(T(A.month,t),s);case"MM":return F(P(2,t),s);case"Mo":return F(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}};var di=class extends k{priority=110;parse(t,e,i){let s=o=>o-1;switch(e){case"L":return F(T(A.month,t),s);case"LL":return F(P(2,t),s);case"Lo":return F(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]};function za(n,t,e){let i=x(n),s=Qn(i,e)-t;return i.setDate(i.getDate()-s*7),i}var fi=class extends k{priority=100;parse(t,e,i){switch(e){case"w":return T(A.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return P(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,s){return Q(za(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]};function Ba(n,t){let e=x(n),i=Un(e)-t;return e.setDate(e.getDate()-i*7),e}var pi=class extends k{priority=100;parse(t,e,i){switch(e){case"I":return T(A.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return P(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return ht(Ba(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]};var id=[31,28,31,30,31,30,31,31,30,31,30,31],sd=[31,29,31,30,31,30,31,31,30,31,30,31],gi=class extends k{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return T(A.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return P(e.length,t)}}validate(t,e){let i=t.getFullYear(),s=si(i),o=t.getMonth();return s?e>=1&&e<=sd[o]:e>=1&&e<=id[o]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]};var mi=class extends k{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return T(A.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return P(e.length,t)}}validate(t,e){let i=t.getFullYear();return si(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]};function we(n,t,e){let i=et(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=x(n),r=o.getDay(),c=(t%7+7)%7,l=7-s,h=t<0||t>6?t-(r+l)%7:(c+l)%7-(r+l)%7;return Et(o,h)}var bi=class extends k{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=we(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]};var xi=class extends k{priority=90;parse(t,e,i,s){let o=r=>{let a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(e){case"e":case"ee":return F(P(e.length,t),o);case"eo":return F(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=we(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]};var yi=class extends k{priority=90;parse(t,e,i,s){let o=r=>{let a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(e){case"c":case"cc":return F(P(e.length,t),o);case"co":return F(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=we(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]};function Ha(n,t){let e=x(n),i=Na(e),s=t-i;return Et(e,s)}var _i=class extends k{priority=90;parse(t,e,i){let s=o=>o===0?7:o;switch(e){case"i":case"ii":return P(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return F(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return F(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return F(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiii":default:return F(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=Ha(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]};var wi=class extends k{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(_e(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]};var Mi=class extends k{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(_e(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]};var ki=class extends k{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(_e(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]};var Di=class extends k{priority=70;parse(t,e,i){switch(e){case"h":return T(A.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return P(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){let s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]};var vi=class extends k{priority=70;parse(t,e,i){switch(e){case"H":return T(A.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return P(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]};var Pi=class extends k{priority=70;parse(t,e,i){switch(e){case"K":return T(A.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return P(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]};var Oi=class extends k{priority=70;parse(t,e,i){switch(e){case"k":return T(A.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return P(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){let s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]};var Si=class extends k{priority=60;parse(t,e,i){switch(e){case"m":return T(A.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return P(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]};var Ti=class extends k{priority=50;parse(t,e,i){switch(e){case"s":return T(A.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return P(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]};var Ci=class extends k{priority=30;parse(t,e){let i=s=>Math.floor(s*Math.pow(10,-e.length+3));return F(P(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]};var Ai=class extends k{priority=10;parse(t,e){switch(e){case"X":return lt(ct.basicOptionalMinutes,t);case"XX":return lt(ct.basic,t);case"XXXX":return lt(ct.basicOptionalSeconds,t);case"XXXXX":return lt(ct.extendedOptionalSeconds,t);case"XXX":default:return lt(ct.extended,t)}}set(t,e,i){return e.timestampIsSet?t:O(t,t.getTime()-Xt(t)-i)}incompatibleTokens=["t","T","x"]};var Li=class extends k{priority=10;parse(t,e){switch(e){case"x":return lt(ct.basicOptionalMinutes,t);case"xx":return lt(ct.basic,t);case"xxxx":return lt(ct.basicOptionalSeconds,t);case"xxxxx":return lt(ct.extendedOptionalSeconds,t);case"xxx":default:return lt(ct.extended,t)}}set(t,e,i){return e.timestampIsSet?t:O(t,t.getTime()-Xt(t)-i)}incompatibleTokens=["t","T","X"]};var Ii=class extends k{priority=40;parse(t){return ni(t)}set(t,e,i){return[O(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"};var Ei=class extends k{priority=20;parse(t){return ni(t)}set(t,e,i){return[O(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"};var Ya={G:new ei,y:new oi,Y:new ri,R:new ai,u:new ci,Q:new li,q:new hi,M:new ui,L:new di,w:new fi,I:new pi,d:new gi,D:new mi,E:new bi,e:new xi,c:new yi,i:new _i,a:new wi,b:new Mi,B:new ki,h:new Di,H:new vi,K:new Pi,k:new Oi,m:new Si,s:new Ti,S:new Ci,X:new Ai,x:new Li,t:new Ii,T:new Ei};var od=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ad=/^'([^]*?)'?$/,cd=/''/g,ld=/\S/,hd=/[a-zA-Z]/;function Va(n,t,e,i){let s=Fa(),o=i?.locale??s.locale??$e,r=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(t==="")return n===""?x(e):O(e,NaN);let c={firstWeekContainsDate:r,weekStartsOn:a,locale:o},l=[new ti],h=t.match(rd).map(p=>{let g=p[0];if(g in Xe){let b=Xe[g];return b(p,o.formatLong)}return p}).join("").match(od),u=[];for(let p of h){!i?.useAdditionalWeekYearTokens&&Kn(p)&&xe(p,t,n),!i?.useAdditionalDayOfYearTokens&&Gn(p)&&xe(p,t,n);let g=p[0],b=Ya[g];if(b){let{incompatibleTokens:_}=b;if(Array.isArray(_)){let M=u.find(y=>_.includes(y.token)||y.token===g);if(M)throw new RangeError(`The format string mustn't contain \`${M.fullToken}\` and \`${p}\` at the same time`)}else if(b.incompatibleTokens==="*"&&u.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);u.push({token:g,fullToken:p});let w=b.run(n,p,o.match,c);if(!w)return O(e,NaN);l.push(w.setter),n=w.rest}else{if(g.match(hd))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");if(p==="''"?p="'":g==="'"&&(p=ud(p)),n.indexOf(p)===0)n=n.slice(p.length);else return O(e,NaN)}}if(n.length>0&&ld.test(n))return O(e,NaN);let d=l.map(p=>p.priority).sort((p,g)=>g-p).filter((p,g,b)=>b.indexOf(p)===g).map(p=>l.filter(g=>g.priority===p).sort((g,b)=>b.subPriority-g.subPriority)).map(p=>p[0]),f=x(e);if(isNaN(f.getTime()))return O(e,NaN);let m={};for(let p of d){if(!p.validate(f,c))return O(e,NaN);let g=p.set(f,m,c);Array.isArray(g)?(f=g[0],Object.assign(m,g[1])):f=g}return O(e,f)}function ud(n){return n.match(ad)[1].replace(cd,"'")}function ja(n){let t=x(n);return t.setMinutes(0,0,0),t}function qa(n){let t=x(n);return t.setMilliseconds(0),t}function $a(n,t){let e=t?.additionalDigits??2,i=gd(n),s;if(i.date){let c=md(i.date,e);s=bd(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);let o=s.getTime(),r=0,a;if(i.time&&(r=xd(i.time),isNaN(r)))return new Date(NaN);if(i.timezone){if(a=yd(i.timezone),isNaN(a))return new Date(NaN)}else{let c=new Date(o+r),l=new Date(0);return l.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),l.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),l}return new Date(o+r+a)}var Ri={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},dd=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,fd=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,pd=/^([+-])(\d{2})(?::?(\d{2}))?$/;function gd(n){let t={},e=n.split(Ri.dateTimeDelimiter),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){let s=Ri.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function md(n,t){let e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};let 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 bd(n,t){if(t===null)return new Date(NaN);let e=n.match(dd);if(!e)return new Date(NaN);let i=!!e[4],s=Ue(e[1]),o=Ue(e[2])-1,r=Ue(e[3]),a=Ue(e[4]),c=Ue(e[5])-1;if(i)return Dd(t,a,c)?_d(t,a,c):new Date(NaN);{let l=new Date(0);return!Md(t,o,r)||!kd(t,s)?new Date(NaN):(l.setUTCFullYear(t,o,Math.max(s,r)),l)}}function Ue(n){return n?parseInt(n):1}function xd(n){let t=n.match(fd);if(!t)return NaN;let e=As(t[1]),i=As(t[2]),s=As(t[3]);return vd(e,i,s)?e*Dt+i*kt+s*1e3:NaN}function As(n){return n&&parseFloat(n.replace(",","."))||0}function yd(n){if(n==="Z")return 0;let t=n.match(pd);if(!t)return 0;let e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Pd(i,s)?e*(i*Dt+s*kt):NaN}function _d(n,t,e){let i=new Date(0);i.setUTCFullYear(n,0,4);let s=i.getUTCDay()||7,o=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+o),i}var wd=[31,null,31,30,31,30,31,31,30,31,30,31];function Xa(n){return n%400===0||n%4===0&&n%100!==0}function Md(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(wd[t]||(Xa(n)?29:28))}function kd(n,t){return t>=1&&t<=(Xa(n)?366:365)}function Dd(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function vd(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Pd(n,t){return t>=0&&t<=59}var Od={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"};Cs._date.override({_id:"date-fns",formats:function(){return Od},parse:function(n,t){if(n===null||typeof n>"u")return null;let e=typeof n;return e==="number"||n instanceof Date?n=x(n):e==="string"&&(typeof t=="string"?n=Va(n,t,new Date,this.options):n=$a(n,this.options)),Hn(n)?n.getTime():null},format:function(n,t){return Ra(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Rt(n,t);case"second":return Jr(n,t);case"minute":return Kr(n,t);case"hour":return Qr(n,t);case"day":return Et(n,t);case"week":return ta(n,t);case"month":return fe(n,t);case"quarter":return Zr(n,t);case"year":return ea(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ft(n,t);case"second":return ha(n,t);case"minute":return aa(n,t);case"hour":return ra(n,t);case"day":return Yn(n,t);case"week":return ua(n,t);case"month":return qn(n,t);case"quarter":return la(n,t);case"year":return da(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return qa(n);case"minute":return fa(n);case"hour":return ja(n);case"day":return qe(n);case"week":return Q(n);case"isoWeek":return Q(n,{weekStartsOn:+e});case"month":return ga(n);case"quarter":return pa(n);case"year":return $n(n);default:return n}},endOf:function(n,t){switch(t){case"second":return wa(n);case"minute":return ya(n);case"hour":return ba(n);case"day":return Vn(n);case"week":return xa(n);case"month":return jn(n);case"quarter":return _a(n);case"year":return ma(n);default:return n}}});he.register(Yr,Cn,In,Fn,En,de,jr);document.addEventListener("DOMContentLoaded",async()=>{let n=document.getElementById("chart"),e=`/phperkaigi/2024/golf/api/quizzes/${n.dataset.quizId}/chart.json`,i=await fetch(e).then(c=>c.json());if(i.error)return;let s=i.stats;for(let c of s){let l=[];for(let h of c.scores)(l.length===0||l[l.length-1].code_size>h.code_size)&&l.push(h);c.scores=l}let o=s.flatMap(c=>c.scores.map(l=>({...l,user:c.user}))).toSorted((c,l)=>c.submitted_at-l.submitted_at),r=(()=>{let c=[],l=new Map;for(let{user:h,submitted_at:u,code_size:d}of o){l.set(h.name,{user:h,submitted_at:u,code_size:d});let f=l.values().toArray().toSorted((p,g)=>p.code_size===g.code_size?p.submitted_at-g.submitted_at:p.code_size-g.code_size),m=new Map;for(let[p,{user:g,code_size:b}]of f.entries())m.set(g.name,{user:g,code_size:b,rank:p+1});c.push({submitted_at:u,scores:m})}return c})(),a=(()=>{let c=new Map;for(let{submitted_at:l,scores:h}of r)for(let[u,{user:d,code_size:f,rank:m}]of h.entries())c.has(u)||c.set(u,[]),c.get(u).push({user:d,code_size:f,rank:m,submitted_at:l});return c.values().toArray().toSorted((l,h)=>{let u=l[l.length-1].rank,d=h[h.length-1].rank;return u-d})})();new he(n,{type:"line",data:{datasets:a.map(c=>({label:`${c[0].user.name}${c[0].user.is_admin?" (staff)":""}`,data:c.map(l=>({x:l.submitted_at*1e3,y:l.rank,code_size:l.code_size}))}))},options:{scales:{x:{type:"time",time:{parsing:!1,display:!1,unit:"day",tooltipFormat:"yyyy-MM-dd HH:mm:ss",displayFormats:{day:"yyyy-MM-dd"}},title:{display:!0,text:"\u65E5\u6642"}},y:{title:{display:!0,text:"\u9806\u4F4D"},reverse:!0,min:1,offset:!0}},plugins:{tooltip:{callbacks:{label:c=>{let l=c.dataset.label,h=c.raw.code_size;return`${l} (${h} byte)`}}}}}})});})(); +`):n}function Xh(n,t){let{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 mr(n,t){let e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:r,boxHeight:a}=t,c=Z(t.bodyFont),l=Z(t.titleFont),h=Z(t.footerFont),u=o.length,d=s.length,f=i.length,g=it(t.padding),m=g.height,p=0,b=i.reduce((w,y)=>w+y.before.length+y.lines.length+y.after.length,0);if(b+=n.beforeBody.length+n.afterBody.length,u&&(m+=u*l.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let w=t.displayColors?Math.max(a,c.lineHeight):c.lineHeight;m+=f*w+(b-f)*c.lineHeight+(b-1)*t.bodySpacing}d&&(m+=t.footerMarginTop+d*h.lineHeight+(d-1)*t.footerSpacing);let x=0,M=function(w){p=Math.max(p,e.measureText(w).width+x)};return e.save(),e.font=l.string,E(n.title,M),e.font=c.string,E(n.beforeBody.concat(n.afterBody),M),x=t.displayColors?r+2+t.boxPadding:0,E(i,w=>{E(w.before,M),E(w.lines,M),E(w.after,M)}),x=0,e.font=h.string,E(n.footer,M),e.restore(),p+=g.width,{width:p,height:m}}function Uh(n,t){let{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Qh(n,t,e,i){let{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 Gh(n,t,e,i){let{x:s,width:o}=e,{width:r,chartArea:{left:a,right:c}}=n,l="center";return i==="center"?l=s<=(a+c)/2?"left":"right":s<=o/2?l="left":s>=r-o/2&&(l="right"),Qh(l,n,t,e)&&(l="center"),l}function br(n,t,e){let i=e.yAlign||t.yAlign||Uh(n,e);return{xAlign:e.xAlign||t.xAlign||Gh(n,t,e,i),yAlign:i}}function Kh(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Zh(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function xr(n,t,e,i){let{caretSize:s,caretPadding:o,cornerRadius:r}=n,{xAlign:a,yAlign:c}=e,l=s+o,{topLeft:h,topRight:u,bottomLeft:d,bottomRight:f}=re(r),g=Kh(t,a),m=Zh(t,c,l);return c==="center"?a==="left"?g+=l:a==="right"&&(g-=l):a==="left"?g-=Math.max(h,d)+s:a==="right"&&(g+=Math.max(u,f)+s),{x:at(g,0,i.width-t.width),y:at(m,0,i.height-t.height)}}function Pn(n,t,e){let i=it(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function yr(n){return gt([],kt(n))}function Jh(n,t,e){return wt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function _r(n,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}var Xr={beforeTitle:pt,title(n){if(n.length>0){let 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:pt,beforeBody:pt,beforeLabel:pt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");let e=n.formattedValue;return R(e)||(t+=e),t},labelColor(n){let 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){let e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:pt,afterBody:pt,beforeFooter:pt,footer:pt,afterFooter:pt};function J(n,t,e,i){let s=n[t].call(e,i);return typeof s>"u"?Xr[t].call(e,i):s}var Rn=class extends $t{static positioners=Ye;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new Cn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Jh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){let{callbacks:i}=e,s=J(i,"beforeTitle",this,t),o=J(i,"title",this,t),r=J(i,"afterTitle",this,t),a=[];return a=gt(a,kt(s)),a=gt(a,kt(o)),a=gt(a,kt(r)),a}getBeforeBody(t,e){return yr(J(e.callbacks,"beforeBody",this,t))}getBody(t,e){let{callbacks:i}=e,s=[];return E(t,o=>{let r={before:[],lines:[],after:[]},a=_r(i,o);gt(r.before,kt(J(a,"beforeLabel",this,o))),gt(r.lines,J(a,"label",this,o)),gt(r.after,kt(J(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return yr(J(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:i}=e,s=J(i,"beforeFooter",this,t),o=J(i,"footer",this,t),r=J(i,"afterFooter",this,t),a=[];return a=gt(a,kt(s)),a=gt(a,kt(o)),a=gt(a,kt(r)),a}_createItems(t){let e=this._active,i=this.chart.data,s=[],o=[],r=[],a=[],c,l;for(c=0,l=e.length;c<l;++c)a.push(Xh(this.chart,e[c]));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))),E(a,h=>{let u=_r(t.callbacks,h);s.push(J(u,"labelColor",this,h)),o.push(J(u,"labelPointStyle",this,h)),r.push(J(u,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){let i=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=Ye[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);let c=this._size=mr(this,i),l=Object.assign({},a,c),h=br(this.chart,i,l),u=xr(i,l,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){let 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){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:c,topRight:l,bottomLeft:h,bottomRight:u}=re(a),{x:d,y:f}=t,{width:g,height:m}=e,p,b,x,M,w,y;return o==="center"?(w=f+m/2,s==="left"?(p=d,b=p-r,M=w+r,y=w-r):(p=d+g,b=p+r,M=w-r,y=w+r),x=p):(s==="left"?b=d+Math.max(c,h)+r:s==="right"?b=d+g-Math.max(l,u)-r:b=this.caretX,o==="top"?(M=f,w=M-r,p=b-r,x=b+r):(M=f+m,w=M+r,p=b+r,x=b-r),y=M),{x1:p,x2:b,x3:x,y1:M,y2:w,y3:y}}drawTitle(t,e,i){let s=this.title,o=s.length,r,a,c;if(o){let l=wn(i.rtl,this.x,this.width);for(t.x=Pn(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",r=Z(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,c=0;c<o;++c)e.fillText(s[c],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,c+1===o&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,o){let r=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:c,boxWidth:l}=o,h=Z(o.bodyFont),u=Pn(this,"left",o),d=s.x(u),f=c<h.lineHeight?(h.lineHeight-c)/2:0,g=e.y+f;if(o.usePointStyle){let m={radius:Math.min(l,c)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},p=s.leftForLtr(d,l)+l/2,b=g+c/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,gn(t,m,p,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,gn(t,m,p,b)}else{t.lineWidth=L(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let m=s.leftForLtr(d,l),p=s.leftForLtr(s.xPlus(d,1),l-2),b=re(r.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,mn(t,{x:m,y:g,w:l,h:c,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),mn(t,{x:p,y:g+1,w:l-2,h:c-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,l,c),t.strokeRect(m,g,l,c),t.fillStyle=r.backgroundColor,t.fillRect(p,g+1,l-2,c-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:c,boxWidth:l,boxPadding:h}=i,u=Z(i.bodyFont),d=u.lineHeight,f=0,g=wn(i.rtl,this.x,this.width),m=function(D){e.fillText(D,g.x(t.x+f),t.y+d/2),t.y+=d+o},p=g.textAlign(r),b,x,M,w,y,P,v;for(e.textAlign=r,e.textBaseline="middle",e.font=u.string,t.x=Pn(this,p,i),e.fillStyle=i.bodyColor,E(this.beforeBody,m),f=a&&p!=="right"?r==="center"?l/2+h:l+2+h:0,w=0,P=s.length;w<P;++w){for(b=s[w],x=this.labelTextColors[w],e.fillStyle=x,E(b.before,m),M=b.lines,a&&M.length&&(this._drawColorBox(e,t,w,g,i),d=Math.max(u.lineHeight,c)),y=0,v=M.length;y<v;++y)m(M[y]),d=u.lineHeight;E(b.after,m)}f=0,d=u.lineHeight,E(this.afterBody,m),t.y-=o}drawFooter(t,e,i){let s=this.footer,o=s.length,r,a;if(o){let c=wn(i.rtl,this.x,this.width);for(t.x=Pn(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=c.textAlign(i.footerAlign),e.textBaseline="middle",r=Z(i.footerFont),e.fillStyle=i.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(s[a],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){let{xAlign:o,yAlign:r}=this,{x:a,y:c}=t,{width:l,height:h}=i,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=re(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+u,c),r==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+l-d,c),e.quadraticCurveTo(a+l,c,a+l,c+d),r==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+l,c+h-g),e.quadraticCurveTo(a+l,c+h,a+l-g,c+h),r==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+f,c+h),e.quadraticCurveTo(a,c+h,a,c+h-f),r==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,c+u),e.quadraticCurveTo(a,c,a+u,c),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){let r=Ye[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=mr(this,t),c=Object.assign({},r,this._size),l=br(e,t,c),h=xr(t,c,l,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),i=this.opacity;if(!i)return;this._updateAnimationTarget(e);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;let r=it(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),Fo(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Ro(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let i=this._active,s=t.map(({datasetIndex:a,index:c})=>{let l=this.chart.getDatasetMeta(a);if(!l)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:l.data[c],index:c}}),o=!Ce(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;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),c=e||!Ce(r,o)||a;return c&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_getActiveElements(t,e,i,s){let 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);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){let{caretX:i,caretY:s,options:o}=this,r=Ye[o.position].call(this,t,e);return r!==!1&&(i!==r.x||s!==r.y)}},Ur={id:"tooltip",_element:Rn,positioners:Ye,afterInit(n,t,e){e&&(n.tooltip=new Rn({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){let t=n.tooltip;if(t&&t._willRender()){let 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){let 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:Xr},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"]};function tu(n,t){let e=[],{bounds:s,step:o,min:r,max:a,precision:c,count:l,maxTicks:h,maxDigits:u,includeBounds:d}=n,f=o||1,g=h-1,{min:m,max:p}=t,b=!R(r),x=!R(a),M=!R(l),w=(p-m)/(u+1),y=Xi((p-m)/g/f)*f,P,v,D,C;if(y<1e-14&&!b&&!x)return[{value:m},{value:p}];C=Math.ceil(p/y)-Math.floor(m/y),C>g&&(y=Xi(C*y/g/f)*f),R(c)||(P=Math.pow(10,c),y=Math.ceil(y*P)/P),s==="ticks"?(v=Math.floor(m/y)*y,D=Math.ceil(p/y)*y):(v=m,D=p),b&&x&&o&&so((a-r)/o,y/1e3)?(C=Math.round(Math.min((a-r)/y,h)),y=(a-r)/C,v=r,D=a):M?(v=b?r:v,D=x?a:D,C=l-1,y=(D-v)/C):(C=(D-v)/y,ie(C,Math.round(C),y/1e3)?C=Math.round(C):C=Math.ceil(C));let Y=Math.max(Qi(y),Qi(v));P=Math.pow(10,R(c)?Y:c),v=Math.round(v*P)/P,D=Math.round(D*P)/P;let V=0;for(b&&(d&&v!==r?(e.push({value:r}),v<r&&V++,ie(Math.round((v+V*y)*P)/P,r,wr(r,w,n))&&V++):v<r&&V++);V<C;++V){let q=Math.round((v+V*y)*P)/P;if(x&&q>a)break;e.push({value:q})}return x&&d&&D!==a?e.length&&ie(e[e.length-1].value,a,wr(a,w,n))?e[e.length-1].value=a:e.push({value:a}):(!x||D===a)&&e.push({value:D}),e}function wr(n,t,{horizontal:e,minRotation:i}){let s=ct(i),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+n).length;return Math.min(t/o,r)}var ue=class extends le{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 R(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds(),{min:s,max:o}=this,r=c=>s=e?s:c,a=c=>o=i?o:c;if(t){let c=Ht(s),l=Ht(o);c<0&&l<0?a(0):c>0&&l>0&&r(0)}if(s===o){let c=o===0?1:Math.abs(o*.05);a(o+c),t||r(s-c)}this.min=s,this.max=o}getTickLimit(){let t=this.options.ticks,{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(){let t=this.options,e=t.ticks,i=this.getTickLimit();i=Math.max(2,i);let 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=tu(s,o);return t.bounds==="ticks"&&Ui(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let t=this.ticks,e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){let 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 oe(t,this.chart.options.locale,this.options.ticks.format)}},zn=class extends ue{static id="linear";static defaults={ticks:{callback:Ie.formatters.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?t:0,this.max=$(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,i=ct(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}},je=n=>Math.floor(_t(n)),qt=(n,t)=>Math.pow(10,je(n)+t);function Mr(n){return n/Math.pow(10,je(n))===1}function kr(n,t,e){let i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function eu(n,t){let e=t-n,i=je(e);for(;kr(n,t,i)>10;)i++;for(;kr(n,t,i)<10;)i--;return Math.min(i,je(n))}function nu(n,{min:t,max:e}){t=K(n.min,t);let i=[],s=je(t),o=eu(t,e),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),c=s>o?Math.pow(10,s):0,l=Math.round((t-c)*r)/r,h=Math.floor((t-c)/a/10)*a*10,u=Math.floor((l-h)/Math.pow(10,o)),d=K(n.min,Math.round((c+h+u*Math.pow(10,o))*r)/r);for(;d<e;)i.push({value:d,major:Mr(d),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),d=Math.round((c+h+u*Math.pow(10,o))*r)/r;let f=K(n.max,d);return i.push({value:f,major:Mr(f),significand:u}),i}var vr=class extends le{static id="logarithmic";static defaults={ticks:{callback:Ie.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let i=ue.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return $(i)&&i>0?i:null}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=$(t)?Math.max(0,t):null,this.max=$(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!$(this._userMin)&&(this.min=t===qt(this.min,0)?qt(this.min,-1):qt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),i=this.min,s=this.max,o=a=>i=t?i:a,r=a=>s=e?s:a;i===s&&(i<=0?(o(1),r(10)):(o(qt(i,-1)),r(qt(s,1)))),i<=0&&o(qt(s,-1)),s<=0&&r(qt(i,1)),this.min=i,this.max=s}buildTicks(){let t=this.options,e={min:this._userMin,max:this._userMax},i=nu(e,this);return t.bounds==="ticks"&&Ui(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":oe(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=_t(t),this._valueRange=_t(this.max)-_t(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(_t(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}};function As(n){let t=n.ticks;if(t.display&&n.display){let e=it(t.backdropPadding);return F(t.font&&t.font.size,W.font.size)+e.height}return 0}function iu(n,t,e){return e=N(e)?e:[e],{w:yo(n,t.string,e),h:e.length*t.lineHeight}}function Dr(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 su(n){let 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?H/o:0;for(let c=0;c<o;c++){let l=r.setContext(n.getPointLabelContext(c));s[c]=l.padding;let h=n.getPointPosition(c,n.drawingArea+s[c],a),u=Z(l.font),d=iu(n.ctx,u,n._pointLabels[c]);i[c]=d;let f=rt(n.getIndexAngle(c)+a),g=Math.round(dn(f)),m=Dr(g,h.x,d.w,0,180),p=Dr(g,h.y,d.h,90,270);ou(e,t,f,m,p)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=cu(n,i,s)}function ou(n,t,e,i,s){let o=Math.abs(Math.sin(e)),r=Math.abs(Math.cos(e)),a=0,c=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?(c=(t.t-s.start)/r,n.t=Math.min(n.t,t.t-c)):s.end>t.b&&(c=(s.end-t.b)/r,n.b=Math.max(n.b,t.b+c))}function ru(n,t,e){let i=n.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,c=n.getPointPosition(t,i+s+r,o),l=Math.round(dn(rt(c.angle+G))),h=uu(c.y,a.h,l),u=lu(l),d=hu(c.x,a.w,u);return{visible:!0,x:c.x,y:h,textAlign:u,left:d,top:h,right:d+a.w,bottom:h+a.h}}function au(n,t){if(!t)return!0;let{left:e,top:i,right:s,bottom:o}=n;return!(ft({x:e,y:i},t)||ft({x:e,y:o},t)||ft({x:s,y:i},t)||ft({x:s,y:o},t))}function cu(n,t,e){let i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:r,display:a}=o.pointLabels,c={extra:As(o)/2,additionalAngle:r?H/s:0},l;for(let h=0;h<s;h++){c.padding=e[h],c.size=t[h];let u=ru(n,h,c);i.push(u),a==="auto"&&(u.visible=au(u,l),u.visible&&(l=u))}return i}function lu(n){return n===0||n===180?"center":n<180?"left":"right"}function hu(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function uu(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function du(n,t,e){let{left:i,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!R(a)){let c=re(t.borderRadius),l=it(t.backdropPadding);n.fillStyle=a;let h=i-l.left,u=s-l.top,d=o-i+l.width,f=r-s+l.height;Object.values(c).some(g=>g!==0)?(n.beginPath(),mn(n,{x:h,y:u,w:d,h:f,radius:c}),n.fill()):n.fillRect(h,u,d,f)}}function fu(n,t){let{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){let o=n._pointLabelItems[s];if(!o.visible)continue;let r=i.setContext(n.getPointLabelContext(s));du(e,r,o);let a=Z(r.font),{x:c,y:l,textAlign:h}=o;Ee(e,n._pointLabels[s],c,l+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Qr(n,t,e,i){let{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,X);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 pu(n,t,e,i,s){let o=n.ctx,r=t.circular,{color:a,lineWidth:c}=t;!r&&!i||!a||!c||e<0||(o.save(),o.strokeStyle=a,o.lineWidth=c,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Qr(n,e,r,i),o.closePath(),o.stroke(),o.restore())}function gu(n,t,e){return wt(n,{label:e,index:t,type:"pointLabel"})}var Pr=class extends ue{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ie.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=it(As(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(){let{min:t,max:e}=this.getMinMax(!1);this.min=$(t)&&!isNaN(t)?t:0,this.max=$(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/As(this.options))}generateTickLabels(t){ue.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{let s=B(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){let t=this.options;t.display&&t.pointLabels.display?su(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){let e=X/(this._pointLabels.length||1),i=this.options.startAngle||0;return rt(t*e+ct(i))}getDistanceFromCenterForValue(t){if(R(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(R(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t<e.length){let i=e[t];return gu(this.getContext(),t,i)}}getPointPosition(t,e,i=0){let s=this.getIndexAngle(t)-G+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){let{left:e,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:e}}=this.options;if(t){let i=this.ctx;i.save(),i.beginPath(),Qr(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){let t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,r=this._pointLabels.length,a,c,l;if(e.pointLabels.display&&fu(this,r),s.display&&this.ticks.forEach((h,u)=>{if(u!==0||u===0&&this.min<0){c=this.getDistanceFromCenterForValue(h.value);let d=this.getContext(u),f=s.setContext(d),g=o.setContext(d);pu(this,f,c,r,g)}}),i.display){for(t.save(),a=r-1;a>=0;a--){let 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,c=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),l=this.getPointPosition(a,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;let s=this.getIndexAngle(0),o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,c)=>{if(c===0&&this.min>=0&&!e.reverse)return;let l=i.setContext(this.getContext(c)),h=Z(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=l.backdropColor;let u=it(l.backdropPadding);t.fillRect(-r/2-u.left,-o-h.size/2-u.top,r+u.width,h.size+u.height)}Ee(t,a.label,0,-o,h,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}},Wn={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}},tt=Object.keys(Wn);function Or(n,t){return n-t}function Sr(n,t){if(R(t))return null;let e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts,r=t;return typeof i=="function"&&(r=i(r)),$(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(se(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Tr(n,t,e,i){let s=tt.length;for(let o=tt.indexOf(n);o<s-1;++o){let r=Wn[tt[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=i)return tt[o]}return tt[s-1]}function mu(n,t,e,i,s){for(let o=tt.length-1;o>=tt.indexOf(e);o--){let r=tt[o];if(Wn[r].common&&n._adapter.diff(s,i,r)>=t-1)return r}return tt[e?tt.indexOf(e):0]}function bu(n){for(let t=tt.indexOf(n)+1,e=tt.length;t<e;++t)if(Wn[tt[t]].common)return tt[t]}function Cr(n,t,e){if(!e)n[t]=!0;else if(e.length){let{lo:i,hi:s}=fn(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function xu(n,t,e,i){let s=n._adapter,o=+s.startOf(t[0].value,i),r=t[t.length-1].value,a,c;for(a=o;a<=r;a=+s.add(a,1,i))c=e[a],c>=0&&(t[c].major=!0);return t}function Ar(n,t,e){let i=[],s={},o=t.length,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:xu(n,i,s,e)}var de=class extends le{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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={}){let i=t.time||(t.time={}),s=this._adapter=new Ls._date(t.adapters.date);s.init(e),ne(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:Sr(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,i=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function c(l){!r&&!isNaN(l.min)&&(s=Math.min(s,l.min)),!a&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!r||!a)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),s=$(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=$(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(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){let 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]);let o=this.min,r=this.max,a=lo(s,o,r);return this._unit=e.unit||(i.autoSkip?Tr(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):mu(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:bu(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Ar(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);let r=t.length<3?.5:.25;e=at(e,0,r),i=at(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){let t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,r=o.unit||Tr(o.minUnit,e,i,this._getLabelCapacity(e)),a=F(s.ticks.stepSize,1),c=r==="week"?o.isoWeekday:!1,l=se(c)||c===!0,h={},u=e,d,f;if(l&&(u=+t.startOf(u,"isoWeek",c)),u=+t.startOf(u,l?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);let g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=u,f=0;d<i;d=+t.add(d,a,r),f++)Cr(h,d,g);return(d===i||s.bounds==="ticks"||f===1)&&Cr(h,d,g),Object.keys(h).sort(Or).map(m=>+m)}getLabelForValue(t){let e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){let s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,s){let o=this.options,r=o.ticks.callback;if(r)return B(r,[t,e,i],this);let a=o.time.displayFormats,c=this._unit,l=this._majorUnit,h=c&&a[c],u=l&&a[l],d=i[e],f=l&&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){let e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){let e=this.options.ticks,i=this.ctx.measureText(t).width,s=ct(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){let e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,Ar(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;let 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(){let t=this._cache.labels||[],e,i;if(t.length)return t;let s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Sr(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return fo(t.sort(Or))}};function On(n,t,e){let i=0,s=n.length-1,o,r,a,c;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=At(n,"pos",t)),{pos:o,time:a}=n[i],{pos:r,time:c}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=At(n,"time",t)),{time:o,pos:a}=n[i],{time:r,pos:c}=n[s]);let l=r-o;return l?a+(c-a)*(t-o)/l:a}var Lr=class extends de{static id="timeseries";static defaults=de.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=On(e,this.min),this._tableRange=On(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:e,max:i}=this,s=[],o=[],r,a,c,l,h;for(r=0,a=t.length;r<a;++r)l=t[r],l>=e&&l<=i&&s.push(l);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],c=s[r-1],l=s[r],Math.round((h+c)/2)!==l&&o.push({time:l,pos:r/(a-1)});return o}_generate(){let t=this.min,e=this.max,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;let 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(On(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return On(this._table,i*this._tableRange+this._minPos,!0)}};var yu=Math.pow(10,8)*24*60*60*1e3,Bd=-yu,Nn=6048e5,Gr=864e5,vt=6e4,Dt=36e5,Kr=1e3;var _u=3600;var Zr=_u*24,Hd=Zr*7,wu=Zr*365.2425,Mu=wu/12,Yd=Mu*3,Is=Symbol.for("constructDateFrom");function S(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Is in n?n[Is](t):n instanceof Date?new n.constructor(t):new Date(t)}function _(n,t){return S(t||n,n)}function Rt(n,t,e){let i=_(n,e?.in);return isNaN(t)?S(e?.in||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function fe(n,t,e){let i=_(n,e?.in);if(isNaN(t))return S(e?.in||n,NaN);if(!t)return i;let s=i.getDate(),o=S(e?.in||n,i.getTime());o.setMonth(i.getMonth()+t+1,0);let r=o.getDate();return s>=r?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function pe(n,t,e){return S(e?.in||n,+_(n)+t)}function Jr(n,t,e){return pe(n,t*Dt,e)}var ku={};function et(){return ku}function Q(n,t){let e=et(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,s=_(n,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 ut(n,t){return Q(n,{...t,weekStartsOn:1})}function Bn(n,t){let e=_(n,t?.in),i=e.getFullYear(),s=S(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);let o=ut(s),r=S(e,0);r.setFullYear(i,0,4),r.setHours(0,0,0,0);let a=ut(r);return e.getTime()>=o.getTime()?i+1:e.getTime()>=a.getTime()?i:i-1}function Xt(n){let t=_(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 nt(n,...t){let e=S.bind(null,n||t.find(i=>typeof i=="object"));return t.map(e)}function $e(n,t){let e=_(n,t?.in);return e.setHours(0,0,0,0),e}function Hn(n,t,e){let[i,s]=nt(e?.in,n,t),o=$e(i),r=$e(s),a=+o-Xt(o),c=+r-Xt(r);return Math.round((a-c)/Gr)}function ta(n,t){let e=Bn(n,t),i=S(t?.in||n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),ut(i)}function ea(n,t,e){let i=_(n,e?.in);return i.setTime(i.getTime()+t*vt),i}function na(n,t,e){return fe(n,t*3,e)}function ia(n,t,e){return pe(n,t*1e3,e)}function sa(n,t,e){return Rt(n,t*7,e)}function oa(n,t,e){return fe(n,t*12,e)}function Ut(n,t){let e=+_(n)-+_(t);return e<0?-1:e>0?1:e}function ra(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Yn(n){return!(!ra(n)&&typeof n!="number"||isNaN(+_(n)))}function aa(n,t,e){let[i,s]=nt(e?.in,n,t),o=i.getFullYear()-s.getFullYear(),r=i.getMonth()-s.getMonth();return o*12+r}function ca(n,t,e){let[i,s]=nt(e?.in,n,t);return i.getFullYear()-s.getFullYear()}function Vn(n,t,e){let[i,s]=nt(e?.in,n,t),o=la(i,s),r=Math.abs(Hn(i,s));i.setDate(i.getDate()-o*r);let a=+(la(i,s)===-o),c=o*(r-a);return c===0?0:c}function la(n,t){let 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 bt(n){return t=>{let i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function ha(n,t,e){let[i,s]=nt(e?.in,n,t),o=(+i-+s)/Dt;return bt(e?.roundingMethod)(o)}function ge(n,t){return+_(n)-+_(t)}function ua(n,t,e){let i=ge(n,t)/vt;return bt(e?.roundingMethod)(i)}function jn(n,t){let e=_(n,t?.in);return e.setHours(23,59,59,999),e}function qn(n,t){let e=_(n,t?.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function da(n,t){let e=_(n,t?.in);return+jn(e,t)==+qn(e,t)}function $n(n,t,e){let[i,s,o]=nt(e?.in,n,n,t),r=Ut(s,o),a=Math.abs(aa(s,o));if(a<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-r*a);let c=Ut(s,o)===-r;da(i)&&a===1&&Ut(i,o)===1&&(c=!1);let l=r*(a-+c);return l===0?0:l}function fa(n,t,e){let i=$n(n,t,e)/3;return bt(e?.roundingMethod)(i)}function pa(n,t,e){let i=ge(n,t)/1e3;return bt(e?.roundingMethod)(i)}function ga(n,t,e){let i=Vn(n,t,e)/7;return bt(e?.roundingMethod)(i)}function ma(n,t,e){let[i,s]=nt(e?.in,n,t),o=Ut(i,s),r=Math.abs(ca(i,s));i.setFullYear(1584),s.setFullYear(1584);let a=Ut(i,s)===-o,c=o*(r-+a);return c===0?0:c}function ba(n,t){let e=_(n,t?.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function xa(n,t){let e=_(n,t?.in);return e.setDate(1),e.setHours(0,0,0,0),e}function ya(n,t){let e=_(n,t?.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Xn(n,t){let e=_(n,t?.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function _a(n,t){let e=_(n,t?.in);return e.setMinutes(59,59,999),e}function wa(n,t){let e=et(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??e.weekStartsOn??e.locale?.options?.weekStartsOn??0,s=_(n,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 Ma(n,t){let e=_(n,t?.in);return e.setSeconds(59,999),e}function ka(n,t){let e=_(n,t?.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function va(n,t){let e=_(n,t?.in);return e.setMilliseconds(999),e}var vu={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"}},Da=(n,t,e)=>{let i,s=vu[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e?.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Un(n){return(t={})=>{let e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}var Du={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Pu={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ou={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Pa={date:Un({formats:Du,defaultWidth:"full"}),time:Un({formats:Pu,defaultWidth:"full"}),dateTime:Un({formats:Ou,defaultWidth:"full"})};var Su={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Oa=(n,t,e,i)=>Su[n];function me(n){return(t,e)=>{let i=e?.context?String(e.context):"standalone",s;if(i==="formatting"&&n.formattingValues){let r=n.defaultFormattingWidth||n.defaultWidth,a=e?.width?String(e.width):r;s=n.formattingValues[a]||n.formattingValues[r]}else{let r=n.defaultWidth,a=e?.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[r]}let o=n.argumentCallback?n.argumentCallback(t):t;return s[o]}}var Tu={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Cu={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Au={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"]},Lu={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"]},Iu={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"}},Eu={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"}},Fu=(n,t)=>{let 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"},Sa={ordinalNumber:Fu,era:me({values:Tu,defaultWidth:"wide"}),quarter:me({values:Cu,defaultWidth:"wide",argumentCallback:n=>n-1}),month:me({values:Au,defaultWidth:"wide"}),day:me({values:Lu,defaultWidth:"wide"}),dayPeriod:me({values:Iu,defaultWidth:"wide",formattingValues:Eu,defaultFormattingWidth:"wide"})};function be(n){return(t,e={})=>{let i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],o=t.match(s);if(!o)return null;let r=o[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(a)?zu(a,u=>u.test(r)):Ru(a,u=>u.test(r)),l;l=n.valueCallback?n.valueCallback(c):c,l=e.valueCallback?e.valueCallback(l):l;let h=t.slice(r.length);return{value:l,rest:h}}}function Ru(n,t){for(let e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function zu(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Ta(n){return(t,e={})=>{let i=t.match(n.matchPattern);if(!i)return null;let 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;let a=t.slice(s.length);return{value:r,rest:a}}}var Wu=/^(\d+)(th|st|nd|rd)?/i,Nu=/\d+/i,Bu={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},Hu={any:[/^b/i,/^(a|c)/i]},Yu={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Vu={any:[/1/i,/2/i,/3/i,/4/i]},ju={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},qu={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]},$u={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},Xu={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]},Uu={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},Qu={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}},Ca={ordinalNumber:Ta({matchPattern:Wu,parsePattern:Nu,valueCallback:n=>parseInt(n,10)}),era:be({matchPatterns:Bu,defaultMatchWidth:"wide",parsePatterns:Hu,defaultParseWidth:"any"}),quarter:be({matchPatterns:Yu,defaultMatchWidth:"wide",parsePatterns:Vu,defaultParseWidth:"any",valueCallback:n=>n+1}),month:be({matchPatterns:ju,defaultMatchWidth:"wide",parsePatterns:qu,defaultParseWidth:"any"}),day:be({matchPatterns:$u,defaultMatchWidth:"wide",parsePatterns:Xu,defaultParseWidth:"any"}),dayPeriod:be({matchPatterns:Uu,defaultMatchWidth:"any",parsePatterns:Qu,defaultParseWidth:"any"})};var Xe={code:"en-US",formatDistance:Da,formatLong:Pa,formatRelative:Oa,localize:Sa,match:Ca,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Aa(n,t){let e=_(n,t?.in);return Hn(e,Xn(e))+1}function Qn(n,t){let e=_(n,t?.in),i=+ut(e)-+ta(e);return Math.round(i/Nn)+1}function xe(n,t){let e=_(n,t?.in),i=e.getFullYear(),s=et(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,r=S(t?.in||n,0);r.setFullYear(i+1,0,o),r.setHours(0,0,0,0);let a=Q(r,t),c=S(t?.in||n,0);c.setFullYear(i,0,o),c.setHours(0,0,0,0);let l=Q(c,t);return+e>=+a?i+1:+e>=+l?i:i-1}function La(n,t){let e=et(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??e.firstWeekContainsDate??e.locale?.options?.firstWeekContainsDate??1,s=xe(n,t),o=S(t?.in||n,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),Q(o,t)}function Gn(n,t){let e=_(n,t?.in),i=+Q(e,t)-+La(e,t);return Math.round(i/Nn)+1}function I(n,t){let e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}var Pt={y(n,t){let e=n.getFullYear(),i=e>0?e:1-e;return I(t==="yy"?i%100:i,t.length)},M(n,t){let e=n.getMonth();return t==="M"?String(e+1):I(e+1,2)},d(n,t){return I(n.getDate(),t.length)},a(n,t){let 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 I(n.getHours()%12||12,t.length)},H(n,t){return I(n.getHours(),t.length)},m(n,t){return I(n.getMinutes(),t.length)},s(n,t){return I(n.getSeconds(),t.length)},S(n,t){let e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return I(s,t.length)}};var ye={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Es={G:function(n,t,e){let 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"){let i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Pt.y(n,t)},Y:function(n,t,e,i){let s=xe(n,i),o=s>0?s:1-s;if(t==="YY"){let r=o%100;return I(r,2)}return t==="Yo"?e.ordinalNumber(o,{unit:"year"}):I(o,t.length)},R:function(n,t){let e=Bn(n);return I(e,t.length)},u:function(n,t){let e=n.getFullYear();return I(e,t.length)},Q:function(n,t,e){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return I(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){let i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return I(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){let i=n.getMonth();switch(t){case"M":case"MM":return Pt.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){let i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return I(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){let s=Gn(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):I(s,t.length)},I:function(n,t,e){let i=Qn(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):I(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Pt.d(n,t)},D:function(n,t,e){let i=Aa(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):I(i,t.length)},E:function(n,t,e){let 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){let s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return I(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){let s=n.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return I(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){let i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return I(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){let 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){let i=n.getHours(),s;switch(i===12?s=ye.noon:i===0?s=ye.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){let i=n.getHours(),s;switch(i>=17?s=ye.evening:i>=12?s=ye.afternoon:i>=4?s=ye.morning:s=ye.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 Pt.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Pt.H(n,t)},K:function(n,t,e){let i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):I(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(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Pt.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Pt.s(n,t)},S:function(n,t){return Pt.S(n,t)},X:function(n,t,e){let i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ea(i);case"XXXX":case"XX":return Qt(i);case"XXXXX":case"XXX":default:return Qt(i,":")}},x:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"x":return Ea(i);case"xxxx":case"xx":return Qt(i);case"xxxxx":case"xxx":default:return Qt(i,":")}},O:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ia(i,":");case"OOOO":default:return"GMT"+Qt(i,":")}},z:function(n,t,e){let i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ia(i,":");case"zzzz":default:return"GMT"+Qt(i,":")}},t:function(n,t,e){let i=Math.trunc(+n/1e3);return I(i,t.length)},T:function(n,t,e){return I(+n,t.length)}};function Ia(n,t=""){let 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+I(o,2)}function Ea(n,t){return n%60===0?(n>0?"-":"+")+I(Math.abs(n)/60,2):Qt(n,t)}function Qt(n,t=""){let e=n>0?"-":"+",i=Math.abs(n),s=I(Math.trunc(i/60),2),o=I(i%60,2);return e+s+t+o}var Fa=(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"})}},Ra=(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"})}},Gu=(n,t)=>{let e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Fa(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}}",Fa(i,t)).replace("{{time}}",Ra(s,t))},Ue={p:Ra,P:Gu};var Ku=/^D+$/,Zu=/^Y+$/,Ju=["D","DD","YY","YYYY"];function Kn(n){return Ku.test(n)}function Zn(n){return Zu.test(n)}function Qe(n,t,e){let i=td(n,t,e);if(console.warn(i),Ju.includes(n))throw new RangeError(i)}function td(n,t,e){let 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`}var ed=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,id=/^'([^]*?)'?$/,sd=/''/g,od=/[a-zA-Z]/;function za(n,t,e){let i=et(),s=e?.locale??i.locale??Xe,o=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,a=_(n,e?.in);if(!Yn(a))throw new RangeError("Invalid time value");let c=t.match(nd).map(h=>{let u=h[0];if(u==="p"||u==="P"){let d=Ue[u];return d(h,s.formatLong)}return h}).join("").match(ed).map(h=>{if(h==="''")return{isToken:!1,value:"'"};let u=h[0];if(u==="'")return{isToken:!1,value:rd(h)};if(Es[u])return{isToken:!0,value:h};if(u.match(od))throw new RangeError("Format string contains an unescaped latin alphabet character `"+u+"`");return{isToken:!1,value:h}});s.localize.preprocessor&&(c=s.localize.preprocessor(a,c));let l={firstWeekContainsDate:o,weekStartsOn:r,locale:s};return c.map(h=>{if(!h.isToken)return h.value;let u=h.value;(!e?.useAdditionalWeekYearTokens&&Zn(u)||!e?.useAdditionalDayOfYearTokens&&Kn(u))&&Qe(u,t,String(n));let d=Es[u[0]];return d(a,u,s.localize,l)}).join("")}function rd(n){let t=n.match(id);return t?t[1].replace(sd,"'"):n}function Wa(){return Object.assign({},et())}function Na(n,t){let e=_(n,t?.in).getDay();return e===0?7:e}function Ba(n,t){let e=ad(t)?new t(0):S(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function ad(n){return typeof n=="function"&&n.prototype?.constructor===n}var cd=10,Jn=class{subPriority=0;validate(t,e){return!0}},ti=class extends Jn{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)}},ei=class extends Jn{priority=cd;subPriority=-1;constructor(t,e){super(),this.context=t||(i=>S(e,i))}set(t,e){return e.timestampIsSet?t:S(t,Ba(t,this.context))}};var k=class{run(t,e,i,s){let o=this.parse(t,e,i,s);return o?{setter:new ti(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,e,i){return!0}};var ni=class extends k{priority=140;parse(t,e,i){switch(e){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});case"GGGG":default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,e,i){return e.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]};var A={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}/},lt={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 z(n,t){return n&&{value:t(n.value),rest:n.rest}}function T(n,t){let e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function ht(n,t){let e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};let 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*Dt+o*vt+r*Kr),rest:t.slice(e[0].length)}}function ii(n){return T(A.anyDigitsSigned,n)}function O(n,t){switch(n){case 1:return T(A.singleDigit,t);case 2:return T(A.twoDigits,t);case 3:return T(A.threeDigits,t);case 4:return T(A.fourDigits,t);default:return T(new RegExp("^\\d{1,"+n+"}"),t)}}function _e(n,t){switch(n){case 1:return T(A.singleDigitSigned,t);case 2:return T(A.twoDigitsSigned,t);case 3:return T(A.threeDigitsSigned,t);case 4:return T(A.fourDigitsSigned,t);default:return T(new RegExp("^-?\\d{1,"+n+"}"),t)}}function we(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 si(n,t){let e=t>0,i=e?t:1-t,s;if(i<=50)s=n||100;else{let 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 oi(n){return n%400===0||n%4===0&&n%100!==0}var ri=class extends k{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,e,i){let s=o=>({year:o,isTwoDigitYear:e==="yy"});switch(e){case"y":return z(O(4,t),s);case"yo":return z(i.ordinalNumber(t,{unit:"year"}),s);default:return z(O(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i){let s=t.getFullYear();if(i.isTwoDigitYear){let r=si(i.year,s);return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}let o=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}};var ai=class extends k{priority=130;parse(t,e,i){let s=o=>({year:o,isTwoDigitYear:e==="YY"});switch(e){case"Y":return z(O(4,t),s);case"Yo":return z(i.ordinalNumber(t,{unit:"year"}),s);default:return z(O(e.length,t),s)}}validate(t,e){return e.isTwoDigitYear||e.year>0}set(t,e,i,s){let o=xe(t,s);if(i.isTwoDigitYear){let a=si(i.year,o);return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,s)}let r=!("era"in e)||e.era===1?i.year:1-i.year;return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),Q(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]};var ci=class extends k{priority=130;parse(t,e){return e==="R"?_e(4,t):_e(e.length,t)}set(t,e,i){let s=S(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),ut(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]};var li=class extends k{priority=130;parse(t,e){return e==="u"?_e(4,t):_e(e.length,t)}set(t,e,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]};var hi=class extends k{priority=120;parse(t,e,i){switch(e){case"Q":case"QQ":return O(e.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]};var ui=class extends k{priority=120;parse(t,e,i){switch(e){case"q":case"qq":return O(e.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=1&&e<=4}set(t,e,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]};var di=class extends k{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,e,i){let s=o=>o-1;switch(e){case"M":return z(T(A.month,t),s);case"MM":return z(O(2,t),s);case"Mo":return z(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}};var fi=class extends k{priority=110;parse(t,e,i){let s=o=>o-1;switch(e){case"L":return z(T(A.month,t),s);case"LL":return z(O(2,t),s);case"Lo":return z(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]};function Ha(n,t,e){let i=_(n,e?.in),s=Gn(i,e)-t;return i.setDate(i.getDate()-s*7),_(i,e?.in)}var pi=class extends k{priority=100;parse(t,e,i){switch(e){case"w":return T(A.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return O(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i,s){return Q(Ha(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]};function Ya(n,t,e){let i=_(n,e?.in),s=Qn(i,e)-t;return i.setDate(i.getDate()-s*7),i}var gi=class extends k{priority=100;parse(t,e,i){switch(e){case"I":return T(A.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return O(e.length,t)}}validate(t,e){return e>=1&&e<=53}set(t,e,i){return ut(Ya(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]};var ld=[31,28,31,30,31,30,31,31,30,31,30,31],hd=[31,29,31,30,31,30,31,31,30,31,30,31],mi=class extends k{priority=90;subPriority=1;parse(t,e,i){switch(e){case"d":return T(A.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return O(e.length,t)}}validate(t,e){let i=t.getFullYear(),s=oi(i),o=t.getMonth();return s?e>=1&&e<=hd[o]:e>=1&&e<=ld[o]}set(t,e,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]};var bi=class extends k{priority=90;subpriority=1;parse(t,e,i){switch(e){case"D":case"DD":return T(A.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return O(e.length,t)}}validate(t,e){let i=t.getFullYear();return oi(i)?e>=1&&e<=366:e>=1&&e<=365}set(t,e,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]};function Me(n,t,e){let i=et(),s=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=_(n,e?.in),r=o.getDay(),c=(t%7+7)%7,l=7-s,h=t<0||t>6?t-(r+l)%7:(c+l)%7-(r+l)%7;return Rt(o,h,e)}var xi=class extends k{priority=90;parse(t,e,i){switch(e){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=Me(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]};var yi=class extends k{priority=90;parse(t,e,i,s){let o=r=>{let a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(e){case"e":case"ee":return z(O(e.length,t),o);case"eo":return z(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=Me(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]};var _i=class extends k{priority=90;parse(t,e,i,s){let o=r=>{let a=Math.floor((r-1)/7)*7;return(r+s.weekStartsOn+6)%7+a};switch(e){case"c":case"cc":return z(O(e.length,t),o);case"co":return z(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,e){return e>=0&&e<=6}set(t,e,i,s){return t=Me(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]};function Va(n,t,e){let i=_(n,e?.in),s=Na(i,e),o=t-s;return Rt(i,o,e)}var wi=class extends k{priority=90;parse(t,e,i){let s=o=>o===0?7:o;switch(e){case"i":case"ii":return O(e.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return z(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return z(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return z(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiii":default:return z(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,e){return e>=1&&e<=7}set(t,e,i){return t=Va(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]};var Mi=class extends k{priority=80;parse(t,e,i){switch(e){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(we(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]};var ki=class extends k{priority=80;parse(t,e,i){switch(e){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(we(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]};var vi=class extends k{priority=80;parse(t,e,i){switch(e){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,e,i){return t.setHours(we(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]};var Di=class extends k{priority=70;parse(t,e,i){switch(e){case"h":return T(A.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return O(e.length,t)}}validate(t,e){return e>=1&&e<=12}set(t,e,i){let s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]};var Pi=class extends k{priority=70;parse(t,e,i){switch(e){case"H":return T(A.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return O(e.length,t)}}validate(t,e){return e>=0&&e<=23}set(t,e,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]};var Oi=class extends k{priority=70;parse(t,e,i){switch(e){case"K":return T(A.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return O(e.length,t)}}validate(t,e){return e>=0&&e<=11}set(t,e,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]};var Si=class extends k{priority=70;parse(t,e,i){switch(e){case"k":return T(A.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return O(e.length,t)}}validate(t,e){return e>=1&&e<=24}set(t,e,i){let s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]};var Ti=class extends k{priority=60;parse(t,e,i){switch(e){case"m":return T(A.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return O(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]};var Ci=class extends k{priority=50;parse(t,e,i){switch(e){case"s":return T(A.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return O(e.length,t)}}validate(t,e){return e>=0&&e<=59}set(t,e,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]};var Ai=class extends k{priority=30;parse(t,e){let i=s=>Math.trunc(s*Math.pow(10,-e.length+3));return z(O(e.length,t),i)}set(t,e,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]};var Li=class extends k{priority=10;parse(t,e){switch(e){case"X":return ht(lt.basicOptionalMinutes,t);case"XX":return ht(lt.basic,t);case"XXXX":return ht(lt.basicOptionalSeconds,t);case"XXXXX":return ht(lt.extendedOptionalSeconds,t);case"XXX":default:return ht(lt.extended,t)}}set(t,e,i){return e.timestampIsSet?t:S(t,t.getTime()-Xt(t)-i)}incompatibleTokens=["t","T","x"]};var Ii=class extends k{priority=10;parse(t,e){switch(e){case"x":return ht(lt.basicOptionalMinutes,t);case"xx":return ht(lt.basic,t);case"xxxx":return ht(lt.basicOptionalSeconds,t);case"xxxxx":return ht(lt.extendedOptionalSeconds,t);case"xxx":default:return ht(lt.extended,t)}}set(t,e,i){return e.timestampIsSet?t:S(t,t.getTime()-Xt(t)-i)}incompatibleTokens=["t","T","X"]};var Ei=class extends k{priority=40;parse(t){return ii(t)}set(t,e,i){return[S(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"};var Fi=class extends k{priority=20;parse(t){return ii(t)}set(t,e,i){return[S(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"};var ja={G:new ni,y:new ri,Y:new ai,R:new ci,u:new li,Q:new hi,q:new ui,M:new di,L:new fi,w:new pi,I:new gi,d:new mi,D:new bi,E:new xi,e:new yi,c:new _i,i:new wi,a:new Mi,b:new ki,B:new vi,h:new Di,H:new Pi,K:new Oi,k:new Si,m:new Ti,s:new Ci,S:new Ai,X:new Li,x:new Ii,t:new Ei,T:new Fi};var ud=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,dd=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fd=/^'([^]*?)'?$/,pd=/''/g,gd=/\S/,md=/[a-zA-Z]/;function qa(n,t,e,i){let s=()=>S(i?.in||e,NaN),o=Wa(),r=i?.locale??o.locale??Xe,a=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,c=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return n?s():_(e,i?.in);let l={firstWeekContainsDate:a,weekStartsOn:c,locale:r},h=[new ei(i?.in,e)],u=t.match(dd).map(p=>{let b=p[0];if(b in Ue){let x=Ue[b];return x(p,r.formatLong)}return p}).join("").match(ud),d=[];for(let p of u){!i?.useAdditionalWeekYearTokens&&Zn(p)&&Qe(p,t,n),!i?.useAdditionalDayOfYearTokens&&Kn(p)&&Qe(p,t,n);let b=p[0],x=ja[b];if(x){let{incompatibleTokens:M}=x;if(Array.isArray(M)){let y=d.find(P=>M.includes(P.token)||P.token===b);if(y)throw new RangeError(`The format string mustn't contain \`${y.fullToken}\` and \`${p}\` at the same time`)}else if(x.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${p}\` and any other token at the same time`);d.push({token:b,fullToken:p});let w=x.run(n,p,r.match,l);if(!w)return s();h.push(w.setter),n=w.rest}else{if(b.match(md))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(p==="''"?p="'":b==="'"&&(p=bd(p)),n.indexOf(p)===0)n=n.slice(p.length);else return s()}}if(n.length>0&&gd.test(n))return s();let f=h.map(p=>p.priority).sort((p,b)=>b-p).filter((p,b,x)=>x.indexOf(p)===b).map(p=>h.filter(b=>b.priority===p).sort((b,x)=>x.subPriority-b.subPriority)).map(p=>p[0]),g=_(e,i?.in);if(isNaN(+g))return s();let m={};for(let p of f){if(!p.validate(g,l))return s();let b=p.set(g,m,l);Array.isArray(b)?(g=b[0],Object.assign(m,b[1])):g=b}return g}function bd(n){return n.match(fd)[1].replace(pd,"'")}function $a(n,t){let e=_(n,t?.in);return e.setMinutes(0,0,0),e}function Xa(n,t){let e=_(n,t?.in);return e.setSeconds(0,0),e}function Ua(n,t){let e=_(n,t?.in);return e.setMilliseconds(0),e}function Qa(n,t){let e=()=>S(t?.in,NaN),i=t?.additionalDigits??2,s=wd(n),o;if(s.date){let l=Md(s.date,i);o=kd(l.restDateString,l.year)}if(!o||isNaN(+o))return e();let r=+o,a=0,c;if(s.time&&(a=vd(s.time),isNaN(a)))return e();if(s.timezone){if(c=Dd(s.timezone),isNaN(c))return e()}else{let l=new Date(r+a),h=_(0,t?.in);return h.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),h.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),h}return _(r+a+c,t?.in)}var Ri={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},xd=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,yd=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,_d=/^([+-])(\d{2})(?::?(\d{2}))?$/;function wd(n){let t={},e=n.split(Ri.dateTimeDelimiter),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){let s=Ri.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Md(n,t){let e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};let 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 kd(n,t){if(t===null)return new Date(NaN);let e=n.match(xd);if(!e)return new Date(NaN);let i=!!e[4],s=Ge(e[1]),o=Ge(e[2])-1,r=Ge(e[3]),a=Ge(e[4]),c=Ge(e[5])-1;if(i)return Cd(t,a,c)?Pd(t,a,c):new Date(NaN);{let l=new Date(0);return!Sd(t,o,r)||!Td(t,s)?new Date(NaN):(l.setUTCFullYear(t,o,Math.max(s,r)),l)}}function Ge(n){return n?parseInt(n):1}function vd(n){let t=n.match(yd);if(!t)return NaN;let e=Fs(t[1]),i=Fs(t[2]),s=Fs(t[3]);return Ad(e,i,s)?e*Dt+i*vt+s*1e3:NaN}function Fs(n){return n&&parseFloat(n.replace(",","."))||0}function Dd(n){if(n==="Z")return 0;let t=n.match(_d);if(!t)return 0;let e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Ld(i,s)?e*(i*Dt+s*vt):NaN}function Pd(n,t,e){let i=new Date(0);i.setUTCFullYear(n,0,4);let s=i.getUTCDay()||7,o=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+o),i}var Od=[31,null,31,30,31,30,31,31,30,31,30,31];function Ga(n){return n%400===0||n%4===0&&n%100!==0}function Sd(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Od[t]||(Ga(n)?29:28))}function Td(n,t){return t>=1&&t<=(Ga(n)?366:365)}function Cd(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Ad(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Ld(n,t){return t>=0&&t<=59}var Id={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"};Ls._date.override({_id:"date-fns",formats:function(){return Id},parse:function(n,t){if(n===null||typeof n>"u")return null;let e=typeof n;return e==="number"||n instanceof Date?n=_(n):e==="string"&&(typeof t=="string"?n=qa(n,t,new Date,this.options):n=Qa(n,this.options)),Yn(n)?n.getTime():null},format:function(n,t){return za(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return pe(n,t);case"second":return ia(n,t);case"minute":return ea(n,t);case"hour":return Jr(n,t);case"day":return Rt(n,t);case"week":return sa(n,t);case"month":return fe(n,t);case"quarter":return na(n,t);case"year":return oa(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return ge(n,t);case"second":return pa(n,t);case"minute":return ua(n,t);case"hour":return ha(n,t);case"day":return Vn(n,t);case"week":return ga(n,t);case"month":return $n(n,t);case"quarter":return fa(n,t);case"year":return ma(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Ua(n);case"minute":return Xa(n);case"hour":return $a(n);case"day":return $e(n);case"week":return Q(n);case"isoWeek":return Q(n,{weekStartsOn:+e});case"month":return xa(n);case"quarter":return ba(n);case"year":return Xn(n);default:return n}},endOf:function(n,t){switch(t){case"second":return va(n);case"minute":return Ma(n);case"hour":return _a(n);case"day":return jn(n);case"week":return wa(n);case"month":return qn(n);case"quarter":return ka(n);case"year":return ya(n);default:return n}}});he.register($r,An,En,zn,Fn,de,Ur);document.addEventListener("DOMContentLoaded",async()=>{let n=document.getElementById("chart"),e=`/phperkaigi/2024/golf/api/quizzes/${n.dataset.quizId}/chart.json`,i=await fetch(e).then(c=>c.json());if(i.error)return;let s=i.stats;for(let c of s){let l=[];for(let h of c.scores)(l.length===0||l[l.length-1].code_size>h.code_size)&&l.push(h);c.scores=l}let o=s.flatMap(c=>c.scores.map(l=>({...l,user:c.user}))).toSorted((c,l)=>c.submitted_at-l.submitted_at),r=(()=>{let c=[],l=new Map;for(let{user:h,submitted_at:u,code_size:d}of o){l.set(h.name,{user:h,submitted_at:u,code_size:d});let f=l.values().toArray().toSorted((m,p)=>m.code_size===p.code_size?m.submitted_at-p.submitted_at:m.code_size-p.code_size),g=new Map;for(let[m,{user:p,code_size:b}]of f.entries())g.set(p.name,{user:p,code_size:b,rank:m+1});c.push({submitted_at:u,scores:g})}return c})(),a=(()=>{let c=new Map;for(let{submitted_at:l,scores:h}of r)for(let[u,{user:d,code_size:f,rank:g}]of h.entries())c.has(u)||c.set(u,[]),c.get(u).push({user:d,code_size:f,rank:g,submitted_at:l});return c.values().toArray().toSorted((l,h)=>{let u=l[l.length-1].rank,d=h[h.length-1].rank;return u-d})})();new he(n,{type:"line",data:{datasets:a.map(c=>({label:`${c[0].user.name}${c[0].user.is_admin?" (staff)":""}`,data:c.map(l=>({x:l.submitted_at*1e3,y:l.rank,code_size:l.code_size}))}))},options:{scales:{x:{type:"time",time:{parsing:!1,display:!1,unit:"day",tooltipFormat:"yyyy-MM-dd HH:mm:ss",displayFormats:{day:"yyyy-MM-dd"}},title:{display:!0,text:"\u65E5\u6642"}},y:{title:{display:!0,text:"\u9806\u4F4D"},reverse:!0,min:1,offset:!0}},plugins:{tooltip:{callbacks:{label:c=>{let l=c.dataset.label,h=c.raw.code_size;return`${l} (${h} byte)`}}}}}})});})(); /*! Bundled license information: @kurkle/color/dist/color.esm.js: (*! - * @kurkle/color v0.3.2 + * @kurkle/color v0.3.4 * https://github.com/kurkle/color#readme - * (c) 2023 Jukka Kurkela - * Released under the MIT License - *) - -chart.js/dist/chunks/helpers.segment.js: - (*! - * Chart.js v4.4.1 - * https://www.chartjs.org - * (c) 2023 Chart.js Contributors + * (c) 2024 Jukka Kurkela * Released under the MIT License *) +chart.js/dist/chunks/helpers.dataset.js: chart.js/dist/chart.js: (*! - * Chart.js v4.4.1 + * Chart.js v4.5.1 * https://www.chartjs.org - * (c) 2023 Chart.js Contributors + * (c) 2025 Chart.js Contributors * Released under the MIT License *) |
