@kong-ui-public/analytics-chart 0.10.8 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,29 +1,29 @@
1
- var G1=Object.defineProperty;var K1=(ot,g,me)=>g in ot?G1(ot,g,{enumerable:!0,configurable:!0,writable:!0,value:me}):ot[g]=me;var k=(ot,g,me)=>(K1(ot,typeof g!="symbol"?g+"":g,me),me);(function(ot,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],g):(ot=typeof globalThis<"u"?globalThis:ot||self,g(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"]))})(this,function(ot,g,me){var Ie,Od;"use strict";const Ed={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Not all data is shown in the below report. Reports are currently limited to a maximum of {maxReturned} entities.",entityNoName:"no-name",total:"Total",chartUnits:{ms:"ms",bytes:"Bytes",count:"requests","count/minute":"rpm",requests:"requests"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{Service:"Service",ServiceVersion:"Service Version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime Group",GatewayService:"Gateway Service",StatusCode:"Status Code",CodeClass:"Status Code (grouped)",Time:"Time",API_PRODUCT:"API Product",API_PRODUCT_VERSION:"API Product Version",RUNTIME_GROUP:"Runtime Group",GATEWAY_SERVICE:"Gateway Service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status Code",STATUS_CODE_GROUPED:"Status Code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request Count",RequestsPerMinute:"Requests per Minute",LatencyP99:"Response Latency (p99)",LatencyP95:"Response Latency (p95)",LatencyP50:"Response Latency (p50)",LatencyAverage:"Response Latency (avg)",UpstreamLatencyP99:"Upstream Latency (p99)",UpstreamLatencyP95:"Upstream Latency (p95)",UpstreamLatencyP50:"Upstream Latency (p50)",UpstreamLatencyAverage:"Upstream Latency (avg)",KongLatencyP99:"Kong Latency (p99)",KongLatencyP95:"Kong Latency (p95)",KongLatencyP50:"Kong Latency (p50)",KongLatencyAverage:"Kong Latency (avg)",ResponseSizeP99:"Response Size (p99)",ResponseSizeP95:"Response Size (p95)",ResponseSizeP50:"Response Size (p50)",RequestSizeP99:"Request Size (p99)",RequestSizeP95:"Request Size (p95)",RequestSizeP50:"Request Size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx",REQUEST_COUNT:"Request Count",REQUEST_PER_MINUTE:"Requests per Minute",RESPONSE_LATENCY_P99:"Response Latency",RESPONSE_LATENCY_P95:"Response Latency",RESPONSE_LATENCY_P50:"Response Latency",RESPONSE_SIZE_P99:"Response Size (p99)",RESPONSE_SIZE_P95:"Response Size (p95)",RESPONSE_SIZE_P50:"Response Size (p50)",REQUEST_SIZE_P99:"Request Size (p99)",REQUEST_SIZE_P95:"Request Size (p95)",REQUEST_SIZE_P50:"Request Size (p50)",CONTROL_PLANE:"Control Plane"},metricAxisTitles:{REQUEST_COUNT:"Request Count",REQUEST_PER_MINUTE:"Requests per Minute",RESPONSE_LATENCY_P99:"Response Latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response Latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response Latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response Size (p99) in {unit}",RESPONSE_SIZE_P95:"Response Size (p95) in {unit}",RESPONSE_SIZE_P50:"Response Size (p50) in {unit}",REQUEST_SIZE_P99:"Request Size (p99) in {unit}",REQUEST_SIZE_P95:"Request Size (p95) in {unit}",REQUEST_SIZE_P50:"Request Size (p50) in {unit}",TotalRequests:"Request Count",RequestsPerMinute:"Requests per Minute",LatencyP99:"Response Latency (p99) in {unit}",LatencyP95:"Response Latency (p95) in {unit}",LatencyP50:"Response Latency (p50) in {unit}",LatencyAverage:"Response Latency (avg) in {unit}",UpstreamLatencyP99:"Upstream Latency (p99) in {unit}",UpstreamLatencyP95:"Upstream Latency (p95) in {unit}",UpstreamLatencyP50:"Upstream Latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream Latency (avg) in {unit}",KongLatencyP99:"Kong Latency (p99) in {unit}",KongLatencyP95:"Kong Latency (p95) in {unit}",KongLatencyP50:"Kong Latency (p50) in {unit}",KongLatencyAverage:"Kong Latency (avg) in {unit}",ResponseSizeP99:"Response Size (p99) in {unit}",ResponseSizeP95:"Response Size (p95) in {unit}",ResponseSizeP50:"Response Size (p50) in {unit}",RequestSizeP99:"Request Size (p99) in {unit}",RequestSizeP95:"Request Size (p95) in {unit}",RequestSizeP50:"Request Size (p50) in {unit}"},granularityAxisTitles:{Minutely:"@timestamp per minute",Hourly:"@timestamp per hour",Daily:"@timestamp per day",Weekly:"@timestamp per week"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}}};function Ad(){const n=me.createI18n("en-us",Ed);return{i18n:n,i18nT:me.i18nTComponent(n)}}/*!
1
+ var G1=Object.defineProperty;var K1=(ot,g,me)=>g in ot?G1(ot,g,{enumerable:!0,configurable:!0,writable:!0,value:me}):ot[g]=me;var k=(ot,g,me)=>(K1(ot,typeof g!="symbol"?g+"":g,me),me);(function(ot,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("@kong-ui-public/i18n")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n"],g):(ot=typeof globalThis<"u"?globalThis:ot||self,g(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"]))})(this,function(ot,g,me){var Ie,Pd;"use strict";const Ed={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Not all data is shown in the below report. Reports are currently limited to a maximum of {maxReturned} entities.",entityNoName:"no-name",total:"Total",chartUnits:{ms:"ms",bytes:"Bytes",count:"requests","count/minute":"rpm",requests:"requests"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{Service:"Service",ServiceVersion:"Service Version",Route:"Route",Application:"Application",RuntimeGroup:"Runtime Group",GatewayService:"Gateway Service",StatusCode:"Status Code",CodeClass:"Status Code (grouped)",Time:"Time",API_PRODUCT:"API Product",API_PRODUCT_VERSION:"API Product Version",RUNTIME_GROUP:"Runtime Group",GATEWAY_SERVICE:"Gateway Service",ROUTE:"Route",APPLICATION:"Application",STATUS_CODE:"Status Code",STATUS_CODE_GROUPED:"Status Code (grouped)",TIME:"Time",ORGANIZATION:"Organization",TotalRequests:"Request Count",RequestsPerMinute:"Requests per Minute",LatencyP99:"Response Latency (p99)",LatencyP95:"Response Latency (p95)",LatencyP50:"Response Latency (p50)",LatencyAverage:"Response Latency (avg)",UpstreamLatencyP99:"Upstream Latency (p99)",UpstreamLatencyP95:"Upstream Latency (p95)",UpstreamLatencyP50:"Upstream Latency (p50)",UpstreamLatencyAverage:"Upstream Latency (avg)",KongLatencyP99:"Kong Latency (p99)",KongLatencyP95:"Kong Latency (p95)",KongLatencyP50:"Kong Latency (p50)",KongLatencyAverage:"Kong Latency (avg)",ResponseSizeP99:"Response Size (p99)",ResponseSizeP95:"Response Size (p95)",ResponseSizeP50:"Response Size (p50)",RequestSizeP99:"Request Size (p99)",RequestSizeP95:"Request Size (p95)",RequestSizeP50:"Request Size (p50)",SuccessfulRequests:"Successful requests",SUCCESS:"Successful requests",FailedRequests:"Failed requests",FAILURE:"Failed requests","5XX":"5xx","4XX":"4xx",REQUEST_COUNT:"Request Count",REQUEST_PER_MINUTE:"Requests per Minute",RESPONSE_LATENCY_P99:"Response Latency",RESPONSE_LATENCY_P95:"Response Latency",RESPONSE_LATENCY_P50:"Response Latency",RESPONSE_SIZE_P99:"Response Size (p99)",RESPONSE_SIZE_P95:"Response Size (p95)",RESPONSE_SIZE_P50:"Response Size (p50)",REQUEST_SIZE_P99:"Request Size (p99)",REQUEST_SIZE_P95:"Request Size (p95)",REQUEST_SIZE_P50:"Request Size (p50)",CONTROL_PLANE:"Control Plane"},metricAxisTitles:{REQUEST_COUNT:"Request Count",REQUEST_PER_MINUTE:"Requests per Minute",RESPONSE_LATENCY_P99:"Response Latency (p99) in {unit}",RESPONSE_LATENCY_P95:"Response Latency (p95) in {unit}",RESPONSE_LATENCY_P50:"Response Latency (p50) in {unit}",RESPONSE_SIZE_P99:"Response Size (p99) in {unit}",RESPONSE_SIZE_P95:"Response Size (p95) in {unit}",RESPONSE_SIZE_P50:"Response Size (p50) in {unit}",REQUEST_SIZE_P99:"Request Size (p99) in {unit}",REQUEST_SIZE_P95:"Request Size (p95) in {unit}",REQUEST_SIZE_P50:"Request Size (p50) in {unit}",TotalRequests:"Request Count",RequestsPerMinute:"Requests per Minute",LatencyP99:"Response Latency (p99) in {unit}",LatencyP95:"Response Latency (p95) in {unit}",LatencyP50:"Response Latency (p50) in {unit}",LatencyAverage:"Response Latency (avg) in {unit}",UpstreamLatencyP99:"Upstream Latency (p99) in {unit}",UpstreamLatencyP95:"Upstream Latency (p95) in {unit}",UpstreamLatencyP50:"Upstream Latency (p50) in {unit}",UpstreamLatencyAverage:"Upstream Latency (avg) in {unit}",KongLatencyP99:"Kong Latency (p99) in {unit}",KongLatencyP95:"Kong Latency (p95) in {unit}",KongLatencyP50:"Kong Latency (p50) in {unit}",KongLatencyAverage:"Kong Latency (avg) in {unit}",ResponseSizeP99:"Response Size (p99) in {unit}",ResponseSizeP95:"Response Size (p95) in {unit}",ResponseSizeP50:"Response Size (p50) in {unit}",RequestSizeP99:"Request Size (p99) in {unit}",RequestSizeP95:"Request Size (p95) in {unit}",RequestSizeP50:"Request Size (p50) in {unit}"},granularityAxisTitles:{Minutely:"@timestamp per minute",Hourly:"@timestamp per hour",Daily:"@timestamp per day",Weekly:"@timestamp per week"},topNTable:{nameLabel:"Name",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong",errors:{meta:"Error: response must contain 'meta'",display:"Error: 'display' response incorrectly formatted (must have at least one key)",metricNames:"Error: 'metricNames' response incorrectly formatted (must have at least one entry)"}}};function Ad(){const n=me.createI18n("en-us",Ed);return{i18n:n,i18nT:me.i18nTComponent(n)}}/*!
2
2
  * @kurkle/color v0.3.2
3
3
  * https://github.com/kurkle/color#readme
4
4
  * (c) 2023 Jukka Kurkela
5
5
  * Released under the MIT License
6
- */function vn(n){return n+.5|0}const be=(n,t,e)=>Math.max(Math.min(n,e),t);function xn(n){return be(vn(n*2.55),0,255)}function ye(n){return be(vn(n*255),0,255)}function se(n){return be(vn(n/2.55)/100,0,1)}function Js(n){return be(vn(n*100),0,100)}const jt={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},vr=[..."0123456789ABCDEF"],Rd=n=>vr[n&15],Ld=n=>vr[(n&240)>>4]+vr[n&15],fi=n=>(n&240)>>4===(n&15),Id=n=>fi(n.r)&&fi(n.g)&&fi(n.b)&&fi(n.a);function Nd(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&jt[n[1]]*17,g:255&jt[n[2]]*17,b:255&jt[n[3]]*17,a:t===5?jt[n[4]]*17:255}:(t===7||t===9)&&(e={r:jt[n[1]]<<4|jt[n[2]],g:jt[n[3]]<<4|jt[n[4]],b:jt[n[5]]<<4|jt[n[6]],a:t===9?jt[n[7]]<<4|jt[n[8]]:255})),e}const Fd=(n,t)=>n<255?t(n):"";function Yd(n){var t=Id(n)?Rd:Ld;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Fd(n.a,t):void 0}const Wd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function to(n,t,e){const i=t*Math.min(e,1-e),r=(a,s=(a+n/30)%12)=>e-i*Math.max(Math.min(s-3,9-s,1),-1);return[r(0),r(8),r(4)]}function Ud(n,t,e){const i=(r,a=(r+n/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function Bd(n,t,e){const i=to(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function zd(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function xr(n){const e=n.r/255,i=n.g/255,r=n.b/255,a=Math.max(e,i,r),s=Math.min(e,i,r),o=(a+s)/2;let l,c,u;return a!==s&&(u=a-s,c=o>.5?u/(2-a-s):u/(a+s),l=zd(e,i,r,u,a),l=l*60+.5),[l|0,c||0,o]}function wr(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(ye)}function _r(n,t,e){return wr(to,n,t,e)}function Hd(n,t,e){return wr(Bd,n,t,e)}function $d(n,t,e){return wr(Ud,n,t,e)}function eo(n){return(n%360+360)%360}function Vd(n){const t=Wd.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?xn(+t[5]):ye(+t[5]));const r=eo(+t[2]),a=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?i=Hd(r,a,s):t[1]==="hsv"?i=$d(r,a,s):i=_r(r,a,s),{r:i[0],g:i[1],b:i[2],a:e}}function jd(n,t){var e=xr(n);e[0]=eo(e[0]+t),e=_r(e),n.r=e[0],n.g=e[1],n.b=e[2]}function qd(n){if(!n)return;const t=xr(n),e=t[0],i=Js(t[1]),r=Js(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${se(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const no={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"},io={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 Xd(){const n={},t=Object.keys(io),e=Object.keys(no);let i,r,a,s,o;for(i=0;i<t.length;i++){for(s=o=t[i],r=0;r<e.length;r++)a=e[r],o=o.replace(a,no[a]);a=parseInt(io[s],16),n[o]=[a>>16&255,a>>8&255,a&255]}return n}let gi;function Gd(n){gi||(gi=Xd(),gi.transparent=[0,0,0,0]);const t=gi[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Kd=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Zd(n){const t=Kd.exec(n);let e=255,i,r,a;if(t){if(t[7]!==i){const s=+t[7];e=t[8]?xn(s):be(s*255,0,255)}return i=+t[1],r=+t[3],a=+t[5],i=255&(t[2]?xn(i):be(i,0,255)),r=255&(t[4]?xn(r):be(r,0,255)),a=255&(t[6]?xn(a):be(a,0,255)),{r:i,g:r,b:a,a:e}}}function Qd(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${se(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Dr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Qe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Jd(n,t,e){const i=Qe(se(n.r)),r=Qe(se(n.g)),a=Qe(se(n.b));return{r:ye(Dr(i+e*(Qe(se(t.r))-i))),g:ye(Dr(r+e*(Qe(se(t.g))-r))),b:ye(Dr(a+e*(Qe(se(t.b))-a))),a:n.a+e*(t.a-n.a)}}function pi(n,t,e){if(n){let i=xr(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=_r(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ro(n,t){return n&&Object.assign(t||{},n)}function ao(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=ye(n[3]))):(t=ro(n,{r:0,g:0,b:0,a:1}),t.a=ye(t.a)),t}function th(n){return n.charAt(0)==="r"?Zd(n):Vd(n)}class wn{constructor(t){if(t instanceof wn)return t;const e=typeof t;let i;e==="object"?i=ao(t):e==="string"&&(i=Nd(t)||Gd(t)||th(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ro(this._rgb);return t&&(t.a=se(t.a)),t}set rgb(t){this._rgb=ao(t)}rgbString(){return this._valid?Qd(this._rgb):void 0}hexString(){return this._valid?Yd(this._rgb):void 0}hslString(){return this._valid?qd(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let a;const s=e===a?.5:e,o=2*s-1,l=i.a-r.a,c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2;a=1-c,i.r=255&c*i.r+a*r.r+.5,i.g=255&c*i.g+a*r.g+.5,i.b=255&c*i.b+a*r.b+.5,i.a=s*i.a+(1-s)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Jd(this._rgb,t._rgb,e)),this}clone(){return new wn(this.rgb)}alpha(t){return this._rgb.a=ye(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=vn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return pi(this._rgb,2,t),this}darken(t){return pi(this._rgb,2,-t),this}saturate(t){return pi(this._rgb,1,t),this}desaturate(t){return pi(this._rgb,1,-t),this}rotate(t){return jd(this._rgb,t),this}}/*!
6
+ */function xn(n){return n+.5|0}const be=(n,t,e)=>Math.max(Math.min(n,e),t);function wn(n){return be(xn(n*2.55),0,255)}function ye(n){return be(xn(n*255),0,255)}function se(n){return be(xn(n/2.55)/100,0,1)}function Js(n){return be(xn(n*100),0,100)}const jt={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},vr=[..."0123456789ABCDEF"],Rd=n=>vr[n&15],Ld=n=>vr[(n&240)>>4]+vr[n&15],fi=n=>(n&240)>>4===(n&15),Id=n=>fi(n.r)&&fi(n.g)&&fi(n.b)&&fi(n.a);function Nd(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&jt[n[1]]*17,g:255&jt[n[2]]*17,b:255&jt[n[3]]*17,a:t===5?jt[n[4]]*17:255}:(t===7||t===9)&&(e={r:jt[n[1]]<<4|jt[n[2]],g:jt[n[3]]<<4|jt[n[4]],b:jt[n[5]]<<4|jt[n[6]],a:t===9?jt[n[7]]<<4|jt[n[8]]:255})),e}const Fd=(n,t)=>n<255?t(n):"";function Yd(n){var t=Id(n)?Rd:Ld;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Fd(n.a,t):void 0}const Wd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function to(n,t,e){const i=t*Math.min(e,1-e),r=(a,s=(a+n/30)%12)=>e-i*Math.max(Math.min(s-3,9-s,1),-1);return[r(0),r(8),r(4)]}function Ud(n,t,e){const i=(r,a=(r+n/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[i(5),i(3),i(1)]}function Bd(n,t,e){const i=to(n,1,.5);let r;for(t+e>1&&(r=1/(t+e),t*=r,e*=r),r=0;r<3;r++)i[r]*=1-t-e,i[r]+=t;return i}function zd(n,t,e,i,r){return n===r?(t-e)/i+(t<e?6:0):t===r?(e-n)/i+2:(n-t)/i+4}function xr(n){const e=n.r/255,i=n.g/255,r=n.b/255,a=Math.max(e,i,r),s=Math.min(e,i,r),o=(a+s)/2;let l,c,u;return a!==s&&(u=a-s,c=o>.5?u/(2-a-s):u/(a+s),l=zd(e,i,r,u,a),l=l*60+.5),[l|0,c||0,o]}function wr(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(ye)}function _r(n,t,e){return wr(to,n,t,e)}function Hd(n,t,e){return wr(Bd,n,t,e)}function $d(n,t,e){return wr(Ud,n,t,e)}function eo(n){return(n%360+360)%360}function Vd(n){const t=Wd.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?wn(+t[5]):ye(+t[5]));const r=eo(+t[2]),a=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?i=Hd(r,a,s):t[1]==="hsv"?i=$d(r,a,s):i=_r(r,a,s),{r:i[0],g:i[1],b:i[2],a:e}}function jd(n,t){var e=xr(n);e[0]=eo(e[0]+t),e=_r(e),n.r=e[0],n.g=e[1],n.b=e[2]}function qd(n){if(!n)return;const t=xr(n),e=t[0],i=Js(t[1]),r=Js(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${r}%, ${se(n.a)})`:`hsl(${e}, ${i}%, ${r}%)`}const no={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"},io={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 Xd(){const n={},t=Object.keys(io),e=Object.keys(no);let i,r,a,s,o;for(i=0;i<t.length;i++){for(s=o=t[i],r=0;r<e.length;r++)a=e[r],o=o.replace(a,no[a]);a=parseInt(io[s],16),n[o]=[a>>16&255,a>>8&255,a&255]}return n}let gi;function Gd(n){gi||(gi=Xd(),gi.transparent=[0,0,0,0]);const t=gi[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Kd=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Zd(n){const t=Kd.exec(n);let e=255,i,r,a;if(t){if(t[7]!==i){const s=+t[7];e=t[8]?wn(s):be(s*255,0,255)}return i=+t[1],r=+t[3],a=+t[5],i=255&(t[2]?wn(i):be(i,0,255)),r=255&(t[4]?wn(r):be(r,0,255)),a=255&(t[6]?wn(a):be(a,0,255)),{r:i,g:r,b:a,a:e}}}function Qd(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${se(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Dr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Qe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Jd(n,t,e){const i=Qe(se(n.r)),r=Qe(se(n.g)),a=Qe(se(n.b));return{r:ye(Dr(i+e*(Qe(se(t.r))-i))),g:ye(Dr(r+e*(Qe(se(t.g))-r))),b:ye(Dr(a+e*(Qe(se(t.b))-a))),a:n.a+e*(t.a-n.a)}}function pi(n,t,e){if(n){let i=xr(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=_r(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ro(n,t){return n&&Object.assign(t||{},n)}function ao(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=ye(n[3]))):(t=ro(n,{r:0,g:0,b:0,a:1}),t.a=ye(t.a)),t}function th(n){return n.charAt(0)==="r"?Zd(n):Vd(n)}class _n{constructor(t){if(t instanceof _n)return t;const e=typeof t;let i;e==="object"?i=ao(t):e==="string"&&(i=Nd(t)||Gd(t)||th(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ro(this._rgb);return t&&(t.a=se(t.a)),t}set rgb(t){this._rgb=ao(t)}rgbString(){return this._valid?Qd(this._rgb):void 0}hexString(){return this._valid?Yd(this._rgb):void 0}hslString(){return this._valid?qd(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,r=t.rgb;let a;const s=e===a?.5:e,o=2*s-1,l=i.a-r.a,c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2;a=1-c,i.r=255&c*i.r+a*r.r+.5,i.g=255&c*i.g+a*r.g+.5,i.b=255&c*i.b+a*r.b+.5,i.a=s*i.a+(1-s)*r.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Jd(this._rgb,t._rgb,e)),this}clone(){return new _n(this.rgb)}alpha(t){return this._rgb.a=ye(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=xn(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return pi(this._rgb,2,t),this}darken(t){return pi(this._rgb,2,-t),this}saturate(t){return pi(this._rgb,1,t),this}desaturate(t){return pi(this._rgb,1,-t),this}rotate(t){return jd(this._rgb,t),this}}/*!
7
7
  * Chart.js v4.4.0
8
8
  * https://www.chartjs.org
9
9
  * (c) 2023 Chart.js Contributors
10
10
  * Released under the MIT License
11
- */function oe(){}const eh=(()=>{let n=0;return()=>n++})();function U(n){return n===null||typeof n>"u"}function tt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function $(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function pt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Ht(n,t){return pt(n)?n:t}function W(n,t){return typeof n>"u"?t:n}const nh=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,so=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function rt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function at(n,t,e,i){let r,a,s;if(tt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if($(n))for(s=Object.keys(n),a=s.length,r=0;r<a;r++)t.call(e,n[s[r]],s[r])}function mi(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function bi(n){if(tt(n))return n.map(bi);if($(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=bi(n[e[r]]);return t}return n}function oo(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function ih(n,t,e,i){if(!oo(n))return;const r=t[n],a=e[n];$(r)&&$(a)?_n(r,a,i):t[n]=bi(a)}function _n(n,t,e){const i=tt(t)?t:[t],r=i.length;if(!$(n))return n;e=e||{};const a=e.merger||ih;let s;for(let o=0;o<r;++o){if(s=i[o],!$(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function Dn(n,t){return _n(n,t,{merger:rh})}function rh(n,t,e){if(!oo(n))return;const i=t[n],r=e[n];$(i)&&$(r)?Dn(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=bi(r))}const lo={"":n=>n,x:n=>n.x,y:n=>n.y};function ah(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function sh(n){const t=ah(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ve(n,t){return(lo[t]||(lo[t]=sh(t)))(n)}function Tr(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wt=n=>typeof n<"u",Ut=n=>typeof n=="function",co=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function oh(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const X=Math.PI,ct=2*X,lh=ct+X,yi=Number.POSITIVE_INFINITY,Mr=X/180,ut=X/2,qt=X/4,vi=X*2/3,xe=Math.log10,Qt=Math.sign;function Tn(n,t,e){return Math.abs(n-t)<e}function uo(n){const t=Math.round(n);n=Tn(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xe(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function ch(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function we(n){return!isNaN(parseFloat(n))&&isFinite(n)}function uh(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function ho(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function St(n){return n*(X/180)}function xi(n){return n*(180/X)}function fo(n){if(!pt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function go(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*X&&(a+=ct),{angle:a,distance:r}}function Je(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function dh(n,t){return(n-t+lh)%ct-X}function $t(n){return(n%ct+ct)%ct}function Mn(n,t,e,i){const r=$t(n),a=$t(t),s=$t(e),o=$t(a-r),l=$t(s-r),c=$t(r-a),u=$t(r-s);return r===a||r===s||i&&a===s||o>l&&c<u}function Pt(n,t,e){return Math.max(t,Math.min(e,n))}function hh(n){return Pt(n,-32768,32767)}function le(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Sr(n,t,e){e=e||(s=>n[s]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const ce=(n,t,e,i)=>Sr(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),fh=(n,t,e)=>Sr(n,e,i=>n[i][t]>=e);function gh(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const po=["push","pop","shift","splice","unshift"];function ph(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),po.forEach(e=>{const i="_onData"+Tr(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=r.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...a)}),s}})})}function mo(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(po.forEach(a=>{delete n[a]}),delete n._chartjs)}function bo(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const yo=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function vo(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,yo.call(window,()=>{i=!1,n.apply(t,e)}))}}function mh(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const kr=n=>n==="start"?"left":n==="end"?"right":"center",Rt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,bh=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function xo(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:h}=s.getUserBounds();d&&(r=Pt(Math.min(ce(o,l,c).lo,e?i:ce(t,l,s.getPixelForValue(c)).lo),0,i-1)),h?a=Pt(Math.max(ce(o,s.axis,u,!0).hi+1,e?0:ce(t,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function wo(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const wi=n=>n===0||n===1,_o=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*ct/e)),Do=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*ct/e)+1,Sn={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*ut)+1,easeOutSine:n=>Math.sin(n*ut),easeInOutSine:n=>-.5*(Math.cos(X*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=>wi(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=>wi(n)?n:_o(n,.075,.3),easeOutElastic:n=>wi(n)?n:Do(n,.075,.3),easeInOutElastic(n){return wi(n)?n:n<.5?.5*_o(n*2,.1125,.45):.5+.5*Do(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-Sn.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?Sn.easeInBounce(n*2)*.5:Sn.easeOutBounce(n*2-1)*.5+.5};function Cr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function To(n){return Cr(n)?n:new wn(n)}function Pr(n){return Cr(n)?n:new wn(n).saturate(.5).darken(.1).hexString()}const yh=["x","y","borderWidth","radius","tension"],vh=["color","borderColor","backgroundColor"];function xh(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:vh},numbers:{type:"number",properties:yh}}),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 wh(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Mo=new Map;function _h(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Mo.get(e);return i||(i=new Intl.NumberFormat(n,t),Mo.set(e,i)),i}function kn(n,t,e){return _h(t,e).format(n)}const So={values(n){return tt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(r="scientific"),a=Dh(n,e)}const s=xe(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),kn(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xe(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?So.numeric.call(this,n,t,e):""}};function Dh(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 _i={formatters:So};function Th(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:_i.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Fe=Object.create(null),Or=Object.create(null);function Cn(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function Er(n,t,e){return typeof t=="string"?_n(Cn(n,t),e):_n(Cn(n,""),t)}class Mh{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,r)=>Pr(r.backgroundColor),this.hoverBorderColor=(i,r)=>Pr(r.borderColor),this.hoverColor=(i,r)=>Pr(r.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 Er(this,t,e)}get(t){return Cn(this,t)}describe(t,e){return Er(Or,t,e)}override(t,e){return Er(Fe,t,e)}route(t,e,i,r){const a=Cn(this,t),s=Cn(this,i),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[r];return $(l)?Object.assign({},c,l):W(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var bt=new Mh({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[xh,wh,Th]);function Sh(n){return!n||U(n.size)||U(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Di(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function kh(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,h;for(l=0;l<o;l++)if(d=e[l],d!=null&&!tt(d))s=Di(n,r,a,s,d);else if(tt(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!tt(h)&&(s=Di(n,r,a,s,h));n.restore();const f=a.length/2;if(f>e.length){for(l=0;l<f;l++)delete r[a[l]];a.splice(0,f)}return s}function Ye(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function ko(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function Ar(n,t,e,i){Co(n,t,e,i,null)}function Co(n,t,e,i,r){let a,s,o,l,c,u,d,h;const f=t.pointStyle,p=t.rotation,y=t.radius;let b=(p||0)*Mr;if(f&&typeof f=="object"&&(a=f.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(b),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),f){default:r?n.ellipse(e,i,r/2,y,0,0,ct):n.arc(e,i,y,0,ct),n.closePath();break;case"triangle":u=r?r/2:y,n.moveTo(e+Math.sin(b)*u,i-Math.cos(b)*y),b+=vi,n.lineTo(e+Math.sin(b)*u,i-Math.cos(b)*y),b+=vi,n.lineTo(e+Math.sin(b)*u,i-Math.cos(b)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(b+qt)*l,d=Math.cos(b+qt)*(r?r/2-c:l),o=Math.sin(b+qt)*l,h=Math.sin(b+qt)*(r?r/2-c:l),n.arc(e-d,i-o,c,b-X,b-ut),n.arc(e+h,i-s,c,b-ut,b),n.arc(e+d,i+o,c,b,b+ut),n.arc(e-h,i+s,c,b+ut,b+X),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=r?r/2:l,n.rect(e-u,i-l,2*u,2*l);break}b+=qt;case"rectRot":d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+h,i-s),n.lineTo(e+d,i+o),n.lineTo(e-h,i+s),n.closePath();break;case"crossRot":b+=qt;case"cross":d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-s),n.lineTo(e-h,i+s);break;case"star":d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-s),n.lineTo(e-h,i+s),b+=qt,d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-s),n.lineTo(e-h,i+s);break;case"line":s=r?r/2:Math.cos(b)*y,o=Math.sin(b)*y,n.moveTo(e-s,i-o),n.lineTo(e+s,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(b)*(r?r/2:y),i+Math.sin(b)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ue(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 Pn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function On(n){n.restore()}function Ch(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Ph(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 Oh(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),U(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 Eh(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function Ah(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function We(n,t,e,i,r,a={}){const s=tt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=r.string,Oh(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&Ah(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),U(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,i,a.maxWidth)),n.fillText(c,e,i,a.maxWidth),Eh(n,e,i,c,a),i+=Number(r.lineHeight);n.restore()}function tn(n,t){const{x:e,y:i,w:r,h:a,radius:s}=t;n.arc(e+s.topLeft,i+s.topLeft,s.topLeft,1.5*X,X,!0),n.lineTo(e,i+a-s.bottomLeft),n.arc(e+s.bottomLeft,i+a-s.bottomLeft,s.bottomLeft,X,ut,!0),n.lineTo(e+r-s.bottomRight,i+a),n.arc(e+r-s.bottomRight,i+a-s.bottomRight,s.bottomRight,ut,0,!0),n.lineTo(e+r,i+s.topRight),n.arc(e+r-s.topRight,i+s.topRight,s.topRight,0,-ut,!0),n.lineTo(e+s.topLeft,i)}const Rh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Lh=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ih(n,t){const e=(""+n).match(Rh);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Nh=n=>+n||0;function Rr(n,t){const e={},i=$(t),r=i?Object.keys(t):t,a=$(n)?i?s=>W(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of r)e[s]=Nh(a(s));return e}function Po(n){return Rr(n,{top:"y",right:"x",bottom:"y",left:"x"})}function _e(n){return Rr(n,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(n){const t=Po(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function dt(n,t){n=n||{},t=t||bt.font;let e=W(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=W(n.style,t.style);i&&!(""+i).match(Lh)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:W(n.family,t.family),lineHeight:Ih(W(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:W(n.weight,t.weight),string:""};return r.string=Sh(r),r}function En(n,t,e,i){let r=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),r=!1),e!==void 0&&tt(o)&&(o=o[e%o.length],r=!1),o!==void 0))return i&&!r&&(i.cacheable=!1),o}function Fh(n,t,e){const{min:i,max:r}=n,a=so(t,(r-i)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(i,-Math.abs(a)),max:s(r,a)}}function De(n,t){return Object.assign(Object.create(n),t)}function Lr(n,t=[""],e,i,r=()=>n[0]){const a=e||n;typeof i>"u"&&(i=Lo("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:i,_getTarget:r,override:o=>Lr([o,...n],t,a,i)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Eo(o,l,()=>Vh(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return Io(o).includes(l)},ownKeys(o){return Io(o)},set(o,l,c){const u=o._storage||(o._storage=r());return o[l]=u[l]=c,delete o._keys,!0}})}function en(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Oo(n,i),setContext:a=>en(n,a,e,i),override:a=>en(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Eo(a,s,()=>Wh(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Oo(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:Ut(e)?e:()=>e,isIndexable:Ut(i)?i:()=>i}}const Yh=(n,t)=>n?n+Tr(t):t,Ir=(n,t)=>$(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Eo(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Wh(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=n;let o=i[t];return Ut(o)&&s.isScriptable(t)&&(o=Uh(t,o,n,e)),tt(o)&&o.length&&(o=Bh(t,o,n,s.isIndexable)),Ir(t,o)&&(o=en(o,r,a&&a[t],s)),o}function Uh(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||i);return o.delete(n),Ir(n,l)&&(l=Nr(r._scopes,r,n,l)),l}function Bh(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&i(n))return t[a.index%t.length];if($(t[0])){const l=t,c=r._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Nr(c,r,n,u);t.push(en(d,a,s&&s[n],o))}}return t}function Ao(n,t,e){return Ut(n)?n(t,e):n}const zh=(n,t)=>n===!0?t:typeof n=="string"?ve(t,n):void 0;function Hh(n,t,e,i,r){for(const a of t){const s=zh(e,a);if(s){n.add(s);const o=Ao(s._fallback,e,r);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(s===!1&&typeof i<"u"&&e!==i)return null}return!1}function Nr(n,t,e,i){const r=t._rootScopes,a=Ao(t._fallback,e,i),s=[...n,...r],o=new Set;o.add(i);let l=Ro(o,s,e,a||e,i);return l===null||typeof a<"u"&&a!==e&&(l=Ro(o,s,a,l,i),l===null)?!1:Lr(Array.from(o),[""],r,a,()=>$h(t,e,i))}function Ro(n,t,e,i,r){for(;e;)e=Hh(n,t,e,i,r);return e}function $h(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return tt(r)&&$(e)?e:r||{}}function Vh(n,t,e,i){let r;for(const a of t)if(r=Lo(Yh(a,n),e),typeof r<"u")return Ir(n,r)?Nr(e,i,n,r):r}function Lo(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Io(n){let t=n._keys;return t||(t=n._keys=jh(n._scopes)),t}function jh(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function No(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,s=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],s[o]={r:r.parse(ve(u,a),c)};return s}const qh=Number.EPSILON||1e-14,nn=(n,t)=>t<n.length&&!n[t].skip&&n[t],Fo=n=>n==="x"?"y":"x";function Xh(n,t,e,i){const r=n.skip?t:n,a=t,s=e.skip?t:e,o=Je(a,r),l=Je(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:a.x-d*(s.x-r.x),y:a.y-d*(s.y-r.y)},next:{x:a.x+h*(s.x-r.x),y:a.y+h*(s.y-r.y)}}}function Gh(n,t,e){const i=n.length;let r,a,s,o,l,c=nn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=nn(n,u+1),!(!l||!c)){if(Tn(t[u],0,qh)){e[u]=e[u+1]=0;continue}r=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(r,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=r*s*t[u],e[u+1]=a*s*t[u])}}function Kh(n,t,e="x"){const i=Fo(e),r=n.length;let a,s,o,l=nn(n,0);for(let c=0;c<r;++c){if(s=o,o=l,l=nn(n,c+1),!o)continue;const u=o[e],d=o[i];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${i}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${i}`]=d+a*t[c])}}function Zh(n,t="x"){const e=Fo(t),i=n.length,r=Array(i).fill(0),a=Array(i);let s,o,l,c=nn(n,0);for(s=0;s<i;++s)if(o=l,l=c,c=nn(n,s+1),!!l){if(c){const u=c[t]-l[t];r[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Qt(r[s-1])!==Qt(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}Gh(n,r,a),Kh(n,a,t)}function Ti(n,t,e){return Math.max(Math.min(n,e),t)}function Qh(n,t){let e,i,r,a,s,o=ue(n[0],t);for(e=0,i=n.length;e<i;++e)s=a,a=o,o=e<i-1&&ue(n[e+1],t),a&&(r=n[e],s&&(r.cp1x=Ti(r.cp1x,t.left,t.right),r.cp1y=Ti(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=Ti(r.cp2x,t.left,t.right),r.cp2y=Ti(r.cp2y,t.top,t.bottom)))}function Jh(n,t,e,i,r){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Zh(n,r);else{let c=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Xh(c,o,n[Math.min(a+1,s-(i?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&Qh(n,e)}function Yo(){return typeof window<"u"&&typeof document<"u"}function Fr(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Mi(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Si=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function tf(n,t){return Si(n).getPropertyValue(t)}const ef=["top","right","bottom","left"];function Ue(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=ef[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const nf=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function rf(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let s=!1,o,l;if(nf(r,a,n.target))o=r,l=a;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function Te(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Si(e),a=r.boxSizing==="border-box",s=Ue(r,"padding"),o=Ue(r,"border","width"),{x:l,y:c,box:u}=rf(n,e),d=s.left+(u&&o.left),h=s.top+(u&&o.top);let{width:f,height:p}=t;return a&&(f-=s.width+o.width,p-=s.height+o.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((c-h)/p*e.height/i)}}function af(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Fr(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Si(a),l=Ue(o,"border","width"),c=Ue(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,i=Mi(o.maxWidth,a,"clientWidth"),r=Mi(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||yi,maxHeight:r||yi}}const ki=n=>Math.round(n*10)/10;function sf(n,t,e,i){const r=Si(n),a=Ue(r,"margin"),s=Mi(r.maxWidth,n,"clientWidth")||yi,o=Mi(r.maxHeight,n,"clientHeight")||yi,l=af(n,t,e);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const h=Ue(r,"border","width"),f=Ue(r,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-a.width),u=Math.max(0,i?c/i:u-a.height),c=ki(Math.min(c,s,l.maxWidth)),u=ki(Math.min(u,o,l.maxHeight)),c&&!u&&(u=ki(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ki(Math.floor(u*i))),{width:c,height:u}}function Wo(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||s.height!==r||s.width!==a?(n.currentDevicePixelRatio=i,s.height=r,s.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const of=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return n}();function Uo(n,t){const e=tf(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Be(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function lf(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 cf(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=Be(n,r,e),o=Be(r,a,e),l=Be(a,t,e),c=Be(s,o,e),u=Be(o,l,e);return Be(c,u,e)}const uf=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}}},df=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function rn(n,t,e){return n?uf(t,e):df()}function Bo(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 zo(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Ho(n){return n==="angle"?{between:Mn,compare:dh,normalize:$t}:{between:le,compare:(t,e)=>t-e,normalize:t=>t}}function $o({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function hf(n,t,e){const{property:i,start:r,end:a}=e,{between:s,normalize:o}=Ho(i),l=t.length;let{start:c,end:u,loop:d}=n,h,f;if(d){for(c+=l,u+=l,h=0,f=l;h<f&&s(o(t[c%l][i]),r,a);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Vo(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=Ho(i),{start:u,end:d,loop:h,style:f}=hf(n,t,e),p=[];let y=!1,b=null,m,v,x;const w=()=>l(r,x,m)&&o(r,x)!==0,_=()=>o(a,m)===0||l(a,x,m),D=()=>y||w(),T=()=>!y||_();for(let S=u,M=u;S<=d;++S)v=t[S%s],!v.skip&&(m=c(v[i]),m!==x&&(y=l(m,r,a),b===null&&D()&&(b=o(m,r)===0?S:M),b!==null&&T()&&(p.push($o({start:b,end:S,loop:h,count:s,style:f})),b=null),M=S,x=m));return b!==null&&p.push($o({start:b,end:d,loop:h,count:s,style:f})),p}function jo(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=Vo(i[r],n.points,t);a.length&&e.push(...a)}return e}function ff(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function gf(n,t,e,i){const r=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%r];c.skip||c.stop?o.skip||(i=!1,a.push({start:t%r,end:(l-1)%r,loop:i}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%r,end:s%r,loop:i}),a}function pf(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:s,end:o}=ff(e,r,a,i);if(i===!0)return qo(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+r:o,c=!!n._fullLoop&&s===0&&o===r-1;return qo(n,gf(e,s,l,c),e,t)}function qo(n,t,e,i){return!i||!i.setContext||!e?t:mf(n,t,e,i)}function mf(n,t,e,i){const r=n._chart.getContext(),a=Xo(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,h=d;function f(p,y,b,m){const v=o?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=v;for(;e[y%l].skip;)y+=v;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:b,style:m}),u=m,d=y%l)}}for(const p of t){d=o?d:p.start;let y=e[d%l],b;for(h=d+1;h<=p.end;h++){const m=e[h%l];b=Xo(i.setContext(De(r,{type:"segment",p0:y,p1:m,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:s}))),bf(b,u)&&f(d,h-1,p.loop,u),y=m,u=b}d<h-1&&f(d,h-1,p.loop,u)}return c}function Xo(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function bf(n,t){if(!t)return!1;const e=[],i=function(r,a){return Cr(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
11
+ */function oe(){}const eh=(()=>{let n=0;return()=>n++})();function U(n){return n===null||typeof n>"u"}function tt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function H(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function gt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Ht(n,t){return gt(n)?n:t}function W(n,t){return typeof n>"u"?t:n}const nh=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,so=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function rt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function at(n,t,e,i){let r,a,s;if(tt(n))if(a=n.length,i)for(r=a-1;r>=0;r--)t.call(e,n[r],r);else for(r=0;r<a;r++)t.call(e,n[r],r);else if(H(n))for(s=Object.keys(n),a=s.length,r=0;r<a;r++)t.call(e,n[s[r]],s[r])}function mi(n,t){let e,i,r,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(r=n[e],a=t[e],r.datasetIndex!==a.datasetIndex||r.index!==a.index)return!1;return!0}function bi(n){if(tt(n))return n.map(bi);if(H(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let r=0;for(;r<i;++r)t[e[r]]=bi(n[e[r]]);return t}return n}function oo(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function ih(n,t,e,i){if(!oo(n))return;const r=t[n],a=e[n];H(r)&&H(a)?Dn(r,a,i):t[n]=bi(a)}function Dn(n,t,e){const i=tt(t)?t:[t],r=i.length;if(!H(n))return n;e=e||{};const a=e.merger||ih;let s;for(let o=0;o<r;++o){if(s=i[o],!H(s))continue;const l=Object.keys(s);for(let c=0,u=l.length;c<u;++c)a(l[c],n,s,e)}return n}function Tn(n,t){return Dn(n,t,{merger:rh})}function rh(n,t,e){if(!oo(n))return;const i=t[n],r=e[n];H(i)&&H(r)?Tn(i,r):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=bi(r))}const lo={"":n=>n,x:n=>n.x,y:n=>n.y};function ah(n){const t=n.split("."),e=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function sh(n){const t=ah(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function ve(n,t){return(lo[t]||(lo[t]=sh(t)))(n)}function Tr(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wt=n=>typeof n<"u",Ut=n=>typeof n=="function",co=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function oh(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,ct=2*q,lh=ct+q,yi=Number.POSITIVE_INFINITY,Mr=q/180,ut=q/2,qt=q/4,vi=q*2/3,xe=Math.log10,Qt=Math.sign;function Mn(n,t,e){return Math.abs(n-t)<e}function uo(n){const t=Math.round(n);n=Mn(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xe(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function ch(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((r,a)=>r-a).pop(),t}function we(n){return!isNaN(parseFloat(n))&&isFinite(n)}function uh(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function ho(n,t,e){let i,r,a;for(i=0,r=n.length;i<r;i++)a=n[i][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function St(n){return n*(q/180)}function xi(n){return n*(180/q)}function fo(n){if(!gt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function go(n,t){const e=t.x-n.x,i=t.y-n.y,r=Math.sqrt(e*e+i*i);let a=Math.atan2(i,e);return a<-.5*q&&(a+=ct),{angle:a,distance:r}}function Je(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function dh(n,t){return(n-t+lh)%ct-q}function $t(n){return(n%ct+ct)%ct}function Sn(n,t,e,i){const r=$t(n),a=$t(t),s=$t(e),o=$t(a-r),l=$t(s-r),c=$t(r-a),u=$t(r-s);return r===a||r===s||i&&a===s||o>l&&c<u}function Ot(n,t,e){return Math.max(t,Math.min(e,n))}function hh(n){return Ot(n,-32768,32767)}function le(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Sr(n,t,e){e=e||(s=>n[s]<t);let i=n.length-1,r=0,a;for(;i-r>1;)a=r+i>>1,e(a)?r=a:i=a;return{lo:r,hi:i}}const ce=(n,t,e,i)=>Sr(n,e,i?r=>{const a=n[r][t];return a<e||a===e&&n[r+1][t]===e}:r=>n[r][t]<e),fh=(n,t,e)=>Sr(n,e,i=>n[i][t]>=e);function gh(n,t,e){let i=0,r=n.length;for(;i<r&&n[i]<t;)i++;for(;r>i&&n[r-1]>e;)r--;return i>0||r<n.length?n.slice(i,r):n}const po=["push","pop","shift","splice","unshift"];function ph(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),po.forEach(e=>{const i="_onData"+Tr(e),r=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=r.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...a)}),s}})})}function mo(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(po.forEach(a=>{delete n[a]}),delete n._chartjs)}function bo(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const yo=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function vo(n,t){let e=[],i=!1;return function(...r){e=r,i||(i=!0,yo.call(window,()=>{i=!1,n.apply(t,e)}))}}function mh(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const kr=n=>n==="start"?"left":n==="end"?"right":"center",Rt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,bh=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function xo(n,t,e){const i=t.length;let r=0,a=i;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:h}=s.getUserBounds();d&&(r=Ot(Math.min(ce(o,l,c).lo,e?i:ce(t,l,s.getPixelForValue(c)).lo),0,i-1)),h?a=Ot(Math.max(ce(o,s.axis,u,!0).hi+1,e?0:ce(t,l,s.getPixelForValue(u),!0).hi+1),r,i)-r:a=i-r}return{start:r,count:a}}function wo(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,r={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=r,!0;const a=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,r),a}const wi=n=>n===0||n===1,_o=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*ct/e)),Do=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*ct/e)+1,kn={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*ut)+1,easeOutSine:n=>Math.sin(n*ut),easeInOutSine:n=>-.5*(Math.cos(q*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=>wi(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=>wi(n)?n:_o(n,.075,.3),easeOutElastic:n=>wi(n)?n:Do(n,.075,.3),easeInOutElastic(n){return wi(n)?n:n<.5?.5*_o(n*2,.1125,.45):.5+.5*Do(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-kn.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?kn.easeInBounce(n*2)*.5:kn.easeOutBounce(n*2-1)*.5+.5};function Cr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function To(n){return Cr(n)?n:new _n(n)}function Or(n){return Cr(n)?n:new _n(n).saturate(.5).darken(.1).hexString()}const yh=["x","y","borderWidth","radius","tension"],vh=["color","borderColor","backgroundColor"];function xh(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:vh},numbers:{type:"number",properties:yh}}),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 wh(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Mo=new Map;function _h(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Mo.get(e);return i||(i=new Intl.NumberFormat(n,t),Mo.set(e,i)),i}function Cn(n,t,e){return _h(t,e).format(n)}const So={values(n){return tt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let r,a=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(r="scientific"),a=Dh(n,e)}const s=xe(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Cn(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xe(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?So.numeric.call(this,n,t,e):""}};function Dh(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 _i={formatters:So};function Th(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:_i.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Fe=Object.create(null),Pr=Object.create(null);function On(n,t){if(!t)return n;const e=t.split(".");for(let i=0,r=e.length;i<r;++i){const a=e[i];n=n[a]||(n[a]=Object.create(null))}return n}function Er(n,t,e){return typeof t=="string"?Dn(On(n,t),e):Dn(On(n,""),t)}class Mh{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,r)=>Or(r.backgroundColor),this.hoverBorderColor=(i,r)=>Or(r.borderColor),this.hoverColor=(i,r)=>Or(r.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 Er(this,t,e)}get(t){return On(this,t)}describe(t,e){return Er(Pr,t,e)}override(t,e){return Er(Fe,t,e)}route(t,e,i,r){const a=On(this,t),s=On(this,i),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[r];return H(l)?Object.assign({},c,l):W(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var mt=new Mh({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[xh,wh,Th]);function Sh(n){return!n||U(n.size)||U(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Di(n,t,e,i,r){let a=t[r];return a||(a=t[r]=n.measureText(r).width,e.push(r)),a>i&&(i=a),i}function kh(n,t,e,i){i=i||{};let r=i.data=i.data||{},a=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},a=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,h;for(l=0;l<o;l++)if(d=e[l],d!=null&&!tt(d))s=Di(n,r,a,s,d);else if(tt(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!tt(h)&&(s=Di(n,r,a,s,h));n.restore();const f=a.length/2;if(f>e.length){for(l=0;l<f;l++)delete r[a[l]];a.splice(0,f)}return s}function Ye(n,t,e){const i=n.currentDevicePixelRatio,r=e!==0?Math.max(e/2,.5):0;return Math.round((t-r)*i)/i+r}function ko(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function Ar(n,t,e,i){Co(n,t,e,i,null)}function Co(n,t,e,i,r){let a,s,o,l,c,u,d,h;const f=t.pointStyle,p=t.rotation,y=t.radius;let b=(p||0)*Mr;if(f&&typeof f=="object"&&(a=f.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(b),n.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),f){default:r?n.ellipse(e,i,r/2,y,0,0,ct):n.arc(e,i,y,0,ct),n.closePath();break;case"triangle":u=r?r/2:y,n.moveTo(e+Math.sin(b)*u,i-Math.cos(b)*y),b+=vi,n.lineTo(e+Math.sin(b)*u,i-Math.cos(b)*y),b+=vi,n.lineTo(e+Math.sin(b)*u,i-Math.cos(b)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,s=Math.cos(b+qt)*l,d=Math.cos(b+qt)*(r?r/2-c:l),o=Math.sin(b+qt)*l,h=Math.sin(b+qt)*(r?r/2-c:l),n.arc(e-d,i-o,c,b-q,b-ut),n.arc(e+h,i-s,c,b-ut,b),n.arc(e+d,i+o,c,b,b+ut),n.arc(e-h,i+s,c,b+ut,b+q),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=r?r/2:l,n.rect(e-u,i-l,2*u,2*l);break}b+=qt;case"rectRot":d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+h,i-s),n.lineTo(e+d,i+o),n.lineTo(e-h,i+s),n.closePath();break;case"crossRot":b+=qt;case"cross":d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-s),n.lineTo(e-h,i+s);break;case"star":d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-s),n.lineTo(e-h,i+s),b+=qt,d=Math.cos(b)*(r?r/2:y),s=Math.cos(b)*y,o=Math.sin(b)*y,h=Math.sin(b)*(r?r/2:y),n.moveTo(e-d,i-o),n.lineTo(e+d,i+o),n.moveTo(e+h,i-s),n.lineTo(e-h,i+s);break;case"line":s=r?r/2:Math.cos(b)*y,o=Math.sin(b)*y,n.moveTo(e-s,i-o),n.lineTo(e+s,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(b)*(r?r/2:y),i+Math.sin(b)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function ue(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 Pn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function En(n){n.restore()}function Ch(n,t,e,i,r){if(!t)return n.lineTo(e.x,e.y);if(r==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else r==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Oh(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 Ph(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),U(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 Eh(n,t,e,i,r){if(r.strikethrough||r.underline){const a=n.measureText(i),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=r.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function Ah(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function We(n,t,e,i,r,a={}){const s=tt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=r.string,Ph(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&Ah(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),U(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,i,a.maxWidth)),n.fillText(c,e,i,a.maxWidth),Eh(n,e,i,c,a),i+=Number(r.lineHeight);n.restore()}function tn(n,t){const{x:e,y:i,w:r,h:a,radius:s}=t;n.arc(e+s.topLeft,i+s.topLeft,s.topLeft,1.5*q,q,!0),n.lineTo(e,i+a-s.bottomLeft),n.arc(e+s.bottomLeft,i+a-s.bottomLeft,s.bottomLeft,q,ut,!0),n.lineTo(e+r-s.bottomRight,i+a),n.arc(e+r-s.bottomRight,i+a-s.bottomRight,s.bottomRight,ut,0,!0),n.lineTo(e+r,i+s.topRight),n.arc(e+r-s.topRight,i+s.topRight,s.topRight,0,-ut,!0),n.lineTo(e+s.topLeft,i)}const Rh=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Lh=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ih(n,t){const e=(""+n).match(Rh);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Nh=n=>+n||0;function Rr(n,t){const e={},i=H(t),r=i?Object.keys(t):t,a=H(n)?i?s=>W(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of r)e[s]=Nh(a(s));return e}function Oo(n){return Rr(n,{top:"y",right:"x",bottom:"y",left:"x"})}function _e(n){return Rr(n,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(n){const t=Oo(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function dt(n,t){n=n||{},t=t||mt.font;let e=W(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=W(n.style,t.style);i&&!(""+i).match(Lh)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:W(n.family,t.family),lineHeight:Ih(W(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:W(n.weight,t.weight),string:""};return r.string=Sh(r),r}function An(n,t,e,i){let r=!0,a,s,o;for(a=0,s=n.length;a<s;++a)if(o=n[a],o!==void 0&&(t!==void 0&&typeof o=="function"&&(o=o(t),r=!1),e!==void 0&&tt(o)&&(o=o[e%o.length],r=!1),o!==void 0))return i&&!r&&(i.cacheable=!1),o}function Fh(n,t,e){const{min:i,max:r}=n,a=so(t,(r-i)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(i,-Math.abs(a)),max:s(r,a)}}function De(n,t){return Object.assign(Object.create(n),t)}function Lr(n,t=[""],e,i,r=()=>n[0]){const a=e||n;typeof i>"u"&&(i=Lo("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:i,_getTarget:r,override:o=>Lr([o,...n],t,a,i)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Eo(o,l,()=>Vh(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return Io(o).includes(l)},ownKeys(o){return Io(o)},set(o,l,c){const u=o._storage||(o._storage=r());return o[l]=u[l]=c,delete o._keys,!0}})}function en(n,t,e,i){const r={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Po(n,i),setContext:a=>en(n,a,e,i),override:a=>en(n.override(a),t,e,i)};return new Proxy(r,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Eo(a,s,()=>Wh(a,s,o))},getOwnPropertyDescriptor(a,s){return a._descriptors.allKeys?Reflect.has(n,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,s)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(a,s){return Reflect.has(n,s)},ownKeys(){return Reflect.ownKeys(n)},set(a,s,o){return n[s]=o,delete a[s],!0}})}function Po(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=n;return{allKeys:r,scriptable:e,indexable:i,isScriptable:Ut(e)?e:()=>e,isIndexable:Ut(i)?i:()=>i}}const Yh=(n,t)=>n?n+Tr(t):t,Ir=(n,t)=>H(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Eo(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Wh(n,t,e){const{_proxy:i,_context:r,_subProxy:a,_descriptors:s}=n;let o=i[t];return Ut(o)&&s.isScriptable(t)&&(o=Uh(t,o,n,e)),tt(o)&&o.length&&(o=Bh(t,o,n,s.isIndexable)),Ir(t,o)&&(o=en(o,r,a&&a[t],s)),o}function Uh(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(a,s||i);return o.delete(n),Ir(n,l)&&(l=Nr(r._scopes,r,n,l)),l}function Bh(n,t,e,i){const{_proxy:r,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&i(n))return t[a.index%t.length];if(H(t[0])){const l=t,c=r._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Nr(c,r,n,u);t.push(en(d,a,s&&s[n],o))}}return t}function Ao(n,t,e){return Ut(n)?n(t,e):n}const zh=(n,t)=>n===!0?t:typeof n=="string"?ve(t,n):void 0;function Hh(n,t,e,i,r){for(const a of t){const s=zh(e,a);if(s){n.add(s);const o=Ao(s._fallback,e,r);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(s===!1&&typeof i<"u"&&e!==i)return null}return!1}function Nr(n,t,e,i){const r=t._rootScopes,a=Ao(t._fallback,e,i),s=[...n,...r],o=new Set;o.add(i);let l=Ro(o,s,e,a||e,i);return l===null||typeof a<"u"&&a!==e&&(l=Ro(o,s,a,l,i),l===null)?!1:Lr(Array.from(o),[""],r,a,()=>$h(t,e,i))}function Ro(n,t,e,i,r){for(;e;)e=Hh(n,t,e,i,r);return e}function $h(n,t,e){const i=n._getTarget();t in i||(i[t]={});const r=i[t];return tt(r)&&H(e)?e:r||{}}function Vh(n,t,e,i){let r;for(const a of t)if(r=Lo(Yh(a,n),e),typeof r<"u")return Ir(n,r)?Nr(e,i,n,r):r}function Lo(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Io(n){let t=n._keys;return t||(t=n._keys=jh(n._scopes)),t}function jh(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function No(n,t,e,i){const{iScale:r}=n,{key:a="r"}=this._parsing,s=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],s[o]={r:r.parse(ve(u,a),c)};return s}const qh=Number.EPSILON||1e-14,nn=(n,t)=>t<n.length&&!n[t].skip&&n[t],Fo=n=>n==="x"?"y":"x";function Xh(n,t,e,i){const r=n.skip?t:n,a=t,s=e.skip?t:e,o=Je(a,r),l=Je(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,h=i*u;return{previous:{x:a.x-d*(s.x-r.x),y:a.y-d*(s.y-r.y)},next:{x:a.x+h*(s.x-r.x),y:a.y+h*(s.y-r.y)}}}function Gh(n,t,e){const i=n.length;let r,a,s,o,l,c=nn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=nn(n,u+1),!(!l||!c)){if(Mn(t[u],0,qh)){e[u]=e[u+1]=0;continue}r=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(r,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=r*s*t[u],e[u+1]=a*s*t[u])}}function Kh(n,t,e="x"){const i=Fo(e),r=n.length;let a,s,o,l=nn(n,0);for(let c=0;c<r;++c){if(s=o,o=l,l=nn(n,c+1),!o)continue;const u=o[e],d=o[i];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${i}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${i}`]=d+a*t[c])}}function Zh(n,t="x"){const e=Fo(t),i=n.length,r=Array(i).fill(0),a=Array(i);let s,o,l,c=nn(n,0);for(s=0;s<i;++s)if(o=l,l=c,c=nn(n,s+1),!!l){if(c){const u=c[t]-l[t];r[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Qt(r[s-1])!==Qt(r[s])?0:(r[s-1]+r[s])/2:r[s-1]:r[s]}Gh(n,r,a),Kh(n,a,t)}function Ti(n,t,e){return Math.max(Math.min(n,e),t)}function Qh(n,t){let e,i,r,a,s,o=ue(n[0],t);for(e=0,i=n.length;e<i;++e)s=a,a=o,o=e<i-1&&ue(n[e+1],t),a&&(r=n[e],s&&(r.cp1x=Ti(r.cp1x,t.left,t.right),r.cp1y=Ti(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=Ti(r.cp2x,t.left,t.right),r.cp2y=Ti(r.cp2y,t.top,t.bottom)))}function Jh(n,t,e,i,r){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Zh(n,r);else{let c=i?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Xh(c,o,n[Math.min(a+1,s-(i?0:1))%s],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&Qh(n,e)}function Yo(){return typeof window<"u"&&typeof document<"u"}function Fr(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Mi(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Si=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function tf(n,t){return Si(n).getPropertyValue(t)}const ef=["top","right","bottom","left"];function Ue(n,t,e){const i={};e=e?"-"+e:"";for(let r=0;r<4;r++){const a=ef[r];i[a]=parseFloat(n[t+"-"+a+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const nf=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function rf(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:r,offsetY:a}=i;let s=!1,o,l;if(nf(r,a,n.target))o=r,l=a;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function Te(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,r=Si(e),a=r.boxSizing==="border-box",s=Ue(r,"padding"),o=Ue(r,"border","width"),{x:l,y:c,box:u}=rf(n,e),d=s.left+(u&&o.left),h=s.top+(u&&o.top);let{width:f,height:p}=t;return a&&(f-=s.width+o.width,p-=s.height+o.height),{x:Math.round((l-d)/f*e.width/i),y:Math.round((c-h)/p*e.height/i)}}function af(n,t,e){let i,r;if(t===void 0||e===void 0){const a=Fr(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=Si(a),l=Ue(o,"border","width"),c=Ue(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,i=Mi(o.maxWidth,a,"clientWidth"),r=Mi(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:i||yi,maxHeight:r||yi}}const ki=n=>Math.round(n*10)/10;function sf(n,t,e,i){const r=Si(n),a=Ue(r,"margin"),s=Mi(r.maxWidth,n,"clientWidth")||yi,o=Mi(r.maxHeight,n,"clientHeight")||yi,l=af(n,t,e);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const h=Ue(r,"border","width"),f=Ue(r,"padding");c-=f.width+h.width,u-=f.height+h.height}return c=Math.max(0,c-a.width),u=Math.max(0,i?c/i:u-a.height),c=ki(Math.min(c,s,l.maxWidth)),u=ki(Math.min(u,o,l.maxHeight)),c&&!u&&(u=ki(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ki(Math.floor(u*i))),{width:c,height:u}}function Wo(n,t,e){const i=t||1,r=Math.floor(n.height*i),a=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const s=n.canvas;return s.style&&(e||!s.style.height&&!s.style.width)&&(s.style.height=`${n.height}px`,s.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||s.height!==r||s.width!==a?(n.currentDevicePixelRatio=i,s.height=r,s.width=a,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const of=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return n}();function Uo(n,t){const e=tf(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Be(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function lf(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 cf(n,t,e,i){const r={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=Be(n,r,e),o=Be(r,a,e),l=Be(a,t,e),c=Be(s,o,e),u=Be(o,l,e);return Be(c,u,e)}const uf=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}}},df=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function rn(n,t,e){return n?uf(t,e):df()}function Bo(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 zo(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Ho(n){return n==="angle"?{between:Sn,compare:dh,normalize:$t}:{between:le,compare:(t,e)=>t-e,normalize:t=>t}}function $o({start:n,end:t,count:e,loop:i,style:r}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:r}}function hf(n,t,e){const{property:i,start:r,end:a}=e,{between:s,normalize:o}=Ho(i),l=t.length;let{start:c,end:u,loop:d}=n,h,f;if(d){for(c+=l,u+=l,h=0,f=l;h<f&&s(o(t[c%l][i]),r,a);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Vo(n,t,e){if(!e)return[n];const{property:i,start:r,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=Ho(i),{start:u,end:d,loop:h,style:f}=hf(n,t,e),p=[];let y=!1,b=null,m,v,w;const x=()=>l(r,w,m)&&o(r,w)!==0,_=()=>o(a,m)===0||l(a,w,m),D=()=>y||x(),T=()=>!y||_();for(let M=u,S=u;M<=d;++M)v=t[M%s],!v.skip&&(m=c(v[i]),m!==w&&(y=l(m,r,a),b===null&&D()&&(b=o(m,r)===0?M:S),b!==null&&T()&&(p.push($o({start:b,end:M,loop:h,count:s,style:f})),b=null),S=M,w=m));return b!==null&&p.push($o({start:b,end:d,loop:h,count:s,style:f})),p}function jo(n,t){const e=[],i=n.segments;for(let r=0;r<i.length;r++){const a=Vo(i[r],n.points,t);a.length&&e.push(...a)}return e}function ff(n,t,e,i){let r=0,a=t-1;if(e&&!i)for(;r<t&&!n[r].skip;)r++;for(;r<t&&n[r].skip;)r++;for(r%=t,e&&(a+=r);a>r&&n[a%t].skip;)a--;return a%=t,{start:r,end:a}}function gf(n,t,e,i){const r=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%r];c.skip||c.stop?o.skip||(i=!1,a.push({start:t%r,end:(l-1)%r,loop:i}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%r,end:s%r,loop:i}),a}function pf(n,t){const e=n.points,i=n.options.spanGaps,r=e.length;if(!r)return[];const a=!!n._loop,{start:s,end:o}=ff(e,r,a,i);if(i===!0)return qo(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+r:o,c=!!n._fullLoop&&s===0&&o===r-1;return qo(n,gf(e,s,l,c),e,t)}function qo(n,t,e,i){return!i||!i.setContext||!e?t:mf(n,t,e,i)}function mf(n,t,e,i){const r=n._chart.getContext(),a=Xo(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,h=d;function f(p,y,b,m){const v=o?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=v;for(;e[y%l].skip;)y+=v;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:b,style:m}),u=m,d=y%l)}}for(const p of t){d=o?d:p.start;let y=e[d%l],b;for(h=d+1;h<=p.end;h++){const m=e[h%l];b=Xo(i.setContext(De(r,{type:"segment",p0:y,p1:m,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:s}))),bf(b,u)&&f(d,h-1,p.loop,u),y=m,u=b}d<h-1&&f(d,h-1,p.loop,u)}return c}function Xo(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function bf(n,t){if(!t)return!1;const e=[],i=function(r,a){return Cr(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
12
12
  * Chart.js v4.4.0
13
13
  * https://www.chartjs.org
14
14
  * (c) 2023 Chart.js Contributors
15
15
  * Released under the MIT License
16
- */class yf{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=yo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var de=new yf;const Go="transparent",vf={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=To(n||Go),r=i.valid&&To(t||Go);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class xf{constructor(t,e,i,r){const a=e[i];r=En([t.to,r,a,t.from]);const s=En([t.from,a,r]);this._active=!0,this._fn=t.fn||vf[t.type||typeof s],this._easing=Sn[t.easing]||Sn.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=s,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=En([t.to,e,r,t.from]),this._from=En([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<i),!this._active){this._target[r]=o,this._notify(!0);return}if(e<0){this._target[r]=a;return}l=e/i%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(a,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class Yr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!$(t))return;const e=Object.keys(bt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!$(a))return;const s={};for(const o of e)s[o]=a[o];(tt(a.properties)&&a.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,s)})})}_animateOptions(t,e){const i=e.options,r=_f(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&wf(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,o);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}a[c]=d=new xf(h,t,c,u),r.push(d)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return de.add(this._chart,i),!0}}function wf(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function _f(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Ko(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function Df(n,t,e){if(e===!1)return!1;const i=Ko(n,e),r=Ko(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function Tf(n){let t,e,i,r;return $(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function Zo(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function Qo(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=r.length;s<o;++s){if(l=+r[s],l===e){if(i.all)continue;break}c=n.values[l],pt(c)&&(a||t===0||Qt(t)===Qt(c))&&(t+=c)}return t}}function Mf(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function Jo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Sf(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function kf(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function Cf(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function tl(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function el(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=i,l=a.axis,c=s.axis,u=Sf(a,s,i),d=t.length;let h;for(let f=0;f<d;++f){const p=t[f],{[l]:y,[c]:b}=p,m=p._stacks||(p._stacks={});h=m[c]=Cf(r,u,y),h[o]=b,h._top=tl(h,s,!0,i.type),h._bottom=tl(h,s,!1,i.type);const v=h._visualValues||(h._visualValues={});v[o]=b}}function Wr(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Pf(n,t){return De(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Of(n,t,e){return De(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function An(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const Ur=n=>n==="reset"||n==="none",nl=(n,t)=>t?n:Object.assign({},n),Ef=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Zo(e,!0),values:null};class Gt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Jo(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&&An(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,a=e.xAxisID=W(i.xAxisID,Wr(t,"x")),s=e.yAxisID=W(i.yAxisID,Wr(t,"y")),o=e.rAxisID=W(i.rAxisID,Wr(t,"r")),l=e.indexAxis,c=e.iAxisID=r(l,a,s,o),u=e.vAxisID=r(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&mo(this._data,this),t._stacked&&An(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if($(e))this._data=Mf(e);else if(i!==e){if(i){mo(i,this);const r=this._cachedMeta;An(r),r._parsed=[]}e&&Object.isExtensible(e)&&ph(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const a=e._stacked;e._stacked=Jo(e.vScale,e),e.stack!==i.stack&&(r=!0,An(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&el(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:a,_stacked:s}=i,o=a.axis;let l=t===0&&e===r.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=r,i._sorted=!0,h=r;else{tt(r[t])?h=this.parseArrayData(i,r,t,e):$(r[t])?h=this.parseObjectData(i,r,t,e):h=this.parsePrimitiveData(i,r,t,e);const f=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=h[u],l&&(f()&&(l=!1),c=d);i._sorted=l}s&&el(this,h)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(r);let h,f,p;for(h=0,f=r;h<f;++h)p=h+i,d[h]={[o]:u||a.parse(c[p],p),[l]:s.parse(e[p],p)};return d}parseArrayData(t,e,i,r){const{xScale:a,yScale:s}=t,o=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+i,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,i,r){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,d,h,f;for(u=0,d=r;u<d;++u)h=u+i,f=e[h],c[u]={x:a.parse(ve(f,o),h),y:s.parse(ve(f,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:Zo(r,!0),values:e._stacks[t.axis]._visualValues};return Qo(o,s,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let s=a===null?NaN:a;const o=r&&i._stacks[e.axis];r&&o&&(r.values=o,s=Qo(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,s=r.length,o=this._getOtherScale(t),l=Ef(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=kf(o);let h,f;function p(){f=r[h];const y=f[o.axis];return!pt(f[t.axis])||u>y||d<y}for(h=0;h<s&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),a));++h);if(a){for(h=s-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,s;for(r=0,a=e.length;r<a;++r)s=e[r][t.axis],pt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Tf(W(this.options.clip,Df(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=r[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=Of(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=Pf(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&Wt(i);if(o)return nl(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),f=Object.keys(bt.elements[t]),p=()=>this.getContext(i,r,e),y=c.resolveNamedOptions(h,f,p,d);return y.$shared&&(y.$shared=l,a[s]=Object.freeze(nl(y,l))),y}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(r.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new Yr(r,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ur(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),s=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:s}}updateElement(t,e,i,r){Ur(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Ur(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const r=i.length,a=e.length,s=Math.min(a,r);s&&this.parse(0,s),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&An(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}k(Gt,"defaults",{}),k(Gt,"datasetElementType",null),k(Gt,"dataElementType",null);function Af(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=bo(i.sort((r,a)=>r-a))}return n._cache.$bar}function Rf(n){const t=n.iScale,e=Af(t,n.type);let i=t._length,r,a,s,o;const l=()=>{s===32767||s===-32768||(Wt(o)&&(i=Math.min(i,Math.abs(s-o)||i)),o=s)};for(r=0,a=e.length;r<a;++r)s=t.getPixelForValue(e[r]),l();for(o=void 0,r=0,a=t.ticks.length;r<a;++r)s=t.getPixelForTick(r),l();return i}function Lf(n,t,e,i){const r=e.barThickness;let a,s;return U(r)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=r*i,s=1),{chunk:a/i,ratio:s,start:t.pixels[n]-a/2}}function If(n,t,e,i){const r=t.pixels,a=r[n];let s=n>0?r[n-1]:null,o=n<r.length-1?r[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/i,ratio:e.barPercentage,start:c}}function Nf(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),s=Math.min(r,a),o=Math.max(r,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:a,min:s,max:o}}function il(n,t,e,i){return tt(n)?Nf(n,t,e,i):t[e.axis]=e.parse(n,i),t}function rl(n,t,e,i){const r=n.iScale,a=n.vScale,s=r.getLabels(),o=r===a,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[r.axis]=o||r.parse(s[c],c),l.push(il(h,d,a,c));return l}function Br(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Ff(n,t,e){return n!==0?Qt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Yf(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function Wf(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Yf(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=c:(e._bottom||0)===i?r=u:(a[al(u,s,o,l)]=!0,r=c)),a[al(r,s,o,l)]=!0,n.borderSkipped=a}function al(n,t,e,i){return i?(n=Uf(n,t,e),n=sl(n,e,t)):n=sl(n,t,e),n}function Uf(n,t,e){return n===t?e:n===e?t:n}function sl(n,t,e){return n==="start"?t:n==="end"?e:n}function Bf(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Rn extends Gt{parsePrimitiveData(t,e,i,r){return rl(t,e,i,r)}parseArrayData(t,e,i,r){return rl(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let h,f,p,y;for(h=i,f=i+r;h<f;++h)y=e[h],p={},p[a.axis]=a.parse(ve(y,c),h),d.push(il(ve(y,u),p,s,h));return d}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),s=a._custom,o=Br(s)?"["+s.start+", "+s.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const a=r==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,r);for(let f=e;f<e+i;f++){const p=this.getParsed(f),y=a||U(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,u),m=(p._stacks||{})[o.axis],v={horizontal:c,base:y.base,enableBorderRadius:!m||Br(p._custom)||s===m._top||s===m._bottom,x:c?y.head:b.center,y:c?b.center:y.head,height:c?b.size:Math.abs(y.size),width:c?Math.abs(y.size):b.size};h&&(v.options=d||this.resolveDataElementOptions(f,t[f].active?"active":r));const x=v.options||t[f].options;Wf(v,x,m,s),Bf(v,x,u.ratio),this.updateElement(t[f],f,v,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=i.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(U(u)||isNaN(u))return!0};for(const l of r)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,s;for(a=0,s=e.data.length;a<s;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const o=t.barThickness;return{min:o||Rf(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=Br(c);let d=l[e.axis],h=0,f=i?this.applyStack(e,l,i):d,p,y;f!==d&&(h=f-d,f=d),u&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&Qt(d)!==Qt(c.barEnd)&&(h=0),h+=d);const b=!U(a)&&!u?a:h;let m=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(h+f):p=m,y=p-m,Math.abs(y)<s){y=Ff(y,e,o)*s,d===o&&(m-=y/2);const v=e.getPixelForDecimal(0),x=e.getPixelForDecimal(1),w=Math.min(v,x),_=Math.max(v,x);m=Math.max(Math.min(m,_),w),p=m+y,i&&!u&&(l._stacks[e.axis]._visualValues[r]=e.getValueForPixel(p)-e.getValueForPixel(m))}if(m===e.getPixelForValue(o)){const v=Qt(y)*e.getLineWidthForValue(o)/2;m+=v,y-=v}return{size:y,base:m,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,s=W(r.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=r.barThickness==="flex"?If(t,e,r,c):Lf(t,e,r,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(s,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}k(Rn,"id","bar"),k(Rn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),k(Rn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ci extends Gt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=W(o[2],this.resolveDataElementOptions(s+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=W(o&&o.r&&+o.r,this.resolveDataElementOptions(s+i).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,r),u=s.axis,d=o.axis;for(let h=e;h<e+i;h++){const f=t[h],p=!a&&this.getParsed(h),y={},b=y[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),m=y[d]=a?o.getBasePixel():o.getPixelForValue(p[d]);y.skip=isNaN(b)||isNaN(m),c&&(y.options=l||this.resolveDataElementOptions(h,f.active?"active":r),a&&(y.options.radius=0)),this.updateElement(f,h,y,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=W(i&&i._custom,a),r}}k(Ci,"id","bubble"),k(Ci,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),k(Ci,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function zf(n,t,e){let i=1,r=1,a=0,s=0;if(t<ct){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),h=Math.sin(l),f=(x,w,_)=>Mn(x,o,l,!0)?1:Math.max(w,w*e,_,_*e),p=(x,w,_)=>Mn(x,o,l,!0)?-1:Math.min(w,w*e,_,_*e),y=f(0,c,d),b=f(ut,u,h),m=p(X,c,d),v=p(X+ut,u,h);i=(y-m)/2,r=(b-v)/2,a=-(y+m)/2,s=-(b+v)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:s}}class Me extends Gt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=l=>+i[l];if($(i[t])){const{key:l="value"}=this._parsing;a=c=>+ve(i[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)r._parsed[s]=a(s)}}_getRotation(){return St(this.options.rotation-90)}_getCircumference(){return St(this.options.circumference)}_getRotationExtents(){let t=ct,e=-ct;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),s=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),l=Math.min(nh(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:p,offsetY:y}=zf(d,u,l),b=(i.width-s)/h,m=(i.height-s)/f,v=Math.max(Math.min(b,m)/2,0),x=so(this.options.radius,v),w=Math.max(x*l,0),_=(x-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*x,this.offsetY=y*x,r.total=this.calculateTotal(),this.outerRadius=x-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/ct)}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,h=a&&c.animateScale,f=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:y,includeOptions:b}=this._getSharedOptions(e,r);let m=this._getRotation(),v;for(v=0;v<e;++v)m+=this._circumference(v,a);for(v=e;v<e+i;++v){const x=this._circumference(v,a),w=t[v],_={x:u+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+x,circumference:x,outerRadius:p,innerRadius:f};b&&(_.options=y||this.resolveDataElementOptions(v,w.active?"active":r)),m+=x,this.updateElement(w,v,_,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=kn(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,s,o,l;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){s=i.getDatasetMeta(r),t=s.data,o=s.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)l=o.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.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(W(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}k(Me,"id","doughnut"),k(Me,"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"}),k(Me,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),k(Me,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class Ln extends Gt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=xo(e,r,s);this._drawStart=o,this._drawCount=l,wo(e)&&(o=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:c},t),this.updateElements(r,o,l,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=s.axis,f=o.axis,{spanGaps:p,segment:y}=this.options,b=we(p)?p:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||r==="none",v=e+i,x=t.length;let w=e>0&&this.getParsed(e-1);for(let _=0;_<x;++_){const D=t[_],T=m?D:{};if(_<e||_>=v){T.skip=!0;continue}const S=this.getParsed(_),M=U(S[f]),O=T[h]=s.getPixelForValue(S[h],_),A=T[f]=a||M?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,S,l):S[f],_);T.skip=isNaN(O)||isNaN(A)||M,T.stop=_>0&&Math.abs(S[h]-w[h])>b,y&&(T.parsed=S,T.raw=c.data[_]),d&&(T.options=u||this.resolveDataElementOptions(_,D.active?"active":r)),m||this.updateElement(D,_,T,r),w=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}k(Ln,"id","line"),k(Ln,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),k(Ln,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class In extends Gt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=kn(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return No.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),s=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*X;let f=h,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)f+=this._computeAngle(p,r,y);for(p=e;p<e+i;p++){const b=t[p];let m=f,v=f+this._computeAngle(p,r,y),x=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=v,a&&(l.animateScale&&(x=0),l.animateRotate&&(m=v=h));const w={x:u,y:d,innerRadius:0,outerRadius:x,startAngle:m,endAngle:v,options:this.resolveDataElementOptions(p,b.active?"active":r)};this.updateElement(b,p,w,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?St(this.resolveDataElementOptions(t,e).angle||i):0}}k(In,"id","polarArea"),k(In,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),k(In,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class zr extends Me{}k(zr,"id","pie"),k(zr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Pi extends Gt{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return No.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===r.length,options:s};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,s=r==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":r),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,h=s?a.yCenter:u.y,f={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,o,f,r)}}}k(Pi,"id","radar"),k(Pi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),k(Pi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Oi extends Gt{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=xo(e,i,r);if(this._drawStart=a,this._drawCount=s,wo(e)&&(a=0,s=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,r),d=this.getSharedOptions(u),h=this.includeOptions(r,d),f=s.axis,p=o.axis,{spanGaps:y,segment:b}=this.options,m=we(y)?y:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||a||r==="none";let x=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){const _=t[w],D=this.getParsed(w),T=v?_:{},S=U(D[p]),M=T[f]=s.getPixelForValue(D[f],w),O=T[p]=a||S?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,D,l):D[p],w);T.skip=isNaN(M)||isNaN(O)||S,T.stop=w>0&&Math.abs(D[f]-x[f])>m,b&&(T.parsed=D,T.raw=c.data[w]),h&&(T.options=d||this.resolveDataElementOptions(w,_.active?"active":r)),v||this.updateElement(_,w,T,r),x=D}this.updateSharedOptions(d,r,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,s)/2}}k(Oi,"id","scatter"),k(Oi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),k(Oi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Hf=Object.freeze({__proto__:null,BarController:Rn,BubbleController:Ci,DoughnutController:Me,LineController:Ln,PieController:zr,PolarAreaController:In,RadarController:Pi,ScatterController:Oi});function ze(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Hr{constructor(t){k(this,"options");this.options=t||{}}static override(t){Object.assign(Hr.prototype,t)}init(){}formats(){return ze()}parse(){return ze()}format(){return ze()}add(){return ze()}diff(){return ze()}startOf(){return ze()}endOf(){return ze()}}var ol={_date:Hr};function $f(n,t,e,i){const{controller:r,data:a,_sorted:s}=n,o=r._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?fh:ce;if(i){if(r._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),h=l(a,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Nn(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:h}=$f(a[o],t,s,r);for(let f=d;f<=h;++f){const p=u[f];p.skip||i(p,c,f)}}}function Vf(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,s=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function $r(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||Nn(n,e,t,function(o,l,c){!r&&!ue(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function jf(n,t,e,i){let r=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],i),{angle:d}=go(s,{x:t.x,y:t.y});Mn(d,c,u)&&r.push({element:s,datasetIndex:o,index:l})}return Nn(n,e,t,a),r}function qf(n,t,e,i,r,a){let s=[];const o=Vf(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const f=u.inRange(t.x,t.y,r);if(i&&!f)return;const p=u.getCenterPoint(r);if(!(!!a||n.isPointInArea(p))&&!f)return;const b=o(t,p);b<l?(s=[{element:u,datasetIndex:d,index:h}],l=b):b===l&&s.push({element:u,datasetIndex:d,index:h})}return Nn(n,e,t,c),s}function Vr(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?jf(n,t,e,r):qf(n,t,e,i,r,a)}function ll(n,t,e,i,r){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Nn(n,e,t,(l,c,u)=>{l[s](t[e],r)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,r))}),i&&!o?[]:a}var jr={evaluateInteractionItems:Nn,modes:{index(n,t,e,i){const r=Te(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?$r(n,r,a,i,s):Vr(n,r,a,!1,i,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const r=Te(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?$r(n,r,a,i,s):Vr(n,r,a,!1,i,s);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const r=Te(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return $r(n,r,a,i,s)},nearest(n,t,e,i){const r=Te(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return Vr(n,r,a,e.intersect,i,s)},x(n,t,e,i){const r=Te(t,n);return ll(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Te(t,n);return ll(n,r,"y",e.intersect,i)}}};const cl=["left","top","right","bottom"];function Fn(n,t){return n.filter(e=>e.pos===t)}function ul(n,t){return n.filter(e=>cl.indexOf(e.pos)===-1&&e.box.axis===t)}function Yn(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function Xf(n){const t=[];let e,i,r,a,s,o;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&a+s,stackWeight:o});return t}function Gf(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!cl.includes(r))continue;const s=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function Kf(n,t){const e=Gf(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=r):(o.width=i,o.height=u?u*r:l&&t.availableHeight)}return e}function Zf(n){const t=Xf(n),e=Yn(t.filter(c=>c.box.fullSize),!0),i=Yn(Fn(t,"left"),!0),r=Yn(Fn(t,"right")),a=Yn(Fn(t,"top"),!0),s=Yn(Fn(t,"bottom")),o=ul(t,"x"),l=ul(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(l).concat(s).concat(o),chartArea:Fn(t,"chartArea"),vertical:i.concat(r).concat(l),horizontal:a.concat(s).concat(o)}}function dl(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function hl(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 Qf(n,t,e,i){const{pos:r,box:a}=e,s=n.maxPadding;if(!$(r)){e.size&&(n[r]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[r]+=e.size}a.getPadding&&hl(s,a.getPadding());const o=Math.max(0,t.outerWidth-dl(s,n,"left","right")),l=Math.max(0,t.outerHeight-dl(s,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Jf(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function tg(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return i(n?["left","right"]:["top","bottom"])}function Wn(n,t,e,i){const r=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,tg(o.horizontal,t));const{same:d,other:h}=Qf(t,e,o,i);c|=d&&r.length,u=u||h,l.fullSize||r.push(o)}return c&&Wn(r,t,e,i)||u}function Ei(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function fl(n,t,e,i){const r=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,h=c.size||l.height;Wt(c.start)&&(s=c.start),l.fullSize?Ei(l,r.left,s,e.outerWidth-r.right-r.left,h):Ei(l,t.left+c.placed,s,d,h),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,h=c.size||l.width;Wt(c.start)&&(a=c.start),l.fullSize?Ei(l,a,r.top,h,e.outerHeight-r.bottom-r.top):Ei(l,a,t.top+c.placed,h,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}var Lt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=kt(n.options.layout.padding),a=Math.max(t-r.width,0),s=Math.max(e-r.height,0),o=Zf(n.boxes),l=o.vertical,c=o.horizontal;at(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,b)=>b.box.options&&b.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},r);hl(h,kt(i));const f=Object.assign({maxPadding:h,w:a,h:s,x:r.left,y:r.top},r),p=Kf(l.concat(c),d);Wn(o.fullSize,f,d,p),Wn(l,f,d,p),Wn(c,f,d,p)&&Wn(l,f,d,p),Jf(f),fl(o.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,fl(o.rightAndBottom,f,d,p),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},at(o.chartArea,y=>{const b=y.box;Object.assign(b,n.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class gl{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class eg extends gl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ai="$chartjs",ng={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},pl=n=>n===null||n==="";function ig(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ai]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",pl(r)){const a=Uo(n,"width");a!==void 0&&(n.width=a)}if(pl(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=Uo(n,"height");a!==void 0&&(n.height=a)}return n}const ml=of?{passive:!0}:!1;function rg(n,t,e){n.addEventListener(t,e,ml)}function ag(n,t,e){n.canvas.removeEventListener(t,e,ml)}function sg(n,t){const e=ng[n.type]||n.type,{x:i,y:r}=Te(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Ri(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function og(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ri(o.addedNodes,i),s=s&&!Ri(o.removedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function lg(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ri(o.removedNodes,i),s=s&&!Ri(o.addedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const Un=new Map;let bl=0;function yl(){const n=window.devicePixelRatio;n!==bl&&(bl=n,Un.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function cg(n,t){Un.size||window.addEventListener("resize",yl),Un.set(n,t)}function ug(n){Un.delete(n),Un.size||window.removeEventListener("resize",yl)}function dg(n,t,e){const i=n.canvas,r=i&&Fr(i);if(!r)return;const a=vo((o,l)=>{const c=r.clientWidth;e(o,l),c<r.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(r),cg(n,a),s}function qr(n,t,e){e&&e.disconnect(),t==="resize"&&ug(n)}function hg(n,t,e){const i=n.canvas,r=vo(a=>{n.ctx!==null&&e(sg(a,n))},n);return rg(i,t,r),r}class fg extends gl{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ig(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ai])return!1;const i=e[Ai].initial;["height","width"].forEach(a=>{const s=i[a];U(s)?e.removeAttribute(a):e.setAttribute(a,s)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[Ai],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),s={attach:og,detach:lg,resize:dg}[e]||hg;r[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:qr,detach:qr,resize:qr}[e]||ag)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return sf(t,e,i,r)}isAttached(t){const e=Fr(t);return!!(e&&e.isConnected)}}function gg(n){return!Yo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?eg:fg}class Ot{constructor(){k(this,"x");k(this,"y");k(this,"active",!1);k(this,"options");k(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return we(this.x)&&we(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}k(Ot,"defaults",{}),k(Ot,"defaultRoutes");function pg(n,t){const e=n.options.ticks,i=mg(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?yg(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>r)return vg(t,c,a,s/r),c;const u=bg(a,t,r);if(s>0){let d,h;const f=s>1?Math.round((l-o)/(s-1)):null;for(Li(t,c,u,U(f)?0:o-f,o),d=0,h=s-1;d<h;d++)Li(t,c,u,a[d],a[d+1]);return Li(t,c,u,l,U(f)?t.length:l+f),c}return Li(t,c,u),c}function mg(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function bg(n,t,e){const i=xg(n),r=t.length/e;if(!i)return Math.max(r,1);const a=ch(i);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>r)return l}return Math.max(r,1)}function yg(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function vg(n,t,e,i){let r=0,a=e[0],s;for(i=Math.ceil(i),s=0;s<n.length;s++)s===a&&(t.push(n[s]),r++,a=e[r*i])}function Li(n,t,e,i,r){const a=W(i,0),s=Math.min(W(r,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),r&&(l=r-i,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function xg(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const wg=n=>n==="left"?"right":n==="right"?"left":n,vl=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,xl=(n,t)=>Math.min(t||n,n);function wl(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function _g(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(r),c;if(!(e&&(i===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(r-1))/2,l+=r<t?c:-c,l<a-o||l>s+o)))return l}function Dg(n,t){at(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function Bn(n){return n.drawTicks?n.tickLength:0}function _l(n,t){if(!n.display)return 0;const e=dt(n.font,t),i=kt(n.padding);return(tt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Tg(n,t){return De(n,{scale:t,type:"scale"})}function Mg(n,t,e){return De(n,{tick:e,index:t,type:"tick"})}function Sg(n,t,e){let i=kr(n);return(e&&t!=="right"||!e&&t==="right")&&(i=wg(i)),i}function kg(n,t,e,i){const{top:r,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,f,p;const y=s-r,b=o-a;if(n.isHorizontal()){if(f=Rt(i,a,o),$(e)){const m=Object.keys(e)[0],v=e[m];p=u[m].getPixelForValue(v)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=vl(n,e,t);h=o-a}else{if($(e)){const m=Object.keys(e)[0],v=e[m];f=u[m].getPixelForValue(v)-b+t}else e==="center"?f=(c.left+c.right)/2-b+t:f=vl(n,e,t);p=Rt(i,s,r),d=e==="left"?-ut:ut}return{titleX:f,titleY:p,maxWidth:h,rotation:d}}class He extends Ot{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:r}=this;return t=Ht(t,Number.POSITIVE_INFINITY),e=Ht(e,Number.NEGATIVE_INFINITY),i=Ht(i,Number.POSITIVE_INFINITY),r=Ht(r,Number.NEGATIVE_INFINITY),{min:Ht(t,i),max:Ht(e,r),minDefined:pt(t),maxDefined:pt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),s;if(r&&a)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),r||(e=Math.min(e,s.min)),a||(i=Math.max(i,s.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:Ht(e,Ht(i,e)),max:Ht(i,Ht(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){rt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:s}=this.options,o=s.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=Fh(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?wl(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=pg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){rt(this.options.afterUpdate,[this])}beforeSetDimensions(){rt(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(){rt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),rt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){rt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=rt(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){rt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){rt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=xl(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,a=e.maxRotation;let s=r,o,l,c;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=Pt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/i:f/(i-1),d+6>o&&(o=f/(i-(t.offset?.5:1)),l=this.maxHeight-Bn(t.grid)-e.padding-_l(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=xi(Math.min(Math.asin(Pt((u.highest.height+6)/o,-1,1)),Math.asin(Pt(l/c,-1,1))-Math.asin(Pt(h/c,-1,1)))),s=Math.max(r,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){rt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=_l(r,e.options.font);if(o?(t.width=this.maxWidth,t.height=Bn(a)+l):(t.height=this.maxHeight,t.width=Bn(a)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=St(this.labelRotation),y=Math.cos(p),b=Math.sin(p);if(o){const m=i.mirror?0:b*d.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+m+f)}else{const m=i.mirror?0:y*d.width+b*h.height;t.width=Math.min(this.maxWidth,t.width+m+f)}this._calculatePadding(c,u,b,y)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=r*t.width,f=i*e.height):(h=i*t.height,f=r*e.width):a==="start"?f=e.width:a==="end"?h=t.width:a!=="inner"&&(h=t.width/2,f=e.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){rt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)U(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=wl(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/xl(e,i));let c=0,u=0,d,h,f,p,y,b,m,v,x,w,_;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),r.font=b=y.string,m=a[b]=a[b]||{data:{},gc:[]},v=y.lineHeight,x=w=0,!U(p)&&!tt(p))x=Di(r,m.data,m.gc,x,p),w=v;else if(tt(p))for(h=0,f=p.length;h<f;++h)_=p[h],!U(_)&&!tt(_)&&(x=Di(r,m.data,m.gc,x,_),w+=v);s.push(x),o.push(w),c=Math.max(x,c),u=Math.max(w,u)}Dg(a,e);const D=s.indexOf(c),T=o.indexOf(u),S=M=>({width:s[M]||0,height:o[M]||0});return{first:S(0),last:S(e-1),widest:S(D),highest:S(T),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return hh(this._alignToPixels?Ye(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Mg(this.getContext(),t,i))}return this.$context||(this.$context=Tg(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=St(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*i>o*r?o/i:l/r:l*r<o*i?l/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:s,border:o}=r,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=Bn(a),f=[],p=o.setContext(this.getContext()),y=p.display?p.width:0,b=y/2,m=function(B){return Ye(i,B,y)};let v,x,w,_,D,T,S,M,O,A,R,H;if(s==="top")v=m(this.bottom),T=this.bottom-h,M=v-b,A=m(t.top)+b,H=t.bottom;else if(s==="bottom")v=m(this.top),A=t.top,H=m(t.bottom)-b,T=v+b,M=this.top+h;else if(s==="left")v=m(this.right),D=this.right-h,S=v-b,O=m(t.left)+b,R=t.right;else if(s==="right")v=m(this.left),O=t.left,R=m(t.right)-b,D=v+b,S=this.left+h;else if(e==="x"){if(s==="center")v=m((t.top+t.bottom)/2+.5);else if($(s)){const B=Object.keys(s)[0],Z=s[B];v=m(this.chart.scales[B].getPixelForValue(Z))}A=t.top,H=t.bottom,T=v+b,M=T+h}else if(e==="y"){if(s==="center")v=m((t.left+t.right)/2);else if($(s)){const B=Object.keys(s)[0],Z=s[B];v=m(this.chart.scales[B].getPixelForValue(Z))}D=v-b,S=D-h,O=t.left,R=t.right}const ft=W(r.ticks.maxTicksLimit,d),N=Math.max(1,Math.ceil(d/ft));for(x=0;x<d;x+=N){const B=this.getContext(x),Z=a.setContext(B),Ct=o.setContext(B),C=Z.lineWidth,I=Z.color,F=Ct.dash||[],V=Ct.dashOffset,j=Z.tickWidth,q=Z.tickColor,mt=Z.tickBorderDash||[],gt=Z.tickBorderDashOffset;w=_g(this,x,l),w!==void 0&&(_=Ye(i,w,C),c?D=S=O=R=_:T=M=A=H=_,f.push({tx1:D,ty1:T,tx2:S,ty2:M,x1:O,y1:A,x2:R,y2:H,width:C,color:I,borderDash:F,borderDashOffset:V,tickWidth:j,tickColor:q,tickBorderDash:mt,tickBorderDashOffset:gt}))}return this._ticksLength=d,this._borderValue=v,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,h=Bn(i.grid),f=h+u,p=d?-u:f,y=-St(this.labelRotation),b=[];let m,v,x,w,_,D,T,S,M,O,A,R,H="middle";if(r==="top")D=this.bottom-p,T=this._getXAxisLabelAlignment();else if(r==="bottom")D=this.top+p,T=this._getXAxisLabelAlignment();else if(r==="left"){const N=this._getYAxisLabelAlignment(h);T=N.textAlign,_=N.x}else if(r==="right"){const N=this._getYAxisLabelAlignment(h);T=N.textAlign,_=N.x}else if(e==="x"){if(r==="center")D=(t.top+t.bottom)/2+f;else if($(r)){const N=Object.keys(r)[0],B=r[N];D=this.chart.scales[N].getPixelForValue(B)+f}T=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")_=(t.left+t.right)/2-f;else if($(r)){const N=Object.keys(r)[0],B=r[N];_=this.chart.scales[N].getPixelForValue(B)}T=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?H="top":l==="end"&&(H="bottom"));const ft=this._getLabelSizes();for(m=0,v=o.length;m<v;++m){x=o[m],w=x.label;const N=a.setContext(this.getContext(m));S=this.getPixelForTick(m)+a.labelOffset,M=this._resolveTickFontOptions(m),O=M.lineHeight,A=tt(w)?w.length:1;const B=A/2,Z=N.color,Ct=N.textStrokeColor,C=N.textStrokeWidth;let I=T;s?(_=S,T==="inner"&&(m===v-1?I=this.options.reverse?"left":"right":m===0?I=this.options.reverse?"right":"left":I="center"),r==="top"?c==="near"||y!==0?R=-A*O+O/2:c==="center"?R=-ft.highest.height/2-B*O+O:R=-ft.highest.height+O/2:c==="near"||y!==0?R=O/2:c==="center"?R=ft.highest.height/2-B*O:R=ft.highest.height-A*O,d&&(R*=-1),y!==0&&!N.showLabelBackdrop&&(_+=O/2*Math.sin(y))):(D=S,R=(1-A)*O/2);let F;if(N.showLabelBackdrop){const V=kt(N.backdropPadding),j=ft.heights[m],q=ft.widths[m];let mt=R-V.top,gt=0-V.left;switch(H){case"middle":mt-=j/2;break;case"bottom":mt-=j;break}switch(T){case"center":gt-=q/2;break;case"right":gt-=q;break}F={left:gt,top:mt,width:q+V.width,height:j+V.height,color:N.backdropColor}}b.push({label:w,font:M,textOffset:R,options:{rotation:y,color:Z,strokeColor:Ct,strokeWidth:C,textAlign:I,textBaseline:H,translation:[_,D],backdrop:F}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-St(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?r?(u=this.right+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?r?(u=this.left+a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=r.length;a<s;++a){const l=r[a];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,a=i.setContext(this.getContext()),s=i.display?a.width:0;if(!s)return;const o=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=Ye(t,this.left,s)-s/2,u=Ye(t,this.right,o)+o/2,d=h=l):(d=Ye(t,this.top,s)-s/2,h=Ye(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Pn(i,r);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;We(i,c,0,u,l,o)}r&&On(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=dt(i.font),s=kt(i.padding),o=i.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||$(e)?(l+=s.bottom,tt(i.text)&&(l+=a.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=kg(this,l,e,o);We(t,i.text,0,0,a,{color:i.color,maxWidth:d,rotation:h,textAlign:Sg(o,e,r),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=W(t.grid&&t.grid.z,-1),r=W(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==He.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return dt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ii{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Og(e)&&(i=this.register(e));const r=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,Cg(t,s,i),this.override&&bt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in bt[r]&&(delete bt[r][i],this.override&&delete Fe[i])}}function Cg(n,t,e){const i=_n(Object.create(null),[e?bt.get(e):{},bt.get(t),n.defaults]);bt.set(t,i),n.defaultRoutes&&Pg(t,n.defaultRoutes),n.descriptors&&bt.describe(t,n.descriptors)}function Pg(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");bt.route(a,r,l,o)})}function Og(n){return"id"in n&&"defaults"in n}class Eg{constructor(){this.controllers=new Ii(Gt,"datasets",!0),this.elements=new Ii(Ot,"elements"),this.plugins=new Ii(Object,"plugins"),this.scales=new Ii(He,"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(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):at(r,s=>{const o=i||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,i){const r=Tr(t);rt(i["before"+r],[],i),e[t](i),rt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Jt=new Eg;class Ag{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),s=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,r){r=r||{};for(const a of t){const s=a.plugin,o=s[i],l=[e,r,a.options];if(rt(o,l,s)===!1&&r.cancelable)return!1}return!0}invalidate(){U(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=W(i.options&&i.options.plugins,{}),a=Rg(i);return r===!1&&!e?[]:Ig(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Rg(n){const t={},e=[],i=Object.keys(Jt.plugins.items);for(let a=0;a<i.length;a++)e.push(Jt.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const s=r[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function Lg(n,t){return!t&&n===!1?null:n===!0?{}:n}function Ig(n,{plugins:t,localIds:e},i,r){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=Lg(i[l],r);c!==null&&a.push({plugin:o,options:Ng(n.config,{plugin:o,local:e[l]},c,s)})}return a}function Ng(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(i,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Xr(n,t){const e=bt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Fg(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Yg(n,t){return n===t?"_index_":"_value_"}function Dl(n){if(n==="x"||n==="y"||n==="r")return n}function Wg(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Gr(n,...t){if(Dl(n))return n;for(const e of t){const i=e.axis||Wg(e.position)||n.length>1&&Dl(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Tl(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Ug(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Tl(n,"x",e[0])||Tl(n,"y",e[0])}return{}}function Bg(n,t){const e=Fe[n.type]||{scales:{}},i=t.scales||{},r=Xr(n.type,t),a=Object.create(null);return Object.keys(i).forEach(s=>{const o=i[s];if(!$(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Gr(s,o,Ug(s,n),bt.scales[o.type]),c=Yg(l,r),u=e.scales||{};a[s]=Dn(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||Xr(o,t),u=(Fe[o]||{}).scales||{};Object.keys(u).forEach(d=>{const h=Fg(d,l),f=s[h+"AxisID"]||h;a[f]=a[f]||Object.create(null),Dn(a[f],[{axis:h},i[f],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];Dn(o,[bt.scales[o.type],bt.scale])}),a}function Ml(n){const t=n.options||(n.options={});t.plugins=W(t.plugins,{}),t.scales=Bg(n,t)}function Sl(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function zg(n){return n=n||{},n.data=Sl(n.data),Ml(n),n}const kl=new Map,Cl=new Set;function Ni(n,t){let e=kl.get(n);return e||(e=t(),kl.set(n,e),Cl.add(e)),e}const zn=(n,t,e)=>{const i=ve(t,e);i!==void 0&&n.add(i)};class Hg{constructor(t){this._config=zg(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=Sl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ml(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ni(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ni(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ni(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ni(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>zn(l,t,d))),u.forEach(d=>zn(l,r,d)),u.forEach(d=>zn(l,Fe[a]||{},d)),u.forEach(d=>zn(l,bt,d)),u.forEach(d=>zn(l,Or,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Cl.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Fe[e]||{},bt.datasets[e]||{},{type:e},bt,Or]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Pl(this._resolverCache,t,r);let l=s;if(Vg(s,e)){a.$shared=!1,i=Ut(i)?i():i;const c=this.createResolver(t,i,o);l=en(s,i,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,i=[""],r){const{resolver:a}=Pl(this._resolverCache,t,i);return $(e)?en(a,e,void 0,r):a}}function Pl(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:Lr(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,a)),a}const $g=n=>$(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Ut(n[e]),!1);function Vg(n,t){const{isScriptable:e,isIndexable:i}=Oo(n);for(const r of t){const a=e(r),s=i(r),o=(s||a)&&n[r];if(a&&(Ut(o)||$g(o))||s&&tt(o))return!0}return!1}var jg="4.4.0";const qg=["top","bottom","left","right","chartArea"];function Ol(n,t){return n==="top"||n==="bottom"||qg.indexOf(n)===-1&&t==="x"}function El(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Al(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),rt(e&&e.onComplete,[n],t)}function Xg(n){const t=n.chart,e=t.options.animation;rt(e&&e.onProgress,[n],t)}function Rl(n){return Yo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Fi={},Ll=n=>{const t=Rl(n);return Object.values(Fi).filter(e=>e.canvas===t).pop()};function Gg(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const s=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=s)}}}function Kg(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Yi(n,t,e){return n.options.clip?n[e]:t[e]}function Zg(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Yi(e,t,"left"),right:Yi(e,t,"right"),top:Yi(i,t,"top"),bottom:Yi(i,t,"bottom")}:t}let Xt=(Ie=class{static register(...t){Jt.add(...t),Il()}static unregister(...t){Jt.remove(...t),Il()}constructor(t,e){const i=this.config=new Hg(e),r=Rl(t),a=Ll(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||gg(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=eh(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ag,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=mh(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Fi[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}de.listen(this,"complete",Al),de.listen(this,"progress",Xg),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return U(t)?e&&a?a:r?i/r: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 Jt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Wo(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ko(this.canvas,this.ctx),this}stop(){return de.stop(this),this}resize(t,e){de.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(r,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Wo(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),rt(i.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};at(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=Gr(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),at(a,s=>{const o=s.options,l=o.id,c=Gr(l,o),u=W(o.type,s.dtype);(o.position===void 0||Ol(o.position,c)!==Ol(s.dposition))&&(o.position=s.dposition),r[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=Jt.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),at(r,(s,o)=>{s||delete i[o]}),at(i,s=>{Lt.configure(this,s,s.options),Lt.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(El("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let s=this.getDatasetMeta(i);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=a.indexAxis||Xr(o,this.options),s.order=a.order||0,s.index=i,s.label=""+a.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const l=Jt.getController(o),{datasetElementType:c,dataElementType:u}=bt.datasets[o];Object.assign(l,{dataElementType:Jt.getElement(u),datasetElementType:c&&Jt.getElement(c)}),s.controller=new l(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){at(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!r&&a.indexOf(d)===-1;d.buildOrUpdateElements(h),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||at(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(El("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){at(this.scales,t=>{Lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!co(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const s=i==="_removeElements"?-a:a;Gg(t,r,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!co(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],at(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),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,Ut(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(de.has(this)?this.attached&&!de.running(this)&&de.start(this):(this.draw(),Al({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,a;for(r=0,a=e.length;r<a;++r){const s=e[r];(!t||s.visible)&&i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=Zg(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Pn(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&On(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ue(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=jr.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={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(r)),r}getContext(){return this.$context||(this.$context=De(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,r);Wt(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(o=>o.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),de.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ko(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Fi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},r=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};at(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},r=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){at(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},at(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!mi(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=i?t:a(t,e);s.length&&this.updateHoverStyle(s,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,s=e,o=this._getActiveElements(t,r,i,s),l=oh(t),c=Kg(t,this._lastEvent,i,l);i&&(this._lastEvent=null,rt(a.onHover,[t,o,this],this),l&&rt(a.onClick,[t,o,this],this));const u=!mi(o,r);return(u||e)&&(this._active=o,this._updateHoverStyles(o,r,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}},k(Ie,"defaults",bt),k(Ie,"instances",Fi),k(Ie,"overrides",Fe),k(Ie,"registry",Jt),k(Ie,"version",jg),k(Ie,"getChart",Ll),Ie);function Il(){return at(Xt.instances,n=>n._plugins.invalidate())}function Qg(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=r/o;n.beginPath(),n.arc(a,s,o,i-c,e+c),l>r?(c=r/l,n.arc(a,s,l,e+c,i-c,!0)):n.arc(a,s,r,e+ut,i-ut),n.closePath(),n.clip()}function Jg(n){return Rr(n,["outerStart","outerEnd","innerStart","innerEnd"])}function tp(n,t,e,i){const r=Jg(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,i*t/2),o=l=>{const c=(e-Math.min(a,l))*i/2;return Pt(l,0,Math.min(a,c))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Pt(r.innerStart,0,s),innerEnd:Pt(r.innerEnd,0,s)}}function an(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Wi(n,t,e,i,r,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),h=u>0?u+i+e+c:0;let f=0;const p=r-l;if(i){const N=u>0?u-i:0,B=d>0?d-i:0,Z=(N+B)/2,Ct=Z!==0?p*Z/(Z+i):p;f=(p-Ct)/2}const y=Math.max(.001,p*d-e/X)/d,b=(p-y)/2,m=l+b+f,v=r-b-f,{outerStart:x,outerEnd:w,innerStart:_,innerEnd:D}=tp(t,h,d,v-m),T=d-x,S=d-w,M=m+x/T,O=v-w/S,A=h+_,R=h+D,H=m+_/A,ft=v-D/R;if(n.beginPath(),a){const N=(M+O)/2;if(n.arc(s,o,d,M,N),n.arc(s,o,d,N,O),w>0){const C=an(S,O,s,o);n.arc(C.x,C.y,w,O,v+ut)}const B=an(R,v,s,o);if(n.lineTo(B.x,B.y),D>0){const C=an(R,ft,s,o);n.arc(C.x,C.y,D,v+ut,ft+Math.PI)}const Z=(v-D/h+(m+_/h))/2;if(n.arc(s,o,h,v-D/h,Z,!0),n.arc(s,o,h,Z,m+_/h,!0),_>0){const C=an(A,H,s,o);n.arc(C.x,C.y,_,H+Math.PI,m-ut)}const Ct=an(T,m,s,o);if(n.lineTo(Ct.x,Ct.y),x>0){const C=an(T,M,s,o);n.arc(C.x,C.y,x,m-ut,M)}}else{n.moveTo(s,o);const N=Math.cos(M)*d+s,B=Math.sin(M)*d+o;n.lineTo(N,B);const Z=Math.cos(O)*d+s,Ct=Math.sin(O)*d+o;n.lineTo(Z,Ct)}n.closePath()}function ep(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Wi(n,t,e,i,l,r);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%ct||ct))}return Wi(n,t,e,i,l,r),n.fill(),l}function np(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,f=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,f?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(a){Wi(n,t,e,i,p,r);for(let y=0;y<a;++y)n.stroke();isNaN(o)||(p=s+(o%ct||ct))}f&&Qg(n,t,p),a||(Wi(n,t,e,i,p,r),n.stroke())}class Hn extends Ot{constructor(e){super();k(this,"circumference");k(this,"endAngle");k(this,"fullCircles");k(this,"innerRadius");k(this,"outerRadius");k(this,"pixelMargin");k(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.getProps(["x","y"],r),{angle:s,distance:o}=go(a,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,y=W(h,c-l)>=ct||Mn(s,l,c),b=le(o,u+f,d+f);return y&&b}getCenterPoint(e){const{x:i,y:r,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,h=(o+l+u+c)/2;return{x:i+Math.cos(d)*h,y:r+Math.sin(d)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:r}=this,a=(i.offset||0)/4,s=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>ct?Math.floor(r/ct):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(X,r||0)),u=a*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,ep(e,this,u,s,o),np(e,this,u,s,o),e.restore()}}k(Hn,"id","arc"),k(Hn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),k(Hn,"defaultRoutes",{backgroundColor:"backgroundColor"}),k(Hn,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Nl(n,t,e=t){n.lineCap=W(e.borderCapStyle,t.borderCapStyle),n.setLineDash(W(e.borderDash,t.borderDash)),n.lineDashOffset=W(e.borderDashOffset,t.borderDashOffset),n.lineJoin=W(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=W(e.borderWidth,t.borderWidth),n.strokeStyle=W(e.borderColor,t.borderColor)}function ip(n,t,e){n.lineTo(e.x,e.y)}function rp(n){return n.stepped?Ch:n.tension||n.cubicInterpolationMode==="monotone"?Ph:ip}function Fl(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:s,end:o}=t,l=Math.max(r,s),c=Math.min(a,o),u=r<s&&a<s||r>o&&a>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function ap(n,t,e,i){const{points:r,options:a}=t,{count:s,start:o,loop:l,ilen:c}=Fl(r,e,i),u=rp(a);let{move:d=!0,reverse:h}=i||{},f,p,y;for(f=0;f<=c;++f)p=r[(o+(h?c-f:f))%s],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,h,a.stepped),y=p);return l&&(p=r[(o+(h?c:0))%s],u(n,y,p,h,a.stepped)),!!l}function sp(n,t,e,i){const r=t.points,{count:a,start:s,ilen:o}=Fl(r,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,f,p,y,b,m;const v=w=>(s+(c?o-w:w))%a,x=()=>{y!==b&&(n.lineTo(u,b),n.lineTo(u,y),n.lineTo(u,m))};for(l&&(f=r[v(0)],n.moveTo(f.x,f.y)),h=0;h<=o;++h){if(f=r[v(h)],f.skip)continue;const w=f.x,_=f.y,D=w|0;D===p?(_<y?y=_:_>b&&(b=_),u=(d*u+w)/++d):(x(),n.lineTo(w,_),p=D,d=0,y=b=_),m=_}x()}function Kr(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?sp:ap}function op(n){return n.stepped?lf:n.tension||n.cubicInterpolationMode==="monotone"?cf:Be}function lp(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Nl(n,t.options),n.stroke(r)}function cp(n,t,e,i){const{segments:r,options:a}=t,s=Kr(t);for(const o of r)Nl(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const up=typeof Path2D=="function";function dp(n,t,e,i){up&&!t.options.segment?lp(n,t,e,i):cp(n,t,e,i)}class Se extends Ot{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Jh(this._points,i,t,r,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=pf(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],a=this.points,s=jo(this,{property:e,start:r,end:r});if(!s.length)return;const o=[],l=op(i);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:h}=s[c],f=a[d],p=a[h];if(f===p){o.push(f);continue}const y=Math.abs((r-f[e])/(p[e]-f[e])),b=l(f,p,y,i.stepped);b[e]=t[e],o.push(b)}return o.length===1?o[0]:o}pathSegment(t,e,i){return Kr(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=Kr(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of r)s&=a(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),dp(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}k(Se,"id","line"),k(Se,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),k(Se,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),k(Se,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Yl(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class Ui extends Ot{constructor(e){super();k(this,"parsed");k(this,"skip");k(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],r);return Math.pow(e-s,2)+Math.pow(i-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,i){return Yl(this,e,"x",i)}inYRange(e,i){return Yl(this,e,"y",i)}getCenterPoint(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const r=i&&e.borderWidth||0;return(i+r)*2}draw(e,i){const r=this.options;this.skip||r.radius<.1||!ue(this,i,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,Ar(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}k(Ui,"id","point"),k(Ui,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),k(Ui,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Wl(n,t){const{x:e,y:i,base:r,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,r),l=Math.max(e,r),c=i-d,u=i+d):(d=a/2,o=e-d,l=e+d,c=Math.min(i,r),u=Math.max(i,r)),{left:o,top:c,right:l,bottom:u}}function ke(n,t,e,i){return n?0:Pt(t,e,i)}function hp(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=Po(i);return{t:ke(r.top,a.top,0,e),r:ke(r.right,a.right,0,t),b:ke(r.bottom,a.bottom,0,e),l:ke(r.left,a.left,0,t)}}function fp(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=_e(r),s=Math.min(t,e),o=n.borderSkipped,l=i||$(r);return{topLeft:ke(!l||o.top||o.left,a.topLeft,0,s),topRight:ke(!l||o.top||o.right,a.topRight,0,s),bottomLeft:ke(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:ke(!l||o.bottom||o.right,a.bottomRight,0,s)}}function gp(n){const t=Wl(n),e=t.right-t.left,i=t.bottom-t.top,r=hp(n,e/2,i/2),a=fp(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function Zr(n,t,e,i){const r=t===null,a=e===null,o=n&&!(r&&a)&&Wl(n,i);return o&&(r||le(t,o.left,o.right))&&(a||le(e,o.top,o.bottom))}function pp(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function mp(n,t){n.rect(t.x,t.y,t.w,t.h)}function Qr(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,s=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+s,radius:n.radius}}class Bi extends Ot{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:a,outer:s}=gp(this),o=pp(s.radius)?tn:mp;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,Qr(s,e,a)),t.clip(),o(t,Qr(a,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,Qr(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return Zr(this,t,e,i)}inXRange(t,e){return Zr(this,t,null,e)}inYRange(t,e){return Zr(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}k(Bi,"id","bar"),k(Bi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),k(Bi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var bp=Object.freeze({__proto__:null,ArcElement:Hn,BarElement:Bi,LineElement:Se,PointElement:Ui});const Jr=["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)"],Ul=Jr.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Bl(n){return Jr[n%Jr.length]}function zl(n){return Ul[n%Ul.length]}function yp(n,t){return n.borderColor=Bl(t),n.backgroundColor=zl(t),++t}function vp(n,t){return n.backgroundColor=n.data.map(()=>Bl(t++)),t}function xp(n,t){return n.backgroundColor=n.data.map(()=>zl(t++)),t}function wp(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Me?t=vp(e,t):r instanceof In?t=xp(e,t):r&&(t=yp(e,t))}}function Hl(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function _p(n){return n&&(n.borderColor||n.backgroundColor)}var Dp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(Hl(i)||_p(r)||a&&Hl(a)))return;const s=wp(n);i.forEach(s)}};function Tp(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,h,f,p,y;for(s[l++]=n[u],d=0;d<a-2;d++){let b=0,m=0,v;const x=Math.floor((d+1)*o)+1+t,w=Math.min(Math.floor((d+2)*o)+1,e)+t,_=w-x;for(v=x;v<w;v++)b+=n[v].x,m+=n[v].y;b/=_,m/=_;const D=Math.floor(d*o)+1+t,T=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:S,y:M}=n[u];for(f=p=-1,v=D;v<T;v++)p=.5*Math.abs((S-b)*(n[v].y-M)-(S-n[v].x)*(m-M)),p>f&&(f=p,h=n[v],y=v);s[l++]=h,u=y}return s[l++]=n[c],s}function Mp(n,t,e,i){let r=0,a=0,s,o,l,c,u,d,h,f,p,y;const b=[],m=t+e-1,v=n[t].x,w=n[m].x-v;for(s=t;s<t+e;++s){o=n[s],l=(o.x-v)/w*i,c=o.y;const _=l|0;if(_===u)c<p?(p=c,d=s):c>y&&(y=c,h=s),r=(a*r+o.x)/++a;else{const D=s-1;if(!U(d)&&!U(h)){const T=Math.min(d,h),S=Math.max(d,h);T!==f&&T!==D&&b.push({...n[T],x:r}),S!==f&&S!==D&&b.push({...n[S],x:r})}s>0&&D!==f&&b.push(n[D]),b.push(o),u=_,a=0,p=y=c,d=h=f=s}}return b}function $l(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Vl(n){n.data.datasets.forEach(t=>{$l(t)})}function Sp(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(i=Pt(ce(t,a.axis,s).lo,0,e-1)),c?r=Pt(ce(t,a.axis,o).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var kp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Vl(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:s,indexAxis:o}=r,l=n.getDatasetMeta(a),c=s||r.data;if(En([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:h}=Sp(l,c);const f=e.threshold||4*i;if(h<=f){$l(r);return}U(s)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=Tp(c,d,h,i,e);break;case"min-max":p=Mp(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=p})},destroy(n){Vl(n)}};function Cp(n,t,e){const i=n.segments,r=n.points,a=t.points,s=[];for(const o of i){let{start:l,end:c}=o;c=ea(l,c,r);const u=ta(e,r[l],r[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:r[l],end:r[c]});continue}const d=jo(t,u);for(const h of d){const f=ta(e,a[h.start],a[h.end],h.loop),p=Vo(o,r,f);for(const y of p)s.push({source:y,target:h,start:{[e]:jl(u,f,"start",Math.max)},end:{[e]:jl(u,f,"end",Math.min)}})}}return s}function ta(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=$t(r),a=$t(a)),{property:n,start:r,end:a}}function Pp(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=ea(s,o,r);const l=r[s],c=r[o];i!==null?(a.push({x:l.x,y:i}),a.push({x:c.x,y:i})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function ea(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function jl(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function ql(n,t){let e=[],i=!1;return tt(n)?(i=!0,e=n):e=Pp(n,t),e.length?new Se({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Xl(n){return n&&n.fill!==!1}function Op(n,t,e){let r=n[t].fill;const a=[t];let s;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!pt(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;a.push(r),r=s.fill}return!1}function Ep(n,t,e){const i=Ip(n);if($(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return pt(r)&&Math.floor(r)===r?Ap(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Ap(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Rp(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:$(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Lp(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:$(n)?i=n.value:i=t.getBaseValue(),i}function Ip(n){const t=n.options,e=t.fill;let i=W(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Np(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,s=i.points,o=Fp(t,e);o.push(ql({x:null,y:t.bottom},i));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)Yp(r,s[u],o)}return new Se({points:r,options:{}})}function Fp(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function Yp(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:s,last:o,point:l}=Wp(a,t,"x");if(!(!l||s&&o)){if(s)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function Wp(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],h=s[u.end][e];if(le(r,d,h)){o=r===d,l=r===h;break}}return{first:o,last:l,point:i}}class Gl{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:s}=this;return e=e||{start:0,end:ct},t.arc(r,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function Up(n){const{chart:t,fill:e,line:i}=n;if(pt(e))return Bp(t,e);if(e==="stack")return Np(n);if(e==="shape")return!0;const r=zp(n);return r instanceof Gl?r:ql(r,i)}function Bp(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function zp(n){return(n.scale||{}).getPointPositionForValue?$p(n):Hp(n)}function Hp(n){const{scale:t={},fill:e}=n,i=Rp(e,t);if(pt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function $p(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,s=Lp(e,t,a),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,a);return new Gl({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<r;++l)o.push(t.getPointPositionForValue(l,s));return o}function na(n,t,e){const i=Up(t),{line:r,scale:a,axis:s}=t,o=r.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&r.points.length&&(Pn(n,e),Vp(n,{line:r,target:i,above:u,below:d,area:e,scale:a,axis:s}),On(n))}function Vp(n,t){const{line:e,target:i,above:r,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==r&&(Kl(n,i,s.top),Zl(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore(),n.save(),Kl(n,i,s.bottom)),Zl(n,{line:e,target:i,color:a,scale:o,property:l}),n.restore()}function Kl(n,t,e){const{segments:i,points:r}=t;let a=!0,s=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],d=r[ea(l,c,r)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Zl(n,t){const{line:e,target:i,property:r,color:a,scale:s}=t,o=Cp(e,i,r);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:h=a}={}}=l,f=i!==!0;n.save(),n.fillStyle=h,jp(n,s,f&&ta(r,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let y;if(f){p?n.closePath():Ql(n,i,d,r);const b=!!i.pathSegment(n,c,{move:p,reverse:!0});y=p&&b,y||Ql(n,i,u,r)}n.closePath(),n.fill(y?"evenodd":"nonzero"),n.restore()}}function jp(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,i,o-s,r-i),n.clip())}function Ql(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var qp={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,s,o,l;for(s=0;s<i;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof Se&&(l={visible:n.isDatasetVisible(s),index:s,fill:Ep(o,s,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],!(!l||l.fill===!1)&&(l.fill=Op(r,s,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),i&&o.fill&&na(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;Xl(a)&&na(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Xl(i)||e.drawTime!=="beforeDatasetDraw"||na(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Jl=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Xp=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class tc extends Ot{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=rt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=dt(i.font),a=r.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=Jl(i,a);let c,u;e.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,r,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+o;let d=t;a.textAlign="left",a.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,y)=>{const b=i+e/2+a.measureText(p.text).width;(y===0||c[c.length-1]+b+2*o>s)&&(d+=u,c[c.length-(y>0?0:1)]=0,f+=u,h++),l[y]={left:0,top:f,row:h,width:b,height:r},c[c.length-1]+=b+o}),d}_fitCols(t,e,i,r){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,h=0,f=0,p=0,y=0;return this.legendItems.forEach((b,m)=>{const{itemWidth:v,itemHeight:x}=Gp(i,e,a,b,r);m>0&&f+x+2*o>u&&(d+=h+o,c.push({width:h,height:f}),p+=h+o,y++,h=f=0),l[m]={left:p,top:f,col:y,width:v,height:x},h=Math.max(h,v),f+=x+o}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,s=rn(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=Rt(i,this.left+r,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=Rt(i,this.left+r,this.right-this.lineWidths[o])),c.top+=this.top+t+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=Rt(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=Rt(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Pn(t,this),this._draw(),On(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:s}=t,o=bt.color,l=rn(t.rtl,this.left,this.width),c=dt(s.font),{padding:u}=s,d=c.size,h=d/2;let f;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:b}=Jl(s,d),m=function(D,T,S){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;r.save();const M=W(S.lineWidth,1);if(r.fillStyle=W(S.fillStyle,o),r.lineCap=W(S.lineCap,"butt"),r.lineDashOffset=W(S.lineDashOffset,0),r.lineJoin=W(S.lineJoin,"miter"),r.lineWidth=M,r.strokeStyle=W(S.strokeStyle,o),r.setLineDash(W(S.lineDash,[])),s.usePointStyle){const O={radius:y*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:M},A=l.xPlus(D,p/2),R=T+h;Co(r,O,A,R,s.pointStyleWidth&&p)}else{const O=T+Math.max((d-y)/2,0),A=l.leftForLtr(D,p),R=_e(S.borderRadius);r.beginPath(),Object.values(R).some(H=>H!==0)?tn(r,{x:A,y:O,w:p,h:y,radius:R}):r.rect(A,O,p,y),r.fill(),M!==0&&r.stroke()}r.restore()},v=function(D,T,S){We(r,S.text,D,T+b/2,c,{strikethrough:S.hidden,textAlign:l.textAlign(S.textAlign)})},x=this.isHorizontal(),w=this._computeTitleHeight();x?f={x:Rt(a,this.left+u,this.right-i[0]),y:this.top+u+w,line:0}:f={x:this.left+u,y:Rt(a,this.top+w+u,this.bottom-e[0].height),line:0},Bo(this.ctx,t.textDirection);const _=b+u;this.legendItems.forEach((D,T)=>{r.strokeStyle=D.fontColor,r.fillStyle=D.fontColor;const S=r.measureText(D.text).width,M=l.textAlign(D.textAlign||(D.textAlign=s.textAlign)),O=p+h+S;let A=f.x,R=f.y;l.setWidth(this.width),x?T>0&&A+O+u>this.right&&(R=f.y+=_,f.line++,A=f.x=Rt(a,this.left+u,this.right-i[f.line])):T>0&&R+_>this.bottom&&(A=f.x=A+e[f.line].width+u,f.line++,R=f.y=Rt(a,this.top+w+u,this.bottom-e[f.line].height));const H=l.x(A);if(m(H,R,D),A=bh(M,A+p+h,x?A+O:this.right,t.rtl),v(l.x(A),R,D),x)f.x+=O+u;else if(typeof D.text!="string"){const ft=c.lineHeight;f.y+=ec(D,ft)+u}else f.y+=_}),zo(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=dt(e.font),r=kt(e.padding);if(!e.display)return;const a=rn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=i.size/2,c=r.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Rt(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((y,b)=>Math.max(y,b.height),0);u=c+Rt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Rt(o,d,d+h);s.textAlign=a.textAlign(kr(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,We(s,e.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,e=dt(t.font),i=kt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if(le(t,this.left,this.right)&&le(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],le(t,r.left,r.left+r.width)&&le(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Qp(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=Xp(r,i);r&&!a&&rt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&rt(e.onHover,[t,i,this],this)}else i&&rt(e.onClick,[t,i,this],this)}}function Gp(n,t,e,i,r){const a=Kp(i,n,t,e),s=Zp(r,i,t.lineHeight);return{itemWidth:a,itemHeight:s}}function Kp(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+i.measureText(r).width}function Zp(n,t,e){let i=n;return typeof t.text!="string"&&(i=ec(t,e)),i}function ec(n,t){const e=n.text?n.text.length:0;return t*e}function Qp(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Jp={id:"legend",_element:tc,start(n,t,e){const i=n.legend=new tc({ctx:n.ctx,options:e,chart:n});Lt.configure(n,i,e),Lt.addBox(n,i)},stop(n){Lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Lt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:r||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ia extends Ot{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=tt(i.text)?i.text.length:1;this._padding=kt(i.padding);const a=r*dt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=Rt(o,i,a),d=e+t,c=a-i):(s.position==="left"?(u=i+t,d=Rt(o,r,e),l=X*-.5):(u=a-t,d=Rt(o,e,r),l=X*.5),c=r-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=dt(e.font),a=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);We(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:kr(e.align),textBaseline:"middle",translation:[s,o]})}}function tm(n,t){const e=new ia({ctx:n.ctx,options:t,chart:n});Lt.configure(n,e,t),Lt.addBox(n,e),n.titleBlock=e}var em={id:"title",_element:ia,start(n,t,e){tm(n,e)},stop(n){const t=n.titleBlock;Lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Lt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const zi=new WeakMap;var nm={id:"subtitle",start(n,t,e){const i=new ia({ctx:n.ctx,options:e,chart:n});Lt.configure(n,i,e),Lt.addBox(n,i),zi.set(n,i)},stop(n){Lt.removeBox(n,zi.get(n)),zi.delete(n)},beforeUpdate(n,t,e){const i=zi.get(n);Lt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const $n={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();i+=o.x,r+=o.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Je(t,c);u<r&&(r=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function te(n,t){return t&&(tt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function he(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
16
+ */class yf{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,r){const a=e.listeners[r],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(i-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=yo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const a=i.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),a.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var de=new yf;const Go="transparent",vf={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=To(n||Go),r=i.valid&&To(t||Go);return r&&r.valid?r.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class xf{constructor(t,e,i,r){const a=e[i];r=An([t.to,r,a,t.from]);const s=An([t.from,a,r]);this._active=!0,this._fn=t.fn||vf[t.type||typeof s],this._easing=kn[t.easing]||kn.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=s,this._to=r,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const r=this._target[this._prop],a=i-this._start,s=this._duration-a;this._start=i,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=An([t.to,e,r,t.from]),this._from=An([t.from,r,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,r=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<i),!this._active){this._target[r]=o,this._notify(!0);return}if(e<0){this._target[r]=a;return}l=e/i%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(a,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][e]()}}class Yr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!H(t))return;const e=Object.keys(mt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const a=t[r];if(!H(a))return;const s={};for(const o of e)s[o]=a[o];(tt(a.properties)&&a.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,s)})})}_animateOptions(t,e){const i=e.options,r=_f(t,i);if(!r)return[];const a=this._createAnimations(r,i);return i.$shared&&wf(t.options.$animations,i).then(()=>{t.options=i},()=>{}),a}_createAnimations(t,e){const i=this._properties,r=[],a=t.$animations||(t.$animations={}),s=Object.keys(e),o=Date.now();let l;for(l=s.length-1;l>=0;--l){const c=s[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,o);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}a[c]=d=new xf(h,t,c,u),r.push(d)}return r}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return de.add(this._chart,i),!0}}function wf(n,t){const e=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const a=n[i[r]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function _f(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Ko(n,t){const e=n&&n.options||{},i=e.reverse,r=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:i?a:r,end:i?r:a}}function Df(n,t,e){if(e===!1)return!1;const i=Ko(n,e),r=Ko(t,e);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function Tf(n){let t,e,i,r;return H(n)?(t=n.top,e=n.right,i=n.bottom,r=n.left):t=e=i=r=n,{top:t,right:e,bottom:i,left:r,disabled:n===!1}}function Zo(n,t){const e=[],i=n._getSortedDatasetMetas(t);let r,a;for(r=0,a=i.length;r<a;++r)e.push(i[r].index);return e}function Qo(n,t,e,i={}){const r=n.keys,a=i.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=r.length;s<o;++s){if(l=+r[s],l===e){if(i.all)continue;break}c=n.values[l],gt(c)&&(a||t===0||Qt(t)===Qt(c))&&(t+=c)}return t}}function Mf(n){const t=Object.keys(n),e=new Array(t.length);let i,r,a;for(i=0,r=t.length;i<r;++i)a=t[i],e[i]={x:a,y:n[a]};return e}function Jo(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Sf(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function kf(n){const{min:t,max:e,minDefined:i,maxDefined:r}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?e:Number.POSITIVE_INFINITY}}function Cf(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function tl(n,t,e,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const a=n[r.index];if(e&&a>0||!e&&a<0)return r.index}return null}function el(n,t){const{chart:e,_cachedMeta:i}=n,r=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=i,l=a.axis,c=s.axis,u=Sf(a,s,i),d=t.length;let h;for(let f=0;f<d;++f){const p=t[f],{[l]:y,[c]:b}=p,m=p._stacks||(p._stacks={});h=m[c]=Cf(r,u,y),h[o]=b,h._top=tl(h,s,!0,i.type),h._bottom=tl(h,s,!1,i.type);const v=h._visualValues||(h._visualValues={});v[o]=b}}function Wr(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Of(n,t){return De(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Pf(n,t,e){return De(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Rn(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const r of t){const a=r._stacks;if(!a||a[i]===void 0||a[i][e]===void 0)return;delete a[i][e],a[i]._visualValues!==void 0&&a[i]._visualValues[e]!==void 0&&delete a[i]._visualValues[e]}}}const Ur=n=>n==="reset"||n==="none",nl=(n,t)=>t?n:Object.assign({},n),Ef=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Zo(e,!0),values:null};class Kt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Jo(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&&Rn(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),r=(d,h,f,p)=>d==="x"?h:d==="r"?p:f,a=e.xAxisID=W(i.xAxisID,Wr(t,"x")),s=e.yAxisID=W(i.yAxisID,Wr(t,"y")),o=e.rAxisID=W(i.rAxisID,Wr(t,"r")),l=e.indexAxis,c=e.iAxisID=r(l,a,s,o),u=e.vAxisID=r(l,s,a,o);e.xScale=this.getScaleForId(a),e.yScale=this.getScaleForId(s),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&mo(this._data,this),t._stacked&&Rn(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(H(e))this._data=Mf(e);else if(i!==e){if(i){mo(i,this);const r=this._cachedMeta;Rn(r),r._parsed=[]}e&&Object.isExtensible(e)&&ph(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const a=e._stacked;e._stacked=Jo(e.vScale,e),e.stack!==i.stack&&(r=!0,Rn(e),e.stack=i.stack),this._resyncElements(t),(r||a!==e._stacked)&&el(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:r}=this,{iScale:a,_stacked:s}=i,o=a.axis;let l=t===0&&e===r.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,h;if(this._parsing===!1)i._parsed=r,i._sorted=!0,h=r;else{tt(r[t])?h=this.parseArrayData(i,r,t,e):H(r[t])?h=this.parseObjectData(i,r,t,e):h=this.parsePrimitiveData(i,r,t,e);const f=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=d=h[u],l&&(f()&&(l=!1),c=d);i._sorted=l}s&&el(this,h)}parsePrimitiveData(t,e,i,r){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(r);let h,f,p;for(h=0,f=r;h<f;++h)p=h+i,d[h]={[o]:u||a.parse(c[p],p),[l]:s.parse(e[p],p)};return d}parseArrayData(t,e,i,r){const{xScale:a,yScale:s}=t,o=new Array(r);let l,c,u,d;for(l=0,c=r;l<c;++l)u=l+i,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,i,r){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,d,h,f;for(u=0,d=r;u<d;++u)h=u+i,f=e[h],c[u]={x:a.parse(ve(f,o),h),y:s.parse(ve(f,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const r=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:Zo(r,!0),values:e._stacks[t.axis]._visualValues};return Qo(o,s,a.index,{mode:i})}updateRangeFromParsed(t,e,i,r){const a=i[e.axis];let s=a===null?NaN:a;const o=r&&i._stacks[e.axis];r&&o&&(r.values=o,s=Qo(r,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const i=this._cachedMeta,r=i._parsed,a=i._sorted&&t===i.iScale,s=r.length,o=this._getOtherScale(t),l=Ef(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=kf(o);let h,f;function p(){f=r[h];const y=f[o.axis];return!gt(f[t.axis])||u>y||d<y}for(h=0;h<s&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),a));++h);if(a){for(h=s-1;h>=0;--h)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let r,a,s;for(r=0,a=e.length;r<a;++r)s=e[r][t.axis],gt(s)&&i.push(s);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,r=e.vScale,a=this.getParsed(t);return{label:i?""+i.getLabelForValue(a[i.axis]):"",value:r?""+r.getLabelForValue(a[r.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Tf(W(this.options.clip,Df(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,r=i.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=r[u];d.hidden||(d.active&&c?s.push(d):d.draw(t,a))}for(u=0;u<s.length;++u)s[u].draw(t,a)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const r=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=Pf(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=r.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=Of(this.chart.getContext(),this.index)),a.dataset=r,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=i,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const r=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&Wt(i);if(o)return nl(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=r?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),f=Object.keys(mt.elements[t]),p=()=>this.getContext(i,r,e),y=c.resolveNamedOptions(h,f,p,d);return y.$shared&&(y.$shared=l,a[s]=Object.freeze(nl(y,l))),y}_resolveAnimations(t,e,i){const r=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(r.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new Yr(r,l&&l.animations);return l&&l._cacheable&&(a[s]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ur(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),r=this._sharedOptions,a=this.getSharedOptions(i),s=this.includeOptions(e,a)||a!==r;return this.updateSharedOptions(a,e,i),{sharedOptions:a,includeOptions:s}}updateElement(t,e,i,r){Ur(r)?Object.assign(t,i):this._resolveAnimations(e,r).update(t,i)}updateSharedOptions(t,e,i){t&&!Ur(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,r){t.active=r;const a=this.getStyle(e,r);this._resolveAnimations(e,i,r).update(t,{options:!r&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const r=i.length,a=e.length,s=Math.min(a,r);s&&this.parse(0,s),a>r?this._insertElements(r,a-r,t):a<r&&this._removeElements(a,r-a)}_insertElements(t,e,i=!0){const r=this._cachedMeta,a=r.data,s=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=s;o--)c[o]=c[o-e]};for(l(a),o=t;o<s;++o)a[o]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(t,e),i&&this.updateElements(a,t,e,"reset")}updateElements(t,e,i,r){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,e);i._stacked&&Rn(i,r)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,r]=t;this[e](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}k(Kt,"defaults",{}),k(Kt,"datasetElementType",null),k(Kt,"dataElementType",null);function Af(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let r=0,a=e.length;r<a;r++)i=i.concat(e[r].controller.getAllParsedValues(n));n._cache.$bar=bo(i.sort((r,a)=>r-a))}return n._cache.$bar}function Rf(n){const t=n.iScale,e=Af(t,n.type);let i=t._length,r,a,s,o;const l=()=>{s===32767||s===-32768||(Wt(o)&&(i=Math.min(i,Math.abs(s-o)||i)),o=s)};for(r=0,a=e.length;r<a;++r)s=t.getPixelForValue(e[r]),l();for(o=void 0,r=0,a=t.ticks.length;r<a;++r)s=t.getPixelForTick(r),l();return i}function Lf(n,t,e,i){const r=e.barThickness;let a,s;return U(r)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=r*i,s=1),{chunk:a/i,ratio:s,start:t.pixels[n]-a/2}}function If(n,t,e,i){const r=t.pixels,a=r[n];let s=n>0?r[n-1]:null,o=n<r.length-1?r[n+1]:null;const l=e.categoryPercentage;s===null&&(s=a-(o===null?t.end-t.start:o-a)),o===null&&(o=a+a-s);const c=a-(a-Math.min(s,o))/2*l;return{chunk:Math.abs(o-s)/2*l/i,ratio:e.barPercentage,start:c}}function Nf(n,t,e,i){const r=e.parse(n[0],i),a=e.parse(n[1],i),s=Math.min(r,a),o=Math.max(r,a);let l=s,c=o;Math.abs(s)>Math.abs(o)&&(l=o,c=s),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:a,min:s,max:o}}function il(n,t,e,i){return tt(n)?Nf(n,t,e,i):t[e.axis]=e.parse(n,i),t}function rl(n,t,e,i){const r=n.iScale,a=n.vScale,s=r.getLabels(),o=r===a,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[r.axis]=o||r.parse(s[c],c),l.push(il(h,d,a,c));return l}function Br(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Ff(n,t,e){return n!==0?Qt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Yf(n){let t,e,i,r,a;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(r="end",a="start"):(r="start",a="end"),{start:e,end:i,reverse:t,top:r,bottom:a}}function Wf(n,t,e,i){let r=t.borderSkipped;const a={};if(!r){n.borderSkipped=a;return}if(r===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Yf(n);r==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?r=c:(e._bottom||0)===i?r=u:(a[al(u,s,o,l)]=!0,r=c)),a[al(r,s,o,l)]=!0,n.borderSkipped=a}function al(n,t,e,i){return i?(n=Uf(n,t,e),n=sl(n,e,t)):n=sl(n,t,e),n}function Uf(n,t,e){return n===t?e:n===e?t:n}function sl(n,t,e){return n==="start"?t:n==="end"?e:n}function Bf(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Ln extends Kt{parsePrimitiveData(t,e,i,r){return rl(t,e,i,r)}parseArrayData(t,e,i,r){return rl(t,e,i,r)}parseObjectData(t,e,i,r){const{iScale:a,vScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=a.axis==="x"?o:l,u=s.axis==="x"?o:l,d=[];let h,f,p,y;for(h=i,f=i+r;h<f;++h)y=e[h],p={},p[a.axis]=a.parse(ve(y,c),h),d.push(il(ve(y,u),p,s,h));return d}updateRangeFromParsed(t,e,i,r){super.updateRangeFromParsed(t,e,i,r);const a=i._custom;a&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:r}=e,a=this.getParsed(t),s=a._custom,o=Br(s)?"["+s.start+", "+s.end+"]":""+r.getLabelForValue(a[r.axis]);return{label:""+i.getLabelForValue(a[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,r){const a=r==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:h}=this._getSharedOptions(e,r);for(let f=e;f<e+i;f++){const p=this.getParsed(f),y=a||U(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,u),m=(p._stacks||{})[o.axis],v={horizontal:c,base:y.base,enableBorderRadius:!m||Br(p._custom)||s===m._top||s===m._bottom,x:c?y.head:b.center,y:c?b.center:y.head,height:c?b.size:Math.abs(y.size),width:c?Math.abs(y.size):b.size};h&&(v.options=d||this.resolveDataElementOptions(f,t[f].active?"active":r));const w=v.options||t[f].options;Wf(v,w,m,s),Bf(v,w,u.ratio),this.updateElement(t[f],f,v,r)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=i.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(U(u)||isNaN(u))return!0};for(const l of r)if(!(e!==void 0&&o(l))&&((a===!1||s.indexOf(l.stack)===-1||a===void 0&&l.stack===void 0)&&s.push(l.stack),l.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const r=this._getStacks(t,i),a=e!==void 0?r.indexOf(e):-1;return a===-1?r.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,r=[];let a,s;for(a=0,s=e.data.length;a<s;++a)r.push(i.getPixelForValue(this.getParsed(a)[i.axis],a));const o=t.barThickness;return{min:o||Rf(e),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:r},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=Br(c);let d=l[e.axis],h=0,f=i?this.applyStack(e,l,i):d,p,y;f!==d&&(h=f-d,f=d),u&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&Qt(d)!==Qt(c.barEnd)&&(h=0),h+=d);const b=!U(a)&&!u?a:h;let m=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(h+f):p=m,y=p-m,Math.abs(y)<s){y=Ff(y,e,o)*s,d===o&&(m-=y/2);const v=e.getPixelForDecimal(0),w=e.getPixelForDecimal(1),x=Math.min(v,w),_=Math.max(v,w);m=Math.max(Math.min(m,_),x),p=m+y,i&&!u&&(l._stacks[e.axis]._visualValues[r]=e.getValueForPixel(p)-e.getValueForPixel(m))}if(m===e.getPixelForValue(o)){const v=Qt(y)*e.getLineWidthForValue(o)/2;m+=v,y-=v}return{size:y,base:m,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,r=this.options,a=r.skipNull,s=W(r.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=r.barThickness==="flex"?If(t,e,r,c):Lf(t,e,r,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0);o=u.start+u.chunk*d+u.chunk/2,l=Math.min(s,u.chunk*u.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(s,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,r=i.length;let a=0;for(;a<r;++a)this.getParsed(a)[e.axis]!==null&&i[a].draw(this._ctx)}}k(Ln,"id","bar"),k(Ln,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),k(Ln,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ci extends Kt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,r){const a=super.parsePrimitiveData(t,e,i,r);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+i).radius;return a}parseArrayData(t,e,i,r){const a=super.parseArrayData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=W(o[2],this.resolveDataElementOptions(s+i).radius)}return a}parseObjectData(t,e,i,r){const a=super.parseObjectData(t,e,i,r);for(let s=0;s<a.length;s++){const o=e[i+s];a[s]._custom=W(o&&o.r&&+o.r,this.resolveDataElementOptions(s+i).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,r),u=s.axis,d=o.axis;for(let h=e;h<e+i;h++){const f=t[h],p=!a&&this.getParsed(h),y={},b=y[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(p[u]),m=y[d]=a?o.getBasePixel():o.getPixelForValue(p[d]);y.skip=isNaN(b)||isNaN(m),c&&(y.options=l||this.resolveDataElementOptions(h,f.active?"active":r),a&&(y.options.radius=0)),this.updateElement(f,h,y,r)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,e);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const a=r.radius;return e!=="active"&&(r.radius=0),r.radius+=W(i&&i._custom,a),r}}k(Ci,"id","bubble"),k(Ci,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),k(Ci,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function zf(n,t,e){let i=1,r=1,a=0,s=0;if(t<ct){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),d=Math.cos(l),h=Math.sin(l),f=(w,x,_)=>Sn(w,o,l,!0)?1:Math.max(x,x*e,_,_*e),p=(w,x,_)=>Sn(w,o,l,!0)?-1:Math.min(x,x*e,_,_*e),y=f(0,c,d),b=f(ut,u,h),m=p(q,c,d),v=p(q+ut,u,h);i=(y-m)/2,r=(b-v)/2,a=-(y+m)/2,s=-(b+v)/2}return{ratioX:i,ratioY:r,offsetX:a,offsetY:s}}class Me extends Kt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let a=l=>+i[l];if(H(i[t])){const{key:l="value"}=this._parsing;a=c=>+ve(i[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)r._parsed[s]=a(s)}}_getRotation(){return St(this.options.rotation-90)}_getCircumference(){return St(this.options.circumference)}_getRotationExtents(){let t=ct,e=-ct;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,a=r._getRotation(),s=r._getCircumference();t=Math.min(t,a),e=Math.max(e,a+s)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,r=this._cachedMeta,a=r.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-s)/2,0),l=Math.min(nh(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:p,offsetY:y}=zf(d,u,l),b=(i.width-s)/h,m=(i.height-s)/f,v=Math.max(Math.min(b,m)/2,0),w=so(this.options.radius,v),x=Math.max(w*l,0),_=(w-x)/this._getVisibleDatasetWeightTotal();this.offsetX=p*w,this.offsetY=y*w,r.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const i=this.options,r=this._cachedMeta,a=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*a/ct)}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,h=a&&c.animateScale,f=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:y,includeOptions:b}=this._getSharedOptions(e,r);let m=this._getRotation(),v;for(v=0;v<e;++v)m+=this._circumference(v,a);for(v=e;v<e+i;++v){const w=this._circumference(v,a),x=t[v],_={x:u+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+w,circumference:w,outerRadius:p,innerRadius:f};b&&(_.options=y||this.resolveDataElementOptions(v,x.active?"active":r)),m+=w,this.updateElement(x,v,_,r)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,r;for(r=0;r<e.length;r++){const a=t._parsed[r];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(r)&&!e[r].hidden&&(i+=Math.abs(a))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Cn(e._parsed[t],i.options.locale);return{label:r[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const i=this.chart;let r,a,s,o,l;if(!t){for(r=0,a=i.data.datasets.length;r<a;++r)if(i.isDatasetVisible(r)){s=i.getDatasetMeta(r),t=s.data,o=s.controller;break}}if(!t)return 0;for(r=0,a=t.length;r<a;++r)l=o.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,r=t.length;i<r;++i){const a=this.resolveDataElementOptions(i);e=Math.max(e,a.offset||0,a.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(W(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}k(Me,"id","doughnut"),k(Me,"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"}),k(Me,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),k(Me,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class In extends Kt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:r=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=xo(e,r,s);this._drawStart=o,this._drawCount=l,wo(e)&&(o=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=r;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!s,options:c},t),this.updateElements(r,o,l,t)}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,r),h=s.axis,f=o.axis,{spanGaps:p,segment:y}=this.options,b=we(p)?p:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||r==="none",v=e+i,w=t.length;let x=e>0&&this.getParsed(e-1);for(let _=0;_<w;++_){const D=t[_],T=m?D:{};if(_<e||_>=v){T.skip=!0;continue}const M=this.getParsed(_),S=U(M[f]),P=T[h]=s.getPixelForValue(M[h],_),L=T[f]=a||S?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,M,l):M[f],_);T.skip=isNaN(P)||isNaN(L)||S,T.stop=_>0&&Math.abs(M[h]-x[h])>b,y&&(T.parsed=M,T.raw=c.data[_]),d&&(T.options=u||this.resolveDataElementOptions(_,D.active?"active":r)),m||this.updateElement(D,_,T,r),x=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const a=r[0].size(this.resolveDataElementOptions(0)),s=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}k(In,"id","line"),k(In,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),k(In,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Nn extends Kt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,r=i.data.labels||[],a=Cn(e._parsed[t].r,i.options.locale);return{label:r[t]||"",value:a}}parseObjectData(t,e,i,r){return No.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const a=this.getParsed(r).r;!isNaN(a)&&this.chart.getDataVisibility(r)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,r=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(r/2,0),s=Math.max(i.cutoutPercentage?a/100*i.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,r){const a=r==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,h=c.getIndexAngle(0)-.5*q;let f=h,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)f+=this._computeAngle(p,r,y);for(p=e;p<e+i;p++){const b=t[p];let m=f,v=f+this._computeAngle(p,r,y),w=s.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;f=v,a&&(l.animateScale&&(w=0),l.animateRotate&&(m=v=h));const x={x:u,y:d,innerRadius:0,outerRadius:w,startAngle:m,endAngle:v,options:this.resolveDataElementOptions(p,b.active?"active":r)};this.updateElement(b,p,x,r)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?St(this.resolveDataElementOptions(t,e).angle||i):0}}k(Nn,"id","polarArea"),k(Nn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),k(Nn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return e.labels.map((a,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:a,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class zr extends Me{}k(zr,"id","pie"),k(zr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Oi extends Kt{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,r){return No.bind(this)(t,e,i,r)}update(t){const e=this._cachedMeta,i=e.dataset,r=e.data||[],a=e.iScale.getLabels();if(i.points=r,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===r.length,options:s};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,e,i,r){const a=this._cachedMeta.rScale,s=r==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":r),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,h=s?a.yCenter:u.y,f={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,o,f,r)}}}k(Oi,"id","radar"),k(Oi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),k(Oi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Pi extends Kt{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:a}=e,s=this.getParsed(t),o=r.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,r=this.chart._animationsDisabled;let{start:a,count:s}=xo(e,i,r);if(this._drawStart=a,this._drawCount=s,wo(e)&&(a=0,s=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,r){const a=r==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,r),d=this.getSharedOptions(u),h=this.includeOptions(r,d),f=s.axis,p=o.axis,{spanGaps:y,segment:b}=this.options,m=we(y)?y:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||a||r==="none";let w=e>0&&this.getParsed(e-1);for(let x=e;x<e+i;++x){const _=t[x],D=this.getParsed(x),T=v?_:{},M=U(D[p]),S=T[f]=s.getPixelForValue(D[f],x),P=T[p]=a||M?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,D,l):D[p],x);T.skip=isNaN(S)||isNaN(P)||M,T.stop=x>0&&Math.abs(D[f]-w[f])>m,b&&(T.parsed=D,T.raw=c.data[x]),h&&(T.options=d||this.resolveDataElementOptions(x,_.active?"active":r)),v||this.updateElement(_,x,T,r),w=D}this.updateSharedOptions(d,r,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!e.length)return r;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(r,a,s)/2}}k(Pi,"id","scatter"),k(Pi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),k(Pi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Hf=Object.freeze({__proto__:null,BarController:Ln,BubbleController:Ci,DoughnutController:Me,LineController:In,PieController:zr,PolarAreaController:Nn,RadarController:Oi,ScatterController:Pi});function ze(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Hr{constructor(t){k(this,"options");this.options=t||{}}static override(t){Object.assign(Hr.prototype,t)}init(){}formats(){return ze()}parse(){return ze()}format(){return ze()}add(){return ze()}diff(){return ze()}startOf(){return ze()}endOf(){return ze()}}var ol={_date:Hr};function $f(n,t,e,i){const{controller:r,data:a,_sorted:s}=n,o=r._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?fh:ce;if(i){if(r._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),h=l(a,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Fn(n,t,e,i,r){const a=n.getSortedVisibleDatasetMetas(),s=e[t];for(let o=0,l=a.length;o<l;++o){const{index:c,data:u}=a[o],{lo:d,hi:h}=$f(a[o],t,s,r);for(let f=d;f<=h;++f){const p=u[f];p.skip||i(p,c,f)}}}function Vf(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,r){const a=t?Math.abs(i.x-r.x):0,s=e?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function $r(n,t,e,i,r){const a=[];return!r&&!n.isPointInArea(t)||Fn(n,e,t,function(o,l,c){!r&&!ue(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function jf(n,t,e,i){let r=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],i),{angle:d}=go(s,{x:t.x,y:t.y});Sn(d,c,u)&&r.push({element:s,datasetIndex:o,index:l})}return Fn(n,e,t,a),r}function qf(n,t,e,i,r,a){let s=[];const o=Vf(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){const f=u.inRange(t.x,t.y,r);if(i&&!f)return;const p=u.getCenterPoint(r);if(!(!!a||n.isPointInArea(p))&&!f)return;const b=o(t,p);b<l?(s=[{element:u,datasetIndex:d,index:h}],l=b):b===l&&s.push({element:u,datasetIndex:d,index:h})}return Fn(n,e,t,c),s}function Vr(n,t,e,i,r,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!i?jf(n,t,e,r):qf(n,t,e,i,r,a)}function ll(n,t,e,i,r){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Fn(n,e,t,(l,c,u)=>{l[s](t[e],r)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,r))}),i&&!o?[]:a}var jr={evaluateInteractionItems:Fn,modes:{index(n,t,e,i){const r=Te(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?$r(n,r,a,i,s):Vr(n,r,a,!1,i,s),l=[];return o.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,d=c.data[u];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:u})}),l):[]},dataset(n,t,e,i){const r=Te(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?$r(n,r,a,i,s):Vr(n,r,a,!1,i,s);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const r=Te(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return $r(n,r,a,i,s)},nearest(n,t,e,i){const r=Te(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return Vr(n,r,a,e.intersect,i,s)},x(n,t,e,i){const r=Te(t,n);return ll(n,r,"x",e.intersect,i)},y(n,t,e,i){const r=Te(t,n);return ll(n,r,"y",e.intersect,i)}}};const cl=["left","top","right","bottom"];function Yn(n,t){return n.filter(e=>e.pos===t)}function ul(n,t){return n.filter(e=>cl.indexOf(e.pos)===-1&&e.box.axis===t)}function Wn(n,t){return n.sort((e,i)=>{const r=t?i:e,a=t?e:i;return r.weight===a.weight?r.index-a.index:r.weight-a.weight})}function Xf(n){const t=[];let e,i,r,a,s,o;for(e=0,i=(n||[]).length;e<i;++e)r=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=r,t.push({index:e,box:r,pos:a,horizontal:r.isHorizontal(),weight:r.weight,stack:s&&a+s,stackWeight:o});return t}function Gf(n){const t={};for(const e of n){const{stack:i,pos:r,stackWeight:a}=e;if(!i||!cl.includes(r))continue;const s=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function Kf(n,t){const e=Gf(n),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let a,s,o;for(a=0,s=n.length;a<s;++a){o=n[a];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=r):(o.width=i,o.height=u?u*r:l&&t.availableHeight)}return e}function Zf(n){const t=Xf(n),e=Wn(t.filter(c=>c.box.fullSize),!0),i=Wn(Yn(t,"left"),!0),r=Wn(Yn(t,"right")),a=Wn(Yn(t,"top"),!0),s=Wn(Yn(t,"bottom")),o=ul(t,"x"),l=ul(t,"y");return{fullSize:e,leftAndTop:i.concat(a),rightAndBottom:r.concat(l).concat(s).concat(o),chartArea:Yn(t,"chartArea"),vertical:i.concat(r).concat(l),horizontal:a.concat(s).concat(o)}}function dl(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function hl(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 Qf(n,t,e,i){const{pos:r,box:a}=e,s=n.maxPadding;if(!H(r)){e.size&&(n[r]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?a.height:a.width),e.size=d.size/d.count,n[r]+=e.size}a.getPadding&&hl(s,a.getPadding());const o=Math.max(0,t.outerWidth-dl(s,n,"left","right")),l=Math.max(0,t.outerHeight-dl(s,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Jf(n){const t=n.maxPadding;function e(i){const r=Math.max(t[i]-n[i],0);return n[i]+=r,r}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function tg(n,t){const e=t.maxPadding;function i(r){const a={left:0,top:0,right:0,bottom:0};return r.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return i(n?["left","right"]:["top","bottom"])}function Un(n,t,e,i){const r=[];let a,s,o,l,c,u;for(a=0,s=n.length,c=0;a<s;++a){o=n[a],l=o.box,l.update(o.width||t.w,o.height||t.h,tg(o.horizontal,t));const{same:d,other:h}=Qf(t,e,o,i);c|=d&&r.length,u=u||h,l.fullSize||r.push(o)}return c&&Un(r,t,e,i)||u}function Ei(n,t,e,i,r){n.top=e,n.left=t,n.right=t+i,n.bottom=e+r,n.width=i,n.height=r}function fl(n,t,e,i){const r=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=i[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,h=c.size||l.height;Wt(c.start)&&(s=c.start),l.fullSize?Ei(l,r.left,s,e.outerWidth-r.right-r.left,h):Ei(l,t.left+c.placed,s,d,h),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,h=c.size||l.width;Wt(c.start)&&(a=c.start),l.fullSize?Ei(l,a,r.top,h,e.outerHeight-r.bottom-r.top):Ei(l,a,t.top+c.placed,h,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}var Lt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const r=kt(n.options.layout.padding),a=Math.max(t-r.width,0),s=Math.max(e-r.height,0),o=Zf(n.boxes),l=o.vertical,c=o.horizontal;at(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,b)=>b.box.options&&b.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:r,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),h=Object.assign({},r);hl(h,kt(i));const f=Object.assign({maxPadding:h,w:a,h:s,x:r.left,y:r.top},r),p=Kf(l.concat(c),d);Un(o.fullSize,f,d,p),Un(l,f,d,p),Un(c,f,d,p)&&Un(l,f,d,p),Jf(f),fl(o.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,fl(o.rightAndBottom,f,d,p),n.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},at(o.chartArea,y=>{const b=y.box;Object.assign(b,n.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class gl{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,r){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,r?Math.floor(e/r):i)}}isAttached(t){return!0}updateConfig(t){}}class eg extends gl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ai="$chartjs",ng={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},pl=n=>n===null||n==="";function ig(n,t){const e=n.style,i=n.getAttribute("height"),r=n.getAttribute("width");if(n[Ai]={initial:{height:i,width:r,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",pl(r)){const a=Uo(n,"width");a!==void 0&&(n.width=a)}if(pl(i))if(n.style.height==="")n.height=n.width/(t||2);else{const a=Uo(n,"height");a!==void 0&&(n.height=a)}return n}const ml=of?{passive:!0}:!1;function rg(n,t,e){n.addEventListener(t,e,ml)}function ag(n,t,e){n.canvas.removeEventListener(t,e,ml)}function sg(n,t){const e=ng[n.type]||n.type,{x:i,y:r}=Te(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Ri(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function og(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ri(o.addedNodes,i),s=s&&!Ri(o.removedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}function lg(n,t,e){const i=n.canvas,r=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Ri(o.removedNodes,i),s=s&&!Ri(o.addedNodes,i);s&&e()});return r.observe(document,{childList:!0,subtree:!0}),r}const Bn=new Map;let bl=0;function yl(){const n=window.devicePixelRatio;n!==bl&&(bl=n,Bn.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function cg(n,t){Bn.size||window.addEventListener("resize",yl),Bn.set(n,t)}function ug(n){Bn.delete(n),Bn.size||window.removeEventListener("resize",yl)}function dg(n,t,e){const i=n.canvas,r=i&&Fr(i);if(!r)return;const a=vo((o,l)=>{const c=r.clientWidth;e(o,l),c<r.clientWidth&&e()},window),s=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||a(c,u)});return s.observe(r),cg(n,a),s}function qr(n,t,e){e&&e.disconnect(),t==="resize"&&ug(n)}function hg(n,t,e){const i=n.canvas,r=vo(a=>{n.ctx!==null&&e(sg(a,n))},n);return rg(i,t,r),r}class fg extends gl{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ig(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Ai])return!1;const i=e[Ai].initial;["height","width"].forEach(a=>{const s=i[a];U(s)?e.removeAttribute(a):e.setAttribute(a,s)});const r=i.style||{};return Object.keys(r).forEach(a=>{e.style[a]=r[a]}),e.width=e.width,delete e[Ai],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const r=t.$proxies||(t.$proxies={}),s={attach:og,detach:lg,resize:dg}[e]||hg;r[e]=s(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),r=i[e];if(!r)return;({attach:qr,detach:qr,resize:qr}[e]||ag)(t,e,r),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,r){return sf(t,e,i,r)}isAttached(t){const e=Fr(t);return!!(e&&e.isConnected)}}function gg(n){return!Yo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?eg:fg}class Pt{constructor(){k(this,"x");k(this,"y");k(this,"active",!1);k(this,"options");k(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return we(this.x)&&we(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const r={};return t.forEach(a=>{r[a]=i[a]&&i[a].active()?i[a]._to:this[a]}),r}}k(Pt,"defaults",{}),k(Pt,"defaultRoutes");function pg(n,t){const e=n.options.ticks,i=mg(n),r=Math.min(e.maxTicksLimit||i,i),a=e.major.enabled?yg(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>r)return vg(t,c,a,s/r),c;const u=bg(a,t,r);if(s>0){let d,h;const f=s>1?Math.round((l-o)/(s-1)):null;for(Li(t,c,u,U(f)?0:o-f,o),d=0,h=s-1;d<h;d++)Li(t,c,u,a[d],a[d+1]);return Li(t,c,u,l,U(f)?t.length:l+f),c}return Li(t,c,u),c}function mg(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),r=n._maxLength/e;return Math.floor(Math.min(i,r))}function bg(n,t,e){const i=xg(n),r=t.length/e;if(!i)return Math.max(r,1);const a=ch(i);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>r)return l}return Math.max(r,1)}function yg(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function vg(n,t,e,i){let r=0,a=e[0],s;for(i=Math.ceil(i),s=0;s<n.length;s++)s===a&&(t.push(n[s]),r++,a=e[r*i])}function Li(n,t,e,i,r){const a=W(i,0),s=Math.min(W(r,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),r&&(l=r-i,e=l/Math.floor(l/e)),u=a;u<0;)o++,u=Math.round(a+o*e);for(c=Math.max(a,0);c<s;c++)c===u&&(t.push(n[c]),o++,u=Math.round(a+o*e))}function xg(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const wg=n=>n==="left"?"right":n==="right"?"left":n,vl=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,xl=(n,t)=>Math.min(t||n,n);function wl(n,t){const e=[],i=n.length/t,r=n.length;let a=0;for(;a<r;a+=i)e.push(n[Math.floor(a)]);return e}function _g(n,t,e){const i=n.ticks.length,r=Math.min(t,i-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(r),c;if(!(e&&(i===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(r-1))/2,l+=r<t?c:-c,l<a-o||l>s+o)))return l}function Dg(n,t){at(n,e=>{const i=e.gc,r=i.length/2;let a;if(r>t){for(a=0;a<r;++a)delete e.data[i[a]];i.splice(0,r)}})}function zn(n){return n.drawTicks?n.tickLength:0}function _l(n,t){if(!n.display)return 0;const e=dt(n.font,t),i=kt(n.padding);return(tt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Tg(n,t){return De(n,{scale:t,type:"scale"})}function Mg(n,t,e){return De(n,{tick:e,index:t,type:"tick"})}function Sg(n,t,e){let i=kr(n);return(e&&t!=="right"||!e&&t==="right")&&(i=wg(i)),i}function kg(n,t,e,i){const{top:r,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,f,p;const y=s-r,b=o-a;if(n.isHorizontal()){if(f=Rt(i,a,o),H(e)){const m=Object.keys(e)[0],v=e[m];p=u[m].getPixelForValue(v)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=vl(n,e,t);h=o-a}else{if(H(e)){const m=Object.keys(e)[0],v=e[m];f=u[m].getPixelForValue(v)-b+t}else e==="center"?f=(c.left+c.right)/2-b+t:f=vl(n,e,t);p=Rt(i,s,r),d=e==="left"?-ut:ut}return{titleX:f,titleY:p,maxWidth:h,rotation:d}}class He extends Pt{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:r}=this;return t=Ht(t,Number.POSITIVE_INFINITY),e=Ht(e,Number.NEGATIVE_INFINITY),i=Ht(i,Number.POSITIVE_INFINITY),r=Ht(r,Number.NEGATIVE_INFINITY),{min:Ht(t,i),max:Ht(e,r),minDefined:gt(t),maxDefined:gt(e)}}getMinMax(t){let{min:e,max:i,minDefined:r,maxDefined:a}=this.getUserBounds(),s;if(r&&a)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),r||(e=Math.min(e,s.min)),a||(i=Math.max(i,s.max));return e=a&&e>i?i:e,i=r&&e>i?e:i,{min:Ht(e,Ht(i,e)),max:Ht(i,Ht(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){rt(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:r,grace:a,ticks:s}=this.options,o=s.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=Fh(this,a,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?wl(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=pg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){rt(this.options.afterUpdate,[this])}beforeSetDimensions(){rt(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(){rt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),rt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){rt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,r,a;for(i=0,r=t.length;i<r;i++)a=t[i],a.label=rt(e.callback,[a.value,i,t],this)}afterTickToLabelConversion(){rt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){rt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=xl(this.ticks.length,t.ticks.maxTicksLimit),r=e.minRotation||0,a=e.maxRotation;let s=r,o,l,c;if(!this._isVisible()||!e.display||r>=a||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),d=u.widest.width,h=u.highest.height,f=Ot(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/i:f/(i-1),d+6>o&&(o=f/(i-(t.offset?.5:1)),l=this.maxHeight-zn(t.grid)-e.padding-_l(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),s=xi(Math.min(Math.asin(Ot((u.highest.height+6)/o,-1,1)),Math.asin(Ot(l/c,-1,1))-Math.asin(Ot(h/c,-1,1)))),s=Math.max(r,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){rt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:r,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=_l(r,e.options.font);if(o?(t.width=this.maxWidth,t.height=zn(a)+l):(t.height=this.maxHeight,t.width=zn(a)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),f=i.padding*2,p=St(this.labelRotation),y=Math.cos(p),b=Math.sin(p);if(o){const m=i.mirror?0:b*d.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+m+f)}else{const m=i.mirror?0:y*d.width+b*h.height;t.width=Math.min(this.maxWidth,t.width+m+f)}this._calculatePadding(c,u,b,y)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,r){const{ticks:{align:a,padding:s},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,f=0;l?c?(h=r*t.width,f=i*e.height):(h=i*t.height,f=r*e.width):a==="start"?f=e.width:a==="end"?h=t.width:a!=="inner"&&(h=t.width/2,f=e.width/2),this.paddingLeft=Math.max((h-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((f-d+s)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;a==="start"?(u=0,d=t.height):a==="end"&&(u=e.height,d=0),this.paddingTop=u+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){rt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)U(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=wl(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:r,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/xl(e,i));let c=0,u=0,d,h,f,p,y,b,m,v,w,x,_;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),r.font=b=y.string,m=a[b]=a[b]||{data:{},gc:[]},v=y.lineHeight,w=x=0,!U(p)&&!tt(p))w=Di(r,m.data,m.gc,w,p),x=v;else if(tt(p))for(h=0,f=p.length;h<f;++h)_=p[h],!U(_)&&!tt(_)&&(w=Di(r,m.data,m.gc,w,_),x+=v);s.push(w),o.push(x),c=Math.max(w,c),u=Math.max(x,u)}Dg(a,e);const D=s.indexOf(c),T=o.indexOf(u),M=S=>({width:s[S]||0,height:o[S]||0});return{first:M(0),last:M(e-1),widest:M(D),highest:M(T),widths:s,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return hh(this._alignToPixels?Ye(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Mg(this.getContext(),t,i))}return this.$context||(this.$context=Tg(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=St(this.labelRotation),i=Math.abs(Math.cos(e)),r=Math.abs(Math.sin(e)),a=this._getLabelSizes(),s=t.autoSkipPadding||0,o=a?a.widest.width+s:0,l=a?a.highest.height+s:0;return this.isHorizontal()?l*i>o*r?o/i:l/r:l*r<o*i?l/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,r=this.options,{grid:a,position:s,border:o}=r,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),h=zn(a),f=[],p=o.setContext(this.getContext()),y=p.display?p.width:0,b=y/2,m=function(B){return Ye(i,B,y)};let v,w,x,_,D,T,M,S,P,L,E,X;if(s==="top")v=m(this.bottom),T=this.bottom-h,S=v-b,L=m(t.top)+b,X=t.bottom;else if(s==="bottom")v=m(this.top),L=t.top,X=m(t.bottom)-b,T=v+b,S=this.top+h;else if(s==="left")v=m(this.right),D=this.right-h,M=v-b,P=m(t.left)+b,E=t.right;else if(s==="right")v=m(this.left),P=t.left,E=m(t.right)-b,D=v+b,M=this.left+h;else if(e==="x"){if(s==="center")v=m((t.top+t.bottom)/2+.5);else if(H(s)){const B=Object.keys(s)[0],Z=s[B];v=m(this.chart.scales[B].getPixelForValue(Z))}L=t.top,X=t.bottom,T=v+b,S=T+h}else if(e==="y"){if(s==="center")v=m((t.left+t.right)/2);else if(H(s)){const B=Object.keys(s)[0],Z=s[B];v=m(this.chart.scales[B].getPixelForValue(Z))}D=v-b,M=D-h,P=t.left,E=t.right}const wt=W(r.ticks.maxTicksLimit,d),N=Math.max(1,Math.ceil(d/wt));for(w=0;w<d;w+=N){const B=this.getContext(w),Z=a.setContext(B),Ct=o.setContext(B),C=Z.lineWidth,I=Z.color,F=Ct.dash||[],$=Ct.dashOffset,V=Z.tickWidth,j=Z.tickColor,pt=Z.tickBorderDash||[],ft=Z.tickBorderDashOffset;x=_g(this,w,l),x!==void 0&&(_=Ye(i,x,C),c?D=M=P=E=_:T=S=L=X=_,f.push({tx1:D,ty1:T,tx2:M,ty2:S,x1:P,y1:L,x2:E,y2:X,width:C,color:I,borderDash:F,borderDashOffset:$,tickWidth:V,tickColor:j,tickBorderDash:pt,tickBorderDashOffset:ft}))}return this._ticksLength=d,this._borderValue=v,f}_computeLabelItems(t){const e=this.axis,i=this.options,{position:r,ticks:a}=i,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,h=zn(i.grid),f=h+u,p=d?-u:f,y=-St(this.labelRotation),b=[];let m,v,w,x,_,D,T,M,S,P,L,E,X="middle";if(r==="top")D=this.bottom-p,T=this._getXAxisLabelAlignment();else if(r==="bottom")D=this.top+p,T=this._getXAxisLabelAlignment();else if(r==="left"){const N=this._getYAxisLabelAlignment(h);T=N.textAlign,_=N.x}else if(r==="right"){const N=this._getYAxisLabelAlignment(h);T=N.textAlign,_=N.x}else if(e==="x"){if(r==="center")D=(t.top+t.bottom)/2+f;else if(H(r)){const N=Object.keys(r)[0],B=r[N];D=this.chart.scales[N].getPixelForValue(B)+f}T=this._getXAxisLabelAlignment()}else if(e==="y"){if(r==="center")_=(t.left+t.right)/2-f;else if(H(r)){const N=Object.keys(r)[0],B=r[N];_=this.chart.scales[N].getPixelForValue(B)}T=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const wt=this._getLabelSizes();for(m=0,v=o.length;m<v;++m){w=o[m],x=w.label;const N=a.setContext(this.getContext(m));M=this.getPixelForTick(m)+a.labelOffset,S=this._resolveTickFontOptions(m),P=S.lineHeight,L=tt(x)?x.length:1;const B=L/2,Z=N.color,Ct=N.textStrokeColor,C=N.textStrokeWidth;let I=T;s?(_=M,T==="inner"&&(m===v-1?I=this.options.reverse?"left":"right":m===0?I=this.options.reverse?"right":"left":I="center"),r==="top"?c==="near"||y!==0?E=-L*P+P/2:c==="center"?E=-wt.highest.height/2-B*P+P:E=-wt.highest.height+P/2:c==="near"||y!==0?E=P/2:c==="center"?E=wt.highest.height/2-B*P:E=wt.highest.height-L*P,d&&(E*=-1),y!==0&&!N.showLabelBackdrop&&(_+=P/2*Math.sin(y))):(D=M,E=(1-L)*P/2);let F;if(N.showLabelBackdrop){const $=kt(N.backdropPadding),V=wt.heights[m],j=wt.widths[m];let pt=E-$.top,ft=0-$.left;switch(X){case"middle":pt-=V/2;break;case"bottom":pt-=V;break}switch(T){case"center":ft-=j/2;break;case"right":ft-=j;break}F={left:ft,top:pt,width:j+$.width,height:V+$.height,color:N.backdropColor}}b.push({label:x,font:S,textOffset:E,options:{rotation:y,color:Z,strokeColor:Ct,strokeWidth:C,textAlign:I,textBaseline:X,translation:[_,D],backdrop:F}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-St(this.labelRotation))return t==="top"?"left":"right";let r="center";return e.align==="start"?r="left":e.align==="end"?r="right":e.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:r,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?r?(u=this.right+a,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?r?(u=this.left+a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:r,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,r,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const r=this.ticks.findIndex(a=>a.value===t);return r>=0?e.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(a=0,s=r.length;a<s;++a){const l=r[a];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:r}}=this,a=i.setContext(this.getContext()),s=i.display?a.width:0;if(!s)return;const o=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,h;this.isHorizontal()?(c=Ye(t,this.left,s)-s/2,u=Ye(t,this.right,o)+o/2,d=h=l):(d=Ye(t,this.top,s)-s/2,h=Ye(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=a.width,e.strokeStyle=a.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&Pn(i,r);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;We(i,c,0,u,l,o)}r&&En(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:r}}=this;if(!i.display)return;const a=dt(i.font),s=kt(i.padding),o=i.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||H(e)?(l+=s.bottom,tt(i.text)&&(l+=a.lineHeight*(i.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:h}=kg(this,l,e,o);We(t,i.text,0,0,a,{color:i.color,maxWidth:d,rotation:h,textAlign:Sg(o,e,r),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=W(t.grid&&t.grid.z,-1),r=W(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==He.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:i,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return dt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ii{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;Pg(e)&&(i=this.register(e));const r=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in r||(r[a]=t,Cg(t,s,i),this.override&&mt.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,r=this.scope;i in e&&delete e[i],r&&i in mt[r]&&(delete mt[r][i],this.override&&delete Fe[i])}}function Cg(n,t,e){const i=Dn(Object.create(null),[e?mt.get(e):{},mt.get(t),n.defaults]);mt.set(t,i),n.defaultRoutes&&Og(t,n.defaultRoutes),n.descriptors&&mt.describe(t,n.descriptors)}function Og(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),r=i.pop(),a=[n].concat(i).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");mt.route(a,r,l,o)})}function Pg(n){return"id"in n&&"defaults"in n}class Eg{constructor(){this.controllers=new Ii(Kt,"datasets",!0),this.elements=new Ii(Pt,"elements"),this.plugins=new Ii(Object,"plugins"),this.scales=new Ii(He,"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(r=>{const a=i||this._getRegistryForType(r);i||a.isForType(r)||a===this.plugins&&r.id?this._exec(t,a,r):at(r,s=>{const o=i||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,i){const r=Tr(t);rt(i["before"+r],[],i),e[t](i),rt(i["after"+r],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const r=e.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var Jt=new Eg;class Ag{constructor(){this._init=[]}notify(t,e,i,r){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=r?this._descriptors(t).filter(r):this._descriptors(t),s=this._notify(a,t,e,i);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,i,r){r=r||{};for(const a of t){const s=a.plugin,o=s[i],l=[e,r,a.options];if(rt(o,l,s)===!1&&r.cancelable)return!1}return!0}invalidate(){U(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,r=W(i.options&&i.options.plugins,{}),a=Rg(i);return r===!1&&!e?[]:Ig(t,a,r,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,r=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(r(e,i),t,"stop"),this._notify(r(i,e),t,"start")}}function Rg(n){const t={},e=[],i=Object.keys(Jt.plugins.items);for(let a=0;a<i.length;a++)e.push(Jt.getPlugin(i[a]));const r=n.plugins||[];for(let a=0;a<r.length;a++){const s=r[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function Lg(n,t){return!t&&n===!1?null:n===!0?{}:n}function Ig(n,{plugins:t,localIds:e},i,r){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=Lg(i[l],r);c!==null&&a.push({plugin:o,options:Ng(n.config,{plugin:o,local:e[l]},c,s)})}return a}function Ng(n,{plugin:t,local:e},i,r){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(i,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Xr(n,t){const e=mt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Fg(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Yg(n,t){return n===t?"_index_":"_value_"}function Dl(n){if(n==="x"||n==="y"||n==="r")return n}function Wg(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Gr(n,...t){if(Dl(n))return n;for(const e of t){const i=e.axis||Wg(e.position)||n.length>1&&Dl(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Tl(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Ug(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Tl(n,"x",e[0])||Tl(n,"y",e[0])}return{}}function Bg(n,t){const e=Fe[n.type]||{scales:{}},i=t.scales||{},r=Xr(n.type,t),a=Object.create(null);return Object.keys(i).forEach(s=>{const o=i[s];if(!H(o))return console.error(`Invalid scale configuration for scale: ${s}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=Gr(s,o,Ug(s,n),mt.scales[o.type]),c=Yg(l,r),u=e.scales||{};a[s]=Tn(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||Xr(o,t),u=(Fe[o]||{}).scales||{};Object.keys(u).forEach(d=>{const h=Fg(d,l),f=s[h+"AxisID"]||h;a[f]=a[f]||Object.create(null),Tn(a[f],[{axis:h},i[f],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];Tn(o,[mt.scales[o.type],mt.scale])}),a}function Ml(n){const t=n.options||(n.options={});t.plugins=W(t.plugins,{}),t.scales=Bg(n,t)}function Sl(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function zg(n){return n=n||{},n.data=Sl(n.data),Ml(n),n}const kl=new Map,Cl=new Set;function Ni(n,t){let e=kl.get(n);return e||(e=t(),kl.set(n,e),Cl.add(e)),e}const Hn=(n,t,e)=>{const i=ve(t,e);i!==void 0&&n.add(i)};class Hg{constructor(t){this._config=zg(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=Sl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Ml(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ni(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ni(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ni(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ni(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let r=i.get(t);return(!r||e)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,e,i){const{options:r,type:a}=this,s=this._cachedScopes(t,i),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Hn(l,t,d))),u.forEach(d=>Hn(l,r,d)),u.forEach(d=>Hn(l,Fe[a]||{},d)),u.forEach(d=>Hn(l,mt,d)),u.forEach(d=>Hn(l,Pr,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Cl.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Fe[e]||{},mt.datasets[e]||{},{type:e},mt,Pr]}resolveNamedOptions(t,e,i,r=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Ol(this._resolverCache,t,r);let l=s;if(Vg(s,e)){a.$shared=!1,i=Ut(i)?i():i;const c=this.createResolver(t,i,o);l=en(s,i,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,i=[""],r){const{resolver:a}=Ol(this._resolverCache,t,i);return H(e)?en(a,e,void 0,r):a}}function Ol(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const r=e.join();let a=i.get(r);return a||(a={resolver:Lr(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,a)),a}const $g=n=>H(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Ut(n[e]),!1);function Vg(n,t){const{isScriptable:e,isIndexable:i}=Po(n);for(const r of t){const a=e(r),s=i(r),o=(s||a)&&n[r];if(a&&(Ut(o)||$g(o))||s&&tt(o))return!0}return!1}var jg="4.4.0";const qg=["top","bottom","left","right","chartArea"];function Pl(n,t){return n==="top"||n==="bottom"||qg.indexOf(n)===-1&&t==="x"}function El(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Al(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),rt(e&&e.onComplete,[n],t)}function Xg(n){const t=n.chart,e=t.options.animation;rt(e&&e.onProgress,[n],t)}function Rl(n){return Yo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Fi={},Ll=n=>{const t=Rl(n);return Object.values(Fi).filter(e=>e.canvas===t).pop()};function Gg(n,t,e){const i=Object.keys(n);for(const r of i){const a=+r;if(a>=t){const s=n[r];delete n[r],(e>0||a>t)&&(n[a+e]=s)}}}function Kg(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Yi(n,t,e){return n.options.clip?n[e]:t[e]}function Zg(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Yi(e,t,"left"),right:Yi(e,t,"right"),top:Yi(i,t,"top"),bottom:Yi(i,t,"bottom")}:t}let Xt=(Ie=class{static register(...t){Jt.add(...t),Il()}static unregister(...t){Jt.remove(...t),Il()}constructor(t,e){const i=this.config=new Hg(e),r=Rl(t),a=Ll(r);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");const s=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||gg(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=eh(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ag,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=mh(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Fi[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}de.listen(this,"complete",Al),de.listen(this,"progress",Xg),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:r,_aspectRatio:a}=this;return U(t)?e&&a?a:r?i/r: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 Jt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Wo(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ko(this.canvas,this.ctx),this}stop(){return de.stop(this),this}resize(t,e){de.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,r=this.canvas,a=i.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(r,t,e,a),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Wo(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),rt(i.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};at(e,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,r=Object.keys(i).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=Gr(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),at(a,s=>{const o=s.options,l=o.id,c=Gr(l,o),u=W(o.type,s.dtype);(o.position===void 0||Pl(o.position,c)!==Pl(s.dposition))&&(o.position=s.dposition),r[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const h=Jt.getScale(u);d=new h({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(o,t)}),at(r,(s,o)=>{s||delete i[o]}),at(i,s=>{Lt.configure(this,s,s.options),Lt.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((r,a)=>r.index-a.index),i>e){for(let r=e;r<i;++r)this._destroyDatasetMeta(r);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(El("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,r)=>{e.filter(a=>a===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=e.length;i<r;i++){const a=e[i];let s=this.getDatasetMeta(i);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(i),s=this.getDatasetMeta(i)),s.type=o,s.indexAxis=a.indexAxis||Xr(o,this.options),s.order=a.order||0,s.index=i,s.label=""+a.label,s.visible=this.isDatasetVisible(i),s.controller)s.controller.updateIndex(i),s.controller.linkScales();else{const l=Jt.getController(o),{datasetElementType:c,dataElementType:u}=mt.datasets[o];Object.assign(l,{dataElementType:Jt.getElement(u),datasetElementType:c&&Jt.getElement(c)}),s.controller=new l(this,i),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){at(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),h=!r&&a.indexOf(d)===-1;d.buildOrUpdateElements(h),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=i.layout.autoPadding?s:0,this._updateLayout(s),r||at(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(El("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){at(this.scales,t=>{Lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!co(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:a}of e){const s=i==="_removeElements"?-a:a;Gg(t,r,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),r=i(0);for(let a=1;a<e;a++)if(!co(r,i(a)))return;return Array.from(r).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],at(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,a)=>{r._idx=a}),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,Ut(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(e),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(de.has(this)?this.attached&&!de.running(this)&&de.start(this):(this.draw(),Al({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resize(i,r),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let r,a;for(r=0,a=e.length;r<a;++r){const s=e[r];(!t||s.visible)&&i.push(s)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,r=!i.disabled,a=Zg(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(r&&Pn(e,{left:i.left===!1?0:a.left-i.left,right:i.right===!1?this.width:a.right+i.right,top:i.top===!1?0:a.top-i.top,bottom:i.bottom===!1?this.height:a.bottom+i.bottom}),t.controller.draw(),r&&En(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ue(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,r){const a=jr.modes[e];return typeof a=="function"?a(this,t,i,r):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let r=i.filter(a=>a&&a._dataset===e).pop();return r||(r={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(r)),r}getContext(){return this.$context||(this.$context=De(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const r=i?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,r);Wt(e)?(a.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),s.update(a,{visible:i}),this.update(o=>o.datasetIndex===t?r:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),de.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ko(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Fi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},r=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};at(this.options.events,a=>i(a,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},r=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},a=(l,c)=>{this.canvas&&this.resize(l,c)};let s;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",a),i("detach",s)};s=()=>{this.attached=!1,r("resize",a),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){at(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},at(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const r=i?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+r+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[r+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:a,index:s})=>{const o=this.getDatasetMeta(a);if(!o)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:o.data[s],index:s}});!mi(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const r=this.options.hover,a=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),s=a(e,t),o=i?t:a(t,e);s.length&&this.updateHoverStyle(s,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},r=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const a=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(a||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:r=[],options:a}=this,s=e,o=this._getActiveElements(t,r,i,s),l=oh(t),c=Kg(t,this._lastEvent,i,l);i&&(this._lastEvent=null,rt(a.onHover,[t,o,this],this),l&&rt(a.onClick,[t,o,this],this));const u=!mi(o,r);return(u||e)&&(this._active=o,this._updateHoverStyles(o,r,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,r){if(t.type==="mouseout")return[];if(!i)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,r)}},k(Ie,"defaults",mt),k(Ie,"instances",Fi),k(Ie,"overrides",Fe),k(Ie,"registry",Jt),k(Ie,"version",jg),k(Ie,"getChart",Ll),Ie);function Il(){return at(Xt.instances,n=>n._plugins.invalidate())}function Qg(n,t,e){const{startAngle:i,pixelMargin:r,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=r/o;n.beginPath(),n.arc(a,s,o,i-c,e+c),l>r?(c=r/l,n.arc(a,s,l,e+c,i-c,!0)):n.arc(a,s,r,e+ut,i-ut),n.closePath(),n.clip()}function Jg(n){return Rr(n,["outerStart","outerEnd","innerStart","innerEnd"])}function tp(n,t,e,i){const r=Jg(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,i*t/2),o=l=>{const c=(e-Math.min(a,l))*i/2;return Ot(l,0,Math.min(a,c))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Ot(r.innerStart,0,s),innerEnd:Ot(r.innerEnd,0,s)}}function an(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Wi(n,t,e,i,r,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),h=u>0?u+i+e+c:0;let f=0;const p=r-l;if(i){const N=u>0?u-i:0,B=d>0?d-i:0,Z=(N+B)/2,Ct=Z!==0?p*Z/(Z+i):p;f=(p-Ct)/2}const y=Math.max(.001,p*d-e/q)/d,b=(p-y)/2,m=l+b+f,v=r-b-f,{outerStart:w,outerEnd:x,innerStart:_,innerEnd:D}=tp(t,h,d,v-m),T=d-w,M=d-x,S=m+w/T,P=v-x/M,L=h+_,E=h+D,X=m+_/L,wt=v-D/E;if(n.beginPath(),a){const N=(S+P)/2;if(n.arc(s,o,d,S,N),n.arc(s,o,d,N,P),x>0){const C=an(M,P,s,o);n.arc(C.x,C.y,x,P,v+ut)}const B=an(E,v,s,o);if(n.lineTo(B.x,B.y),D>0){const C=an(E,wt,s,o);n.arc(C.x,C.y,D,v+ut,wt+Math.PI)}const Z=(v-D/h+(m+_/h))/2;if(n.arc(s,o,h,v-D/h,Z,!0),n.arc(s,o,h,Z,m+_/h,!0),_>0){const C=an(L,X,s,o);n.arc(C.x,C.y,_,X+Math.PI,m-ut)}const Ct=an(T,m,s,o);if(n.lineTo(Ct.x,Ct.y),w>0){const C=an(T,S,s,o);n.arc(C.x,C.y,w,m-ut,S)}}else{n.moveTo(s,o);const N=Math.cos(S)*d+s,B=Math.sin(S)*d+o;n.lineTo(N,B);const Z=Math.cos(P)*d+s,Ct=Math.sin(P)*d+o;n.lineTo(Z,Ct)}n.closePath()}function ep(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Wi(n,t,e,i,l,r);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%ct||ct))}return Wi(n,t,e,i,l,r),n.fill(),l}function np(n,t,e,i,r){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,f=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,f?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(a){Wi(n,t,e,i,p,r);for(let y=0;y<a;++y)n.stroke();isNaN(o)||(p=s+(o%ct||ct))}f&&Qg(n,t,p),a||(Wi(n,t,e,i,p,r),n.stroke())}class $n extends Pt{constructor(e){super();k(this,"circumference");k(this,"endAngle");k(this,"fullCircles");k(this,"innerRadius");k(this,"outerRadius");k(this,"pixelMargin");k(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.getProps(["x","y"],r),{angle:s,distance:o}=go(a,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),f=(this.options.spacing+this.options.borderWidth)/2,y=W(h,c-l)>=ct||Sn(s,l,c),b=le(o,u+f,d+f);return y&&b}getCenterPoint(e){const{x:i,y:r,startAngle:a,endAngle:s,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(a+s)/2,h=(o+l+u+c)/2;return{x:i+Math.cos(d)*h,y:r+Math.sin(d)*h}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:r}=this,a=(i.offset||0)/4,s=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>ct?Math.floor(r/ct):0,r===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*a,Math.sin(l)*a);const c=1-Math.sin(Math.min(q,r||0)),u=a*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,ep(e,this,u,s,o),np(e,this,u,s,o),e.restore()}}k($n,"id","arc"),k($n,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),k($n,"defaultRoutes",{backgroundColor:"backgroundColor"}),k($n,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Nl(n,t,e=t){n.lineCap=W(e.borderCapStyle,t.borderCapStyle),n.setLineDash(W(e.borderDash,t.borderDash)),n.lineDashOffset=W(e.borderDashOffset,t.borderDashOffset),n.lineJoin=W(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=W(e.borderWidth,t.borderWidth),n.strokeStyle=W(e.borderColor,t.borderColor)}function ip(n,t,e){n.lineTo(e.x,e.y)}function rp(n){return n.stepped?Ch:n.tension||n.cubicInterpolationMode==="monotone"?Oh:ip}function Fl(n,t,e={}){const i=n.length,{start:r=0,end:a=i-1}=e,{start:s,end:o}=t,l=Math.max(r,s),c=Math.min(a,o),u=r<s&&a<s||r>o&&a>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function ap(n,t,e,i){const{points:r,options:a}=t,{count:s,start:o,loop:l,ilen:c}=Fl(r,e,i),u=rp(a);let{move:d=!0,reverse:h}=i||{},f,p,y;for(f=0;f<=c;++f)p=r[(o+(h?c-f:f))%s],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,h,a.stepped),y=p);return l&&(p=r[(o+(h?c:0))%s],u(n,y,p,h,a.stepped)),!!l}function sp(n,t,e,i){const r=t.points,{count:a,start:s,ilen:o}=Fl(r,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,f,p,y,b,m;const v=x=>(s+(c?o-x:x))%a,w=()=>{y!==b&&(n.lineTo(u,b),n.lineTo(u,y),n.lineTo(u,m))};for(l&&(f=r[v(0)],n.moveTo(f.x,f.y)),h=0;h<=o;++h){if(f=r[v(h)],f.skip)continue;const x=f.x,_=f.y,D=x|0;D===p?(_<y?y=_:_>b&&(b=_),u=(d*u+x)/++d):(w(),n.lineTo(x,_),p=D,d=0,y=b=_),m=_}w()}function Kr(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?sp:ap}function op(n){return n.stepped?lf:n.tension||n.cubicInterpolationMode==="monotone"?cf:Be}function lp(n,t,e,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,e,i)&&r.closePath()),Nl(n,t.options),n.stroke(r)}function cp(n,t,e,i){const{segments:r,options:a}=t,s=Kr(t);for(const o of r)Nl(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const up=typeof Path2D=="function";function dp(n,t,e,i){up&&!t.options.segment?lp(n,t,e,i):cp(n,t,e,i)}class Se extends Pt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;Jh(this._points,i,t,r,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=pf(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,r=t[e],a=this.points,s=jo(this,{property:e,start:r,end:r});if(!s.length)return;const o=[],l=op(i);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:h}=s[c],f=a[d],p=a[h];if(f===p){o.push(f);continue}const y=Math.abs((r-f[e])/(p[e]-f[e])),b=l(f,p,y,i.stepped);b[e]=t[e],o.push(b)}return o.length===1?o[0]:o}pathSegment(t,e,i){return Kr(this)(t,this,e,i)}path(t,e,i){const r=this.segments,a=Kr(this);let s=this._loop;e=e||0,i=i||this.points.length-e;for(const o of r)s&=a(t,this,o,{start:e,end:e+i-1});return!!s}draw(t,e,i,r){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),dp(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}k(Se,"id","line"),k(Se,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),k(Se,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),k(Se,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Yl(n,t,e,i){const r=n.options,{[e]:a}=n.getProps([e],i);return Math.abs(t-a)<r.radius+r.hitRadius}class Ui extends Pt{constructor(e){super();k(this,"parsed");k(this,"skip");k(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,r){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],r);return Math.pow(e-s,2)+Math.pow(i-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,i){return Yl(this,e,"x",i)}inYRange(e,i){return Yl(this,e,"y",i)}getCenterPoint(e){const{x:i,y:r}=this.getProps(["x","y"],e);return{x:i,y:r}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const r=i&&e.borderWidth||0;return(i+r)*2}draw(e,i){const r=this.options;this.skip||r.radius<.1||!ue(this,i,this.size(r)/2)||(e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.fillStyle=r.backgroundColor,Ar(e,r,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}k(Ui,"id","point"),k(Ui,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),k(Ui,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Wl(n,t){const{x:e,y:i,base:r,width:a,height:s}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,d;return n.horizontal?(d=s/2,o=Math.min(e,r),l=Math.max(e,r),c=i-d,u=i+d):(d=a/2,o=e-d,l=e+d,c=Math.min(i,r),u=Math.max(i,r)),{left:o,top:c,right:l,bottom:u}}function ke(n,t,e,i){return n?0:Ot(t,e,i)}function hp(n,t,e){const i=n.options.borderWidth,r=n.borderSkipped,a=Oo(i);return{t:ke(r.top,a.top,0,e),r:ke(r.right,a.right,0,t),b:ke(r.bottom,a.bottom,0,e),l:ke(r.left,a.left,0,t)}}function fp(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),r=n.options.borderRadius,a=_e(r),s=Math.min(t,e),o=n.borderSkipped,l=i||H(r);return{topLeft:ke(!l||o.top||o.left,a.topLeft,0,s),topRight:ke(!l||o.top||o.right,a.topRight,0,s),bottomLeft:ke(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:ke(!l||o.bottom||o.right,a.bottomRight,0,s)}}function gp(n){const t=Wl(n),e=t.right-t.left,i=t.bottom-t.top,r=hp(n,e/2,i/2),a=fp(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:a},inner:{x:t.left+r.l,y:t.top+r.t,w:e-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,a.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(r.b,r.r))}}}}function Zr(n,t,e,i){const r=t===null,a=e===null,o=n&&!(r&&a)&&Wl(n,i);return o&&(r||le(t,o.left,o.right))&&(a||le(e,o.top,o.bottom))}function pp(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function mp(n,t){n.rect(t.x,t.y,t.w,t.h)}function Qr(n,t,e={}){const i=n.x!==e.x?-t:0,r=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-i,s=(n.y+n.h!==e.y+e.h?t:0)-r;return{x:n.x+i,y:n.y+r,w:n.w+a,h:n.h+s,radius:n.radius}}class Bi extends Pt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:r}}=this,{inner:a,outer:s}=gp(this),o=pp(s.radius)?tn:mp;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,Qr(s,e,a)),t.clip(),o(t,Qr(a,-e,s)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,Qr(a,e)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,e,i){return Zr(this,t,e,i)}inXRange(t,e){return Zr(this,t,null,e)}inYRange(t,e){return Zr(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:r,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+r)/2:e,y:a?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}k(Bi,"id","bar"),k(Bi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),k(Bi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var bp=Object.freeze({__proto__:null,ArcElement:$n,BarElement:Bi,LineElement:Se,PointElement:Ui});const Jr=["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)"],Ul=Jr.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Bl(n){return Jr[n%Jr.length]}function zl(n){return Ul[n%Ul.length]}function yp(n,t){return n.borderColor=Bl(t),n.backgroundColor=zl(t),++t}function vp(n,t){return n.backgroundColor=n.data.map(()=>Bl(t++)),t}function xp(n,t){return n.backgroundColor=n.data.map(()=>zl(t++)),t}function wp(n){let t=0;return(e,i)=>{const r=n.getDatasetMeta(i).controller;r instanceof Me?t=vp(e,t):r instanceof Nn?t=xp(e,t):r&&(t=yp(e,t))}}function Hl(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function _p(n){return n&&(n.borderColor||n.backgroundColor)}var Dp={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:r}=n.config,{elements:a}=r;if(!e.forceOverride&&(Hl(i)||_p(r)||a&&Hl(a)))return;const s=wp(n);i.forEach(s)}};function Tp(n,t,e,i,r){const a=r.samples||i;if(a>=e)return n.slice(t,t+e);const s=[],o=(e-2)/(a-2);let l=0;const c=t+e-1;let u=t,d,h,f,p,y;for(s[l++]=n[u],d=0;d<a-2;d++){let b=0,m=0,v;const w=Math.floor((d+1)*o)+1+t,x=Math.min(Math.floor((d+2)*o)+1,e)+t,_=x-w;for(v=w;v<x;v++)b+=n[v].x,m+=n[v].y;b/=_,m/=_;const D=Math.floor(d*o)+1+t,T=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:M,y:S}=n[u];for(f=p=-1,v=D;v<T;v++)p=.5*Math.abs((M-b)*(n[v].y-S)-(M-n[v].x)*(m-S)),p>f&&(f=p,h=n[v],y=v);s[l++]=h,u=y}return s[l++]=n[c],s}function Mp(n,t,e,i){let r=0,a=0,s,o,l,c,u,d,h,f,p,y;const b=[],m=t+e-1,v=n[t].x,x=n[m].x-v;for(s=t;s<t+e;++s){o=n[s],l=(o.x-v)/x*i,c=o.y;const _=l|0;if(_===u)c<p?(p=c,d=s):c>y&&(y=c,h=s),r=(a*r+o.x)/++a;else{const D=s-1;if(!U(d)&&!U(h)){const T=Math.min(d,h),M=Math.max(d,h);T!==f&&T!==D&&b.push({...n[T],x:r}),M!==f&&M!==D&&b.push({...n[M],x:r})}s>0&&D!==f&&b.push(n[D]),b.push(o),u=_,a=0,p=y=c,d=h=f=s}}return b}function $l(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Vl(n){n.data.datasets.forEach(t=>{$l(t)})}function Sp(n,t){const e=t.length;let i=0,r;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(i=Ot(ce(t,a.axis,s).lo,0,e-1)),c?r=Ot(ce(t,a.axis,o).hi+1,i,e)-i:r=e-i,{start:i,count:r}}var kp={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Vl(n);return}const i=n.width;n.data.datasets.forEach((r,a)=>{const{_data:s,indexAxis:o}=r,l=n.getDatasetMeta(a),c=s||r.data;if(An([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:d,count:h}=Sp(l,c);const f=e.threshold||4*i;if(h<=f){$l(r);return}U(s)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=Tp(c,d,h,i,e);break;case"min-max":p=Mp(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}r._decimated=p})},destroy(n){Vl(n)}};function Cp(n,t,e){const i=n.segments,r=n.points,a=t.points,s=[];for(const o of i){let{start:l,end:c}=o;c=ea(l,c,r);const u=ta(e,r[l],r[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:r[l],end:r[c]});continue}const d=jo(t,u);for(const h of d){const f=ta(e,a[h.start],a[h.end],h.loop),p=Vo(o,r,f);for(const y of p)s.push({source:y,target:h,start:{[e]:jl(u,f,"start",Math.max)},end:{[e]:jl(u,f,"end",Math.min)}})}}return s}function ta(n,t,e,i){if(i)return;let r=t[n],a=e[n];return n==="angle"&&(r=$t(r),a=$t(a)),{property:n,start:r,end:a}}function Op(n,t){const{x:e=null,y:i=null}=n||{},r=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=ea(s,o,r);const l=r[s],c=r[o];i!==null?(a.push({x:l.x,y:i}),a.push({x:c.x,y:i})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function ea(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function jl(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function ql(n,t){let e=[],i=!1;return tt(n)?(i=!0,e=n):e=Op(n,t),e.length?new Se({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Xl(n){return n&&n.fill!==!1}function Pp(n,t,e){let r=n[t].fill;const a=[t];let s;if(!e)return r;for(;r!==!1&&a.indexOf(r)===-1;){if(!gt(r))return r;if(s=n[r],!s)return!1;if(s.visible)return r;a.push(r),r=s.fill}return!1}function Ep(n,t,e){const i=Ip(n);if(H(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return gt(r)&&Math.floor(r)===r?Ap(i[0],t,r,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Ap(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Rp(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:H(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Lp(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:H(n)?i=n.value:i=t.getBaseValue(),i}function Ip(n){const t=n.options,e=t.fill;let i=W(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Np(n){const{scale:t,index:e,line:i}=n,r=[],a=i.segments,s=i.points,o=Fp(t,e);o.push(ql({x:null,y:t.bottom},i));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)Yp(r,s[u],o)}return new Se({points:r,options:{}})}function Fp(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const a=i[r];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function Yp(n,t,e){const i=[];for(let r=0;r<e.length;r++){const a=e[r],{first:s,last:o,point:l}=Wp(a,t,"x");if(!(!l||s&&o)){if(s)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function Wp(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const r=i[e],a=n.segments,s=n.points;let o=!1,l=!1;for(let c=0;c<a.length;c++){const u=a[c],d=s[u.start][e],h=s[u.end][e];if(le(r,d,h)){o=r===d,l=r===h;break}}return{first:o,last:l,point:i}}class Gl{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:r,y:a,radius:s}=this;return e=e||{start:0,end:ct},t.arc(r,a,s,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:r}=this,a=t.angle;return{x:e+Math.cos(a)*r,y:i+Math.sin(a)*r,angle:a}}}function Up(n){const{chart:t,fill:e,line:i}=n;if(gt(e))return Bp(t,e);if(e==="stack")return Np(n);if(e==="shape")return!0;const r=zp(n);return r instanceof Gl?r:ql(r,i)}function Bp(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function zp(n){return(n.scale||{}).getPointPositionForValue?$p(n):Hp(n)}function Hp(n){const{scale:t={},fill:e}=n,i=Rp(e,t);if(gt(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function $p(n){const{scale:t,fill:e}=n,i=t.options,r=t.getLabels().length,a=i.reverse?t.max:t.min,s=Lp(e,t,a),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,a);return new Gl({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<r;++l)o.push(t.getPointPositionForValue(l,s));return o}function na(n,t,e){const i=Up(t),{line:r,scale:a,axis:s}=t,o=r.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};i&&r.points.length&&(Pn(n,e),Vp(n,{line:r,target:i,above:u,below:d,area:e,scale:a,axis:s}),En(n))}function Vp(n,t){const{line:e,target:i,above:r,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==r&&(Kl(n,i,s.top),Zl(n,{line:e,target:i,color:r,scale:o,property:l}),n.restore(),n.save(),Kl(n,i,s.bottom)),Zl(n,{line:e,target:i,color:a,scale:o,property:l}),n.restore()}function Kl(n,t,e){const{segments:i,points:r}=t;let a=!0,s=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],d=r[ea(l,c,r)];a?(n.moveTo(u.x,u.y),a=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),s=!!t.pathSegment(n,o,{move:s}),s?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Zl(n,t){const{line:e,target:i,property:r,color:a,scale:s}=t,o=Cp(e,i,r);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:h=a}={}}=l,f=i!==!0;n.save(),n.fillStyle=h,jp(n,s,f&&ta(r,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let y;if(f){p?n.closePath():Ql(n,i,d,r);const b=!!i.pathSegment(n,c,{move:p,reverse:!0});y=p&&b,y||Ql(n,i,u,r)}n.closePath(),n.fill(y?"evenodd":"nonzero"),n.restore()}}function jp(n,t,e){const{top:i,bottom:r}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,i,o-s,r-i),n.clip())}function Ql(n,t,e,i){const r=t.interpolate(e,i);r&&n.lineTo(r.x,r.y)}var qp={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,r=[];let a,s,o,l;for(s=0;s<i;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof Se&&(l={visible:n.isDatasetVisible(s),index:s,fill:Ep(o,s,i),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,r.push(l);for(s=0;s<i;++s)l=r[s],!(!l||l.fill===!1)&&(l.fill=Pp(r,s,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",r=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=r.length-1;s>=0;--s){const o=r[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),i&&o.fill&&na(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const a=i[r].$filler;Xl(a)&&na(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Xl(i)||e.drawTime!=="beforeDatasetDraw"||na(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Jl=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Xp=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class tc extends Pt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=rt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=dt(i.font),a=r.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=Jl(i,a);let c,u;e.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,r,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,r){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+o;let d=t;a.textAlign="left",a.textBaseline="middle";let h=-1,f=-u;return this.legendItems.forEach((p,y)=>{const b=i+e/2+a.measureText(p.text).width;(y===0||c[c.length-1]+b+2*o>s)&&(d+=u,c[c.length-(y>0?0:1)]=0,f+=u,h++),l[y]={left:0,top:f,row:h,width:b,height:r},c[c.length-1]+=b+o}),d}_fitCols(t,e,i,r){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,h=0,f=0,p=0,y=0;return this.legendItems.forEach((b,m)=>{const{itemWidth:v,itemHeight:w}=Gp(i,e,a,b,r);m>0&&f+w+2*o>u&&(d+=h+o,c.push({width:h,height:f}),p+=h+o,y++,h=f=0),l[m]={left:p,top:f,col:y,width:v,height:w},h=Math.max(h,v),f+=w+o}),d+=h,c.push({width:h,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:r},rtl:a}}=this,s=rn(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=Rt(i,this.left+r,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=Rt(i,this.left+r,this.right-this.lineWidths[o])),c.top+=this.top+t+r,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+r}else{let o=0,l=Rt(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=Rt(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+r,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Pn(t,this),this._draw(),En(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:r}=this,{align:a,labels:s}=t,o=mt.color,l=rn(t.rtl,this.left,this.width),c=dt(s.font),{padding:u}=s,d=c.size,h=d/2;let f;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:b}=Jl(s,d),m=function(D,T,M){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;r.save();const S=W(M.lineWidth,1);if(r.fillStyle=W(M.fillStyle,o),r.lineCap=W(M.lineCap,"butt"),r.lineDashOffset=W(M.lineDashOffset,0),r.lineJoin=W(M.lineJoin,"miter"),r.lineWidth=S,r.strokeStyle=W(M.strokeStyle,o),r.setLineDash(W(M.lineDash,[])),s.usePointStyle){const P={radius:y*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:S},L=l.xPlus(D,p/2),E=T+h;Co(r,P,L,E,s.pointStyleWidth&&p)}else{const P=T+Math.max((d-y)/2,0),L=l.leftForLtr(D,p),E=_e(M.borderRadius);r.beginPath(),Object.values(E).some(X=>X!==0)?tn(r,{x:L,y:P,w:p,h:y,radius:E}):r.rect(L,P,p,y),r.fill(),S!==0&&r.stroke()}r.restore()},v=function(D,T,M){We(r,M.text,D,T+b/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},w=this.isHorizontal(),x=this._computeTitleHeight();w?f={x:Rt(a,this.left+u,this.right-i[0]),y:this.top+u+x,line:0}:f={x:this.left+u,y:Rt(a,this.top+x+u,this.bottom-e[0].height),line:0},Bo(this.ctx,t.textDirection);const _=b+u;this.legendItems.forEach((D,T)=>{r.strokeStyle=D.fontColor,r.fillStyle=D.fontColor;const M=r.measureText(D.text).width,S=l.textAlign(D.textAlign||(D.textAlign=s.textAlign)),P=p+h+M;let L=f.x,E=f.y;l.setWidth(this.width),w?T>0&&L+P+u>this.right&&(E=f.y+=_,f.line++,L=f.x=Rt(a,this.left+u,this.right-i[f.line])):T>0&&E+_>this.bottom&&(L=f.x=L+e[f.line].width+u,f.line++,E=f.y=Rt(a,this.top+x+u,this.bottom-e[f.line].height));const X=l.x(L);if(m(X,E,D),L=bh(S,L+p+h,w?L+P:this.right,t.rtl),v(l.x(L),E,D),w)f.x+=P+u;else if(typeof D.text!="string"){const wt=c.lineHeight;f.y+=ec(D,wt)+u}else f.y+=_}),zo(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=dt(e.font),r=kt(e.padding);if(!e.display)return;const a=rn(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=i.size/2,c=r.top+l;let u,d=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=Rt(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((y,b)=>Math.max(y,b.height),0);u=c+Rt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=Rt(o,d,d+h);s.textAlign=a.textAlign(kr(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=i.string,We(s,e.text,f,u,i)}_computeTitleHeight(){const t=this.options.title,e=dt(t.font),i=kt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,r,a;if(le(t,this.left,this.right)&&le(e,this.top,this.bottom)){for(a=this.legendHitBoxes,i=0;i<a.length;++i)if(r=a[i],le(t,r.left,r.left+r.width)&&le(e,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Qp(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,a=Xp(r,i);r&&!a&&rt(e.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!a&&rt(e.onHover,[t,i,this],this)}else i&&rt(e.onClick,[t,i,this],this)}}function Gp(n,t,e,i,r){const a=Kp(i,n,t,e),s=Zp(r,i,t.lineHeight);return{itemWidth:a,itemHeight:s}}function Kp(n,t,e,i){let r=n.text;return r&&typeof r!="string"&&(r=r.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+i.measureText(r).width}function Zp(n,t,e){let i=n;return typeof t.text!="string"&&(i=ec(t,e)),i}function ec(n,t){const e=n.text?n.text.length:0;return t*e}function Qp(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Jp={id:"legend",_element:tc,start(n,t,e){const i=n.legend=new tc({ctx:n.ctx,options:e,chart:n});Lt.configure(n,i,e),Lt.addBox(n,i)},stop(n){Lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Lt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,r=e.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:r,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:r||c.textAlign,borderRadius:s&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class ia extends Pt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const r=tt(i.text)?i.text.length:1;this._padding=kt(i.padding);const a=r*dt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=a:this.width=a}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:r,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=Rt(o,i,a),d=e+t,c=a-i):(s.position==="left"?(u=i+t,d=Rt(o,r,e),l=q*-.5):(u=a-t,d=Rt(o,e,r),l=q*.5),c=r-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=dt(e.font),a=i.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);We(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:kr(e.align),textBaseline:"middle",translation:[s,o]})}}function tm(n,t){const e=new ia({ctx:n.ctx,options:t,chart:n});Lt.configure(n,e,t),Lt.addBox(n,e),n.titleBlock=e}var em={id:"title",_element:ia,start(n,t,e){tm(n,e)},stop(n){const t=n.titleBlock;Lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Lt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const zi=new WeakMap;var nm={id:"subtitle",start(n,t,e){const i=new ia({ctx:n.ctx,options:e,chart:n});Lt.configure(n,i,e),Lt.addBox(n,i),zi.set(n,i)},stop(n){Lt.removeBox(n,zi.get(n)),zi.delete(n)},beforeUpdate(n,t,e){const i=zi.get(n);Lt.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Vn={average(n){if(!n.length)return!1;let t,e,i=0,r=0,a=0;for(t=0,e=n.length;t<e;++t){const s=n[t].element;if(s&&s.hasValue()){const o=s.tooltipPosition();i+=o.x,r+=o.y,++a}}return{x:i/a,y:r/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,r=Number.POSITIVE_INFINITY,a,s,o;for(a=0,s=n.length;a<s;++a){const l=n[a].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=Je(t,c);u<r&&(r=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function te(n,t){return t&&(tt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function he(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function im(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:s,value:o}=a.getLabelAndValue(r);return{chart:n,label:s,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:o,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function nc(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=dt(t.bodyFont),c=dt(t.titleFont),u=dt(t.footerFont),d=a.length,h=r.length,f=i.length,p=kt(t.padding);let y=p.height,b=0,m=i.reduce((w,_)=>w+_.before.length+_.lines.length+_.after.length,0);if(m+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),m){const w=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;y+=f*w+(m-f)*l.lineHeight+(m-1)*t.bodySpacing}h&&(y+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let v=0;const x=function(w){b=Math.max(b,e.measureText(w).width+v)};return e.save(),e.font=c.string,at(n.title,x),e.font=l.string,at(n.beforeBody.concat(n.afterBody),x),v=t.displayColors?s+2+t.boxPadding:0,at(i,w=>{at(w.before,x),at(w.lines,x),at(w.after,x)}),v=0,e.font=u.string,at(n.footer,x),e.restore(),b+=p.width,{width:b,height:y}}function rm(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function am(n,t,e,i){const{x:r,width:a}=i,s=e.caretSize+e.caretPadding;if(n==="left"&&r+a+s>t.width||n==="right"&&r-a-s<0)return!0}function sm(n,t,e,i){const{x:r,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=r<=(o+l)/2?"left":"right":r<=a/2?c="left":r>=s-a/2&&(c="right"),am(c,n,t,e)&&(c="center"),c}function ic(n,t,e){const i=e.yAlign||t.yAlign||rm(n,e);return{xAlign:e.xAlign||t.xAlign||sm(n,t,e,i),yAlign:i}}function om(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function lm(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function rc(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=r+a,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=_e(s);let p=om(t,o);const y=lm(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,h)+r:o==="right"&&(p+=Math.max(d,f)+r),{x:Pt(p,0,i.width-t.width),y:Pt(y,0,i.height-t.height)}}function Hi(n,t,e){const i=kt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function ac(n){return te([],he(n))}function cm(n,t,e){return De(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function sc(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const oc={beforeTitle:oe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:oe,beforeBody:oe,beforeLabel:oe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return U(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:oe,afterBody:oe,beforeFooter:oe,footer:oe,afterFooter:oe};function Bt(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?oc[t].call(e,i):r}class ra extends Ot{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,a=new Yr(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=cm(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=Bt(i,"beforeTitle",this,t),a=Bt(i,"title",this,t),s=Bt(i,"afterTitle",this,t);let o=[];return o=te(o,he(r)),o=te(o,he(a)),o=te(o,he(s)),o}getBeforeBody(t,e){return ac(Bt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return at(t,a=>{const s={before:[],lines:[],after:[]},o=sc(i,a);te(s.before,he(Bt(o,"beforeLabel",this,a))),te(s.lines,Bt(o,"label",this,a)),te(s.after,he(Bt(o,"afterLabel",this,a))),r.push(s)}),r}getAfterBody(t,e){return ac(Bt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=Bt(i,"beforeFooter",this,t),a=Bt(i,"footer",this,t),s=Bt(i,"afterFooter",this,t);let o=[];return o=te(o,he(r)),o=te(o,he(a)),o=te(o,he(s)),o}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(im(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),at(o,u=>{const d=sc(t.callbacks,u);r.push(Bt(d,"labelColor",this,u)),a.push(Bt(d,"labelPointStyle",this,u)),s.push(Bt(d,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,s=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const o=$n[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=nc(this,i),c=Object.assign({},o,l),u=ic(this.chart,i,c),d=rc(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=_e(o),{x:h,y:f}=t,{width:p,height:y}=e;let b,m,v,x,w,_;return a==="center"?(w=f+y/2,r==="left"?(b=h,m=b-s,x=w+s,_=w-s):(b=h+p,m=b+s,x=w-s,_=w+s),v=b):(r==="left"?m=h+Math.max(l,u)+s:r==="right"?m=h+p-Math.max(c,d)-s:m=this.caretX,a==="top"?(x=f,w=x-s,b=m-s,v=m+s):(x=f+y,w=x+s,b=m+s,v=m-s),_=x),{x1:b,x2:m,x3:v,y1:x,y2:w,y3:_}}drawTitle(t,e,i){const r=this.title,a=r.length;let s,o,l;if(a){const c=rn(i.rtl,this.x,this.width);for(t.x=Hi(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",s=dt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(r[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,r,a){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=a,u=dt(a.bodyFont),d=Hi(this,"left",a),h=r.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+f;if(a.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},b=r.leftForLtr(h,c)+c/2,m=p+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,Ar(t,y,b,m),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Ar(t,y,b,m)}else{t.lineWidth=$(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=r.leftForLtr(h,c),b=r.leftForLtr(r.xPlus(h,1),c-2),m=_e(s.borderRadius);Object.values(m).some(v=>v!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,tn(t,{x:y,y:p,w:c,h:l,radius:m}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),tn(t,{x:b,y:p+1,w:c-2,h:l-2,radius:m}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=dt(i.bodyFont);let h=d.lineHeight,f=0;const p=rn(i.rtl,this.x,this.width),y=function(S){e.fillText(S,p.x(t.x+f),t.y+h/2),t.y+=h+a},b=p.textAlign(s);let m,v,x,w,_,D,T;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=Hi(this,b,i),e.fillStyle=i.bodyColor,at(this.beforeBody,y),f=o&&b!=="right"?s==="center"?c/2+u:c+2+u:0,w=0,D=r.length;w<D;++w){for(m=r[w],v=this.labelTextColors[w],e.fillStyle=v,at(m.before,y),x=m.lines,o&&x.length&&(this._drawColorBox(e,t,w,p,i),h=Math.max(d.lineHeight,l)),_=0,T=x.length;_<T;++_)y(x[_]),h=d.lineHeight;at(m.after,y)}f=0,h=d.lineHeight,at(this.afterBody,y),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let s,o;if(a){const l=rn(i.rtl,this.x,this.width);for(t.x=Hi(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",s=dt(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(r[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=_e(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,i,r),e.lineTo(o+c-h,l),e.quadraticCurveTo(o+c,l,o+c,l+h),s==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(o+f,l+u),e.quadraticCurveTo(o,l+u,o,l+u-f),s==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const s=$n[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=nc(this,t),l=Object.assign({},s,this._size),c=ic(e,t,l),u=rc(t,l,c,e);(r._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=kt(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,r,e),Bo(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),zo(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),a=!mi(i,r),s=this._positionChanged(r,e);(a||s)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),o=this._positionChanged(s,t),l=e||!mi(s,a)||o;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,s=$n[a.position].call(this,t,e);return s!==!1&&(i!==s.x||r!==s.y)}}k(ra,"positioners",$n);var $i={id:"tooltip",_element:ra,positioners:$n,afterInit(n,t,e){e&&(n.tooltip=new ra({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:oc},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"]},um=Object.freeze({__proto__:null,Colors:Dp,Decimation:kp,Filler:qp,Legend:Jp,SubTitle:nm,Title:em,Tooltip:$i});const dm=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function hm(n,t,e,i){const r=n.indexOf(t);if(r===-1)return dm(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const fm=(n,t)=>n===null?null:Pt(Math.round(n),0,t);function lc(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class aa extends He{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(U(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:hm(i,t,W(e,t),this._addedLabels),fm(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)r.push({value:s});return r}getLabelForValue(t){return lc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}k(aa,"id","category"),k(aa,"defaults",{ticks:{callback:lc}});function gm(n,t){const e=[],{bounds:r,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,f=a||1,p=u-1,{min:y,max:b}=t,m=!U(s),v=!U(o),x=!U(c),w=(b-y)/(d+1);let _=uo((b-y)/p/f)*f,D,T,S,M;if(_<1e-14&&!m&&!v)return[{value:y},{value:b}];M=Math.ceil(b/_)-Math.floor(y/_),M>p&&(_=uo(M*_/p/f)*f),U(l)||(D=Math.pow(10,l),_=Math.ceil(_*D)/D),r==="ticks"?(T=Math.floor(y/_)*_,S=Math.ceil(b/_)*_):(T=y,S=b),m&&v&&a&&uh((o-s)/a,_/1e3)?(M=Math.round(Math.min((o-s)/_,u)),_=(o-s)/M,T=s,S=o):x?(T=m?s:T,S=v?o:S,M=c-1,_=(S-T)/M):(M=(S-T)/_,Tn(M,Math.round(M),_/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max(fo(_),fo(T));D=Math.pow(10,U(l)?O:l),T=Math.round(T*D)/D,S=Math.round(S*D)/D;let A=0;for(m&&(h&&T!==s?(e.push({value:s}),T<s&&A++,Tn(Math.round((T+A*_)*D)/D,s,cc(s,w,n))&&A++):T<s&&A++);A<M;++A){const R=Math.round((T+A*_)*D)/D;if(v&&R>o)break;e.push({value:R})}return v&&h&&S!==o?e.length&&Tn(e[e.length-1].value,o,cc(o,w,n))?e[e.length-1].value=o:e.push({value:o}):(!v||S===o)&&e.push({value:S}),e}function cc(n,t,{horizontal:e,minRotation:i}){const r=St(i),a=(e?Math.sin(r):Math.cos(r))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class Vi extends He{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 U(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:a}=this;const s=l=>r=e?r:l,o=l=>a=i?a:l;if(t){const l=Qt(r),c=Qt(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(r===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(r-l)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={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},a=this._range||this,s=gm(r,a);return t.bounds==="ticks"&&ho(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return kn(t,this.chart.options.locale,this.options.ticks.format)}}class sa extends Vi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=pt(t)?t:0,this.max=pt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=St(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}k(sa,"id","linear"),k(sa,"defaults",{ticks:{callback:_i.formatters.numeric}});const Vn=n=>Math.floor(xe(n)),$e=(n,t)=>Math.pow(10,Vn(n)+t);function uc(n){return n/Math.pow(10,Vn(n))===1}function dc(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function pm(n,t){const e=t-n;let i=Vn(e);for(;dc(n,t,i)>10;)i++;for(;dc(n,t,i)<10;)i--;return Math.min(i,Vn(n))}function mm(n,{min:t,max:e}){t=Ht(n.min,t);const i=[],r=Vn(t);let a=pm(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=r>a?Math.pow(10,r):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),h=Ht(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;h<e;)i.push({value:h,major:uc(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),h=Math.round((l+u+d*Math.pow(10,a))*s)/s;const f=Ht(n.max,h);return i.push({value:f,major:uc(f),significand:d}),i}class oa extends He{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Vi.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return pt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=pt(t)?Math.max(0,t):null,this.max=pt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!pt(this._userMin)&&(this.min=t===$e(this.min,0)?$e(this.min,-1):$e(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=o=>i=t?i:o,s=o=>r=e?r:o;i===r&&(i<=0?(a(1),s(10)):(a($e(i,-1)),s($e(r,1)))),i<=0&&a($e(r,-1)),r<=0&&s($e(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=mm(e,this);return t.bounds==="ticks"&&ho(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":kn(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xe(t),this._valueRange=xe(this.max)-xe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}k(oa,"id","logarithmic"),k(oa,"defaults",{ticks:{callback:_i.formatters.logarithmic,major:{enabled:!0}}});function la(n){const t=n.ticks;if(t.display&&n.display){const e=kt(t.backdropPadding);return W(t.font&&t.font.size,bt.font.size)+e.height}return 0}function bm(n,t,e){return e=tt(e)?e:[e],{w:kh(n,t.string,e),h:e.length*t.lineHeight}}function hc(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function ym(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?X/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));r[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+r[l],o),d=dt(c.font),h=bm(n.ctx,d,n._pointLabels[l]);i[l]=h;const f=$t(n.getIndexAngle(l)+o),p=Math.round(xi(f)),y=hc(p,u.x,h.w,0,180),b=hc(p,u.y,h.h,90,270);vm(e,t,f,y,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=_m(n,i,r)}function vm(n,t,e,i,r){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),r.start<t.t?(l=(t.t-r.start)/s,n.t=Math.min(n.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function xm(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,i+r+s,a),c=Math.round(xi($t(l.angle+ut))),u=Mm(l.y,o.h,c),d=Dm(c),h=Tm(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+o.w,bottom:u+o.h}}function wm(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:a}=n;return!(ue({x:e,y:i},t)||ue({x:e,y:a},t)||ue({x:r,y:i},t)||ue({x:r,y:a},t))}function _m(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:la(a)/2,additionalAngle:s?X/r:0};let c;for(let u=0;u<r;u++){l.padding=e[u],l.size=t[u];const d=xm(n,u,l);i.push(d),o==="auto"&&(d.visible=wm(d,c),d.visible&&(c=d))}return i}function Dm(n){return n===0||n===180?"center":n<180?"left":"right"}function Tm(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Mm(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Sm(n,t,e){const{left:i,top:r,right:a,bottom:s}=e,{backdropColor:o}=t;if(!U(o)){const l=_e(t.borderRadius),c=kt(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=r-c.top,h=a-i+c.width,f=s-r+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),tn(n,{x:u,y:d,w:h,h:f,radius:l}),n.fill()):n.fillRect(u,d,h,f)}}function km(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=n._pointLabelItems[r];if(!a.visible)continue;const s=i.setContext(n.getPointLabelContext(r));Sm(e,s,a);const o=dt(s.font),{x:l,y:c,textAlign:u}=a;We(e,n._pointLabels[r],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function fc(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,ct);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let s=1;s<i;s++)a=n.getPointPosition(s,t),r.lineTo(a.x,a.y)}}function Cm(n,t,e,i,r){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!i||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),fc(n,e,s,i),a.closePath(),a.stroke(),a.restore())}function Pm(n,t,e){return De(n,{label:e,index:t,type:"pointLabel"})}class jn extends Vi{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=kt(la(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=pt(t)&&!isNaN(t)?t:0,this.max=pt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/la(this.options))}generateTickLabels(t){Vi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=rt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?ym(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return $t(t*e+St(i))}getDistanceFromCenterForValue(t){if(U(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(U(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Pm(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-ut+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),fc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&km(this,s),r.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=r.setContext(h),p=a.setContext(h);Cm(this,f,l,s,p)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=dt(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=kt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}We(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}k(jn,"id","radialLinear"),k(jn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_i.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),k(jn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),k(jn,"descriptors",{angleLines:{_fallback:"grid"}});const ji={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}},zt=Object.keys(ji);function gc(n,t){return n-t}function pc(n,t){if(U(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let s=t;return typeof i=="function"&&(s=i(s)),pt(s)||(s=typeof i=="string"?e.parse(s,i):e.parse(s)),s===null?null:(r&&(s=r==="week"&&(we(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,r)),+s)}function mc(n,t,e,i){const r=zt.length;for(let a=zt.indexOf(n);a<r-1;++a){const s=ji[zt[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=i)return zt[a]}return zt[r-1]}function Om(n,t,e,i,r){for(let a=zt.length-1;a>=zt.indexOf(e);a--){const s=zt[a];if(ji[s].common&&n._adapter.diff(r,i,s)>=t-1)return s}return zt[e?zt.indexOf(e):0]}function Em(n){for(let t=zt.indexOf(n)+1,e=zt.length;t<e;++t)if(ji[zt[t]].common)return zt[t]}function bc(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Sr(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function Am(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+r.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function yc(n,t,e){const i=[],r={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],r[o]=s,i.push({value:o,major:!1});return a===0||!e?i:Am(n,i,r,e)}class qn extends He{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new ol._date(t.adapters.date);r.init(e),Dn(i.displayFormats,r.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:pc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=pt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=pt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,s=this.max,o=gh(r,a,s);return this._unit=e.unit||(i.autoSkip?mc(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):Om(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Em(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),yc(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Pt(e,0,s),i=Pt(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,s=a.unit||mc(a.minUnit,e,i,this._getLabelCapacity(e)),o=W(r.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=we(l)||l===!0,u={};let d=e,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<i;h=+t.add(h,o,s),f++)bc(u,h,p);return(h===i||r.bounds==="ticks"||f===1)&&bc(u,h,p),Object.keys(u).sort(gc).map(y=>+y)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,a=this._unit,s=e||r[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,r){const a=this.options,s=a.ticks.callback;if(s)return rt(s,[t,e,i],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],h=i[e],f=c&&d&&h&&h.major;return this._adapter.format(t,r||(f?d:u))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=St(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),s=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*a+o*s,h:i*s+o*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,yc(this,[t],this._majorUnit),r),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(pc(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return bo(t.sort(gc))}}k(qn,"id","time"),k(qn,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function qi(n,t,e){let i=0,r=n.length-1,a,s,o,l;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ce(n,"pos",t)),{pos:a,time:o}=n[i],{pos:s,time:l}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ce(n,"time",t)),{time:a,pos:o}=n[i],{time:s,pos:l}=n[r]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class ca extends qn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=qi(e,this.min),this._tableRange=qi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=i&&r.push(c);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=r.length;s<o;++s)u=r[s+1],l=r[s-1],c=r[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,a)=>r-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(qi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return qi(this._table,i*this._tableRange+this._minPos,!0)}}k(ca,"id","timeseries"),k(ca,"defaults",qn.defaults);var Rm=Object.freeze({__proto__:null,CategoryScale:aa,LinearScale:sa,LogarithmicScale:oa,RadialLinearScale:jn,TimeScale:qn,TimeSeriesScale:ca});const Lm=[Hf,bp,um,Rm],Im=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Nm=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Fm=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ym=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],vc=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function ua(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Ym:Fm:t.binary?Nm:Im,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const r=n<0,a=r?"-":t.signed?"+":"";r&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=vc(n,t.locale,s);return a+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=vc(Number(n),t.locale,s),c=e[o];return a+l+i+c}function fe(n){"@babel/helpers - typeof";return fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(n)}function ht(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function L(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function Y(n){L(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||fe(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function xc(n,t){L(2,arguments);var e=Y(n),i=ht(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function da(n,t){L(2,arguments);var e=Y(n),i=ht(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}function Xn(n,t){L(2,arguments);var e=Y(n).getTime(),i=ht(t);return new Date(e+i)}var Wm=36e5;function Um(n,t){L(2,arguments);var e=ht(t);return Xn(n,e*Wm)}var Bm={};function Ce(){return Bm}function wc(n,t){var e,i,r,a,s,o,l,c;L(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Y(n),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function Xi(n){var 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 ha(n){L(1,arguments);var t=Y(n);return t.setHours(0,0,0,0),t}var zm=864e5;function Hm(n,t){L(2,arguments);var e=ha(n),i=ha(t),r=e.getTime()-Xi(e),a=i.getTime()-Xi(i);return Math.round((r-a)/zm)}var $m=6e4;function Vm(n,t){L(2,arguments);var e=ht(t);return Xn(n,e*$m)}function jm(n,t){L(2,arguments);var e=ht(t),i=e*3;return da(n,i)}function qm(n,t){L(2,arguments);var e=ht(t);return Xn(n,e*1e3)}function Xm(n,t){L(2,arguments);var e=ht(t),i=e*7;return xc(n,i)}function Gm(n,t){L(2,arguments);var e=ht(t);return da(n,e*12)}function Gn(n,t){L(2,arguments);var e=Y(n),i=Y(t),r=e.getTime()-i.getTime();return r<0?-1:r>0?1:r}var Gi=6e4,Kn=36e5,Km=1e3,Zm=3600;function Qm(n){return L(1,arguments),n instanceof Date||fe(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function fa(n){if(L(1,arguments),!Qm(n)&&typeof n!="number")return!1;var t=Y(n);return!isNaN(Number(t))}function Jm(n,t){L(2,arguments);var e=Y(n),i=Y(t),r=e.getFullYear()-i.getFullYear(),a=e.getMonth()-i.getMonth();return r*12+a}function t0(n,t){L(2,arguments);var e=Y(n),i=Y(t);return e.getFullYear()-i.getFullYear()}function _c(n,t){var 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 Dc(n,t){L(2,arguments);var e=Y(n),i=Y(t),r=_c(e,i),a=Math.abs(Hm(e,i));e.setDate(e.getDate()-r*a);var s=+(_c(e,i)===-r),o=r*(a-s);return o===0?0:o}function Ki(n,t){return L(2,arguments),Y(n).getTime()-Y(t).getTime()}var Tc={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},e0="trunc";function Zn(n){return n?Tc[n]:Tc[e0]}function n0(n,t,e){L(2,arguments);var i=Ki(n,t)/Kn;return Zn(e==null?void 0:e.roundingMethod)(i)}function i0(n,t,e){L(2,arguments);var i=Ki(n,t)/Gi;return Zn(e==null?void 0:e.roundingMethod)(i)}function Mc(n){L(1,arguments);var t=Y(n);return t.setHours(23,59,59,999),t}function Sc(n){L(1,arguments);var t=Y(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function r0(n){L(1,arguments);var t=Y(n);return Mc(t).getTime()===Sc(t).getTime()}function kc(n,t){L(2,arguments);var e=Y(n),i=Y(t),r=Gn(e,i),a=Math.abs(Jm(e,i)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-r*a);var o=Gn(e,i)===-r;r0(Y(n))&&a===1&&Gn(n,i)===1&&(o=!1),s=r*(a-Number(o))}return s===0?0:s}function a0(n,t,e){L(2,arguments);var i=kc(n,t)/3;return Zn(e==null?void 0:e.roundingMethod)(i)}function s0(n,t,e){L(2,arguments);var i=Ki(n,t)/1e3;return Zn(e==null?void 0:e.roundingMethod)(i)}function o0(n,t,e){L(2,arguments);var i=Dc(n,t)/7;return Zn(e==null?void 0:e.roundingMethod)(i)}function l0(n,t){L(2,arguments);var e=Y(n),i=Y(t),r=Gn(e,i),a=Math.abs(t0(e,i));e.setFullYear(1584),i.setFullYear(1584);var s=Gn(e,i)===-r,o=r*(a-Number(s));return o===0?0:o}function c0(n){L(1,arguments);var t=Y(n);return t.setSeconds(0,0),t}function u0(n){L(1,arguments);var t=Y(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function d0(n){L(1,arguments);var t=Y(n);return t.setDate(1),t.setHours(0,0,0,0),t}function h0(n){L(1,arguments);var t=Y(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function f0(n){L(1,arguments);var t=Y(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function g0(n){L(1,arguments);var t=Y(n);return t.setMinutes(59,59,999),t}function p0(n,t){var e,i,r,a,s,o,l,c;L(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Y(n),f=h.getDay(),p=(f<d?-7:0)+6-(f-d);return h.setDate(h.getDate()+p),h.setHours(23,59,59,999),h}function m0(n){L(1,arguments);var t=Y(n);return t.setSeconds(59,999),t}function b0(n){L(1,arguments);var t=Y(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function y0(n){L(1,arguments);var t=Y(n);return t.setMilliseconds(999),t}function Cc(n,t){L(2,arguments);var e=ht(t);return Xn(n,-e)}var v0=864e5;function x0(n){L(1,arguments);var t=Y(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=e-i;return Math.floor(r/v0)+1}function sn(n){L(1,arguments);var t=1,e=Y(n),i=e.getUTCDay(),r=(i<t?7:0)+i-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function Pc(n){L(1,arguments);var t=Y(n),e=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(e+1,0,4),i.setUTCHours(0,0,0,0);var r=sn(i),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=sn(a);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function w0(n){L(1,arguments);var t=Pc(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var i=sn(e);return i}var _0=6048e5;function Oc(n){L(1,arguments);var t=Y(n),e=sn(t).getTime()-w0(t).getTime();return Math.round(e/_0)+1}function Ve(n,t){var e,i,r,a,s,o,l,c;L(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Y(n),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function ga(n,t){var e,i,r,a,s,o,l,c;L(1,arguments);var u=Y(n),d=u.getUTCFullYear(),h=Ce(),f=ht((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:h.firstWeekContainsDate)!==null&&i!==void 0?i:(l=h.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var y=Ve(p,t),b=new Date(0);b.setUTCFullYear(d,0,f),b.setUTCHours(0,0,0,0);var m=Ve(b,t);return u.getTime()>=y.getTime()?d+1:u.getTime()>=m.getTime()?d:d-1}function D0(n,t){var e,i,r,a,s,o,l,c;L(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1),h=ga(n,t),f=new Date(0);f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0);var p=Ve(f,t);return p}var T0=6048e5;function Ec(n,t){L(1,arguments);var e=Y(n),i=Ve(e,t).getTime()-D0(e,t).getTime();return Math.round(i/T0)+1}function st(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}var M0={y:function(t,e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return st(e==="yy"?r%100:r,e.length)},M:function(t,e){var i=t.getUTCMonth();return e==="M"?String(i+1):st(i+1,2)},d:function(t,e){return st(t.getUTCDate(),e.length)},a:function(t,e){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h:function(t,e){return st(t.getUTCHours()%12||12,e.length)},H:function(t,e){return st(t.getUTCHours(),e.length)},m:function(t,e){return st(t.getUTCMinutes(),e.length)},s:function(t,e){return st(t.getUTCSeconds(),e.length)},S:function(t,e){var i=e.length,r=t.getUTCMilliseconds(),a=Math.floor(r*Math.pow(10,i-3));return st(a,e.length)}};const Pe=M0;var on={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},S0={G:function(t,e,i){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(r,{width:"abbreviated"});case"GGGGG":return i.era(r,{width:"narrow"});case"GGGG":default:return i.era(r,{width:"wide"})}},y:function(t,e,i){if(e==="yo"){var r=t.getUTCFullYear(),a=r>0?r:1-r;return i.ordinalNumber(a,{unit:"year"})}return Pe.y(t,e)},Y:function(t,e,i,r){var a=ga(t,r),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return st(o,2)}return e==="Yo"?i.ordinalNumber(s,{unit:"year"}):st(s,e.length)},R:function(t,e){var i=Pc(t);return st(i,e.length)},u:function(t,e){var i=t.getUTCFullYear();return st(i,e.length)},Q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return st(r,2);case"Qo":return i.ordinalNumber(r,{unit:"quarter"});case"QQQ":return i.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return st(r,2);case"qo":return i.ordinalNumber(r,{unit:"quarter"});case"qqq":return i.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,i){var r=t.getUTCMonth();switch(e){case"M":case"MM":return Pe.M(t,e);case"Mo":return i.ordinalNumber(r+1,{unit:"month"});case"MMM":return i.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,i){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return st(r+1,2);case"Lo":return i.ordinalNumber(r+1,{unit:"month"});case"LLL":return i.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,i,r){var a=Ec(t,r);return e==="wo"?i.ordinalNumber(a,{unit:"week"}):st(a,e.length)},I:function(t,e,i){var r=Oc(t);return e==="Io"?i.ordinalNumber(r,{unit:"week"}):st(r,e.length)},d:function(t,e,i){return e==="do"?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):Pe.d(t,e)},D:function(t,e,i){var r=x0(t);return e==="Do"?i.ordinalNumber(r,{unit:"dayOfYear"}):st(r,e.length)},E:function(t,e,i){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(r,{width:"short",context:"formatting"});case"EEEE":default:return i.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return st(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return st(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var r=t.getUTCDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return st(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(r,{width:"short",context:"formatting"});case"iiii":default:return i.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,i){var r=t.getUTCHours(),a=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){var r=t.getUTCHours(),a;switch(r===12?a=on.noon:r===0?a=on.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,i){var r=t.getUTCHours(),a;switch(r>=17?a=on.evening:r>=12?a=on.afternoon:r>=4?a=on.morning:a=on.night,e){case"B":case"BB":case"BBB":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,i){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),i.ordinalNumber(r,{unit:"hour"})}return Pe.h(t,e)},H:function(t,e,i){return e==="Ho"?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Pe.H(t,e)},K:function(t,e,i){var r=t.getUTCHours()%12;return e==="Ko"?i.ordinalNumber(r,{unit:"hour"}):st(r,e.length)},k:function(t,e,i){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?i.ordinalNumber(r,{unit:"hour"}):st(r,e.length)},m:function(t,e,i){return e==="mo"?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Pe.m(t,e)},s:function(t,e,i){return e==="so"?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Pe.s(t,e)},S:function(t,e){return Pe.S(t,e)},X:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Rc(s);case"XXXX":case"XX":return je(s);case"XXXXX":case"XXX":default:return je(s,":")}},x:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Rc(s);case"xxxx":case"xx":return je(s);case"xxxxx":case"xxx":default:return je(s,":")}},O:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ac(s,":");case"OOOO":default:return"GMT"+je(s,":")}},z:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ac(s,":");case"zzzz":default:return"GMT"+je(s,":")}},t:function(t,e,i,r){var a=r._originalDate||t,s=Math.floor(a.getTime()/1e3);return st(s,e.length)},T:function(t,e,i,r){var a=r._originalDate||t,s=a.getTime();return st(s,e.length)}};function Ac(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+st(a,2)}function Rc(n,t){if(n%60===0){var e=n>0?"-":"+";return e+st(Math.abs(n)/60,2)}return je(n,t)}function je(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=st(Math.floor(r/60),2),s=st(r%60,2);return i+a+e+s}const k0=S0;var Lc=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ic=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},C0=function(t,e){var i=t.match(/(P+)(p+)?/)||[],r=i[1],a=i[2];if(!a)return Lc(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Lc(r,e)).replace("{{time}}",Ic(a,e))},P0={p:Ic,P:C0};const pa=P0;var O0=["D","DD"],E0=["YY","YYYY"];function Nc(n){return O0.indexOf(n)!==-1}function Fc(n){return E0.indexOf(n)!==-1}function Zi(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var A0={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"}},R0=function(t,e,i){var r,a=A0[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r};const L0=R0;function ma(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,i=n.formats[e]||n.formats[n.defaultWidth];return i}}var I0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},N0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},F0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Y0={date:ma({formats:I0,defaultWidth:"full"}),time:ma({formats:N0,defaultWidth:"full"}),dateTime:ma({formats:F0,defaultWidth:"full"})};const W0=Y0;var U0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},B0=function(t,e,i,r){return U0[t]};const z0=B0;function Qn(n){return function(t,e){var i=e!=null&&e.context?String(e.context):"standalone",r;if(i==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;r=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return r[c]}}var H0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},V0={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"]},j0={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"]},q0={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"}},X0={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"}},G0=function(t,e){var i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},K0={ordinalNumber:G0,era:Qn({values:H0,defaultWidth:"wide"}),quarter:Qn({values:$0,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Qn({values:V0,defaultWidth:"wide"}),day:Qn({values:j0,defaultWidth:"wide"}),dayPeriod:Qn({values:q0,defaultWidth:"wide",formattingValues:X0,defaultFormattingWidth:"wide"})};const Z0=K0;function Jn(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],a=t.match(r);if(!a)return null;var s=a[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?J0(o,function(d){return d.test(s)}):Q0(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function Q0(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function J0(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function tb(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(n.matchPattern);if(!i)return null;var r=i[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(r.length);return{value:s,rest:o}}}var eb=/^(\d+)(th|st|nd|rd)?/i,nb=/\d+/i,ib={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},rb={any:[/^b/i,/^(a|c)/i]},ab={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sb={any:[/1/i,/2/i,/3/i,/4/i]},ob={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},lb={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]},cb={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},ub={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]},db={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hb={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fb={ordinalNumber:tb({matchPattern:eb,parsePattern:nb,valueCallback:function(t){return parseInt(t,10)}}),era:Jn({matchPatterns:ib,defaultMatchWidth:"wide",parsePatterns:rb,defaultParseWidth:"any"}),quarter:Jn({matchPatterns:ab,defaultMatchWidth:"wide",parsePatterns:sb,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:Jn({matchPatterns:ob,defaultMatchWidth:"wide",parsePatterns:lb,defaultParseWidth:"any"}),day:Jn({matchPatterns:cb,defaultMatchWidth:"wide",parsePatterns:ub,defaultParseWidth:"any"}),dayPeriod:Jn({matchPatterns:db,defaultMatchWidth:"any",parsePatterns:hb,defaultParseWidth:"any"})},gb={code:"en-US",formatDistance:L0,formatLong:W0,formatRelative:z0,localize:Z0,match:fb,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Yc=gb;var pb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bb=/^'([^]*?)'?$/,yb=/''/g,vb=/[a-zA-Z]/;function xb(n,t,e){var i,r,a,s,o,l,c,u,d,h,f,p,y,b,m,v,x,w;L(2,arguments);var _=String(t),D=Ce(),T=(i=(r=e==null?void 0:e.locale)!==null&&r!==void 0?r:D.locale)!==null&&i!==void 0?i:Yc,S=ht((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:D.firstWeekContainsDate)!==null&&s!==void 0?s:(d=D.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=ht((f=(p=(y=(b=e==null?void 0:e.weekStartsOn)!==null&&b!==void 0?b:e==null||(m=e.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&y!==void 0?y:D.weekStartsOn)!==null&&p!==void 0?p:(x=D.locale)===null||x===void 0||(w=x.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&f!==void 0?f:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var O=Y(n);if(!fa(O))throw new RangeError("Invalid time value");var A=Xi(O),R=Cc(O,A),H={firstWeekContainsDate:S,weekStartsOn:M,locale:T,_originalDate:O},ft=_.match(mb).map(function(N){var B=N[0];if(B==="p"||B==="P"){var Z=pa[B];return Z(N,T.formatLong)}return N}).join("").match(pb).map(function(N){if(N==="''")return"'";var B=N[0];if(B==="'")return wb(N);var Z=k0[B];if(Z)return!(e!=null&&e.useAdditionalWeekYearTokens)&&Fc(N)&&Zi(N,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&Nc(N)&&Zi(N,t,String(n)),Z(R,N,T.localize,H);if(B.match(vb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");return N}).join("");return ft}function wb(n){var t=n.match(bb);return t?t[1].replace(yb,"'"):n}function _b(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Wc(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function Db(n,t){if(n){if(typeof n=="string")return Wc(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Wc(n,t)}}function Uc(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=Db(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function E(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ba(n,t){return ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},ba(n,t)}function Q(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&ba(n,t)}function Qi(n){return Qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qi(n)}function Tb(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Mb(n,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return E(n)}function J(n){var t=Tb();return function(){var i=Qi(n),r;if(t){var a=Qi(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return Mb(this,r)}}function G(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Sb(n,t){if(fe(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(fe(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Bc(n){var t=Sb(n,"string");return fe(t)==="symbol"?t:String(t)}function zc(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,Bc(i.key),i)}}function K(n,t,e){return t&&zc(n.prototype,t),e&&zc(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function P(n,t,e){return t=Bc(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var kb=10,Hc=function(){function n(){G(this,n),P(this,"priority",void 0),P(this,"subPriority",0)}return K(n,[{key:"validate",value:function(e,i){return!0}}]),n}(),Cb=function(n){Q(e,n);var t=J(e);function e(i,r,a,s,o){var l;return G(this,e),l=t.call(this),l.value=i,l.validateValue=r,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return K(e,[{key:"validate",value:function(r,a){return this.validateValue(r,this.value,a)}},{key:"set",value:function(r,a,s){return this.setValue(r,a,this.value,s)}}]),e}(Hc),Pb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",kb),P(E(i),"subPriority",-1),i}return K(e,[{key:"set",value:function(r,a){if(a.timestampIsSet)return r;var s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}}]),e}(Hc),nt=function(){function n(){G(this,n),P(this,"incompatibleTokens",void 0),P(this,"priority",void 0),P(this,"subPriority",void 0)}return K(n,[{key:"run",value:function(e,i,r,a){var s=this.parse(e,i,r,a);return s?{setter:new Cb(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,i,r){return!0}}]),n}(),Ob=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",140),P(E(i),"incompatibleTokens",["R","u","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}},{key:"set",value:function(r,a,s){return a.era=s,r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Tt={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}/},ee={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 Mt(n,t){return n&&{value:t(n.value),rest:n.rest}}function yt(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function ne(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:i*(r*Kn+a*Gi+s*Km),rest:t.slice(e[0].length)}}function $c(n){return yt(Tt.anyDigitsSigned,n)}function _t(n,t){switch(n){case 1:return yt(Tt.singleDigit,t);case 2:return yt(Tt.twoDigits,t);case 3:return yt(Tt.threeDigits,t);case 4:return yt(Tt.fourDigits,t);default:return yt(new RegExp("^\\d{1,"+n+"}"),t)}}function Ji(n,t){switch(n){case 1:return yt(Tt.singleDigitSigned,t);case 2:return yt(Tt.twoDigitsSigned,t);case 3:return yt(Tt.threeDigitsSigned,t);case 4:return yt(Tt.fourDigitsSigned,t);default:return yt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function ya(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 Vc(n,t){var e=t>0,i=e?t:1-t,r;if(i<=50)r=n||100;else{var a=i+50,s=Math.floor(a/100)*100,o=n>=a%100;r=n+s-(o?100:0)}return e?r:1-r}function jc(n){return n%400===0||n%4===0&&n%100!==0}var Eb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",130),P(E(i),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Mt(_t(4,r),o);case"yo":return Mt(s.ordinalNumber(r,{unit:"year"}),o);default:return Mt(_t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s){var o=r.getUTCFullYear();if(s.isTwoDigitYear){var l=Vc(s.year,o);return r.setUTCFullYear(l,0,1),r.setUTCHours(0,0,0,0),r}var c=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(c,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Ab=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",130),P(E(i),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Mt(_t(4,r),o);case"Yo":return Mt(s.ordinalNumber(r,{unit:"year"}),o);default:return Mt(_t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s,o){var l=ga(r,o);if(s.isTwoDigitYear){var c=Vc(s.year,l);return r.setUTCFullYear(c,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),Ve(r,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(u,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),Ve(r,o)}}]),e}(nt),Rb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",130),P(E(i),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a){return Ji(a==="R"?4:a.length,r)}},{key:"set",value:function(r,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),sn(o)}}]),e}(nt),Lb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",130),P(E(i),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a){return Ji(a==="u"?4:a.length,r)}},{key:"set",value:function(r,a,s){return r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Ib=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",120),P(E(i),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"Q":case"QQ":return _t(a.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Nb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",120),P(E(i),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"q":case"qq":return _t(a.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Fb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),P(E(i),"priority",110),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"M":return Mt(yt(Tt.month,r),o);case"MM":return Mt(_t(2,r),o);case"Mo":return Mt(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Yb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",110),P(E(i),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"L":return Mt(yt(Tt.month,r),o);case"LL":return Mt(_t(2,r),o);case"Lo":return Mt(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt);function Wb(n,t,e){L(2,arguments);var i=Y(n),r=ht(t),a=Ec(i,e)-r;return i.setUTCDate(i.getUTCDate()-a*7),i}var Ub=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",100),P(E(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"w":return yt(Tt.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s,o){return Ve(Wb(r,s,o),o)}}]),e}(nt);function Bb(n,t){L(2,arguments);var e=Y(n),i=ht(t),r=Oc(e)-i;return e.setUTCDate(e.getUTCDate()-r*7),e}var zb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",100),P(E(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"I":return yt(Tt.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s){return sn(Bb(r,s))}}]),e}(nt),Hb=[31,28,31,30,31,30,31,31,30,31,30,31],$b=[31,29,31,30,31,30,31,31,30,31,30,31],Vb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",90),P(E(i),"subPriority",1),P(E(i),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"d":return yt(Tt.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=jc(s),l=r.getUTCMonth();return o?a>=1&&a<=$b[l]:a>=1&&a<=Hb[l]}},{key:"set",value:function(r,a,s){return r.setUTCDate(s),r.setUTCHours(0,0,0,0),r}}]),e}(nt),jb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",90),P(E(i),"subpriority",1),P(E(i),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"D":case"DD":return yt(Tt.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=jc(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(r,a,s){return r.setUTCMonth(0,s),r.setUTCHours(0,0,0,0),r}}]),e}(nt);function va(n,t,e){var i,r,a,s,o,l,c,u;L(2,arguments);var d=Ce(),h=ht((i=(r=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Y(n),p=ht(t),y=f.getUTCDay(),b=p%7,m=(b+7)%7,v=(m<h?7:0)+p-y;return f.setUTCDate(f.getUTCDate()+v),f}var qb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",90),P(E(i),"incompatibleTokens",["D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=va(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Xb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",90),P(E(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Mt(_t(a.length,r),l);case"eo":return Mt(s.ordinalNumber(r,{unit:"day"}),l);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=va(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Gb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",90),P(E(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Mt(_t(a.length,r),l);case"co":return Mt(s.ordinalNumber(r,{unit:"day"}),l);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=va(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(nt);function Kb(n,t){L(2,arguments);var e=ht(t);e%7===0&&(e=e-7);var i=1,r=Y(n),a=r.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<i?7:0)+e-a;return r.setUTCDate(r.getUTCDate()+l),r}var Zb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",90),P(E(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return _t(a.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return Mt(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return Mt(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Mt(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Mt(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(r,a){return a>=1&&a<=7}},{key:"set",value:function(r,a,s){return r=Kb(r,s),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Qb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",80),P(E(i),"incompatibleTokens",["b","B","H","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(ya(s),0,0,0),r}}]),e}(nt),Jb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",80),P(E(i),"incompatibleTokens",["a","B","H","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(ya(s),0,0,0),r}}]),e}(nt),ty=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",80),P(E(i),"incompatibleTokens",["a","b","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(ya(s),0,0,0),r}}]),e}(nt),ey=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",70),P(E(i),"incompatibleTokens",["H","K","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"h":return yt(Tt.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=12}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):!o&&s===12?r.setUTCHours(0,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(nt),ny=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",70),P(E(i),"incompatibleTokens",["a","b","h","K","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"H":return yt(Tt.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=23}},{key:"set",value:function(r,a,s){return r.setUTCHours(s,0,0,0),r}}]),e}(nt),iy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",70),P(E(i),"incompatibleTokens",["h","H","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"K":return yt(Tt.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(nt),ry=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",70),P(E(i),"incompatibleTokens",["a","b","h","H","K","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"k":return yt(Tt.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=24}},{key:"set",value:function(r,a,s){var o=s<=24?s%24:s;return r.setUTCHours(o,0,0,0),r}}]),e}(nt),ay=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",60),P(E(i),"incompatibleTokens",["t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"m":return yt(Tt.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCMinutes(s,0,0),r}}]),e}(nt),sy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",50),P(E(i),"incompatibleTokens",["t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"s":return yt(Tt.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCSeconds(s,0),r}}]),e}(nt),oy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",30),P(E(i),"incompatibleTokens",["t","T"]),i}return K(e,[{key:"parse",value:function(r,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Mt(_t(a.length,r),s)}},{key:"set",value:function(r,a,s){return r.setUTCMilliseconds(s),r}}]),e}(nt),ly=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",10),P(E(i),"incompatibleTokens",["t","T","x"]),i}return K(e,[{key:"parse",value:function(r,a){switch(a){case"X":return ne(ee.basicOptionalMinutes,r);case"XX":return ne(ee.basic,r);case"XXXX":return ne(ee.basicOptionalSeconds,r);case"XXXXX":return ne(ee.extendedOptionalSeconds,r);case"XXX":default:return ne(ee.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(nt),cy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",10),P(E(i),"incompatibleTokens",["t","T","X"]),i}return K(e,[{key:"parse",value:function(r,a){switch(a){case"x":return ne(ee.basicOptionalMinutes,r);case"xx":return ne(ee.basic,r);case"xxxx":return ne(ee.basicOptionalSeconds,r);case"xxxxx":return ne(ee.extendedOptionalSeconds,r);case"xxx":default:return ne(ee.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(nt),uy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",40),P(E(i),"incompatibleTokens","*"),i}return K(e,[{key:"parse",value:function(r){return $c(r)}},{key:"set",value:function(r,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(nt),dy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),P(E(i),"priority",20),P(E(i),"incompatibleTokens","*"),i}return K(e,[{key:"parse",value:function(r){return $c(r)}},{key:"set",value:function(r,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(nt),hy={G:new Ob,y:new Eb,Y:new Ab,R:new Rb,u:new Lb,Q:new Ib,q:new Nb,M:new Fb,L:new Yb,w:new Ub,I:new zb,d:new Vb,D:new jb,E:new qb,e:new Xb,c:new Gb,i:new Zb,a:new Qb,b:new Jb,B:new ty,h:new ey,H:new ny,K:new iy,k:new ry,m:new ay,s:new sy,S:new oy,X:new ly,x:new cy,t:new uy,T:new dy},fy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,py=/^'([^]*?)'?$/,my=/''/g,by=/\S/,yy=/[a-zA-Z]/;function vy(n,t,e,i){var r,a,s,o,l,c,u,d,h,f,p,y,b,m,v,x,w,_;L(3,arguments);var D=String(n),T=String(t),S=Ce(),M=(r=(a=i==null?void 0:i.locale)!==null&&a!==void 0?a:S.locale)!==null&&r!==void 0?r:Yc;if(!M.match)throw new RangeError("locale must contain match property");var O=ht((s=(o=(l=(c=i==null?void 0:i.firstWeekContainsDate)!==null&&c!==void 0?c:i==null||(u=i.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:S.firstWeekContainsDate)!==null&&o!==void 0?o:(h=S.locale)===null||h===void 0||(f=h.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var A=ht((p=(y=(b=(m=i==null?void 0:i.weekStartsOn)!==null&&m!==void 0?m:i==null||(v=i.locale)===null||v===void 0||(x=v.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&b!==void 0?b:S.weekStartsOn)!==null&&y!==void 0?y:(w=S.locale)===null||w===void 0||(_=w.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&p!==void 0?p:0);if(!(A>=0&&A<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(T==="")return D===""?Y(e):new Date(NaN);var R={firstWeekContainsDate:O,weekStartsOn:A,locale:M},H=[new Pb],ft=T.match(gy).map(function(lt){var et=lt[0];if(et in pa){var It=pa[et];return It(lt,M.formatLong)}return lt}).join("").match(fy),N=[],B=Uc(ft),Z;try{var Ct=function(){var et=Z.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&Fc(et)&&Zi(et,T,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Nc(et)&&Zi(et,T,n);var It=et[0],pe=hy[It];if(pe){var pr=pe.incompatibleTokens;if(Array.isArray(pr)){var mr=N.find(function(br){return pr.includes(br.token)||br.token===It});if(mr)throw new RangeError("The format string mustn't contain `".concat(mr.fullToken,"` and `").concat(et,"` at the same time"))}else if(pe.incompatibleTokens==="*"&&N.length>0)throw new RangeError("The format string mustn't contain `".concat(et,"` and any other token at the same time"));N.push({token:It,fullToken:et});var hi=pe.run(D,et,M.match,R);if(!hi)return{v:new Date(NaN)};H.push(hi.setter),D=hi.rest}else{if(It.match(yy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+It+"`");if(et==="''"?et="'":It==="'"&&(et=xy(et)),D.indexOf(et)===0)D=D.slice(et.length);else return{v:new Date(NaN)}}};for(B.s();!(Z=B.n()).done;){var C=Ct();if(fe(C)==="object")return C.v}}catch(lt){B.e(lt)}finally{B.f()}if(D.length>0&&by.test(D))return new Date(NaN);var I=H.map(function(lt){return lt.priority}).sort(function(lt,et){return et-lt}).filter(function(lt,et,It){return It.indexOf(lt)===et}).map(function(lt){return H.filter(function(et){return et.priority===lt}).sort(function(et,It){return It.subPriority-et.subPriority})}).map(function(lt){return lt[0]}),F=Y(e);if(isNaN(F.getTime()))return new Date(NaN);var V=Cc(F,Xi(F)),j={},q=Uc(I),mt;try{for(q.s();!(mt=q.n()).done;){var gt=mt.value;if(!gt.validate(V,R))return new Date(NaN);var it=gt.set(V,j,R);Array.isArray(it)?(V=it[0],_b(j,it[1])):V=it}}catch(lt){q.e(lt)}finally{q.f()}return V}function xy(n){return n.match(py)[1].replace(my,"'")}function wy(n){L(1,arguments);var t=Y(n);return t.setMinutes(0,0,0),t}function _y(n){L(1,arguments);var t=Y(n);return t.setMilliseconds(0),t}function Dy(n){L(1,arguments);var t=n/Kn;return Math.floor(t)}function qc(n,t){var e;L(1,arguments);var i=ht((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=ky(n),a;if(r.date){var s=Cy(r.date,i);a=Py(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(r.time&&(l=Oy(r.time),isNaN(l)))return new Date(NaN);if(r.timezone){if(c=Ey(r.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ty=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,My=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Sy=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ky(n){var t={},e=n.split(tr.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],tr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(tr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var r=tr.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function Cy(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,a=i[2]?parseInt(i[2]):null;return{year:a===null?r:a*100,restDateString:n.slice((i[1]||i[2]).length)}}function Py(n,t){if(t===null)return new Date(NaN);var e=n.match(Ty);if(!e)return new Date(NaN);var i=!!e[4],r=ti(e[1]),a=ti(e[2])-1,s=ti(e[3]),o=ti(e[4]),l=ti(e[5])-1;if(i)return Ny(t,o,l)?Ay(t,o,l):new Date(NaN);var c=new Date(0);return!Ly(t,a,s)||!Iy(t,r)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(r,s)),c)}function ti(n){return n?parseInt(n):1}function Oy(n){var t=n.match(My);if(!t)return NaN;var e=xa(t[1]),i=xa(t[2]),r=xa(t[3]);return Fy(e,i,r)?e*Kn+i*Gi+r*1e3:NaN}function xa(n){return n&&parseFloat(n.replace(",","."))||0}function Ey(n){if(n==="Z")return 0;var t=n.match(Sy);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Yy(i,r)?e*(i*Kn+r*Gi):NaN}function Ay(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Ry=[31,null,31,30,31,30,31,31,30,31,30,31];function Xc(n){return n%400===0||n%4===0&&n%100!==0}function Ly(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Ry[t]||(Xc(n)?29:28))}function Iy(n,t){return t>=1&&t<=(Xc(n)?366:365)}function Ny(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Fy(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Yy(n,t){return t>=0&&t<=59}function Wy(n){L(1,arguments);var t=n/Zm;return Math.floor(t)}var Et=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(Et||{}),er=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(er||{}),vt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(vt||{}),ln=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ln||{});const wa=(n,t)=>{var i,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}if(e.body&&!n.locked){const a=e.labelColors,s=((r=(i=t.chart.config)==null?void 0:i.options)==null?void 0:r.indexAxis)==="y"?"x":"y",o=[Et.HORIZONTAL_BAR,Et.VERTICAL_BAR].includes(n.chartType),l=[er.GAUGE,Et.DOUGHNUT].includes(n.chartType);n.tooltipContext=o?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[s];let h;n.units==="bytes"?h=isNaN(d)?d:ua(d):h=`${d%1===0?fs.format(d):fs.format(Number(d.toFixed(ix)))} ${n.units}`;const f=o&&c.dataset.label!==c.label?c.dataset.label:l?c.dataset.labels[c.dataIndex]:c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:f,value:h,rawValue:d}}).sort((c,u)=>u.rawValue-c.rawValue),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Uy=n=>n&&n.datasets&&n.datasets.length,By=n=>Uy(n)&&n.datasets.some(t=>t.data.length),zy=n=>By(n)&&n.datasets.some(t=>t.data.length>1),Hy=n=>zy(n)&&n.datasets.some(t=>t.data[0]&&fa(t.data[0].x)),$y=n=>Hy(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),_a=(n,t,e)=>{const r=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-r):n.x-t*s*(1-r)},Vy=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function ei(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Da={exports:{}},Gc={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Gc);var xt=Gc.exports,Ta={exports:{}},Ma={exports:{}},Kc={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Kc);var Zc=Kc.exports,Sa={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(r.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+r.length+" present")}n.exports=t.default})(Sa,Sa.exports);var Nt=Sa.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Zc),r=e(Nt);function a(s){return(0,r.default)(1,arguments),s instanceof Date||(0,i.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ma,Ma.exports);var jy=Ma.exports,ka={exports:{}};(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Zc),r=e(Nt);function a(s){(0,r.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,i.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n.exports=t.default})(ka,ka.exports);var ie=ka.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(jy),r=e(ie),a=e(Nt);function s(o){if((0,a.default)(1,arguments),!(0,i.default)(o)&&typeof o!="number")return!1;var l=(0,r.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Ta,Ta.exports);var qy=Ta.exports,Ca={exports:{}},Pa={exports:{}},Oa={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Oa,Oa.exports);var qe=Oa.exports;const Xy=ei(qe);(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(qe),r=e(ie),a=e(Nt);function s(o,l){(0,a.default)(2,arguments);var c=(0,r.default)(o).getTime(),u=(0,i.default)(l);return new Date(c+u)}n.exports=t.default})(Pa,Pa.exports);var Gy=Pa.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Gy),r=e(Nt),a=e(qe);function s(o,l){(0,r.default)(2,arguments);var c=(0,a.default)(l);return(0,i.default)(o,-c)}n.exports=t.default})(Ca,Ca.exports);var Ky=Ca.exports,Ea={exports:{}},Aa={exports:{}};(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(ie),r=e(Nt),a=864e5;function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Aa,Aa.exports);var Zy=Aa.exports,Ra={exports:{}},La={exports:{}};(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(ie),r=e(Nt);function a(s){(0,r.default)(1,arguments);var o=1,l=(0,i.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(La,La.exports);var Ia=La.exports,Na={exports:{}},Fa={exports:{}};(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(ie),r=e(Nt),a=e(Ia);function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),h=new Date(0);h.setUTCFullYear(c,0,4),h.setUTCHours(0,0,0,0);var f=(0,a.default)(h);return l.getTime()>=d.getTime()?c+1:l.getTime()>=f.getTime()?c:c-1}n.exports=t.default})(Fa,Fa.exports);var Qc=Fa.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Qc),r=e(Ia),a=e(Nt);function s(o){(0,a.default)(1,arguments);var l=(0,i.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,r.default)(c);return u}n.exports=t.default})(Na,Na.exports);var Qy=Na.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(ie),r=e(Ia),a=e(Qy),s=e(Nt),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,i.default)(c),d=(0,r.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})(Ra,Ra.exports);var Jy=Ra.exports,Ya={exports:{}},Wa={exports:{}},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.getDefaultOptions=tv,Xe.setDefaultOptions=ev;var Jc={};function tv(){return Jc}function ev(n){Jc=n}(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=e(ie),r=e(Nt),a=e(qe),s=Xe;function o(l,c){var u,d,h,f,p,y,b,m;(0,r.default)(1,arguments);var v=(0,s.getDefaultOptions)(),x=(0,a.default)((u=(d=(h=(f=c==null?void 0:c.weekStartsOn)!==null&&f!==void 0?f:c==null||(p=c.locale)===null||p===void 0||(y=p.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&h!==void 0?h:v.weekStartsOn)!==null&&d!==void 0?d:(b=v.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&u!==void 0?u:0);if(!(x>=0&&x<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,i.default)(l),_=w.getUTCDay(),D=(_<x?7:0)+_-x;return w.setUTCDate(w.getUTCDate()-D),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(Wa,Wa.exports);var Ua=Wa.exports,Ba={exports:{}},za={exports:{}};(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(ie),r=e(Nt),a=e(Ua),s=e(qe),o=Xe;function l(c,u){var d,h,f,p,y,b,m,v;(0,r.default)(1,arguments);var x=(0,i.default)(c),w=x.getUTCFullYear(),_=(0,o.getDefaultOptions)(),D=(0,s.default)((d=(h=(f=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(y=u.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&f!==void 0?f:_.firstWeekContainsDate)!==null&&h!==void 0?h:(m=_.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(D>=1&&D<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=new Date(0);T.setUTCFullYear(w+1,0,D),T.setUTCHours(0,0,0,0);var S=(0,a.default)(T,u),M=new Date(0);M.setUTCFullYear(w,0,D),M.setUTCHours(0,0,0,0);var O=(0,a.default)(M,u);return x.getTime()>=S.getTime()?w+1:x.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(za,za.exports);var tu=za.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(tu),r=e(Nt),a=e(Ua),s=e(qe),o=Xe;function l(c,u){var d,h,f,p,y,b,m,v;(0,r.default)(1,arguments);var x=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(h=(f=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(y=u.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&f!==void 0?f:x.firstWeekContainsDate)!==null&&h!==void 0?h:(m=x.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1),_=(0,i.default)(c,u),D=new Date(0);D.setUTCFullYear(_,0,w),D.setUTCHours(0,0,0,0);var T=(0,a.default)(D,u);return T}n.exports=t.default})(Ba,Ba.exports);var nv=Ba.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(ie),r=e(Ua),a=e(nv),s=e(Nt),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,i.default)(c),h=(0,r.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(h/o)+1}n.exports=t.default})(Ya,Ya.exports);var iv=Ya.exports,Ha={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){for(var a=i<0?"-":"",s=Math.abs(i).toString();s.length<r;)s="0"+s;return a+s}n.exports=t.default})(Ha,Ha.exports);var eu=Ha.exports,$a={exports:{}};(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(eu),r={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,i.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,i.default)(c+1,2)},d:function(o,l){return(0,i.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,i.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,i.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,i.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,i.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,i.default)(d,l.length)}},a=r;t.default=a,n.exports=t.default})($a,$a.exports);var rv=$a.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(Zy),r=e(Jy),a=e(Qc),s=e(iv),o=e(tu),l=e(eu),c=e(rv),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(m,v,x){var w=m.getUTCFullYear()>0?1:0;switch(v){case"G":case"GG":case"GGG":return x.era(w,{width:"abbreviated"});case"GGGGG":return x.era(w,{width:"narrow"});case"GGGG":default:return x.era(w,{width:"wide"})}},y:function(m,v,x){if(v==="yo"){var w=m.getUTCFullYear(),_=w>0?w:1-w;return x.ordinalNumber(_,{unit:"year"})}return c.default.y(m,v)},Y:function(m,v,x,w){var _=(0,o.default)(m,w),D=_>0?_:1-_;if(v==="YY"){var T=D%100;return(0,l.default)(T,2)}return v==="Yo"?x.ordinalNumber(D,{unit:"year"}):(0,l.default)(D,v.length)},R:function(m,v){var x=(0,a.default)(m);return(0,l.default)(x,v.length)},u:function(m,v){var x=m.getUTCFullYear();return(0,l.default)(x,v.length)},Q:function(m,v,x){var w=Math.ceil((m.getUTCMonth()+1)/3);switch(v){case"Q":return String(w);case"QQ":return(0,l.default)(w,2);case"Qo":return x.ordinalNumber(w,{unit:"quarter"});case"QQQ":return x.quarter(w,{width:"abbreviated",context:"formatting"});case"QQQQQ":return x.quarter(w,{width:"narrow",context:"formatting"});case"QQQQ":default:return x.quarter(w,{width:"wide",context:"formatting"})}},q:function(m,v,x){var w=Math.ceil((m.getUTCMonth()+1)/3);switch(v){case"q":return String(w);case"qq":return(0,l.default)(w,2);case"qo":return x.ordinalNumber(w,{unit:"quarter"});case"qqq":return x.quarter(w,{width:"abbreviated",context:"standalone"});case"qqqqq":return x.quarter(w,{width:"narrow",context:"standalone"});case"qqqq":default:return x.quarter(w,{width:"wide",context:"standalone"})}},M:function(m,v,x){var w=m.getUTCMonth();switch(v){case"M":case"MM":return c.default.M(m,v);case"Mo":return x.ordinalNumber(w+1,{unit:"month"});case"MMM":return x.month(w,{width:"abbreviated",context:"formatting"});case"MMMMM":return x.month(w,{width:"narrow",context:"formatting"});case"MMMM":default:return x.month(w,{width:"wide",context:"formatting"})}},L:function(m,v,x){var w=m.getUTCMonth();switch(v){case"L":return String(w+1);case"LL":return(0,l.default)(w+1,2);case"Lo":return x.ordinalNumber(w+1,{unit:"month"});case"LLL":return x.month(w,{width:"abbreviated",context:"standalone"});case"LLLLL":return x.month(w,{width:"narrow",context:"standalone"});case"LLLL":default:return x.month(w,{width:"wide",context:"standalone"})}},w:function(m,v,x,w){var _=(0,s.default)(m,w);return v==="wo"?x.ordinalNumber(_,{unit:"week"}):(0,l.default)(_,v.length)},I:function(m,v,x){var w=(0,r.default)(m);return v==="Io"?x.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,v.length)},d:function(m,v,x){return v==="do"?x.ordinalNumber(m.getUTCDate(),{unit:"date"}):c.default.d(m,v)},D:function(m,v,x){var w=(0,i.default)(m);return v==="Do"?x.ordinalNumber(w,{unit:"dayOfYear"}):(0,l.default)(w,v.length)},E:function(m,v,x){var w=m.getUTCDay();switch(v){case"E":case"EE":case"EEE":return x.day(w,{width:"abbreviated",context:"formatting"});case"EEEEE":return x.day(w,{width:"narrow",context:"formatting"});case"EEEEEE":return x.day(w,{width:"short",context:"formatting"});case"EEEE":default:return x.day(w,{width:"wide",context:"formatting"})}},e:function(m,v,x,w){var _=m.getUTCDay(),D=(_-w.weekStartsOn+8)%7||7;switch(v){case"e":return String(D);case"ee":return(0,l.default)(D,2);case"eo":return x.ordinalNumber(D,{unit:"day"});case"eee":return x.day(_,{width:"abbreviated",context:"formatting"});case"eeeee":return x.day(_,{width:"narrow",context:"formatting"});case"eeeeee":return x.day(_,{width:"short",context:"formatting"});case"eeee":default:return x.day(_,{width:"wide",context:"formatting"})}},c:function(m,v,x,w){var _=m.getUTCDay(),D=(_-w.weekStartsOn+8)%7||7;switch(v){case"c":return String(D);case"cc":return(0,l.default)(D,v.length);case"co":return x.ordinalNumber(D,{unit:"day"});case"ccc":return x.day(_,{width:"abbreviated",context:"standalone"});case"ccccc":return x.day(_,{width:"narrow",context:"standalone"});case"cccccc":return x.day(_,{width:"short",context:"standalone"});case"cccc":default:return x.day(_,{width:"wide",context:"standalone"})}},i:function(m,v,x){var w=m.getUTCDay(),_=w===0?7:w;switch(v){case"i":return String(_);case"ii":return(0,l.default)(_,v.length);case"io":return x.ordinalNumber(_,{unit:"day"});case"iii":return x.day(w,{width:"abbreviated",context:"formatting"});case"iiiii":return x.day(w,{width:"narrow",context:"formatting"});case"iiiiii":return x.day(w,{width:"short",context:"formatting"});case"iiii":default:return x.day(w,{width:"wide",context:"formatting"})}},a:function(m,v,x){var w=m.getUTCHours(),_=w/12>=1?"pm":"am";switch(v){case"a":case"aa":return x.dayPeriod(_,{width:"abbreviated",context:"formatting"});case"aaa":return x.dayPeriod(_,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return x.dayPeriod(_,{width:"narrow",context:"formatting"});case"aaaa":default:return x.dayPeriod(_,{width:"wide",context:"formatting"})}},b:function(m,v,x){var w=m.getUTCHours(),_;switch(w===12?_=u.noon:w===0?_=u.midnight:_=w/12>=1?"pm":"am",v){case"b":case"bb":return x.dayPeriod(_,{width:"abbreviated",context:"formatting"});case"bbb":return x.dayPeriod(_,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return x.dayPeriod(_,{width:"narrow",context:"formatting"});case"bbbb":default:return x.dayPeriod(_,{width:"wide",context:"formatting"})}},B:function(m,v,x){var w=m.getUTCHours(),_;switch(w>=17?_=u.evening:w>=12?_=u.afternoon:w>=4?_=u.morning:_=u.night,v){case"B":case"BB":case"BBB":return x.dayPeriod(_,{width:"abbreviated",context:"formatting"});case"BBBBB":return x.dayPeriod(_,{width:"narrow",context:"formatting"});case"BBBB":default:return x.dayPeriod(_,{width:"wide",context:"formatting"})}},h:function(m,v,x){if(v==="ho"){var w=m.getUTCHours()%12;return w===0&&(w=12),x.ordinalNumber(w,{unit:"hour"})}return c.default.h(m,v)},H:function(m,v,x){return v==="Ho"?x.ordinalNumber(m.getUTCHours(),{unit:"hour"}):c.default.H(m,v)},K:function(m,v,x){var w=m.getUTCHours()%12;return v==="Ko"?x.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,v.length)},k:function(m,v,x){var w=m.getUTCHours();return w===0&&(w=24),v==="ko"?x.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,v.length)},m:function(m,v,x){return v==="mo"?x.ordinalNumber(m.getUTCMinutes(),{unit:"minute"}):c.default.m(m,v)},s:function(m,v,x){return v==="so"?x.ordinalNumber(m.getUTCSeconds(),{unit:"second"}):c.default.s(m,v)},S:function(m,v){return c.default.S(m,v)},X:function(m,v,x,w){var _=w._originalDate||m,D=_.getTimezoneOffset();if(D===0)return"Z";switch(v){case"X":return f(D);case"XXXX":case"XX":return p(D);case"XXXXX":case"XXX":default:return p(D,":")}},x:function(m,v,x,w){var _=w._originalDate||m,D=_.getTimezoneOffset();switch(v){case"x":return f(D);case"xxxx":case"xx":return p(D);case"xxxxx":case"xxx":default:return p(D,":")}},O:function(m,v,x,w){var _=w._originalDate||m,D=_.getTimezoneOffset();switch(v){case"O":case"OO":case"OOO":return"GMT"+h(D,":");case"OOOO":default:return"GMT"+p(D,":")}},z:function(m,v,x,w){var _=w._originalDate||m,D=_.getTimezoneOffset();switch(v){case"z":case"zz":case"zzz":return"GMT"+h(D,":");case"zzzz":default:return"GMT"+p(D,":")}},t:function(m,v,x,w){var _=w._originalDate||m,D=Math.floor(_.getTime()/1e3);return(0,l.default)(D,v.length)},T:function(m,v,x,w){var _=w._originalDate||m,D=_.getTime();return(0,l.default)(D,v.length)}};function h(b,m){var v=b>0?"-":"+",x=Math.abs(b),w=Math.floor(x/60),_=x%60;if(_===0)return v+String(w);var D=m||"";return v+String(w)+D+(0,l.default)(_,2)}function f(b,m){if(b%60===0){var v=b>0?"-":"+";return v+(0,l.default)(Math.abs(b)/60,2)}return p(b,m)}function p(b,m){var v=m||"",x=b>0?"-":"+",w=Math.abs(b),_=(0,l.default)(Math.floor(w/60),2),D=(0,l.default)(w%60,2);return x+_+v+D}var y=d;t.default=y,n.exports=t.default})(Ea,Ea.exports);var av=Ea.exports,Va={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},i=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},r=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],h=u[2];if(!h)return e(l,c);var f;switch(d){case"P":f=c.dateTime({width:"short"});break;case"PP":f=c.dateTime({width:"medium"});break;case"PPP":f=c.dateTime({width:"long"});break;case"PPPP":default:f=c.dateTime({width:"full"});break}return f.replace("{{date}}",e(d,c)).replace("{{time}}",i(h,c))},a={p:i,P:r},s=a;t.default=s,n.exports=t.default})(Va,Va.exports);var sv=Va.exports,ja={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(ja,ja.exports);var nu=ja.exports;const iu=ei(nu);var ni={};Object.defineProperty(ni,"__esModule",{value:!0}),ni.isProtectedDayOfYearToken=cv,ni.isProtectedWeekYearToken=uv,ni.throwProtectedError=dv;var ov=["D","DD"],lv=["YY","YYYY"];function cv(n){return ov.indexOf(n)!==-1}function uv(n){return lv.indexOf(n)!==-1}function dv(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var qa={exports:{}},Xa={exports:{}},Ga={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},i=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},r=i;t.default=r,n.exports=t.default})(Ga,Ga.exports);var hv=Ga.exports,Ka={exports:{}},Za={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):i.defaultWidth,s=i.formats[a]||i.formats[i.defaultWidth];return s}}n.exports=t.default})(Za,Za.exports);var fv=Za.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(fv),r={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,i.default)({formats:r,defaultWidth:"full"}),time:(0,i.default)({formats:a,defaultWidth:"full"}),dateTime:(0,i.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(Ka,Ka.exports);var gv=Ka.exports,Qa={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i=function(s,o,l,c){return e[s]},r=i;t.default=r,n.exports=t.default})(Qa,Qa.exports);var pv=Qa.exports,Ja={exports:{}},ts={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&i.formattingValues){var l=i.defaultFormattingWidth||i.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=i.formattingValues[c]||i.formattingValues[l]}else{var u=i.defaultWidth,d=a!=null&&a.width?String(a.width):i.defaultWidth;o=i.values[d]||i.values[u]}var h=i.argumentCallback?i.argumentCallback(r):r;return o[h]}}n.exports=t.default})(ts,ts.exports);var mv=ts.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(mv),r={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},o={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"]},l={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"}},c={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"}},u=function(p,y){var b=Number(p),m=b%100;if(m>20||m<10)switch(m%10){case 1:return b+"st";case 2:return b+"nd";case 3:return b+"rd"}return b+"th"},d={ordinalNumber:u,era:(0,i.default)({values:r,defaultWidth:"wide"}),quarter:(0,i.default)({values:a,defaultWidth:"wide",argumentCallback:function(p){return p-1}}),month:(0,i.default)({values:s,defaultWidth:"wide"}),day:(0,i.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,i.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},h=d;t.default=h,n.exports=t.default})(Ja,Ja.exports);var bv=Ja.exports,es={exports:{}},ns={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],h=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],f=Array.isArray(h)?r(h,function(b){return b.test(d)}):i(h,function(b){return b.test(d)}),p;p=a.valueCallback?a.valueCallback(f):f,p=o.valueCallback?o.valueCallback(p):p;var y=s.slice(d.length);return{value:p,rest:y}}}function i(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function r(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(ns,ns.exports);var yv=ns.exports,is={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.match(i.matchPattern);if(!s)return null;var o=s[0],l=r.match(i.parsePattern);if(!l)return null;var c=i.valueCallback?i.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=r.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(is,is.exports);var vv=is.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(yv),r=e(vv),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},h={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]},f={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},p={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]},y={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},b={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}},m={ordinalNumber:(0,r.default)({matchPattern:a,parsePattern:s,valueCallback:function(w){return parseInt(w,10)}}),era:(0,i.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,i.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(w){return w+1}}),month:(0,i.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:h,defaultParseWidth:"any"}),day:(0,i.default)({matchPatterns:f,defaultMatchWidth:"wide",parsePatterns:p,defaultParseWidth:"any"}),dayPeriod:(0,i.default)({matchPatterns:y,defaultMatchWidth:"any",parsePatterns:b,defaultParseWidth:"any"})},v=m;t.default=v,n.exports=t.default})(es,es.exports);var xv=es.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(hv),r=e(gv),a=e(pv),s=e(bv),o=e(xv),l={code:"en-US",formatDistance:i.default,formatLong:r.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(Xa,Xa.exports);var wv=Xa.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(wv),r=i.default;t.default=r,n.exports=t.default})(qa,qa.exports);var _v=qa.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=x;var i=e(qy),r=e(Ky),a=e(ie),s=e(av),o=e(sv),l=e(nu),c=ni,u=e(qe),d=e(Nt),h=Xe,f=e(_v),p=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,y=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,b=/^'([^]*?)'?$/,m=/''/g,v=/[a-zA-Z]/;function x(_,D,T){var S,M,O,A,R,H,ft,N,B,Z,Ct,C,I,F,V,j,q,mt;(0,d.default)(2,arguments);var gt=String(D),it=(0,h.getDefaultOptions)(),lt=(S=(M=T==null?void 0:T.locale)!==null&&M!==void 0?M:it.locale)!==null&&S!==void 0?S:f.default,et=(0,u.default)((O=(A=(R=(H=T==null?void 0:T.firstWeekContainsDate)!==null&&H!==void 0?H:T==null||(ft=T.locale)===null||ft===void 0||(N=ft.options)===null||N===void 0?void 0:N.firstWeekContainsDate)!==null&&R!==void 0?R:it.firstWeekContainsDate)!==null&&A!==void 0?A:(B=it.locale)===null||B===void 0||(Z=B.options)===null||Z===void 0?void 0:Z.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(et>=1&&et<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var It=(0,u.default)((Ct=(C=(I=(F=T==null?void 0:T.weekStartsOn)!==null&&F!==void 0?F:T==null||(V=T.locale)===null||V===void 0||(j=V.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&I!==void 0?I:it.weekStartsOn)!==null&&C!==void 0?C:(q=it.locale)===null||q===void 0||(mt=q.options)===null||mt===void 0?void 0:mt.weekStartsOn)!==null&&Ct!==void 0?Ct:0);if(!(It>=0&&It<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!lt.localize)throw new RangeError("locale must contain localize property");if(!lt.formatLong)throw new RangeError("locale must contain formatLong property");var pe=(0,a.default)(_);if(!(0,i.default)(pe))throw new RangeError("Invalid time value");var pr=(0,l.default)(pe),mr=(0,r.default)(pe,pr),hi={firstWeekContainsDate:et,weekStartsOn:It,locale:lt,_originalDate:pe},br=gt.match(y).map(function(Vt){var Ne=Vt[0];if(Ne==="p"||Ne==="P"){var yr=o.default[Ne];return yr(Vt,lt.formatLong)}return Vt}).join("").match(p).map(function(Vt){if(Vt==="''")return"'";var Ne=Vt[0];if(Ne==="'")return w(Vt);var yr=s.default[Ne];if(yr)return!(T!=null&&T.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(Vt)&&(0,c.throwProtectedError)(Vt,D,String(_)),!(T!=null&&T.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(Vt)&&(0,c.throwProtectedError)(Vt,D,String(_)),yr(mr,Vt,lt.localize,hi);if(Ne.match(v))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ne+"`");return Vt}).join("");return br}function w(_){var D=_.match(b);return D?D[1].replace(m,"'"):_}n.exports=t.default})(Da,Da.exports);var Dv=Da.exports;const Tv=ei(Dv);function ru(n,t,e){var i=kv(n,e.timeZone,e.locale);return i.formatToParts?Mv(i,t):Sv(i,t)}function Mv(n,t){for(var e=n.formatToParts(t),i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Sv(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function kv(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Cv(n,t){var e=Av(t);return e.formatToParts?Ov(e,n):Ev(e,n)}var Pv={year:0,month:1,day:2,hour:3,minute:4,second:5};function Ov(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=Pv[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function Ev(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var rs={};function Av(n){if(!rs[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";rs[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return rs[n]}function au(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var su=36e5,Rv=6e4,as={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function ss(n,t,e){var i,r;if(!n||(i=as.timezoneZ.exec(n),i))return 0;var a;if(i=as.timezoneHH.exec(n),i)return a=parseInt(i[1],10),ou(a)?-(a*su):NaN;if(i=as.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return ou(a,s)?(r=Math.abs(a)*su+s*Rv,a>0?-r:r):NaN}if(Nv(n)){t=new Date(t||Date.now());var o=e?t:Lv(t),l=os(o,n),c=e?l:Iv(t,l,n);return-c}return NaN}function Lv(n){return au(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function os(n,t){var e=Cv(n,t),i=au(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Iv(n,t,e){var i=n.getTime(),r=i-t,a=os(new Date(r),e);if(t===a)return t;r-=a-t;var s=os(new Date(r),e);return a===s?a:Math.max(a,s)}function ou(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var lu={};function Nv(n){if(lu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lu[n]=!0,!0}catch{return!1}}var Fv=60*1e3,Yv={X:function(n,t,e,i){var r=ls(i.timeZone,i._originalDate||n);if(r===0)return"Z";switch(t){case"X":return cu(r);case"XXXX":case"XX":return cn(r);case"XXXXX":case"XXX":default:return cn(r,":")}},x:function(n,t,e,i){var r=ls(i.timeZone,i._originalDate||n);switch(t){case"x":return cu(r);case"xxxx":case"xx":return cn(r);case"xxxxx":case"xxx":default:return cn(r,":")}},O:function(n,t,e,i){var r=ls(i.timeZone,i._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Wv(r,":");case"OOOO":default:return"GMT"+cn(r,":")}},z:function(n,t,e,i){var r=i._originalDate||n;switch(t){case"z":case"zz":case"zzz":return ru("short",r,i);case"zzzz":default:return ru("long",r,i)}}};function ls(n,t){var e=n?ss(n,t,!0)/Fv:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function nr(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}function cn(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=nr(Math.floor(r/60),2),s=nr(Math.floor(r%60),2);return i+a+e+s}function cu(n,t){if(n%60===0){var e=n>0?"-":"+";return e+nr(Math.abs(n)/60,2)}return cn(n,t)}function Wv(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+nr(a,2)}const Uv=Yv;var Bv=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,cs=36e5,uu=6e4,zv=2,Ft={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Bv};function du(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?zv:Xy(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Hv(n),a=$v(r.date,i),s=a.year,o=a.restDateString,l=Vv(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=jv(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=ss(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=iu(new Date(c+u)),d=iu(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Hv(n){var t={},e=Ft.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ft.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=Ft.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function $v(n,t){var e=Ft.YYY[t],i=Ft.YYYYY[t],r;if(r=Ft.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=Ft.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Vv(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=Ft.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,gu(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=Ft.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Gv(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=Ft.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return gu(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=Ft.Www.exec(n),e)return a=parseInt(e[1],10)-1,pu(t,a)?hu(t,a):new Date(NaN);if(e=Ft.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return pu(t,a,l)?hu(t,a,l):new Date(NaN)}return null}function jv(n){var t,e,i;if(t=Ft.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),us(e)?e%24*cs:NaN;if(t=Ft.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),us(e,i)?e%24*cs+i*uu:NaN;if(t=Ft.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return us(e,i,r)?e%24*cs+i*uu+r*1e3:NaN}return null}function hu(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var qv=[31,28,31,30,31,30,31,31,30,31,30,31],Xv=[31,29,31,30,31,30,31,31,30,31,30,31];function fu(n){return n%400===0||n%4===0&&n%100!==0}function gu(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=fu(n);if(i&&e>Xv[t]||!i&&e>qv[t])return!1}return!0}function Gv(n,t){if(t<1)return!1;var e=fu(n);return!(e&&t>366||!e&&t>365)}function pu(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function us(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Kv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Zv(n,t,e){var i=String(t),r=e||{},a=i.match(Kv);if(a){var s=du(n,r);i=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+Uv[l[0]](s,l,null,r)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},i)}return Tv(n,i,r)}var ds={exports:{}},hs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(hs,hs.exports);var Qv=hs.exports;(function(n,t){var e=xt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(Qv);function r(a){return(0,i.default)({},a)}n.exports=t.default})(ds,ds.exports);var Jv=ds.exports;const tx=ei(Jv);function ex(n,t,e){var i=du(n,e),r=ss(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function nx(n,t,e,i){var r=tx(i);return r.timeZone=t,Zv(ex(n,t),e,r)}const ix=2,fs=new Intl.NumberFormat(((Od=document==null?void 0:document.documentElement)==null?void 0:Od.lang)||"en-US");function rx(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, YYY hh:mm a";t.short&&(i="MMM dd, YYY"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return nx(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const gs=10,Kt=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ii=(n,t)=>(t||Kt)[n%Kt.length],ri=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),r=parseInt(n.substring(4,6),16);e=e-t,i=i-t,r=r-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${a}${s}${o}`},mu="#6f7787",ax={lineTension:.4,borderWidth:2,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},ps=new Map,ms=(n,t)=>t==="bytes"?ua(n):t==="count/minute"?n.toFixed(2):fs.format(n),bu=n=>{const e=document.createElement("canvas").getContext("2d"),i=dt({});return e.font=i.string,e.measureText(n).width},sx=()=>{const n="label_height";if(!ps.has(n)){const t=dt({});ps.set(n,t.lineHeight)}return ps.get(n)},ox=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),yu=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),vu=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function lx(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return $i.positioners.barChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=_a(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offset,y:c,xAlign:u}},jr.modes.customInteractionMode=function(i,r){const a=Te(r,i),s=[];return jr.evaluateInteractionItems(i,i.options.indexAxis||"x",a,(o,l,c)=>{i.options.indexAxis==="y"&&o.inYRange(a.y,!0)&&i.data.datasets[l].data[c]&&s.push({element:o,datasetIndex:l,index:c}),i.options.indexAxis==="x"&&o.inXRange(a.x,!0)&&i.data.datasets[l].data[c]&&s.push({element:o,datasetIndex:l,index:c})}),s},g.computed(()=>{var i,r,a,s,o,l,c,u;return{indexAxis:n.indexAxis,scales:{x:{border:{display:!1},stacked:n.stacked,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,callback:function(d,h){const f=this;if(f.chart.options.indexAxis===f.axis){d=f.getLabelForValue(h);const p=10;return d&&d.length>p?d.slice(0,p)+"...":d}return f.getLabelForValue(Number(d))}},title:{display:n.indexAxis==="y"?!U((i=n.metricAxesTitle)==null?void 0:i.value):!U((r=n.dimensionAxesTitle)==null?void 0:r.value),text:n.indexAxis==="y"?(a=n.metricAxesTitle)==null?void 0:a.value:(s=n.dimensionAxesTitle)==null?void 0:s.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{callback:function(d,h){const f=this;return f.chart.options.indexAxis===f.axis?(d=f.getLabelForValue(h),d&&d.length>gs?d.slice(0,gs)+"...":d):f.getLabelForValue(Number(d))}},title:{display:n.indexAxis==="x"?!U((o=n.metricAxesTitle)==null?void 0:o.value):!U((l=n.dimensionAxesTitle)==null?void 0:l.value),text:n.indexAxis==="x"?(c=n.metricAxesTitle)==null?void 0:c.value:(u=n.dimensionAxesTitle)==null?void 0:u.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:d=>{wa(n.tooltipState,d)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Xt.register(...Lm);const cx=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,a)=>r===i[a])};function ux(n,t,e,i,r){const a=g.shallowRef(null),s=(o,l)=>{if(t.value)return new Xt(t.value,{type:n,data:o,plugins:i,options:l})};return g.onMounted(()=>{a.value=s(e.value,r.value)}),g.onBeforeUnmount(()=>{U(a.value)||a.value.destroy()}),g.watch(e,(o,l)=>{if(cx(l,o)&&!U(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else U(a.value)||a.value.destroy(),a.value=s(o,r.value)}),g.watch(t,()=>{U(a.value)||a.value.destroy(),a.value=s(e.value,r.value)}),g.watch(r,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(U(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var xu={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],f=Math.round(c).toString().split("");return f.reverse().forEach(function(p,y){y&&y%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,f=d.round?"round":"floor";return d.decimal===!1?(c=Math[f](h),c.toString()):(d.precision?c=h:c=h<10?Math[f](h*10)/10:Math[f](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,r=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var f=u.min10k?r:i;return c<f||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,i,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(xu);var dx=xu.exports;const un=ei(dx);function hx(n,t,e){const{i18n:i}=Dt.useI18n();return{legendValues:g.computed(()=>n.value.datasets.reduce((a,s)=>{const o=s.total?s.total:s.data.reduce((c,u)=>c+(typeof u=="number"?Number(u)||0:Number(u.y)||0),0);let l;if(e.value==="bytes")l=isNaN(o)?"0":ua(o);else{l=`${un(o,{capital:!0})} ${e.value}`;const c=e.value&&i&&i.te(`chartUnits.${e.value}`)&&i.t(`chartUnits.${e.value}`)||e.value;l=i&&i.t("legend.datapointValueDisplay",{value:un(o,{capital:!0}),unit:c})||`${un(o,{capital:!0})} ${e.value}`}return{...a,[s.label]:{raw:o,formatted:l}}},{}))}}function fx(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return $i.positioners.doughnutChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=_a(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offset,y:c,xAlign:u}},{options:g.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{wa(n.tooltipState,i)}}}}))}}var gx=Object.defineProperty,px=(n,t,e)=>t in n?gx(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,re=(n,t,e)=>(px(n,typeof t!="symbol"?t+"":t,e),e),z=(n=>(n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(z||{}),wt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(wt||{});function bs(n){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(n)}function ir(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ae(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function dn(n){ae(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||bs(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wu(n,t){ae(2,arguments);var e=dn(n),i=ir(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function mx(n,t){ae(2,arguments);var e=dn(n),i=ir(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}var bx={};function yx(){return bx}function rr(n,t){var e,i,r,a,s,o,l,c;ae(1,arguments);var u=yx(),d=ir((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=dn(n),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function _u(n){ae(1,arguments);var t=dn(n);return t.setHours(0,0,0,0),t}var vx=60,xx=3600;function hn(n){ae(1,arguments);var t=dn(n);return t.setDate(1),t.setHours(0,0,0,0),t}function wx(n){ae(1,arguments);var t=dn(n),e=t.getFullYear(),i=t.getMonth(),r=new Date(0);return r.setFullYear(e,i+1,0),r.setHours(0,0,0,0),r.getDate()}function _x(n){return ae(1,arguments),Math.floor(n*xx)}function Dx(n){ae(1,arguments);var t=n/vx;return Math.floor(t)}function Du(n,t){ae(2,arguments);var e=ir(t);return mx(n,-e)}function ys(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Tu={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Tu);var Tx=Tu.exports,vs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(vs,vs.exports);var Mx=vs.exports;const Sx=ys(Mx);var xs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(xs,xs.exports);var kx=xs.exports;const Mu=ys(kx);function Cx(n,t){var e=Ax(t);return e.formatToParts?Ox(e,n):Ex(e,n)}var Px={year:0,month:1,day:2,hour:3,minute:4,second:5};function Ox(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=Px[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function Ex(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var ws={};function Ax(n){if(!ws[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";ws[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return ws[n]}function _s(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Su=36e5,Rx=6e4,Ds={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function ar(n,t,e){var i,r;if(!n||(i=Ds.timezoneZ.exec(n),i))return 0;var a;if(i=Ds.timezoneHH.exec(n),i)return a=parseInt(i[1],10),ku(a)?-(a*Su):NaN;if(i=Ds.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return ku(a,s)?(r=Math.abs(a)*Su+s*Rx,a>0?-r:r):NaN}if(Nx(n)){t=new Date(t||Date.now());var o=e?t:Lx(t),l=Ts(o,n),c=e?l:Ix(t,l,n);return-c}return NaN}function Lx(n){return _s(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ts(n,t){var e=Cx(n,t),i=_s(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Ix(n,t,e){var i=n.getTime(),r=i-t,a=Ts(new Date(r),e);if(t===a)return t;r-=a-t;var s=Ts(new Date(r),e);return a===s?a:Math.max(a,s)}function ku(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Cu={};function Nx(n){if(Cu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Cu[n]=!0,!0}catch{return!1}}var Fx=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Pu=Fx;var Ms=36e5,Ou=6e4,Yx=2,Yt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Pu};function Ss(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?Yx:Sx(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Wx(n),a=Ux(r.date,i),s=a.year,o=a.restDateString,l=Bx(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=zx(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=ar(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Mu(new Date(c+u)),d=Mu(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Wx(n){var t={},e=Yt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Yt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=Yt.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Ux(n,t){var e=Yt.YYY[t],i=Yt.YYYYY[t],r;if(r=Yt.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=Yt.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Bx(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=Yt.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,Ru(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=Yt.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Vx(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=Yt.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Ru(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=Yt.Www.exec(n),e)return a=parseInt(e[1],10)-1,Lu(t,a)?Eu(t,a):new Date(NaN);if(e=Yt.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Lu(t,a,l)?Eu(t,a,l):new Date(NaN)}return null}function zx(n){var t,e,i;if(t=Yt.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),ks(e)?e%24*Ms:NaN;if(t=Yt.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),ks(e,i)?e%24*Ms+i*Ou:NaN;if(t=Yt.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return ks(e,i,r)?e%24*Ms+i*Ou+r*1e3:NaN}return null}function Eu(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Hx=[31,28,31,30,31,30,31,31,30,31,30,31],$x=[31,29,31,30,31,30,31,31,30,31,30,31];function Au(n){return n%400===0||n%4===0&&n%100!==0}function Ru(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=Au(n);if(i&&e>$x[t]||!i&&e>Hx[t])return!1}return!0}function Vx(n,t){if(t<1)return!1;var e=Au(n);return!(e&&t>366||!e&&t>365)}function Lu(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function ks(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Cs={exports:{}},Ps={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Ps,Ps.exports);var jx=Ps.exports;(function(n,t){var e=Tx.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(jx);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Cs,Cs.exports);var qx=Cs.exports;const Xx=ys(qx);function Gx(n,t,e){var i=Ss(n,e),r=ar(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function Kx(n,t){return-ar(n,t)}function Zx(n,t,e){if(typeof n=="string"&&!n.match(Pu)){var i=Xx(e);return i.timeZone=t,Ss(n,i)}var r=Ss(n,e),a=_s(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()).getTime(),s=ar(t,new Date(a));return new Date(a+s)}const Qx={[z.MINUTELY]:60*1e3,[z.HOURLY]:60*60*1e3,[z.DAILY]:60*60*24*1e3,[z.WEEKLY]:60*60*24*7*1e3};function ai(n){return n&&Object.values(z).find(t=>n<=Qx[t])||null}const fn=(n,t)=>new Date(n.getTime()-Kx(t,n));class Zt{constructor(t){re(this,"timeframeText"),re(this,"key"),re(this,"display"),re(this,"timeframeLength"),re(this,"allowedTiers"),re(this,"defaultResponseGranularity"),re(this,"dataGranularity"),re(this,"isRelative"),re(this,"_startCustom"),re(this,"_endCustom"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(z.MINUTELY),e>=2&&e<=7*24&&t.add(z.HOURLY),e>=2*24&&t.add(z.DAILY),e>=2*24*14&&t.add(z.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=Zx(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Gx(e,t)}}class Jx extends Zt{rawStart(t){let e=rr(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=fn(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class tw extends Zt{rawStart(t){let e=hn(this.tzAdjustedDate(t));return t&&(e=fn(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class ew extends Zt{rawEnd(t){let e=rr(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=fn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rr(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=fn(i,t)),i}}class nw extends Zt{rawEnd(t){let e=hn(this.tzAdjustedDate(t));return t&&(e=fn(e,t)),e}rawStart(t){let e=hn(Du(this.tzAdjustedDate(t),1));return t&&(e=fn(e,t)),e}}wt.FIFTEEN_MIN,new Zt({key:wt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:z.MINUTELY,dataGranularity:z.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),wt.ONE_HOUR,new Zt({key:wt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:z.MINUTELY,dataGranularity:z.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),wt.SIX_HOUR,new Zt({key:wt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:z.HOURLY,dataGranularity:z.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),wt.TWELVE_HOUR,new Zt({key:wt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:z.HOURLY,dataGranularity:z.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),wt.ONE_DAY,new Zt({key:wt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:z.HOURLY,dataGranularity:z.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),wt.SEVEN_DAY,new Zt({key:wt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),wt.THIRTY_DAY,new Zt({key:wt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),wt.CURRENT_WEEK,new Jx({key:wt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rr(new Date,{weekStartsOn:1});return(_u(wu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),wt.CURRENT_MONTH,new tw({key:wt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=hn(new Date);return(_u(wu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),wt.PREVIOUS_WEEK,new ew({key:wt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),wt.PREVIOUS_MONTH,new nw({key:wt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=hn(new Date),e=hn(Du(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=iw(t,e)),60*60*24*wx(new Date().setMonth(new Date().getMonth()-1))+_x(n)},defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function iw(n,t){return Dx(n.getTimezoneOffset()-t.getTimezoneOffset())}function rw(n){const t=g.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!U((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=g.computed(()=>{var l,c;return{title:{display:!U((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};$i.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,h=n.tooltipState.height||this.height,f=u.width/2,p=u.height/2,y=_a(c,d,f);let b=Vy(c,h,p);const m=c.y<p?"top":"bottom",v=c.x<f?"left":"center";return h>u.height&&(b=0),{x:y,y:b,xAlign:v,yAlign:m}};const r=g.computed(()=>{switch(n.granularity.value){case z.MINUTELY:return"minute";case z.HOURLY:return"hour";case z.DAILY:return"day";default:return"day"}}),a=g.computed(()=>n.timeRangeMs?Dy(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm":Wy(Number(n.timeRangeSec.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=g.computed(()=>[z.DAILY,z.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:g.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:r.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{wa(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function aw(n,t){const{i18n:e}=Dt.useI18n();return g.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o=a&&Object.keys(a),l=a&&o&&(o.length===1?o[0]!=="Organization":o.length>0);if(!r.length||!s)return{datasets:[],labels:[]};const c=l&&o||s,u=c[0],d=c.length>1?c[1]:c[0],h=s[0],f=Object.fromEntries(r.map(m=>{const v=l?`${m.event[u]},${m.event[d]}`:`${u},${d}`,x=m.event[h];return[v,x]})),p=l&&a[u]||s,y=l&&a[d]||s;return!p||!y?{labels:[],datasets:[]}:{labels:l?a[u].map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m):s.map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m),datasets:y&&Array.from(y).flatMap((m,v)=>{if(!m)return[];let{colorPalette:x}=n;U(x)&&(x=Kt);const w={},_=Array.isArray(x)?ii(v,x):x[m]||ii(v);return w[m]=_,{label:e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m,backgroundColor:_,data:p.map(D=>f[`${D},${m}`]||0)}})}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const sw=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),ow=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return qc(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},lw=(n,t,e,i,r)=>{const s=Math.max(t-6e4,Math.max(...(r||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((s-i)/e)*e+i+e;return sw(o,l,e)};function cw(n,t){const{i18n:e}=Dt.useI18n();return g.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o="startMs"in t.value.meta?t.value.meta.startMs:t.value.meta.start*1e3,l="endMs"in t.value.meta?t.value.meta.endMs:t.value.meta.end*1e3;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=s&&s[0],d=c&&c[0]||u,h=a&&a[d]||s,f=t.value.meta.granularity;if(typeof f!="number"||isNaN(f)||!isFinite(f)||f===0)return console.error("Invalid step value:",f),{datasets:[]};if(!r.length)return{datasets:[]};const p=ow(o),y=lw(o,l,f,p,r),b=new Set,m=r!=null&&r.length?r.reduce((_,D)=>{const T=new Date(D.timestamp).valueOf(),S=D.event;return b.add(u),T in _||(_[T]={}),u in _[T]||(_[T][u]={}),h.forEach(M=>{S[d]===M||d===M?_[T][u][M]=Math.round(Number(S[u])*1e3)/1e3:c.length||(_[T][u][M]=Math.round(Number(S[M])*1e3)/1e3)}),_},{}):{},v=[...b].reduce((_,D)=>(h.forEach(T=>_.push([D,T])),_),[]),x={},w=[...v].map(([_,D],T)=>{const S=y.map(H=>H in m&&_ in m[H]?{x:H,y:m[H][_][D]||0}:{x:H,y:0});let{colorPalette:M,fill:O}=n;U(M)&&(M=Kt);const A=Array.isArray(M)?ii(T,M):M[D]||ii(T),R=ri(A,50);return x[D]=A,{rawDimension:D,rawMetric:_,label:e&&e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||D,borderColor:R,backgroundColor:A,data:S,total:S.reduce((H,{y:ft})=>H+Number(ft),0),...ax,fill:O}});return w.sort((_,D)=>Number(_.total)<Number(D.total)?-1:1),{datasets:w,colorMap:x}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const Dt={useBarChartOptions:lx,useChartJSCommon:ux,useChartLegendValues:hx,useExploreResultToDatasets:aw,useExploreResultToTimeDataset:cw,useDoughnutChartOptions:fx,useLinechartOptions:rw,useI18n:Ad,useReportChartDataForSynthetics:(n,t)=>{g.watch([n,t],(e,i,r)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})}};/*!
18
+ `):n}function im(n,t){const{element:e,datasetIndex:i,index:r}=t,a=n.getDatasetMeta(i).controller,{label:s,value:o}=a.getLabelAndValue(r);return{chart:n,label:s,parsed:a.getParsed(r),raw:n.data.datasets[i].data[r],formattedValue:o,dataset:a.getDataset(),dataIndex:r,datasetIndex:i,element:e}}function nc(n,t){const e=n.chart.ctx,{body:i,footer:r,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=dt(t.bodyFont),c=dt(t.titleFont),u=dt(t.footerFont),d=a.length,h=r.length,f=i.length,p=kt(t.padding);let y=p.height,b=0,m=i.reduce((x,_)=>x+_.before.length+_.lines.length+_.after.length,0);if(m+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),m){const x=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;y+=f*x+(m-f)*l.lineHeight+(m-1)*t.bodySpacing}h&&(y+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let v=0;const w=function(x){b=Math.max(b,e.measureText(x).width+v)};return e.save(),e.font=c.string,at(n.title,w),e.font=l.string,at(n.beforeBody.concat(n.afterBody),w),v=t.displayColors?s+2+t.boxPadding:0,at(i,x=>{at(x.before,w),at(x.lines,w),at(x.after,w)}),v=0,e.font=u.string,at(n.footer,w),e.restore(),b+=p.width,{width:b,height:y}}function rm(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function am(n,t,e,i){const{x:r,width:a}=i,s=e.caretSize+e.caretPadding;if(n==="left"&&r+a+s>t.width||n==="right"&&r-a-s<0)return!0}function sm(n,t,e,i){const{x:r,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=r<=(o+l)/2?"left":"right":r<=a/2?c="left":r>=s-a/2&&(c="right"),am(c,n,t,e)&&(c="center"),c}function ic(n,t,e){const i=e.yAlign||t.yAlign||rm(n,e);return{xAlign:e.xAlign||t.xAlign||sm(n,t,e,i),yAlign:i}}function om(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function lm(n,t,e){let{y:i,height:r}=n;return t==="top"?i+=e:t==="bottom"?i-=r+e:i-=r/2,i}function rc(n,t,e,i){const{caretSize:r,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=r+a,{topLeft:u,topRight:d,bottomLeft:h,bottomRight:f}=_e(s);let p=om(t,o);const y=lm(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,h)+r:o==="right"&&(p+=Math.max(d,f)+r),{x:Ot(p,0,i.width-t.width),y:Ot(y,0,i.height-t.height)}}function Hi(n,t,e){const i=kt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function ac(n){return te([],he(n))}function cm(n,t,e){return De(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function sc(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const oc={beforeTitle:oe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:oe,beforeBody:oe,beforeLabel:oe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return U(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:oe,afterBody:oe,beforeFooter:oe,footer:oe,afterFooter:oe};function Bt(n,t,e,i){const r=n[t].call(e,i);return typeof r>"u"?oc[t].call(e,i):r}class ra extends Pt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&e.options.animation&&i.animations,a=new Yr(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=cm(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,r=Bt(i,"beforeTitle",this,t),a=Bt(i,"title",this,t),s=Bt(i,"afterTitle",this,t);let o=[];return o=te(o,he(r)),o=te(o,he(a)),o=te(o,he(s)),o}getBeforeBody(t,e){return ac(Bt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,r=[];return at(t,a=>{const s={before:[],lines:[],after:[]},o=sc(i,a);te(s.before,he(Bt(o,"beforeLabel",this,a))),te(s.lines,Bt(o,"label",this,a)),te(s.after,he(Bt(o,"afterLabel",this,a))),r.push(s)}),r}getAfterBody(t,e){return ac(Bt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,r=Bt(i,"beforeFooter",this,t),a=Bt(i,"footer",this,t),s=Bt(i,"afterFooter",this,t);let o=[];return o=te(o,he(r)),o=te(o,he(a)),o=te(o,he(s)),o}_createItems(t){const e=this._active,i=this.chart.data,r=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(im(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,i))),at(o,u=>{const d=sc(t.callbacks,u);r.push(Bt(d,"labelColor",this,u)),a.push(Bt(d,"labelPointStyle",this,u)),s.push(Bt(d,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),r=this._active;let a,s=[];if(!r.length)this.opacity!==0&&(a={opacity:0});else{const o=Vn[i.position].call(this,r,this._eventPosition);s=this._createItems(i),this.title=this.getTitle(s,i),this.beforeBody=this.getBeforeBody(s,i),this.body=this.getBody(s,i),this.afterBody=this.getAfterBody(s,i),this.footer=this.getFooter(s,i);const l=this._size=nc(this,i),c=Object.assign({},o,l),u=ic(this.chart,i,c),d=rc(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,a={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=s,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,r){const a=this.getCaretPosition(t,i,r);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,i){const{xAlign:r,yAlign:a}=this,{caretSize:s,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=_e(o),{x:h,y:f}=t,{width:p,height:y}=e;let b,m,v,w,x,_;return a==="center"?(x=f+y/2,r==="left"?(b=h,m=b-s,w=x+s,_=x-s):(b=h+p,m=b+s,w=x-s,_=x+s),v=b):(r==="left"?m=h+Math.max(l,u)+s:r==="right"?m=h+p-Math.max(c,d)-s:m=this.caretX,a==="top"?(w=f,x=w-s,b=m-s,v=m+s):(w=f+y,x=w+s,b=m+s,v=m-s),_=w),{x1:b,x2:m,x3:v,y1:w,y2:x,y3:_}}drawTitle(t,e,i){const r=this.title,a=r.length;let s,o,l;if(a){const c=rn(i.rtl,this.x,this.width);for(t.x=Hi(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",s=dt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(r[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,r,a){const s=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=a,u=dt(a.bodyFont),d=Hi(this,"left",a),h=r.x(d),f=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+f;if(a.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},b=r.leftForLtr(h,c)+c/2,m=p+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,Ar(t,y,b,m),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Ar(t,y,b,m)}else{t.lineWidth=H(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const y=r.leftForLtr(h,c),b=r.leftForLtr(r.xPlus(h,1),c-2),m=_e(s.borderRadius);Object.values(m).some(v=>v!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,tn(t,{x:y,y:p,w:c,h:l,radius:m}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),tn(t,{x:b,y:p+1,w:c-2,h:l-2,radius:m}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=s.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:r}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=dt(i.bodyFont);let h=d.lineHeight,f=0;const p=rn(i.rtl,this.x,this.width),y=function(M){e.fillText(M,p.x(t.x+f),t.y+h/2),t.y+=h+a},b=p.textAlign(s);let m,v,w,x,_,D,T;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=Hi(this,b,i),e.fillStyle=i.bodyColor,at(this.beforeBody,y),f=o&&b!=="right"?s==="center"?c/2+u:c+2+u:0,x=0,D=r.length;x<D;++x){for(m=r[x],v=this.labelTextColors[x],e.fillStyle=v,at(m.before,y),w=m.lines,o&&w.length&&(this._drawColorBox(e,t,x,p,i),h=Math.max(d.lineHeight,l)),_=0,T=w.length;_<T;++_)y(w[_]),h=d.lineHeight;at(m.after,y)}f=0,h=d.lineHeight,at(this.afterBody,y),t.y-=a}drawFooter(t,e,i){const r=this.footer,a=r.length;let s,o;if(a){const l=rn(i.rtl,this.x,this.width);for(t.x=Hi(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",s=dt(i.footerFont),e.fillStyle=i.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(r[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+i.footerSpacing}}drawBackground(t,e,i,r){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:p}=_e(r.cornerRadius);e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,e.lineWidth=r.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,i,r),e.lineTo(o+c-h,l),e.quadraticCurveTo(o+c,l,o+c,l+h),s==="center"&&a==="right"&&this.drawCaret(t,e,i,r),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),s==="bottom"&&this.drawCaret(t,e,i,r),e.lineTo(o+f,l+u),e.quadraticCurveTo(o,l+u,o,l+u-f),s==="center"&&a==="left"&&this.drawCaret(t,e,i,r),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),r.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,r=i&&i.x,a=i&&i.y;if(r||a){const s=Vn[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=nc(this,t),l=Object.assign({},s,this._size),c=ic(e,t,l),u=rc(t,l,c,e);(r._to!==u.x||a._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const r={width:this.width,height:this.height},a={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const s=kt(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(a,t,r,e),Bo(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),zo(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,r=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),a=!mi(i,r),s=this._positionChanged(r,e);(a||s)&&(this._active=r,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,i),o=this._positionChanged(s,t),l=e||!mi(s,a)||o;return l&&(this._active=s,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,r){const a=this.options;if(t.type==="mouseout")return[];if(!r)return e;const s=this.chart.getElementsAtEventForMode(t,a.mode,a,i);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:i,caretY:r,options:a}=this,s=Vn[a.position].call(this,t,e);return s!==!1&&(i!==s.x||r!==s.y)}}k(ra,"positioners",Vn);var $i={id:"tooltip",_element:ra,positioners:Vn,afterInit(n,t,e){e&&(n.tooltip=new ra({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:oc},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"]},um=Object.freeze({__proto__:null,Colors:Dp,Decimation:kp,Filler:qp,Legend:Jp,SubTitle:nm,Title:em,Tooltip:$i});const dm=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function hm(n,t,e,i){const r=n.indexOf(t);if(r===-1)return dm(n,t,e,i);const a=n.lastIndexOf(t);return r!==a?e:r}const fm=(n,t)=>n===null?null:Ot(Math.round(n),0,t);function lc(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class aa extends He{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:r,label:a}of e)i[r]===a&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(U(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:hm(i,t,W(e,t),this._addedLabels),fm(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,r=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let s=t;s<=e;s++)r.push({value:s});return r}getLabelForValue(t){return lc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}k(aa,"id","category"),k(aa,"defaults",{ticks:{callback:lc}});function gm(n,t){const e=[],{bounds:r,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,f=a||1,p=u-1,{min:y,max:b}=t,m=!U(s),v=!U(o),w=!U(c),x=(b-y)/(d+1);let _=uo((b-y)/p/f)*f,D,T,M,S;if(_<1e-14&&!m&&!v)return[{value:y},{value:b}];S=Math.ceil(b/_)-Math.floor(y/_),S>p&&(_=uo(S*_/p/f)*f),U(l)||(D=Math.pow(10,l),_=Math.ceil(_*D)/D),r==="ticks"?(T=Math.floor(y/_)*_,M=Math.ceil(b/_)*_):(T=y,M=b),m&&v&&a&&uh((o-s)/a,_/1e3)?(S=Math.round(Math.min((o-s)/_,u)),_=(o-s)/S,T=s,M=o):w?(T=m?s:T,M=v?o:M,S=c-1,_=(M-T)/S):(S=(M-T)/_,Mn(S,Math.round(S),_/1e3)?S=Math.round(S):S=Math.ceil(S));const P=Math.max(fo(_),fo(T));D=Math.pow(10,U(l)?P:l),T=Math.round(T*D)/D,M=Math.round(M*D)/D;let L=0;for(m&&(h&&T!==s?(e.push({value:s}),T<s&&L++,Mn(Math.round((T+L*_)*D)/D,s,cc(s,x,n))&&L++):T<s&&L++);L<S;++L){const E=Math.round((T+L*_)*D)/D;if(v&&E>o)break;e.push({value:E})}return v&&h&&M!==o?e.length&&Mn(e[e.length-1].value,o,cc(o,x,n))?e[e.length-1].value=o:e.push({value:o}):(!v||M===o)&&e.push({value:M}),e}function cc(n,t,{horizontal:e,minRotation:i}){const r=St(i),a=(e?Math.sin(r):Math.cos(r))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class Vi extends He{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 U(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:r,max:a}=this;const s=l=>r=e?r:l,o=l=>a=i?a:l;if(t){const l=Qt(r),c=Qt(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(r===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(r-l)}this.min=r,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),e=e||11),e&&(r=Math.min(e,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={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},a=this._range||this,s=gm(r,a);return t.bounds==="ticks"&&ho(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-e)/Math.max(t.length-1,1)/2;e-=r,i+=r}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Cn(t,this.chart.options.locale,this.options.ticks.format)}}class sa extends Vi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=gt(t)?t:0,this.max=gt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=St(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}k(sa,"id","linear"),k(sa,"defaults",{ticks:{callback:_i.formatters.numeric}});const jn=n=>Math.floor(xe(n)),$e=(n,t)=>Math.pow(10,jn(n)+t);function uc(n){return n/Math.pow(10,jn(n))===1}function dc(n,t,e){const i=Math.pow(10,e),r=Math.floor(n/i);return Math.ceil(t/i)-r}function pm(n,t){const e=t-n;let i=jn(e);for(;dc(n,t,i)>10;)i++;for(;dc(n,t,i)<10;)i--;return Math.min(i,jn(n))}function mm(n,{min:t,max:e}){t=Ht(n.min,t);const i=[],r=jn(t);let a=pm(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=r>a?Math.pow(10,r):0,c=Math.round((t-l)*s)/s,u=Math.floor((t-l)/o/10)*o*10;let d=Math.floor((c-u)/Math.pow(10,a)),h=Ht(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;h<e;)i.push({value:h,major:uc(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),h=Math.round((l+u+d*Math.pow(10,a))*s)/s;const f=Ht(n.max,h);return i.push({value:f,major:uc(f),significand:d}),i}class oa extends He{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Vi.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return gt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=gt(t)?Math.max(0,t):null,this.max=gt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!gt(this._userMin)&&(this.min=t===$e(this.min,0)?$e(this.min,-1):$e(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,r=this.max;const a=o=>i=t?i:o,s=o=>r=e?r:o;i===r&&(i<=0?(a(1),s(10)):(a($e(i,-1)),s($e(r,1)))),i<=0&&a($e(r,-1)),r<=0&&s($e(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=mm(e,this);return t.bounds==="ticks"&&ho(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":Cn(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xe(t),this._valueRange=xe(this.max)-xe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}k(oa,"id","logarithmic"),k(oa,"defaults",{ticks:{callback:_i.formatters.logarithmic,major:{enabled:!0}}});function la(n){const t=n.ticks;if(t.display&&n.display){const e=kt(t.backdropPadding);return W(t.font&&t.font.size,mt.font.size)+e.height}return 0}function bm(n,t,e){return e=tt(e)?e:[e],{w:kh(n,t.string,e),h:e.length*t.lineHeight}}function hc(n,t,e,i,r){return n===i||n===r?{start:t-e/2,end:t+e/2}:n<i||n>r?{start:t-e,end:t}:{start:t,end:t+e}}function ym(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],r=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?q/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));r[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+r[l],o),d=dt(c.font),h=bm(n.ctx,d,n._pointLabels[l]);i[l]=h;const f=$t(n.getIndexAngle(l)+o),p=Math.round(xi(f)),y=hc(p,u.x,h.w,0,180),b=hc(p,u.y,h.h,90,270);vm(e,t,f,y,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=_m(n,i,r)}function vm(n,t,e,i,r){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/a,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),r.start<t.t?(l=(t.t-r.start)/s,n.t=Math.min(n.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function xm(n,t,e){const i=n.drawingArea,{extra:r,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,i+r+s,a),c=Math.round(xi($t(l.angle+ut))),u=Mm(l.y,o.h,c),d=Dm(c),h=Tm(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+o.w,bottom:u+o.h}}function wm(n,t){if(!t)return!0;const{left:e,top:i,right:r,bottom:a}=n;return!(ue({x:e,y:i},t)||ue({x:e,y:a},t)||ue({x:r,y:i},t)||ue({x:r,y:a},t))}function _m(n,t,e){const i=[],r=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:la(a)/2,additionalAngle:s?q/r:0};let c;for(let u=0;u<r;u++){l.padding=e[u],l.size=t[u];const d=xm(n,u,l);i.push(d),o==="auto"&&(d.visible=wm(d,c),d.visible&&(c=d))}return i}function Dm(n){return n===0||n===180?"center":n<180?"left":"right"}function Tm(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Mm(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Sm(n,t,e){const{left:i,top:r,right:a,bottom:s}=e,{backdropColor:o}=t;if(!U(o)){const l=_e(t.borderRadius),c=kt(t.backdropPadding);n.fillStyle=o;const u=i-c.left,d=r-c.top,h=a-i+c.width,f=s-r+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),tn(n,{x:u,y:d,w:h,h:f,radius:l}),n.fill()):n.fillRect(u,d,h,f)}}function km(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let r=t-1;r>=0;r--){const a=n._pointLabelItems[r];if(!a.visible)continue;const s=i.setContext(n.getPointLabelContext(r));Sm(e,s,a);const o=dt(s.font),{x:l,y:c,textAlign:u}=a;We(e,n._pointLabels[r],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function fc(n,t,e,i){const{ctx:r}=n;if(e)r.arc(n.xCenter,n.yCenter,t,0,ct);else{let a=n.getPointPosition(0,t);r.moveTo(a.x,a.y);for(let s=1;s<i;s++)a=n.getPointPosition(s,t),r.lineTo(a.x,a.y)}}function Cm(n,t,e,i,r){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!i||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(r.dash),a.lineDashOffset=r.dashOffset,a.beginPath(),fc(n,e,s,i),a.closePath(),a.stroke(),a.restore())}function Om(n,t,e){return De(n,{label:e,index:t,type:"pointLabel"})}class qn extends Vi{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=kt(la(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=gt(t)&&!isNaN(t)?t:0,this.max=gt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/la(this.options))}generateTickLabels(t){Vi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const r=rt(this.options.pointLabels.callback,[e,i],this);return r||r===0?r:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?ym(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,r){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,r))}getIndexAngle(t){const e=ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return $t(t*e+St(i))}getDistanceFromCenterForValue(t){if(U(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(U(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return Om(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const r=this.getIndexAngle(t)-ut+i;return{x:Math.cos(r)*e+this.xCenter,y:Math.sin(r)*e+this.yCenter,angle:r}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:r,bottom:a}=this._pointLabelItems[t];return{left:e,top:i,right:r,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),fc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:r,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&km(this,s),r.display&&this.ticks.forEach((u,d)=>{if(d!==0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),f=r.setContext(h),p=a.setContext(h);Cm(this,f,l,s,p)}}),i.display){for(t.save(),o=s-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=dt(c.font);if(a=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,s=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const d=kt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}We(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}k(qn,"id","radialLinear"),k(qn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_i.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),k(qn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),k(qn,"descriptors",{angleLines:{_fallback:"grid"}});const ji={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}},zt=Object.keys(ji);function gc(n,t){return n-t}function pc(n,t){if(U(t))return null;const e=n._adapter,{parser:i,round:r,isoWeekday:a}=n._parseOpts;let s=t;return typeof i=="function"&&(s=i(s)),gt(s)||(s=typeof i=="string"?e.parse(s,i):e.parse(s)),s===null?null:(r&&(s=r==="week"&&(we(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,r)),+s)}function mc(n,t,e,i){const r=zt.length;for(let a=zt.indexOf(n);a<r-1;++a){const s=ji[zt[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=i)return zt[a]}return zt[r-1]}function Pm(n,t,e,i,r){for(let a=zt.length-1;a>=zt.indexOf(e);a--){const s=zt[a];if(ji[s].common&&n._adapter.diff(r,i,s)>=t-1)return s}return zt[e?zt.indexOf(e):0]}function Em(n){for(let t=zt.indexOf(n)+1,e=zt.length;t<e;++t)if(ji[zt[t]].common)return zt[t]}function bc(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:r}=Sr(e,t),a=e[i]>=t?e[i]:e[r];n[a]=!0}}function Am(n,t,e,i){const r=n._adapter,a=+r.startOf(t[0].value,i),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+r.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function yc(n,t,e){const i=[],r={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],r[o]=s,i.push({value:o,major:!1});return a===0||!e?i:Am(n,i,r,e)}class Xn extends He{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),r=this._adapter=new ol._date(t.adapters.date);r.init(e),Tn(i.displayFormats,r.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:pc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:r,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!o&&!isNaN(c.max)&&(a=Math.max(a,c.max))}(!s||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=gt(r)&&!isNaN(r)?r:+e.startOf(Date.now(),i),a=gt(a)&&!isNaN(a)?a:+e.endOf(Date.now(),i)+1,this.min=Math.min(r,a-1),this.max=Math.max(r+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const a=this.min,s=this.max,o=gh(r,a,s);return this._unit=e.unit||(i.autoSkip?mc(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):Pm(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Em(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),yc(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,r,a;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?e=1-r:e=(this.getDecimalForValue(t[1])-r)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?i=a:i=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Ot(e,0,s),i=Ot(i,0,s),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,r=this.options,a=r.time,s=a.unit||mc(a.minUnit,e,i,this._getLabelCapacity(e)),o=W(r.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=we(l)||l===!0,u={};let d=e,h,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(i,e,s)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+s);const p=r.ticks.source==="data"&&this.getDataTimestamps();for(h=d,f=0;h<i;h=+t.add(h,o,s),f++)bc(u,h,p);return(h===i||r.bounds==="ticks"||f===1)&&bc(u,h,p),Object.keys(u).sort(gc).map(y=>+y)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const r=this.options.time.displayFormats,a=this._unit,s=e||r[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,i,r){const a=this.options,s=a.ticks.callback;if(s)return rt(s,[t,e,i],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],h=i[e],f=c&&d&&h&&h.major;return this._adapter.format(t,r||(f?d:u))}generateTickLabels(t){let e,i,r;for(e=0,i=t.length;e<i;++e)r=t[e],r.label=this._tickFormatFunction(r.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,r=St(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(r),s=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*a+o*s,h:i*s+o*a}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,r=i[e.unit]||i.millisecond,a=this._tickFormatFunction(t,0,yc(this,[t],this._majorUnit),r),s=this._getLabelSize(a),o=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(e=0,i=r.length;e<i;++e)t=t.concat(r[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const r=this.getLabels();for(e=0,i=r.length;e<i;++e)t.push(pc(this,r[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return bo(t.sort(gc))}}k(Xn,"id","time"),k(Xn,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function qi(n,t,e){let i=0,r=n.length-1,a,s,o,l;e?(t>=n[i].pos&&t<=n[r].pos&&({lo:i,hi:r}=ce(n,"pos",t)),{pos:a,time:o}=n[i],{pos:s,time:l}=n[r]):(t>=n[i].time&&t<=n[r].time&&({lo:i,hi:r}=ce(n,"time",t)),{time:a,pos:o}=n[i],{time:s,pos:l}=n[r]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class ca extends Xn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=qi(e,this.min),this._tableRange=qi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,r=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=i&&r.push(c);if(r.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(s=0,o=r.length;s<o;++s)u=r[s+1],l=r[s-1],c=r[s],Math.round((u+l)/2)!==c&&a.push({time:c,pos:s/(o-1)});return a}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((r,a)=>r-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(qi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return qi(this._table,i*this._tableRange+this._minPos,!0)}}k(ca,"id","timeseries"),k(ca,"defaults",Xn.defaults);var Rm=Object.freeze({__proto__:null,CategoryScale:aa,LinearScale:sa,LogarithmicScale:oa,RadialLinearScale:qn,TimeScale:Xn,TimeSeriesScale:ca});const Lm=[Hf,bp,um,Rm],Im=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Nm=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Fm=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ym=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],vc=(n,t,e)=>{let i=n;return typeof t=="string"||Array.isArray(t)?i=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(i=n.toLocaleString(void 0,e)),i};function ua(n,t){if(!Number.isFinite(n))throw new TypeError(`Expected a finite number, got ${typeof n}: ${n}`);t={bits:!1,binary:!1,space:!0,...t};const e=t.bits?t.binary?Ym:Fm:t.binary?Nm:Im,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const r=n<0,a=r?"-":t.signed?"+":"";r&&(n=-n);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),n<1){const u=vc(n,t.locale,s);return a+u+i+e[0]}const o=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**o,s||(n=n.toPrecision(3));const l=vc(Number(n),t.locale,s),c=e[o];return a+l+i+c}function fe(n){"@babel/helpers - typeof";return fe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fe(n)}function ht(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function R(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function Y(n){R(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||fe(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function xc(n,t){R(2,arguments);var e=Y(n),i=ht(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function da(n,t){R(2,arguments);var e=Y(n),i=ht(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}function Gn(n,t){R(2,arguments);var e=Y(n).getTime(),i=ht(t);return new Date(e+i)}var Wm=36e5;function Um(n,t){R(2,arguments);var e=ht(t);return Gn(n,e*Wm)}var Bm={};function Ce(){return Bm}function wc(n,t){var e,i,r,a,s,o,l,c;R(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Y(n),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function Xi(n){var 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 ha(n){R(1,arguments);var t=Y(n);return t.setHours(0,0,0,0),t}var zm=864e5;function Hm(n,t){R(2,arguments);var e=ha(n),i=ha(t),r=e.getTime()-Xi(e),a=i.getTime()-Xi(i);return Math.round((r-a)/zm)}var $m=6e4;function Vm(n,t){R(2,arguments);var e=ht(t);return Gn(n,e*$m)}function jm(n,t){R(2,arguments);var e=ht(t),i=e*3;return da(n,i)}function qm(n,t){R(2,arguments);var e=ht(t);return Gn(n,e*1e3)}function Xm(n,t){R(2,arguments);var e=ht(t),i=e*7;return xc(n,i)}function Gm(n,t){R(2,arguments);var e=ht(t);return da(n,e*12)}function Kn(n,t){R(2,arguments);var e=Y(n),i=Y(t),r=e.getTime()-i.getTime();return r<0?-1:r>0?1:r}var Gi=6e4,Zn=36e5,Km=1e3,Zm=3600;function Qm(n){return R(1,arguments),n instanceof Date||fe(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function fa(n){if(R(1,arguments),!Qm(n)&&typeof n!="number")return!1;var t=Y(n);return!isNaN(Number(t))}function Jm(n,t){R(2,arguments);var e=Y(n),i=Y(t),r=e.getFullYear()-i.getFullYear(),a=e.getMonth()-i.getMonth();return r*12+a}function t0(n,t){R(2,arguments);var e=Y(n),i=Y(t);return e.getFullYear()-i.getFullYear()}function _c(n,t){var 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 Dc(n,t){R(2,arguments);var e=Y(n),i=Y(t),r=_c(e,i),a=Math.abs(Hm(e,i));e.setDate(e.getDate()-r*a);var s=+(_c(e,i)===-r),o=r*(a-s);return o===0?0:o}function Ki(n,t){return R(2,arguments),Y(n).getTime()-Y(t).getTime()}var Tc={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},e0="trunc";function Qn(n){return n?Tc[n]:Tc[e0]}function n0(n,t,e){R(2,arguments);var i=Ki(n,t)/Zn;return Qn(e==null?void 0:e.roundingMethod)(i)}function i0(n,t,e){R(2,arguments);var i=Ki(n,t)/Gi;return Qn(e==null?void 0:e.roundingMethod)(i)}function Mc(n){R(1,arguments);var t=Y(n);return t.setHours(23,59,59,999),t}function Sc(n){R(1,arguments);var t=Y(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function r0(n){R(1,arguments);var t=Y(n);return Mc(t).getTime()===Sc(t).getTime()}function kc(n,t){R(2,arguments);var e=Y(n),i=Y(t),r=Kn(e,i),a=Math.abs(Jm(e,i)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-r*a);var o=Kn(e,i)===-r;r0(Y(n))&&a===1&&Kn(n,i)===1&&(o=!1),s=r*(a-Number(o))}return s===0?0:s}function a0(n,t,e){R(2,arguments);var i=kc(n,t)/3;return Qn(e==null?void 0:e.roundingMethod)(i)}function s0(n,t,e){R(2,arguments);var i=Ki(n,t)/1e3;return Qn(e==null?void 0:e.roundingMethod)(i)}function o0(n,t,e){R(2,arguments);var i=Dc(n,t)/7;return Qn(e==null?void 0:e.roundingMethod)(i)}function l0(n,t){R(2,arguments);var e=Y(n),i=Y(t),r=Kn(e,i),a=Math.abs(t0(e,i));e.setFullYear(1584),i.setFullYear(1584);var s=Kn(e,i)===-r,o=r*(a-Number(s));return o===0?0:o}function c0(n){R(1,arguments);var t=Y(n);return t.setSeconds(0,0),t}function u0(n){R(1,arguments);var t=Y(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function d0(n){R(1,arguments);var t=Y(n);return t.setDate(1),t.setHours(0,0,0,0),t}function h0(n){R(1,arguments);var t=Y(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function f0(n){R(1,arguments);var t=Y(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function g0(n){R(1,arguments);var t=Y(n);return t.setMinutes(59,59,999),t}function p0(n,t){var e,i,r,a,s,o,l,c;R(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Y(n),f=h.getDay(),p=(f<d?-7:0)+6-(f-d);return h.setDate(h.getDate()+p),h.setHours(23,59,59,999),h}function m0(n){R(1,arguments);var t=Y(n);return t.setSeconds(59,999),t}function b0(n){R(1,arguments);var t=Y(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function y0(n){R(1,arguments);var t=Y(n);return t.setMilliseconds(999),t}function Cc(n,t){R(2,arguments);var e=ht(t);return Gn(n,-e)}var v0=864e5;function x0(n){R(1,arguments);var t=Y(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var i=t.getTime(),r=e-i;return Math.floor(r/v0)+1}function sn(n){R(1,arguments);var t=1,e=Y(n),i=e.getUTCDay(),r=(i<t?7:0)+i-t;return e.setUTCDate(e.getUTCDate()-r),e.setUTCHours(0,0,0,0),e}function Oc(n){R(1,arguments);var t=Y(n),e=t.getUTCFullYear(),i=new Date(0);i.setUTCFullYear(e+1,0,4),i.setUTCHours(0,0,0,0);var r=sn(i),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=sn(a);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function w0(n){R(1,arguments);var t=Oc(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var i=sn(e);return i}var _0=6048e5;function Pc(n){R(1,arguments);var t=Y(n),e=sn(t).getTime()-w0(t).getTime();return Math.round(e/_0)+1}function Ve(n,t){var e,i,r,a,s,o,l,c;R(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=Y(n),f=h.getUTCDay(),p=(f<d?7:0)+f-d;return h.setUTCDate(h.getUTCDate()-p),h.setUTCHours(0,0,0,0),h}function ga(n,t){var e,i,r,a,s,o,l,c;R(1,arguments);var u=Y(n),d=u.getUTCFullYear(),h=Ce(),f=ht((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:h.firstWeekContainsDate)!==null&&i!==void 0?i:(l=h.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(d+1,0,f),p.setUTCHours(0,0,0,0);var y=Ve(p,t),b=new Date(0);b.setUTCFullYear(d,0,f),b.setUTCHours(0,0,0,0);var m=Ve(b,t);return u.getTime()>=y.getTime()?d+1:u.getTime()>=m.getTime()?d:d-1}function D0(n,t){var e,i,r,a,s,o,l,c;R(1,arguments);var u=Ce(),d=ht((e=(i=(r=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&r!==void 0?r:u.firstWeekContainsDate)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1),h=ga(n,t),f=new Date(0);f.setUTCFullYear(h,0,d),f.setUTCHours(0,0,0,0);var p=Ve(f,t);return p}var T0=6048e5;function Ec(n,t){R(1,arguments);var e=Y(n),i=Ve(e,t).getTime()-D0(e,t).getTime();return Math.round(i/T0)+1}function st(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}var M0={y:function(t,e){var i=t.getUTCFullYear(),r=i>0?i:1-i;return st(e==="yy"?r%100:r,e.length)},M:function(t,e){var i=t.getUTCMonth();return e==="M"?String(i+1):st(i+1,2)},d:function(t,e){return st(t.getUTCDate(),e.length)},a:function(t,e){var i=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.toUpperCase();case"aaa":return i;case"aaaaa":return i[0];case"aaaa":default:return i==="am"?"a.m.":"p.m."}},h:function(t,e){return st(t.getUTCHours()%12||12,e.length)},H:function(t,e){return st(t.getUTCHours(),e.length)},m:function(t,e){return st(t.getUTCMinutes(),e.length)},s:function(t,e){return st(t.getUTCSeconds(),e.length)},S:function(t,e){var i=e.length,r=t.getUTCMilliseconds(),a=Math.floor(r*Math.pow(10,i-3));return st(a,e.length)}};const Oe=M0;var on={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},S0={G:function(t,e,i){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(r,{width:"abbreviated"});case"GGGGG":return i.era(r,{width:"narrow"});case"GGGG":default:return i.era(r,{width:"wide"})}},y:function(t,e,i){if(e==="yo"){var r=t.getUTCFullYear(),a=r>0?r:1-r;return i.ordinalNumber(a,{unit:"year"})}return Oe.y(t,e)},Y:function(t,e,i,r){var a=ga(t,r),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return st(o,2)}return e==="Yo"?i.ordinalNumber(s,{unit:"year"}):st(s,e.length)},R:function(t,e){var i=Oc(t);return st(i,e.length)},u:function(t,e){var i=t.getUTCFullYear();return st(i,e.length)},Q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return st(r,2);case"Qo":return i.ordinalNumber(r,{unit:"quarter"});case"QQQ":return i.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,i){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return st(r,2);case"qo":return i.ordinalNumber(r,{unit:"quarter"});case"qqq":return i.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,i){var r=t.getUTCMonth();switch(e){case"M":case"MM":return Oe.M(t,e);case"Mo":return i.ordinalNumber(r+1,{unit:"month"});case"MMM":return i.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,i){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return st(r+1,2);case"Lo":return i.ordinalNumber(r+1,{unit:"month"});case"LLL":return i.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,i,r){var a=Ec(t,r);return e==="wo"?i.ordinalNumber(a,{unit:"week"}):st(a,e.length)},I:function(t,e,i){var r=Pc(t);return e==="Io"?i.ordinalNumber(r,{unit:"week"}):st(r,e.length)},d:function(t,e,i){return e==="do"?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):Oe.d(t,e)},D:function(t,e,i){var r=x0(t);return e==="Do"?i.ordinalNumber(r,{unit:"dayOfYear"}):st(r,e.length)},E:function(t,e,i){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(r,{width:"short",context:"formatting"});case"EEEE":default:return i.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return st(s,2);case"eo":return i.ordinalNumber(s,{unit:"day"});case"eee":return i.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(a,{width:"short",context:"formatting"});case"eeee":default:return i.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,i,r){var a=t.getUTCDay(),s=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return st(s,e.length);case"co":return i.ordinalNumber(s,{unit:"day"});case"ccc":return i.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(a,{width:"narrow",context:"standalone"});case"cccccc":return i.day(a,{width:"short",context:"standalone"});case"cccc":default:return i.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,i){var r=t.getUTCDay(),a=r===0?7:r;switch(e){case"i":return String(a);case"ii":return st(a,e.length);case"io":return i.ordinalNumber(a,{unit:"day"});case"iii":return i.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(r,{width:"short",context:"formatting"});case"iiii":default:return i.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,i){var r=t.getUTCHours(),a=r/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,i){var r=t.getUTCHours(),a;switch(r===12?a=on.noon:r===0?a=on.midnight:a=r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,i){var r=t.getUTCHours(),a;switch(r>=17?a=on.evening:r>=12?a=on.afternoon:r>=4?a=on.morning:a=on.night,e){case"B":case"BB":case"BBB":return i.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,i){if(e==="ho"){var r=t.getUTCHours()%12;return r===0&&(r=12),i.ordinalNumber(r,{unit:"hour"})}return Oe.h(t,e)},H:function(t,e,i){return e==="Ho"?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Oe.H(t,e)},K:function(t,e,i){var r=t.getUTCHours()%12;return e==="Ko"?i.ordinalNumber(r,{unit:"hour"}):st(r,e.length)},k:function(t,e,i){var r=t.getUTCHours();return r===0&&(r=24),e==="ko"?i.ordinalNumber(r,{unit:"hour"}):st(r,e.length)},m:function(t,e,i){return e==="mo"?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Oe.m(t,e)},s:function(t,e,i){return e==="so"?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):Oe.s(t,e)},S:function(t,e){return Oe.S(t,e)},X:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Rc(s);case"XXXX":case"XX":return je(s);case"XXXXX":case"XXX":default:return je(s,":")}},x:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Rc(s);case"xxxx":case"xx":return je(s);case"xxxxx":case"xxx":default:return je(s,":")}},O:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Ac(s,":");case"OOOO":default:return"GMT"+je(s,":")}},z:function(t,e,i,r){var a=r._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Ac(s,":");case"zzzz":default:return"GMT"+je(s,":")}},t:function(t,e,i,r){var a=r._originalDate||t,s=Math.floor(a.getTime()/1e3);return st(s,e.length)},T:function(t,e,i,r){var a=r._originalDate||t,s=a.getTime();return st(s,e.length)}};function Ac(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+st(a,2)}function Rc(n,t){if(n%60===0){var e=n>0?"-":"+";return e+st(Math.abs(n)/60,2)}return je(n,t)}function je(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=st(Math.floor(r/60),2),s=st(r%60,2);return i+a+e+s}const k0=S0;var Lc=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ic=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},C0=function(t,e){var i=t.match(/(P+)(p+)?/)||[],r=i[1],a=i[2];if(!a)return Lc(t,e);var s;switch(r){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Lc(r,e)).replace("{{time}}",Ic(a,e))},O0={p:Ic,P:C0};const pa=O0;var P0=["D","DD"],E0=["YY","YYYY"];function Nc(n){return P0.indexOf(n)!==-1}function Fc(n){return E0.indexOf(n)!==-1}function Zi(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var A0={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"}},R0=function(t,e,i){var r,a=A0[t];return typeof a=="string"?r=a:e===1?r=a.one:r=a.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r};const L0=R0;function ma(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,i=n.formats[e]||n.formats[n.defaultWidth];return i}}var I0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},N0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},F0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Y0={date:ma({formats:I0,defaultWidth:"full"}),time:ma({formats:N0,defaultWidth:"full"}),dateTime:ma({formats:F0,defaultWidth:"full"})};const W0=Y0;var U0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},B0=function(t,e,i,r){return U0[t]};const z0=B0;function Jn(n){return function(t,e){var i=e!=null&&e.context?String(e.context):"standalone",r;if(i==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;r=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return r[c]}}var H0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},V0={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"]},j0={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"]},q0={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"}},X0={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"}},G0=function(t,e){var i=Number(t),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},K0={ordinalNumber:G0,era:Jn({values:H0,defaultWidth:"wide"}),quarter:Jn({values:$0,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Jn({values:V0,defaultWidth:"wide"}),day:Jn({values:j0,defaultWidth:"wide"}),dayPeriod:Jn({values:q0,defaultWidth:"wide",formattingValues:X0,defaultFormattingWidth:"wide"})};const Z0=K0;function ti(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=e.width,r=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],a=t.match(r);if(!a)return null;var s=a[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?J0(o,function(d){return d.test(s)}):Q0(o,function(d){return d.test(s)}),c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;var u=t.slice(s.length);return{value:c,rest:u}}}function Q0(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function J0(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function tb(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=t.match(n.matchPattern);if(!i)return null;var r=i[0],a=t.match(n.parsePattern);if(!a)return null;var s=n.valueCallback?n.valueCallback(a[0]):a[0];s=e.valueCallback?e.valueCallback(s):s;var o=t.slice(r.length);return{value:s,rest:o}}}var eb=/^(\d+)(th|st|nd|rd)?/i,nb=/\d+/i,ib={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},rb={any:[/^b/i,/^(a|c)/i]},ab={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sb={any:[/1/i,/2/i,/3/i,/4/i]},ob={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},lb={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]},cb={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},ub={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]},db={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},hb={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},fb={ordinalNumber:tb({matchPattern:eb,parsePattern:nb,valueCallback:function(t){return parseInt(t,10)}}),era:ti({matchPatterns:ib,defaultMatchWidth:"wide",parsePatterns:rb,defaultParseWidth:"any"}),quarter:ti({matchPatterns:ab,defaultMatchWidth:"wide",parsePatterns:sb,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ti({matchPatterns:ob,defaultMatchWidth:"wide",parsePatterns:lb,defaultParseWidth:"any"}),day:ti({matchPatterns:cb,defaultMatchWidth:"wide",parsePatterns:ub,defaultParseWidth:"any"}),dayPeriod:ti({matchPatterns:db,defaultMatchWidth:"any",parsePatterns:hb,defaultParseWidth:"any"})},gb={code:"en-US",formatDistance:L0,formatLong:W0,formatRelative:z0,localize:Z0,match:fb,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Yc=gb;var pb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,bb=/^'([^]*?)'?$/,yb=/''/g,vb=/[a-zA-Z]/;function xb(n,t,e){var i,r,a,s,o,l,c,u,d,h,f,p,y,b,m,v,w,x;R(2,arguments);var _=String(t),D=Ce(),T=(i=(r=e==null?void 0:e.locale)!==null&&r!==void 0?r:D.locale)!==null&&i!==void 0?i:Yc,M=ht((a=(s=(o=(l=e==null?void 0:e.firstWeekContainsDate)!==null&&l!==void 0?l:e==null||(c=e.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&o!==void 0?o:D.firstWeekContainsDate)!==null&&s!==void 0?s:(d=D.locale)===null||d===void 0||(h=d.options)===null||h===void 0?void 0:h.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(M>=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var S=ht((f=(p=(y=(b=e==null?void 0:e.weekStartsOn)!==null&&b!==void 0?b:e==null||(m=e.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&y!==void 0?y:D.weekStartsOn)!==null&&p!==void 0?p:(w=D.locale)===null||w===void 0||(x=w.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:0);if(!(S>=0&&S<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!T.localize)throw new RangeError("locale must contain localize property");if(!T.formatLong)throw new RangeError("locale must contain formatLong property");var P=Y(n);if(!fa(P))throw new RangeError("Invalid time value");var L=Xi(P),E=Cc(P,L),X={firstWeekContainsDate:M,weekStartsOn:S,locale:T,_originalDate:P},wt=_.match(mb).map(function(N){var B=N[0];if(B==="p"||B==="P"){var Z=pa[B];return Z(N,T.formatLong)}return N}).join("").match(pb).map(function(N){if(N==="''")return"'";var B=N[0];if(B==="'")return wb(N);var Z=k0[B];if(Z)return!(e!=null&&e.useAdditionalWeekYearTokens)&&Fc(N)&&Zi(N,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&Nc(N)&&Zi(N,t,String(n)),Z(E,N,T.localize,X);if(B.match(vb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+B+"`");return N}).join("");return wt}function wb(n){var t=n.match(bb);return t?t[1].replace(yb,"'"):n}function _b(n,t){if(n==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function Wc(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,i=new Array(t);e<t;e++)i[e]=n[e];return i}function Db(n,t){if(n){if(typeof n=="string")return Wc(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set")return Array.from(n);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return Wc(n,t)}}function Uc(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=Db(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var i=0,r=function(){};return{s:r,n:function(){return i>=n.length?{done:!0}:{done:!1,value:n[i++]}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a=!0,s=!1,o;return{s:function(){e=e.call(n)},n:function(){var c=e.next();return a=c.done,c},e:function(c){s=!0,o=c},f:function(){try{!a&&e.return!=null&&e.return()}finally{if(s)throw o}}}}function A(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function ba(n,t){return ba=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,r){return i.__proto__=r,i},ba(n,t)}function Q(n,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&ba(n,t)}function Qi(n){return Qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Qi(n)}function Tb(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Mb(n,t){if(t&&(fe(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return A(n)}function J(n){var t=Tb();return function(){var i=Qi(n),r;if(t){var a=Qi(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return Mb(this,r)}}function G(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function Sb(n,t){if(fe(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var i=e.call(n,t||"default");if(fe(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function Bc(n){var t=Sb(n,"string");return fe(t)==="symbol"?t:String(t)}function zc(n,t){for(var e=0;e<t.length;e++){var i=t[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,Bc(i.key),i)}}function K(n,t,e){return t&&zc(n.prototype,t),e&&zc(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function O(n,t,e){return t=Bc(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var kb=10,Hc=function(){function n(){G(this,n),O(this,"priority",void 0),O(this,"subPriority",0)}return K(n,[{key:"validate",value:function(e,i){return!0}}]),n}(),Cb=function(n){Q(e,n);var t=J(e);function e(i,r,a,s,o){var l;return G(this,e),l=t.call(this),l.value=i,l.validateValue=r,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return K(e,[{key:"validate",value:function(r,a){return this.validateValue(r,this.value,a)}},{key:"set",value:function(r,a,s){return this.setValue(r,a,this.value,s)}}]),e}(Hc),Ob=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",kb),O(A(i),"subPriority",-1),i}return K(e,[{key:"set",value:function(r,a){if(a.timestampIsSet)return r;var s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}}]),e}(Hc),nt=function(){function n(){G(this,n),O(this,"incompatibleTokens",void 0),O(this,"priority",void 0),O(this,"subPriority",void 0)}return K(n,[{key:"run",value:function(e,i,r,a){var s=this.parse(e,i,r,a);return s?{setter:new Cb(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,i,r){return!0}}]),n}(),Pb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",140),O(A(i),"incompatibleTokens",["R","u","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"});case"GGGGG":return s.era(r,{width:"narrow"});case"GGGG":default:return s.era(r,{width:"wide"})||s.era(r,{width:"abbreviated"})||s.era(r,{width:"narrow"})}}},{key:"set",value:function(r,a,s){return a.era=s,r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Tt={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}/},ee={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 Mt(n,t){return n&&{value:t(n.value),rest:n.rest}}function bt(n,t){var e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function ne(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var i=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,a=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:i*(r*Zn+a*Gi+s*Km),rest:t.slice(e[0].length)}}function $c(n){return bt(Tt.anyDigitsSigned,n)}function _t(n,t){switch(n){case 1:return bt(Tt.singleDigit,t);case 2:return bt(Tt.twoDigits,t);case 3:return bt(Tt.threeDigits,t);case 4:return bt(Tt.fourDigits,t);default:return bt(new RegExp("^\\d{1,"+n+"}"),t)}}function Ji(n,t){switch(n){case 1:return bt(Tt.singleDigitSigned,t);case 2:return bt(Tt.twoDigitsSigned,t);case 3:return bt(Tt.threeDigitsSigned,t);case 4:return bt(Tt.fourDigitsSigned,t);default:return bt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function ya(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 Vc(n,t){var e=t>0,i=e?t:1-t,r;if(i<=50)r=n||100;else{var a=i+50,s=Math.floor(a/100)*100,o=n>=a%100;r=n+s-(o?100:0)}return e?r:1-r}function jc(n){return n%400===0||n%4===0&&n%100!==0}var Eb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",130),O(A(i),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return Mt(_t(4,r),o);case"yo":return Mt(s.ordinalNumber(r,{unit:"year"}),o);default:return Mt(_t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s){var o=r.getUTCFullYear();if(s.isTwoDigitYear){var l=Vc(s.year,o);return r.setUTCFullYear(l,0,1),r.setUTCHours(0,0,0,0),r}var c=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(c,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Ab=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",130),O(A(i),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return Mt(_t(4,r),o);case"Yo":return Mt(s.ordinalNumber(r,{unit:"year"}),o);default:return Mt(_t(a.length,r),o)}}},{key:"validate",value:function(r,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(r,a,s,o){var l=ga(r,o);if(s.isTwoDigitYear){var c=Vc(s.year,l);return r.setUTCFullYear(c,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),Ve(r,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return r.setUTCFullYear(u,0,o.firstWeekContainsDate),r.setUTCHours(0,0,0,0),Ve(r,o)}}]),e}(nt),Rb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",130),O(A(i),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a){return Ji(a==="R"?4:a.length,r)}},{key:"set",value:function(r,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),sn(o)}}]),e}(nt),Lb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",130),O(A(i),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a){return Ji(a==="u"?4:a.length,r)}},{key:"set",value:function(r,a,s){return r.setUTCFullYear(s,0,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Ib=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",120),O(A(i),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"Q":case"QQ":return _t(a.length,r);case"Qo":return s.ordinalNumber(r,{unit:"quarter"});case"QQQ":return s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(r,{width:"wide",context:"formatting"})||s.quarter(r,{width:"abbreviated",context:"formatting"})||s.quarter(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Nb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",120),O(A(i),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"q":case"qq":return _t(a.length,r);case"qo":return s.ordinalNumber(r,{unit:"quarter"});case"qqq":return s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(r,{width:"wide",context:"standalone"})||s.quarter(r,{width:"abbreviated",context:"standalone"})||s.quarter(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=1&&a<=4}},{key:"set",value:function(r,a,s){return r.setUTCMonth((s-1)*3,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Fb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),O(A(i),"priority",110),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"M":return Mt(bt(Tt.month,r),o);case"MM":return Mt(_t(2,r),o);case"Mo":return Mt(s.ordinalNumber(r,{unit:"month"}),o);case"MMM":return s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(r,{width:"wide",context:"formatting"})||s.month(r,{width:"abbreviated",context:"formatting"})||s.month(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Yb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",110),O(A(i),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c-1};switch(a){case"L":return Mt(bt(Tt.month,r),o);case"LL":return Mt(_t(2,r),o);case"Lo":return Mt(s.ordinalNumber(r,{unit:"month"}),o);case"LLL":return s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(r,{width:"wide",context:"standalone"})||s.month(r,{width:"abbreviated",context:"standalone"})||s.month(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){return r.setUTCMonth(s,1),r.setUTCHours(0,0,0,0),r}}]),e}(nt);function Wb(n,t,e){R(2,arguments);var i=Y(n),r=ht(t),a=Ec(i,e)-r;return i.setUTCDate(i.getUTCDate()-a*7),i}var Ub=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",100),O(A(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"w":return bt(Tt.week,r);case"wo":return s.ordinalNumber(r,{unit:"week"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s,o){return Ve(Wb(r,s,o),o)}}]),e}(nt);function Bb(n,t){R(2,arguments);var e=Y(n),i=ht(t),r=Pc(e)-i;return e.setUTCDate(e.getUTCDate()-r*7),e}var zb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",100),O(A(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"I":return bt(Tt.week,r);case"Io":return s.ordinalNumber(r,{unit:"week"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=53}},{key:"set",value:function(r,a,s){return sn(Bb(r,s))}}]),e}(nt),Hb=[31,28,31,30,31,30,31,31,30,31,30,31],$b=[31,29,31,30,31,30,31,31,30,31,30,31],Vb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",90),O(A(i),"subPriority",1),O(A(i),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"d":return bt(Tt.date,r);case"do":return s.ordinalNumber(r,{unit:"date"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=jc(s),l=r.getUTCMonth();return o?a>=1&&a<=$b[l]:a>=1&&a<=Hb[l]}},{key:"set",value:function(r,a,s){return r.setUTCDate(s),r.setUTCHours(0,0,0,0),r}}]),e}(nt),jb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",90),O(A(i),"subpriority",1),O(A(i),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"D":case"DD":return bt(Tt.dayOfYear,r);case"Do":return s.ordinalNumber(r,{unit:"date"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){var s=r.getUTCFullYear(),o=jc(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(r,a,s){return r.setUTCMonth(0,s),r.setUTCHours(0,0,0,0),r}}]),e}(nt);function va(n,t,e){var i,r,a,s,o,l,c,u;R(2,arguments);var d=Ce(),h=ht((i=(r=(a=(s=e==null?void 0:e.weekStartsOn)!==null&&s!==void 0?s:e==null||(o=e.locale)===null||o===void 0||(l=o.options)===null||l===void 0?void 0:l.weekStartsOn)!==null&&a!==void 0?a:d.weekStartsOn)!==null&&r!==void 0?r:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Y(n),p=ht(t),y=f.getUTCDay(),b=p%7,m=(b+7)%7,v=(m<h?7:0)+p-y;return f.setUTCDate(f.getUTCDate()+v),f}var qb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",90),O(A(i),"incompatibleTokens",["D","i","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=va(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Xb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",90),O(A(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"e":case"ee":return Mt(_t(a.length,r),l);case"eo":return Mt(s.ordinalNumber(r,{unit:"day"}),l);case"eee":return s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeeee":return s.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=va(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Gb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",90),O(A(i),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s,o){var l=function(u){var d=Math.floor((u-1)/7)*7;return(u+o.weekStartsOn+6)%7+d};switch(a){case"c":case"cc":return Mt(_t(a.length,r),l);case"co":return Mt(s.ordinalNumber(r,{unit:"day"}),l);case"ccc":return s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"ccccc":return s.day(r,{width:"narrow",context:"standalone"});case"cccccc":return s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(r,{width:"wide",context:"standalone"})||s.day(r,{width:"abbreviated",context:"standalone"})||s.day(r,{width:"short",context:"standalone"})||s.day(r,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(r,a){return a>=0&&a<=6}},{key:"set",value:function(r,a,s,o){return r=va(r,s,o),r.setUTCHours(0,0,0,0),r}}]),e}(nt);function Kb(n,t){R(2,arguments);var e=ht(t);e%7===0&&(e=e-7);var i=1,r=Y(n),a=r.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<i?7:0)+e-a;return r.setUTCDate(r.getUTCDate()+l),r}var Zb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",90),O(A(i),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return _t(a.length,r);case"io":return s.ordinalNumber(r,{unit:"day"});case"iii":return Mt(s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiii":return Mt(s.day(r,{width:"narrow",context:"formatting"}),o);case"iiiiii":return Mt(s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o);case"iiii":default:return Mt(s.day(r,{width:"wide",context:"formatting"})||s.day(r,{width:"abbreviated",context:"formatting"})||s.day(r,{width:"short",context:"formatting"})||s.day(r,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(r,a){return a>=1&&a<=7}},{key:"set",value:function(r,a,s){return r=Kb(r,s),r.setUTCHours(0,0,0,0),r}}]),e}(nt),Qb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",80),O(A(i),"incompatibleTokens",["b","B","H","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(ya(s),0,0,0),r}}]),e}(nt),Jb=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",80),O(A(i),"incompatibleTokens",["a","B","H","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(ya(s),0,0,0),r}}]),e}(nt),ty=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",80),O(A(i),"incompatibleTokens",["a","b","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(r,{width:"wide",context:"formatting"})||s.dayPeriod(r,{width:"abbreviated",context:"formatting"})||s.dayPeriod(r,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(r,a,s){return r.setUTCHours(ya(s),0,0,0),r}}]),e}(nt),ey=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",70),O(A(i),"incompatibleTokens",["H","K","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"h":return bt(Tt.hour12h,r);case"ho":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=12}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):!o&&s===12?r.setUTCHours(0,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(nt),ny=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",70),O(A(i),"incompatibleTokens",["a","b","h","K","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"H":return bt(Tt.hour23h,r);case"Ho":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=23}},{key:"set",value:function(r,a,s){return r.setUTCHours(s,0,0,0),r}}]),e}(nt),iy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",70),O(A(i),"incompatibleTokens",["h","H","k","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"K":return bt(Tt.hour11h,r);case"Ko":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=11}},{key:"set",value:function(r,a,s){var o=r.getUTCHours()>=12;return o&&s<12?r.setUTCHours(s+12,0,0,0):r.setUTCHours(s,0,0,0),r}}]),e}(nt),ry=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",70),O(A(i),"incompatibleTokens",["a","b","h","H","K","t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"k":return bt(Tt.hour24h,r);case"ko":return s.ordinalNumber(r,{unit:"hour"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=1&&a<=24}},{key:"set",value:function(r,a,s){var o=s<=24?s%24:s;return r.setUTCHours(o,0,0,0),r}}]),e}(nt),ay=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",60),O(A(i),"incompatibleTokens",["t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"m":return bt(Tt.minute,r);case"mo":return s.ordinalNumber(r,{unit:"minute"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCMinutes(s,0,0),r}}]),e}(nt),sy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",50),O(A(i),"incompatibleTokens",["t","T"]),i}return K(e,[{key:"parse",value:function(r,a,s){switch(a){case"s":return bt(Tt.second,r);case"so":return s.ordinalNumber(r,{unit:"second"});default:return _t(a.length,r)}}},{key:"validate",value:function(r,a){return a>=0&&a<=59}},{key:"set",value:function(r,a,s){return r.setUTCSeconds(s,0),r}}]),e}(nt),oy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",30),O(A(i),"incompatibleTokens",["t","T"]),i}return K(e,[{key:"parse",value:function(r,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return Mt(_t(a.length,r),s)}},{key:"set",value:function(r,a,s){return r.setUTCMilliseconds(s),r}}]),e}(nt),ly=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",10),O(A(i),"incompatibleTokens",["t","T","x"]),i}return K(e,[{key:"parse",value:function(r,a){switch(a){case"X":return ne(ee.basicOptionalMinutes,r);case"XX":return ne(ee.basic,r);case"XXXX":return ne(ee.basicOptionalSeconds,r);case"XXXXX":return ne(ee.extendedOptionalSeconds,r);case"XXX":default:return ne(ee.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(nt),cy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",10),O(A(i),"incompatibleTokens",["t","T","X"]),i}return K(e,[{key:"parse",value:function(r,a){switch(a){case"x":return ne(ee.basicOptionalMinutes,r);case"xx":return ne(ee.basic,r);case"xxxx":return ne(ee.basicOptionalSeconds,r);case"xxxxx":return ne(ee.extendedOptionalSeconds,r);case"xxx":default:return ne(ee.extended,r)}}},{key:"set",value:function(r,a,s){return a.timestampIsSet?r:new Date(r.getTime()-s)}}]),e}(nt),uy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",40),O(A(i),"incompatibleTokens","*"),i}return K(e,[{key:"parse",value:function(r){return $c(r)}},{key:"set",value:function(r,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(nt),dy=function(n){Q(e,n);var t=J(e);function e(){var i;G(this,e);for(var r=arguments.length,a=new Array(r),s=0;s<r;s++)a[s]=arguments[s];return i=t.call.apply(t,[this].concat(a)),O(A(i),"priority",20),O(A(i),"incompatibleTokens","*"),i}return K(e,[{key:"parse",value:function(r){return $c(r)}},{key:"set",value:function(r,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(nt),hy={G:new Pb,y:new Eb,Y:new Ab,R:new Rb,u:new Lb,Q:new Ib,q:new Nb,M:new Fb,L:new Yb,w:new Ub,I:new zb,d:new Vb,D:new jb,E:new qb,e:new Xb,c:new Gb,i:new Zb,a:new Qb,b:new Jb,B:new ty,h:new ey,H:new ny,K:new iy,k:new ry,m:new ay,s:new sy,S:new oy,X:new ly,x:new cy,t:new uy,T:new dy},fy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,py=/^'([^]*?)'?$/,my=/''/g,by=/\S/,yy=/[a-zA-Z]/;function vy(n,t,e,i){var r,a,s,o,l,c,u,d,h,f,p,y,b,m,v,w,x,_;R(3,arguments);var D=String(n),T=String(t),M=Ce(),S=(r=(a=i==null?void 0:i.locale)!==null&&a!==void 0?a:M.locale)!==null&&r!==void 0?r:Yc;if(!S.match)throw new RangeError("locale must contain match property");var P=ht((s=(o=(l=(c=i==null?void 0:i.firstWeekContainsDate)!==null&&c!==void 0?c:i==null||(u=i.locale)===null||u===void 0||(d=u.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&l!==void 0?l:M.firstWeekContainsDate)!==null&&o!==void 0?o:(h=M.locale)===null||h===void 0||(f=h.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(P>=1&&P<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var L=ht((p=(y=(b=(m=i==null?void 0:i.weekStartsOn)!==null&&m!==void 0?m:i==null||(v=i.locale)===null||v===void 0||(w=v.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&b!==void 0?b:M.weekStartsOn)!==null&&y!==void 0?y:(x=M.locale)===null||x===void 0||(_=x.options)===null||_===void 0?void 0:_.weekStartsOn)!==null&&p!==void 0?p:0);if(!(L>=0&&L<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(T==="")return D===""?Y(e):new Date(NaN);var E={firstWeekContainsDate:P,weekStartsOn:L,locale:S},X=[new Ob],wt=T.match(gy).map(function(lt){var et=lt[0];if(et in pa){var It=pa[et];return It(lt,S.formatLong)}return lt}).join("").match(fy),N=[],B=Uc(wt),Z;try{var Ct=function(){var et=Z.value;!(i!=null&&i.useAdditionalWeekYearTokens)&&Fc(et)&&Zi(et,T,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Nc(et)&&Zi(et,T,n);var It=et[0],pe=hy[It];if(pe){var pr=pe.incompatibleTokens;if(Array.isArray(pr)){var mr=N.find(function(br){return pr.includes(br.token)||br.token===It});if(mr)throw new RangeError("The format string mustn't contain `".concat(mr.fullToken,"` and `").concat(et,"` at the same time"))}else if(pe.incompatibleTokens==="*"&&N.length>0)throw new RangeError("The format string mustn't contain `".concat(et,"` and any other token at the same time"));N.push({token:It,fullToken:et});var hi=pe.run(D,et,S.match,E);if(!hi)return{v:new Date(NaN)};X.push(hi.setter),D=hi.rest}else{if(It.match(yy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+It+"`");if(et==="''"?et="'":It==="'"&&(et=xy(et)),D.indexOf(et)===0)D=D.slice(et.length);else return{v:new Date(NaN)}}};for(B.s();!(Z=B.n()).done;){var C=Ct();if(fe(C)==="object")return C.v}}catch(lt){B.e(lt)}finally{B.f()}if(D.length>0&&by.test(D))return new Date(NaN);var I=X.map(function(lt){return lt.priority}).sort(function(lt,et){return et-lt}).filter(function(lt,et,It){return It.indexOf(lt)===et}).map(function(lt){return X.filter(function(et){return et.priority===lt}).sort(function(et,It){return It.subPriority-et.subPriority})}).map(function(lt){return lt[0]}),F=Y(e);if(isNaN(F.getTime()))return new Date(NaN);var $=Cc(F,Xi(F)),V={},j=Uc(I),pt;try{for(j.s();!(pt=j.n()).done;){var ft=pt.value;if(!ft.validate($,E))return new Date(NaN);var it=ft.set($,V,E);Array.isArray(it)?($=it[0],_b(V,it[1])):$=it}}catch(lt){j.e(lt)}finally{j.f()}return $}function xy(n){return n.match(py)[1].replace(my,"'")}function wy(n){R(1,arguments);var t=Y(n);return t.setMinutes(0,0,0),t}function _y(n){R(1,arguments);var t=Y(n);return t.setMilliseconds(0),t}function Dy(n){R(1,arguments);var t=n/Zn;return Math.floor(t)}function qc(n,t){var e;R(1,arguments);var i=ht((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=ky(n),a;if(r.date){var s=Cy(r.date,i);a=Oy(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(r.time&&(l=Py(r.time),isNaN(l)))return new Date(NaN);if(r.timezone){if(c=Ey(r.timezone),isNaN(c))return new Date(NaN)}else{var u=new Date(o+l),d=new Date(0);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return new Date(o+l+c)}var tr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Ty=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,My=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Sy=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ky(n){var t={},e=n.split(tr.dateTimeDelimiter),i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],tr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(tr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){var r=tr.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function Cy(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};var r=i[1]?parseInt(i[1]):null,a=i[2]?parseInt(i[2]):null;return{year:a===null?r:a*100,restDateString:n.slice((i[1]||i[2]).length)}}function Oy(n,t){if(t===null)return new Date(NaN);var e=n.match(Ty);if(!e)return new Date(NaN);var i=!!e[4],r=ei(e[1]),a=ei(e[2])-1,s=ei(e[3]),o=ei(e[4]),l=ei(e[5])-1;if(i)return Ny(t,o,l)?Ay(t,o,l):new Date(NaN);var c=new Date(0);return!Ly(t,a,s)||!Iy(t,r)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(r,s)),c)}function ei(n){return n?parseInt(n):1}function Py(n){var t=n.match(My);if(!t)return NaN;var e=xa(t[1]),i=xa(t[2]),r=xa(t[3]);return Fy(e,i,r)?e*Zn+i*Gi+r*1e3:NaN}function xa(n){return n&&parseFloat(n.replace(",","."))||0}function Ey(n){if(n==="Z")return 0;var t=n.match(Sy);if(!t)return 0;var e=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return Yy(i,r)?e*(i*Zn+r*Gi):NaN}function Ay(n,t,e){var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=(t-1)*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Ry=[31,null,31,30,31,30,31,31,30,31,30,31];function Xc(n){return n%400===0||n%4===0&&n%100!==0}function Ly(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Ry[t]||(Xc(n)?29:28))}function Iy(n,t){return t>=1&&t<=(Xc(n)?366:365)}function Ny(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Fy(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Yy(n,t){return t>=0&&t<=59}function Wy(n){R(1,arguments);var t=n/Zm;return Math.floor(t)}var Et=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(Et||{}),er=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(er||{}),yt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(yt||{}),ln=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(ln||{});const wa=(n,t)=>{var i,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}if(e.body&&!n.locked){const a=e.labelColors,s=((r=(i=t.chart.config)==null?void 0:i.options)==null?void 0:r.indexAxis)==="y"?"x":"y",o=[Et.HORIZONTAL_BAR,Et.VERTICAL_BAR].includes(n.chartType),l=[er.GAUGE,Et.DOUGHNUT].includes(n.chartType);n.tooltipContext=o?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((c,u)=>{const d=l?c.parsed:c.parsed[s];let h;n.units==="bytes"?h=isNaN(d)?d:ua(d):h=`${d%1===0?fs.format(d):fs.format(Number(d.toFixed(ix)))} ${n.units}`;const f=o&&c.dataset.label!==c.label?c.dataset.label:l?c.dataset.labels[c.dataIndex]:c.dataset.label;return{backgroundColor:a[u].backgroundColor,borderColor:a[u].borderColor,label:f,value:h,rawValue:d}}).sort((c,u)=>u.rawValue-c.rawValue),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Uy=n=>n&&n.datasets&&n.datasets.length,By=n=>Uy(n)&&n.datasets.some(t=>t.data.length),zy=n=>By(n)&&n.datasets.some(t=>t.data.length>1),Hy=n=>zy(n)&&n.datasets.some(t=>t.data[0]&&fa(t.data[0].x)),$y=n=>Hy(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),_a=(n,t,e)=>{const r=Math.min(t/1150,1),a=.15,s=1.15;return n.x<e?n.x+t*a*(1-r):n.x-t*s*(1-r)},Vy=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function ni(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Da={exports:{}},Gc={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Gc);var vt=Gc.exports,Ta={exports:{}},Ma={exports:{}},Kc={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Kc);var Zc=Kc.exports,Sa={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(r.length<i)throw new TypeError(i+" argument"+(i>1?"s":"")+" required, but only "+r.length+" present")}n.exports=t.default})(Sa,Sa.exports);var Nt=Sa.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Zc),r=e(Nt);function a(s){return(0,r.default)(1,arguments),s instanceof Date||(0,i.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ma,Ma.exports);var jy=Ma.exports,ka={exports:{}};(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(Zc),r=e(Nt);function a(s){(0,r.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,i.default)(s)==="object"&&o==="[object Date]"?new Date(s.getTime()):typeof s=="number"||o==="[object Number]"?new Date(s):((typeof s=="string"||o==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}n.exports=t.default})(ka,ka.exports);var ie=ka.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(jy),r=e(ie),a=e(Nt);function s(o){if((0,a.default)(1,arguments),!(0,i.default)(o)&&typeof o!="number")return!1;var l=(0,r.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Ta,Ta.exports);var qy=Ta.exports,Ca={exports:{}},Oa={exports:{}},Pa={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(Pa,Pa.exports);var qe=Pa.exports;const Xy=ni(qe);(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(qe),r=e(ie),a=e(Nt);function s(o,l){(0,a.default)(2,arguments);var c=(0,r.default)(o).getTime(),u=(0,i.default)(l);return new Date(c+u)}n.exports=t.default})(Oa,Oa.exports);var Gy=Oa.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Gy),r=e(Nt),a=e(qe);function s(o,l){(0,r.default)(2,arguments);var c=(0,a.default)(l);return(0,i.default)(o,-c)}n.exports=t.default})(Ca,Ca.exports);var Ky=Ca.exports,Ea={exports:{}},Aa={exports:{}};(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(ie),r=e(Nt),a=864e5;function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getTime();l.setUTCMonth(0,1),l.setUTCHours(0,0,0,0);var u=l.getTime(),d=c-u;return Math.floor(d/a)+1}n.exports=t.default})(Aa,Aa.exports);var Zy=Aa.exports,Ra={exports:{}},La={exports:{}};(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var i=e(ie),r=e(Nt);function a(s){(0,r.default)(1,arguments);var o=1,l=(0,i.default)(s),c=l.getUTCDay(),u=(c<o?7:0)+c-o;return l.setUTCDate(l.getUTCDate()-u),l.setUTCHours(0,0,0,0),l}n.exports=t.default})(La,La.exports);var Ia=La.exports,Na={exports:{}},Fa={exports:{}};(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(ie),r=e(Nt),a=e(Ia);function s(o){(0,r.default)(1,arguments);var l=(0,i.default)(o),c=l.getUTCFullYear(),u=new Date(0);u.setUTCFullYear(c+1,0,4),u.setUTCHours(0,0,0,0);var d=(0,a.default)(u),h=new Date(0);h.setUTCFullYear(c,0,4),h.setUTCHours(0,0,0,0);var f=(0,a.default)(h);return l.getTime()>=d.getTime()?c+1:l.getTime()>=f.getTime()?c:c-1}n.exports=t.default})(Fa,Fa.exports);var Qc=Fa.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var i=e(Qc),r=e(Ia),a=e(Nt);function s(o){(0,a.default)(1,arguments);var l=(0,i.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,r.default)(c);return u}n.exports=t.default})(Na,Na.exports);var Qy=Na.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(ie),r=e(Ia),a=e(Qy),s=e(Nt),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,i.default)(c),d=(0,r.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})(Ra,Ra.exports);var Jy=Ra.exports,Ya={exports:{}},Wa={exports:{}},Xe={};Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.getDefaultOptions=tv,Xe.setDefaultOptions=ev;var Jc={};function tv(){return Jc}function ev(n){Jc=n}(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var i=e(ie),r=e(Nt),a=e(qe),s=Xe;function o(l,c){var u,d,h,f,p,y,b,m;(0,r.default)(1,arguments);var v=(0,s.getDefaultOptions)(),w=(0,a.default)((u=(d=(h=(f=c==null?void 0:c.weekStartsOn)!==null&&f!==void 0?f:c==null||(p=c.locale)===null||p===void 0||(y=p.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&h!==void 0?h:v.weekStartsOn)!==null&&d!==void 0?d:(b=v.locale)===null||b===void 0||(m=b.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&u!==void 0?u:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var x=(0,i.default)(l),_=x.getUTCDay(),D=(_<w?7:0)+_-w;return x.setUTCDate(x.getUTCDate()-D),x.setUTCHours(0,0,0,0),x}n.exports=t.default})(Wa,Wa.exports);var Ua=Wa.exports,Ba={exports:{}},za={exports:{}};(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(ie),r=e(Nt),a=e(Ua),s=e(qe),o=Xe;function l(c,u){var d,h,f,p,y,b,m,v;(0,r.default)(1,arguments);var w=(0,i.default)(c),x=w.getUTCFullYear(),_=(0,o.getDefaultOptions)(),D=(0,s.default)((d=(h=(f=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(y=u.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&f!==void 0?f:_.firstWeekContainsDate)!==null&&h!==void 0?h:(m=_.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(D>=1&&D<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var T=new Date(0);T.setUTCFullYear(x+1,0,D),T.setUTCHours(0,0,0,0);var M=(0,a.default)(T,u),S=new Date(0);S.setUTCFullYear(x,0,D),S.setUTCHours(0,0,0,0);var P=(0,a.default)(S,u);return w.getTime()>=M.getTime()?x+1:w.getTime()>=P.getTime()?x:x-1}n.exports=t.default})(za,za.exports);var tu=za.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(tu),r=e(Nt),a=e(Ua),s=e(qe),o=Xe;function l(c,u){var d,h,f,p,y,b,m,v;(0,r.default)(1,arguments);var w=(0,o.getDefaultOptions)(),x=(0,s.default)((d=(h=(f=(p=u==null?void 0:u.firstWeekContainsDate)!==null&&p!==void 0?p:u==null||(y=u.locale)===null||y===void 0||(b=y.options)===null||b===void 0?void 0:b.firstWeekContainsDate)!==null&&f!==void 0?f:w.firstWeekContainsDate)!==null&&h!==void 0?h:(m=w.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1),_=(0,i.default)(c,u),D=new Date(0);D.setUTCFullYear(_,0,x),D.setUTCHours(0,0,0,0);var T=(0,a.default)(D,u);return T}n.exports=t.default})(Ba,Ba.exports);var nv=Ba.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var i=e(ie),r=e(Ua),a=e(nv),s=e(Nt),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,i.default)(c),h=(0,r.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(h/o)+1}n.exports=t.default})(Ya,Ya.exports);var iv=Ya.exports,Ha={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){for(var a=i<0?"-":"",s=Math.abs(i).toString();s.length<r;)s="0"+s;return a+s}n.exports=t.default})(Ha,Ha.exports);var eu=Ha.exports,$a={exports:{}};(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(eu),r={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,i.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,i.default)(c+1,2)},d:function(o,l){return(0,i.default)(o.getUTCDate(),l.length)},a:function(o,l){var c=o.getUTCHours()/12>=1?"pm":"am";switch(l){case"a":case"aa":return c.toUpperCase();case"aaa":return c;case"aaaaa":return c[0];case"aaaa":default:return c==="am"?"a.m.":"p.m."}},h:function(o,l){return(0,i.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,i.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,i.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,i.default)(o.getUTCSeconds(),l.length)},S:function(o,l){var c=l.length,u=o.getUTCMilliseconds(),d=Math.floor(u*Math.pow(10,c-3));return(0,i.default)(d,l.length)}},a=r;t.default=a,n.exports=t.default})($a,$a.exports);var rv=$a.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(Zy),r=e(Jy),a=e(Qc),s=e(iv),o=e(tu),l=e(eu),c=e(rv),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(m,v,w){var x=m.getUTCFullYear()>0?1:0;switch(v){case"G":case"GG":case"GGG":return w.era(x,{width:"abbreviated"});case"GGGGG":return w.era(x,{width:"narrow"});case"GGGG":default:return w.era(x,{width:"wide"})}},y:function(m,v,w){if(v==="yo"){var x=m.getUTCFullYear(),_=x>0?x:1-x;return w.ordinalNumber(_,{unit:"year"})}return c.default.y(m,v)},Y:function(m,v,w,x){var _=(0,o.default)(m,x),D=_>0?_:1-_;if(v==="YY"){var T=D%100;return(0,l.default)(T,2)}return v==="Yo"?w.ordinalNumber(D,{unit:"year"}):(0,l.default)(D,v.length)},R:function(m,v){var w=(0,a.default)(m);return(0,l.default)(w,v.length)},u:function(m,v){var w=m.getUTCFullYear();return(0,l.default)(w,v.length)},Q:function(m,v,w){var x=Math.ceil((m.getUTCMonth()+1)/3);switch(v){case"Q":return String(x);case"QQ":return(0,l.default)(x,2);case"Qo":return w.ordinalNumber(x,{unit:"quarter"});case"QQQ":return w.quarter(x,{width:"abbreviated",context:"formatting"});case"QQQQQ":return w.quarter(x,{width:"narrow",context:"formatting"});case"QQQQ":default:return w.quarter(x,{width:"wide",context:"formatting"})}},q:function(m,v,w){var x=Math.ceil((m.getUTCMonth()+1)/3);switch(v){case"q":return String(x);case"qq":return(0,l.default)(x,2);case"qo":return w.ordinalNumber(x,{unit:"quarter"});case"qqq":return w.quarter(x,{width:"abbreviated",context:"standalone"});case"qqqqq":return w.quarter(x,{width:"narrow",context:"standalone"});case"qqqq":default:return w.quarter(x,{width:"wide",context:"standalone"})}},M:function(m,v,w){var x=m.getUTCMonth();switch(v){case"M":case"MM":return c.default.M(m,v);case"Mo":return w.ordinalNumber(x+1,{unit:"month"});case"MMM":return w.month(x,{width:"abbreviated",context:"formatting"});case"MMMMM":return w.month(x,{width:"narrow",context:"formatting"});case"MMMM":default:return w.month(x,{width:"wide",context:"formatting"})}},L:function(m,v,w){var x=m.getUTCMonth();switch(v){case"L":return String(x+1);case"LL":return(0,l.default)(x+1,2);case"Lo":return w.ordinalNumber(x+1,{unit:"month"});case"LLL":return w.month(x,{width:"abbreviated",context:"standalone"});case"LLLLL":return w.month(x,{width:"narrow",context:"standalone"});case"LLLL":default:return w.month(x,{width:"wide",context:"standalone"})}},w:function(m,v,w,x){var _=(0,s.default)(m,x);return v==="wo"?w.ordinalNumber(_,{unit:"week"}):(0,l.default)(_,v.length)},I:function(m,v,w){var x=(0,r.default)(m);return v==="Io"?w.ordinalNumber(x,{unit:"week"}):(0,l.default)(x,v.length)},d:function(m,v,w){return v==="do"?w.ordinalNumber(m.getUTCDate(),{unit:"date"}):c.default.d(m,v)},D:function(m,v,w){var x=(0,i.default)(m);return v==="Do"?w.ordinalNumber(x,{unit:"dayOfYear"}):(0,l.default)(x,v.length)},E:function(m,v,w){var x=m.getUTCDay();switch(v){case"E":case"EE":case"EEE":return w.day(x,{width:"abbreviated",context:"formatting"});case"EEEEE":return w.day(x,{width:"narrow",context:"formatting"});case"EEEEEE":return w.day(x,{width:"short",context:"formatting"});case"EEEE":default:return w.day(x,{width:"wide",context:"formatting"})}},e:function(m,v,w,x){var _=m.getUTCDay(),D=(_-x.weekStartsOn+8)%7||7;switch(v){case"e":return String(D);case"ee":return(0,l.default)(D,2);case"eo":return w.ordinalNumber(D,{unit:"day"});case"eee":return w.day(_,{width:"abbreviated",context:"formatting"});case"eeeee":return w.day(_,{width:"narrow",context:"formatting"});case"eeeeee":return w.day(_,{width:"short",context:"formatting"});case"eeee":default:return w.day(_,{width:"wide",context:"formatting"})}},c:function(m,v,w,x){var _=m.getUTCDay(),D=(_-x.weekStartsOn+8)%7||7;switch(v){case"c":return String(D);case"cc":return(0,l.default)(D,v.length);case"co":return w.ordinalNumber(D,{unit:"day"});case"ccc":return w.day(_,{width:"abbreviated",context:"standalone"});case"ccccc":return w.day(_,{width:"narrow",context:"standalone"});case"cccccc":return w.day(_,{width:"short",context:"standalone"});case"cccc":default:return w.day(_,{width:"wide",context:"standalone"})}},i:function(m,v,w){var x=m.getUTCDay(),_=x===0?7:x;switch(v){case"i":return String(_);case"ii":return(0,l.default)(_,v.length);case"io":return w.ordinalNumber(_,{unit:"day"});case"iii":return w.day(x,{width:"abbreviated",context:"formatting"});case"iiiii":return w.day(x,{width:"narrow",context:"formatting"});case"iiiiii":return w.day(x,{width:"short",context:"formatting"});case"iiii":default:return w.day(x,{width:"wide",context:"formatting"})}},a:function(m,v,w){var x=m.getUTCHours(),_=x/12>=1?"pm":"am";switch(v){case"a":case"aa":return w.dayPeriod(_,{width:"abbreviated",context:"formatting"});case"aaa":return w.dayPeriod(_,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return w.dayPeriod(_,{width:"narrow",context:"formatting"});case"aaaa":default:return w.dayPeriod(_,{width:"wide",context:"formatting"})}},b:function(m,v,w){var x=m.getUTCHours(),_;switch(x===12?_=u.noon:x===0?_=u.midnight:_=x/12>=1?"pm":"am",v){case"b":case"bb":return w.dayPeriod(_,{width:"abbreviated",context:"formatting"});case"bbb":return w.dayPeriod(_,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return w.dayPeriod(_,{width:"narrow",context:"formatting"});case"bbbb":default:return w.dayPeriod(_,{width:"wide",context:"formatting"})}},B:function(m,v,w){var x=m.getUTCHours(),_;switch(x>=17?_=u.evening:x>=12?_=u.afternoon:x>=4?_=u.morning:_=u.night,v){case"B":case"BB":case"BBB":return w.dayPeriod(_,{width:"abbreviated",context:"formatting"});case"BBBBB":return w.dayPeriod(_,{width:"narrow",context:"formatting"});case"BBBB":default:return w.dayPeriod(_,{width:"wide",context:"formatting"})}},h:function(m,v,w){if(v==="ho"){var x=m.getUTCHours()%12;return x===0&&(x=12),w.ordinalNumber(x,{unit:"hour"})}return c.default.h(m,v)},H:function(m,v,w){return v==="Ho"?w.ordinalNumber(m.getUTCHours(),{unit:"hour"}):c.default.H(m,v)},K:function(m,v,w){var x=m.getUTCHours()%12;return v==="Ko"?w.ordinalNumber(x,{unit:"hour"}):(0,l.default)(x,v.length)},k:function(m,v,w){var x=m.getUTCHours();return x===0&&(x=24),v==="ko"?w.ordinalNumber(x,{unit:"hour"}):(0,l.default)(x,v.length)},m:function(m,v,w){return v==="mo"?w.ordinalNumber(m.getUTCMinutes(),{unit:"minute"}):c.default.m(m,v)},s:function(m,v,w){return v==="so"?w.ordinalNumber(m.getUTCSeconds(),{unit:"second"}):c.default.s(m,v)},S:function(m,v){return c.default.S(m,v)},X:function(m,v,w,x){var _=x._originalDate||m,D=_.getTimezoneOffset();if(D===0)return"Z";switch(v){case"X":return f(D);case"XXXX":case"XX":return p(D);case"XXXXX":case"XXX":default:return p(D,":")}},x:function(m,v,w,x){var _=x._originalDate||m,D=_.getTimezoneOffset();switch(v){case"x":return f(D);case"xxxx":case"xx":return p(D);case"xxxxx":case"xxx":default:return p(D,":")}},O:function(m,v,w,x){var _=x._originalDate||m,D=_.getTimezoneOffset();switch(v){case"O":case"OO":case"OOO":return"GMT"+h(D,":");case"OOOO":default:return"GMT"+p(D,":")}},z:function(m,v,w,x){var _=x._originalDate||m,D=_.getTimezoneOffset();switch(v){case"z":case"zz":case"zzz":return"GMT"+h(D,":");case"zzzz":default:return"GMT"+p(D,":")}},t:function(m,v,w,x){var _=x._originalDate||m,D=Math.floor(_.getTime()/1e3);return(0,l.default)(D,v.length)},T:function(m,v,w,x){var _=x._originalDate||m,D=_.getTime();return(0,l.default)(D,v.length)}};function h(b,m){var v=b>0?"-":"+",w=Math.abs(b),x=Math.floor(w/60),_=w%60;if(_===0)return v+String(x);var D=m||"";return v+String(x)+D+(0,l.default)(_,2)}function f(b,m){if(b%60===0){var v=b>0?"-":"+";return v+(0,l.default)(Math.abs(b)/60,2)}return p(b,m)}function p(b,m){var v=m||"",w=b>0?"-":"+",x=Math.abs(b),_=(0,l.default)(Math.floor(x/60),2),D=(0,l.default)(x%60,2);return w+_+v+D}var y=d;t.default=y,n.exports=t.default})(Ea,Ea.exports);var av=Ea.exports,Va={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(l,c){switch(l){case"P":return c.date({width:"short"});case"PP":return c.date({width:"medium"});case"PPP":return c.date({width:"long"});case"PPPP":default:return c.date({width:"full"})}},i=function(l,c){switch(l){case"p":return c.time({width:"short"});case"pp":return c.time({width:"medium"});case"ppp":return c.time({width:"long"});case"pppp":default:return c.time({width:"full"})}},r=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],h=u[2];if(!h)return e(l,c);var f;switch(d){case"P":f=c.dateTime({width:"short"});break;case"PP":f=c.dateTime({width:"medium"});break;case"PPP":f=c.dateTime({width:"long"});break;case"PPPP":default:f=c.dateTime({width:"full"});break}return f.replace("{{date}}",e(d,c)).replace("{{time}}",i(h,c))},a={p:i,P:r},s=a;t.default=s,n.exports=t.default})(Va,Va.exports);var sv=Va.exports,ja={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(ja,ja.exports);var nu=ja.exports;const iu=ni(nu);var ii={};Object.defineProperty(ii,"__esModule",{value:!0}),ii.isProtectedDayOfYearToken=cv,ii.isProtectedWeekYearToken=uv,ii.throwProtectedError=dv;var ov=["D","DD"],lv=["YY","YYYY"];function cv(n){return ov.indexOf(n)!==-1}function uv(n){return lv.indexOf(n)!==-1}function dv(n,t,e){if(n==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(n==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(e,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var qa={exports:{}},Xa={exports:{}},Ga={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={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"}},i=function(s,o,l){var c,u=e[s];return typeof u=="string"?c=u:o===1?c=u.one:c=u.other.replace("{{count}}",o.toString()),l!=null&&l.addSuffix?l.comparison&&l.comparison>0?"in "+c:c+" ago":c},r=i;t.default=r,n.exports=t.default})(Ga,Ga.exports);var hv=Ga.exports,Ka={exports:{}},Za={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=r.width?String(r.width):i.defaultWidth,s=i.formats[a]||i.formats[i.defaultWidth];return s}}n.exports=t.default})(Za,Za.exports);var fv=Za.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(fv),r={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},a={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},s={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o={date:(0,i.default)({formats:r,defaultWidth:"full"}),time:(0,i.default)({formats:a,defaultWidth:"full"}),dateTime:(0,i.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(Ka,Ka.exports);var gv=Ka.exports,Qa={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i=function(s,o,l,c){return e[s]},r=i;t.default=r,n.exports=t.default})(Qa,Qa.exports);var pv=Qa.exports,Ja={exports:{}},ts={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&i.formattingValues){var l=i.defaultFormattingWidth||i.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=i.formattingValues[c]||i.formattingValues[l]}else{var u=i.defaultWidth,d=a!=null&&a.width?String(a.width):i.defaultWidth;o=i.values[d]||i.values[u]}var h=i.argumentCallback?i.argumentCallback(r):r;return o[h]}}n.exports=t.default})(ts,ts.exports);var mv=ts.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(mv),r={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},a={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},s={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"]},o={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"]},l={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"}},c={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"}},u=function(p,y){var b=Number(p),m=b%100;if(m>20||m<10)switch(m%10){case 1:return b+"st";case 2:return b+"nd";case 3:return b+"rd"}return b+"th"},d={ordinalNumber:u,era:(0,i.default)({values:r,defaultWidth:"wide"}),quarter:(0,i.default)({values:a,defaultWidth:"wide",argumentCallback:function(p){return p-1}}),month:(0,i.default)({values:s,defaultWidth:"wide"}),day:(0,i.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,i.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},h=d;t.default=h,n.exports=t.default})(Ja,Ja.exports);var bv=Ja.exports,es={exports:{}},ns={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(a){return function(s){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.width,c=l&&a.matchPatterns[l]||a.matchPatterns[a.defaultMatchWidth],u=s.match(c);if(!u)return null;var d=u[0],h=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],f=Array.isArray(h)?r(h,function(b){return b.test(d)}):i(h,function(b){return b.test(d)}),p;p=a.valueCallback?a.valueCallback(f):f,p=o.valueCallback?o.valueCallback(p):p;var y=s.slice(d.length);return{value:p,rest:y}}}function i(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function r(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(ns,ns.exports);var yv=ns.exports,is={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){return function(r){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=r.match(i.matchPattern);if(!s)return null;var o=s[0],l=r.match(i.parsePattern);if(!l)return null;var c=i.valueCallback?i.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=r.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(is,is.exports);var vv=is.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(yv),r=e(vv),a=/^(\d+)(th|st|nd|rd)?/i,s=/\d+/i,o={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},l={any:[/^b/i,/^(a|c)/i]},c={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},u={any:[/1/i,/2/i,/3/i,/4/i]},d={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},h={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]},f={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},p={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]},y={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},b={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}},m={ordinalNumber:(0,r.default)({matchPattern:a,parsePattern:s,valueCallback:function(x){return parseInt(x,10)}}),era:(0,i.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,i.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(x){return x+1}}),month:(0,i.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:h,defaultParseWidth:"any"}),day:(0,i.default)({matchPatterns:f,defaultMatchWidth:"wide",parsePatterns:p,defaultParseWidth:"any"}),dayPeriod:(0,i.default)({matchPatterns:y,defaultMatchWidth:"any",parsePatterns:b,defaultParseWidth:"any"})},v=m;t.default=v,n.exports=t.default})(es,es.exports);var xv=es.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(hv),r=e(gv),a=e(pv),s=e(bv),o=e(xv),l={code:"en-US",formatDistance:i.default,formatLong:r.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(Xa,Xa.exports);var wv=Xa.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e(wv),r=i.default;t.default=r,n.exports=t.default})(qa,qa.exports);var _v=qa.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=w;var i=e(qy),r=e(Ky),a=e(ie),s=e(av),o=e(sv),l=e(nu),c=ii,u=e(qe),d=e(Nt),h=Xe,f=e(_v),p=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,y=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,b=/^'([^]*?)'?$/,m=/''/g,v=/[a-zA-Z]/;function w(_,D,T){var M,S,P,L,E,X,wt,N,B,Z,Ct,C,I,F,$,V,j,pt;(0,d.default)(2,arguments);var ft=String(D),it=(0,h.getDefaultOptions)(),lt=(M=(S=T==null?void 0:T.locale)!==null&&S!==void 0?S:it.locale)!==null&&M!==void 0?M:f.default,et=(0,u.default)((P=(L=(E=(X=T==null?void 0:T.firstWeekContainsDate)!==null&&X!==void 0?X:T==null||(wt=T.locale)===null||wt===void 0||(N=wt.options)===null||N===void 0?void 0:N.firstWeekContainsDate)!==null&&E!==void 0?E:it.firstWeekContainsDate)!==null&&L!==void 0?L:(B=it.locale)===null||B===void 0||(Z=B.options)===null||Z===void 0?void 0:Z.firstWeekContainsDate)!==null&&P!==void 0?P:1);if(!(et>=1&&et<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var It=(0,u.default)((Ct=(C=(I=(F=T==null?void 0:T.weekStartsOn)!==null&&F!==void 0?F:T==null||($=T.locale)===null||$===void 0||(V=$.options)===null||V===void 0?void 0:V.weekStartsOn)!==null&&I!==void 0?I:it.weekStartsOn)!==null&&C!==void 0?C:(j=it.locale)===null||j===void 0||(pt=j.options)===null||pt===void 0?void 0:pt.weekStartsOn)!==null&&Ct!==void 0?Ct:0);if(!(It>=0&&It<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!lt.localize)throw new RangeError("locale must contain localize property");if(!lt.formatLong)throw new RangeError("locale must contain formatLong property");var pe=(0,a.default)(_);if(!(0,i.default)(pe))throw new RangeError("Invalid time value");var pr=(0,l.default)(pe),mr=(0,r.default)(pe,pr),hi={firstWeekContainsDate:et,weekStartsOn:It,locale:lt,_originalDate:pe},br=ft.match(y).map(function(Vt){var Ne=Vt[0];if(Ne==="p"||Ne==="P"){var yr=o.default[Ne];return yr(Vt,lt.formatLong)}return Vt}).join("").match(p).map(function(Vt){if(Vt==="''")return"'";var Ne=Vt[0];if(Ne==="'")return x(Vt);var yr=s.default[Ne];if(yr)return!(T!=null&&T.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(Vt)&&(0,c.throwProtectedError)(Vt,D,String(_)),!(T!=null&&T.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(Vt)&&(0,c.throwProtectedError)(Vt,D,String(_)),yr(mr,Vt,lt.localize,hi);if(Ne.match(v))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Ne+"`");return Vt}).join("");return br}function x(_){var D=_.match(b);return D?D[1].replace(m,"'"):_}n.exports=t.default})(Da,Da.exports);var Dv=Da.exports;const Tv=ni(Dv);function ru(n,t,e){var i=kv(n,e.timeZone,e.locale);return i.formatToParts?Mv(i,t):Sv(i,t)}function Mv(n,t){for(var e=n.formatToParts(t),i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function Sv(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function kv(n,t,e){if(e&&!e.code)throw new Error("date-fns-tz error: Please set a language code on the locale object imported from date-fns, e.g. `locale.code = 'en-US'`");return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Cv(n,t){var e=Av(t);return e.formatToParts?Pv(e,n):Ev(e,n)}var Ov={year:0,month:1,day:2,hour:3,minute:4,second:5};function Pv(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=Ov[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function Ev(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var rs={};function Av(n){if(!rs[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";rs[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return rs[n]}function au(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var su=36e5,Rv=6e4,as={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function ss(n,t,e){var i,r;if(!n||(i=as.timezoneZ.exec(n),i))return 0;var a;if(i=as.timezoneHH.exec(n),i)return a=parseInt(i[1],10),ou(a)?-(a*su):NaN;if(i=as.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return ou(a,s)?(r=Math.abs(a)*su+s*Rv,a>0?-r:r):NaN}if(Nv(n)){t=new Date(t||Date.now());var o=e?t:Lv(t),l=os(o,n),c=e?l:Iv(t,l,n);return-c}return NaN}function Lv(n){return au(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function os(n,t){var e=Cv(n,t),i=au(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Iv(n,t,e){var i=n.getTime(),r=i-t,a=os(new Date(r),e);if(t===a)return t;r-=a-t;var s=os(new Date(r),e);return a===s?a:Math.max(a,s)}function ou(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var lu={};function Nv(n){if(lu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),lu[n]=!0,!0}catch{return!1}}var Fv=60*1e3,Yv={X:function(n,t,e,i){var r=ls(i.timeZone,i._originalDate||n);if(r===0)return"Z";switch(t){case"X":return cu(r);case"XXXX":case"XX":return cn(r);case"XXXXX":case"XXX":default:return cn(r,":")}},x:function(n,t,e,i){var r=ls(i.timeZone,i._originalDate||n);switch(t){case"x":return cu(r);case"xxxx":case"xx":return cn(r);case"xxxxx":case"xxx":default:return cn(r,":")}},O:function(n,t,e,i){var r=ls(i.timeZone,i._originalDate||n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Wv(r,":");case"OOOO":default:return"GMT"+cn(r,":")}},z:function(n,t,e,i){var r=i._originalDate||n;switch(t){case"z":case"zz":case"zzz":return ru("short",r,i);case"zzzz":default:return ru("long",r,i)}}};function ls(n,t){var e=n?ss(n,t,!0)/Fv:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function nr(n,t){for(var e=n<0?"-":"",i=Math.abs(n).toString();i.length<t;)i="0"+i;return e+i}function cn(n,t){var e=t||"",i=n>0?"-":"+",r=Math.abs(n),a=nr(Math.floor(r/60),2),s=nr(Math.floor(r%60),2);return i+a+e+s}function cu(n,t){if(n%60===0){var e=n>0?"-":"+";return e+nr(Math.abs(n)/60,2)}return cn(n,t)}function Wv(n,t){var e=n>0?"-":"+",i=Math.abs(n),r=Math.floor(i/60),a=i%60;if(a===0)return e+String(r);var s=t||"";return e+String(r)+s+nr(a,2)}const Uv=Yv;var Bv=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,cs=36e5,uu=6e4,zv=2,Ft={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Bv};function du(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?zv:Xy(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Hv(n),a=$v(r.date,i),s=a.year,o=a.restDateString,l=Vv(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=jv(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=ss(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=iu(new Date(c+u)),d=iu(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Hv(n){var t={},e=Ft.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Ft.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=Ft.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function $v(n,t){var e=Ft.YYY[t],i=Ft.YYYYY[t],r;if(r=Ft.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=Ft.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Vv(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=Ft.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,gu(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=Ft.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Gv(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=Ft.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return gu(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=Ft.Www.exec(n),e)return a=parseInt(e[1],10)-1,pu(t,a)?hu(t,a):new Date(NaN);if(e=Ft.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return pu(t,a,l)?hu(t,a,l):new Date(NaN)}return null}function jv(n){var t,e,i;if(t=Ft.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),us(e)?e%24*cs:NaN;if(t=Ft.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),us(e,i)?e%24*cs+i*uu:NaN;if(t=Ft.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return us(e,i,r)?e%24*cs+i*uu+r*1e3:NaN}return null}function hu(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var qv=[31,28,31,30,31,30,31,31,30,31,30,31],Xv=[31,29,31,30,31,30,31,31,30,31,30,31];function fu(n){return n%400===0||n%4===0&&n%100!==0}function gu(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=fu(n);if(i&&e>Xv[t]||!i&&e>qv[t])return!1}return!0}function Gv(n,t){if(t<1)return!1;var e=fu(n);return!(e&&t>366||!e&&t>365)}function pu(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function us(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Kv=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Zv(n,t,e){var i=String(t),r=e||{},a=i.match(Kv);if(a){var s=du(n,r);i=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+Uv[l[0]](s,l,null,r)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},i)}return Tv(n,i,r)}var ds={exports:{}},hs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(hs,hs.exports);var Qv=hs.exports;(function(n,t){var e=vt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(Qv);function r(a){return(0,i.default)({},a)}n.exports=t.default})(ds,ds.exports);var Jv=ds.exports;const tx=ni(Jv);function ex(n,t,e){var i=du(n,e),r=ss(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function nx(n,t,e,i){var r=tx(i);return r.timeZone=t,Zv(ex(n,t),e,r)}const ix=2,fs=new Intl.NumberFormat(((Pd=document==null?void 0:document.documentElement)==null?void 0:Pd.lang)||"en-US");function rx(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, YYY hh:mm a";t.short&&(i="MMM dd, YYY"),t.includeTZ&&(i+=" (z)");const r=new Date(n);return nx(r,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const gs=10,Gt=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],un=(n,t)=>(t||Gt)[n%Gt.length],ri=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),r=parseInt(n.substring(4,6),16);e=e-t,i=i-t,r=r-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${a}${s}${o}`},mu="#6f7787",ax={lineTension:.4,borderWidth:2,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},ps=new Map,ms=(n,t)=>t==="bytes"?ua(n):t==="count/minute"?n.toFixed(2):fs.format(n),bu=n=>{const e=document.createElement("canvas").getContext("2d"),i=dt({});return e.font=i.string,e.measureText(n).width},sx=()=>{const n="label_height";if(!ps.has(n)){const t=dt({});ps.set(n,t.lineHeight)}return ps.get(n)},ox=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),yu=(n,t)=>t.datasets.reduce((e,i,r)=>n.isDatasetVisible(r)?e+i.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),vu=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`;function lx(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return $i.positioners.barChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=_a(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offset,y:c,xAlign:u}},jr.modes.customInteractionMode=function(i,r){const a=Te(r,i),s=[];return jr.evaluateInteractionItems(i,i.options.indexAxis||"x",a,(o,l,c)=>{i.options.indexAxis==="y"&&o.inYRange(a.y,!0)&&i.data.datasets[l].data[c]&&s.push({element:o,datasetIndex:l,index:c}),i.options.indexAxis==="x"&&o.inXRange(a.x,!0)&&i.data.datasets[l].data[c]&&s.push({element:o,datasetIndex:l,index:c})}),s},g.computed(()=>{var i,r,a,s,o,l,c,u;return{indexAxis:n.indexAxis,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,callback:function(d,h){const f=this;if(f.chart.options.indexAxis===f.axis){d=f.getLabelForValue(h);const p=10;return d&&d.length>p?d.slice(0,p)+"...":d}return f.getLabelForValue(Number(d))}},title:{display:n.indexAxis==="y"?!U((i=n.metricAxesTitle)==null?void 0:i.value):!U((r=n.dimensionAxesTitle)==null?void 0:r.value),text:n.indexAxis==="y"?(a=n.metricAxesTitle)==null?void 0:a.value:(s=n.dimensionAxesTitle)==null?void 0:s.value,padding:{top:20},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{callback:function(d,h){const f=this;return f.chart.options.indexAxis===f.axis?(d=f.getLabelForValue(h),d&&d.length>gs?d.slice(0,gs)+"...":d):f.getLabelForValue(Number(d))}},title:{display:n.indexAxis==="x"?!U((o=n.metricAxesTitle)==null?void 0:o.value):!U((l=n.dimensionAxesTitle)==null?void 0:l.value),text:n.indexAxis==="x"?(c=n.metricAxesTitle)==null?void 0:c.value:(u=n.dimensionAxesTitle)==null?void 0:u.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:d=>{wa(n.tooltipState,d)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Xt.register(...Lm);const cx=(n,t)=>{const e=t.datasets.map(r=>r.label),i=n.datasets.map(r=>r.label);return n.datasets.length===t.datasets.length&&e.every((r,a)=>r===i[a])};function ux(n,t,e,i,r){const a=g.shallowRef(null),s=(o,l)=>{if(t.value)return new Xt(t.value,{type:n,data:o,plugins:i,options:l})};return g.onMounted(()=>{a.value=s(e.value,r.value)}),g.onBeforeUnmount(()=>{U(a.value)||a.value.destroy()}),g.watch(e,(o,l)=>{if(cx(l,o)&&!U(a.value)){for(const[c,u]of o.datasets.entries())Object.assign(a.value.data.datasets[c],u);a.value.data.labels=o.labels,a.value.update()}else U(a.value)||a.value.destroy(),a.value=s(o,r.value)}),g.watch(t,()=>{U(a.value)||a.value.destroy(),a.value=s(e.value,r.value)}),g.watch(r,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(U(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var xu={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],f=Math.round(c).toString().split("");return f.reverse().forEach(function(p,y){y&&y%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,f=d.round?"round":"floor";return d.decimal===!1?(c=Math[f](h),c.toString()):(d.precision?c=h:c=h<10?Math[f](h*10)/10:Math[f](h),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,r=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var h=c<0;h&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var f=u.min10k?r:i;return c<f||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,i,u)+"k":c<s?d=e(c,a,u)+"m":c<o?d=t(e(c,s,u),u)+"b":d=t(e(c,o,u),u)+"t",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(xu);var dx=xu.exports;const dn=ni(dx);function hx(n,t,e){const{i18n:i}=Dt.useI18n();return{legendValues:g.computed(()=>n.value.datasets.reduce((a,s)=>{const o=s.total?s.total:s.data.reduce((c,u)=>c+(typeof u=="number"?Number(u)||0:Number(u.y)||0),0);let l;if(e.value==="bytes")l=isNaN(o)?"0":ua(o);else{l=`${dn(o,{capital:!0})} ${e.value}`;const c=e.value&&i&&i.te(`chartUnits.${e.value}`)&&i.t(`chartUnits.${e.value}`)||e.value;l=i&&i.t("legend.datapointValueDisplay",{value:dn(o,{capital:!0}),unit:c})||`${dn(o,{capital:!0})} ${e.value}`}return{...a,[s.label]:{raw:o,formatted:l}}},{}))}}function fx(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return $i.positioners.doughnutChartTooltipPosition=function(i,r){if(!i.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=_a(r,s,o),c=r.y,u=r.x<o?"left":"center";return{x:l-n.tooltipState.offset,y:c,xAlign:u}},{options:g.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{wa(n.tooltipState,i)}}}}))}}var gx=Object.defineProperty,px=(n,t,e)=>t in n?gx(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,re=(n,t,e)=>(px(n,typeof t!="symbol"?t+"":t,e),e),z=(n=>(n.MINUTELY="Minutely",n.HOURLY="Hourly",n.DAILY="Daily",n.WEEKLY="Weekly",n))(z||{}),xt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n))(xt||{});function bs(n){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(n)}function ir(n){if(n===null||n===!0||n===!1)return NaN;var t=Number(n);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ae(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function hn(n){ae(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||bs(n)==="object"&&t==="[object Date]"?new Date(n.getTime()):typeof n=="number"||t==="[object Number]"?new Date(n):((typeof n=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function wu(n,t){ae(2,arguments);var e=hn(n),i=ir(t);return isNaN(i)?new Date(NaN):(i&&e.setDate(e.getDate()+i),e)}function mx(n,t){ae(2,arguments);var e=hn(n),i=ir(t);if(isNaN(i))return new Date(NaN);if(!i)return e;var r=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+i+1,0);var s=a.getDate();return r>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),r),e)}var bx={};function yx(){return bx}function rr(n,t){var e,i,r,a,s,o,l,c;ae(1,arguments);var u=yx(),d=ir((e=(i=(r=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(s=t.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&r!==void 0?r:u.weekStartsOn)!==null&&i!==void 0?i:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.weekStartsOn)!==null&&e!==void 0?e:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=hn(n),f=h.getDay(),p=(f<d?7:0)+f-d;return h.setDate(h.getDate()-p),h.setHours(0,0,0,0),h}function _u(n){ae(1,arguments);var t=hn(n);return t.setHours(0,0,0,0),t}var vx=60,xx=3600;function fn(n){ae(1,arguments);var t=hn(n);return t.setDate(1),t.setHours(0,0,0,0),t}function wx(n){ae(1,arguments);var t=hn(n),e=t.getFullYear(),i=t.getMonth(),r=new Date(0);return r.setFullYear(e,i+1,0),r.setHours(0,0,0,0),r.getDate()}function _x(n){return ae(1,arguments),Math.floor(n*xx)}function Dx(n){ae(1,arguments);var t=n/vx;return Math.floor(t)}function Du(n,t){ae(2,arguments);var e=ir(t);return mx(n,-e)}function ys(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Tu={exports:{}};(function(n){function t(e){return e&&e.__esModule?e:{default:e}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Tu);var Tx=Tu.exports,vs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){if(i===null||i===!0||i===!1)return NaN;var r=Number(i);return isNaN(r)?r:r<0?Math.ceil(r):Math.floor(r)}n.exports=t.default})(vs,vs.exports);var Mx=vs.exports;const Sx=ys(Mx);var xs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i){var r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()));return r.setUTCFullYear(i.getFullYear()),i.getTime()-r.getTime()}n.exports=t.default})(xs,xs.exports);var kx=xs.exports;const Mu=ys(kx);function Cx(n,t){var e=Ax(t);return e.formatToParts?Px(e,n):Ex(e,n)}var Ox={year:0,month:1,day:2,hour:3,minute:4,second:5};function Px(n,t){try{for(var e=n.formatToParts(t),i=[],r=0;r<e.length;r++){var a=Ox[e[r].type];a>=0&&(i[a]=parseInt(e[r].value,10))}return i}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function Ex(n,t){var e=n.format(t).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[i[3],i[1],i[2],i[4],i[5],i[6]]}var ws={};function Ax(n){if(!ws[n]){var t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),e=t==="06/25/2014, 00:00:00"||t==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";ws[n]=e?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return ws[n]}function _s(n,t,e,i,r,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,r,a,s),o}var Su=36e5,Rx=6e4,Ds={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-]\d{2}):?(\d{2})$/};function ar(n,t,e){var i,r;if(!n||(i=Ds.timezoneZ.exec(n),i))return 0;var a;if(i=Ds.timezoneHH.exec(n),i)return a=parseInt(i[1],10),ku(a)?-(a*Su):NaN;if(i=Ds.timezoneHHMM.exec(n),i){a=parseInt(i[1],10);var s=parseInt(i[2],10);return ku(a,s)?(r=Math.abs(a)*Su+s*Rx,a>0?-r:r):NaN}if(Nx(n)){t=new Date(t||Date.now());var o=e?t:Lx(t),l=Ts(o,n),c=e?l:Ix(t,l,n);return-c}return NaN}function Lx(n){return _s(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ts(n,t){var e=Cx(n,t),i=_s(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),r=n.getTime(),a=r%1e3;return r-=a>=0?a:1e3+a,i-r}function Ix(n,t,e){var i=n.getTime(),r=i-t,a=Ts(new Date(r),e);if(t===a)return t;r-=a-t;var s=Ts(new Date(r),e);return a===s?a:Math.max(a,s)}function ku(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var Cu={};function Nx(n){if(Cu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Cu[n]=!0,!0}catch{return!1}}var Fx=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Ou=Fx;var Ms=36e5,Pu=6e4,Yx=2,Yt={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Ou};function Ss(n,t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);var e=t||{},i=e.additionalDigits==null?Yx:Sx(e.additionalDigits);if(i!==2&&i!==1&&i!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(!(typeof n=="string"||Object.prototype.toString.call(n)==="[object String]"))return new Date(NaN);var r=Wx(n),a=Ux(r.date,i),s=a.year,o=a.restDateString,l=Bx(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(r.time&&(u=zx(r.time),isNaN(u)))return new Date(NaN);if(r.timeZone||e.timeZone){if(d=ar(r.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Mu(new Date(c+u)),d=Mu(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Wx(n){var t={},e=Yt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Yt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){var r=Yt.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function Ux(n,t){var e=Yt.YYY[t],i=Yt.YYYYY[t],r;if(r=Yt.YYYY.exec(n)||i.exec(n),r){var a=r[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(r=Yt.YY.exec(n)||e.exec(n),r){var s=r[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Bx(n,t){if(t===null)return null;var e,i,r,a;if(n.length===0)return i=new Date(0),i.setUTCFullYear(t),i;if(e=Yt.MM.exec(n),e)return i=new Date(0),r=parseInt(e[1],10)-1,Ru(t,r)?(i.setUTCFullYear(t,r),i):new Date(NaN);if(e=Yt.DDD.exec(n),e){i=new Date(0);var s=parseInt(e[1],10);return Vx(t,s)?(i.setUTCFullYear(t,0,s),i):new Date(NaN)}if(e=Yt.MMDD.exec(n),e){i=new Date(0),r=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Ru(t,r,o)?(i.setUTCFullYear(t,r,o),i):new Date(NaN)}if(e=Yt.Www.exec(n),e)return a=parseInt(e[1],10)-1,Lu(t,a)?Eu(t,a):new Date(NaN);if(e=Yt.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Lu(t,a,l)?Eu(t,a,l):new Date(NaN)}return null}function zx(n){var t,e,i;if(t=Yt.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),ks(e)?e%24*Ms:NaN;if(t=Yt.HHMM.exec(n),t)return e=parseInt(t[1],10),i=parseFloat(t[2].replace(",",".")),ks(e,i)?e%24*Ms+i*Pu:NaN;if(t=Yt.HHMMSS.exec(n),t){e=parseInt(t[1],10),i=parseInt(t[2],10);var r=parseFloat(t[3].replace(",","."));return ks(e,i,r)?e%24*Ms+i*Pu+r*1e3:NaN}return null}function Eu(n,t,e){t=t||0,e=e||0;var i=new Date(0);i.setUTCFullYear(n,0,4);var r=i.getUTCDay()||7,a=t*7+e+1-r;return i.setUTCDate(i.getUTCDate()+a),i}var Hx=[31,28,31,30,31,30,31,31,30,31,30,31],$x=[31,29,31,30,31,30,31,31,30,31,30,31];function Au(n){return n%400===0||n%4===0&&n%100!==0}function Ru(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var i=Au(n);if(i&&e>$x[t]||!i&&e>Hx[t])return!1}return!0}function Vx(n,t){if(t<1)return!1;var e=Au(n);return!(e&&t>366||!e&&t>365)}function Lu(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function ks(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Cs={exports:{}},Os={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(i,r){if(i==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i[a]=r[a]);return i}n.exports=t.default})(Os,Os.exports);var jx=Os.exports;(function(n,t){var e=Tx.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=e(jx);function r(a){return(0,i.default)({},a)}n.exports=t.default})(Cs,Cs.exports);var qx=Cs.exports;const Xx=ys(qx);function Gx(n,t,e){var i=Ss(n,e),r=ar(t,i,!0),a=new Date(i.getTime()-r),s=new Date(0);return s.setFullYear(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()),s.setHours(a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),a.getUTCMilliseconds()),s}function Kx(n,t){return-ar(n,t)}function Zx(n,t,e){if(typeof n=="string"&&!n.match(Ou)){var i=Xx(e);return i.timeZone=t,Ss(n,i)}var r=Ss(n,e),a=_s(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()).getTime(),s=ar(t,new Date(a));return new Date(a+s)}const Qx={[z.MINUTELY]:60*1e3,[z.HOURLY]:60*60*1e3,[z.DAILY]:60*60*24*1e3,[z.WEEKLY]:60*60*24*7*1e3};function ai(n){return n&&Object.values(z).find(t=>n<=Qx[t])||null}const gn=(n,t)=>new Date(n.getTime()-Kx(t,n));class Zt{constructor(t){re(this,"timeframeText"),re(this,"key"),re(this,"display"),re(this,"timeframeLength"),re(this,"allowedTiers"),re(this,"defaultResponseGranularity"),re(this,"dataGranularity"),re(this,"isRelative"),re(this,"_startCustom"),re(this,"_endCustom"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add(z.MINUTELY),e>=2&&e<=7*24&&t.add(z.HOURLY),e>=2*24&&t.add(z.DAILY),e>=2*24*14&&t.add(z.WEEKLY),t}tzAdjustedDate(t){if(!t)return new Date;const e=Zx(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return Gx(e,t)}}class Jx extends Zt{rawStart(t){let e=rr(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=gn(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class tw extends Zt{rawStart(t){let e=fn(this.tzAdjustedDate(t));return t&&(e=gn(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class ew extends Zt{rawEnd(t){let e=rr(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=gn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=rr(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=gn(i,t)),i}}class nw extends Zt{rawEnd(t){let e=fn(this.tzAdjustedDate(t));return t&&(e=gn(e,t)),e}rawStart(t){let e=fn(Du(this.tzAdjustedDate(t),1));return t&&(e=gn(e,t)),e}}xt.FIFTEEN_MIN,new Zt({key:xt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:z.MINUTELY,dataGranularity:z.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),xt.ONE_HOUR,new Zt({key:xt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:z.MINUTELY,dataGranularity:z.MINUTELY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),xt.SIX_HOUR,new Zt({key:xt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:z.HOURLY,dataGranularity:z.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),xt.TWELVE_HOUR,new Zt({key:xt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:z.HOURLY,dataGranularity:z.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),xt.ONE_DAY,new Zt({key:xt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:z.HOURLY,dataGranularity:z.HOURLY,isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),xt.SEVEN_DAY,new Zt({key:xt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),xt.THIRTY_DAY,new Zt({key:xt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),xt.CURRENT_WEEK,new Jx({key:xt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=rr(new Date,{weekStartsOn:1});return(_u(wu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),xt.CURRENT_MONTH,new tw({key:xt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=fn(new Date);return(_u(wu(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),xt.PREVIOUS_WEEK,new ew({key:xt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]}),xt.PREVIOUS_MONTH,new nw({key:xt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=fn(new Date),e=fn(Du(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=iw(t,e)),60*60*24*wx(new Date().setMonth(new Date().getMonth()-1))+_x(n)},defaultResponseGranularity:z.DAILY,dataGranularity:z.DAILY,isRelative:!1,allowedTiers:["plus","enterprise"]});function iw(n,t){return Dx(n.getTimezoneOffset()-t.getTimezoneOffset())}function rw(n){const t=g.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0},title:{display:!U((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:20},font:{weight:"bold"}}}}),e=g.computed(()=>{var l,c;return{title:{display:!U((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:20},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};$i.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,h=n.tooltipState.height||this.height,f=u.width/2,p=u.height/2,y=_a(c,d,f);let b=Vy(c,h,p);const m=c.y<p?"top":"bottom",v=c.x<f?"left":"center";return h>u.height&&(b=0),{x:y,y:b,xAlign:v,yAlign:m}};const r=g.computed(()=>{switch(n.granularity.value){case z.MINUTELY:return"minute";case z.HOURLY:return"hour";case z.DAILY:return"day";default:return"day"}}),a=g.computed(()=>n.timeRangeMs?Dy(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm":Wy(Number(n.timeRangeSec.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=g.computed(()=>[z.DAILY,z.WEEKLY].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:g.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:{border:{display:!1},...t.value,stacked:n.stacked.value,time:{tooltipFormat:"h:mm:ss a",unit:r.value,displayFormats:{minute:"h:mm:ss a",hour:a.value,day:s.value}}},y:{border:{display:!1},...e.value,stacked:n.stacked.value}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...i,external:l=>{wa(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function aw(n,t){const{i18n:e}=Dt.useI18n();return g.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&(o.length===1?o[0]!=="Organization":o.length>0);if(!r.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],h=u.length>1?u[1]:u[0],f=Object.fromEntries(l?r.flatMap(m=>s.map((v,w)=>{const x=m.event[d],_=c?`${x},${v}`:`${w},${v}`,D=m.event[v];return[_,D]})):r.map(m=>{const v=c?`${m.event[d]},${m.event[h]}`:`${d},${h}`,w=m.event[s[0]];return[v,w]})),p=c&&a[d]||s,y=c&&a[h]||s;return!p||!y?{labels:[],datasets:[]}:{labels:c?a[d].map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m):s.map(m=>e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m),datasets:l?s.map(m=>({label:e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m,backgroundColor:un(s.indexOf(m),Gt),data:p.map((v,w)=>c?f[`${v},${m}`]||0:f[`${w},${m}`]||0)})):y&&Array.from(y).flatMap((m,v)=>{if(!m)return[];let{colorPalette:w}=n;U(w)&&(w=Gt);const x={},_=Array.isArray(w)?un(v,w):w[m]||un(v);return x[m]=_,{label:e&&e.te(`chartLabels.${m}`)&&e.t(`chartLabels.${m}`)||m,backgroundColor:_,data:p.map(D=>f[`${D},${m}`]||0)}})}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const sw=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,r)=>i+r*e),ow=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return qc(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},lw=(n,t,e,i,r)=>{const s=Math.max(t-6e4,Math.max(...(r||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((s-i)/e)*e+i+e;return sw(o,l,e)};function cw(n,t){const{i18n:e}=Dt.useI18n();return g.computed(()=>{try{if(t.value&&"meta"in t.value&&"records"in t.value){const r=t.value.records,{dimensions:a,metricNames:s}=t.value.meta,o="startMs"in t.value.meta?t.value.meta.startMs:t.value.meta.start*1e3,l="endMs"in t.value.meta?t.value.meta.endMs:t.value.meta.end*1e3;if(!s)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=a&&Object.keys(a)||s,u=c&&c[0],d=a&&a[u]||s,h=t.value.meta.granularity;if(typeof h!="number"||isNaN(h)||!isFinite(h)||h===0)return console.error("Invalid step value:",h),{datasets:[]};if(!r.length)return{datasets:[]};const f=ow(o),p=lw(o,l,h,f,r),y=new Set,b=r!=null&&r.length?r.reduce((x,_)=>{const D=new Date(_.timestamp).valueOf(),T=_.event;for(const M of s)y.add(M),D in x||(x[D]={}),M in x[D]||(x[D][M]={});for(const M of s)d.forEach(S=>{T[u]===S||M===S?(x[D][M]||(x[D][M]={}),x[D][M][S]=Math.round(Number(T[M])*1e3)/1e3):c.length||(x[D][M]||(x[D][M]={}),x[D][M][S]=Math.round(Number(T[S])*1e3)/1e3)});return x},{}):{},m=s.length===1?s.flatMap(x=>d.map(_=>[x,_])):d.map(x=>[x,x]),v={},w=[...m].map(([x,_],D)=>{const T=p.map(E=>E in b&&x in b[E]?{x:E,y:b[E][x][_]||0}:{x:E,y:0});let{colorPalette:M,fill:S}=n;U(M)&&(M=Gt);const P=Array.isArray(M)?un(D,M):M[_]||un(D),L=ri(P,50);return v[_]=P,{rawDimension:_,rawMetric:x,label:e&&e.te(`chartLabels.${_}`)&&e.t(`chartLabels.${_}`)||_,borderColor:L,backgroundColor:P,data:T,total:T.reduce((E,{y:X})=>E+Number(X),0),...ax,fill:S}});return w.sort((x,_)=>Number(x.total)<Number(_.total)?-1:1),{datasets:w,colorMap:v}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const Dt={useBarChartOptions:lx,useChartJSCommon:ux,useChartLegendValues:hx,useExploreResultToDatasets:aw,useExploreResultToTimeDataset:cw,useDoughnutChartOptions:fx,useLinechartOptions:rw,useI18n:Ad,useReportChartDataForSynthetics:(n,t)=>{g.watch([n,t],(e,i,r)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})}};/*!
20
20
  * chartjs-plugin-annotation v3.0.1
21
21
  * https://www.chartjs.org/chartjs-plugin-annotation/index
22
22
  * (c) 2023 chartjs-plugin-annotation Contributors
23
23
  * Released under the MIT License
24
- */const Iu={modes:{point(n,t){return sr(n,t,{intersect:!0})},nearest(n,t,e){return hw(n,t,e)},x(n,t,e){return sr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return sr(n,t,{intersect:e.intersect,axis:"y"})}}};function Os(n,t,e){return(Iu.modes[e.mode]||Iu.modes.nearest)(n,t,e)}function uw(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function dw(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function sr(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):uw(i,t,e.axis))}function hw(n,t,e){let i=Number.POSITIVE_INFINITY;return sr(n,t,e).reduce((r,a)=>{const s=a.getCenterPoint(),o=dw(t,s,e.axis),l=Je(t,o);return l<i?(r=[a],i=l):l===i&&r.push(a),r},[]).sort((r,a)=>r._index-a._index).slice(0,1)}const fw=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Ge=.001,or=(n,t,e)=>Math.min(e,Math.max(t,n));function gw(n,t,e){for(const i of Object.keys(n))n[i]=or(n[i],t,e);return n}function pw(n,t,e,i){if(!n||!t||e<=0)return!1;const r=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+r,2)}function Nu(n,{x:t,y:e,x2:i,y2:r},a,s){const o=s/2,l=n.x>=t-o-Ge&&n.x<=i+o+Ge,c=n.y>=e-o-Ge&&n.y<=r+o+Ge;return a==="x"?l:(a==="y"||l)&&c}function gn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function mw(n,t,e,i=!0){const r=e.split(".");let a=0;for(const s of t.split(".")){const o=r[a++];if(parseInt(s,10)<parseInt(o,10))break;if(fw(o,s)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Fu=n=>typeof n=="string"&&n.endsWith("%"),Yu=n=>parseFloat(n)/100,Wu=n=>or(Yu(n),0,1),lr=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),bw={box:n=>lr(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>lr(n.centerX,n.centerY),line:n=>lr(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>lr(n.centerX,n.centerY)};function Es(n,t){return t==="start"?0:t==="end"?n:Fu(t)?Wu(t)*n:n/2}function Oe(n,t,e=!0){return typeof t=="number"?t:Fu(t)?(e?Wu(t):Yu(t))*n:n}function yw(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function As(n,t="center"){return $(n)?{x:W(n.x,t),y:W(n.y,t)}:(n=W(n,t),{x:n,y:n})}function Uu(n){return n&&(Wt(n.xValue)||Wt(n.yValue))}function si(n,t,e){const i=e.init;if(i){if(i===!0)return zu(t,e)}else return;return vw(n,t,e)}function Bu(n,t,e){let i=!1;return t.forEach(r=>{Ut(n[r])?(i=!0,e[r]=n[r]):Wt(e[r])&&delete e[r]}),i}function zu(n,t){const e=t.type||"line";return bw[e](n)}function vw(n,t,e){const i=rt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return zu(t,e);if($(i))return i}const Rs=new Map,xw=n=>isNaN(n)||n<=0,ww=n=>n.reduce(function(t,e){return t+=e.string,t},"");function cr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Ls(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(St(i)),n.translate(-t,-e))}function Ee(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function pn(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Is(n,t){const e=t.content;if(cr(e))return{width:Oe(e.width,t.width),height:Oe(e.height,t.height)};const i=t.font,r=tt(i)?i.map(l=>dt(l)):[dt(i)],a=t.textStrokeWidth,s=tt(e)?e:[e],o=s.join()+ww(r)+a+(n._measureText?"-spriting":"");return Rs.has(o)||Rs.set(o,Sw(n,s,r,a)),Rs.get(o)}function Hu(n,t,e){const{x:i,y:r,width:a,height:s}=t;n.save(),pn(n,e);const o=Ee(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),tn(n,{x:i,y:r,w:a,h:s,radius:gw(_e(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function _w(n,t,e){const i=e.content;if(cr(i)){n.save(),n.globalAlpha=Pw(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}const r=tt(i)?i:[i],a=e.font,s=tt(a)?a.map(d=>dt(d)):[dt(a)],o=e.color,l=tt(o)?o:[o],c=yw(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,Dw(n,e)&&kw(n,{x:c,y:u},r,s),Cw(n,{x:c,y:u},r,{fonts:s,colors:l}),n.restore()}function Dw(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function Tw(n,t,e,i){const{radius:r,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Mr;if(cr(s)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}xw(r)||Mw(n,{x:e,y:i,radius:r,rotation:o,style:s,rad:l})}function Mw(n,{x:t,y:e,radius:i,rotation:r,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,i,0,ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=vi,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=vi,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(s+qt)*c,l=Math.sin(s+qt)*c,n.arc(t-o,e-l,u,s-X,s-ut),n.arc(t+l,e-o,u,s-ut,s),n.arc(t+o,e+l,u,s,s+ut),n.arc(t-l,e+o,u,s+ut,s+X),n.closePath();break;case"rect":if(!r){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}s+=qt;case"rectRot":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=qt;case"cross":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=qt,o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*i,e+Math.sin(s)*i);break}n.fill()}function Sw(n,t,e,i){n.save();const r=t.length;let a=0,s=i;for(let o=0;o<r;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+i),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function kw(n,{x:t,y:e},i,r){n.beginPath();let a=0;i.forEach(function(s,o){const l=r[Math.min(o,r.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function Cw(n,{x:t,y:e},i,{fonts:r,colors:a}){let s=0;i.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function Pw(n,t){const e=we(n)?n:t;return we(e)?or(e,0,1):1}const $u={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function mn(n,t,e){return t=typeof t=="number"?t:n.parse(t),pt(t)?n.getPixelForValue(t):e}function Ke(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===r);return a.length?a[0].id:r}function Vu(n,t){if(n){const e=n.options.reverse,i=mn(n,t.min,e?t.end:t.start),r=mn(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function ju(n,t){const{chartArea:e,scales:i}=n,r=i[Ke(i,t,"xScaleID")],a=i[Ke(i,t,"yScaleID")];let s=e.width/2,o=e.height/2;return r&&(s=mn(r,t.xValue,r.left+r.width/2)),a&&(o=mn(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function Ns(n,t){const e=n.scales,i=e[Ke(e,t,"xScaleID")],r=e[Ke(e,t,"yScaleID")];if(!i&&!r)return{};let{left:a,right:s}=i||n.chartArea,{top:o,bottom:l}=r||n.chartArea;const c=Gu(i,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=Gu(r,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function qu(n,t){if(!Uu(t)){const e=Ns(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-i,y:s-i,x2:a+i,y2:s+i,centerX:a,centerY:s,width:r,height:r,radius:i}}return Ew(n,t)}function Ow(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],a={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?Aw(r,a,t):Rw(e,a,t),a}function Xu(n,t){const e=Ns(n,t);return e.initProperties=si(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:Nw(n,e,t),initProperties:e.initProperties}],e}function Ew(n,t){const e=ju(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Gu(n,t){const e=Vu(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function Aw(n,t,e){const i=mn(n,e.value,NaN),r=mn(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function Rw(n,t,e){for(const i of Object.keys($u)){const r=n[Ke(n,e,i)];if(r){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=$u[i],d=Vu(r,{min:e[a],max:e[s],start:r[o],end:r[l]});t[c]=d.start,t[u]=d.end}}}function Lw({properties:n,options:t},e,i,r){const{x:a,x2:s,width:o}=n;return Ku({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function Iw({properties:n,options:t},e,i,r){const{y:a,y2:s,height:o}=n;return Ku({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Ku(n,t){const{start:e,end:i,borderWidth:r}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=i-r-e-s-o-t.size;return e+r/2+l+Es(c,a)}function Nw(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=As(i.position),a=kt(i.padding),s=Is(n.ctx,i),o=Lw({properties:t,options:e},s,r,a),l=Iw({properties:t,options:e},s,r,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}function Ze(n,t,e){const i=Math.cos(e),r=Math.sin(e),a=t.x,s=t.y;return{x:a+i*(n.x-a)-r*(n.y-s),y:s+r*(n.x-a)+i*(n.y-s)}}const Fs=["enter","leave"],Ys=Fs.concat("click");function Fw(n,t,e){t.listened=Bu(e,Ys,t.listeners),t.moveListened=!1,t._getElements=Os,Fs.forEach(i=>{Ut(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Ut(i.click)&&(t.listened=!0),t.moveListened||Fs.forEach(r=>{Ut(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function Yw(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return Ww(n,t,e);case"click":return Uw(n,t,e)}}function Ww(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Os(n,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const a={state:n,event:t};let s=Zu(a,"leave",r,i);return Zu(a,"enter",i,r)||s}function Zu({state:n,event:t},e,i,r){let a;for(const s of i)r.indexOf(s)<0&&(a=Qu(s.options[e]||n.listeners[e],s,t)||a);return a}function Uw(n,t,e){const i=n.listeners,r=Os(n,t,e.interaction);let a;for(const s of r)a=Qu(s.options.click||i.click,s,t)||a;return a}function Qu(n,t,e){return rt(n,[t.$context,e])===!0}const ur=["afterDraw","beforeDraw"];function Bw(n,t,e){const i=t.visibleElements;t.hooked=Bu(e,ur,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ur.forEach(a=>{Ut(r.options[a])&&(t.hooked=!0)})})}function Ju(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return rt(i,[t.$context])}}function zw(n,t,e){const i=qw(n.scales,t,e);let r=td(t,i,"min","suggestedMin");r=td(t,i,"max","suggestedMax")||r,r&&Ut(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function Hw(n,t){for(const e of n)Vw(e,t)}function td(n,t,e,i){if(pt(t[e])&&!$w(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function $w(n,t,e){return Wt(n[t])||Wt(n[e])}function Vw(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Ke(t,n,e);i&&!t[i]&&jw(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function jw(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(Wt(n[e+i]))return!0;return!1}function qw(n,t,e){const i=t.axis,r=t.id,a=i+"ScaleID",s={min:W(t.min,Number.NEGATIVE_INFINITY),max:W(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===r?ed(o,t,["value","endValue"],s):Ke(n,o,a)===r&&ed(o,t,[i+"Min",i+"Max",i+"Value"],s);return s}function ed(n,t,e,i){for(const r of e){const a=n[r];if(Wt(a)){const s=t.parse(a);i.min=Math.min(i.min,s),i.max=Math.max(i.max,s)}}}class bn extends Ot{inRange(t,e,i,r){const{x:a,y:s}=Ze({x:t,y:e},this.getCenterPoint(r),St(-this.options.rotation));return Nu({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return gn(this,t)}draw(t){t.save(),Ls(t,this.getCenterPoint(),this.options.rotation),Hu(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Xu(t,e)}}bn.id="boxAnnotation",bn.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},bn.defaultRoutes={borderColor:"color",backgroundColor:"color"},bn.descriptors={label:{_fallback:!0}};const nd=["left","bottom","top","right"];class oi extends Ot{inRange(t,e,i,r){const{x:a,y:s}=Ze({x:t,y:e},this.getCenterPoint(r),St(-this.rotation));return Nu({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return gn(this,t)}draw(t){const e=this.options,i=!Wt(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Ls(t,this.getCenterPoint(),this.rotation),Gw(t,this),Hu(t,this,e),_w(t,n_(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Uu(e))i=ju(t,e);else{const{centerX:o,centerY:l}=Ns(t,e);i={x:o,y:l}}const r=kt(e.padding),a=Is(t.ctx,e),s=Xw(i,a,e,r);return{initProperties:si(t,s,e),pointX:i.x,pointY:i.y,...s,rotation:e.rotation}}}oi.id="labelAnnotation",oi.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},oi.defaultRoutes={borderColor:"color"};function Xw(n,t,e,i){const r=t.width+i.width+e.borderWidth,a=t.height+i.height+e.borderWidth,s=As(e.position,"center"),o=id(n.x,r,e.xAdjust,s.x),l=id(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+r,y2:l+a,width:r,height:a,centerX:o+r/2,centerY:l+a/2}}function id(n,t,e=0,i){return n-Es(t,i)+e}function Gw(n,t){const{pointX:e,pointY:i,options:r}=t,a=r.callout,s=a&&a.display&&t_(t,a);if(!s||i_(t,a,s))return;if(n.save(),n.beginPath(),!Ee(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=Kw(t,s),{sideStart:u,sideEnd:d}=Qw(t,s,l);(a.margin>0||r.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const h=Ze({x:e,y:i},t.getCenterPoint(),St(-t.rotation));n.lineTo(h.x,h.y),n.stroke(),n.restore()}function Kw(n,t){const{x:e,y:i,x2:r,y2:a}=n,s=Zw(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:i},l={x:o.x,y:a}):(o={x:e,y:i+s},l={x:r,y:o.y}),{separatorStart:o,separatorEnd:l}}function Zw(n,t){const{width:e,height:i,options:r}=n,a=r.callout.margin+r.borderWidth/2;return t==="right"?e+a:t==="bottom"?i+a:-a}function Qw(n,t,e){const{y:i,width:r,height:a,options:s}=n,o=s.callout.start,l=Jw(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Oe(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+Oe(r,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Jw(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function t_(n,t){const e=t.position;return nd.includes(e)?e:e_(n,t)}function e_(n,t){const{x:e,y:i,x2:r,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:h}=n,f={x:u,y:d},p=t.start,y=Oe(s,p),b=Oe(o,p),m=[e,e+y,e+y,r],v=[i+b,a,i,a],x=[];for(let w=0;w<4;w++){const _=Ze({x:m[w],y:v[w]},f,St(h));x.push({position:nd[w],distance:Je(_,{x:l,y:c})})}return x.sort((w,_)=>w.distance-_.distance)[0].position}function n_({x:n,y:t,width:e,height:i,options:r}){const a=r.borderWidth/2,s=kt(r.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-r.borderWidth,height:i-s.top-s.bottom-r.borderWidth}}function i_(n,t,e){const{pointX:i,pointY:r}=n,a=t.margin;let s=i,o=r;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ws=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Us=(n,t,e)=>Ws(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,rd=(n,t,e)=>Ws(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,li=n=>n*n,r_=(n,t,{x:e,y:i,x2:r,y2:a},s)=>s==="y"?{start:Math.min(i,a),end:Math.max(i,a),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},ad=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Bs=(n,t,e,i)=>({x:ad(n.x,t.x,e.x,i),y:ad(n.y,t.y,e.y,i)}),sd=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),od=(n,t,e,i)=>-Math.atan2(sd(n.x,t.x,e.x,i),sd(n.y,t.y,e.y,i))+.5*X;class ci extends Ot{inRange(t,e,i,r){const a=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){Ee(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,h=e*u.currentDevicePixelRatio,f=l.isPointInStroke(o,d,h)||zs(this,s,r);return l.restore(),f}const c=li(a);return l_(this,s,c,r)||zs(this,s,r)}return a_(this,{mouseX:t,mouseY:e},i,{hBorderWidth:a,useFinalPosition:r})}getCenterPoint(t){return gn(this,t)}draw(t){const{x:e,y:i,x2:r,y2:a,cp:s,options:o}=this;if(t.save(),!Ee(t,o))return t.restore();pn(t,o);const l=Math.sqrt(Math.pow(r-e,2)+Math.pow(a-i,2));if(o.curve&&s)return m_(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=hd(this),f=Math.atan2(a-i,r-e);t.translate(e,i),t.rotate(f),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-h,0),t.shadowColor=o.borderShadowColor,t.stroke(),Hs(t,0,d,c),Hs(t,l,-h,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=Ow(t,e),{x:r,y:a,x2:s,y2:o}=i,l=s_(i,t.chartArea),c=l?o_({x:r,y:a},{x:s,y:o},t.chartArea):{x:r,y:a,x2:s,y2:o,width:Math.abs(s-r),height:Math.abs(o-a)};if(c.centerX=(s+r)/2,c.centerY=(o+a)/2,c.initProperties=si(t,c,e),e.curve){const d={x:c.x,y:c.y},h={x:c.x2,y:c.y2};c.cp=p_(c,e,Je(d,h))}const u=c_(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ci.id="lineAnnotation";const ld={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ci.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},ld),fill:!1,length:12,start:Object.assign({},ld),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},oi.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ci.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ci.defaultRoutes={borderColor:"color"};function a_(n,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:a}){const s=r_(t,e,n.getProps(["x","y","x2","y2"],a),i);return s.value>=s.start-r&&s.value<=s.end+r||zs(n,{mouseX:t,mouseY:e},a,i)}function s_({x:n,y:t,x2:e,y2:i},{top:r,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<r&&i<r||t>s&&i>s)}function cd({x:n,y:t},e,{top:i,right:r,bottom:a,left:s}){return n<s&&(t=rd(s,{x:n,y:t},e),n=s),n>r&&(t=rd(r,{x:n,y:t},e),n=r),t<i&&(n=Us(i,{x:n,y:t},e),t=i),t>a&&(n=Us(a,{x:n,y:t},e),t=a),{x:n,y:t}}function o_(n,t,e){const{x:i,y:r}=cd(n,t,e),{x:a,y:s}=cd(t,n,e);return{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)}}function l_(n,{mouseX:t,mouseY:e},i=Ge,r){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],r),c=o-a,u=l-s,d=li(c)+li(u),h=d===0?-1:((t-a)*c+(e-s)*u)/d;let f,p;return h<0?(f=a,p=s):h>1?(f=o,p=l):(f=a+h*c,p=s+h*u),li(t-f)+li(e-p)<=i}function zs(n,{mouseX:t,mouseY:e},i,r){const a=n.label;return a.options.display&&a.inRange(t,e,r,i)}function c_(n,t,e){const i=e.borderWidth,r=kt(e.padding),a=Is(n.ctx,e),s=a.width+r.width+i,o=a.height+r.height+i;return d_(t,e,{width:s,height:o,padding:r},n.chartArea)}function u_(n){const{x:t,y:e,x2:i,y2:r}=n,a=Math.atan2(r-e,i-t);return a>X/2?a-X:a<X/-2?a+X:a}function d_(n,t,e,i){const{width:r,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?u_(n):St(t.rotation),h=h_(r,a,d),f=f_(n,t,{labelSize:h,padding:s},i),p=n.cp?Bs(c,n.cp,u,f):Ws(c,u,f),y={size:h.w,min:i.left,max:i.right,padding:s.left},b={size:h.h,min:i.top,max:i.bottom,padding:s.top},m=dd(p.x,y)+o,v=dd(p.y,b)+l;return{x:m-r/2,y:v-a/2,x2:m+r/2,y2:v+a/2,centerX:m,centerY:v,pointX:p.x,pointY:p.y,width:r,height:a,rotation:xi(d)}}function h_(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function f_(n,t,e,i){let r;const a=g_(n,i);return t.position==="start"?r=ud({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?r=1-ud({w:n.x-n.x2,h:n.y-n.y2},e,t,a):r=Es(1,t.position),r}function ud(n,t,e,i){const{labelSize:r,padding:a}=t,s=n.w*i.dx,o=n.h*i.dy,l=s>0&&(r.w/2+a.left-i.x)/s,c=o>0&&(r.h/2+a.top-i.y)/o;return or(Math.max(l,c),0,.25)}function g_(n,t){const{x:e,x2:i,y:r,y2:a}=n,s=Math.min(r,a)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(r,a),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function dd(n,t){const{size:e,min:i,max:r,padding:a}=t,s=e/2;return e>r-i?(r+i)/2:(i>=n-a-s&&(n=i+a+s),r<=n+a+s&&(n=r-a-s),n)}function hd(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:fd(n,e),endAdjust:fd(n,i)}}function fd(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,a={x:e,y:i+r};return Math.abs(Us(0,a,{x:0,y:r}))}function Hs(n,t,e,i){if(!i||!i.display)return;const{length:r,width:a,fill:s,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-r)+e;n.beginPath(),pn(n,i),Ee(n,i),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function p_(n,t,e){const{x:i,y:r,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-r,a-i),u=As(t.controlPoint,0),d={x:o+Oe(e,u.x,!1),y:l+Oe(e,u.y,!1)};return Ze(d,{x:o,y:l},c)}function gd(n,{x:t,y:e},{angle:i,adjust:r},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(i),Hs(n,0,-r,a),n.restore())}function m_(n,t,e,i){const{x:r,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=hd(t),f={x:r,y:a},p={x:s,y:o},y=od(f,e,p,0),b=od(f,e,p,1)-X,m=Bs(f,e,p,d/i),v=Bs(f,e,p,1-h/i),x=new Path2D;n.beginPath(),x.moveTo(m.x,m.y),x.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(x),t.path=x,t.ctx=n,gd(n,m,{angle:y,adjust:d},c),gd(n,v,{angle:b,adjust:h},u)}class ui extends Ot{inRange(t,e,i,r){const a=this.options.rotation,s=this.options.borderWidth;if(i!=="x"&&i!=="y")return b_({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],r),d=s/2,h=i==="y"?{start:l,end:u}:{start:o,end:c},f=Ze({x:t,y:e},this.getCenterPoint(r),St(-a));return f[i]>=h.start-d-Ge&&f[i]<=h.end+d+Ge}getCenterPoint(t){return gn(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:a,options:s}=this;t.save(),Ls(t,this.getCenterPoint(),s.rotation),pn(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=Ee(t,s);t.ellipse(r,a,i/2,e/2,X/2,0,2*X),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Xu(t,e)}}ui.id="ellipseAnnotation",ui.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},bn.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ui.defaultRoutes={borderColor:"color",backgroundColor:"color"},ui.descriptors={label:{_fallback:!0}};function b_(n,t,e,i){const{width:r,height:a,centerX:s,centerY:o}=t,l=r/2,c=a/2;if(l<=0||c<=0)return!1;const u=St(e||0),d=i/2||0,h=Math.cos(u),f=Math.sin(u),p=Math.pow(h*(n.x-s)+f*(n.y-o),2),y=Math.pow(f*(n.x-s)-h*(n.y-o),2);return p/Math.pow(l+d,2)+y/Math.pow(c+d,2)<=1.0001}class dr extends Ot{inRange(t,e,i,r){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],r),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return pw({x:t,y:e},this.getCenterPoint(r),c/2,u);const d=u/2,h=i==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return h.value>=h.start-d&&h.value<=h.end+d}getCenterPoint(t){return gn(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,pn(t,e);const r=Ee(t,e);Tw(t,this,this.centerX,this.centerY),r&&!cr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=qu(t,e);return i.initProperties=si(t,i,e),i}}dr.id="pointAnnotation",dr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},dr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class hr extends Ot{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&v_(this.elements,t,e,r);const a=Ze({x:t,y:e},this.getCenterPoint(r),St(-this.options.rotation)),s=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[i]>=o&&a[i]<=l}getCenterPoint(t){return gn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,pn(t,i);const r=Ee(t,i);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=qu(t,e),{sides:r,rotation:a}=e,s=[],o=2*X/r;let l=a*Mr;for(let c=0;c<r;c++,l+=o){const u=y_(i,e,l);u.initProperties=si(t,i,e),s.push(u)}return i.elements=s,i}}hr.id="polygonAnnotation",hr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},hr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function y_({centerX:n,centerY:t},{radius:e,borderWidth:i},r){const a=i/2,s=Math.sin(r),o=Math.cos(r),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function v_(n,t,e,i){let r=!1,a=n[n.length-1].getProps(["bX","bY"],i);for(const s of n){const o=s.getProps(["bX","bY"],i);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(r=!r),a=o}return r}const Ae={box:bn,ellipse:ui,label:oi,line:ci,point:dr,polygon:hr};Object.keys(Ae).forEach(n=>{bt.describe(`elements.${Ae[n].id}`,{_fallback:"plugins.annotation.common"})});const x_={update:Object.assign},w_=Ys.concat(ur),pd=(n,t)=>$(t)?js(n,t):n,$s=n=>n==="color"||n==="font";function Vs(n="line"){return Ae[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function __(n,t,e,i){const r=T_(n,e.animations,i),a=t.annotations,s=k_(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=md(s,o,l.type),u=l.setContext(S_(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=D_(d),"elements"in d&&(M_(c,d.elements,u,r),delete d.elements),Wt(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=bd(u),r.update(c,d)}}function D_(n){return isNaN(n.x)||isNaN(n.y)}function T_(n,t,e){return e==="reset"||e==="none"||e==="resize"?x_:new Yr(n,t)}function M_(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=md(r,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=bd(c),i.update(l,o)}}function md(n,t,e,i){const r=Ae[Vs(e)];let a=n[t];return(!a||!(a instanceof r))&&(a=n[t]=new r,Object.assign(a,i)),a}function bd(n){const t=Ae[Vs(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,js(n,t.defaults),js(n,t.defaultRoutes));for(const i of w_)e[i]=n[i];return e}function js(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],a=n[i];$s(i)&&tt(a)?e[i]=a.map(s=>pd(s,r)):e[i]=pd(a,r)}return e}function S_(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function k_(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var C_="3.0.1";const Re=new Map,P_=Ys.concat(ur);var yd={id:"annotation",version:C_,beforeRegister(){mw("chart.js","4.0",Xt.version)},afterRegister(){Xt.register(Ae)},afterUnregister(){Xt.unregister(Ae)},beforeInit(n){Re.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Re.get(n),r=i.annotations=[];let a=e.annotations;$(a)?Object.keys(a).forEach(s=>{const o=a[s];$(o)&&(o.id=s,r.push(o))}):tt(a)&&r.push(...a),Hw(r,n.scales)},afterDataLimits(n,t){const e=Re.get(n);zw(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Re.get(n);Fw(n,i,e),__(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),Bw(n,i,e)},beforeDatasetsDraw(n,t,e){fr(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){fr(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){fr(n,"beforeDraw",e.clip)},afterDraw(n,t,e){fr(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Re.get(n);Yw(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Re.delete(n)},_getState(n){return Re.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!P_.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Ae[Vs(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:$s,_fallback:!0},_indexable:$s}},additionalOptionScopes:[""]};function fr(n,t,e){const{ctx:i,chartArea:r}=n,a=Re.get(n);e&&Pn(i,r);const s=O_(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)E_(i,r,a,o);e&&On(i)}function O_(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function E_(n,t,e,i){const r=i.element;i.main?(Ju(e,r,"beforeDraw"),r.draw(n,t),Ju(e,r,"afterDraw")):r.draw(n,t)}const A_={class:"tooltip-title"},R_={class:"title font-bold"},L_={key:1,class:"subtitle"},I_={class:"tooltip"},N_={key:0},F_={class:"display-label"},Y_={class:"display-value"},W_=g.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=n,i=g.ref(null),r=g.ref(!1),a=g.ref({x:0,y:0}),s=g.ref({x:0,y:0}),o=g.ref({left:e.left,top:e.top});g.watch(i,h=>{if(h){const{width:f,height:p}=h.getBoundingClientRect();t("dimensions",{width:f,height:p})}}),g.watch(()=>e.locked,h=>{h?(o.value.left=e.left,o.value.top=e.top):h===!1&&(t("top",o.value.top),t("left",o.value.left))});function l(h){i.value&&(r.value=!0,a.value={x:i.value.offsetLeft,y:i.value.offsetTop},s.value={x:h.clientX,y:h.clientY},window.addEventListener("mousemove",u),window.addEventListener("mouseup",d))}let c=null;function u(h){h.preventDefault(),h.stopPropagation(),r.value&&(c!==null&&window.cancelAnimationFrame(c),c=window.requestAnimationFrame(()=>{const f=h.clientX-s.value.x,p=h.clientY-s.value.y;o.value.left=`${a.value.x+f}px`,o.value.top=`${a.value.y+p}px`}))}function d(){r.value=!1,c!==null&&window.cancelAnimationFrame(c),window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d)}return(h,f)=>{const p=g.resolveComponent("KIcon");return n.showTooltip?(g.openBlock(),g.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:i,class:g.normalizeClass(["tooltip-container",{locked:n.locked}]),style:g.normalizeStyle({left:n.locked?o.value.left:n.left,top:n.locked?o.value.top:n.top,pointerEvents:n.locked?"all":"none"}),onMousedown:l},[g.createElementVNode("div",A_,[g.createElementVNode("span",R_,g.toDisplayString(n.tooltipTitle),1),n.locked?(g.openBlock(),g.createBlock(p,{key:0,class:"drag-icon",icon:"drag"})):g.createCommentVNode("",!0),n.context?(g.openBlock(),g.createElementBlock("span",L_,g.toDisplayString(n.context),1)):g.createCommentVNode("",!0)]),g.createElementVNode("ul",I_,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(n.series,({backgroundColor:y,borderColor:b,label:m,value:v})=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:m},[n.series.length?(g.openBlock(),g.createElementBlock("li",N_,[g.createElementVNode("div",{class:"tooltip-legend",style:g.normalizeStyle({background:y,"border-color":b})},null,4),g.createElementVNode("span",F_,g.toDisplayString(m),1),g.createElementVNode("span",Y_,g.toDisplayString(v),1)])):g.createCommentVNode("",!0)],64))),128))])],38)):g.createCommentVNode("",!0)}}}),uD="",ge=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},qs=ge(W_,[["__scopeId","data-v-c0b7c451"]]),U_="#995c00",B_="40px",z_=["onClick"],H_=["title"],$_={key:0,class:"sub-label"},V_=g.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=g.ref(),i=g.ref([]),r=g.ref(!1),a=g.inject("showLegendValues",!0),s=g.inject("legendPosition",g.ref(vt.Right)),o=g.ref([]),l=()=>{const y=e.value;if(!y||!i.value||y.children.length===0)return 0;let b=1,m=y.children[0].getBoundingClientRect().top;for(const v of i.value){const x=v.getBoundingClientRect().top;x!==m&&(b++,m=x)}return b},c=()=>{e.value&&s.value===vt.Bottom&&(l()>1?r.value=!0:r.value=!1)},u=()=>{if(e.value&&s.value===vt.Bottom){let y=0;i.value.forEach(m=>{const v=Array.from(m.children).reduce((x,w)=>x+w.offsetWidth,0);v>y&&(y=v)});const b=parseInt(B_,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${y+b}px)`}},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let y=0;y<t.items.length;y++)if(t.items[y].text!==o.value[y].text)return o.value=t.items,!0;return!1};g.watch(()=>t.items,()=>{c(),d()&&u()},{immediate:!0,flush:"post"}),g.watch(()=>s.value,()=>{u()}),g.onMounted(()=>{o.value=t.items,window.addEventListener("resize",c)}),g.onBeforeUnmount(()=>{window.removeEventListener("resize",c)});const h=(y=0,b)=>{if(t.chartInstance===null)return;const m=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart;f(y,b)?m.hide(y,b):m.show(y,b),m.update()},f=(y=0,b)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const m=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart,v=m.getDatasetMeta(y);return v.dataset||b===void 0?m.isDatasetVisible(y):!(v.data.length&&v.data[b].hidden)},p=y=>({[vt.Right]:"vertical",[vt.Bottom]:"horizontal",[vt.Hidden]:"hidden"})[y];return(y,b)=>g.unref(s)!==g.unref(vt).Hidden?(g.openBlock(),g.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:g.normalizeClass(["legend-container",p(g.unref(s))]),"data-testid":"legend"},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(n.items,({fillStyle:m,strokeStyle:v,text:x,datasetIndex:w,index:_,value:D})=>(g.openBlock(),g.createElementBlock("li",{key:x,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:T=>h(w,_)},[g.createElementVNode("div",{class:"legend",style:g.normalizeStyle({background:m,"border-color":v})},null,4),g.createElementVNode("div",{class:g.normalizeClass(["label-container",{"strike-through":!f(w,_)}])},[g.createElementVNode("div",{class:g.normalizeClass(["label",{"truncate-label":r.value}]),title:g.unref(s)===g.unref(vt).Bottom&&x},g.toDisplayString(x),11,H_),D&&g.unref(a)?(g.openBlock(),g.createElementBlock("div",$_,g.toDisplayString(D.formatted),1)):g.createCommentVNode("",!0)],2)],8,z_))),128))],2)):g.createCommentVNode("",!0)}}),dD="",Xs=ge(V_,[["__scopeId","data-v-22ddf722"]]);let gr;const j_=new Uint8Array(16);function q_(){if(!gr&&(gr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gr(j_)}const At=[];for(let n=0;n<256;++n)At.push((n+256).toString(16).slice(1));function X_(n,t=0){return At[n[t+0]]+At[n[t+1]]+At[n[t+2]]+At[n[t+3]]+"-"+At[n[t+4]]+At[n[t+5]]+"-"+At[n[t+6]]+At[n[t+7]]+"-"+At[n[t+8]]+At[n[t+9]]+"-"+At[n[t+10]]+At[n[t+11]]+At[n[t+12]]+At[n[t+13]]+At[n[t+14]]+At[n[t+15]]}const vd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Le(n,t,e){if(vd.randomUUID&&!t&&!n)return vd.randomUUID();n=n||{};const i=n.random||(n.rng||q_)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let r=0;r<16;++r)t[e+r]=i[r];return t}return X_(i)}const xd=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,i.bottom-a.y):e.strokeRect(r.left,a.y-a.height/2,a.x-r.left,a.height),e.restore()},wd={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&xd(n,this.clickedElements)},afterEvent:function(n,{event:t}){var r;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((r=n.options.interaction)==null?void 0:r.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,xd(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},_d=6,G_=20,K_="100%",Gs=30,Z_=40,Q_=0,J_=10,t1=10,e1=1,n1=g.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px|%)/.test(n)}},emits:["heightUpdate"],setup(n,{emit:t}){const e=n,{i18n:i}=Dt.useI18n(),r=({chart:C},I)=>{var j;const F=C.data,V=(j=F.labels)==null?void 0:j.indexOf(I);return F.datasets.reduce((q,mt,gt)=>{if(C.isDatasetVisible(gt)){const it=mt.data[V];return isNaN(it)?q:q+it}else return q},0)},a=(C,I,F,V)=>{const j=V==="horizontal";I===null&&(I=i.t("entityNoName"));const q={type:"label",yValue:it=>j?I:r(it,I),xValue:it=>j?r(it,I):I},mt={...q,position:j?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>j?0:-Math.abs(sx()),content:it=>ms(r(it,I),F)},gt={...q,content:it=>vu(r(it,I),yu(it.chart,C)),position:j?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:it=>j?bu(ms(r(it,I),F)):0,color:mu};return{[`${I}-value`]:mt,[`${I}-percent`]:gt}},s=g.ref(),o=g.ref(),l=g.ref(Le()),c=Le(),u=Le(),d=g.ref([]),h=g.ref(g.inject("legendPosition",vt.Right)),f=g.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),p=g.toRef(e,"metricUnit"),y=g.computed(()=>p.value&&i.t(`chartUnits.${p.value}`)),b=g.computed(()=>g.toRef(e,"orientation").value==="horizontal"),m=g.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:y,offset:0,width:0,height:0,locked:!1,chartType:b.value?Et.HORIZONTAL_BAR:Et.VERTICAL_BAR}),v=g.ref(0),x=()=>{var C;return e.annotations&&((C=e.chartData.labels)==null?void 0:C.reduce((I,F)=>Object.assign(I,a(e.chartData,F,p.value,e.orientation)),{}))},w={id:l.value,afterUpdate(C){v.value+=1,d.value=C.options.plugins.legend.labels.generateLabels(C).map(I=>({...I,value:e.legendValues&&e.legendValues[I.text]})).sort((I,F)=>I.value&&F.value&&F.value.raw-I.value.raw)}},_={id:c,afterUpdate(C){C.options.plugins.annotation.annotations=e.annotations?x():{}}},S=[w,{id:"axisHover",afterEvent(C,I){if(f.value.show=!1,I.event.type==="mousemove"){const F=I.event,V=C.options.indexAxis,j=C.scales,q=C.scales[V].getLabelForValue(Number(C.scales[V].getValueForPixel(F[V])));if((gt=>gt==="x"?F.y>j.x.top:F.x<j.y.right)(V))if(m.locked||(m.showTooltip=!1),q.length>gs){const it=C.canvas.getContext("2d").measureText(q).width,lt=Math.abs(Math.round(F.x-it*.5)),et=Math.round(F.x+it*.5);f.value.left=V==="x"?`${(lt>0?lt:et)-f.value.offset}px`:`${F.x-it*.5-f.value.offset}px`,f.value.top=`${F.y-50}px`,f.value.show=!0,f.value.text=q}else f.value.show=!1;else f.value.show=!1}}},{id:u,afterUpdate(C){C.options.layout.padding.right=b.value?H.value:0}},wd,...e.annotations?[_]:[]],M=g.computed(()=>e.chartData.labels&&e.chartData.labels.length||0),O=g.computed(()=>{var I,F;let C=K_;if(s.value&&(C=s.value.width,s.value&&((I=e.chartData)!=null&&I.labels)&&((F=e.chartData)==null?void 0:F.labels.length)>Gs&&!b.value)){const V=e.chartData.labels.length;C=`${s.value.offsetWidth+(V-Gs)*Z_}px`}return C});g.watch(()=>{var C;return(C=e.chartData.labels)==null?void 0:C.length},C=>{let I=parseInt(e.height,10);if(C&&b.value){const F=C*G_;I=Math.max(F,I)}t("heightUpdate",I)}),Dt.useReportChartDataForSynthetics(g.toRef(e,"chartData"),g.toRef(e,"syntheticsDataKey")),g.onMounted(()=>{e.annotations&&Xt.register(yd)});const A=g.computed(()=>{const C=Dt.useBarChartOptions({tooltipState:m,legendID:l.value,stacked:g.toRef(e,"stacked"),metricAxesTitle:g.toRef(e,"metricAxesTitle"),dimensionAxesTitle:g.toRef(e,"dimensionAxesTitle"),indexAxis:b.value?"y":"x"});return{...C.value,plugins:{...C.value.plugins,annotation:{annotations:x(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*_d}}}}),R=Dt.useChartJSCommon("bar",s,g.toRef(e,"chartData"),S,A),H=g.computed(()=>{v.value;const C=e.chartData.labels,I=e.chartData.datasets,F=C.map((q,mt)=>I.reduce((gt,it)=>isNaN(Number(it.data[mt]))?gt:gt+Number(it.data[mt]),0)),V=R.value?yu(R.value,e.chartData):ox(e.chartData);return F.map(q=>bu(ms(q,p.value)+vu(q,V))).reduce((q,mt)=>Math.max(q,mt),0)+_d});g.onBeforeUnmount(()=>{Xt.unregister(yd)});const ft={[vt.Right]:"legend-row",[vt.Bottom]:"column"},N=g.computed(()=>{if(o.value&&R.value){const C=window.devicePixelRatio,I=R.value,F=I.scales.y.width*C+e1,V=(I.scales.y.height+I.scales.y.top+I.scales.x.height)*C,j=o.value.getContext("2d");return j.scale(C,C),j.canvas.width=F,j.canvas.height=V,j.canvas.style.width=`${F/C}px`,j.canvas.style.height=`${V/C}px`,{scale:C,width:F*C,height:V*C,targetCtx:j}}return null}),B=C=>{if(N.value&&R.value){const I=N.value.scale,F=N.value.targetCtx,V=N.value.width,j=N.value.height,q=R.value,mt=q.canvas,gt=C.target;F.fillStyle="white",gt.scrollLeft>=Q_&&gt.scrollLeft<=J_?(F.globalCompositeOperation="source-over",F.clearRect(0,0,V,j),F.drawImage(mt,0,0,V,j,0,0,V,j),F.globalCompositeOperation="destination-over",F.fillRect(0,0,V,j)):(F.globalCompositeOperation="source-over",F.fillRect(0,(q.scales.y.height+q.scales.y.top+t1)*I,V,q.scales.x.height*I)),m.offset=gt.scrollLeft,f.value.offset=gt.scrollLeft}},Z=({width:C,height:I})=>{m.width=C,m.height=I};g.watch(()=>e.orientation,()=>{var C;if(o.value&&N.value){const I=N.value.width,F=N.value.height;((C=o.value)==null?void 0:C.getContext("2d")).clearRect(0,0,I,F)}m.showTooltip=!1,m.locked=!1}),g.watch(()=>e.annotations,C=>{R.value&&(C?R.value.options.plugins.annotation.annotations=x(e.chartData):delete R.value.options.plugins.annotation.annotations)});const Ct=()=>{m.showTooltip&&(m.locked=!m.locked)};return(C,I)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["chart-parent",ft[h.value]])},[g.createElementVNode("canvas",{ref_key:"axis",ref:o,class:"axis"},null,512),g.createElementVNode("div",{class:"chart-container",style:g.normalizeStyle({"overflow-x":M.value>Gs?"auto":"hidden"}),"on:scroll":B,onClick:I[0]||(I[0]=F=>Ct())},[g.createElementVNode("div",{class:"chart-body",style:g.normalizeStyle({width:O.value})},[g.createElementVNode("canvas",{ref_key:"canvas",ref:s},null,512)],4)],36),f.value.show?(g.openBlock(),g.createElementBlock("div",{key:0,class:"axis-tooltip",style:g.normalizeStyle({top:f.value.top,left:f.value.left})},g.toDisplayString(f.value.text),5)):g.createCommentVNode("",!0),g.createVNode(qs,{context:m.tooltipContext,left:m.left,locked:m.locked,series:m.tooltipSeries,"show-tooltip":m.showTooltip,"tooltip-title":n.tooltipTitle,top:m.top,onDimensions:Z},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),g.createVNode(Xs,{id:l.value,"chart-instance":g.unref(R),items:d.value},null,8,["id","chart-instance","items"])],2))}}),fD="",i1=ge(n1,[["__scopeId","data-v-2d7e4a73"]]);/*!
24
+ */const Iu={modes:{point(n,t){return sr(n,t,{intersect:!0})},nearest(n,t,e){return hw(n,t,e)},x(n,t,e){return sr(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return sr(n,t,{intersect:e.intersect,axis:"y"})}}};function Ps(n,t,e){return(Iu.modes[e.mode]||Iu.modes.nearest)(n,t,e)}function uw(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function dw(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function sr(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):uw(i,t,e.axis))}function hw(n,t,e){let i=Number.POSITIVE_INFINITY;return sr(n,t,e).reduce((r,a)=>{const s=a.getCenterPoint(),o=dw(t,s,e.axis),l=Je(t,o);return l<i?(r=[a],i=l):l===i&&r.push(a),r},[]).sort((r,a)=>r._index-a._index).slice(0,1)}const fw=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Ge=.001,or=(n,t,e)=>Math.min(e,Math.max(t,n));function gw(n,t,e){for(const i of Object.keys(n))n[i]=or(n[i],t,e);return n}function pw(n,t,e,i){if(!n||!t||e<=0)return!1;const r=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+r,2)}function Nu(n,{x:t,y:e,x2:i,y2:r},a,s){const o=s/2,l=n.x>=t-o-Ge&&n.x<=i+o+Ge,c=n.y>=e-o-Ge&&n.y<=r+o+Ge;return a==="x"?l:(a==="y"||l)&&c}function pn(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function mw(n,t,e,i=!0){const r=e.split(".");let a=0;for(const s of t.split(".")){const o=r[a++];if(parseInt(s,10)<parseInt(o,10))break;if(fw(o,s)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Fu=n=>typeof n=="string"&&n.endsWith("%"),Yu=n=>parseFloat(n)/100,Wu=n=>or(Yu(n),0,1),lr=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),bw={box:n=>lr(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>lr(n.centerX,n.centerY),line:n=>lr(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>lr(n.centerX,n.centerY)};function Es(n,t){return t==="start"?0:t==="end"?n:Fu(t)?Wu(t)*n:n/2}function Pe(n,t,e=!0){return typeof t=="number"?t:Fu(t)?(e?Wu(t):Yu(t))*n:n}function yw(n,t){const{x:e,width:i}=n,r=t.textAlign;return r==="center"?e+i/2:r==="end"||r==="right"?e+i:e}function As(n,t="center"){return H(n)?{x:W(n.x,t),y:W(n.y,t)}:(n=W(n,t),{x:n,y:n})}function Uu(n){return n&&(Wt(n.xValue)||Wt(n.yValue))}function si(n,t,e){const i=e.init;if(i){if(i===!0)return zu(t,e)}else return;return vw(n,t,e)}function Bu(n,t,e){let i=!1;return t.forEach(r=>{Ut(n[r])?(i=!0,e[r]=n[r]):Wt(e[r])&&delete e[r]}),i}function zu(n,t){const e=t.type||"line";return bw[e](n)}function vw(n,t,e){const i=rt(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return zu(t,e);if(H(i))return i}const Rs=new Map,xw=n=>isNaN(n)||n<=0,ww=n=>n.reduce(function(t,e){return t+=e.string,t},"");function cr(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Ls(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(St(i)),n.translate(-t,-e))}function Ee(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle,n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle,n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function mn(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Is(n,t){const e=t.content;if(cr(e))return{width:Pe(e.width,t.width),height:Pe(e.height,t.height)};const i=t.font,r=tt(i)?i.map(l=>dt(l)):[dt(i)],a=t.textStrokeWidth,s=tt(e)?e:[e],o=s.join()+ww(r)+a+(n._measureText?"-spriting":"");return Rs.has(o)||Rs.set(o,Sw(n,s,r,a)),Rs.get(o)}function Hu(n,t,e){const{x:i,y:r,width:a,height:s}=t;n.save(),mn(n,e);const o=Ee(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),tn(n,{x:i,y:r,w:a,h:s,radius:gw(_e(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function _w(n,t,e){const i=e.content;if(cr(i)){n.save(),n.globalAlpha=Ow(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}const r=tt(i)?i:[i],a=e.font,s=tt(a)?a.map(d=>dt(d)):[dt(a)],o=e.color,l=tt(o)?o:[o],c=yw(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,Dw(n,e)&&kw(n,{x:c,y:u},r,s),Cw(n,{x:c,y:u},r,{fonts:s,colors:l}),n.restore()}function Dw(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function Tw(n,t,e,i){const{radius:r,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Mr;if(cr(s)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}xw(r)||Mw(n,{x:e,y:i,radius:r,rotation:o,style:s,rad:l})}function Mw(n,{x:t,y:e,radius:i,rotation:r,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,i,0,ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=vi,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),s+=vi,n.lineTo(t+Math.sin(s)*i,e-Math.cos(s)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(s+qt)*c,l=Math.sin(s+qt)*c,n.arc(t-o,e-l,u,s-q,s-ut),n.arc(t+l,e-o,u,s-ut,s),n.arc(t+o,e+l,u,s,s+ut),n.arc(t-l,e+o,u,s+ut,s+q),n.closePath();break;case"rect":if(!r){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}s+=qt;case"rectRot":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":s+=qt;case"cross":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),s+=qt,o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(s)*i,l=Math.sin(s)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(s)*i,e+Math.sin(s)*i);break}n.fill()}function Sw(n,t,e,i){n.save();const r=t.length;let a=0,s=i;for(let o=0;o<r;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];a=Math.max(a,n.measureText(c).width+i),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function kw(n,{x:t,y:e},i,r){n.beginPath();let a=0;i.forEach(function(s,o){const l=r[Math.min(o,r.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function Cw(n,{x:t,y:e},i,{fonts:r,colors:a}){let s=0;i.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=r[Math.min(l,r.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+d/2+s),s+=d,n.fill()})}function Ow(n,t){const e=we(n)?n:t;return we(e)?or(e,0,1):1}const $u={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function bn(n,t,e){return t=typeof t=="number"?t:n.parse(t),gt(t)?n.getPixelForValue(t):e}function Ke(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const r=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===r);return a.length?a[0].id:r}function Vu(n,t){if(n){const e=n.options.reverse,i=bn(n,t.min,e?t.end:t.start),r=bn(n,t.max,e?t.start:t.end);return{start:i,end:r}}}function ju(n,t){const{chartArea:e,scales:i}=n,r=i[Ke(i,t,"xScaleID")],a=i[Ke(i,t,"yScaleID")];let s=e.width/2,o=e.height/2;return r&&(s=bn(r,t.xValue,r.left+r.width/2)),a&&(o=bn(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function Ns(n,t){const e=n.scales,i=e[Ke(e,t,"xScaleID")],r=e[Ke(e,t,"yScaleID")];if(!i&&!r)return{};let{left:a,right:s}=i||n.chartArea,{top:o,bottom:l}=r||n.chartArea;const c=Gu(i,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=Gu(r,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:a,y:o,x2:s,y2:l,width:s-a,height:l-o,centerX:a+(s-a)/2,centerY:o+(l-o)/2}}function qu(n,t){if(!Uu(t)){const e=Ns(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const r=i*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-i,y:s-i,x2:a+i,y2:s+i,centerX:a,centerY:s,width:r,height:r,radius:i}}return Ew(n,t)}function Pw(n,t){const{scales:e,chartArea:i}=n,r=e[t.scaleID],a={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?Aw(r,a,t):Rw(e,a,t),a}function Xu(n,t){const e=Ns(n,t);return e.initProperties=si(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:Nw(n,e,t),initProperties:e.initProperties}],e}function Ew(n,t){const e=ju(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Gu(n,t){const e=Vu(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function Aw(n,t,e){const i=bn(n,e.value,NaN),r=bn(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function Rw(n,t,e){for(const i of Object.keys($u)){const r=n[Ke(n,e,i)];if(r){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=$u[i],d=Vu(r,{min:e[a],max:e[s],start:r[o],end:r[l]});t[c]=d.start,t[u]=d.end}}}function Lw({properties:n,options:t},e,i,r){const{x:a,x2:s,width:o}=n;return Ku({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:e.width})}function Iw({properties:n,options:t},e,i,r){const{y:a,y2:s,height:o}=n;return Ku({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:e.height})}function Ku(n,t){const{start:e,end:i,borderWidth:r}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=i-r-e-s-o-t.size;return e+r/2+l+Es(c,a)}function Nw(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const r=As(i.position),a=kt(i.padding),s=Is(n.ctx,i),o=Lw({properties:t,options:e},s,r,a),l=Iw({properties:t,options:e},s,r,a),c=s.width+a.width,u=s.height+a.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}function Ze(n,t,e){const i=Math.cos(e),r=Math.sin(e),a=t.x,s=t.y;return{x:a+i*(n.x-a)-r*(n.y-s),y:s+r*(n.x-a)+i*(n.y-s)}}const Fs=["enter","leave"],Ys=Fs.concat("click");function Fw(n,t,e){t.listened=Bu(e,Ys,t.listeners),t.moveListened=!1,t._getElements=Ps,Fs.forEach(i=>{Ut(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Ut(i.click)&&(t.listened=!0),t.moveListened||Fs.forEach(r=>{Ut(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function Yw(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return Ww(n,t,e);case"click":return Uw(n,t,e)}}function Ww(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Ps(n,t,e.interaction):i=[];const r=n.hovered;n.hovered=i;const a={state:n,event:t};let s=Zu(a,"leave",r,i);return Zu(a,"enter",i,r)||s}function Zu({state:n,event:t},e,i,r){let a;for(const s of i)r.indexOf(s)<0&&(a=Qu(s.options[e]||n.listeners[e],s,t)||a);return a}function Uw(n,t,e){const i=n.listeners,r=Ps(n,t,e.interaction);let a;for(const s of r)a=Qu(s.options.click||i.click,s,t)||a;return a}function Qu(n,t,e){return rt(n,[t.$context,e])===!0}const ur=["afterDraw","beforeDraw"];function Bw(n,t,e){const i=t.visibleElements;t.hooked=Bu(e,ur,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ur.forEach(a=>{Ut(r.options[a])&&(t.hooked=!0)})})}function Ju(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return rt(i,[t.$context])}}function zw(n,t,e){const i=qw(n.scales,t,e);let r=td(t,i,"min","suggestedMin");r=td(t,i,"max","suggestedMax")||r,r&&Ut(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function Hw(n,t){for(const e of n)Vw(e,t)}function td(n,t,e,i){if(gt(t[e])&&!$w(n.options,e,i)){const r=n[e]!==t[e];return n[e]=t[e],r}}function $w(n,t,e){return Wt(n[t])||Wt(n[e])}function Vw(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Ke(t,n,e);i&&!t[i]&&jw(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function jw(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(Wt(n[e+i]))return!0;return!1}function qw(n,t,e){const i=t.axis,r=t.id,a=i+"ScaleID",s={min:W(t.min,Number.NEGATIVE_INFINITY),max:W(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===r?ed(o,t,["value","endValue"],s):Ke(n,o,a)===r&&ed(o,t,[i+"Min",i+"Max",i+"Value"],s);return s}function ed(n,t,e,i){for(const r of e){const a=n[r];if(Wt(a)){const s=t.parse(a);i.min=Math.min(i.min,s),i.max=Math.max(i.max,s)}}}class yn extends Pt{inRange(t,e,i,r){const{x:a,y:s}=Ze({x:t,y:e},this.getCenterPoint(r),St(-this.options.rotation));return Nu({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return pn(this,t)}draw(t){t.save(),Ls(t,this.getCenterPoint(),this.options.rotation),Hu(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Xu(t,e)}}yn.id="boxAnnotation",yn.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},yn.defaultRoutes={borderColor:"color",backgroundColor:"color"},yn.descriptors={label:{_fallback:!0}};const nd=["left","bottom","top","right"];class oi extends Pt{inRange(t,e,i,r){const{x:a,y:s}=Ze({x:t,y:e},this.getCenterPoint(r),St(-this.rotation));return Nu({x:a,y:s},this.getProps(["x","y","x2","y2"],r),i,this.options.borderWidth)}getCenterPoint(t){return pn(this,t)}draw(t){const e=this.options,i=!Wt(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Ls(t,this.getCenterPoint(),this.rotation),Gw(t,this),Hu(t,this,e),_w(t,n_(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Uu(e))i=ju(t,e);else{const{centerX:o,centerY:l}=Ns(t,e);i={x:o,y:l}}const r=kt(e.padding),a=Is(t.ctx,e),s=Xw(i,a,e,r);return{initProperties:si(t,s,e),pointX:i.x,pointY:i.y,...s,rotation:e.rotation}}}oi.id="labelAnnotation",oi.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},oi.defaultRoutes={borderColor:"color"};function Xw(n,t,e,i){const r=t.width+i.width+e.borderWidth,a=t.height+i.height+e.borderWidth,s=As(e.position,"center"),o=id(n.x,r,e.xAdjust,s.x),l=id(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+r,y2:l+a,width:r,height:a,centerX:o+r/2,centerY:l+a/2}}function id(n,t,e=0,i){return n-Es(t,i)+e}function Gw(n,t){const{pointX:e,pointY:i,options:r}=t,a=r.callout,s=a&&a.display&&t_(t,a);if(!s||i_(t,a,s))return;if(n.save(),n.beginPath(),!Ee(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=Kw(t,s),{sideStart:u,sideEnd:d}=Qw(t,s,l);(a.margin>0||r.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(d.x,d.y);const h=Ze({x:e,y:i},t.getCenterPoint(),St(-t.rotation));n.lineTo(h.x,h.y),n.stroke(),n.restore()}function Kw(n,t){const{x:e,y:i,x2:r,y2:a}=n,s=Zw(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:i},l={x:o.x,y:a}):(o={x:e,y:i+s},l={x:r,y:o.y}),{separatorStart:o,separatorEnd:l}}function Zw(n,t){const{width:e,height:i,options:r}=n,a=r.callout.margin+r.borderWidth/2;return t==="right"?e+a:t==="bottom"?i+a:-a}function Qw(n,t,e){const{y:i,width:r,height:a,options:s}=n,o=s.callout.start,l=Jw(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Pe(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+Pe(r,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Jw(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function t_(n,t){const e=t.position;return nd.includes(e)?e:e_(n,t)}function e_(n,t){const{x:e,y:i,x2:r,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:h}=n,f={x:u,y:d},p=t.start,y=Pe(s,p),b=Pe(o,p),m=[e,e+y,e+y,r],v=[i+b,a,i,a],w=[];for(let x=0;x<4;x++){const _=Ze({x:m[x],y:v[x]},f,St(h));w.push({position:nd[x],distance:Je(_,{x:l,y:c})})}return w.sort((x,_)=>x.distance-_.distance)[0].position}function n_({x:n,y:t,width:e,height:i,options:r}){const a=r.borderWidth/2,s=kt(r.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-r.borderWidth,height:i-s.top-s.bottom-r.borderWidth}}function i_(n,t,e){const{pointX:i,pointY:r}=n,a=t.margin;let s=i,o=r;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ws=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Us=(n,t,e)=>Ws(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,rd=(n,t,e)=>Ws(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,li=n=>n*n,r_=(n,t,{x:e,y:i,x2:r,y2:a},s)=>s==="y"?{start:Math.min(i,a),end:Math.max(i,a),value:t}:{start:Math.min(e,r),end:Math.max(e,r),value:n},ad=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Bs=(n,t,e,i)=>({x:ad(n.x,t.x,e.x,i),y:ad(n.y,t.y,e.y,i)}),sd=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),od=(n,t,e,i)=>-Math.atan2(sd(n.x,t.x,e.x,i),sd(n.y,t.y,e.y,i))+.5*q;class ci extends Pt{inRange(t,e,i,r){const a=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){Ee(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,h=e*u.currentDevicePixelRatio,f=l.isPointInStroke(o,d,h)||zs(this,s,r);return l.restore(),f}const c=li(a);return l_(this,s,c,r)||zs(this,s,r)}return a_(this,{mouseX:t,mouseY:e},i,{hBorderWidth:a,useFinalPosition:r})}getCenterPoint(t){return pn(this,t)}draw(t){const{x:e,y:i,x2:r,y2:a,cp:s,options:o}=this;if(t.save(),!Ee(t,o))return t.restore();mn(t,o);const l=Math.sqrt(Math.pow(r-e,2)+Math.pow(a-i,2));if(o.curve&&s)return m_(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=hd(this),f=Math.atan2(a-i,r-e);t.translate(e,i),t.rotate(f),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-h,0),t.shadowColor=o.borderShadowColor,t.stroke(),Hs(t,0,d,c),Hs(t,l,-h,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=Pw(t,e),{x:r,y:a,x2:s,y2:o}=i,l=s_(i,t.chartArea),c=l?o_({x:r,y:a},{x:s,y:o},t.chartArea):{x:r,y:a,x2:s,y2:o,width:Math.abs(s-r),height:Math.abs(o-a)};if(c.centerX=(s+r)/2,c.centerY=(o+a)/2,c.initProperties=si(t,c,e),e.curve){const d={x:c.x,y:c.y},h={x:c.x2,y:c.y2};c.cp=p_(c,e,Je(d,h))}const u=c_(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}ci.id="lineAnnotation";const ld={backgroundColor:void 0,backgroundShadowColor:void 0,borderColor:void 0,borderDash:void 0,borderDashOffset:void 0,borderShadowColor:void 0,borderWidth:void 0,display:void 0,fill:void 0,length:void 0,shadowBlur:void 0,shadowOffsetX:void 0,shadowOffsetY:void 0,width:void 0};ci.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},ld),fill:!1,length:12,start:Object.assign({},ld),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},oi.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ci.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},ci.defaultRoutes={borderColor:"color"};function a_(n,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:a}){const s=r_(t,e,n.getProps(["x","y","x2","y2"],a),i);return s.value>=s.start-r&&s.value<=s.end+r||zs(n,{mouseX:t,mouseY:e},a,i)}function s_({x:n,y:t,x2:e,y2:i},{top:r,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<r&&i<r||t>s&&i>s)}function cd({x:n,y:t},e,{top:i,right:r,bottom:a,left:s}){return n<s&&(t=rd(s,{x:n,y:t},e),n=s),n>r&&(t=rd(r,{x:n,y:t},e),n=r),t<i&&(n=Us(i,{x:n,y:t},e),t=i),t>a&&(n=Us(a,{x:n,y:t},e),t=a),{x:n,y:t}}function o_(n,t,e){const{x:i,y:r}=cd(n,t,e),{x:a,y:s}=cd(t,n,e);return{x:i,y:r,x2:a,y2:s,width:Math.abs(a-i),height:Math.abs(s-r)}}function l_(n,{mouseX:t,mouseY:e},i=Ge,r){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],r),c=o-a,u=l-s,d=li(c)+li(u),h=d===0?-1:((t-a)*c+(e-s)*u)/d;let f,p;return h<0?(f=a,p=s):h>1?(f=o,p=l):(f=a+h*c,p=s+h*u),li(t-f)+li(e-p)<=i}function zs(n,{mouseX:t,mouseY:e},i,r){const a=n.label;return a.options.display&&a.inRange(t,e,r,i)}function c_(n,t,e){const i=e.borderWidth,r=kt(e.padding),a=Is(n.ctx,e),s=a.width+r.width+i,o=a.height+r.height+i;return d_(t,e,{width:s,height:o,padding:r},n.chartArea)}function u_(n){const{x:t,y:e,x2:i,y2:r}=n,a=Math.atan2(r-e,i-t);return a>q/2?a-q:a<q/-2?a+q:a}function d_(n,t,e,i){const{width:r,height:a,padding:s}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?u_(n):St(t.rotation),h=h_(r,a,d),f=f_(n,t,{labelSize:h,padding:s},i),p=n.cp?Bs(c,n.cp,u,f):Ws(c,u,f),y={size:h.w,min:i.left,max:i.right,padding:s.left},b={size:h.h,min:i.top,max:i.bottom,padding:s.top},m=dd(p.x,y)+o,v=dd(p.y,b)+l;return{x:m-r/2,y:v-a/2,x2:m+r/2,y2:v+a/2,centerX:m,centerY:v,pointX:p.x,pointY:p.y,width:r,height:a,rotation:xi(d)}}function h_(n,t,e){const i=Math.cos(e),r=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*r),h:Math.abs(n*r)+Math.abs(t*i)}}function f_(n,t,e,i){let r;const a=g_(n,i);return t.position==="start"?r=ud({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?r=1-ud({w:n.x-n.x2,h:n.y-n.y2},e,t,a):r=Es(1,t.position),r}function ud(n,t,e,i){const{labelSize:r,padding:a}=t,s=n.w*i.dx,o=n.h*i.dy,l=s>0&&(r.w/2+a.left-i.x)/s,c=o>0&&(r.h/2+a.top-i.y)/o;return or(Math.max(l,c),0,.25)}function g_(n,t){const{x:e,x2:i,y:r,y2:a}=n,s=Math.min(r,a)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(r,a),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function dd(n,t){const{size:e,min:i,max:r,padding:a}=t,s=e/2;return e>r-i?(r+i)/2:(i>=n-a-s&&(n=i+a+s),r<=n+a+s&&(n=r-a-s),n)}function hd(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:fd(n,e),endAdjust:fd(n,i)}}function fd(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,r=n.options.borderWidth/2,a={x:e,y:i+r};return Math.abs(Us(0,a,{x:0,y:r}))}function Hs(n,t,e,i){if(!i||!i.display)return;const{length:r,width:a,fill:s,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-r)+e;n.beginPath(),mn(n,i),Ee(n,i),n.moveTo(c,-a),n.lineTo(t+e,0),n.lineTo(c,a),s===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function p_(n,t,e){const{x:i,y:r,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-r,a-i),u=As(t.controlPoint,0),d={x:o+Pe(e,u.x,!1),y:l+Pe(e,u.y,!1)};return Ze(d,{x:o,y:l},c)}function gd(n,{x:t,y:e},{angle:i,adjust:r},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(i),Hs(n,0,-r,a),n.restore())}function m_(n,t,e,i){const{x:r,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=hd(t),f={x:r,y:a},p={x:s,y:o},y=od(f,e,p,0),b=od(f,e,p,1)-q,m=Bs(f,e,p,d/i),v=Bs(f,e,p,1-h/i),w=new Path2D;n.beginPath(),w.moveTo(m.x,m.y),w.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(w),t.path=w,t.ctx=n,gd(n,m,{angle:y,adjust:d},c),gd(n,v,{angle:b,adjust:h},u)}class ui extends Pt{inRange(t,e,i,r){const a=this.options.rotation,s=this.options.borderWidth;if(i!=="x"&&i!=="y")return b_({x:t,y:e},this.getProps(["width","height","centerX","centerY"],r),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],r),d=s/2,h=i==="y"?{start:l,end:u}:{start:o,end:c},f=Ze({x:t,y:e},this.getCenterPoint(r),St(-a));return f[i]>=h.start-d-Ge&&f[i]<=h.end+d+Ge}getCenterPoint(t){return pn(this,t)}draw(t){const{width:e,height:i,centerX:r,centerY:a,options:s}=this;t.save(),Ls(t,this.getCenterPoint(),s.rotation),mn(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=Ee(t,s);t.ellipse(r,a,i/2,e/2,q/2,0,2*q),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Xu(t,e)}}ui.id="ellipseAnnotation",ui.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},yn.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},ui.defaultRoutes={borderColor:"color",backgroundColor:"color"},ui.descriptors={label:{_fallback:!0}};function b_(n,t,e,i){const{width:r,height:a,centerX:s,centerY:o}=t,l=r/2,c=a/2;if(l<=0||c<=0)return!1;const u=St(e||0),d=i/2||0,h=Math.cos(u),f=Math.sin(u),p=Math.pow(h*(n.x-s)+f*(n.y-o),2),y=Math.pow(f*(n.x-s)-h*(n.y-o),2);return p/Math.pow(l+d,2)+y/Math.pow(c+d,2)<=1.0001}class dr extends Pt{inRange(t,e,i,r){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],r),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return pw({x:t,y:e},this.getCenterPoint(r),c/2,u);const d=u/2,h=i==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return h.value>=h.start-d&&h.value<=h.end+d}getCenterPoint(t){return pn(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,mn(t,e);const r=Ee(t,e);Tw(t,this,this.centerX,this.centerY),r&&!cr(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=qu(t,e);return i.initProperties=si(t,i,e),i}}dr.id="pointAnnotation",dr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},dr.defaultRoutes={borderColor:"color",backgroundColor:"color"};class hr extends Pt{inRange(t,e,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&v_(this.elements,t,e,r);const a=Ze({x:t,y:e},this.getCenterPoint(r),St(-this.options.rotation)),s=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[i]>=o&&a[i]<=l}getCenterPoint(t){return pn(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,mn(t,i);const r=Ee(t,i);let a=!0;for(const s of e)a?(t.moveTo(s.x,s.y),a=!1):t.lineTo(s.x,s.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=qu(t,e),{sides:r,rotation:a}=e,s=[],o=2*q/r;let l=a*Mr;for(let c=0;c<r;c++,l+=o){const u=y_(i,e,l);u.initProperties=si(t,i,e),s.push(u)}return i.elements=s,i}}hr.id="polygonAnnotation",hr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},hr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function y_({centerX:n,centerY:t},{radius:e,borderWidth:i},r){const a=i/2,s=Math.sin(r),o=Math.cos(r),l={x:n+s*e,y:t-o*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+s*(e+a),bY:t-o*(e+a)}}}function v_(n,t,e,i){let r=!1,a=n[n.length-1].getProps(["bX","bY"],i);for(const s of n){const o=s.getProps(["bX","bY"],i);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(r=!r),a=o}return r}const Ae={box:yn,ellipse:ui,label:oi,line:ci,point:dr,polygon:hr};Object.keys(Ae).forEach(n=>{mt.describe(`elements.${Ae[n].id}`,{_fallback:"plugins.annotation.common"})});const x_={update:Object.assign},w_=Ys.concat(ur),pd=(n,t)=>H(t)?js(n,t):n,$s=n=>n==="color"||n==="font";function Vs(n="line"){return Ae[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function __(n,t,e,i){const r=T_(n,e.animations,i),a=t.annotations,s=k_(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=md(s,o,l.type),u=l.setContext(S_(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=D_(d),"elements"in d&&(M_(c,d.elements,u,r),delete d.elements),Wt(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=bd(u),r.update(c,d)}}function D_(n){return isNaN(n.x)||isNaN(n.y)}function T_(n,t,e){return e==="reset"||e==="none"||e==="resize"?x_:new Yr(n,t)}function M_(n,t,e,i){const r=n.elements||(n.elements=[]);r.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=md(r,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=bd(c),i.update(l,o)}}function md(n,t,e,i){const r=Ae[Vs(e)];let a=n[t];return(!a||!(a instanceof r))&&(a=n[t]=new r,Object.assign(a,i)),a}function bd(n){const t=Ae[Vs(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,js(n,t.defaults),js(n,t.defaultRoutes));for(const i of w_)e[i]=n[i];return e}function js(n,t){const e={};for(const i of Object.keys(t)){const r=t[i],a=n[i];$s(i)&&tt(a)?e[i]=a.map(s=>pd(s,r)):e[i]=pd(a,r)}return e}function S_(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function k_(n,t){const e=t.length,i=n.length;if(i<e){const r=e-i;n.splice(i,0,...new Array(r))}else i>e&&n.splice(e,i-e);return n}var C_="3.0.1";const Re=new Map,O_=Ys.concat(ur);var yd={id:"annotation",version:C_,beforeRegister(){mw("chart.js","4.0",Xt.version)},afterRegister(){Xt.register(Ae)},afterUnregister(){Xt.unregister(Ae)},beforeInit(n){Re.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Re.get(n),r=i.annotations=[];let a=e.annotations;H(a)?Object.keys(a).forEach(s=>{const o=a[s];H(o)&&(o.id=s,r.push(o))}):tt(a)&&r.push(...a),Hw(r,n.scales)},afterDataLimits(n,t){const e=Re.get(n);zw(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Re.get(n);Fw(n,i,e),__(n,i,e,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),Bw(n,i,e)},beforeDatasetsDraw(n,t,e){fr(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){fr(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){fr(n,"beforeDraw",e.clip)},afterDraw(n,t,e){fr(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Re.get(n);Yw(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Re.delete(n)},_getState(n){return Re.get(n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:n=>!O_.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${Ae[Vs(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:$s,_fallback:!0},_indexable:$s}},additionalOptionScopes:[""]};function fr(n,t,e){const{ctx:i,chartArea:r}=n,a=Re.get(n);e&&Pn(i,r);const s=P_(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)E_(i,r,a,o);e&&En(i)}function P_(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&e.push({element:r});return e}function E_(n,t,e,i){const r=i.element;i.main?(Ju(e,r,"beforeDraw"),r.draw(n,t),Ju(e,r,"afterDraw")):r.draw(n,t)}const A_={class:"tooltip-title"},R_={class:"title font-bold"},L_={key:1,class:"subtitle"},I_={class:"tooltip"},N_={key:0},F_={class:"display-label"},Y_={class:"display-value"},W_=g.defineComponent({__name:"ChartTooltip",props:{showTooltip:{type:Boolean,required:!0,default:!1},left:{type:String,required:!1,default:null},top:{type:String,required:!1,default:null},tooltipTitle:{type:String,required:!1,default:""},context:{type:[String,Number],required:!1,default:""},series:{type:Array,required:!0,default:()=>[]},locked:{type:Boolean,required:!1,default:!1}},emits:["dimensions","top","left"],setup(n,{emit:t}){const e=n,i=g.ref(null),r=g.ref(!1),a=g.ref({x:0,y:0}),s=g.ref({x:0,y:0}),o=g.ref({left:e.left,top:e.top});g.watch(i,h=>{if(h){const{width:f,height:p}=h.getBoundingClientRect();t("dimensions",{width:f,height:p})}}),g.watch(()=>e.locked,h=>{h?(o.value.left=e.left,o.value.top=e.top):h===!1&&(t("top",o.value.top),t("left",o.value.left))});function l(h){i.value&&(r.value=!0,a.value={x:i.value.offsetLeft,y:i.value.offsetTop},s.value={x:h.clientX,y:h.clientY},window.addEventListener("mousemove",u),window.addEventListener("mouseup",d))}let c=null;function u(h){h.preventDefault(),h.stopPropagation(),r.value&&(c!==null&&window.cancelAnimationFrame(c),c=window.requestAnimationFrame(()=>{const f=h.clientX-s.value.x,p=h.clientY-s.value.y;o.value.left=`${a.value.x+f}px`,o.value.top=`${a.value.y+p}px`}))}function d(){r.value=!1,c!==null&&window.cancelAnimationFrame(c),window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d)}return(h,f)=>{const p=g.resolveComponent("KIcon");return n.showTooltip?(g.openBlock(),g.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:i,class:g.normalizeClass(["tooltip-container",{locked:n.locked}]),style:g.normalizeStyle({left:n.locked?o.value.left:n.left,top:n.locked?o.value.top:n.top,pointerEvents:n.locked?"all":"none"}),onMousedown:l},[g.createElementVNode("div",A_,[g.createElementVNode("span",R_,g.toDisplayString(n.tooltipTitle),1),n.locked?(g.openBlock(),g.createBlock(p,{key:0,class:"drag-icon",icon:"drag"})):g.createCommentVNode("",!0),n.context?(g.openBlock(),g.createElementBlock("span",L_,g.toDisplayString(n.context),1)):g.createCommentVNode("",!0)]),g.createElementVNode("ul",I_,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(n.series,({backgroundColor:y,borderColor:b,label:m,value:v})=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:m},[n.series.length?(g.openBlock(),g.createElementBlock("li",N_,[g.createElementVNode("div",{class:"tooltip-legend",style:g.normalizeStyle({background:y,"border-color":b})},null,4),g.createElementVNode("span",F_,g.toDisplayString(m),1),g.createElementVNode("span",Y_,g.toDisplayString(v),1)])):g.createCommentVNode("",!0)],64))),128))])],38)):g.createCommentVNode("",!0)}}}),uD="",ge=(n,t)=>{const e=n.__vccOpts||n;for(const[i,r]of t)e[i]=r;return e},qs=ge(W_,[["__scopeId","data-v-c0b7c451"]]),U_="#995c00",B_="40px",z_=["onClick"],H_=["title"],$_={key:0,class:"sub-label"},V_=g.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,e=g.ref(),i=g.ref([]),r=g.ref(!1),a=g.inject("showLegendValues",!0),s=g.inject("legendPosition",g.ref(yt.Right)),o=g.ref([]),l=()=>{const y=e.value;if(!y||!i.value||y.children.length===0)return 0;let b=1,m=y.children[0].getBoundingClientRect().top;for(const v of i.value){const w=v.getBoundingClientRect().top;w!==m&&(b++,m=w)}return b},c=()=>{e.value&&s.value===yt.Bottom&&(l()>1?r.value=!0:r.value=!1)},u=()=>{if(e.value&&s.value===yt.Bottom){let y=0;i.value.forEach(m=>{const v=Array.from(m.children).reduce((w,x)=>w+x.offsetWidth,0);v>y&&(y=v)});const b=parseInt(B_,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${y+b}px)`}},d=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let y=0;y<t.items.length;y++)if(t.items[y].text!==o.value[y].text)return o.value=t.items,!0;return!1};g.watch(()=>t.items,()=>{c(),d()&&u()},{immediate:!0,flush:"post"}),g.watch(()=>s.value,()=>{u()}),g.onMounted(()=>{o.value=t.items,window.addEventListener("resize",c)}),g.onBeforeUnmount(()=>{window.removeEventListener("resize",c)});const h=(y=0,b)=>{if(t.chartInstance===null)return;const m=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart;f(y,b)?m.hide(y,b):m.show(y,b),m.update()},f=(y=0,b)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const m=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart,v=m.getDatasetMeta(y);return v.dataset||b===void 0?m.isDatasetVisible(y):!(v.data.length&&v.data[b].hidden)},p=y=>({[yt.Right]:"vertical",[yt.Bottom]:"horizontal",[yt.Hidden]:"hidden"})[y];return(y,b)=>g.unref(s)!==g.unref(yt).Hidden?(g.openBlock(),g.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:g.normalizeClass(["legend-container",p(g.unref(s))]),"data-testid":"legend"},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(n.items,({fillStyle:m,strokeStyle:v,text:w,datasetIndex:x,index:_,value:D})=>(g.openBlock(),g.createElementBlock("li",{key:w,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:T=>h(x,_)},[g.createElementVNode("div",{class:"legend",style:g.normalizeStyle({background:m,"border-color":v})},null,4),g.createElementVNode("div",{class:g.normalizeClass(["label-container",{"strike-through":!f(x,_)}])},[g.createElementVNode("div",{class:g.normalizeClass(["label",{"truncate-label":r.value}]),title:g.unref(s)===g.unref(yt).Bottom&&w},g.toDisplayString(w),11,H_),D&&g.unref(a)?(g.openBlock(),g.createElementBlock("div",$_,g.toDisplayString(D.formatted),1)):g.createCommentVNode("",!0)],2)],8,z_))),128))],2)):g.createCommentVNode("",!0)}}),dD="",Xs=ge(V_,[["__scopeId","data-v-22ddf722"]]);let gr;const j_=new Uint8Array(16);function q_(){if(!gr&&(gr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!gr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return gr(j_)}const At=[];for(let n=0;n<256;++n)At.push((n+256).toString(16).slice(1));function X_(n,t=0){return At[n[t+0]]+At[n[t+1]]+At[n[t+2]]+At[n[t+3]]+"-"+At[n[t+4]]+At[n[t+5]]+"-"+At[n[t+6]]+At[n[t+7]]+"-"+At[n[t+8]]+At[n[t+9]]+"-"+At[n[t+10]]+At[n[t+11]]+At[n[t+12]]+At[n[t+13]]+At[n[t+14]]+At[n[t+15]]}const vd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Le(n,t,e){if(vd.randomUUID&&!t&&!n)return vd.randomUUID();n=n||{};const i=n.random||(n.rng||q_)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let r=0;r<16;++r)t[e+r]=i[r];return t}return X_(i)}const xd=(n,t)=>{const e=n.ctx,i=n.scales.y,r=n.scales.x,a=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(a.x-a.width/2,a.y,a.width,i.bottom-a.y):e.strokeRect(r.left,a.y-a.height/2,a.x-r.left,a.height),e.restore()},wd={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&xd(n,this.clickedElements)},afterEvent:function(n,{event:t}){var r;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((r=n.options.interaction)==null?void 0:r.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,xd(n,this.clickedElements),this.previousHoverOption=n.options.hover,n.options.hover={mode:null}):(delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1)},beforeDestroy(n){delete this.clickedElements,n.options.hover=this.previousHoverOption||n.options.hover,this.clicked=!1}},_d=6,G_=20,K_="100%",Gs=30,Z_=40,Q_=0,J_=10,t1=10,e1=1,n1=g.defineComponent({__name:"StackedBarChart",props:{chartData:{type:Object,required:!1,default:()=>({labels:[],datasets:[]})},tooltipTitle:{type:String,required:!1,default:""},legendValues:{type:Object,required:!1,default:null},metricUnit:{type:String,required:!1,default:""},orientation:{type:String,required:!1,default:"horizontal",validator:n=>["horizontal","vertical"].includes(n)},annotations:{type:Boolean,required:!1,default:!0},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},stacked:{type:Boolean,required:!1,default:!0},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px|%)/.test(n)}},emits:["heightUpdate"],setup(n,{emit:t}){const e=n,{i18n:i}=Dt.useI18n(),r=({chart:C},I)=>{var V;const F=C.data,$=(V=F.labels)==null?void 0:V.indexOf(I);return F.datasets.reduce((j,pt,ft)=>{if(C.isDatasetVisible(ft)){const it=pt.data[$];return isNaN(it)?j:j+it}else return j},0)},a=(C,I,F,$)=>{const V=$==="horizontal";I===null&&(I=i.t("entityNoName"));const j={type:"label",yValue:it=>V?I:r(it,I),xValue:it=>V?r(it,I):I},pt={...j,position:V?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>V?0:-Math.abs(sx()),content:it=>ms(r(it,I),F)},ft={...j,content:it=>vu(r(it,I),yu(it.chart,C)),position:V?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:it=>V?bu(ms(r(it,I),F)):0,color:mu};return{[`${I}-value`]:pt,[`${I}-percent`]:ft}},s=g.ref(),o=g.ref(),l=g.ref(Le()),c=Le(),u=Le(),d=g.ref([]),h=g.ref(g.inject("legendPosition",yt.Right)),f=g.ref({show:!1,top:"0px",left:"0px",text:"",offset:0}),p=g.toRef(e,"metricUnit"),y=g.computed(()=>p.value&&i.t(`chartUnits.${p.value}`)),b=g.computed(()=>g.toRef(e,"orientation").value==="horizontal"),m=g.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:y,offset:0,width:0,height:0,locked:!1,chartType:b.value?Et.HORIZONTAL_BAR:Et.VERTICAL_BAR}),v=g.ref(0),w=()=>{var C;return e.annotations&&((C=e.chartData.labels)==null?void 0:C.reduce((I,F)=>Object.assign(I,a(e.chartData,F,p.value,e.orientation)),{}))},x={id:l.value,afterUpdate(C){v.value+=1,d.value=C.options.plugins.legend.labels.generateLabels(C).map(I=>({...I,value:e.legendValues&&e.legendValues[I.text]})).sort((I,F)=>I.value&&F.value&&F.value.raw-I.value.raw)}},_={id:c,afterUpdate(C){C.options.plugins.annotation.annotations=e.annotations?w():{}}},M=[x,{id:"axisHover",afterEvent(C,I){if(f.value.show=!1,I.event.type==="mousemove"){const F=I.event,$=C.options.indexAxis,V=C.scales,j=C.scales[$].getLabelForValue(Number(C.scales[$].getValueForPixel(F[$])));if((ft=>ft==="x"?F.y>V.x.top:F.x<V.y.right)($))if(m.locked||(m.showTooltip=!1),j.length>gs){const it=C.canvas.getContext("2d").measureText(j).width,lt=Math.abs(Math.round(F.x-it*.5)),et=Math.round(F.x+it*.5);f.value.left=$==="x"?`${(lt>0?lt:et)-f.value.offset}px`:`${F.x-it*.5-f.value.offset}px`,f.value.top=`${F.y-50}px`,f.value.show=!0,f.value.text=j}else f.value.show=!1;else f.value.show=!1}}},{id:u,afterUpdate(C){C.options.layout.padding.right=b.value?X.value:0}},wd,...e.annotations?[_]:[]],S=g.computed(()=>e.chartData.labels&&e.chartData.labels.length||0),P=g.computed(()=>{var I,F;let C=K_;if(s.value&&(C=s.value.width,s.value&&((I=e.chartData)!=null&&I.labels)&&((F=e.chartData)==null?void 0:F.labels.length)>Gs&&!b.value)){const $=e.chartData.labels.length;C=`${s.value.offsetWidth+($-Gs)*Z_}px`}return C});g.watch(()=>{var C;return(C=e.chartData.labels)==null?void 0:C.length},C=>{let I=parseInt(e.height,10);if(C&&b.value){const F=C*G_;I=Math.max(F,I)}t("heightUpdate",I)}),Dt.useReportChartDataForSynthetics(g.toRef(e,"chartData"),g.toRef(e,"syntheticsDataKey")),g.onMounted(()=>{e.annotations&&Xt.register(yd)});const L=g.computed(()=>{const C=Dt.useBarChartOptions({tooltipState:m,legendID:l.value,stacked:g.toRef(e,"stacked"),metricAxesTitle:g.toRef(e,"metricAxesTitle"),dimensionAxesTitle:g.toRef(e,"dimensionAxesTitle"),indexAxis:b.value?"y":"x"});return{...C.value,plugins:{...C.value.plugins,annotation:{annotations:w(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*_d}}}}),E=Dt.useChartJSCommon("bar",s,g.toRef(e,"chartData"),M,L),X=g.computed(()=>{v.value;const C=e.chartData.labels,I=e.chartData.datasets,F=C.map((j,pt)=>I.reduce((ft,it)=>isNaN(Number(it.data[pt]))?ft:ft+Number(it.data[pt]),0)),$=E.value?yu(E.value,e.chartData):ox(e.chartData);return F.map(j=>bu(ms(j,p.value)+vu(j,$))).reduce((j,pt)=>Math.max(j,pt),0)+_d});g.onBeforeUnmount(()=>{Xt.unregister(yd)});const wt={[yt.Right]:"legend-row",[yt.Bottom]:"column"},N=g.computed(()=>{if(o.value&&E.value){const C=window.devicePixelRatio,I=E.value,F=I.scales.y.width*C+e1,$=(I.scales.y.height+I.scales.y.top+I.scales.x.height)*C,V=o.value.getContext("2d");return V.scale(C,C),V.canvas.width=F,V.canvas.height=$,V.canvas.style.width=`${F/C}px`,V.canvas.style.height=`${$/C}px`,{scale:C,width:F*C,height:$*C,targetCtx:V}}return null}),B=C=>{if(N.value&&E.value){const I=N.value.scale,F=N.value.targetCtx,$=N.value.width,V=N.value.height,j=E.value,pt=j.canvas,ft=C.target;F.fillStyle="white",ft.scrollLeft>=Q_&&ft.scrollLeft<=J_?(F.globalCompositeOperation="source-over",F.clearRect(0,0,$,V),F.drawImage(pt,0,0,$,V,0,0,$,V),F.globalCompositeOperation="destination-over",F.fillRect(0,0,$,V)):(F.globalCompositeOperation="source-over",F.fillRect(0,(j.scales.y.height+j.scales.y.top+t1)*I,$,j.scales.x.height*I)),m.offset=ft.scrollLeft,f.value.offset=ft.scrollLeft}},Z=({width:C,height:I})=>{m.width=C,m.height=I};g.watch(()=>e.orientation,()=>{var C;if(o.value&&N.value){const I=N.value.width,F=N.value.height;((C=o.value)==null?void 0:C.getContext("2d")).clearRect(0,0,I,F)}m.showTooltip=!1,m.locked=!1}),g.watch(()=>e.annotations,C=>{E.value&&(C?E.value.options.plugins.annotation.annotations=w(e.chartData):delete E.value.options.plugins.annotation.annotations)});const Ct=()=>{m.showTooltip&&(m.locked=!m.locked)};return(C,I)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["chart-parent",wt[h.value]])},[g.createElementVNode("canvas",{ref_key:"axis",ref:o,class:"axis"},null,512),g.createElementVNode("div",{class:"chart-container",style:g.normalizeStyle({"overflow-x":S.value>Gs?"auto":"hidden"}),"on:scroll":B,onClick:I[0]||(I[0]=F=>Ct())},[g.createElementVNode("div",{class:"chart-body",style:g.normalizeStyle({width:P.value})},[g.createElementVNode("canvas",{ref_key:"canvas",ref:s},null,512)],4)],36),f.value.show?(g.openBlock(),g.createElementBlock("div",{key:0,class:"axis-tooltip",style:g.normalizeStyle({top:f.value.top,left:f.value.left})},g.toDisplayString(f.value.text),5)):g.createCommentVNode("",!0),g.createVNode(qs,{context:m.tooltipContext,left:m.left,locked:m.locked,series:m.tooltipSeries,"show-tooltip":m.showTooltip,"tooltip-title":n.tooltipTitle,top:m.top,onDimensions:Z},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),g.createVNode(Xs,{id:l.value,"chart-instance":g.unref(E),items:d.value},null,8,["id","chart-instance","items"])],2))}}),fD="",i1=ge(n1,[["__scopeId","data-v-2d7e4a73"]]);/*!
25
25
  * chartjs-adapter-date-fns v3.0.0
26
26
  * https://www.chartjs.org
27
27
  * (c) 2022 chartjs-adapter-date-fns Contributors
28
28
  * Released under the MIT license
29
- */const r1={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"};ol._date.override({_id:"date-fns",formats:function(){return r1},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=Y(n):e==="string"&&(typeof t=="string"?n=vy(n,t,new Date,this.options):n=qc(n,this.options)),fa(n)?n.getTime():null},format:function(n,t){return xb(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Xn(n,t);case"second":return qm(n,t);case"minute":return Vm(n,t);case"hour":return Um(n,t);case"day":return xc(n,t);case"week":return Xm(n,t);case"month":return da(n,t);case"quarter":return jm(n,t);case"year":return Gm(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ki(n,t);case"second":return s0(n,t);case"minute":return i0(n,t);case"hour":return n0(n,t);case"day":return Dc(n,t);case"week":return o0(n,t);case"month":return kc(n,t);case"quarter":return a0(n,t);case"year":return l0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return _y(n);case"minute":return c0(n);case"hour":return wy(n);case"day":return ha(n);case"week":return wc(n);case"isoWeek":return wc(n,{weekStartsOn:+e});case"month":return d0(n);case"quarter":return u0(n);case"year":return f0(n);default:return n}},endOf:function(n,t){switch(t){case"second":return y0(n);case"minute":return m0(n);case"hour":return g0(n);case"day":return Mc(n);case"week":return p0(n);case"month":return Sc(n);case"quarter":return b0(n);case"year":return h0(n);default:return n}}});const Dd={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},a1={type:{type:String,required:!0},...Dd},s1=g.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function yn(n){return g.isProxy(n)?g.toRaw(n):n}function o1(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return g.isProxy(t)?new Proxy(n,{}):n}function l1(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Td(n,t){n.labels=t}function Md(n,t,e){const i=[];n.datasets=t.map(r=>{const a=n.datasets.find(s=>s[e]===r[e]);return!a||!r.data||i.includes(a)?{...r}:(i.push(a),Object.assign(a,r),a)})}function c1(n,t){const e={labels:[],datasets:[]};return Td(e,n.labels),Md(e,n.datasets,t),e}const u1=g.defineComponent({props:a1,setup(n,t){let{expose:e}=t;const i=g.ref(null),r=g.shallowRef(null);e({chart:r});const a=()=>{if(!i.value)return;const{type:l,data:c,options:u,plugins:d,datasetIdKey:h}=n,f=c1(c,h),p=o1(f,c);r.value=new Xt(i.value,{type:l,data:p,options:{...u},plugins:d})},s=()=>{const l=g.toRaw(r.value);l&&(l.destroy(),r.value=null)},o=l=>{l.update(n.updateMode)};return g.onMounted(a),g.onBeforeUnmount(s),g.watch([()=>n.options,()=>n.data],(l,c)=>{let[u,d]=l,[h,f]=c;const p=g.toRaw(r.value);if(!p)return;let y=!1;if(u){const b=yn(u),m=yn(h);b&&b!==m&&(l1(p,b),y=!0)}if(d){const b=yn(d.labels),m=yn(f.labels),v=yn(d.datasets),x=yn(f.datasets);b!==m&&(Td(p.config.data,b),y=!0),v&&v!==x&&(Md(p.config.data,v,n.datasetIdKey),y=!0)}y&&o(p)},{deep:!0}),()=>g.h("canvas",{ref:i})}});function Ks(n,t){return Xt.register(t),g.defineComponent({props:Dd,setup(e,i){let{expose:r}=i;const a=g.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return r({chart:a}),()=>g.h(u1,s1({ref:s},{type:n,...e}))}})}const d1=Ks("bar",Rn),Sd=Ks("doughnut",Me),h1=Ks("line",Ln),f1={class:"chart-container"},g1=g.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:vt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Kt}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(Le()),r=g.ref(Le()),a=g.ref([]),s=g.computed(()=>t.metricUnit&&e.t(`chartUnits.${t.metricUnit}`)),o=g.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:s,offset:0,width:0,height:0,chartType:Et.DOUGHNUT}),l={id:i.value,afterUpdate(y){a.value=y.options.plugins.legend.labels.generateLabels(y).map(b=>({...b,value:t.legendValues&&t.legendValues[b.text],hidden:!1}))}},c=g.computed(()=>[t.chartData.datasets.reduce((b,m)=>(b.labels.push(m.label),b.backgroundColor.push(m.backgroundColor),b.borderColor.push(ri(m.backgroundColor,50)),b.data.push(m.data.reduce((v,x)=>v+x,0)),b),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=g.computed(()=>({...t.chartData,datasets:c.value}));Dt.useReportChartDataForSynthetics(g.toRef(t,"chartData"),g.toRef(t,"syntheticsDataKey"));const{options:d}=Dt.useDoughnutChartOptions({tooltipState:o,legendID:i.value}),h=g.ref(),f=y=>({[vt.Right]:"legend-row",[vt.Bottom]:"column",[vt.Hidden]:"hidden"})[y],p=({width:y,height:b})=>{o.width=y,o.height=b};return(y,b)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["chart-parent",f(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[g.createElementVNode("div",f1,[g.createVNode(g.unref(Sd),{ref_key:"chartInstance",ref:h,"chart-id":r.value,data:u.value,options:g.unref(d),plugins:[l]},null,8,["chart-id","data","options","plugins"]),g.createVNode(qs,{left:o.left,series:o.tooltipSeries,"show-tooltip":o.showTooltip,"tooltip-title":n.tooltipTitle,top:o.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),g.createVNode(Xs,{id:i.value,"chart-instance":h.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),gD="",p1=ge(g1,[["__scopeId","data-v-89d6e4ca"]]),kd=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},Zs={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;kd(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;kd(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},m1=g.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:Et.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},timeRangeSec:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Kt}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(),r=g.ref(Le()),a=g.ref(Le()),s=g.ref([]),o=g.ref(),l=g.ref(g.inject("legendPosition",vt.Right)),c=g.computed(()=>t.metricUnit&&e.t(`chartUnits.${t.metricUnit}`)),u=g.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:c,offset:0,width:0,height:0,chartType:t.type,locked:!1}),d={id:r.value,afterUpdate(x){s.value=x.options.plugins.legend.labels.generateLabels(x).map(w=>({...w,value:t.legendValues&&t.legendValues[w.text]})).sort((w,_)=>w.value&&_.value&&_.value.raw-w.value.raw)}},h=g.computed(()=>[d,wd,...t.type===Et.TIMESERIES_LINE?[Zs]:[]]),{options:f}=Dt.useLinechartOptions({tooltipState:u,timeRangeMs:g.toRef(t,"timeRangeMs"),timeRangeSec:g.toRef(t,"timeRangeSec"),granularity:g.toRef(t,"granularity"),legendID:r.value,stacked:g.toRef(t,"stacked"),metricAxesTitle:g.toRef(t,"metricAxesTitle"),dimensionAxesTitle:g.toRef(t,"dimensionAxesTitle")}),p=g.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((x,w)=>(Array.isArray(t.datasetColors)?(x.backgroundColor=t.datasetColors[w%t.datasetColors.length],x.borderColor=ri(x.backgroundColor,50)):x.rawDimension in t.datasetColors&&(x.backgroundColor=t.datasetColors[x.rawDimension],x.borderColor=ri(x.backgroundColor,50)),x.fill=t.fill,x))}));Dt.useReportChartDataForSynthetics(g.toRef(t,"chartData"),g.toRef(t,"syntheticsDataKey"));const y=x=>rx(x,{short:[z.DAILY,z.WEEKLY].includes(t.granularity)}),b=x=>({[vt.Right]:"legend-row",[vt.Bottom]:"column",[vt.Hidden]:"hidden"})[x],m=({width:x,height:w})=>{u.width=x,u.height=w},v=()=>{var x,w,_;u.locked=!u.locked,i.value&&((w=(x=i.value.chart.tooltip)==null?void 0:x.dataPoints)!=null&&w.length)&&(Zs.clickedSegment=u.locked?(_=i.value.chart.tooltip)==null?void 0:_.dataPoints[0]:void 0)};return g.watch(()=>t.type,()=>{u.locked=!1,u.showTooltip=!1,delete Zs.clickedSegment}),(x,w)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["chart-parent",b(l.value)]),"data-testid":"line-chart-parent"},[g.createElementVNode("div",{class:"chart-container",onClick:w[0]||(w[0]=_=>v())},[n.type===g.unref(Et).TIMESERIES_LINE?(g.openBlock(),g.createBlock(g.unref(h1),{key:0,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:p.value,"data-testid":"time-series-line-chart",options:g.unref(f),plugins:h.value},null,8,["chart-id","data","options","plugins"])):n.type===g.unref(Et).TIMESERIES_BAR?(g.openBlock(),g.createBlock(g.unref(d1),{key:1,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:p.value,"data-testid":"time-series-bar-chart",options:g.unref(f),plugins:h.value},null,8,["chart-id","data","options","plugins"])):g.createCommentVNode("",!0)]),g.createVNode(qs,{ref_key:"tooltipElement",ref:o,context:y(u.tooltipContext),"data-testid":"tooltip",left:u.left,locked:u.locked,series:u.tooltipSeries,"show-tooltip":u.showTooltip,"tooltip-title":n.tooltipTitle,top:u.top,unit:n.metricUnit,onDimensions:m,onLeft:w[1]||(w[1]=_=>u.left=_),onTop:w[2]||(w[2]=_=>u.top=_)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),g.createVNode(Xs,{id:r.value,"chart-instance":i.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),pD="",b1=ge(m1,[["__scopeId","data-v-19da6e6a"]]),y1={class:"analytics-chart-shell"},v1={class:"chart-header"},x1={key:0,class:"chart-title"},w1={id:"result-truncated"},_1={class:"limit-icon-wrapper"},D1=g.defineComponent({__name:"AnalyticsChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!0},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!0},legendPosition:{type:String,required:!1,default:vt.Right},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(t.height),r=M=>{i.value=`${M}px`},a=g.computed(()=>y.value?Dt.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Kt},g.toRef(t,"chartData")).value:Dt.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Kt},g.toRef(t,"chartData")).value),s=g.computed(()=>{var M;return(M=t.chartData)!=null&&M.meta?"start"in t.chartData.meta?t.chartData.meta.end-t.chartData.meta.start:void 0:0}),o=g.computed(()=>{var M;return(M=t.chartData)!=null&&M.meta?"startMs"in t.chartData.meta?t.chartData.meta.endMs-t.chartData.meta.startMs:void 0:0}),l=g.computed(()=>{var M;return(M=t.chartData.meta)!=null&&M.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),c=g.computed(()=>t.showLegendValues&&t.legendPosition!==vt.Bottom),{legendValues:u}=Dt.useChartLegendValues(a,t.chartOptions.type,l),d=g.computed(()=>{var M,O,A;return((A=(O=(M=t.chartData)==null?void 0:M.meta)==null?void 0:O.limit)==null?void 0:A.toString())||null}),h=g.computed(()=>{var M,O;return((O=(M=t.chartData)==null?void 0:M.meta)==null?void 0:O.truncated)||!1}),f=e.t("limitedResultsShown",{maxReturned:d.value}),p=g.computed(()=>[Et.VERTICAL_BAR.toString(),Et.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),y=g.computed(()=>[Et.TIMESERIES_BAR,Et.TIMESERIES_LINE].some(M=>M===t.chartOptions.type)),b=g.computed(()=>t.chartOptions.type===Et.DOUGHNUT),m=g.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),v=g.computed(()=>{var A,R,H;if(!((A=t.chartData)!=null&&A.meta.metricNames)||!((R=t.chartData)!=null&&R.meta.metricUnits))return;const M=t.chartData.meta.metricNames[0],O=t.chartData.meta.metricUnits[M];return((H=t.chartOptions)==null?void 0:H.metricAxesTitle)||e.te(`metricAxisTitles.${M}`)&&e.te(`chartUnits.${O}`)&&e.t(`metricAxisTitles.${M}`,{unit:e.t(`chartUnits.${O}`)})||void 0}),x=g.computed(()=>{const M=y.value?"Time":Object.keys(t.chartData.meta.dimensions||t.chartData.meta.metricNames)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${M}`)&&e.t(`chartLabels.${M}`)||void 0}),w=g.computed(()=>{if(t.chartData.meta.granularity&&typeof t.chartData.meta.granularity!="number"&&"duration"in t.chartData.meta.granularity){const M=ai(t.chartData.meta.granularity.duration);return e.t(`granularityAxisTitles.${M}`)}else if(t.chartData.meta.granularity&&!isNaN(Number(t.chartData.meta.granularity))){const M=ai(Number(t.chartData.meta.granularity));return e.t(`granularityAxisTitles.${M}`)}return e.t("chartlabels.Time")}),_=g.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),D=g.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),T=g.computed(()=>y.value?$y(a.value):t.chartData&&t.chartData.meta&&t.chartData.records.length),S=g.computed(()=>t.chartData.meta.granularity?typeof t.chartData.meta.granularity=="number"?ai(t.chartData.meta.granularity)||z.HOURLY:ai(t.chartData.meta.granularity.duration)||z.HOURLY:ai(new Date(t.chartData.records[1].timestamp).getTime()-new Date(t.chartData.records[0].timestamp).getTime())||z.HOURLY);return g.provide("showLegendValues",c),g.provide("legendPosition",g.toRef(t,"legendPosition")),(M,O)=>{const A=g.resolveComponent("KIcon"),R=g.resolveComponent("KTooltip"),H=g.resolveComponent("KEmptyState");return g.openBlock(),g.createElementBlock("div",y1,[g.createElementVNode("div",v1,[n.chartTitle?(g.openBlock(),g.createElementBlock("div",x1,g.toDisplayString(n.chartTitle),1)):g.createCommentVNode("",!0),g.createElementVNode("div",w1,[T.value&&h.value&&d.value?(g.openBlock(),g.createBlock(R,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(f)),1)]),default:g.withCtx(()=>[g.createElementVNode("div",_1,[g.createVNode(A,{class:"warning-icon",color:"currentColor","hide-title":"",icon:"warning","secondary-color":g.unref(U_),size:"18"},null,8,["secondary-color"])])]),_:1})):g.createCommentVNode("",!0)])]),T.value?(g.openBlock(),g.createElementBlock("div",{key:1,class:"analytics-chart-parent",style:g.normalizeStyle({height:i.value,width:n.width})},[y.value?(g.openBlock(),g.createBlock(b1,{key:0,"chart-data":a.value,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":w.value,fill:n.chartOptions.fill,granularity:S.value,"legend-values":g.unref(u),"metric-axes-title":v.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":o.value,"time-range-sec":s.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","time-range-sec","tooltip-title","type"])):p.value?(g.openBlock(),g.createBlock(i1,{key:1,annotations:n.showAnnotations,"chart-data":a.value,"data-testid":"bar-chart-container","dimension-axes-title":x.value,"legend-values":g.unref(u),"metric-axes-title":v.value,"metric-unit":l.value,orientation:m.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle,onHeightUpdate:r},null,8,["annotations","chart-data","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","synthetics-data-key","tooltip-title"])):b.value?(g.openBlock(),g.createBlock(p1,{key:2,"chart-data":a.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":g.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):g.createCommentVNode("",!0)],4)):(g.openBlock(),g.createBlock(H,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(_.value),1)]),message:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(D.value),1)]),_:1}))])}}}),mD="",T1=ge(D1,[["__scopeId","data-v-0920ebb1"]]),M1={class:"chart-parent","data-testid":"doughnut-chart-parent"},S1={class:"chart-totals-flex"},k1={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},C1=g.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:ln.Hidden},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Kt},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(Le()),r=g.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((b,m)=>b+m,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=g.computed(()=>({...t.chartData,datasets:r.value}));Dt.useReportChartDataForSynthetics(g.toRef(t,"chartData"),g.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=g.ref(),l=g.computed(()=>{var f;return un((f=r==null?void 0:r.value[0])==null?void 0:f.data[0],{capital:!0})}),c=g.computed(()=>{var f,p;return un(((f=r==null?void 0:r.value[0])==null?void 0:f.data[0])+((p=r==null?void 0:r.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=g.computed(()=>{var f;return`color: ${(f=r==null?void 0:r.value[0])==null?void 0:f.backgroundColor[0]}`}),d=g.computed(()=>[ln.Full,ln.SingleMetric].includes(t.metricDisplay)),h=g.computed(()=>t.metricDisplay===ln.Full);return(f,p)=>(g.openBlock(),g.createElementBlock("div",M1,[g.createElementVNode("div",S1,[d.value?(g.openBlock(),g.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:g.normalizeStyle(u.value)},g.toDisplayString(l.value),5)):g.createCommentVNode("",!0),h.value?(g.openBlock(),g.createElementBlock("div",k1,g.toDisplayString(g.unref(e).t("total"))+": "+g.toDisplayString(c.value),1)):g.createCommentVNode("",!0)]),g.createElementVNode("div",{class:"chart-container",style:g.normalizeStyle({height:n.height,width:n.width})},[g.createVNode(g.unref(Sd),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),bD="",P1=ge(C1,[["__scopeId","data-v-4398af32"]]),O1={class:"simple-chart-shell"},E1={key:1,class:"analytics-chart-parent"},A1=g.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.computed(()=>Dt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Kt},g.toRef(t,"chartData")).value),r=g.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),a=g.computed(()=>t.chartOptions.type===er.GAUGE),s=g.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=g.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.records.length);return(l,c)=>{const u=g.resolveComponent("KEmptyState");return g.openBlock(),g.createElementBlock("div",O1,[o.value?(g.openBlock(),g.createElementBlock("div",E1,[a.value?(g.openBlock(),g.createBlock(P1,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","synthetics-data-key","width"])):g.createCommentVNode("",!0)])):(g.openBlock(),g.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(s.value),1)]),_:1}))])}}}),yD="",R1=ge(A1,[["__scopeId","data-v-6808e51e"]]),L1={class:"top-n-card-title","data-testid":"top-n-card-title"},I1={class:"top-n-card-description","data-testid":"top-n-card-description"},N1={key:3,class:"top-n-table","data-testid":"top-n-table"},F1={class:"table-headings"},Y1={class:"table-row"},W1={class:"column-1"},U1={class:"column-2"},B1={class:"table-body","data-testid":"top-n-data"},z1=["data-testid"],H1={class:"column-1"},$1={class:"column-2"},V1=g.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.computed(()=>t.data.records),r=g.computed(()=>{var f;return!!((f=i.value)!=null&&f.length)}),a=g.computed(()=>{var f,p;return(f=t.data.meta)!=null&&f.display&&((p=Object.keys(t.data.meta.display))==null?void 0:p[0])||""}),s=g.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=g.computed(()=>{var f,p;return(p=(f=t.data.meta)==null?void 0:f.metricNames)!=null&&p.length?t.data.meta.metricNames[0]:""}),l=g.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=g.computed(()=>{if(!r.value)return"";if(t.data.meta)if(Object.keys(s.value).length){if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.display");else return e.t("topNTable.errors.meta");return""}),u=f=>{const p=f.event;return String(p[a.value])},d=f=>{const p=u(f);return String(s.value[p])||"–"},h=f=>{if(!o.value)return"–";const y=f.event[o.value];return y?un(y,{capital:!0,round:!0}):"–"};return(f,p)=>{const y=g.resolveComponent("KEmptyState"),b=g.resolveComponent("KSkeleton"),m=g.resolveComponent("KCard");return g.openBlock(),g.createBlock(m,{class:"kong-ui-public-top-n-table"},g.createSlots({body:g.withCtx(()=>[c.value?(g.openBlock(),g.createBlock(y,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(c.value),1)]),_:1})):n.isLoading?(g.openBlock(),g.createBlock(b,{key:1,"table-columns":2,type:"table"})):r.value?(g.openBlock(),g.createElementBlock("div",N1,[g.createElementVNode("div",F1,[g.createElementVNode("div",Y1,[g.createElementVNode("div",W1,g.toDisplayString(g.unref(e).t("topNTable.nameLabel")),1),g.createElementVNode("div",U1,g.toDisplayString(l.value),1)])]),g.createElementVNode("div",B1,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.value,(v,x)=>(g.openBlock(),g.createElementBlock("div",{key:`entry-${x}`,class:"table-row","data-testid":`row-${u(v)}`},[g.createElementVNode("div",H1,[g.renderSlot(f.$slots,"name",{record:{id:u(v),name:d(v),dimension:a.value}},()=>[g.createTextVNode(g.toDisplayString(d(v)),1)],!0)]),g.createElementVNode("div",$1,"   "+g.toDisplayString(h(v)),1)],8,z1))),128))])])):(g.openBlock(),g.createBlock(y,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(n.emptyStateTitle||g.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:g.withCtx(()=>[g.createElementVNode("div",L1,g.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:g.withCtx(()=>[g.createElementVNode("div",I1,g.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),vD="",xD="",j1=ge(V1,[["__scopeId","data-v-bfd2d69d"]]),Qs="#e0e4ea",q1={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},di=(n,t)=>{let e=1;const i=q1[n],r=new Map;for(const a of t)r.set(a,i[e]),e=e%(i.length-1)+1;return r.set(-1,i[0]),r},Cd=new Map([[100,di("100",[100,101,102,103])],[200,di("200",[200,201,202,203,204,205,206,207,208,226])],[300,di("300",[300,301,302,303,304,305,307,308])],[400,di("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,di("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Pd=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=Cd.get(e);return i===void 0?Qs:i.get(t)??i.get(-1)??Qs},X1=n=>{const t=Pd(n);return{solid:t,light:t}};ot.AnalyticsChart=T1,ot.ChartLegendPosition=vt,ot.ChartMetricDisplay=ln,ot.ChartTypes=Et,ot.ChartTypesSimple=er,ot.SimpleChart=R1,ot.TopNTable=j1,ot.accessibleGrey=mu,ot.codesInSpec=Cd,ot.darkenColor=ri,ot.datavisPalette=Kt,ot.lightGrey=Qs,ot.lookupDatavisColor=ii,ot.lookupStatusCodeCategoryColor=X1,ot.lookupStatusCodeColor=Pd,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
29
+ */const r1={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"};ol._date.override({_id:"date-fns",formats:function(){return r1},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=Y(n):e==="string"&&(typeof t=="string"?n=vy(n,t,new Date,this.options):n=qc(n,this.options)),fa(n)?n.getTime():null},format:function(n,t){return xb(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Gn(n,t);case"second":return qm(n,t);case"minute":return Vm(n,t);case"hour":return Um(n,t);case"day":return xc(n,t);case"week":return Xm(n,t);case"month":return da(n,t);case"quarter":return jm(n,t);case"year":return Gm(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ki(n,t);case"second":return s0(n,t);case"minute":return i0(n,t);case"hour":return n0(n,t);case"day":return Dc(n,t);case"week":return o0(n,t);case"month":return kc(n,t);case"quarter":return a0(n,t);case"year":return l0(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return _y(n);case"minute":return c0(n);case"hour":return wy(n);case"day":return ha(n);case"week":return wc(n);case"isoWeek":return wc(n,{weekStartsOn:+e});case"month":return d0(n);case"quarter":return u0(n);case"year":return f0(n);default:return n}},endOf:function(n,t){switch(t){case"second":return y0(n);case"minute":return m0(n);case"hour":return g0(n);case"day":return Mc(n);case"week":return p0(n);case"month":return Sc(n);case"quarter":return b0(n);case"year":return h0(n);default:return n}}});const Dd={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},a1={type:{type:String,required:!0},...Dd},s1=g.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function vn(n){return g.isProxy(n)?g.toRaw(n):n}function o1(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return g.isProxy(t)?new Proxy(n,{}):n}function l1(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Td(n,t){n.labels=t}function Md(n,t,e){const i=[];n.datasets=t.map(r=>{const a=n.datasets.find(s=>s[e]===r[e]);return!a||!r.data||i.includes(a)?{...r}:(i.push(a),Object.assign(a,r),a)})}function c1(n,t){const e={labels:[],datasets:[]};return Td(e,n.labels),Md(e,n.datasets,t),e}const u1=g.defineComponent({props:a1,setup(n,t){let{expose:e}=t;const i=g.ref(null),r=g.shallowRef(null);e({chart:r});const a=()=>{if(!i.value)return;const{type:l,data:c,options:u,plugins:d,datasetIdKey:h}=n,f=c1(c,h),p=o1(f,c);r.value=new Xt(i.value,{type:l,data:p,options:{...u},plugins:d})},s=()=>{const l=g.toRaw(r.value);l&&(l.destroy(),r.value=null)},o=l=>{l.update(n.updateMode)};return g.onMounted(a),g.onBeforeUnmount(s),g.watch([()=>n.options,()=>n.data],(l,c)=>{let[u,d]=l,[h,f]=c;const p=g.toRaw(r.value);if(!p)return;let y=!1;if(u){const b=vn(u),m=vn(h);b&&b!==m&&(l1(p,b),y=!0)}if(d){const b=vn(d.labels),m=vn(f.labels),v=vn(d.datasets),w=vn(f.datasets);b!==m&&(Td(p.config.data,b),y=!0),v&&v!==w&&(Md(p.config.data,v,n.datasetIdKey),y=!0)}y&&o(p)},{deep:!0}),()=>g.h("canvas",{ref:i})}});function Ks(n,t){return Xt.register(t),g.defineComponent({props:Dd,setup(e,i){let{expose:r}=i;const a=g.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return r({chart:a}),()=>g.h(u1,s1({ref:s},{type:n,...e}))}})}const d1=Ks("bar",Ln),Sd=Ks("doughnut",Me),h1=Ks("line",In),f1={class:"chart-container"},g1=g.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:yt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Gt}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(Le()),r=g.ref(Le()),a=g.ref([]),s=g.computed(()=>t.metricUnit&&e.t(`chartUnits.${t.metricUnit}`)),o=g.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:s,offset:0,width:0,height:0,chartType:Et.DOUGHNUT}),l={id:i.value,afterUpdate(y){a.value=y.options.plugins.legend.labels.generateLabels(y).map(b=>({...b,value:t.legendValues&&t.legendValues[b.text],hidden:!1}))}},c=g.computed(()=>[t.chartData.datasets.reduce((b,m)=>(b.labels.push(m.label),b.backgroundColor.push(m.backgroundColor),b.borderColor.push(ri(m.backgroundColor,50)),b.data.push(m.data.reduce((v,w)=>v+w,0)),b),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=g.computed(()=>({...t.chartData,datasets:c.value}));Dt.useReportChartDataForSynthetics(g.toRef(t,"chartData"),g.toRef(t,"syntheticsDataKey"));const{options:d}=Dt.useDoughnutChartOptions({tooltipState:o,legendID:i.value}),h=g.ref(),f=y=>({[yt.Right]:"legend-row",[yt.Bottom]:"column",[yt.Hidden]:"hidden"})[y],p=({width:y,height:b})=>{o.width=y,o.height=b};return(y,b)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["chart-parent",f(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[g.createElementVNode("div",f1,[g.createVNode(g.unref(Sd),{ref_key:"chartInstance",ref:h,"chart-id":r.value,data:u.value,options:g.unref(d),plugins:[l]},null,8,["chart-id","data","options","plugins"]),g.createVNode(qs,{left:o.left,series:o.tooltipSeries,"show-tooltip":o.showTooltip,"tooltip-title":n.tooltipTitle,top:o.top,unit:n.metricUnit,onDimensions:p},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),g.createVNode(Xs,{id:i.value,"chart-instance":h.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),gD="",p1=ge(g1,[["__scopeId","data-v-89d6e4ca"]]),kd=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},Zs={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;kd(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;kd(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},m1=g.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:Et.TIMESERIES_LINE},fill:{type:Boolean,required:!1,default:!1},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},timeRangeMs:{type:Number,required:!1,default:void 0},timeRangeSec:{type:Number,required:!1,default:void 0},granularity:{type:String,required:!0},stacked:{type:Boolean,required:!1,default:!0},legendValues:{type:Object,required:!1,default:null},metricAxesTitle:{type:String,required:!1,default:null},dimensionAxesTitle:{type:String,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Gt}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(),r=g.ref(Le()),a=g.ref(Le()),s=g.ref([]),o=g.ref(),l=g.ref(g.inject("legendPosition",yt.Right)),c=g.computed(()=>t.metricUnit&&e.t(`chartUnits.${t.metricUnit}`)),u=g.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:c,offset:0,width:0,height:0,chartType:t.type,locked:!1}),d={id:r.value,afterUpdate(w){s.value=w.options.plugins.legend.labels.generateLabels(w).map(x=>({...x,value:t.legendValues&&t.legendValues[x.text]})).sort((x,_)=>x.value&&_.value&&_.value.raw-x.value.raw)}},h=g.computed(()=>[d,wd,...t.type===Et.TIMESERIES_LINE?[Zs]:[]]),{options:f}=Dt.useLinechartOptions({tooltipState:u,timeRangeMs:g.toRef(t,"timeRangeMs"),timeRangeSec:g.toRef(t,"timeRangeSec"),granularity:g.toRef(t,"granularity"),legendID:r.value,stacked:g.toRef(t,"stacked"),metricAxesTitle:g.toRef(t,"metricAxesTitle"),dimensionAxesTitle:g.toRef(t,"dimensionAxesTitle")}),p=g.computed(()=>({...t.chartData,datasets:t.chartData.datasets.map((w,x)=>(Array.isArray(t.datasetColors)?(w.backgroundColor=t.datasetColors[x%t.datasetColors.length],w.borderColor=ri(w.backgroundColor,50)):w.rawDimension in t.datasetColors&&(w.backgroundColor=t.datasetColors[w.rawDimension],w.borderColor=ri(w.backgroundColor,50)),w.fill=t.fill,w))}));Dt.useReportChartDataForSynthetics(g.toRef(t,"chartData"),g.toRef(t,"syntheticsDataKey"));const y=w=>rx(w,{short:[z.DAILY,z.WEEKLY].includes(t.granularity)}),b=w=>({[yt.Right]:"legend-row",[yt.Bottom]:"column",[yt.Hidden]:"hidden"})[w],m=({width:w,height:x})=>{u.width=w,u.height=x},v=()=>{var w,x,_;u.locked=!u.locked,i.value&&((x=(w=i.value.chart.tooltip)==null?void 0:w.dataPoints)!=null&&x.length)&&(Zs.clickedSegment=u.locked?(_=i.value.chart.tooltip)==null?void 0:_.dataPoints[0]:void 0)};return g.watch(()=>t.type,()=>{u.locked=!1,u.showTooltip=!1,delete Zs.clickedSegment}),(w,x)=>(g.openBlock(),g.createElementBlock("div",{class:g.normalizeClass(["chart-parent",b(l.value)]),"data-testid":"line-chart-parent"},[g.createElementVNode("div",{class:"chart-container",onClick:x[0]||(x[0]=_=>v())},[n.type===g.unref(Et).TIMESERIES_LINE?(g.openBlock(),g.createBlock(g.unref(h1),{key:0,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:p.value,"data-testid":"time-series-line-chart",options:g.unref(f),plugins:h.value},null,8,["chart-id","data","options","plugins"])):n.type===g.unref(Et).TIMESERIES_BAR?(g.openBlock(),g.createBlock(g.unref(d1),{key:1,ref_key:"chartInstance",ref:i,"chart-id":a.value,data:p.value,"data-testid":"time-series-bar-chart",options:g.unref(f),plugins:h.value},null,8,["chart-id","data","options","plugins"])):g.createCommentVNode("",!0)]),g.createVNode(qs,{ref_key:"tooltipElement",ref:o,context:y(u.tooltipContext),"data-testid":"tooltip",left:u.left,locked:u.locked,series:u.tooltipSeries,"show-tooltip":u.showTooltip,"tooltip-title":n.tooltipTitle,top:u.top,unit:n.metricUnit,onDimensions:m,onLeft:x[1]||(x[1]=_=>u.left=_),onTop:x[2]||(x[2]=_=>u.top=_)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),g.createVNode(Xs,{id:r.value,"chart-instance":i.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),pD="",b1=ge(m1,[["__scopeId","data-v-19da6e6a"]]),y1={class:"analytics-chart-shell"},v1={class:"chart-header"},x1={key:0,class:"chart-title"},w1={id:"result-truncated"},_1={class:"limit-icon-wrapper"},D1=g.defineComponent({__name:"AnalyticsChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!0},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!0},legendPosition:{type:String,required:!1,default:yt.Right},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"500px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(t.height),r=S=>{i.value=`${S}px`},a=g.computed(()=>y.value?Dt.useExploreResultToTimeDataset({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Gt},g.toRef(t,"chartData")).value:Dt.useExploreResultToDatasets({fill:t.chartOptions.fill,colorPalette:t.chartOptions.chartDatasetColors||Gt},g.toRef(t,"chartData")).value),s=g.computed(()=>{var S;return(S=t.chartData)!=null&&S.meta?"start"in t.chartData.meta?t.chartData.meta.end-t.chartData.meta.start:void 0:0}),o=g.computed(()=>{var S;return(S=t.chartData)!=null&&S.meta?"startMs"in t.chartData.meta?t.chartData.meta.endMs-t.chartData.meta.startMs:void 0:0}),l=g.computed(()=>{var S;return(S=t.chartData.meta)!=null&&S.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),c=g.computed(()=>t.showLegendValues&&t.legendPosition!==yt.Bottom),{legendValues:u}=Dt.useChartLegendValues(a,t.chartOptions.type,l),d=g.computed(()=>{var S,P,L;return((L=(P=(S=t.chartData)==null?void 0:S.meta)==null?void 0:P.limit)==null?void 0:L.toString())||null}),h=g.computed(()=>{var S,P;return((P=(S=t.chartData)==null?void 0:S.meta)==null?void 0:P.truncated)||!1}),f=e.t("limitedResultsShown",{maxReturned:d.value}),p=g.computed(()=>[Et.VERTICAL_BAR.toString(),Et.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),y=g.computed(()=>[Et.TIMESERIES_BAR,Et.TIMESERIES_LINE].some(S=>S===t.chartOptions.type)),b=g.computed(()=>t.chartOptions.type===Et.DOUGHNUT),m=g.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),v=g.computed(()=>{var L,E,X;if(!((L=t.chartData)!=null&&L.meta.metricNames)||!((E=t.chartData)!=null&&E.meta.metricUnits))return;const S=t.chartData.meta.metricNames[0],P=t.chartData.meta.metricUnits[S];return((X=t.chartOptions)==null?void 0:X.metricAxesTitle)||e.te(`metricAxisTitles.${S}`)&&e.te(`chartUnits.${P}`)&&e.t(`metricAxisTitles.${S}`,{unit:e.t(`chartUnits.${P}`)})||void 0}),w=g.computed(()=>{const S=y.value?"Time":Object.keys(t.chartData.meta.dimensions||t.chartData.meta.metricNames)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||void 0}),x=g.computed(()=>{if(t.chartData.meta.granularity&&typeof t.chartData.meta.granularity!="number"&&"duration"in t.chartData.meta.granularity){const S=ai(t.chartData.meta.granularity.duration);return e.t(`granularityAxisTitles.${S}`)}else if(t.chartData.meta.granularity&&!isNaN(Number(t.chartData.meta.granularity))){const S=ai(Number(t.chartData.meta.granularity));return e.t(`granularityAxisTitles.${S}`)}return e.t("chartlabels.Time")}),_=g.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),D=g.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),T=g.computed(()=>y.value?$y(a.value):t.chartData&&t.chartData.meta&&t.chartData.records.length),M=g.computed(()=>t.chartData.meta.granularity?typeof t.chartData.meta.granularity=="number"?ai(t.chartData.meta.granularity)||z.HOURLY:ai(t.chartData.meta.granularity.duration)||z.HOURLY:ai(new Date(t.chartData.records[1].timestamp).getTime()-new Date(t.chartData.records[0].timestamp).getTime())||z.HOURLY);return g.provide("showLegendValues",c),g.provide("legendPosition",g.toRef(t,"legendPosition")),(S,P)=>{const L=g.resolveComponent("KIcon"),E=g.resolveComponent("KTooltip"),X=g.resolveComponent("KEmptyState");return g.openBlock(),g.createElementBlock("div",y1,[g.createElementVNode("div",v1,[n.chartTitle?(g.openBlock(),g.createElementBlock("div",x1,g.toDisplayString(n.chartTitle),1)):g.createCommentVNode("",!0),g.createElementVNode("div",w1,[T.value&&h.value&&d.value?(g.openBlock(),g.createBlock(E,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(f)),1)]),default:g.withCtx(()=>[g.createElementVNode("div",_1,[g.createVNode(L,{class:"warning-icon",color:"currentColor","hide-title":"",icon:"warning","secondary-color":g.unref(U_),size:"18"},null,8,["secondary-color"])])]),_:1})):g.createCommentVNode("",!0)])]),T.value?(g.openBlock(),g.createElementBlock("div",{key:1,class:"analytics-chart-parent",style:g.normalizeStyle({height:i.value,width:n.width})},[y.value?(g.openBlock(),g.createBlock(b1,{key:0,"chart-data":a.value,"dataset-colors":n.chartOptions.chartDatasetColors,"dimension-axes-title":x.value,fill:n.chartOptions.fill,granularity:M.value,"legend-values":g.unref(u),"metric-axes-title":v.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":o.value,"time-range-sec":s.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","dataset-colors","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","time-range-sec","tooltip-title","type"])):p.value?(g.openBlock(),g.createBlock(i1,{key:1,annotations:n.showAnnotations,"chart-data":a.value,"data-testid":"bar-chart-container","dimension-axes-title":w.value,"legend-values":g.unref(u),"metric-axes-title":v.value,"metric-unit":l.value,orientation:m.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle,onHeightUpdate:r},null,8,["annotations","chart-data","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):b.value?(g.openBlock(),g.createBlock(p1,{key:2,"chart-data":a.value,"dataset-colors":n.chartOptions.chartDatasetColors,fill:n.chartOptions.fill,"legend-position":n.legendPosition,"legend-values":g.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","fill","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):g.createCommentVNode("",!0)],4)):(g.openBlock(),g.createBlock(X,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"170"},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(_.value),1)]),message:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(D.value),1)]),_:1}))])}}}),mD="",T1=ge(D1,[["__scopeId","data-v-4d9f3a20"]]),M1={class:"chart-parent","data-testid":"doughnut-chart-parent"},S1={class:"chart-totals-flex"},k1={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},C1=g.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:ln.Hidden},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Gt},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.ref(Le()),r=g.computed(()=>[t.chartData.datasets.reduce((p,y)=>(p.labels.push(y.label),p.borderColor.push(y.backgroundColor),p.backgroundColor.push(y.backgroundColor),p.data.push(y.data.reduce((b,m)=>b+m,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=g.computed(()=>({...t.chartData,datasets:r.value}));Dt.useReportChartDataForSynthetics(g.toRef(t,"chartData"),g.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=g.ref(),l=g.computed(()=>{var f;return dn((f=r==null?void 0:r.value[0])==null?void 0:f.data[0],{capital:!0})}),c=g.computed(()=>{var f,p;return dn(((f=r==null?void 0:r.value[0])==null?void 0:f.data[0])+((p=r==null?void 0:r.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=g.computed(()=>{var f;return`color: ${(f=r==null?void 0:r.value[0])==null?void 0:f.backgroundColor[0]}`}),d=g.computed(()=>[ln.Full,ln.SingleMetric].includes(t.metricDisplay)),h=g.computed(()=>t.metricDisplay===ln.Full);return(f,p)=>(g.openBlock(),g.createElementBlock("div",M1,[g.createElementVNode("div",S1,[d.value?(g.openBlock(),g.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:g.normalizeStyle(u.value)},g.toDisplayString(l.value),5)):g.createCommentVNode("",!0),h.value?(g.openBlock(),g.createElementBlock("div",k1,g.toDisplayString(g.unref(e).t("total"))+": "+g.toDisplayString(c.value),1)):g.createCommentVNode("",!0)]),g.createElementVNode("div",{class:"chart-container",style:g.normalizeStyle({height:n.height,width:n.width})},[g.createVNode(g.unref(Sd),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),bD="",O1=ge(C1,[["__scopeId","data-v-4398af32"]]),P1={class:"simple-chart-shell"},E1={key:1,class:"analytics-chart-parent"},A1=g.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.computed(()=>Dt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Gt},g.toRef(t,"chartData")).value),r=g.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metricUnits?Object.values(t.chartData.meta.metricUnits)[0]:""}),a=g.computed(()=>t.chartOptions.type===er.GAUGE),s=g.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=g.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.records.length);return(l,c)=>{const u=g.resolveComponent("KEmptyState");return g.openBlock(),g.createElementBlock("div",P1,[o.value?(g.openBlock(),g.createElementBlock("div",E1,[a.value?(g.openBlock(),g.createBlock(O1,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":r.value,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","synthetics-data-key","width"])):g.createCommentVNode("",!0)])):(g.openBlock(),g.createBlock(u,{key:0,class:"chart-empty-state","cta-is-hidden":!0,"data-testid":"no-data-in-report",icon:"stateNoData","icon-size":"80"},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(s.value),1)]),_:1}))])}}}),yD="",R1=ge(A1,[["__scopeId","data-v-6808e51e"]]),L1={class:"top-n-card-title","data-testid":"top-n-card-title"},I1={class:"top-n-card-description","data-testid":"top-n-card-description"},N1={key:3,class:"top-n-table","data-testid":"top-n-table"},F1={class:"table-headings"},Y1={class:"table-row"},W1={class:"column-1"},U1={class:"column-2"},B1={class:"table-body","data-testid":"top-n-data"},z1=["data-testid"],H1={class:"column-1"},$1={class:"column-2"},V1=g.defineComponent({__name:"TopNTable",props:{title:{type:String,required:!0},description:{type:String,default:""},data:{type:Object,required:!0},emptyStateTitle:{type:String,default:""},isLoading:{type:Boolean,default:!1}},setup(n){const t=n,{i18n:e}=Dt.useI18n(),i=g.computed(()=>t.data.records),r=g.computed(()=>{var f;return!!((f=i.value)!=null&&f.length)}),a=g.computed(()=>{var f,p;return(f=t.data.meta)!=null&&f.display&&((p=Object.keys(t.data.meta.display))==null?void 0:p[0])||""}),s=g.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=g.computed(()=>{var f,p;return(p=(f=t.data.meta)==null?void 0:f.metricNames)!=null&&p.length?t.data.meta.metricNames[0]:""}),l=g.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=g.computed(()=>{if(!r.value)return"";if(t.data.meta)if(Object.keys(s.value).length){if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.display");else return e.t("topNTable.errors.meta");return""}),u=f=>{const p=f.event;return String(p[a.value])},d=f=>{const p=u(f);return String(s.value[p])||"–"},h=f=>{if(!o.value)return"–";const y=f.event[o.value];return y?dn(y,{capital:!0,round:!0}):"–"};return(f,p)=>{const y=g.resolveComponent("KEmptyState"),b=g.resolveComponent("KSkeleton"),m=g.resolveComponent("KCard");return g.openBlock(),g.createBlock(m,{class:"kong-ui-public-top-n-table"},g.createSlots({body:g.withCtx(()=>[c.value?(g.openBlock(),g.createBlock(y,{key:0,"cta-is-hidden":"","data-testid":"top-n-error-state","is-error":""},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(g.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),message:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(c.value),1)]),_:1})):n.isLoading?(g.openBlock(),g.createBlock(b,{key:1,"table-columns":2,type:"table"})):r.value?(g.openBlock(),g.createElementBlock("div",N1,[g.createElementVNode("div",F1,[g.createElementVNode("div",Y1,[g.createElementVNode("div",W1,g.toDisplayString(g.unref(e).t("topNTable.nameLabel")),1),g.createElementVNode("div",U1,g.toDisplayString(l.value),1)])]),g.createElementVNode("div",B1,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(i.value,(v,w)=>(g.openBlock(),g.createElementBlock("div",{key:`entry-${w}`,class:"table-row","data-testid":`row-${u(v)}`},[g.createElementVNode("div",H1,[g.renderSlot(f.$slots,"name",{record:{id:u(v),name:d(v),dimension:a.value}},()=>[g.createTextVNode(g.toDisplayString(d(v)),1)],!0)]),g.createElementVNode("div",$1,"   "+g.toDisplayString(h(v)),1)],8,z1))),128))])])):(g.openBlock(),g.createBlock(y,{key:2,"cta-is-hidden":"","data-testid":"top-n-empty-state",icon:"stateNoData","icon-size":"80"},{title:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(n.emptyStateTitle||g.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:g.withCtx(()=>[g.createElementVNode("div",L1,g.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:g.withCtx(()=>[g.createElementVNode("div",I1,g.toDisplayString(n.description),1)]),key:"1"}:void 0]),1024)}}}),vD="",xD="",j1=ge(V1,[["__scopeId","data-v-bfd2d69d"]]),Qs="#e0e4ea",q1={100:["#c8e2fd","#80bfff","#4da6ff","#1a8cff","#0072e5","#0059b2"],200:["#ceedd2","#9edca6","#89d595","#6fcc83","#44c26b","#0bb652","#0ca84a","#169643","#196e33","#1b572a"],300:["#fff4db","#ffe9b8","#ffe2a1","#ffd982","#ffd062","#fdc53b","#f4bb1e","#e8b00b","#d9a30f","#c89407"],400:["#ffead8","#ffd5b1","#ffc899","#ffba81","#ffae6b","#fe9439","#f6871d","#eb7c0c","#da700c","#cc6100"],500:["#ffd5d5","#ffb6b6","#ff9d9d","#ff8484","#ff6a6a","#ff4545","#fb1f1f","#e90b0b","#d40202","#be0202"]},di=(n,t)=>{let e=1;const i=q1[n],r=new Map;for(const a of t)r.set(a,i[e]),e=e%(i.length-1)+1;return r.set(-1,i[0]),r},Cd=new Map([[100,di("100",[100,101,102,103])],[200,di("200",[200,201,202,203,204,205,206,207,208,226])],[300,di("300",[300,301,302,303,304,305,307,308])],[400,di("400",[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451])],[500,di("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Od=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=Cd.get(e);return i===void 0?Qs:i.get(t)??i.get(-1)??Qs},X1=n=>{const t=Od(n);return{solid:t,light:t}};ot.AnalyticsChart=T1,ot.ChartLegendPosition=yt,ot.ChartMetricDisplay=ln,ot.ChartTypes=Et,ot.ChartTypesSimple=er,ot.SimpleChart=R1,ot.TopNTable=j1,ot.accessibleGrey=mu,ot.codesInSpec=Cd,ot.darkenColor=ri,ot.datavisPalette=Gt,ot.lightGrey=Qs,ot.lookupDatavisColor=un,ot.lookupStatusCodeCategoryColor=X1,ot.lookupStatusCodeColor=Od,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});