@kong-ui-public/analytics-chart 4.4.3 → 4.5.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,44 +1,43 @@
1
- (function(at,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons"],h):(at=typeof globalThis<"u"?globalThis:at||self,h(at["kong-ui-publicvitals-chart"]={},at.Vue,at["kong-ui-public-i18n"],at.KongIcons))})(this,function(at,h,Cn,ic){"use strict";var vC=Object.defineProperty;var bC=(at,h,Cn)=>h in at?vC(at,h,{enumerable:!0,configurable:!0,writable:!0,value:Cn}):at[h]=Cn;var H=(at,h,Cn)=>bC(at,typeof h!="symbol"?h+"":h,Cn);var Mn,cp;const Tp={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",debug:"debug",total:"Total",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}"},csvExport:{noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",defaultFilename:"Chart Export",exportPreview:"Export Preview",exportButton:"Export",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC Offset",Timestamp:"Timestamp"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{request_count:"Request Count",requests_per_minute:"Requests per Minute",response_latency_p99:"Response Latency (p99)",response_latency_p95:"Response Latency (p95)",response_latency_p50:"Response Latency (p50)",kong_latency_p99:"Kong Latency (p99)",kong_latency_p95:"Kong Latency (p95)",kong_latency_p50:"Kong Latency (p50)",upstream_latency_p99:"Upstream Latency (p99)",upstream_latency_p95:"Upstream Latency (p95)",upstream_latency_p50:"Upstream Latency (p50)",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",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",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","3XX":"3xx","2XX":"2xx","1XX":"1xx",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",____OTHER____:"Others",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)"},metricAxisTitles:{request_count:"Request Count",requests_per_minute:"Requests per Minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_p99:"Response Latency (p99) in {unit}",response_latency_p95:"Response Latency (p95) in {unit}",response_latency_p50:"Response Latency (p50) in {unit}",upstream_latency_p99:"Upstream Latency (p99) in {unit}",upstream_latency_p95:"Upstream Latency (p95) in {unit}",upstream_latency_p50:"Upstream Latency (p50) in {unit}",kong_latency_p99:"Kong Latency (p99) in {unit}",kong_latency_p95:"Kong Latency (p95) in {unit}",kong_latency_p50:"Kong 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}",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}",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)"},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 Mp(){const n=Cn.createI18n("en-us",Tp);return{i18n:n,i18nT:Cn.i18nTComponent(n)}}/*!
1
+ (function(J,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons"],h):(J=typeof globalThis<"u"?globalThis:J||self,h(J["kong-ui-publicvitals-chart"]={},J.Vue,J["kong-ui-public-i18n"],J.KongIcons))})(this,function(J,h,fn,pa){"use strict";var Cv=Object.defineProperty;var Ov=(J,h,fn)=>h in J?Cv(J,h,{enumerable:!0,configurable:!0,writable:!0,value:fn}):J[h]=fn;var O=(J,h,fn)=>Ov(J,typeof h!="symbol"?h+"":h,fn);var cn,Jd;const fh={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",debug:"debug",total:"Total",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}"},csvExport:{noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",defaultFilename:"Chart Export",exportPreview:"Export Preview",exportButton:"Export",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC Offset",Timestamp:"Timestamp"},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{request_count:"Request Count",requests_per_minute:"Requests per Minute",response_latency_p99:"Response Latency (p99)",response_latency_p95:"Response Latency (p95)",response_latency_p50:"Response Latency (p50)",kong_latency_p99:"Kong Latency (p99)",kong_latency_p95:"Kong Latency (p95)",kong_latency_p50:"Kong Latency (p50)",upstream_latency_p99:"Upstream Latency (p99)",upstream_latency_p95:"Upstream Latency (p95)",upstream_latency_p50:"Upstream Latency (p50)",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",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",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","3XX":"3xx","2XX":"2xx","1XX":"1xx",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",____OTHER____:"Others",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)"},metricAxisTitles:{request_count:"Request Count",requests_per_minute:"Requests per Minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_p99:"Response Latency (p99) in {unit}",response_latency_p95:"Response Latency (p95) in {unit}",response_latency_p50:"Response Latency (p50) in {unit}",upstream_latency_p99:"Upstream Latency (p99) in {unit}",upstream_latency_p95:"Upstream Latency (p95) in {unit}",upstream_latency_p50:"Upstream Latency (p50) in {unit}",kong_latency_p99:"Kong Latency (p99) in {unit}",kong_latency_p95:"Kong Latency (p95) in {unit}",kong_latency_p50:"Kong 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}",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}",ai_request_count:"Request Count",total_tokens:"Total Token Count",prompt_tokens:"Prompt Token Count",completion_tokens:"Completion Token Count",cost:"Costs",llm_cache_embeddings_latency_average:"Embeddings Latency (avg)",llm_cache_fetch_latency_average:"Fetch Latency (avg)",llm_latency_average:"LLM Latency (avg)"},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 gh(){const n=fn.createI18n("en-us",fh);return{i18n:n,i18nT:fn.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 xr(n){return n+.5|0}const sn=(n,t,e)=>Math.max(Math.min(n,e),t);function _r(n){return sn(xr(n*2.55),0,255)}function on(n){return sn(xr(n*255),0,255)}function He(n){return sn(xr(n/2.55)/100,0,1)}function ac(n){return sn(xr(n*100),0,100)}const we={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},Aa=[..."0123456789ABCDEF"],Dp=n=>Aa[n&15],Sp=n=>Aa[(n&240)>>4]+Aa[n&15],pi=n=>(n&240)>>4===(n&15),kp=n=>pi(n.r)&&pi(n.g)&&pi(n.b)&&pi(n.a);function Cp(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&we[n[1]]*17,g:255&we[n[2]]*17,b:255&we[n[3]]*17,a:t===5?we[n[4]]*17:255}:(t===7||t===9)&&(e={r:we[n[1]]<<4|we[n[2]],g:we[n[3]]<<4|we[n[4]],b:we[n[5]]<<4|we[n[6]],a:t===9?we[n[7]]<<4|we[n[8]]:255})),e}const Op=(n,t)=>n<255?t(n):"";function Pp(n){var t=kp(n)?Dp:Sp;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Op(n.a,t):void 0}const Ep=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function sc(n,t,e){const r=t*Math.min(e,1-e),i=(a,s=(a+n/30)%12)=>e-r*Math.max(Math.min(s-3,9-s,1),-1);return[i(0),i(8),i(4)]}function Rp(n,t,e){const r=(i,a=(i+n/60)%6)=>e-e*t*Math.max(Math.min(a,4-a,1),0);return[r(5),r(3),r(1)]}function Ap(n,t,e){const r=sc(n,1,.5);let i;for(t+e>1&&(i=1/(t+e),t*=i,e*=i),i=0;i<3;i++)r[i]*=1-t-e,r[i]+=t;return r}function Lp(n,t,e,r,i){return n===i?(t-e)/r+(t<e?6:0):t===i?(e-n)/r+2:(n-t)/r+4}function La(n){const e=n.r/255,r=n.g/255,i=n.b/255,a=Math.max(e,r,i),s=Math.min(e,r,i),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=Lp(e,r,i,u,a),l=l*60+.5),[l|0,c||0,o]}function Ia(n,t,e,r){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,r)).map(on)}function Na(n,t,e){return Ia(sc,n,t,e)}function Ip(n,t,e){return Ia(Ap,n,t,e)}function Np(n,t,e){return Ia(Rp,n,t,e)}function oc(n){return(n%360+360)%360}function Fp(n){const t=Ep.exec(n);let e=255,r;if(!t)return;t[5]!==r&&(e=t[6]?_r(+t[5]):on(+t[5]));const i=oc(+t[2]),a=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=Ip(i,a,s):t[1]==="hsv"?r=Np(i,a,s):r=Na(i,a,s),{r:r[0],g:r[1],b:r[2],a:e}}function Up(n,t){var e=La(n);e[0]=oc(e[0]+t),e=Na(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Bp(n){if(!n)return;const t=La(n),e=t[0],r=ac(t[1]),i=ac(t[2]);return n.a<255?`hsla(${e}, ${r}%, ${i}%, ${He(n.a)})`:`hsl(${e}, ${r}%, ${i}%)`}const lc={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"},cc={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 Wp(){const n={},t=Object.keys(cc),e=Object.keys(lc);let r,i,a,s,o;for(r=0;r<t.length;r++){for(s=o=t[r],i=0;i<e.length;i++)a=e[i],o=o.replace(a,lc[a]);a=parseInt(cc[s],16),n[o]=[a>>16&255,a>>8&255,a&255]}return n}let gi;function zp(n){gi||(gi=Wp(),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 Yp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Hp(n){const t=Yp.exec(n);let e=255,r,i,a;if(t){if(t[7]!==r){const s=+t[7];e=t[8]?_r(s):sn(s*255,0,255)}return r=+t[1],i=+t[3],a=+t[5],r=255&(t[2]?_r(r):sn(r,0,255)),i=255&(t[4]?_r(i):sn(i,0,255)),a=255&(t[6]?_r(a):sn(a,0,255)),{r,g:i,b:a,a:e}}}function $p(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${He(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Fa=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Zn=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function jp(n,t,e){const r=Zn(He(n.r)),i=Zn(He(n.g)),a=Zn(He(n.b));return{r:on(Fa(r+e*(Zn(He(t.r))-r))),g:on(Fa(i+e*(Zn(He(t.g))-i))),b:on(Fa(a+e*(Zn(He(t.b))-a))),a:n.a+e*(t.a-n.a)}}function mi(n,t,e){if(n){let r=La(n);r[t]=Math.max(0,Math.min(r[t]+r[t]*e,t===0?360:1)),r=Na(r),n.r=r[0],n.g=r[1],n.b=r[2]}}function uc(n,t){return n&&Object.assign(t||{},n)}function dc(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=on(n[3]))):(t=uc(n,{r:0,g:0,b:0,a:1}),t.a=on(t.a)),t}function Vp(n){return n.charAt(0)==="r"?Hp(n):Fp(n)}class wr{constructor(t){if(t instanceof wr)return t;const e=typeof t;let r;e==="object"?r=dc(t):e==="string"&&(r=Cp(t)||zp(t)||Vp(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=uc(this._rgb);return t&&(t.a=He(t.a)),t}set rgb(t){this._rgb=dc(t)}rgbString(){return this._valid?$p(this._rgb):void 0}hexString(){return this._valid?Pp(this._rgb):void 0}hslString(){return this._valid?Bp(this._rgb):void 0}mix(t,e){if(t){const r=this.rgb,i=t.rgb;let a;const s=e===a?.5:e,o=2*s-1,l=r.a-i.a,c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2;a=1-c,r.r=255&c*r.r+a*i.r+.5,r.g=255&c*r.g+a*i.g+.5,r.b=255&c*r.b+a*i.b+.5,r.a=s*r.a+(1-s)*i.a,this.rgb=r}return this}interpolate(t,e){return t&&(this._rgb=jp(this._rgb,t._rgb,e)),this}clone(){return new wr(this.rgb)}alpha(t){return this._rgb.a=on(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=xr(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 mi(this._rgb,2,t),this}darken(t){return mi(this._rgb,2,-t),this}saturate(t){return mi(this._rgb,1,t),this}desaturate(t){return mi(this._rgb,1,-t),this}rotate(t){return Up(this._rgb,t),this}}/*!
6
+ */function ei(n){return n+.5|0}const $e=(n,t,e)=>Math.max(Math.min(n,e),t);function ni(n){return $e(ei(n*2.55),0,255)}function Ue(n){return $e(ei(n*255),0,255)}function Pe(n){return $e(ei(n/2.55)/100,0,1)}function ma(n){return $e(ei(n*100),0,100)}const de={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},ur=[..."0123456789ABCDEF"],ph=n=>ur[n&15],mh=n=>ur[(n&240)>>4]+ur[n&15],Ui=n=>(n&240)>>4===(n&15),yh=n=>Ui(n.r)&&Ui(n.g)&&Ui(n.b)&&Ui(n.a);function bh(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&de[n[1]]*17,g:255&de[n[2]]*17,b:255&de[n[3]]*17,a:t===5?de[n[4]]*17:255}:(t===7||t===9)&&(e={r:de[n[1]]<<4|de[n[2]],g:de[n[3]]<<4|de[n[4]],b:de[n[5]]<<4|de[n[6]],a:t===9?de[n[7]]<<4|de[n[8]]:255})),e}const _h=(n,t)=>n<255?t(n):"";function xh(n){var t=yh(n)?ph:mh;return n?"#"+t(n.r)+t(n.g)+t(n.b)+_h(n.a,t):void 0}const wh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ya(n,t,e){const i=t*Math.min(e,1-e),s=(r,o=(r+n/30)%12)=>e-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function kh(n,t,e){const i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Sh(n,t,e){const i=ya(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function vh(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function dr(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),o=Math.min(e,i,s),a=(r+o)/2;let l,c,u;return r!==o&&(u=r-o,c=a>.5?u/(2-r-o):u/(r+o),l=vh(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function hr(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ue)}function fr(n,t,e){return hr(ya,n,t,e)}function Dh(n,t,e){return hr(Sh,n,t,e)}function Mh(n,t,e){return hr(kh,n,t,e)}function ba(n){return(n%360+360)%360}function Th(n){const t=wh.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?ni(+t[5]):Ue(+t[5]));const s=ba(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=Dh(s,r,o):t[1]==="hsv"?i=Mh(s,r,o):i=fr(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Ch(n,t){var e=dr(n);e[0]=ba(e[0]+t),e=fr(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Oh(n){if(!n)return;const t=dr(n),e=t[0],i=ma(t[1]),s=ma(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Pe(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const _a={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"},xa={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 Ph(){const n={},t=Object.keys(xa),e=Object.keys(_a);let i,s,r,o,a;for(i=0;i<t.length;i++){for(o=a=t[i],s=0;s<e.length;s++)r=e[s],a=a.replace(r,_a[r]);r=parseInt(xa[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let qi;function Eh(n){qi||(qi=Ph(),qi.transparent=[0,0,0,0]);const t=qi[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Rh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ah(n){const t=Rh.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?ni(o):$e(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?ni(i):$e(i,0,255)),s=255&(t[4]?ni(s):$e(s,0,255)),r=255&(t[6]?ni(r):$e(r,0,255)),{r:i,g:s,b:r,a:e}}}function Lh(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Pe(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const gr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Rn=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Ih(n,t,e){const i=Rn(Pe(n.r)),s=Rn(Pe(n.g)),r=Rn(Pe(n.b));return{r:Ue(gr(i+e*(Rn(Pe(t.r))-i))),g:Ue(gr(s+e*(Rn(Pe(t.g))-s))),b:Ue(gr(r+e*(Rn(Pe(t.b))-r))),a:n.a+e*(t.a-n.a)}}function Xi(n,t,e){if(n){let i=dr(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=fr(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function wa(n,t){return n&&Object.assign(t||{},n)}function ka(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=Ue(n[3]))):(t=wa(n,{r:0,g:0,b:0,a:1}),t.a=Ue(t.a)),t}function Nh(n){return n.charAt(0)==="r"?Ah(n):Th(n)}class ii{constructor(t){if(t instanceof ii)return t;const e=typeof t;let i;e==="object"?i=ka(t):e==="string"&&(i=bh(t)||Eh(t)||Nh(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=wa(this._rgb);return t&&(t.a=Pe(t.a)),t}set rgb(t){this._rgb=ka(t)}rgbString(){return this._valid?Lh(this._rgb):void 0}hexString(){return this._valid?xh(this._rgb):void 0}hslString(){return this._valid?Oh(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const o=e===r?.5:e,a=2*o-1,l=i.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Ih(this._rgb,t._rgb,e)),this}clone(){return new ii(this.rgb)}alpha(t){return this._rgb.a=Ue(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ei(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 Xi(this._rgb,2,t),this}darken(t){return Xi(this._rgb,2,-t),this}saturate(t){return Xi(this._rgb,1,t),this}desaturate(t){return Xi(this._rgb,1,-t),this}rotate(t){return Ch(this._rgb,t),this}}/*!
7
7
  * Chart.js v4.4.3
8
8
  * https://www.chartjs.org
9
9
  * (c) 2024 Chart.js Contributors
10
10
  * Released under the MIT License
11
- */function $e(){}const qp=(()=>{let n=0;return()=>n++})();function st(n){return n===null||typeof n>"u"}function mt(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 lt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function It(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function be(n,t){return It(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const Xp=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,fc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Tt(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Mt(n,t,e,r){let i,a,s;if(mt(n))if(a=n.length,r)for(i=a-1;i>=0;i--)t.call(e,n[i],i);else for(i=0;i<a;i++)t.call(e,n[i],i);else if(lt(n))for(s=Object.keys(n),a=s.length,i=0;i<a;i++)t.call(e,n[s[i]],s[i])}function yi(n,t){let e,r,i,a;if(!n||!t||n.length!==t.length)return!1;for(e=0,r=n.length;e<r;++e)if(i=n[e],a=t[e],i.datasetIndex!==a.datasetIndex||i.index!==a.index)return!1;return!0}function vi(n){if(mt(n))return n.map(vi);if(lt(n)){const t=Object.create(null),e=Object.keys(n),r=e.length;let i=0;for(;i<r;++i)t[e[i]]=vi(n[e[i]]);return t}return n}function hc(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Gp(n,t,e,r){if(!hc(n))return;const i=t[n],a=e[n];lt(i)&&lt(a)?Tr(i,a,r):t[n]=vi(a)}function Tr(n,t,e){const r=mt(t)?t:[t],i=r.length;if(!lt(n))return n;e=e||{};const a=e.merger||Gp;let s;for(let o=0;o<i;++o){if(s=r[o],!lt(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 Mr(n,t){return Tr(n,t,{merger:Kp})}function Kp(n,t,e){if(!hc(n))return;const r=t[n],i=e[n];lt(r)&&lt(i)?Mr(r,i):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=vi(i))}const pc={"":n=>n,x:n=>n.x,y:n=>n.y};function Qp(n){const t=n.split("."),e=[];let r="";for(const i of t)r+=i,r.endsWith("\\")?r=r.slice(0,-1)+".":(e.push(r),r="");return e}function Zp(n){const t=Qp(n);return e=>{for(const r of t){if(r==="")break;e=e&&e[r]}return e}}function ln(n,t){return(pc[t]||(pc[t]=Zp(t)))(n)}function Ua(n){return n.charAt(0).toUpperCase()+n.slice(1)}const de=n=>typeof n<"u",fe=n=>typeof n=="function",gc=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Jp(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const dt=Math.PI,Ct=2*dt,tg=Ct+dt,bi=Number.POSITIVE_INFINITY,Ba=dt/180,Et=dt/2,Te=dt/4,xi=dt*2/3,cn=Math.log10,Le=Math.sign;function Dr(n,t,e){return Math.abs(n-t)<e}function mc(n){const t=Math.round(n);n=Dr(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(cn(n))),r=n/e;return(r<=1?1:r<=2?2:r<=5?5:10)*e}function eg(n){const t=[],e=Math.sqrt(n);let r;for(r=1;r<e;r++)n%r===0&&(t.push(r),t.push(n/r));return e===(e|0)&&t.push(e),t.sort((i,a)=>i-a).pop(),t}function un(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ng(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function yc(n,t,e){let r,i,a;for(r=0,i=n.length;r<i;r++)a=n[r][e],isNaN(a)||(t.min=Math.min(t.min,a),t.max=Math.max(t.max,a))}function Xt(n){return n*(dt/180)}function _i(n){return n*(180/dt)}function vc(n){if(!It(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function bc(n,t){const e=t.x-n.x,r=t.y-n.y,i=Math.sqrt(e*e+r*r);let a=Math.atan2(r,e);return a<-.5*dt&&(a+=Ct),{angle:a,distance:i}}function Jn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function rg(n,t){return(n-t+tg)%Ct-dt}function xe(n){return(n%Ct+Ct)%Ct}function Sr(n,t,e,r){const i=xe(n),a=xe(t),s=xe(e),o=xe(a-i),l=xe(s-i),c=xe(i-a),u=xe(i-s);return i===a||i===s||r&&a===s||o>l&&c<u}function Qt(n,t,e){return Math.max(t,Math.min(e,n))}function ig(n){return Qt(n,-32768,32767)}function je(n,t,e,r=1e-6){return n>=Math.min(t,e)-r&&n<=Math.max(t,e)+r}function Wa(n,t,e){e=e||(s=>n[s]<t);let r=n.length-1,i=0,a;for(;r-i>1;)a=i+r>>1,e(a)?i=a:r=a;return{lo:i,hi:r}}const Ve=(n,t,e,r)=>Wa(n,e,r?i=>{const a=n[i][t];return a<e||a===e&&n[i+1][t]===e}:i=>n[i][t]<e),ag=(n,t,e)=>Wa(n,e,r=>n[r][t]>=e);function sg(n,t,e){let r=0,i=n.length;for(;r<i&&n[r]<t;)r++;for(;i>r&&n[i-1]>e;)i--;return r>0||i<n.length?n.slice(r,i):n}const xc=["push","pop","shift","splice","unshift"];function og(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),xc.forEach(e=>{const r="_onData"+Ua(e),i=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...a){const s=i.apply(this,a);return n._chartjs.listeners.forEach(o=>{typeof o[r]=="function"&&o[r](...a)}),s}})})}function _c(n,t){const e=n._chartjs;if(!e)return;const r=e.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(xc.forEach(a=>{delete n[a]}),delete n._chartjs)}function wc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Tc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Mc(n,t){let e=[],r=!1;return function(...i){e=i,r||(r=!0,Tc.call(window,()=>{r=!1,n.apply(t,e)}))}}function lg(n,t){let e;return function(...r){return t?(clearTimeout(e),e=setTimeout(n,t,r)):n.apply(this,r),t}}const za=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,cg=(n,t,e,r)=>n===(r?"left":"right")?e:n==="center"?(t+e)/2:t;function Dc(n,t,e){const r=t.length;let i=0,a=r;if(n._sorted){const{iScale:s,_parsed:o}=n,l=s.axis,{min:c,max:u,minDefined:d,maxDefined:f}=s.getUserBounds();d&&(i=Qt(Math.min(Ve(o,l,c).lo,e?r:Ve(t,l,s.getPixelForValue(c)).lo),0,r-1)),f?a=Qt(Math.max(Ve(o,s.axis,u,!0).hi+1,e?0:Ve(t,l,s.getPixelForValue(u),!0).hi+1),i,r)-i:a=r-i}return{start:i,count:a}}function Sc(n){const{xScale:t,yScale:e,_scaleRanges:r}=n,i={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!r)return n._scaleRanges=i,!0;const a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==e.min||r.ymax!==e.max;return Object.assign(r,i),a}const wi=n=>n===0||n===1,kc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ct/e)),Cc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ct/e)+1,kr={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*Et)+1,easeOutSine:n=>Math.sin(n*Et),easeInOutSine:n=>-.5*(Math.cos(dt*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:kc(n,.075,.3),easeOutElastic:n=>wi(n)?n:Cc(n,.075,.3),easeInOutElastic(n){return wi(n)?n:n<.5?.5*kc(n*2,.1125,.45):.5+.5*Cc(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-kr.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?kr.easeInBounce(n*2)*.5:kr.easeOutBounce(n*2-1)*.5+.5};function Ya(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Oc(n){return Ya(n)?n:new wr(n)}function Ha(n){return Ya(n)?n:new wr(n).saturate(.5).darken(.1).hexString()}const ug=["x","y","borderWidth","radius","tension"],dg=["color","borderColor","backgroundColor"];function fg(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:dg},numbers:{type:"number",properties:ug}}),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 hg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Pc=new Map;function pg(n,t){t=t||{};const e=n+JSON.stringify(t);let r=Pc.get(e);return r||(r=new Intl.NumberFormat(n,t),Pc.set(e,r)),r}function Cr(n,t,e){return pg(t,e).format(n)}const Ec={values(n){return mt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const r=this.chart.options.locale;let i,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)&&(i="scientific"),a=gg(n,e)}const s=cn(Math.abs(a)),o=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:i,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),Cr(n,r,l)},logarithmic(n,t,e){if(n===0)return"0";const r=e[t].significand||n/Math.pow(10,Math.floor(cn(n)));return[1,2,3,5,10,15].includes(r)||t>.8*e.length?Ec.numeric.call(this,n,t,e):""}};function gg(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 Ti={formatters:Ec};function mg(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:Ti.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 On=Object.create(null),$a=Object.create(null);function Or(n,t){if(!t)return n;const e=t.split(".");for(let r=0,i=e.length;r<i;++r){const a=e[r];n=n[a]||(n[a]=Object.create(null))}return n}function ja(n,t,e){return typeof t=="string"?Tr(Or(n,t),e):Tr(Or(n,""),t)}class yg{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=r=>r.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=(r,i)=>Ha(i.backgroundColor),this.hoverBorderColor=(r,i)=>Ha(i.borderColor),this.hoverColor=(r,i)=>Ha(i.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 ja(this,t,e)}get(t){return Or(this,t)}describe(t,e){return ja($a,t,e)}override(t,e){return ja(On,t,e)}route(t,e,r,i){const a=Or(this,t),s=Or(this,r),o="_"+e;Object.defineProperties(a,{[o]:{value:a[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=s[i];return lt(l)?Object.assign({},c,l):rt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Ut=new yg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[fg,hg,mg]);function vg(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Mi(n,t,e,r,i){let a=t[i];return a||(a=t[i]=n.measureText(i).width,e.push(i)),a>r&&(r=a),r}function bg(n,t,e,r){r=r||{};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),n.save(),n.font=t;let s=0;const o=e.length;let l,c,u,d,f;for(l=0;l<o;l++)if(d=e[l],d!=null&&!mt(d))s=Mi(n,i,a,s,d);else if(mt(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!mt(f)&&(s=Mi(n,i,a,s,f));n.restore();const p=a.length/2;if(p>e.length){for(l=0;l<p;l++)delete i[a[l]];a.splice(0,p)}return s}function Pn(n,t,e){const r=n.currentDevicePixelRatio,i=e!==0?Math.max(e/2,.5):0;return Math.round((t-i)*r)/r+i}function Rc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Va(n,t,e,r){Ac(n,t,e,r,null)}function Ac(n,t,e,r,i){let a,s,o,l,c,u,d,f;const p=t.pointStyle,y=t.rotation,x=t.radius;let g=(y||0)*Ba;if(p&&typeof p=="object"&&(a=p.toString(),a==="[object HTMLImageElement]"||a==="[object HTMLCanvasElement]")){n.save(),n.translate(e,r),n.rotate(g),n.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),n.restore();return}if(!(isNaN(x)||x<=0)){switch(n.beginPath(),p){default:i?n.ellipse(e,r,i/2,x,0,0,Ct):n.arc(e,r,x,0,Ct),n.closePath();break;case"triangle":u=i?i/2:x,n.moveTo(e+Math.sin(g)*u,r-Math.cos(g)*x),g+=xi,n.lineTo(e+Math.sin(g)*u,r-Math.cos(g)*x),g+=xi,n.lineTo(e+Math.sin(g)*u,r-Math.cos(g)*x),n.closePath();break;case"rectRounded":c=x*.516,l=x-c,s=Math.cos(g+Te)*l,d=Math.cos(g+Te)*(i?i/2-c:l),o=Math.sin(g+Te)*l,f=Math.sin(g+Te)*(i?i/2-c:l),n.arc(e-d,r-o,c,g-dt,g-Et),n.arc(e+f,r-s,c,g-Et,g),n.arc(e+d,r+o,c,g,g+Et),n.arc(e-f,r+s,c,g+Et,g+dt),n.closePath();break;case"rect":if(!y){l=Math.SQRT1_2*x,u=i?i/2:l,n.rect(e-u,r-l,2*u,2*l);break}g+=Te;case"rectRot":d=Math.cos(g)*(i?i/2:x),s=Math.cos(g)*x,o=Math.sin(g)*x,f=Math.sin(g)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+f,r-s),n.lineTo(e+d,r+o),n.lineTo(e-f,r+s),n.closePath();break;case"crossRot":g+=Te;case"cross":d=Math.cos(g)*(i?i/2:x),s=Math.cos(g)*x,o=Math.sin(g)*x,f=Math.sin(g)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s);break;case"star":d=Math.cos(g)*(i?i/2:x),s=Math.cos(g)*x,o=Math.sin(g)*x,f=Math.sin(g)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s),g+=Te,d=Math.cos(g)*(i?i/2:x),s=Math.cos(g)*x,o=Math.sin(g)*x,f=Math.sin(g)*(i?i/2:x),n.moveTo(e-d,r-o),n.lineTo(e+d,r+o),n.moveTo(e+f,r-s),n.lineTo(e-f,r+s);break;case"line":s=i?i/2:Math.cos(g)*x,o=Math.sin(g)*x,n.moveTo(e-s,r-o),n.lineTo(e+s,r+o);break;case"dash":n.moveTo(e,r),n.lineTo(e+Math.cos(g)*(i?i/2:x),r+Math.sin(g)*x);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function qe(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 Pr(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Er(n){n.restore()}function xg(n,t,e,r,i){if(!t)return n.lineTo(e.x,e.y);if(i==="middle"){const a=(t.x+e.x)/2;n.lineTo(a,t.y),n.lineTo(a,e.y)}else i==="after"!=!!r?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function _g(n,t,e,r){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?e.cp2x:e.cp1x,r?e.cp2y:e.cp1y,e.x,e.y)}function wg(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),st(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 Tg(n,t,e,r,i){if(i.strikethrough||i.underline){const a=n.measureText(r),s=t-a.actualBoundingBoxLeft,o=t+a.actualBoundingBoxRight,l=e-a.actualBoundingBoxAscent,c=e+a.actualBoundingBoxDescent,u=i.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=i.decorationWidth||2,n.moveTo(s,u),n.lineTo(o,u),n.stroke()}}function Mg(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function En(n,t,e,r,i,a={}){const s=mt(t)?t:[t],o=a.strokeWidth>0&&a.strokeColor!=="";let l,c;for(n.save(),n.font=i.string,wg(n,a),l=0;l<s.length;++l)c=s[l],a.backdrop&&Mg(n,a.backdrop),o&&(a.strokeColor&&(n.strokeStyle=a.strokeColor),st(a.strokeWidth)||(n.lineWidth=a.strokeWidth),n.strokeText(c,e,r,a.maxWidth)),n.fillText(c,e,r,a.maxWidth),Tg(n,e,r,c,a),r+=Number(i.lineHeight);n.restore()}function tr(n,t){const{x:e,y:r,w:i,h:a,radius:s}=t;n.arc(e+s.topLeft,r+s.topLeft,s.topLeft,1.5*dt,dt,!0),n.lineTo(e,r+a-s.bottomLeft),n.arc(e+s.bottomLeft,r+a-s.bottomLeft,s.bottomLeft,dt,Et,!0),n.lineTo(e+i-s.bottomRight,r+a),n.arc(e+i-s.bottomRight,r+a-s.bottomRight,s.bottomRight,Et,0,!0),n.lineTo(e+i,r+s.topRight),n.arc(e+i-s.topRight,r+s.topRight,s.topRight,0,-Et,!0),n.lineTo(e+s.topLeft,r)}const Dg=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Sg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function kg(n,t){const e=(""+n).match(Dg);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 Cg=n=>+n||0;function qa(n,t){const e={},r=lt(t),i=r?Object.keys(t):t,a=lt(n)?r?s=>rt(n[s],n[t[s]]):s=>n[s]:()=>n;for(const s of i)e[s]=Cg(a(s));return e}function Lc(n){return qa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function dn(n){return qa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Gt(n){const t=Lc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Rt(n,t){n=n||{},t=t||Ut.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let r=rt(n.style,t.style);r&&!(""+r).match(Sg)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const i={family:rt(n.family,t.family),lineHeight:kg(rt(n.lineHeight,t.lineHeight),e),size:e,style:r,weight:rt(n.weight,t.weight),string:""};return i.string=vg(i),i}function Rr(n,t,e,r){let i=!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),i=!1),e!==void 0&&mt(o)&&(o=o[e%o.length],i=!1),o!==void 0))return r&&!i&&(r.cacheable=!1),o}function Og(n,t,e){const{min:r,max:i}=n,a=fc(t,(i-r)/2),s=(o,l)=>e&&o===0?0:o+l;return{min:s(r,-Math.abs(a)),max:s(i,a)}}function fn(n,t){return Object.assign(Object.create(n),t)}function Xa(n,t=[""],e,r,i=()=>n[0]){const a=e||n;typeof r>"u"&&(r=Bc("_fallback",n));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:a,_fallback:r,_getTarget:i,override:o=>Xa([o,...n],t,a,r)};return new Proxy(s,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return Nc(o,l,()=>Fg(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return Wc(o).includes(l)},ownKeys(o){return Wc(o)},set(o,l,c){const u=o._storage||(o._storage=i());return o[l]=u[l]=c,delete o._keys,!0}})}function er(n,t,e,r){const i={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ic(n,r),setContext:a=>er(n,a,e,r),override:a=>er(n.override(a),t,e,r)};return new Proxy(i,{deleteProperty(a,s){return delete a[s],delete n[s],!0},get(a,s,o){return Nc(a,s,()=>Eg(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 Ic(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=n;return{allKeys:i,scriptable:e,indexable:r,isScriptable:fe(e)?e:()=>e,isIndexable:fe(r)?r:()=>r}}const Pg=(n,t)=>n?n+Ua(t):t,Ga=(n,t)=>lt(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Nc(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const r=e();return n[t]=r,r}function Eg(n,t,e){const{_proxy:r,_context:i,_subProxy:a,_descriptors:s}=n;let o=r[t];return fe(o)&&s.isScriptable(t)&&(o=Rg(t,o,n,e)),mt(o)&&o.length&&(o=Ag(t,o,n,s.isIndexable)),Ga(t,o)&&(o=er(o,i,a&&a[t],s)),o}function Rg(n,t,e,r){const{_proxy:i,_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||r);return o.delete(n),Ga(n,l)&&(l=Ka(i._scopes,i,n,l)),l}function Ag(n,t,e,r){const{_proxy:i,_context:a,_subProxy:s,_descriptors:o}=e;if(typeof a.index<"u"&&r(n))return t[a.index%t.length];if(lt(t[0])){const l=t,c=i._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Ka(c,i,n,u);t.push(er(d,a,s&&s[n],o))}}return t}function Fc(n,t,e){return fe(n)?n(t,e):n}const Lg=(n,t)=>n===!0?t:typeof n=="string"?ln(t,n):void 0;function Ig(n,t,e,r,i){for(const a of t){const s=Lg(e,a);if(s){n.add(s);const o=Fc(s._fallback,e,i);if(typeof o<"u"&&o!==e&&o!==r)return o}else if(s===!1&&typeof r<"u"&&e!==r)return null}return!1}function Ka(n,t,e,r){const i=t._rootScopes,a=Fc(t._fallback,e,r),s=[...n,...i],o=new Set;o.add(r);let l=Uc(o,s,e,a||e,r);return l===null||typeof a<"u"&&a!==e&&(l=Uc(o,s,a,l,r),l===null)?!1:Xa(Array.from(o),[""],i,a,()=>Ng(t,e,r))}function Uc(n,t,e,r,i){for(;e;)e=Ig(n,t,e,r,i);return e}function Ng(n,t,e){const r=n._getTarget();t in r||(r[t]={});const i=r[t];return mt(i)&&lt(e)?e:i||{}}function Fg(n,t,e,r){let i;for(const a of t)if(i=Bc(Pg(a,n),e),typeof i<"u")return Ga(n,i)?Ka(e,r,n,i):i}function Bc(n,t){for(const e of t){if(!e)continue;const r=e[n];if(typeof r<"u")return r}}function Wc(n){let t=n._keys;return t||(t=n._keys=Ug(n._scopes)),t}function Ug(n){const t=new Set;for(const e of n)for(const r of Object.keys(e).filter(i=>!i.startsWith("_")))t.add(r);return Array.from(t)}function zc(n,t,e,r){const{iScale:i}=n,{key:a="r"}=this._parsing,s=new Array(r);let o,l,c,u;for(o=0,l=r;o<l;++o)c=o+e,u=t[c],s[o]={r:i.parse(ln(u,a),c)};return s}const Bg=Number.EPSILON||1e-14,nr=(n,t)=>t<n.length&&!n[t].skip&&n[t],Yc=n=>n==="x"?"y":"x";function Wg(n,t,e,r){const i=n.skip?t:n,a=t,s=e.skip?t:e,o=Jn(a,i),l=Jn(s,a);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=r*c,f=r*u;return{previous:{x:a.x-d*(s.x-i.x),y:a.y-d*(s.y-i.y)},next:{x:a.x+f*(s.x-i.x),y:a.y+f*(s.y-i.y)}}}function zg(n,t,e){const r=n.length;let i,a,s,o,l,c=nr(n,0);for(let u=0;u<r-1;++u)if(l=c,c=nr(n,u+1),!(!l||!c)){if(Dr(t[u],0,Bg)){e[u]=e[u+1]=0;continue}i=e[u]/t[u],a=e[u+1]/t[u],o=Math.pow(i,2)+Math.pow(a,2),!(o<=9)&&(s=3/Math.sqrt(o),e[u]=i*s*t[u],e[u+1]=a*s*t[u])}}function Yg(n,t,e="x"){const r=Yc(e),i=n.length;let a,s,o,l=nr(n,0);for(let c=0;c<i;++c){if(s=o,o=l,l=nr(n,c+1),!o)continue;const u=o[e],d=o[r];s&&(a=(u-s[e])/3,o[`cp1${e}`]=u-a,o[`cp1${r}`]=d-a*t[c]),l&&(a=(l[e]-u)/3,o[`cp2${e}`]=u+a,o[`cp2${r}`]=d+a*t[c])}}function Hg(n,t="x"){const e=Yc(t),r=n.length,i=Array(r).fill(0),a=Array(r);let s,o,l,c=nr(n,0);for(s=0;s<r;++s)if(o=l,l=c,c=nr(n,s+1),!!l){if(c){const u=c[t]-l[t];i[s]=u!==0?(c[e]-l[e])/u:0}a[s]=o?c?Le(i[s-1])!==Le(i[s])?0:(i[s-1]+i[s])/2:i[s-1]:i[s]}zg(n,i,a),Yg(n,a,t)}function Di(n,t,e){return Math.max(Math.min(n,e),t)}function $g(n,t){let e,r,i,a,s,o=qe(n[0],t);for(e=0,r=n.length;e<r;++e)s=a,a=o,o=e<r-1&&qe(n[e+1],t),a&&(i=n[e],s&&(i.cp1x=Di(i.cp1x,t.left,t.right),i.cp1y=Di(i.cp1y,t.top,t.bottom)),o&&(i.cp2x=Di(i.cp2x,t.left,t.right),i.cp2y=Di(i.cp2y,t.top,t.bottom)))}function jg(n,t,e,r,i){let a,s,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Hg(n,i);else{let c=r?n[n.length-1]:n[0];for(a=0,s=n.length;a<s;++a)o=n[a],l=Wg(c,o,n[Math.min(a+1,s-(r?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&&$g(n,e)}function Qa(){return typeof window<"u"&&typeof document<"u"}function Za(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Si(n,t,e){let r;return typeof n=="string"?(r=parseInt(n,10),n.indexOf("%")!==-1&&(r=r/100*t.parentNode[e])):r=n,r}const ki=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Vg(n,t){return ki(n).getPropertyValue(t)}const qg=["top","right","bottom","left"];function Rn(n,t,e){const r={};e=e?"-"+e:"";for(let i=0;i<4;i++){const a=qg[i];r[a]=parseFloat(n[t+"-"+a+e])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Xg=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Gg(n,t){const e=n.touches,r=e&&e.length?e[0]:n,{offsetX:i,offsetY:a}=r;let s=!1,o,l;if(Xg(i,a,n.target))o=i,l=a;else{const c=t.getBoundingClientRect();o=r.clientX-c.left,l=r.clientY-c.top,s=!0}return{x:o,y:l,box:s}}function hn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:r}=t,i=ki(e),a=i.boxSizing==="border-box",s=Rn(i,"padding"),o=Rn(i,"border","width"),{x:l,y:c,box:u}=Gg(n,e),d=s.left+(u&&o.left),f=s.top+(u&&o.top);let{width:p,height:y}=t;return a&&(p-=s.width+o.width,y-=s.height+o.height),{x:Math.round((l-d)/p*e.width/r),y:Math.round((c-f)/y*e.height/r)}}function Kg(n,t,e){let r,i;if(t===void 0||e===void 0){const a=n&&Za(n);if(!a)t=n.clientWidth,e=n.clientHeight;else{const s=a.getBoundingClientRect(),o=ki(a),l=Rn(o,"border","width"),c=Rn(o,"padding");t=s.width-c.width-l.width,e=s.height-c.height-l.height,r=Si(o.maxWidth,a,"clientWidth"),i=Si(o.maxHeight,a,"clientHeight")}}return{width:t,height:e,maxWidth:r||bi,maxHeight:i||bi}}const Ci=n=>Math.round(n*10)/10;function Qg(n,t,e,r){const i=ki(n),a=Rn(i,"margin"),s=Si(i.maxWidth,n,"clientWidth")||bi,o=Si(i.maxHeight,n,"clientHeight")||bi,l=Kg(n,t,e);let{width:c,height:u}=l;if(i.boxSizing==="content-box"){const f=Rn(i,"border","width"),p=Rn(i,"padding");c-=p.width+f.width,u-=p.height+f.height}return c=Math.max(0,c-a.width),u=Math.max(0,r?c/r:u-a.height),c=Ci(Math.min(c,s,l.maxWidth)),u=Ci(Math.min(u,o,l.maxHeight)),c&&!u&&(u=Ci(c/2)),(t!==void 0||e!==void 0)&&r&&l.height&&u>l.height&&(u=l.height,c=Ci(Math.floor(u*r))),{width:c,height:u}}function Hc(n,t,e){const r=t||1,i=Math.floor(n.height*r),a=Math.floor(n.width*r);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!==r||s.height!==i||s.width!==a?(n.currentDevicePixelRatio=r,s.height=i,s.width=a,n.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Zg=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Qa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function $c(n,t){const e=Vg(n,t),r=e&&e.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function An(n,t,e,r){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Jg(n,t,e,r){return{x:n.x+e*(t.x-n.x),y:r==="middle"?e<.5?n.y:t.y:r==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function tm(n,t,e,r){const i={x:n.cp2x,y:n.cp2y},a={x:t.cp1x,y:t.cp1y},s=An(n,i,e),o=An(i,a,e),l=An(a,t,e),c=An(s,o,e),u=An(o,l,e);return An(c,u,e)}const em=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,r){return e-r},leftForLtr(e,r){return e-r}}},nm=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function rr(n,t,e){return n?em(t,e):nm()}function jc(n,t){let e,r;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,r=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=r)}function Vc(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function qc(n){return n==="angle"?{between:Sr,compare:rg,normalize:xe}:{between:je,compare:(t,e)=>t-e,normalize:t=>t}}function Xc({start:n,end:t,count:e,loop:r,style:i}){return{start:n%e,end:t%e,loop:r&&(t-n+1)%e===0,style:i}}function rm(n,t,e){const{property:r,start:i,end:a}=e,{between:s,normalize:o}=qc(r),l=t.length;let{start:c,end:u,loop:d}=n,f,p;if(d){for(c+=l,u+=l,f=0,p=l;f<p&&s(o(t[c%l][r]),i,a);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function Gc(n,t,e){if(!e)return[n];const{property:r,start:i,end:a}=e,s=t.length,{compare:o,between:l,normalize:c}=qc(r),{start:u,end:d,loop:f,style:p}=rm(n,t,e),y=[];let x=!1,g=null,m,v,b;const w=()=>l(i,b,m)&&o(i,b)!==0,T=()=>o(a,m)===0||l(a,b,m),S=()=>x||w(),C=()=>!x||T();for(let M=u,D=u;M<=d;++M)v=t[M%s],!v.skip&&(m=c(v[r]),m!==b&&(x=l(m,i,a),g===null&&S()&&(g=o(m,i)===0?M:D),g!==null&&C()&&(y.push(Xc({start:g,end:M,loop:f,count:s,style:p})),g=null),D=M,b=m));return g!==null&&y.push(Xc({start:g,end:d,loop:f,count:s,style:p})),y}function Kc(n,t){const e=[],r=n.segments;for(let i=0;i<r.length;i++){const a=Gc(r[i],n.points,t);a.length&&e.push(...a)}return e}function im(n,t,e,r){let i=0,a=t-1;if(e&&!r)for(;i<t&&!n[i].skip;)i++;for(;i<t&&n[i].skip;)i++;for(i%=t,e&&(a+=i);a>i&&n[a%t].skip;)a--;return a%=t,{start:i,end:a}}function am(n,t,e,r){const i=n.length,a=[];let s=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%i];c.skip||c.stop?o.skip||(r=!1,a.push({start:t%i,end:(l-1)%i,loop:r}),t=s=c.stop?l:null):(s=l,o.skip&&(t=l)),o=c}return s!==null&&a.push({start:t%i,end:s%i,loop:r}),a}function sm(n,t){const e=n.points,r=n.options.spanGaps,i=e.length;if(!i)return[];const a=!!n._loop,{start:s,end:o}=im(e,i,a,r);if(r===!0)return Qc(n,[{start:s,end:o,loop:a}],e,t);const l=o<s?o+i:o,c=!!n._fullLoop&&s===0&&o===i-1;return Qc(n,am(e,s,l,c),e,t)}function Qc(n,t,e,r){return!r||!r.setContext||!e?t:om(n,t,e,r)}function om(n,t,e,r){const i=n._chart.getContext(),a=Zc(n.options),{_datasetIndex:s,options:{spanGaps:o}}=n,l=e.length,c=[];let u=a,d=t[0].start,f=d;function p(y,x,g,m){const v=o?-1:1;if(y!==x){for(y+=l;e[y%l].skip;)y-=v;for(;e[x%l].skip;)x+=v;y%l!==x%l&&(c.push({start:y%l,end:x%l,loop:g,style:m}),u=m,d=x%l)}}for(const y of t){d=o?d:y.start;let x=e[d%l],g;for(f=d+1;f<=y.end;f++){const m=e[f%l];g=Zc(r.setContext(fn(i,{type:"segment",p0:x,p1:m,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),lm(g,u)&&p(d,f-1,y.loop,u),x=m,u=g}d<f-1&&p(d,f-1,y.loop,u)}return c}function Zc(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function lm(n,t){if(!t)return!1;const e=[],r=function(i,a){return Ya(a)?(e.includes(a)||e.push(a),e.indexOf(a)):a};return JSON.stringify(n,r)!==JSON.stringify(t,r)}/*!
11
+ */function Ee(){}const Fh=(()=>{let n=0;return()=>n++})();function tt(n){return n===null||typeof n>"u"}function ot(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 it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function vt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function le(n,t){return vt(n)?n:t}function Z(n,t){return typeof n>"u"?t:n}const Bh=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Sa=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function ut(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function dt(n,t,e,i){let s,r,o;if(ot(n))if(r=n.length,i)for(s=r-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;s<r;s++)t.call(e,n[s],s);else if(it(n))for(o=Object.keys(n),r=o.length,s=0;s<r;s++)t.call(e,n[o[s]],o[s])}function Gi(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Ki(n){if(ot(n))return n.map(Ki);if(it(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=Ki(n[e[s]]);return t}return n}function va(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function zh(n,t,e,i){if(!va(n))return;const s=t[n],r=e[n];it(s)&&it(r)?si(s,r,i):t[n]=Ki(r)}function si(n,t,e){const i=ot(t)?t:[t],s=i.length;if(!it(n))return n;e=e||{};const r=e.merger||zh;let o;for(let a=0;a<s;++a){if(o=i[a],!it(o))continue;const l=Object.keys(o);for(let c=0,u=l.length;c<u;++c)r(l[c],n,o,e)}return n}function ri(n,t){return si(n,t,{merger:Hh})}function Hh(n,t,e){if(!va(n))return;const i=t[n],s=e[n];it(i)&&it(s)?ri(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=Ki(s))}const Da={"":n=>n,x:n=>n.x,y:n=>n.y};function Wh(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Yh(n){const t=Wh(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function qe(n,t){return(Da[t]||(Da[t]=Yh(t)))(n)}function pr(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Qt=n=>typeof n<"u",Jt=n=>typeof n=="function",Ma=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Vh(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const rt=Math.PI,mt=2*rt,jh=mt+rt,Zi=Number.POSITIVE_INFINITY,mr=rt/180,bt=rt/2,he=rt/4,Qi=rt*2/3,Xe=Math.log10,Se=Math.sign;function oi(n,t,e){return Math.abs(n-t)<e}function Ta(n){const t=Math.round(n);n=oi(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 $h(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function Ge(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Uh(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Ca(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Nt(n){return n*(rt/180)}function Ji(n){return n*(180/rt)}function Oa(n){if(!vt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Pa(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*rt&&(r+=mt),{angle:r,distance:s}}function An(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function qh(n,t){return(n-t+jh)%mt-rt}function ce(n){return(n%mt+mt)%mt}function ai(n,t,e,i){const s=ce(n),r=ce(t),o=ce(e),a=ce(r-s),l=ce(o-s),c=ce(s-r),u=ce(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function zt(n,t,e){return Math.max(t,Math.min(e,n))}function Xh(n){return zt(n,-32768,32767)}function Re(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function yr(n,t,e){e=e||(o=>n[o]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const Ae=(n,t,e,i)=>yr(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Gh=(n,t,e)=>yr(n,e,i=>n[i][t]>=e);function Kh(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Ea=["push","pop","shift","splice","unshift"];function Zh(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ea.forEach(e=>{const i="_onData"+pr(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const o=s.apply(this,r);return n._chartjs.listeners.forEach(a=>{typeof a[i]=="function"&&a[i](...r)}),o}})})}function Ra(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Ea.forEach(r=>{delete n[r]}),delete n._chartjs)}function Aa(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const La=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ia(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,La.call(window,()=>{i=!1,n.apply(t,e)}))}}function Qh(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const br=n=>n==="start"?"left":n==="end"?"right":"center",Ut=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Jh=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Na(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:o,_parsed:a}=n,l=o.axis,{min:c,max:u,minDefined:d,maxDefined:f}=o.getUserBounds();d&&(s=zt(Math.min(Ae(a,l,c).lo,e?i:Ae(t,l,o.getPixelForValue(c)).lo),0,i-1)),f?r=zt(Math.max(Ae(a,o.axis,u,!0).hi+1,e?0:Ae(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function Fa(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const ts=n=>n===0||n===1,Ba=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*mt/e)),za=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*mt/e)+1,li={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*bt)+1,easeOutSine:n=>Math.sin(n*bt),easeInOutSine:n=>-.5*(Math.cos(rt*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=>ts(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=>ts(n)?n:Ba(n,.075,.3),easeOutElastic:n=>ts(n)?n:za(n,.075,.3),easeInOutElastic(n){return ts(n)?n:n<.5?.5*Ba(n*2,.1125,.45):.5+.5*za(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-li.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?li.easeInBounce(n*2)*.5:li.easeOutBounce(n*2-1)*.5+.5};function _r(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ha(n){return _r(n)?n:new ii(n)}function xr(n){return _r(n)?n:new ii(n).saturate(.5).darken(.1).hexString()}const tf=["x","y","borderWidth","radius","tension"],ef=["color","borderColor","backgroundColor"];function nf(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:ef},numbers:{type:"number",properties:tf}}),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 sf(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Wa=new Map;function rf(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Wa.get(e);return i||(i=new Intl.NumberFormat(n,t),Wa.set(e,i)),i}function ci(n,t,e){return rf(t,e).format(n)}const Ya={values(n){return ot(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=of(n,e)}const o=Xe(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ci(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?Ya.numeric.call(this,n,t,e):""}};function of(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 es={formatters:Ya};function af(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:es.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 gn=Object.create(null),wr=Object.create(null);function ui(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function kr(n,t,e){return typeof t=="string"?si(ui(n,t),e):si(ui(n,""),t)}class lf{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>xr(s.backgroundColor),this.hoverBorderColor=(i,s)=>xr(s.borderColor),this.hoverColor=(i,s)=>xr(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return kr(this,t,e)}get(t){return ui(this,t)}describe(t,e){return kr(wr,t,e)}override(t,e){return kr(gn,t,e)}route(t,e,i,s){const r=ui(this,t),o=ui(this,i),a="_"+e;Object.defineProperties(r,{[a]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=o[s];return it(l)?Object.assign({},c,l):Z(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var Tt=new lf({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[nf,sf,af]);function cf(n){return!n||tt(n.size)||tt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function ns(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function uf(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let o=0;const a=e.length;let l,c,u,d,f;for(l=0;l<a;l++)if(d=e[l],d!=null&&!ot(d))o=ns(n,s,r,o,d);else if(ot(d))for(c=0,u=d.length;c<u;c++)f=d[c],f!=null&&!ot(f)&&(o=ns(n,s,r,o,f));n.restore();const g=r.length/2;if(g>e.length){for(l=0;l<g;l++)delete s[r[l]];r.splice(0,g)}return o}function pn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Va(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Sr(n,t,e,i){ja(n,t,e,i,null)}function ja(n,t,e,i,s){let r,o,a,l,c,u,d,f;const g=t.pointStyle,p=t.rotation,y=t.radius;let _=(p||0)*mr;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(_),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,mt):n.arc(e,i,y,0,mt),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(_)*u,i-Math.cos(_)*y),_+=Qi,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*y),_+=Qi,n.lineTo(e+Math.sin(_)*u,i-Math.cos(_)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(_+he)*l,d=Math.cos(_+he)*(s?s/2-c:l),a=Math.sin(_+he)*l,f=Math.sin(_+he)*(s?s/2-c:l),n.arc(e-d,i-a,c,_-rt,_-bt),n.arc(e+f,i-o,c,_-bt,_),n.arc(e+d,i+a,c,_,_+bt),n.arc(e-f,i+o,c,_+bt,_+rt),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*y,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}_+=he;case"rectRot":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+f,i-o),n.lineTo(e+d,i+a),n.lineTo(e-f,i+o),n.closePath();break;case"crossRot":_+=he;case"cross":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"star":d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o),_+=he,d=Math.cos(_)*(s?s/2:y),o=Math.cos(_)*y,a=Math.sin(_)*y,f=Math.sin(_)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+f,i-o),n.lineTo(e-f,i+o);break;case"line":o=s?s/2:Math.cos(_)*y,a=Math.sin(_)*y,n.moveTo(e-o,i-a),n.lineTo(e+o,i+a);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(_)*(s?s/2:y),i+Math.sin(_)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Le(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 di(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function hi(n){n.restore()}function df(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function hf(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 ff(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),tt(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 gf(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),o=t-r.actualBoundingBoxLeft,a=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,u),n.lineTo(a,u),n.stroke()}}function pf(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function mn(n,t,e,i,s,r={}){const o=ot(t)?t:[t],a=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,ff(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&pf(n,r.backdrop),a&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),tt(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),gf(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function Ln(n,t){const{x:e,y:i,w:s,h:r,radius:o}=t;n.arc(e+o.topLeft,i+o.topLeft,o.topLeft,1.5*rt,rt,!0),n.lineTo(e,i+r-o.bottomLeft),n.arc(e+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,rt,bt,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,bt,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-bt,!0),n.lineTo(e+o.topLeft,i)}const mf=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,yf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function bf(n,t){const e=(""+n).match(mf);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 _f=n=>+n||0;function vr(n,t){const e={},i=it(t),s=i?Object.keys(t):t,r=it(n)?i?o=>Z(n[o],n[t[o]]):o=>n[o]:()=>n;for(const o of s)e[o]=_f(r(o));return e}function $a(n){return vr(n,{top:"y",right:"x",bottom:"y",left:"x"})}function Ke(n){return vr(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ft(n){const t=$a(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function _t(n,t){n=n||{},t=t||Tt.font;let e=Z(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=Z(n.style,t.style);i&&!(""+i).match(yf)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Z(n.family,t.family),lineHeight:bf(Z(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Z(n.weight,t.weight),string:""};return s.string=cf(s),s}function fi(n,t,e,i){let s=!0,r,o,a;for(r=0,o=n.length;r<o;++r)if(a=n[r],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),e!==void 0&&ot(a)&&(a=a[e%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function xf(n,t,e){const{min:i,max:s}=n,r=Sa(t,(s-i)/2),o=(a,l)=>e&&a===0?0:a+l;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function Ze(n,t){return Object.assign(Object.create(n),t)}function Dr(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=Ka("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Dr([a,...n],t,r,i)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete n[0][l],!0},get(a,l){return qa(a,l,()=>Cf(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return Za(a).includes(l)},ownKeys(a){return Za(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function In(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ua(n,i),setContext:r=>In(n,r,e,i),override:r=>In(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete n[o],!0},get(r,o,a){return qa(r,o,()=>kf(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(r,o,a){return n[o]=a,delete r[o],!0}})}function Ua(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Jt(e)?e:()=>e,isIndexable:Jt(i)?i:()=>i}}const wf=(n,t)=>n?n+pr(t):t,Mr=(n,t)=>it(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function qa(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function kf(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return Jt(a)&&o.isScriptable(t)&&(a=Sf(t,a,n,e)),ot(a)&&a.length&&(a=vf(t,a,n,o.isIndexable)),Mr(t,a)&&(a=In(a,s,r&&r[t],o)),a}function Sf(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_stack:a}=e;if(a.has(n))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+n);a.add(n);let l=t(r,o||i);return a.delete(n),Mr(n,l)&&(l=Tr(s._scopes,s,n,l)),l}function vf(n,t,e,i){const{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(it(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const d=Tr(c,s,n,u);t.push(In(d,r,o&&o[n],a))}}return t}function Xa(n,t,e){return Jt(n)?n(t,e):n}const Df=(n,t)=>n===!0?t:typeof n=="string"?qe(t,n):void 0;function Mf(n,t,e,i,s){for(const r of t){const o=Df(e,r);if(o){n.add(o);const a=Xa(o._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==i)return a}else if(o===!1&&typeof i<"u"&&e!==i)return null}return!1}function Tr(n,t,e,i){const s=t._rootScopes,r=Xa(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=Ga(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=Ga(a,o,r,l,i),l===null)?!1:Dr(Array.from(a),[""],s,r,()=>Tf(t,e,i))}function Ga(n,t,e,i,s){for(;e;)e=Mf(n,t,e,i,s);return e}function Tf(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return ot(s)&&it(e)?e:s||{}}function Cf(n,t,e,i){let s;for(const r of t)if(s=Ka(wf(r,n),e),typeof s<"u")return Mr(n,s)?Tr(e,i,n,s):s}function Ka(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Za(n){let t=n._keys;return t||(t=n._keys=Of(n._scopes)),t}function Of(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Qa(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,o=new Array(i);let a,l,c,u;for(a=0,l=i;a<l;++a)c=a+e,u=t[c],o[a]={r:s.parse(qe(u,r),c)};return o}const Pf=Number.EPSILON||1e-14,Nn=(n,t)=>t<n.length&&!n[t].skip&&n[t],Ja=n=>n==="x"?"y":"x";function Ef(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=An(r,s),l=An(o,r);let c=a/(a+l),u=l/(a+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const d=i*c,f=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+f*(o.x-s.x),y:r.y+f*(o.y-s.y)}}}function Rf(n,t,e){const i=n.length;let s,r,o,a,l,c=Nn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Nn(n,u+1),!(!l||!c)){if(oi(t[u],0,Pf)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),e[u]=s*o*t[u],e[u+1]=r*o*t[u])}}function Af(n,t,e="x"){const i=Ja(e),s=n.length;let r,o,a,l=Nn(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=Nn(n,c+1),!a)continue;const u=a[e],d=a[i];o&&(r=(u-o[e])/3,a[`cp1${e}`]=u-r,a[`cp1${i}`]=d-r*t[c]),l&&(r=(l[e]-u)/3,a[`cp2${e}`]=u+r,a[`cp2${i}`]=d+r*t[c])}}function Lf(n,t="x"){const e=Ja(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=Nn(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=Nn(n,o+1),!!l){if(c){const u=c[t]-l[t];s[o]=u!==0?(c[e]-l[e])/u:0}r[o]=a?c?Se(s[o-1])!==Se(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Rf(n,s,r),Af(n,r,t)}function is(n,t,e){return Math.max(Math.min(n,e),t)}function If(n,t){let e,i,s,r,o,a=Le(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Le(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=is(s.cp1x,t.left,t.right),s.cp1y=is(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=is(s.cp2x,t.left,t.right),s.cp2y=is(s.cp2y,t.top,t.bottom)))}function Nf(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Lf(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,o=n.length;r<o;++r)a=n[r],l=Ef(c,a,n[Math.min(r+1,o-(i?0:1))%o],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&If(n,e)}function Cr(){return typeof window<"u"&&typeof document<"u"}function Or(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ss(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 rs=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Ff(n,t){return rs(n).getPropertyValue(t)}const Bf=["top","right","bottom","left"];function yn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Bf[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const zf=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Hf(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(zf(s,r,n.target))a=s,l=r;else{const c=t.getBoundingClientRect();a=i.clientX-c.left,l=i.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function Qe(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=rs(e),r=s.boxSizing==="border-box",o=yn(s,"padding"),a=yn(s,"border","width"),{x:l,y:c,box:u}=Hf(n,e),d=o.left+(u&&a.left),f=o.top+(u&&a.top);let{width:g,height:p}=t;return r&&(g-=o.width+a.width,p-=o.height+a.height),{x:Math.round((l-d)/g*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Wf(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Or(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=rs(r),l=yn(a,"border","width"),c=yn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=ss(a.maxWidth,r,"clientWidth"),s=ss(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||Zi,maxHeight:s||Zi}}const os=n=>Math.round(n*10)/10;function Yf(n,t,e,i){const s=rs(n),r=yn(s,"margin"),o=ss(s.maxWidth,n,"clientWidth")||Zi,a=ss(s.maxHeight,n,"clientHeight")||Zi,l=Wf(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=yn(s,"border","width"),g=yn(s,"padding");c-=g.width+f.width,u-=g.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=os(Math.min(c,o,l.maxWidth)),u=os(Math.min(u,a,l.maxHeight)),c&&!u&&(u=os(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=os(Math.floor(u*i))),{width:c,height:u}}function tl(n,t,e){const i=t||1,s=Math.floor(n.height*i),r=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const o=n.canvas;return o.style&&(e||!o.style.height&&!o.style.width)&&(o.style.height=`${n.height}px`,o.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(n.currentDevicePixelRatio=i,o.height=s,o.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Vf=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};Cr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function el(n,t){const e=Ff(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function bn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function jf(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 $f(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=bn(n,s,e),a=bn(s,r,e),l=bn(r,t,e),c=bn(o,a,e),u=bn(a,l,e);return bn(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}}},qf=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Fn(n,t,e){return n?Uf(t,e):qf()}function nl(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 il(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function sl(n){return n==="angle"?{between:ai,compare:qh,normalize:ce}:{between:Re,compare:(t,e)=>t-e,normalize:t=>t}}function rl({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Xf(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=sl(i),l=t.length;let{start:c,end:u,loop:d}=n,f,g;if(d){for(c+=l,u+=l,f=0,g=l;f<g&&o(a(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function ol(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=sl(i),{start:u,end:d,loop:f,style:g}=Xf(n,t,e),p=[];let y=!1,_=null,w,S,v;const P=()=>l(s,v,w)&&a(s,v)!==0,M=()=>a(r,w)===0||l(r,v,w),C=()=>y||P(),T=()=>!y||M();for(let b=u,x=u;b<=d;++b)S=t[b%o],!S.skip&&(w=c(S[i]),w!==v&&(y=l(w,s,r),_===null&&C()&&(_=a(w,s)===0?b:x),_!==null&&T()&&(p.push(rl({start:_,end:b,loop:f,count:o,style:g})),_=null),x=b,v=w));return _!==null&&p.push(rl({start:_,end:d,loop:f,count:o,style:g})),p}function al(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=ol(i[s],n.points,t);r.length&&e.push(...r)}return e}function Gf(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Kf(n,t,e,i){const s=n.length,r=[];let o=t,a=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?a.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=o=c.stop?l:null):(o=l,a.skip&&(t=l)),a=c}return o!==null&&r.push({start:t%s,end:o%s,loop:i}),r}function Zf(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=Gf(e,s,r,i);if(i===!0)return ll(n,[{start:o,end:a,loop:r}],e,t);const l=a<o?a+s:a,c=!!n._fullLoop&&o===0&&a===s-1;return ll(n,Kf(e,o,l,c),e,t)}function ll(n,t,e,i){return!i||!i.setContext||!e?t:Qf(n,t,e,i)}function Qf(n,t,e,i){const s=n._chart.getContext(),r=cl(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,f=d;function g(p,y,_,w){const S=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=S;for(;e[y%l].skip;)y+=S;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:_,style:w}),u=w,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],_;for(f=d+1;f<=p.end;f++){const w=e[f%l];_=cl(i.setContext(Ze(s,{type:"segment",p0:y,p1:w,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:o}))),Jf(_,u)&&g(d,f-1,p.loop,u),y=w,u=_}d<f-1&&g(d,f-1,p.loop,u)}return c}function cl(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Jf(n,t){if(!t)return!1;const e=[],i=function(s,r){return _r(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
12
12
  * Chart.js v4.4.3
13
13
  * https://www.chartjs.org
14
14
  * (c) 2024 Chart.js Contributors
15
15
  * Released under the MIT License
16
- */class cm{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,r,i){const a=e.listeners[i],s=e.duration;a.forEach(o=>o({chart:t,initial:e.initial,numSteps:s,currentStep:Math.min(r-e.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Tc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((r,i)=>{if(!r.running||!r.items.length)return;const a=r.items;let s=a.length-1,o=!1,l;for(;s>=0;--s)l=a[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),o=!0):(a[s]=a[a.length-1],a.pop());o&&(i.draw(),this._notify(i,r,t,"progress")),a.length||(r.running=!1,this._notify(i,r,t,"complete"),r.initial=!1),e+=a.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let r=e.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,r)),r}listen(t,e,r){this._getAnims(t).listeners[e].push(r)}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((r,i)=>Math.max(r,i._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 r=e.items;let i=r.length-1;for(;i>=0;--i)r[i].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Xe=new cm;const Jc="transparent",um={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const r=Oc(n||Jc),i=r.valid&&Oc(t||Jc);return i&&i.valid?i.mix(r,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class dm{constructor(t,e,r,i){const a=e[r];i=Rr([t.to,i,a,t.from]);const s=Rr([t.from,a,i]);this._active=!0,this._fn=t.fn||um[t.type||typeof s],this._easing=kr[t.easing]||kr.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=r,this._from=s,this._to=i,this._promises=void 0}active(){return this._active}update(t,e,r){if(this._active){this._notify(!1);const i=this._target[this._prop],a=r-this._start,s=this._duration-a;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=a,this._loop=!!t.loop,this._to=Rr([t.to,e,i,t.from]),this._from=Rr([t.from,i,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,r=this._duration,i=this._prop,a=this._from,s=this._loop,o=this._to;let l;if(this._active=a!==o&&(s||e<r),!this._active){this._target[i]=o,this._notify(!0);return}if(e<0){this._target[i]=a;return}l=e/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(a,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,r)=>{t.push({res:e,rej:r})})}_notify(t){const e=t?"res":"rej",r=this._promises||[];for(let i=0;i<r.length;i++)r[i][e]()}}class Ja{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!lt(t))return;const e=Object.keys(Ut.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const a=t[i];if(!lt(a))return;const s={};for(const o of e)s[o]=a[o];(mt(a.properties)&&a.properties||[i]).forEach(o=>{(o===i||!r.has(o))&&r.set(o,s)})})}_animateOptions(t,e){const r=e.options,i=hm(t,r);if(!i)return[];const a=this._createAnimations(i,r);return r.$shared&&fm(t.options.$animations,r).then(()=>{t.options=r},()=>{}),a}_createAnimations(t,e){const r=this._properties,i=[],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"){i.push(...this._animateOptions(t,e));continue}const u=e[c];let d=a[c];const f=r.get(c);if(d)if(f&&d.active()){d.update(f,u,o);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}a[c]=d=new dm(f,t,c,u),i.push(d)}return i}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const r=this._createAnimations(t,e);if(r.length)return Xe.add(this._chart,r),!0}}function fm(n,t){const e=[],r=Object.keys(t);for(let i=0;i<r.length;i++){const a=n[r[i]];a&&a.active()&&e.push(a.wait())}return Promise.all(e)}function hm(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 tu(n,t){const e=n&&n.options||{},r=e.reverse,i=e.min===void 0?t:0,a=e.max===void 0?t:0;return{start:r?a:i,end:r?i:a}}function pm(n,t,e){if(e===!1)return!1;const r=tu(n,e),i=tu(t,e);return{top:i.end,right:r.end,bottom:i.start,left:r.start}}function gm(n){let t,e,r,i;return lt(n)?(t=n.top,e=n.right,r=n.bottom,i=n.left):t=e=r=i=n,{top:t,right:e,bottom:r,left:i,disabled:n===!1}}function eu(n,t){const e=[],r=n._getSortedDatasetMetas(t);let i,a;for(i=0,a=r.length;i<a;++i)e.push(r[i].index);return e}function nu(n,t,e,r={}){const i=n.keys,a=r.mode==="single";let s,o,l,c;if(t!==null){for(s=0,o=i.length;s<o;++s){if(l=+i[s],l===e){if(r.all)continue;break}c=n.values[l],It(c)&&(a||t===0||Le(t)===Le(c))&&(t+=c)}return t}}function mm(n,t){const{iScale:e,vScale:r}=t,i=e.axis==="x"?"x":"y",a=r.axis==="x"?"x":"y",s=Object.keys(n),o=new Array(s.length);let l,c,u;for(l=0,c=s.length;l<c;++l)u=s[l],o[l]={[i]:u,[a]:n[u]};return o}function ru(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function ym(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function vm(n){const{min:t,max:e,minDefined:r,maxDefined:i}=n.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:i?e:Number.POSITIVE_INFINITY}}function bm(n,t,e){const r=n[t]||(n[t]={});return r[e]||(r[e]={})}function iu(n,t,e,r){for(const i of t.getMatchingVisibleMetas(r).reverse()){const a=n[i.index];if(e&&a>0||!e&&a<0)return i.index}return null}function au(n,t){const{chart:e,_cachedMeta:r}=n,i=e._stacks||(e._stacks={}),{iScale:a,vScale:s,index:o}=r,l=a.axis,c=s.axis,u=ym(a,s,r),d=t.length;let f;for(let p=0;p<d;++p){const y=t[p],{[l]:x,[c]:g}=y,m=y._stacks||(y._stacks={});f=m[c]=bm(i,u,x),f[o]=g,f._top=iu(f,s,!0,r.type),f._bottom=iu(f,s,!1,r.type);const v=f._visualValues||(f._visualValues={});v[o]=g}}function ts(n,t){const e=n.scales;return Object.keys(e).filter(r=>e[r].axis===t).shift()}function xm(n,t){return fn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function _m(n,t,e){return fn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ar(n,t){const e=n.controller.index,r=n.vScale&&n.vScale.axis;if(r){t=t||n._parsed;for(const i of t){const a=i._stacks;if(!a||a[r]===void 0||a[r][e]===void 0)return;delete a[r][e],a[r]._visualValues!==void 0&&a[r]._visualValues[e]!==void 0&&delete a[r]._visualValues[e]}}}const es=n=>n==="reset"||n==="none",su=(n,t)=>t?n:Object.assign({},n),wm=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:eu(e,!0),values:null};class Oe{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=ru(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&&Ar(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,r=this.getDataset(),i=(d,f,p,y)=>d==="x"?f:d==="r"?y:p,a=e.xAxisID=rt(r.xAxisID,ts(t,"x")),s=e.yAxisID=rt(r.yAxisID,ts(t,"y")),o=e.rAxisID=rt(r.rAxisID,ts(t,"r")),l=e.indexAxis,c=e.iAxisID=i(l,a,s,o),u=e.vAxisID=i(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&&_c(this._data,this),t._stacked&&Ar(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),r=this._data;if(lt(e)){const i=this._cachedMeta;this._data=mm(e,i)}else if(r!==e){if(r){_c(r,this);const i=this._cachedMeta;Ar(i),i._parsed=[]}e&&Object.isExtensible(e)&&og(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,r=this.getDataset();let i=!1;this._dataCheck();const a=e._stacked;e._stacked=ru(e.vScale,e),e.stack!==r.stack&&(i=!0,Ar(e),e.stack=r.stack),this._resyncElements(t),(i||a!==e._stacked)&&au(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:r,_data:i}=this,{iScale:a,_stacked:s}=r,o=a.axis;let l=t===0&&e===i.length?!0:r._sorted,c=t>0&&r._parsed[t-1],u,d,f;if(this._parsing===!1)r._parsed=i,r._sorted=!0,f=i;else{mt(i[t])?f=this.parseArrayData(r,i,t,e):lt(i[t])?f=this.parseObjectData(r,i,t,e):f=this.parsePrimitiveData(r,i,t,e);const p=()=>d[o]===null||c&&d[o]<c[o];for(u=0;u<e;++u)r._parsed[u+t]=d=f[u],l&&(p()&&(l=!1),c=d);r._sorted=l}s&&au(this,f)}parsePrimitiveData(t,e,r,i){const{iScale:a,vScale:s}=t,o=a.axis,l=s.axis,c=a.getLabels(),u=a===s,d=new Array(i);let f,p,y;for(f=0,p=i;f<p;++f)y=f+r,d[f]={[o]:u||a.parse(c[y],y),[l]:s.parse(e[y],y)};return d}parseArrayData(t,e,r,i){const{xScale:a,yScale:s}=t,o=new Array(i);let l,c,u,d;for(l=0,c=i;l<c;++l)u=l+r,d=e[u],o[l]={x:a.parse(d[0],u),y:s.parse(d[1],u)};return o}parseObjectData(t,e,r,i){const{xScale:a,yScale:s}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(i);let u,d,f,p;for(u=0,d=i;u<d;++u)f=u+r,p=e[f],c[u]={x:a.parse(ln(p,o),f),y:s.parse(ln(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,r){const i=this.chart,a=this._cachedMeta,s=e[t.axis],o={keys:eu(i,!0),values:e._stacks[t.axis]._visualValues};return nu(o,s,a.index,{mode:r})}updateRangeFromParsed(t,e,r,i){const a=r[e.axis];let s=a===null?NaN:a;const o=i&&r._stacks[e.axis];i&&o&&(i.values=o,s=nu(i,a,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,e){const r=this._cachedMeta,i=r._parsed,a=r._sorted&&t===r.iScale,s=i.length,o=this._getOtherScale(t),l=wm(e,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=vm(o);let f,p;function y(){p=i[f];const x=p[o.axis];return!It(p[t.axis])||u>x||d<x}for(f=0;f<s&&!(!y()&&(this.updateRangeFromParsed(c,t,p,l),a));++f);if(a){for(f=s-1;f>=0;--f)if(!y()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,r=[];let i,a,s;for(i=0,a=e.length;i<a;++i)s=e[i][t.axis],It(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,r=e.iScale,i=e.vScale,a=this.getParsed(t);return{label:r?""+r.getLabelForValue(a[r.axis]):"",value:i?""+i.getLabelForValue(a[i.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=gm(rt(this.options.clip,pm(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,r=this._cachedMeta,i=r.data||[],a=e.chartArea,s=[],o=this._drawStart||0,l=this._drawCount||i.length-o,c=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(t,a,o,l),u=o;u<o+l;++u){const d=i[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 r=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,e,r){const i=this.getDataset();let a;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];a=s.$context||(s.$context=_m(this.getContext(),t,s)),a.parsed=this.getParsed(t),a.raw=i.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=xm(this.chart.getContext(),this.index)),a.dataset=i,a.index=a.datasetIndex=this.index;return a.active=!!e,a.mode=r,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",r){const i=e==="active",a=this._cachedDataOpts,s=t+"-"+e,o=a[s],l=this.enableOptionSharing&&de(r);if(o)return su(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=i?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),p=Object.keys(Ut.elements[t]),y=()=>this.getContext(r,i,e),x=c.resolveNamedOptions(f,p,y,d);return x.$shared&&(x.$shared=l,a[s]=Object.freeze(su(x,l))),x}_resolveAnimations(t,e,r){const i=this.chart,a=this._cachedDataOpts,s=`animation-${e}`,o=a[s];if(o)return o;let l;if(i.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,r,e))}const c=new Ja(i,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||es(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const r=this.resolveDataElementOptions(t,e),i=this._sharedOptions,a=this.getSharedOptions(r),s=this.includeOptions(e,a)||a!==i;return this.updateSharedOptions(a,e,r),{sharedOptions:a,includeOptions:s}}updateElement(t,e,r,i){es(i)?Object.assign(t,r):this._resolveAnimations(e,i).update(t,r)}updateSharedOptions(t,e,r){t&&!es(e)&&this._resolveAnimations(void 0,e).update(t,r)}_setStyle(t,e,r,i){t.active=i;const a=this.getStyle(e,i);this._resolveAnimations(e,r,i).update(t,{options:!i&&this.getSharedOptions(a)||a})}removeHoverStyle(t,e,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,e,r){this._setStyle(t,r,"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,r=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const i=r.length,a=e.length,s=Math.min(a,i);s&&this.parse(0,s),a>i?this._insertElements(i,a-i,t):a<i&&this._removeElements(a,i-a)}_insertElements(t,e,r=!0){const i=this._cachedMeta,a=i.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(i._parsed),this.parse(t,e),r&&this.updateElements(a,t,e,"reset")}updateElements(t,e,r,i){}_removeElements(t,e){const r=this._cachedMeta;if(this._parsing){const i=r._parsed.splice(t,e);r._stacked&&Ar(r,i)}r.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,r,i]=t;this[e](r,i)}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 r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}H(Oe,"defaults",{}),H(Oe,"datasetElementType",null),H(Oe,"dataElementType",null);function Tm(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let r=[];for(let i=0,a=e.length;i<a;i++)r=r.concat(e[i].controller.getAllParsedValues(n));n._cache.$bar=wc(r.sort((i,a)=>i-a))}return n._cache.$bar}function Mm(n){const t=n.iScale,e=Tm(t,n.type);let r=t._length,i,a,s,o;const l=()=>{s===32767||s===-32768||(de(o)&&(r=Math.min(r,Math.abs(s-o)||r)),o=s)};for(i=0,a=e.length;i<a;++i)s=t.getPixelForValue(e[i]),l();for(o=void 0,i=0,a=t.ticks.length;i<a;++i)s=t.getPixelForTick(i),l();return r}function Dm(n,t,e,r){const i=e.barThickness;let a,s;return st(i)?(a=t.min*e.categoryPercentage,s=e.barPercentage):(a=i*r,s=1),{chunk:a/r,ratio:s,start:t.pixels[n]-a/2}}function Sm(n,t,e,r){const i=t.pixels,a=i[n];let s=n>0?i[n-1]:null,o=n<i.length-1?i[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/r,ratio:e.barPercentage,start:c}}function km(n,t,e,r){const i=e.parse(n[0],r),a=e.parse(n[1],r),s=Math.min(i,a),o=Math.max(i,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:i,end:a,min:s,max:o}}function ou(n,t,e,r){return mt(n)?km(n,t,e,r):t[e.axis]=e.parse(n,r),t}function lu(n,t,e,r){const i=n.iScale,a=n.vScale,s=i.getLabels(),o=i===a,l=[];let c,u,d,f;for(c=e,u=e+r;c<u;++c)f=t[c],d={},d[i.axis]=o||i.parse(s[c],c),l.push(ou(f,d,a,c));return l}function ns(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Cm(n,t,e){return n!==0?Le(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Om(n){let t,e,r,i,a;return n.horizontal?(t=n.base>n.x,e="left",r="right"):(t=n.base<n.y,e="bottom",r="top"),t?(i="end",a="start"):(i="start",a="end"),{start:e,end:r,reverse:t,top:i,bottom:a}}function Pm(n,t,e,r){let i=t.borderSkipped;const a={};if(!i){n.borderSkipped=a;return}if(i===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:o,reverse:l,top:c,bottom:u}=Om(n);i==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===r?i=c:(e._bottom||0)===r?i=u:(a[cu(u,s,o,l)]=!0,i=c)),a[cu(i,s,o,l)]=!0,n.borderSkipped=a}function cu(n,t,e,r){return r?(n=Em(n,t,e),n=uu(n,e,t)):n=uu(n,t,e),n}function Em(n,t,e){return n===t?e:n===e?t:n}function uu(n,t,e){return n==="start"?t:n==="end"?e:n}function Rm(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Lr extends Oe{parsePrimitiveData(t,e,r,i){return lu(t,e,r,i)}parseArrayData(t,e,r,i){return lu(t,e,r,i)}parseObjectData(t,e,r,i){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 f,p,y,x;for(f=r,p=r+i;f<p;++f)x=e[f],y={},y[a.axis]=a.parse(ln(x,c),f),d.push(ou(ln(x,u),y,s,f));return d}updateRangeFromParsed(t,e,r,i){super.updateRangeFromParsed(t,e,r,i);const a=r._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:r,vScale:i}=e,a=this.getParsed(t),s=a._custom,o=ns(s)?"["+s.start+", "+s.end+"]":""+i.getLabelForValue(a[i.axis]);return{label:""+r.getLabelForValue(a[r.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,r,i){const a=i==="reset",{index:s,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,i);for(let p=e;p<e+r;p++){const y=this.getParsed(p),x=a||st(y[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),g=this._calculateBarIndexPixels(p,u),m=(y._stacks||{})[o.axis],v={horizontal:c,base:x.base,enableBorderRadius:!m||ns(y._custom)||s===m._top||s===m._bottom,x:c?x.head:g.center,y:c?g.center:x.head,height:c?g.size:Math.abs(x.size),width:c?Math.abs(x.size):g.size};f&&(v.options=d||this.resolveDataElementOptions(p,t[p].active?"active":i));const b=v.options||t[p].options;Pm(v,b,m,s),Rm(v,b,u.ratio),this.updateElement(t[p],p,v,i)}}_getStacks(t,e){const{iScale:r}=this._cachedMeta,i=r.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),a=r.options.stacked,s=[],o=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(st(u)||isNaN(u))return!0};for(const l of i)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,r){const i=this._getStacks(t,r),a=e!==void 0?i.indexOf(e):-1;return a===-1?i.length-1:a}_getRuler(){const t=this.options,e=this._cachedMeta,r=e.iScale,i=[];let a,s;for(a=0,s=e.data.length;a<s;++a)i.push(r.getPixelForValue(this.getParsed(a)[r.axis],a));const o=t.barThickness;return{min:o||Mm(e),pixels:i,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:r,index:i},options:{base:a,minBarLength:s}}=this,o=a||0,l=this.getParsed(t),c=l._custom,u=ns(c);let d=l[e.axis],f=0,p=r?this.applyStack(e,l,r):d,y,x;p!==d&&(f=p-d,p=d),u&&(d=c.barStart,p=c.barEnd-c.barStart,d!==0&&Le(d)!==Le(c.barEnd)&&(f=0),f+=d);const g=!st(a)&&!u?a:f;let m=e.getPixelForValue(g);if(this.chart.getDataVisibility(t)?y=e.getPixelForValue(f+p):y=m,x=y-m,Math.abs(x)<s){x=Cm(x,e,o)*s,d===o&&(m-=x/2);const v=e.getPixelForDecimal(0),b=e.getPixelForDecimal(1),w=Math.min(v,b),T=Math.max(v,b);m=Math.max(Math.min(m,T),w),y=m+x,r&&!u&&(l._stacks[e.axis]._visualValues[i]=e.getValueForPixel(y)-e.getValueForPixel(m))}if(m===e.getPixelForValue(o)){const v=Le(x)*e.getLineWidthForValue(o)/2;m+=v,x-=v}return{size:x,base:m,head:y,center:y+x/2}}_calculateBarIndexPixels(t,e){const r=e.scale,i=this.options,a=i.skipNull,s=rt(i.maxBarThickness,1/0);let o,l;if(e.grouped){const c=a?this._getStackCount(t):e.stackCount,u=i.barThickness==="flex"?Sm(t,e,i,c):Dm(t,e,i,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=r.getPixelForValue(this.getParsed(t)[r.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,r=t.data,i=r.length;let a=0;for(;a<i;++a)this.getParsed(a)[e.axis]!==null&&!r[a].hidden&&r[a].draw(this._ctx)}}H(Lr,"id","bar"),H(Lr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),H(Lr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Oi extends Oe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,r,i){const a=super.parsePrimitiveData(t,e,r,i);for(let s=0;s<a.length;s++)a[s]._custom=this.resolveDataElementOptions(s+r).radius;return a}parseArrayData(t,e,r,i){const a=super.parseArrayData(t,e,r,i);for(let s=0;s<a.length;s++){const o=e[r+s];a[s]._custom=rt(o[2],this.resolveDataElementOptions(s+r).radius)}return a}parseObjectData(t,e,r,i){const a=super.parseObjectData(t,e,r,i);for(let s=0;s<a.length;s++){const o=e[r+s];a[s]._custom=rt(o&&o.r&&+o.r,this.resolveDataElementOptions(s+r).radius)}return a}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let r=t.length-1;r>=0;--r)e=Math.max(e,t[r].size(this.resolveDataElementOptions(r))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:a}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),l=a.getLabelForValue(s.y),c=s._custom;return{label:r[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,i),u=s.axis,d=o.axis;for(let f=e;f<e+r;f++){const p=t[f],y=!a&&this.getParsed(f),x={},g=x[u]=a?s.getPixelForDecimal(.5):s.getPixelForValue(y[u]),m=x[d]=a?o.getBasePixel():o.getPixelForValue(y[d]);x.skip=isNaN(g)||isNaN(m),c&&(x.options=l||this.resolveDataElementOptions(f,p.active?"active":i),a&&(x.options.radius=0)),this.updateElement(p,f,x,i)}}resolveDataElementOptions(t,e){const r=this.getParsed(t);let i=super.resolveDataElementOptions(t,e);i.$shared&&(i=Object.assign({},i,{$shared:!1}));const a=i.radius;return e!=="active"&&(i.radius=0),i.radius+=rt(r&&r._custom,a),i}}H(Oi,"id","bubble"),H(Oi,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),H(Oi,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Am(n,t,e){let r=1,i=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),f=Math.sin(l),p=(b,w,T)=>Sr(b,o,l,!0)?1:Math.max(w,w*e,T,T*e),y=(b,w,T)=>Sr(b,o,l,!0)?-1:Math.min(w,w*e,T,T*e),x=p(0,c,d),g=p(Et,u,f),m=y(dt,c,d),v=y(dt+Et,u,f);r=(x-m)/2,i=(g-v)/2,a=-(x+m)/2,s=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:s}}class pn extends Oe{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 r=this.getDataset().data,i=this._cachedMeta;if(this._parsing===!1)i._parsed=r;else{let a=l=>+r[l];if(lt(r[t])){const{key:l="value"}=this._parsing;a=c=>+ln(r[c],l)}let s,o;for(s=t,o=t+e;s<o;++s)i._parsed[s]=a(s)}}_getRotation(){return Xt(this.options.rotation-90)}_getCircumference(){return Xt(this.options.circumference)}_getRotationExtents(){let t=Ct,e=-Ct;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const i=this.chart.getDatasetMeta(r).controller,a=i._getRotation(),s=i._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:r}=e,i=this._cachedMeta,a=i.data,s=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,o=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(Xp(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:y,offsetY:x}=Am(d,u,l),g=(r.width-s)/f,m=(r.height-s)/p,v=Math.max(Math.min(g,m)/2,0),b=fc(this.options.radius,v),w=Math.max(b*l,0),T=(b-w)/this._getVisibleDatasetWeightTotal();this.offsetX=y*b,this.offsetY=x*b,i.total=this.calculateTotal(),this.outerRadius=b-T*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-T*c,0),this.updateElements(a,0,a.length,t)}_circumference(t,e){const r=this.options,i=this._cachedMeta,a=this._getCircumference();return e&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||i._parsed[t]===null||i.data[t].hidden?0:this.calculateCircumference(i._parsed[t]*a/Ct)}updateElements(t,e,r,i){const a=i==="reset",s=this.chart,o=s.chartArea,c=s.options.animation,u=(o.left+o.right)/2,d=(o.top+o.bottom)/2,f=a&&c.animateScale,p=f?0:this.innerRadius,y=f?0:this.outerRadius,{sharedOptions:x,includeOptions:g}=this._getSharedOptions(e,i);let m=this._getRotation(),v;for(v=0;v<e;++v)m+=this._circumference(v,a);for(v=e;v<e+r;++v){const b=this._circumference(v,a),w=t[v],T={x:u+this.offsetX,y:d+this.offsetY,startAngle:m,endAngle:m+b,circumference:b,outerRadius:y,innerRadius:p};g&&(T.options=x||this.resolveDataElementOptions(v,w.active?"active":i)),m+=b,this.updateElement(w,v,T,i)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let r=0,i;for(i=0;i<e.length;i++){const a=t._parsed[i];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(i)&&!e[i].hidden&&(r+=Math.abs(a))}return r}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Cr(e._parsed[t],r.options.locale);return{label:i[t]||"",value:a}}getMaxBorderWidth(t){let e=0;const r=this.chart;let i,a,s,o,l;if(!t){for(i=0,a=r.data.datasets.length;i<a;++i)if(r.isDatasetVisible(i)){s=r.getDatasetMeta(i),t=s.data,o=s.controller;break}}if(!t)return 0;for(i=0,a=t.length;i<a;++i)l=o.resolveDataElementOptions(i),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let r=0,i=t.length;r<i;++r){const a=this.resolveDataElementOptions(r);e=Math.max(e,a.offset||0,a.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(e+=this._getRingWeight(r));return e}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}H(pn,"id","doughnut"),H(pn,"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"}),H(pn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),H(pn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:r,color:i}}=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:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,r){r.chart.toggleDataVisibility(e.index),r.chart.update()}}}});class Ir extends Oe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:r,data:i=[],_dataset:a}=e,s=this.chart._animationsDisabled;let{start:o,count:l}=Dc(e,i,s);this._drawStart=o,this._drawCount=l,Sc(e)&&(o=0,l=i.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t),this.updateElements(i,o,l,t)}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,i),f=s.axis,p=o.axis,{spanGaps:y,segment:x}=this.options,g=un(y)?y:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||a||i==="none",v=e+r,b=t.length;let w=e>0&&this.getParsed(e-1);for(let T=0;T<b;++T){const S=t[T],C=m?S:{};if(T<e||T>=v){C.skip=!0;continue}const M=this.getParsed(T),D=st(M[p]),O=C[f]=s.getPixelForValue(M[f],T),P=C[p]=a||D?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,M,l):M[p],T);C.skip=isNaN(O)||isNaN(P)||D,C.stop=T>0&&Math.abs(M[f]-w[f])>g,x&&(C.parsed=M,C.raw=c.data[T]),d&&(C.options=u||this.resolveDataElementOptions(T,S.active?"active":i)),m||this.updateElement(S,T,C,i),w=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,r=e.options&&e.options.borderWidth||0,i=t.data||[];if(!i.length)return r;const a=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(r,a,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}H(Ir,"id","line"),H(Ir,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),H(Ir,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Nr extends Oe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,r=this.chart,i=r.data.labels||[],a=Cr(e._parsed[t].r,r.options.locale);return{label:i[t]||"",value:a}}parseObjectData(t,e,r,i){return zc.bind(this)(t,e,r,i)}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((r,i)=>{const a=this.getParsed(i).r;!isNaN(a)&&this.chart.getDataVisibility(i)&&(a<e.min&&(e.min=a),a>e.max&&(e.max=a))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,r=t.options,i=Math.min(e.right-e.left,e.bottom-e.top),a=Math.max(i/2,0),s=Math.max(r.cutoutPercentage?a/100*r.cutoutPercentage:1,0),o=(a-s)/t.getVisibleDatasetCount();this.outerRadius=a-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,r,i){const a=i==="reset",s=this.chart,l=s.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let p=f,y;const x=360/this.countVisibleElements();for(y=0;y<e;++y)p+=this._computeAngle(y,i,x);for(y=e;y<e+r;y++){const g=t[y];let m=p,v=p+this._computeAngle(y,i,x),b=s.getDataVisibility(y)?c.getDistanceFromCenterForValue(this.getParsed(y).r):0;p=v,a&&(l.animateScale&&(b=0),l.animateRotate&&(m=v=f));const w={x:u,y:d,innerRadius:0,outerRadius:b,startAngle:m,endAngle:v,options:this.resolveDataElementOptions(y,g.active?"active":i)};this.updateElement(g,y,w,i)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((r,i)=>{!isNaN(this.getParsed(i).r)&&this.chart.getDataVisibility(i)&&e++}),e}_computeAngle(t,e,r){return this.chart.getDataVisibility(t)?Xt(this.resolveDataElementOptions(t,e).angle||r):0}}H(Nr,"id","polarArea"),H(Nr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),H(Nr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:r,color:i}}=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:i,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,e,r){r.chart.toggleDataVisibility(e.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class rs extends pn{}H(rs,"id","pie"),H(rs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Pi extends Oe{getLabelAndValue(t){const e=this._cachedMeta.vScale,r=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(r[e.axis])}}parseObjectData(t,e,r,i){return zc.bind(this)(t,e,r,i)}update(t){const e=this._cachedMeta,r=e.dataset,i=e.data||[],a=e.iScale.getLabels();if(r.points=i,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const o={_loop:!0,_fullLoop:a.length===i.length,options:s};this.updateElement(r,void 0,o,t)}this.updateElements(i,0,i.length,t)}updateElements(t,e,r,i){const a=this._cachedMeta.rScale,s=i==="reset";for(let o=e;o<e+r;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":i),u=a.getPointPositionForValue(o,this.getParsed(o).r),d=s?a.xCenter:u.x,f=s?a.yCenter:u.y,p={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,o,p,i)}}}H(Pi,"id","radar"),H(Pi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),H(Pi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Ei extends Oe{getLabelAndValue(t){const e=this._cachedMeta,r=this.chart.data.labels||[],{xScale:i,yScale:a}=e,s=this.getParsed(t),o=i.getLabelForValue(s.x),l=a.getLabelForValue(s.y);return{label:r[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:r=[]}=e,i=this.chart._animationsDisabled;let{start:a,count:s}=Dc(e,r,i);if(this._drawStart=a,this._drawCount=s,Sc(e)&&(a=0,s=r.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=r;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!i,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(r,a,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,r,i){const a=i==="reset",{iScale:s,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,i),d=this.getSharedOptions(u),f=this.includeOptions(i,d),p=s.axis,y=o.axis,{spanGaps:x,segment:g}=this.options,m=un(x)?x:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||a||i==="none";let b=e>0&&this.getParsed(e-1);for(let w=e;w<e+r;++w){const T=t[w],S=this.getParsed(w),C=v?T:{},M=st(S[y]),D=C[p]=s.getPixelForValue(S[p],w),O=C[y]=a||M?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,S,l):S[y],w);C.skip=isNaN(D)||isNaN(O)||M,C.stop=w>0&&Math.abs(S[p]-b[p])>m,g&&(C.parsed=S,C.raw=c.data[w]),f&&(C.options=d||this.resolveDataElementOptions(w,T.active?"active":i)),v||this.updateElement(T,w,C,i),b=S}this.updateSharedOptions(d,i,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 r=t.dataset,i=r.options&&r.options.borderWidth||0;if(!e.length)return i;const a=e[0].size(this.resolveDataElementOptions(0)),s=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(i,a,s)/2}}H(Ei,"id","scatter"),H(Ei,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),H(Ei,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Lm=Object.freeze({__proto__:null,BarController:Lr,BubbleController:Oi,DoughnutController:pn,LineController:Ir,PieController:rs,PolarAreaController:Nr,RadarController:Pi,ScatterController:Ei});function Ln(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class is{constructor(t){H(this,"options");this.options=t||{}}static override(t){Object.assign(is.prototype,t)}init(){}formats(){return Ln()}parse(){return Ln()}format(){return Ln()}add(){return Ln()}diff(){return Ln()}startOf(){return Ln()}endOf(){return Ln()}}var du={_date:is};function Im(n,t,e,r){const{controller:i,data:a,_sorted:s}=n,o=i._cachedMeta.iScale;if(o&&t===o.axis&&t!=="r"&&s&&a.length){const l=o._reversePixels?ag:Ve;if(r){if(i._sharedOptions){const c=a[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(a,t,e-u),f=l(a,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(a,t,e)}return{lo:0,hi:a.length-1}}function Fr(n,t,e,r,i){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:f}=Im(a[o],t,s,i);for(let p=d;p<=f;++p){const y=u[p];y.skip||r(y,c,p)}}}function Nm(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(r,i){const a=t?Math.abs(r.x-i.x):0,s=e?Math.abs(r.y-i.y):0;return Math.sqrt(Math.pow(a,2)+Math.pow(s,2))}}function as(n,t,e,r,i){const a=[];return!i&&!n.isPointInArea(t)||Fr(n,e,t,function(o,l,c){!i&&!qe(o,n.chartArea,0)||o.inRange(t.x,t.y,r)&&a.push({element:o,datasetIndex:l,index:c})},!0),a}function Fm(n,t,e,r){let i=[];function a(s,o,l){const{startAngle:c,endAngle:u}=s.getProps(["startAngle","endAngle"],r),{angle:d}=bc(s,{x:t.x,y:t.y});Sr(d,c,u)&&i.push({element:s,datasetIndex:o,index:l})}return Fr(n,e,t,a),i}function Um(n,t,e,r,i,a){let s=[];const o=Nm(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const p=u.inRange(t.x,t.y,i);if(r&&!p)return;const y=u.getCenterPoint(i);if(!(!!a||n.isPointInArea(y))&&!p)return;const g=o(t,y);g<l?(s=[{element:u,datasetIndex:d,index:f}],l=g):g===l&&s.push({element:u,datasetIndex:d,index:f})}return Fr(n,e,t,c),s}function ss(n,t,e,r,i,a){return!a&&!n.isPointInArea(t)?[]:e==="r"&&!r?Fm(n,t,e,i):Um(n,t,e,r,i,a)}function fu(n,t,e,r,i){const a=[],s=e==="x"?"inXRange":"inYRange";let o=!1;return Fr(n,e,t,(l,c,u)=>{l[s](t[e],i)&&(a.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,i))}),r&&!o?[]:a}var os={evaluateInteractionItems:Fr,modes:{index(n,t,e,r){const i=hn(t,n),a=e.axis||"x",s=e.includeInvisible||!1,o=e.intersect?as(n,i,a,r,s):ss(n,i,a,!1,r,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,r){const i=hn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;let o=e.intersect?as(n,i,a,r,s):ss(n,i,a,!1,r,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,r){const i=hn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return as(n,i,a,r,s)},nearest(n,t,e,r){const i=hn(t,n),a=e.axis||"xy",s=e.includeInvisible||!1;return ss(n,i,a,e.intersect,r,s)},x(n,t,e,r){const i=hn(t,n);return fu(n,i,"x",e.intersect,r)},y(n,t,e,r){const i=hn(t,n);return fu(n,i,"y",e.intersect,r)}}};const hu=["left","top","right","bottom"];function Ur(n,t){return n.filter(e=>e.pos===t)}function pu(n,t){return n.filter(e=>hu.indexOf(e.pos)===-1&&e.box.axis===t)}function Br(n,t){return n.sort((e,r)=>{const i=t?r:e,a=t?e:r;return i.weight===a.weight?i.index-a.index:i.weight-a.weight})}function Bm(n){const t=[];let e,r,i,a,s,o;for(e=0,r=(n||[]).length;e<r;++e)i=n[e],{position:a,options:{stack:s,stackWeight:o=1}}=i,t.push({index:e,box:i,pos:a,horizontal:i.isHorizontal(),weight:i.weight,stack:s&&a+s,stackWeight:o});return t}function Wm(n){const t={};for(const e of n){const{stack:r,pos:i,stackWeight:a}=e;if(!r||!hu.includes(i))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=a}return t}function zm(n,t){const e=Wm(n),{vBoxMaxWidth:r,hBoxMaxHeight:i}=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*r:l&&t.availableWidth,o.height=i):(o.width=r,o.height=u?u*i:l&&t.availableHeight)}return e}function Ym(n){const t=Bm(n),e=Br(t.filter(c=>c.box.fullSize),!0),r=Br(Ur(t,"left"),!0),i=Br(Ur(t,"right")),a=Br(Ur(t,"top"),!0),s=Br(Ur(t,"bottom")),o=pu(t,"x"),l=pu(t,"y");return{fullSize:e,leftAndTop:r.concat(a),rightAndBottom:i.concat(l).concat(s).concat(o),chartArea:Ur(t,"chartArea"),vertical:r.concat(i).concat(l),horizontal:a.concat(s).concat(o)}}function gu(n,t,e,r){return Math.max(n[e],t[e])+Math.max(n[r],t[r])}function mu(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 Hm(n,t,e,r){const{pos:i,box:a}=e,s=n.maxPadding;if(!lt(i)){e.size&&(n[i]-=e.size);const d=r[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[i]+=e.size}a.getPadding&&mu(s,a.getPadding());const o=Math.max(0,t.outerWidth-gu(s,n,"left","right")),l=Math.max(0,t.outerHeight-gu(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 $m(n){const t=n.maxPadding;function e(r){const i=Math.max(t[r]-n[r],0);return n[r]+=i,i}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function jm(n,t){const e=t.maxPadding;function r(i){const a={left:0,top:0,right:0,bottom:0};return i.forEach(s=>{a[s]=Math.max(t[s],e[s])}),a}return r(n?["left","right"]:["top","bottom"])}function Wr(n,t,e,r){const i=[];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,jm(o.horizontal,t));const{same:d,other:f}=Hm(t,e,o,r);c|=d&&i.length,u=u||f,l.fullSize||i.push(o)}return c&&Wr(i,t,e,r)||u}function Ri(n,t,e,r,i){n.top=e,n.left=t,n.right=t+r,n.bottom=e+i,n.width=r,n.height=i}function yu(n,t,e,r){const i=e.padding;let{x:a,y:s}=t;for(const o of n){const l=o.box,c=r[o.stack]||{count:1,placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const d=t.w*u,f=c.size||l.height;de(c.start)&&(s=c.start),l.fullSize?Ri(l,i.left,s,e.outerWidth-i.right-i.left,f):Ri(l,t.left+c.placed,s,d,f),c.start=s,c.placed+=d,s=l.bottom}else{const d=t.h*u,f=c.size||l.width;de(c.start)&&(a=c.start),l.fullSize?Ri(l,a,i.top,f,e.outerHeight-i.bottom-i.top):Ri(l,a,t.top+c.placed,f,d),c.start=a,c.placed+=d,a=l.right}}t.x=a,t.y=s}var ie={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,r){if(!n)return;const i=Gt(n.options.layout.padding),a=Math.max(t-i.width,0),s=Math.max(e-i.height,0),o=Ym(n.boxes),l=o.vertical,c=o.horizontal;Mt(n.boxes,x=>{typeof x.beforeLayout=="function"&&x.beforeLayout()});const u=l.reduce((x,g)=>g.box.options&&g.box.options.display===!1?x:x+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:i,availableWidth:a,availableHeight:s,vBoxMaxWidth:a/2/u,hBoxMaxHeight:s/2}),f=Object.assign({},i);mu(f,Gt(r));const p=Object.assign({maxPadding:f,w:a,h:s,x:i.left,y:i.top},i),y=zm(l.concat(c),d);Wr(o.fullSize,p,d,y),Wr(l,p,d,y),Wr(c,p,d,y)&&Wr(l,p,d,y),$m(p),yu(o.leftAndTop,p,d,y),p.x+=p.w,p.y+=p.h,yu(o.rightAndBottom,p,d,y),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Mt(o.chartArea,x=>{const g=x.box;Object.assign(g,n.chartArea),g.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class vu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,r){}removeEventListener(t,e,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,r,i){return e=Math.max(0,e||t.width),r=r||t.height,{width:e,height:Math.max(0,i?Math.floor(e/i):r)}}isAttached(t){return!0}updateConfig(t){}}class Vm extends vu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ai="$chartjs",qm={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},bu=n=>n===null||n==="";function Xm(n,t){const e=n.style,r=n.getAttribute("height"),i=n.getAttribute("width");if(n[Ai]={initial:{height:r,width:i,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",bu(i)){const a=$c(n,"width");a!==void 0&&(n.width=a)}if(bu(r))if(n.style.height==="")n.height=n.width/(t||2);else{const a=$c(n,"height");a!==void 0&&(n.height=a)}return n}const xu=Zg?{passive:!0}:!1;function Gm(n,t,e){n&&n.addEventListener(t,e,xu)}function Km(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,xu)}function Qm(n,t){const e=qm[n.type]||n.type,{x:r,y:i}=hn(n,t);return{type:e,chart:t,native:n,x:r!==void 0?r:null,y:i!==void 0?i:null}}function Li(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Zm(n,t,e){const r=n.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Li(o.addedNodes,r),s=s&&!Li(o.removedNodes,r);s&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}function Jm(n,t,e){const r=n.canvas,i=new MutationObserver(a=>{let s=!1;for(const o of a)s=s||Li(o.removedNodes,r),s=s&&!Li(o.addedNodes,r);s&&e()});return i.observe(document,{childList:!0,subtree:!0}),i}const zr=new Map;let _u=0;function wu(){const n=window.devicePixelRatio;n!==_u&&(_u=n,zr.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function t0(n,t){zr.size||window.addEventListener("resize",wu),zr.set(n,t)}function e0(n){zr.delete(n),zr.size||window.removeEventListener("resize",wu)}function n0(n,t,e){const r=n.canvas,i=r&&Za(r);if(!i)return;const a=Mc((o,l)=>{const c=i.clientWidth;e(o,l),c<i.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(i),t0(n,a),s}function ls(n,t,e){e&&e.disconnect(),t==="resize"&&e0(n)}function r0(n,t,e){const r=n.canvas,i=Mc(a=>{n.ctx!==null&&e(Qm(a,n))},n);return Gm(r,t,i),i}class i0 extends vu{acquireContext(t,e){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(Xm(t,e),r):null}releaseContext(t){const e=t.canvas;if(!e[Ai])return!1;const r=e[Ai].initial;["height","width"].forEach(a=>{const s=r[a];st(s)?e.removeAttribute(a):e.setAttribute(a,s)});const i=r.style||{};return Object.keys(i).forEach(a=>{e.style[a]=i[a]}),e.width=e.width,delete e[Ai],!0}addEventListener(t,e,r){this.removeEventListener(t,e);const i=t.$proxies||(t.$proxies={}),s={attach:Zm,detach:Jm,resize:n0}[e]||r0;i[e]=s(t,e,r)}removeEventListener(t,e){const r=t.$proxies||(t.$proxies={}),i=r[e];if(!i)return;({attach:ls,detach:ls,resize:ls}[e]||Km)(t,e,i),r[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,r,i){return Qg(t,e,r,i)}isAttached(t){const e=t&&Za(t);return!!(e&&e.isConnected)}}function a0(n){return!Qa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Vm:i0}class te{constructor(){H(this,"x");H(this,"y");H(this,"active",!1);H(this,"options");H(this,"$animations")}tooltipPosition(t){const{x:e,y:r}=this.getProps(["x","y"],t);return{x:e,y:r}}hasValue(){return un(this.x)&&un(this.y)}getProps(t,e){const r=this.$animations;if(!e||!r)return this;const i={};return t.forEach(a=>{i[a]=r[a]&&r[a].active()?r[a]._to:this[a]}),i}}H(te,"defaults",{}),H(te,"defaultRoutes");function s0(n,t){const e=n.options.ticks,r=o0(n),i=Math.min(e.maxTicksLimit||r,r),a=e.major.enabled?c0(t):[],s=a.length,o=a[0],l=a[s-1],c=[];if(s>i)return u0(t,c,a,s/i),c;const u=l0(a,t,i);if(s>0){let d,f;const p=s>1?Math.round((l-o)/(s-1)):null;for(Ii(t,c,u,st(p)?0:o-p,o),d=0,f=s-1;d<f;d++)Ii(t,c,u,a[d],a[d+1]);return Ii(t,c,u,l,st(p)?t.length:l+p),c}return Ii(t,c,u),c}function o0(n){const t=n.options.offset,e=n._tickSize(),r=n._length/e+(t?0:1),i=n._maxLength/e;return Math.floor(Math.min(r,i))}function l0(n,t,e){const r=d0(n),i=t.length/e;if(!r)return Math.max(i,1);const a=eg(r);for(let s=0,o=a.length-1;s<o;s++){const l=a[s];if(l>i)return l}return Math.max(i,1)}function c0(n){const t=[];let e,r;for(e=0,r=n.length;e<r;e++)n[e].major&&t.push(e);return t}function u0(n,t,e,r){let i=0,a=e[0],s;for(r=Math.ceil(r),s=0;s<n.length;s++)s===a&&(t.push(n[s]),i++,a=e[i*r])}function Ii(n,t,e,r,i){const a=rt(r,0),s=Math.min(rt(i,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),i&&(l=i-r,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 d0(n){const t=n.length;let e,r;if(t<2)return!1;for(r=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==r)return!1;return r}const f0=n=>n==="left"?"right":n==="right"?"left":n,Tu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Mu=(n,t)=>Math.min(t||n,n);function Du(n,t){const e=[],r=n.length/t,i=n.length;let a=0;for(;a<i;a+=r)e.push(n[Math.floor(a)]);return e}function h0(n,t,e){const r=n.ticks.length,i=Math.min(t,r-1),a=n._startPixel,s=n._endPixel,o=1e-6;let l=n.getPixelForTick(i),c;if(!(e&&(r===1?c=Math.max(l-a,s-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(i-1))/2,l+=i<t?c:-c,l<a-o||l>s+o)))return l}function p0(n,t){Mt(n,e=>{const r=e.gc,i=r.length/2;let a;if(i>t){for(a=0;a<i;++a)delete e.data[r[a]];r.splice(0,i)}})}function Yr(n){return n.drawTicks?n.tickLength:0}function Su(n,t){if(!n.display)return 0;const e=Rt(n.font,t),r=Gt(n.padding);return(mt(n.text)?n.text.length:1)*e.lineHeight+r.height}function g0(n,t){return fn(n,{scale:t,type:"scale"})}function m0(n,t,e){return fn(n,{tick:e,index:t,type:"tick"})}function y0(n,t,e){let r=za(n);return(e&&t!=="right"||!e&&t==="right")&&(r=f0(r)),r}function v0(n,t,e,r){const{top:i,left:a,bottom:s,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,p,y;const x=s-i,g=o-a;if(n.isHorizontal()){if(p=re(r,a,o),lt(e)){const m=Object.keys(e)[0],v=e[m];y=u[m].getPixelForValue(v)+x-t}else e==="center"?y=(c.bottom+c.top)/2+x-t:y=Tu(n,e,t);f=o-a}else{if(lt(e)){const m=Object.keys(e)[0],v=e[m];p=u[m].getPixelForValue(v)-g+t}else e==="center"?p=(c.left+c.right)/2-g+t:p=Tu(n,e,t);y=re(r,s,i),d=e==="left"?-Et:Et}return{titleX:p,titleY:y,maxWidth:f,rotation:d}}class In extends te{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:r,_suggestedMax:i}=this;return t=be(t,Number.POSITIVE_INFINITY),e=be(e,Number.NEGATIVE_INFINITY),r=be(r,Number.POSITIVE_INFINITY),i=be(i,Number.NEGATIVE_INFINITY),{min:be(t,r),max:be(e,i),minDefined:It(t),maxDefined:It(e)}}getMinMax(t){let{min:e,max:r,minDefined:i,maxDefined:a}=this.getUserBounds(),s;if(i&&a)return{min:e,max:r};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)s=o[l].controller.getMinMax(this,t),i||(e=Math.min(e,s.min)),a||(r=Math.max(r,s.max));return e=a&&e>r?r:e,r=i&&e>r?e:r,{min:be(e,be(r,e)),max:be(r,be(e,r))}}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(){Tt(this.options.beforeUpdate,[this])}update(t,e,r){const{beginAtZero:i,grace:a,ticks:s}=this.options,o=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Og(this,a,i),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Du(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=s0(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,r;this.isHorizontal()?(e=this.left,r=this.right):(e=this.top,r=this.bottom,t=!t),this._startPixel=e,this._endPixel=r,this._reversePixels=t,this._length=r-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Tt(this.options.afterUpdate,[this])}beforeSetDimensions(){Tt(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(){Tt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Tt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Tt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let r,i,a;for(r=0,i=t.length;r<i;r++)a=t[r],a.label=Tt(e.callback,[a.value,r,t],this)}afterTickToLabelConversion(){Tt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Tt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,r=Mu(this.ticks.length,t.ticks.maxTicksLimit),i=e.minRotation||0,a=e.maxRotation;let s=i,o,l,c;if(!this._isVisible()||!e.display||i>=a||r<=1||!this.isHorizontal()){this.labelRotation=i;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,p=Qt(this.chart.width-d,0,this.maxWidth);o=t.offset?this.maxWidth/r:p/(r-1),d+6>o&&(o=p/(r-(t.offset?.5:1)),l=this.maxHeight-Yr(t.grid)-e.padding-Su(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),s=_i(Math.min(Math.asin(Qt((u.highest.height+6)/o,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),s=Math.max(i,Math.min(a,s))),this.labelRotation=s}afterCalculateLabelRotation(){Tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:r,title:i,grid:a}}=this,s=this._isVisible(),o=this.isHorizontal();if(s){const l=Su(i,e.options.font);if(o?(t.width=this.maxWidth,t.height=Yr(a)+l):(t.height=this.maxHeight,t.width=Yr(a)+l),r.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),p=r.padding*2,y=Xt(this.labelRotation),x=Math.cos(y),g=Math.sin(y);if(o){const m=r.mirror?0:g*d.width+x*f.height;t.height=Math.min(this.maxHeight,t.height+m+p)}else{const m=r.mirror?0:x*d.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+m+p)}this._calculatePadding(c,u,g,x)}}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,r,i){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 f=0,p=0;l?c?(f=i*t.width,p=r*e.height):(f=r*t.height,p=i*e.width):a==="start"?p=e.width:a==="end"?f=t.width:a!=="inner"&&(f=t.width/2,p=e.width/2),this.paddingLeft=Math.max((f-u+s)*this.width/(this.width-u),0),this.paddingRight=Math.max((p-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(){Tt(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,r;for(e=0,r=t.length;e<r;e++)st(t[e].label)&&(t.splice(e,1),r--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let r=this.ticks;e<r.length&&(r=Du(r,e)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,r){const{ctx:i,_longestTextCache:a}=this,s=[],o=[],l=Math.floor(e/Mu(e,r));let c=0,u=0,d,f,p,y,x,g,m,v,b,w,T;for(d=0;d<e;d+=l){if(y=t[d].label,x=this._resolveTickFontOptions(d),i.font=g=x.string,m=a[g]=a[g]||{data:{},gc:[]},v=x.lineHeight,b=w=0,!st(y)&&!mt(y))b=Mi(i,m.data,m.gc,b,y),w=v;else if(mt(y))for(f=0,p=y.length;f<p;++f)T=y[f],!st(T)&&!mt(T)&&(b=Mi(i,m.data,m.gc,b,T),w+=v);s.push(b),o.push(w),c=Math.max(b,c),u=Math.max(w,u)}p0(a,e);const S=s.indexOf(c),C=o.indexOf(u),M=D=>({width:s[D]||0,height:o[D]||0});return{first:M(0),last:M(e-1),widest:M(S),highest:M(C),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 ig(this._alignToPixels?Pn(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 r=e[t];return r.$context||(r.$context=m0(this.getContext(),t,r))}return this.$context||(this.$context=g0(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Xt(this.labelRotation),r=Math.abs(Math.cos(e)),i=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*r>o*i?o/r:l/i:l*i<o*r?l/r:o/i}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,r=this.chart,i=this.options,{grid:a,position:s,border:o}=i,l=a.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Yr(a),p=[],y=o.setContext(this.getContext()),x=y.display?y.width:0,g=x/2,m=function(Y){return Pn(r,Y,x)};let v,b,w,T,S,C,M,D,O,P,E,F;if(s==="top")v=m(this.bottom),C=this.bottom-f,D=v-g,P=m(t.top)+g,F=t.bottom;else if(s==="bottom")v=m(this.top),P=t.top,F=m(t.bottom)-g,C=v+g,D=this.top+f;else if(s==="left")v=m(this.right),S=this.right-f,M=v-g,O=m(t.left)+g,E=t.right;else if(s==="right")v=m(this.left),O=t.left,E=m(t.right)-g,S=v+g,M=this.left+f;else if(e==="x"){if(s==="center")v=m((t.top+t.bottom)/2+.5);else if(lt(s)){const Y=Object.keys(s)[0],I=s[Y];v=m(this.chart.scales[Y].getPixelForValue(I))}P=t.top,F=t.bottom,C=v+g,D=C+f}else if(e==="y"){if(s==="center")v=m((t.left+t.right)/2);else if(lt(s)){const Y=Object.keys(s)[0],I=s[Y];v=m(this.chart.scales[Y].getPixelForValue(I))}S=v-g,M=S-f,O=t.left,E=t.right}const q=rt(i.ticks.maxTicksLimit,d),$=Math.max(1,Math.ceil(d/q));for(b=0;b<d;b+=$){const Y=this.getContext(b),I=a.setContext(Y),it=o.setContext(Y),B=I.lineWidth,yt=I.color,ut=it.dash||[],z=it.dashOffset,L=I.tickWidth,U=I.tickColor,j=I.tickBorderDash||[],Z=I.tickBorderDashOffset;w=h0(this,b,l),w!==void 0&&(T=Pn(r,w,B),c?S=M=O=E=T:C=D=P=F=T,p.push({tx1:S,ty1:C,tx2:M,ty2:D,x1:O,y1:P,x2:E,y2:F,width:B,color:yt,borderDash:ut,borderDashOffset:z,tickWidth:L,tickColor:U,tickBorderDash:j,tickBorderDashOffset:Z}))}return this._ticksLength=d,this._borderValue=v,p}_computeLabelItems(t){const e=this.axis,r=this.options,{position:i,ticks:a}=r,s=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=a,f=Yr(r.grid),p=f+u,y=d?-u:p,x=-Xt(this.labelRotation),g=[];let m,v,b,w,T,S,C,M,D,O,P,E,F="middle";if(i==="top")S=this.bottom-y,C=this._getXAxisLabelAlignment();else if(i==="bottom")S=this.top+y,C=this._getXAxisLabelAlignment();else if(i==="left"){const $=this._getYAxisLabelAlignment(f);C=$.textAlign,T=$.x}else if(i==="right"){const $=this._getYAxisLabelAlignment(f);C=$.textAlign,T=$.x}else if(e==="x"){if(i==="center")S=(t.top+t.bottom)/2+p;else if(lt(i)){const $=Object.keys(i)[0],Y=i[$];S=this.chart.scales[$].getPixelForValue(Y)+p}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(i==="center")T=(t.left+t.right)/2-p;else if(lt(i)){const $=Object.keys(i)[0],Y=i[$];T=this.chart.scales[$].getPixelForValue(Y)}C=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const q=this._getLabelSizes();for(m=0,v=o.length;m<v;++m){b=o[m],w=b.label;const $=a.setContext(this.getContext(m));M=this.getPixelForTick(m)+a.labelOffset,D=this._resolveTickFontOptions(m),O=D.lineHeight,P=mt(w)?w.length:1;const Y=P/2,I=$.color,it=$.textStrokeColor,B=$.textStrokeWidth;let yt=C;s?(T=M,C==="inner"&&(m===v-1?yt=this.options.reverse?"left":"right":m===0?yt=this.options.reverse?"right":"left":yt="center"),i==="top"?c==="near"||x!==0?E=-P*O+O/2:c==="center"?E=-q.highest.height/2-Y*O+O:E=-q.highest.height+O/2:c==="near"||x!==0?E=O/2:c==="center"?E=q.highest.height/2-Y*O:E=q.highest.height-P*O,d&&(E*=-1),x!==0&&!$.showLabelBackdrop&&(T+=O/2*Math.sin(x))):(S=M,E=(1-P)*O/2);let ut;if($.showLabelBackdrop){const z=Gt($.backdropPadding),L=q.heights[m],U=q.widths[m];let j=E-z.top,Z=0-z.left;switch(F){case"middle":j-=L/2;break;case"bottom":j-=L;break}switch(C){case"center":Z-=U/2;break;case"right":Z-=U;break;case"inner":m===v-1?Z-=U:m>0&&(Z-=U/2);break}ut={left:Z,top:j,width:U+z.width,height:L+z.height,color:$.backdropColor}}g.push({label:w,font:D,textOffset:E,options:{rotation:x,color:I,strokeColor:it,strokeWidth:B,textAlign:yt,textBaseline:F,translation:[T,S],backdrop:ut}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Xt(this.labelRotation))return t==="top"?"left":"right";let i="center";return e.align==="start"?i="left":e.align==="end"?i="right":e.align==="inner"&&(i="inner"),i}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:r,mirror:i,padding:a}}=this.options,s=this._getLabelSizes(),o=t+a,l=s.widest.width;let c,u;return e==="left"?i?(u=this.right+a,r==="near"?c="left":r==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?i?(u=this.left+a,r==="near"?c="right":r==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,r==="near"?c="left":r==="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:r,top:i,width:a,height:s}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(r,i,a,s),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const i=this.ticks.findIndex(a=>a.value===t);return i>=0?e.setContext(this.getContext(i)).lineWidth:0}drawGrid(t){const e=this.options.grid,r=this.ctx,i=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let a,s;const o=(l,c,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(e.display)for(a=0,s=i.length;a<s;++a){const l=i[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:r,grid:i}}=this,a=r.setContext(this.getContext()),s=r.display?a.width:0;if(!s)return;const o=i.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=Pn(t,this.left,s)-s/2,u=Pn(t,this.right,o)+o/2,d=f=l):(d=Pn(t,this.top,s)-s/2,f=Pn(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,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,i=this._computeLabelArea();i&&Pr(r,i);const a=this.getLabelItems(t);for(const s of a){const o=s.options,l=s.font,c=s.label,u=s.textOffset;En(r,c,0,u,l,o)}i&&Er(r)}drawTitle(){const{ctx:t,options:{position:e,title:r,reverse:i}}=this;if(!r.display)return;const a=Rt(r.font),s=Gt(r.padding),o=r.align;let l=a.lineHeight/2;e==="bottom"||e==="center"||lt(e)?(l+=s.bottom,mt(r.text)&&(l+=a.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=v0(this,l,e,o);En(t,r.text,0,0,a,{color:r.color,maxWidth:d,rotation:f,textAlign:y0(o,e,i),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,r=rt(t.grid&&t.grid.z,-1),i=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==In.prototype.draw?[{z:e,draw:a=>{this.draw(a)}}]:[{z:r,draw:a=>{this.drawBackground(),this.drawGrid(a),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:e,draw:a=>{this.drawLabels(a)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",i=[];let a,s;for(a=0,s=e.length;a<s;++a){const o=e[a];o[r]===this.id&&(!t||o.type===t)&&i.push(o)}return i}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Rt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ni{constructor(t,e,r){this.type=t,this.scope=e,this.override=r,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 r;_0(e)&&(r=this.register(e));const i=this.items,a=t.id,s=this.scope+"."+a;if(!a)throw new Error("class does not have id: "+t);return a in i||(i[a]=t,b0(t,s,r),this.override&&Ut.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const e=this.items,r=t.id,i=this.scope;r in e&&delete e[r],i&&r in Ut[i]&&(delete Ut[i][r],this.override&&delete On[r])}}function b0(n,t,e){const r=Tr(Object.create(null),[e?Ut.get(e):{},Ut.get(t),n.defaults]);Ut.set(t,r),n.defaultRoutes&&x0(t,n.defaultRoutes),n.descriptors&&Ut.describe(t,n.descriptors)}function x0(n,t){Object.keys(t).forEach(e=>{const r=e.split("."),i=r.pop(),a=[n].concat(r).join("."),s=t[e].split("."),o=s.pop(),l=s.join(".");Ut.route(a,i,l,o)})}function _0(n){return"id"in n&&"defaults"in n}class w0{constructor(){this.controllers=new Ni(Oe,"datasets",!0),this.elements=new Ni(te,"elements"),this.plugins=new Ni(Object,"plugins"),this.scales=new Ni(In,"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,r){[...e].forEach(i=>{const a=r||this._getRegistryForType(i);r||a.isForType(i)||a===this.plugins&&i.id?this._exec(t,a,i):Mt(i,s=>{const o=r||this._getRegistryForType(s);this._exec(t,o,s)})})}_exec(t,e,r){const i=Ua(t);Tt(r["before"+i],[],r),e[t](r),Tt(r["after"+i],[],r)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const r=this._typedRegistries[e];if(r.isForType(t))return r}return this.plugins}_get(t,e,r){const i=e.get(t);if(i===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return i}}var Ie=new w0;class T0{constructor(){this._init=[]}notify(t,e,r,i){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const a=i?this._descriptors(t).filter(i):this._descriptors(t),s=this._notify(a,t,e,r);return e==="afterDestroy"&&(this._notify(a,t,"stop"),this._notify(this._init,t,"uninstall")),s}_notify(t,e,r,i){i=i||{};for(const a of t){const s=a.plugin,o=s[r],l=[e,i,a.options];if(Tt(o,l,s)===!1&&i.cancelable)return!1}return!0}invalidate(){st(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 r=t&&t.config,i=rt(r.options&&r.options.plugins,{}),a=M0(r);return i===!1&&!e?[]:S0(t,a,i,e)}_notifyStateChanges(t){const e=this._oldCache||[],r=this._cache,i=(a,s)=>a.filter(o=>!s.some(l=>o.plugin.id===l.plugin.id));this._notify(i(e,r),t,"stop"),this._notify(i(r,e),t,"start")}}function M0(n){const t={},e=[],r=Object.keys(Ie.plugins.items);for(let a=0;a<r.length;a++)e.push(Ie.getPlugin(r[a]));const i=n.plugins||[];for(let a=0;a<i.length;a++){const s=i[a];e.indexOf(s)===-1&&(e.push(s),t[s.id]=!0)}return{plugins:e,localIds:t}}function D0(n,t){return!t&&n===!1?null:n===!0?{}:n}function S0(n,{plugins:t,localIds:e},r,i){const a=[],s=n.getContext();for(const o of t){const l=o.id,c=D0(r[l],i);c!==null&&a.push({plugin:o,options:k0(n.config,{plugin:o,local:e[l]},c,s)})}return a}function k0(n,{plugin:t,local:e},r,i){const a=n.pluginScopeKeys(t),s=n.getOptionScopes(r,a);return e&&t.defaults&&s.push(t.defaults),n.createResolver(s,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function cs(n,t){const e=Ut.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function C0(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function O0(n,t){return n===t?"_index_":"_value_"}function ku(n){if(n==="x"||n==="y"||n==="r")return n}function P0(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function us(n,...t){if(ku(n))return n;for(const e of t){const r=e.axis||P0(e.position)||n.length>1&&ku(n[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Cu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function E0(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(r=>r.xAxisID===n||r.yAxisID===n);if(e.length)return Cu(n,"x",e[0])||Cu(n,"y",e[0])}return{}}function R0(n,t){const e=On[n.type]||{scales:{}},r=t.scales||{},i=cs(n.type,t),a=Object.create(null);return Object.keys(r).forEach(s=>{const o=r[s];if(!lt(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=us(s,o,E0(s,n),Ut.scales[o.type]),c=O0(l,i),u=e.scales||{};a[s]=Mr(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(s=>{const o=s.type||n.type,l=s.indexAxis||cs(o,t),u=(On[o]||{}).scales||{};Object.keys(u).forEach(d=>{const f=C0(d,l),p=s[f+"AxisID"]||f;a[p]=a[p]||Object.create(null),Mr(a[p],[{axis:f},r[p],u[d]])})}),Object.keys(a).forEach(s=>{const o=a[s];Mr(o,[Ut.scales[o.type],Ut.scale])}),a}function Ou(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=R0(n,t)}function Pu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function A0(n){return n=n||{},n.data=Pu(n.data),Ou(n),n}const Eu=new Map,Ru=new Set;function Fi(n,t){let e=Eu.get(n);return e||(e=t(),Eu.set(n,e),Ru.add(e)),e}const Hr=(n,t,e)=>{const r=ln(t,e);r!==void 0&&n.add(r)};class L0{constructor(t){this._config=A0(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=Pu(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(),Ou(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Fi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Fi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Fi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,r=this.type;return Fi(`${r}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const r=this._scopeCache;let i=r.get(t);return(!i||e)&&(i=new Map,r.set(t,i)),i}getOptionScopes(t,e,r){const{options:i,type:a}=this,s=this._cachedScopes(t,r),o=s.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>Hr(l,t,d))),u.forEach(d=>Hr(l,i,d)),u.forEach(d=>Hr(l,On[a]||{},d)),u.forEach(d=>Hr(l,Ut,d)),u.forEach(d=>Hr(l,$a,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ru.has(e)&&s.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,On[e]||{},Ut.datasets[e]||{},{type:e},Ut,$a]}resolveNamedOptions(t,e,r,i=[""]){const a={$shared:!0},{resolver:s,subPrefixes:o}=Au(this._resolverCache,t,i);let l=s;if(N0(s,e)){a.$shared=!1,r=fe(r)?r():r;const c=this.createResolver(t,r,o);l=er(s,r,c)}for(const c of e)a[c]=l[c];return a}createResolver(t,e,r=[""],i){const{resolver:a}=Au(this._resolverCache,t,r);return lt(e)?er(a,e,void 0,i):a}}function Au(n,t,e){let r=n.get(t);r||(r=new Map,n.set(t,r));const i=e.join();let a=r.get(i);return a||(a={resolver:Xa(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},r.set(i,a)),a}const I0=n=>lt(n)&&Object.getOwnPropertyNames(n).some(t=>fe(n[t]));function N0(n,t){const{isScriptable:e,isIndexable:r}=Ic(n);for(const i of t){const a=e(i),s=r(i),o=(s||a)&&n[i];if(a&&(fe(o)||I0(o))||s&&mt(o))return!0}return!1}var F0="4.4.3";const U0=["top","bottom","left","right","chartArea"];function Lu(n,t){return n==="top"||n==="bottom"||U0.indexOf(n)===-1&&t==="x"}function Iu(n,t){return function(e,r){return e[n]===r[n]?e[t]-r[t]:e[n]-r[n]}}function Nu(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Tt(e&&e.onComplete,[n],t)}function B0(n){const t=n.chart,e=t.options.animation;Tt(e&&e.onProgress,[n],t)}function Fu(n){return Qa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ui={},Uu=n=>{const t=Fu(n);return Object.values(Ui).filter(e=>e.canvas===t).pop()};function W0(n,t,e){const r=Object.keys(n);for(const i of r){const a=+i;if(a>=t){const s=n[i];delete n[i],(e>0||a>t)&&(n[a+e]=s)}}}function z0(n,t,e,r){return!e||n.type==="mouseout"?null:r?t:n}function Bi(n,t,e){return n.options.clip?n[e]:t[e]}function Y0(n,t){const{xScale:e,yScale:r}=n;return e&&r?{left:Bi(e,t,"left"),right:Bi(e,t,"right"),top:Bi(r,t,"top"),bottom:Bi(r,t,"bottom")}:t}let Me=(Mn=class{static register(...t){Ie.add(...t),Bu()}static unregister(...t){Ie.remove(...t),Bu()}constructor(t,e){const r=this.config=new L0(e),i=Fu(t),a=Uu(i);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=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||a0(i)),this.platform.updateConfig(r);const o=this.platform.acquireContext(i,s.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=qp(),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 T0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=lg(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Ui[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Xe.listen(this,"complete",Nu),Xe.listen(this,"progress",B0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:r,height:i,_aspectRatio:a}=this;return st(t)?e&&a?a:i?r/i: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 Ie}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Rc(this.canvas,this.ctx),this}stop(){return Xe.stop(this),this}resize(t,e){Xe.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const r=this.options,i=this.canvas,a=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(i,t,e,a),o=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Hc(this,o,!0)&&(this.notifyPlugins("resize",{size:s}),Tt(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Mt(e,(r,i)=>{r.id=i})}buildOrUpdateScales(){const t=this.options,e=t.scales,r=this.scales,i=Object.keys(r).reduce((s,o)=>(s[o]=!1,s),{});let a=[];e&&(a=a.concat(Object.keys(e).map(s=>{const o=e[s],l=us(s,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Mt(a,s=>{const o=s.options,l=o.id,c=us(l,o),u=rt(o.type,s.dtype);(o.position===void 0||Lu(o.position,c)!==Lu(s.dposition))&&(o.position=s.dposition),i[l]=!0;let d=null;if(l in r&&r[l].type===u)d=r[l];else{const f=Ie.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(o,t)}),Mt(i,(s,o)=>{s||delete r[o]}),Mt(r,s=>{ie.configure(this,s,s.options),ie.addBox(this,s)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,r=t.length;if(t.sort((i,a)=>i.index-a.index),r>e){for(let i=e;i<r;++i)this._destroyDatasetMeta(i);t.splice(e,r-e)}this._sortedMetasets=t.slice(0).sort(Iu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((r,i)=>{e.filter(a=>a===r._dataset).length===0&&this._destroyDatasetMeta(i)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let r,i;for(this._removeUnreferencedMetasets(),r=0,i=e.length;r<i;r++){const a=e[r];let s=this.getDatasetMeta(r);const o=a.type||this.config.type;if(s.type&&s.type!==o&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=o,s.indexAxis=a.indexAxis||cs(o,this.options),s.order=a.order||0,s.index=r,s.label=""+a.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=Ie.getController(o),{datasetElementType:c,dataElementType:u}=Ut.datasets[o];Object.assign(l,{dataElementType:Ie.getElement(u),datasetElementType:c&&Ie.getElement(c)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){Mt(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 r=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),i=this._animationsDisabled=!r.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),f=!i&&a.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),i||Mt(a,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Iu("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Mt(this.scales,t=>{ie.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!gc(e,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:r,start:i,count:a}of e){const s=r==="_removeElements"?-a:a;W0(t,i,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,r=a=>new Set(t.filter(s=>s[0]===a).map((s,o)=>o+","+s.splice(1).join(","))),i=r(0);for(let a=1;a<e;a++)if(!gc(i,r(a)))return;return Array.from(i).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;ie.update(this,this.width,this.height,t);const e=this.chartArea,r=e.width<=0||e.height<=0;this._layers=[],Mt(this.boxes,i=>{r&&i.position==="chartArea"||(i.configure&&i.configure(),this._layers.push(...i._layers()))},this),this._layers.forEach((i,a)=>{i._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,r=this.data.datasets.length;e<r;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,r=this.data.datasets.length;e<r;++e)this._updateDataset(e,fe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const r=this.getDatasetMeta(t),i={meta:r,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",i)!==!1&&(r.controller._update(e),i.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",i))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Xe.has(this)?this.attached&&!Xe.running(this)&&Xe.start(this):(this.draw(),Nu({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:i}=this._resizeBeforeDraw;this._resize(r,i),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,r=[];let i,a;for(i=0,a=e.length;i<a;++i){const s=e[i];(!t||s.visible)&&r.push(s)}return r}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,r=t._clip,i=!r.disabled,a=Y0(t,this.chartArea),s={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(i&&Pr(e,{left:r.left===!1?0:a.left-r.left,right:r.right===!1?this.width:a.right+r.right,top:r.top===!1?0:a.top-r.top,bottom:r.bottom===!1?this.height:a.bottom+r.bottom}),t.controller.draw(),i&&Er(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return qe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,r,i){const a=os.modes[e];return typeof a=="function"?a(this,t,r,i):[]}getDatasetMeta(t){const e=this.data.datasets[t],r=this._metasets;let i=r.filter(a=>a&&a._dataset===e).pop();return i||(i={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},r.push(i)),i}getContext(){return this.$context||(this.$context=fn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!e.hidden}setDatasetVisibility(t,e){const r=this.getDatasetMeta(t);r.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,r){const i=r?"show":"hide",a=this.getDatasetMeta(t),s=a.controller._resolveAnimations(void 0,i);de(e)?(a.data[e].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(a,{visible:r}),this.update(o=>o.datasetIndex===t?i: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(),Xe.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(),Rc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ui[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,r=(a,s)=>{e.addEventListener(this,a,s),t[a]=s},i=(a,s,o)=>{a.offsetX=s,a.offsetY=o,this._eventHandler(a)};Mt(this.options.events,a=>r(a,i))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,r=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},i=(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=()=>{i("attach",o),this.attached=!0,this.resize(),r("resize",a),r("detach",s)};s=()=>{this.attached=!1,i("resize",a),this._stop(),this._resize(0,0),r("attach",o)},e.isAttached(this.canvas)?o():s()}unbindEvents(){Mt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Mt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,r){const i=r?"set":"remove";let a,s,o,l;for(e==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+i+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){s=t[o];const c=s&&this.getDatasetMeta(s.datasetIndex).controller;c&&c[i+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],r=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}});!yi(r,e)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,e))}notifyPlugins(t,e,r){return this._plugins.notify(this,t,e,r)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,r){const i=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=r?t:a(t,e);s.length&&this.updateHoverStyle(s,i.mode,!1),o.length&&i.mode&&this.updateHoverStyle(o,i.mode,!0)}_eventHandler(t,e){const r={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},i=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,i)===!1)return;const a=this._handleEvent(t,e,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,i),(a||r.changed)&&this.render(),this}_handleEvent(t,e,r){const{_active:i=[],options:a}=this,s=e,o=this._getActiveElements(t,i,r,s),l=Jp(t),c=z0(t,this._lastEvent,r,l);r&&(this._lastEvent=null,Tt(a.onHover,[t,o,this],this),l&&Tt(a.onClick,[t,o,this],this));const u=!yi(o,i);return(u||e)&&(this._active=o,this._updateHoverStyles(o,i,e)),this._lastEvent=c,u}_getActiveElements(t,e,r,i){if(t.type==="mouseout")return[];if(!r)return e;const a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,i)}},H(Mn,"defaults",Ut),H(Mn,"instances",Ui),H(Mn,"overrides",On),H(Mn,"registry",Ie),H(Mn,"version",F0),H(Mn,"getChart",Uu),Mn);function Bu(){return Mt(Me.instances,n=>n._plugins.invalidate())}function H0(n,t,e){const{startAngle:r,pixelMargin:i,x:a,y:s,outerRadius:o,innerRadius:l}=t;let c=i/o;n.beginPath(),n.arc(a,s,o,r-c,e+c),l>i?(c=i/l,n.arc(a,s,l,e+c,r-c,!0)):n.arc(a,s,i,e+Et,r-Et),n.closePath(),n.clip()}function $0(n){return qa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function j0(n,t,e,r){const i=$0(n.options.borderRadius),a=(e-t)/2,s=Math.min(a,r*t/2),o=l=>{const c=(e-Math.min(a,l))*r/2;return Qt(l,0,Math.min(a,c))};return{outerStart:o(i.outerStart),outerEnd:o(i.outerEnd),innerStart:Qt(i.innerStart,0,s),innerEnd:Qt(i.innerEnd,0,s)}}function ir(n,t,e,r){return{x:e+n*Math.cos(t),y:r+n*Math.sin(t)}}function Wi(n,t,e,r,i,a){const{x:s,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+r+e-c,0),f=u>0?u+r+e+c:0;let p=0;const y=i-l;if(r){const $=u>0?u-r:0,Y=d>0?d-r:0,I=($+Y)/2,it=I!==0?y*I/(I+r):y;p=(y-it)/2}const x=Math.max(.001,y*d-e/dt)/d,g=(y-x)/2,m=l+g+p,v=i-g-p,{outerStart:b,outerEnd:w,innerStart:T,innerEnd:S}=j0(t,f,d,v-m),C=d-b,M=d-w,D=m+b/C,O=v-w/M,P=f+T,E=f+S,F=m+T/P,q=v-S/E;if(n.beginPath(),a){const $=(D+O)/2;if(n.arc(s,o,d,D,$),n.arc(s,o,d,$,O),w>0){const B=ir(M,O,s,o);n.arc(B.x,B.y,w,O,v+Et)}const Y=ir(E,v,s,o);if(n.lineTo(Y.x,Y.y),S>0){const B=ir(E,q,s,o);n.arc(B.x,B.y,S,v+Et,q+Math.PI)}const I=(v-S/f+(m+T/f))/2;if(n.arc(s,o,f,v-S/f,I,!0),n.arc(s,o,f,I,m+T/f,!0),T>0){const B=ir(P,F,s,o);n.arc(B.x,B.y,T,F+Math.PI,m-Et)}const it=ir(C,m,s,o);if(n.lineTo(it.x,it.y),b>0){const B=ir(C,D,s,o);n.arc(B.x,B.y,b,m-Et,D)}}else{n.moveTo(s,o);const $=Math.cos(D)*d+s,Y=Math.sin(D)*d+o;n.lineTo($,Y);const I=Math.cos(O)*d+s,it=Math.sin(O)*d+o;n.lineTo(I,it)}n.closePath()}function V0(n,t,e,r,i){const{fullCircles:a,startAngle:s,circumference:o}=t;let l=t.endAngle;if(a){Wi(n,t,e,r,l,i);for(let c=0;c<a;++c)n.fill();isNaN(o)||(l=s+(o%Ct||Ct))}return Wi(n,t,e,r,l,i),n.fill(),l}function q0(n,t,e,r,i){const{fullCircles:a,startAngle:s,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let y=t.endAngle;if(a){Wi(n,t,e,r,y,i);for(let x=0;x<a;++x)n.stroke();isNaN(o)||(y=s+(o%Ct||Ct))}p&&H0(n,t,y),a||(Wi(n,t,e,r,y,i),n.stroke())}class $r extends te{constructor(e){super();H(this,"circumference");H(this,"endAngle");H(this,"fullCircles");H(this,"innerRadius");H(this,"outerRadius");H(this,"pixelMargin");H(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,r,i){const a=this.getProps(["x","y"],i),{angle:s,distance:o}=bc(a,{x:e,y:r}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),p=(this.options.spacing+this.options.borderWidth)/2,x=rt(f,c-l)>=Ct||Sr(s,l,c),g=je(o,u+p,d+p);return x&&g}getCenterPoint(e){const{x:r,y:i,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,f=(o+l+u+c)/2;return{x:r+Math.cos(d)*f,y:i+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:r,circumference:i}=this,a=(r.offset||0)/4,s=(r.spacing||0)/2,o=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=i>Ct?Math.floor(i/Ct):0,i===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(dt,i||0)),u=a*c;e.fillStyle=r.backgroundColor,e.strokeStyle=r.borderColor,V0(e,this,u,s,o),q0(e,this,u,s,o),e.restore()}}H($r,"id","arc"),H($r,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),H($r,"defaultRoutes",{backgroundColor:"backgroundColor"}),H($r,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Wu(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function X0(n,t,e){n.lineTo(e.x,e.y)}function G0(n){return n.stepped?xg:n.tension||n.cubicInterpolationMode==="monotone"?_g:X0}function zu(n,t,e={}){const r=n.length,{start:i=0,end:a=r-1}=e,{start:s,end:o}=t,l=Math.max(i,s),c=Math.min(a,o),u=i<s&&a<s||i>o&&a>o;return{count:r,start:l,loop:t.loop,ilen:c<l&&!u?r+c-l:c-l}}function K0(n,t,e,r){const{points:i,options:a}=t,{count:s,start:o,loop:l,ilen:c}=zu(i,e,r),u=G0(a);let{move:d=!0,reverse:f}=r||{},p,y,x;for(p=0;p<=c;++p)y=i[(o+(f?c-p:p))%s],!y.skip&&(d?(n.moveTo(y.x,y.y),d=!1):u(n,x,y,f,a.stepped),x=y);return l&&(y=i[(o+(f?c:0))%s],u(n,x,y,f,a.stepped)),!!l}function Q0(n,t,e,r){const i=t.points,{count:a,start:s,ilen:o}=zu(i,e,r),{move:l=!0,reverse:c}=r||{};let u=0,d=0,f,p,y,x,g,m;const v=w=>(s+(c?o-w:w))%a,b=()=>{x!==g&&(n.lineTo(u,g),n.lineTo(u,x),n.lineTo(u,m))};for(l&&(p=i[v(0)],n.moveTo(p.x,p.y)),f=0;f<=o;++f){if(p=i[v(f)],p.skip)continue;const w=p.x,T=p.y,S=w|0;S===y?(T<x?x=T:T>g&&(g=T),u=(d*u+w)/++d):(b(),n.lineTo(w,T),y=S,d=0,x=g=T),m=T}b()}function ds(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Q0:K0}function Z0(n){return n.stepped?Jg:n.tension||n.cubicInterpolationMode==="monotone"?tm:An}function J0(n,t,e,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,e,r)&&i.closePath()),Wu(n,t.options),n.stroke(i)}function ty(n,t,e,r){const{segments:i,options:a}=t,s=ds(t);for(const o of i)Wu(n,a,o.style),n.beginPath(),s(n,t,o,{start:e,end:e+r-1})&&n.closePath(),n.stroke()}const ey=typeof Path2D=="function";function ny(n,t,e,r){ey&&!t.options.segment?J0(n,t,e,r):ty(n,t,e,r)}class gn extends te{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 r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const i=r.spanGaps?this._loop:this._fullLoop;jg(this._points,r,t,i,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=sm(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,r=t.length;return r&&e[t[r-1].end]}interpolate(t,e){const r=this.options,i=t[e],a=this.points,s=Kc(this,{property:e,start:i,end:i});if(!s.length)return;const o=[],l=Z0(r);let c,u;for(c=0,u=s.length;c<u;++c){const{start:d,end:f}=s[c],p=a[d],y=a[f];if(p===y){o.push(p);continue}const x=Math.abs((i-p[e])/(y[e]-p[e])),g=l(p,y,x,r.stepped);g[e]=t[e],o.push(g)}return o.length===1?o[0]:o}pathSegment(t,e,r){return ds(this)(t,this,e,r)}path(t,e,r){const i=this.segments,a=ds(this);let s=this._loop;e=e||0,r=r||this.points.length-e;for(const o of i)s&=a(t,this,o,{start:e,end:e+r-1});return!!s}draw(t,e,r,i){const a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),ny(t,this,r,i),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}H(gn,"id","line"),H(gn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),H(gn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),H(gn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Yu(n,t,e,r){const i=n.options,{[e]:a}=n.getProps([e],r);return Math.abs(t-a)<i.radius+i.hitRadius}class zi extends te{constructor(e){super();H(this,"parsed");H(this,"skip");H(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,r,i){const a=this.options,{x:s,y:o}=this.getProps(["x","y"],i);return Math.pow(e-s,2)+Math.pow(r-o,2)<Math.pow(a.hitRadius+a.radius,2)}inXRange(e,r){return Yu(this,e,"x",r)}inYRange(e,r){return Yu(this,e,"y",r)}getCenterPoint(e){const{x:r,y:i}=this.getProps(["x","y"],e);return{x:r,y:i}}size(e){e=e||this.options||{};let r=e.radius||0;r=Math.max(r,r&&e.hoverRadius||0);const i=r&&e.borderWidth||0;return(r+i)*2}draw(e,r){const i=this.options;this.skip||i.radius<.1||!qe(this,r,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Va(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}H(zi,"id","point"),H(zi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),H(zi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hu(n,t){const{x:e,y:r,base:i,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,i),l=Math.max(e,i),c=r-d,u=r+d):(d=a/2,o=e-d,l=e+d,c=Math.min(r,i),u=Math.max(r,i)),{left:o,top:c,right:l,bottom:u}}function mn(n,t,e,r){return n?0:Qt(t,e,r)}function ry(n,t,e){const r=n.options.borderWidth,i=n.borderSkipped,a=Lc(r);return{t:mn(i.top,a.top,0,e),r:mn(i.right,a.right,0,t),b:mn(i.bottom,a.bottom,0,e),l:mn(i.left,a.left,0,t)}}function iy(n,t,e){const{enableBorderRadius:r}=n.getProps(["enableBorderRadius"]),i=n.options.borderRadius,a=dn(i),s=Math.min(t,e),o=n.borderSkipped,l=r||lt(i);return{topLeft:mn(!l||o.top||o.left,a.topLeft,0,s),topRight:mn(!l||o.top||o.right,a.topRight,0,s),bottomLeft:mn(!l||o.bottom||o.left,a.bottomLeft,0,s),bottomRight:mn(!l||o.bottom||o.right,a.bottomRight,0,s)}}function ay(n){const t=Hu(n),e=t.right-t.left,r=t.bottom-t.top,i=ry(n,e/2,r/2),a=iy(n,e/2,r/2);return{outer:{x:t.left,y:t.top,w:e,h:r,radius:a},inner:{x:t.left+i.l,y:t.top+i.t,w:e-i.l-i.r,h:r-i.t-i.b,radius:{topLeft:Math.max(0,a.topLeft-Math.max(i.t,i.l)),topRight:Math.max(0,a.topRight-Math.max(i.t,i.r)),bottomLeft:Math.max(0,a.bottomLeft-Math.max(i.b,i.l)),bottomRight:Math.max(0,a.bottomRight-Math.max(i.b,i.r))}}}}function fs(n,t,e,r){const i=t===null,a=e===null,o=n&&!(i&&a)&&Hu(n,r);return o&&(i||je(t,o.left,o.right))&&(a||je(e,o.top,o.bottom))}function sy(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function oy(n,t){n.rect(t.x,t.y,t.w,t.h)}function hs(n,t,e={}){const r=n.x!==e.x?-t:0,i=n.y!==e.y?-t:0,a=(n.x+n.w!==e.x+e.w?t:0)-r,s=(n.y+n.h!==e.y+e.h?t:0)-i;return{x:n.x+r,y:n.y+i,w:n.w+a,h:n.h+s,radius:n.radius}}class Yi extends te{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:r,backgroundColor:i}}=this,{inner:a,outer:s}=ay(this),o=sy(s.radius)?tr:oy;t.save(),(s.w!==a.w||s.h!==a.h)&&(t.beginPath(),o(t,hs(s,e,a)),t.clip(),o(t,hs(a,-e,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),o(t,hs(a,e)),t.fillStyle=i,t.fill(),t.restore()}inRange(t,e,r){return fs(this,t,e,r)}inXRange(t,e){return fs(this,t,null,e)}inYRange(t,e){return fs(this,null,t,e)}getCenterPoint(t){const{x:e,y:r,base:i,horizontal:a}=this.getProps(["x","y","base","horizontal"],t);return{x:a?(e+i)/2:e,y:a?r:(r+i)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}H(Yi,"id","bar"),H(Yi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),H(Yi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ly=Object.freeze({__proto__:null,ArcElement:$r,BarElement:Yi,LineElement:gn,PointElement:zi});const ps=["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)"],$u=ps.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ju(n){return ps[n%ps.length]}function Vu(n){return $u[n%$u.length]}function cy(n,t){return n.borderColor=ju(t),n.backgroundColor=Vu(t),++t}function uy(n,t){return n.backgroundColor=n.data.map(()=>ju(t++)),t}function dy(n,t){return n.backgroundColor=n.data.map(()=>Vu(t++)),t}function fy(n){let t=0;return(e,r)=>{const i=n.getDatasetMeta(r).controller;i instanceof pn?t=uy(e,t):i instanceof Nr?t=dy(e,t):i&&(t=cy(e,t))}}function qu(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function hy(n){return n&&(n.borderColor||n.backgroundColor)}var py={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:r},options:i}=n.config,{elements:a}=i;if(!e.forceOverride&&(qu(r)||hy(i)||a&&qu(a)))return;const s=fy(n);r.forEach(s)}};function gy(n,t,e,r,i){const a=i.samples||r;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,f,p,y,x;for(s[l++]=n[u],d=0;d<a-2;d++){let g=0,m=0,v;const b=Math.floor((d+1)*o)+1+t,w=Math.min(Math.floor((d+2)*o)+1,e)+t,T=w-b;for(v=b;v<w;v++)g+=n[v].x,m+=n[v].y;g/=T,m/=T;const S=Math.floor(d*o)+1+t,C=Math.min(Math.floor((d+1)*o)+1,e)+t,{x:M,y:D}=n[u];for(p=y=-1,v=S;v<C;v++)y=.5*Math.abs((M-g)*(n[v].y-D)-(M-n[v].x)*(m-D)),y>p&&(p=y,f=n[v],x=v);s[l++]=f,u=x}return s[l++]=n[c],s}function my(n,t,e,r){let i=0,a=0,s,o,l,c,u,d,f,p,y,x;const g=[],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*r,c=o.y;const T=l|0;if(T===u)c<y?(y=c,d=s):c>x&&(x=c,f=s),i=(a*i+o.x)/++a;else{const S=s-1;if(!st(d)&&!st(f)){const C=Math.min(d,f),M=Math.max(d,f);C!==p&&C!==S&&g.push({...n[C],x:i}),M!==p&&M!==S&&g.push({...n[M],x:i})}s>0&&S!==p&&g.push(n[S]),g.push(o),u=T,a=0,y=x=c,d=f=p=s}}return g}function Xu(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 Gu(n){n.data.datasets.forEach(t=>{Xu(t)})}function yy(n,t){const e=t.length;let r=0,i;const{iScale:a}=n,{min:s,max:o,minDefined:l,maxDefined:c}=a.getUserBounds();return l&&(r=Qt(Ve(t,a.axis,s).lo,0,e-1)),c?i=Qt(Ve(t,a.axis,o).hi+1,r,e)-r:i=e-r,{start:r,count:i}}var vy={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Gu(n);return}const r=n.width;n.data.datasets.forEach((i,a)=>{const{_data:s,indexAxis:o}=i,l=n.getDatasetMeta(a),c=s||i.data;if(Rr([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:f}=yy(l,c);const p=e.threshold||4*r;if(f<=p){Xu(i);return}st(s)&&(i._data=c,delete i.data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(x){this._data=x}}));let y;switch(e.algorithm){case"lttb":y=gy(c,d,f,r,e);break;case"min-max":y=my(c,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}i._decimated=y})},destroy(n){Gu(n)}};function by(n,t,e){const r=n.segments,i=n.points,a=t.points,s=[];for(const o of r){let{start:l,end:c}=o;c=ms(l,c,i);const u=gs(e,i[l],i[c],o.loop);if(!t.segments){s.push({source:o,target:u,start:i[l],end:i[c]});continue}const d=Kc(t,u);for(const f of d){const p=gs(e,a[f.start],a[f.end],f.loop),y=Gc(o,i,p);for(const x of y)s.push({source:x,target:f,start:{[e]:Ku(u,p,"start",Math.max)},end:{[e]:Ku(u,p,"end",Math.min)}})}}return s}function gs(n,t,e,r){if(r)return;let i=t[n],a=e[n];return n==="angle"&&(i=xe(i),a=xe(a)),{property:n,start:i,end:a}}function xy(n,t){const{x:e=null,y:r=null}=n||{},i=t.points,a=[];return t.segments.forEach(({start:s,end:o})=>{o=ms(s,o,i);const l=i[s],c=i[o];r!==null?(a.push({x:l.x,y:r}),a.push({x:c.x,y:r})):e!==null&&(a.push({x:e,y:l.y}),a.push({x:e,y:c.y}))}),a}function ms(n,t,e){for(;t>n;t--){const r=e[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Ku(n,t,e,r){return n&&t?r(n[e],t[e]):n?n[e]:t?t[e]:0}function Qu(n,t){let e=[],r=!1;return mt(n)?(r=!0,e=n):e=xy(n,t),e.length?new gn({points:e,options:{tension:0},_loop:r,_fullLoop:r}):null}function Zu(n){return n&&n.fill!==!1}function _y(n,t,e){let i=n[t].fill;const a=[t];let s;if(!e)return i;for(;i!==!1&&a.indexOf(i)===-1;){if(!It(i))return i;if(s=n[i],!s)return!1;if(s.visible)return i;a.push(i),i=s.fill}return!1}function wy(n,t,e){const r=Sy(n);if(lt(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return It(i)&&Math.floor(i)===i?Ty(r[0],t,i,e):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Ty(n,t,e,r){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=r?!1:e}function My(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:lt(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Dy(n,t,e){let r;return n==="start"?r=e:n==="end"?r=t.options.reverse?t.min:t.max:lt(n)?r=n.value:r=t.getBaseValue(),r}function Sy(n){const t=n.options,e=t.fill;let r=rt(e&&e.target,e);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function ky(n){const{scale:t,index:e,line:r}=n,i=[],a=r.segments,s=r.points,o=Cy(t,e);o.push(Qu({x:null,y:t.bottom},r));for(let l=0;l<a.length;l++){const c=a[l];for(let u=c.start;u<=c.end;u++)Oy(i,s[u],o)}return new gn({points:i,options:{}})}function Cy(n,t){const e=[],r=n.getMatchingVisibleMetas("line");for(let i=0;i<r.length;i++){const a=r[i];if(a.index===t)break;a.hidden||e.unshift(a.dataset)}return e}function Oy(n,t,e){const r=[];for(let i=0;i<e.length;i++){const a=e[i],{first:s,last:o,point:l}=Py(a,t,"x");if(!(!l||s&&o)){if(s)r.unshift(l);else if(n.push(l),!o)break}}n.push(...r)}function Py(n,t,e){const r=n.interpolate(t,e);if(!r)return{};const i=r[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],f=s[u.end][e];if(je(i,d,f)){o=i===d,l=i===f;break}}return{first:o,last:l,point:r}}class Ju{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,r){const{x:i,y:a,radius:s}=this;return e=e||{start:0,end:Ct},t.arc(i,a,s,e.end,e.start,!0),!r.bounds}interpolate(t){const{x:e,y:r,radius:i}=this,a=t.angle;return{x:e+Math.cos(a)*i,y:r+Math.sin(a)*i,angle:a}}}function Ey(n){const{chart:t,fill:e,line:r}=n;if(It(e))return Ry(t,e);if(e==="stack")return ky(n);if(e==="shape")return!0;const i=Ay(n);return i instanceof Ju?i:Qu(i,r)}function Ry(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Ay(n){return(n.scale||{}).getPointPositionForValue?Iy(n):Ly(n)}function Ly(n){const{scale:t={},fill:e}=n,r=My(e,t);if(It(r)){const i=t.isHorizontal();return{x:i?r:null,y:i?null:r}}return null}function Iy(n){const{scale:t,fill:e}=n,r=t.options,i=t.getLabels().length,a=r.reverse?t.max:t.min,s=Dy(e,t,a),o=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,a);return new Ju({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<i;++l)o.push(t.getPointPositionForValue(l,s));return o}function ys(n,t,e){const r=Ey(t),{line:i,scale:a,axis:s}=t,o=i.options,l=o.fill,c=o.backgroundColor,{above:u=c,below:d=c}=l||{};r&&i.points.length&&(Pr(n,e),Ny(n,{line:i,target:r,above:u,below:d,area:e,scale:a,axis:s}),Er(n))}function Ny(n,t){const{line:e,target:r,above:i,below:a,area:s,scale:o}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&a!==i&&(td(n,r,s.top),ed(n,{line:e,target:r,color:i,scale:o,property:l}),n.restore(),n.save(),td(n,r,s.bottom)),ed(n,{line:e,target:r,color:a,scale:o,property:l}),n.restore()}function td(n,t,e){const{segments:r,points:i}=t;let a=!0,s=!1;n.beginPath();for(const o of r){const{start:l,end:c}=o,u=i[l],d=i[ms(l,c,i)];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 ed(n,t){const{line:e,target:r,property:i,color:a,scale:s}=t,o=by(e,r,i);for(const{source:l,target:c,start:u,end:d}of o){const{style:{backgroundColor:f=a}={}}=l,p=r!==!0;n.save(),n.fillStyle=f,Fy(n,s,p&&gs(i,u,d)),n.beginPath();const y=!!e.pathSegment(n,l);let x;if(p){y?n.closePath():nd(n,r,d,i);const g=!!r.pathSegment(n,c,{move:y,reverse:!0});x=y&&g,x||nd(n,r,u,i)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function Fy(n,t,e){const{top:r,bottom:i}=t.chart.chartArea,{property:a,start:s,end:o}=e||{};a==="x"&&(n.beginPath(),n.rect(s,r,o-s,i-r),n.clip())}function nd(n,t,e,r){const i=t.interpolate(e,r);i&&n.lineTo(i.x,i.y)}var Uy={id:"filler",afterDatasetsUpdate(n,t,e){const r=(n.data.datasets||[]).length,i=[];let a,s,o,l;for(s=0;s<r;++s)a=n.getDatasetMeta(s),o=a.dataset,l=null,o&&o.options&&o instanceof gn&&(l={visible:n.isDatasetVisible(s),index:s,fill:wy(o,s,r),chart:n,axis:a.controller.options.indexAxis,scale:a.vScale,line:o}),a.$filler=l,i.push(l);for(s=0;s<r;++s)l=i[s],!(!l||l.fill===!1)&&(l.fill=_y(i,s,e.propagate))},beforeDraw(n,t,e){const r=e.drawTime==="beforeDraw",i=n.getSortedVisibleDatasetMetas(),a=n.chartArea;for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;o&&(o.line.updateControlPoints(a,o.axis),r&&o.fill&&ys(n.ctx,o,a))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const r=n.getSortedVisibleDatasetMetas();for(let i=r.length-1;i>=0;--i){const a=r[i].$filler;Zu(a)&&ys(n.ctx,a,n.chartArea)}},beforeDatasetDraw(n,t,e){const r=t.meta.$filler;!Zu(r)||e.drawTime!=="beforeDatasetDraw"||ys(n.ctx,r,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const rd=(n,t)=>{let{boxHeight:e=t,boxWidth:r=t}=n;return n.usePointStyle&&(e=Math.min(e,t),r=n.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:e,itemHeight:Math.max(t,e)}},By=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class id extends te{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,r){this.maxWidth=t,this.maxHeight=e,this._margins=r,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=Tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(r=>t.filter(r,this.chart.data))),t.sort&&(e=e.sort((r,i)=>t.sort(r,i,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 r=t.labels,i=Rt(r.font),a=i.size,s=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=rd(r,a);let c,u;e.font=i.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(s,a,o,l)+10):(u=this.maxHeight,c=this._fitCols(s,i,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,r,i){const{ctx:a,maxWidth:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=i+o;let d=t;a.textAlign="left",a.textBaseline="middle";let f=-1,p=-u;return this.legendItems.forEach((y,x)=>{const g=r+e/2+a.measureText(y.text).width;(x===0||c[c.length-1]+g+2*o>s)&&(d+=u,c[c.length-(x>0?0:1)]=0,p+=u,f++),l[x]={left:0,top:p,row:f,width:g,height:i},c[c.length-1]+=g+o}),d}_fitCols(t,e,r,i){const{ctx:a,maxHeight:s,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=s-t;let d=o,f=0,p=0,y=0,x=0;return this.legendItems.forEach((g,m)=>{const{itemWidth:v,itemHeight:b}=Wy(r,e,a,g,i);m>0&&p+b+2*o>u&&(d+=f+o,c.push({width:f,height:p}),y+=f+o,x++,f=p=0),l[m]={left:y,top:p,col:x,width:v,height:b},f=Math.max(f,v),p+=b+o}),d+=f,c.push({width:f,height:p}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:r,labels:{padding:i},rtl:a}}=this,s=rr(a,this.left,this.width);if(this.isHorizontal()){let o=0,l=re(r,this.left+i,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=re(r,this.left+i,this.right-this.lineWidths[o])),c.top+=this.top+t+i,c.left=s.leftForLtr(s.x(l),c.width),l+=c.width+i}else{let o=0,l=re(r,this.top+t+i,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=re(r,this.top+t+i,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+i,c.left=s.leftForLtr(s.x(c.left),c.width),l+=c.height+i}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Pr(t,this),this._draw(),Er(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:r,ctx:i}=this,{align:a,labels:s}=t,o=Ut.color,l=rr(t.rtl,this.left,this.width),c=Rt(s.font),{padding:u}=s,d=c.size,f=d/2;let p;this.drawTitle(),i.textAlign=l.textAlign("left"),i.textBaseline="middle",i.lineWidth=.5,i.font=c.string;const{boxWidth:y,boxHeight:x,itemHeight:g}=rd(s,d),m=function(S,C,M){if(isNaN(y)||y<=0||isNaN(x)||x<0)return;i.save();const D=rt(M.lineWidth,1);if(i.fillStyle=rt(M.fillStyle,o),i.lineCap=rt(M.lineCap,"butt"),i.lineDashOffset=rt(M.lineDashOffset,0),i.lineJoin=rt(M.lineJoin,"miter"),i.lineWidth=D,i.strokeStyle=rt(M.strokeStyle,o),i.setLineDash(rt(M.lineDash,[])),s.usePointStyle){const O={radius:x*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:D},P=l.xPlus(S,y/2),E=C+f;Ac(i,O,P,E,s.pointStyleWidth&&y)}else{const O=C+Math.max((d-x)/2,0),P=l.leftForLtr(S,y),E=dn(M.borderRadius);i.beginPath(),Object.values(E).some(F=>F!==0)?tr(i,{x:P,y:O,w:y,h:x,radius:E}):i.rect(P,O,y,x),i.fill(),D!==0&&i.stroke()}i.restore()},v=function(S,C,M){En(i,M.text,S,C+g/2,c,{strikethrough:M.hidden,textAlign:l.textAlign(M.textAlign)})},b=this.isHorizontal(),w=this._computeTitleHeight();b?p={x:re(a,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:p={x:this.left+u,y:re(a,this.top+w+u,this.bottom-e[0].height),line:0},jc(this.ctx,t.textDirection);const T=g+u;this.legendItems.forEach((S,C)=>{i.strokeStyle=S.fontColor,i.fillStyle=S.fontColor;const M=i.measureText(S.text).width,D=l.textAlign(S.textAlign||(S.textAlign=s.textAlign)),O=y+f+M;let P=p.x,E=p.y;l.setWidth(this.width),b?C>0&&P+O+u>this.right&&(E=p.y+=T,p.line++,P=p.x=re(a,this.left+u,this.right-r[p.line])):C>0&&E+T>this.bottom&&(P=p.x=P+e[p.line].width+u,p.line++,E=p.y=re(a,this.top+w+u,this.bottom-e[p.line].height));const F=l.x(P);if(m(F,E,S),P=cg(D,P+y+f,b?P+O:this.right,t.rtl),v(l.x(P),E,S),b)p.x+=O+u;else if(typeof S.text!="string"){const q=c.lineHeight;p.y+=ad(S,q)+u}else p.y+=T}),Vc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,r=Rt(e.font),i=Gt(e.padding);if(!e.display)return;const a=rr(t.rtl,this.left,this.width),s=this.ctx,o=e.position,l=r.size/2,c=i.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=re(t.align,d,this.right-f);else{const y=this.columnSizes.reduce((x,g)=>Math.max(x,g.height),0);u=c+re(t.align,this.top,this.bottom-y-t.labels.padding-this._computeTitleHeight())}const p=re(o,d,d+f);s.textAlign=a.textAlign(za(o)),s.textBaseline="middle",s.strokeStyle=e.color,s.fillStyle=e.color,s.font=r.string,En(s,e.text,p,u,r)}_computeTitleHeight(){const t=this.options.title,e=Rt(t.font),r=Gt(t.padding);return t.display?e.lineHeight+r.height:0}_getLegendItemAt(t,e){let r,i,a;if(je(t,this.left,this.right)&&je(e,this.top,this.bottom)){for(a=this.legendHitBoxes,r=0;r<a.length;++r)if(i=a[r],je(t,i.left,i.left+i.width)&&je(e,i.top,i.top+i.height))return this.legendItems[r]}return null}handleEvent(t){const e=this.options;if(!Hy(t.type,e))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const i=this._hoveredItem,a=By(i,r);i&&!a&&Tt(e.onLeave,[t,i,this],this),this._hoveredItem=r,r&&!a&&Tt(e.onHover,[t,r,this],this)}else r&&Tt(e.onClick,[t,r,this],this)}}function Wy(n,t,e,r,i){const a=zy(r,n,t,e),s=Yy(i,r,t.lineHeight);return{itemWidth:a,itemHeight:s}}function zy(n,t,e,r){let i=n.text;return i&&typeof i!="string"&&(i=i.reduce((a,s)=>a.length>s.length?a:s)),t+e.size/2+r.measureText(i).width}function Yy(n,t,e){let r=n;return typeof t.text!="string"&&(r=ad(t,e)),r}function ad(n,t){const e=n.text?n.text.length:0;return t*e}function Hy(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var $y={id:"legend",_element:id,start(n,t,e){const r=n.legend=new id({ctx:n.ctx,options:e,chart:n});ie.configure(n,r,e),ie.addBox(n,r)},stop(n){ie.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const r=n.legend;ie.configure(n,r,e),r.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 r=t.datasetIndex,i=e.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),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:r,textAlign:i,color:a,useBorderRadius:s,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Gt(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:r||c.pointStyle,rotation:c.rotation,textAlign:i||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 vs extends te{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 r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const i=mt(r.text)?r.text.length:1;this._padding=Gt(r.padding);const a=i*Rt(r.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:r,bottom:i,right:a,options:s}=this,o=s.align;let l=0,c,u,d;return this.isHorizontal()?(u=re(o,r,a),d=e+t,c=a-r):(s.position==="left"?(u=r+t,d=re(o,i,e),l=dt*-.5):(u=a-t,d=re(o,e,i),l=dt*.5),c=i-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const r=Rt(e.font),a=r.lineHeight/2+this._padding.top,{titleX:s,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(a);En(t,e.text,0,0,r,{color:e.color,maxWidth:l,rotation:c,textAlign:za(e.align),textBaseline:"middle",translation:[s,o]})}}function jy(n,t){const e=new vs({ctx:n.ctx,options:t,chart:n});ie.configure(n,e,t),ie.addBox(n,e),n.titleBlock=e}var Vy={id:"title",_element:vs,start(n,t,e){jy(n,e)},stop(n){const t=n.titleBlock;ie.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const r=n.titleBlock;ie.configure(n,r,e),r.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 Hi=new WeakMap;var qy={id:"subtitle",start(n,t,e){const r=new vs({ctx:n.ctx,options:e,chart:n});ie.configure(n,r,e),ie.addBox(n,r),Hi.set(n,r)},stop(n){ie.removeBox(n,Hi.get(n)),Hi.delete(n)},beforeUpdate(n,t,e){const r=Hi.get(n);ie.configure(n,r,e),r.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 jr={average(n){if(!n.length)return!1;let t,e,r=new Set,i=0,a=0;for(t=0,e=n.length;t<e;++t){const o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();r.add(l.x),i+=l.y,++a}}return{x:[...r].reduce((o,l)=>o+l)/r.size,y:i/a}},nearest(n,t){if(!n.length)return!1;let e=t.x,r=t.y,i=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=Jn(t,c);u<i&&(i=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,r=l.y}return{x:e,y:r}}};function Ne(n,t){return t&&(mt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Ge(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
16
+ */class tg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],o=e.duration;r.forEach(a=>a({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=La.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let o=r.length-1,a=!1,l;for(;o>=0;--o)l=r[o],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(r[o]=r[r.length-1],r.pop());a&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ie=new tg;const ul="transparent",eg={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ha(n||ul),s=i.valid&&Ha(t||ul);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class ng{constructor(t,e,i,s){const r=e[i];s=fi([t.to,s,r,t.from]);const o=fi([t.from,r,s]);this._active=!0,this._fn=t.fn||eg[t.type||typeof o],this._easing=li[t.easing]||li.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=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,o=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=fi([t.to,e,s,t.from]),this._from=fi([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,o=this._loop,a=this._to;let l;if(this._active=r!==a&&(o||e<i),!this._active){this._target[s]=a,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class Pr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!it(t))return;const e=Object.keys(Tt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!it(r))return;const o={};for(const a of e)o[a]=r[a];(ot(r.properties)&&r.properties||[s]).forEach(a=>{(a===s||!i.has(a))&&i.set(a,o)})})}_animateOptions(t,e){const i=e.options,s=sg(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&ig(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let d=r[c];const f=i.get(c);if(d)if(f&&d.active()){d.update(f,u,a);continue}else d.cancel();if(!f||!f.duration){t[c]=u;continue}r[c]=d=new ng(f,t,c,u),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Ie.add(this._chart,i),!0}}function ig(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function sg(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 dl(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function rg(n,t,e){if(e===!1)return!1;const i=dl(n,e),s=dl(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function og(n){let t,e,i,s;return it(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function hl(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function fl(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let o,a,l,c;if(t!==null){for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===e){if(i.all)continue;break}c=n.values[l],vt(c)&&(r||t===0||Se(t)===Se(c))&&(t+=c)}return t}}function ag(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",o=Object.keys(n),a=new Array(o.length);let l,c,u;for(l=0,c=o.length;l<c;++l)u=o[l],a[l]={[s]:u,[r]:n[u]};return a}function gl(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function lg(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function cg(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function ug(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function pl(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function ml(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:o,index:a}=i,l=r.axis,c=o.axis,u=lg(r,o,i),d=t.length;let f;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:_}=p,w=p._stacks||(p._stacks={});f=w[c]=ug(s,u,y),f[a]=_,f._top=pl(f,o,!0,i.type),f._bottom=pl(f,o,!1,i.type);const S=f._visualValues||(f._visualValues={});S[a]=_}}function Er(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function dg(n,t){return Ze(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function hg(n,t,e){return Ze(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function gi(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const Rr=n=>n==="reset"||n==="none",yl=(n,t)=>t?n:Object.assign({},n),fg=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:hl(e,!0),values:null};class be{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=gl(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&gi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,f,g,p)=>d==="x"?f:d==="r"?p:g,r=e.xAxisID=Z(i.xAxisID,Er(t,"x")),o=e.yAxisID=Z(i.yAxisID,Er(t,"y")),a=e.rAxisID=Z(i.rAxisID,Er(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,o,a),u=e.vAxisID=s(l,o,r,a);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),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&&Ra(this._data,this),t._stacked&&gi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(it(e)){const s=this._cachedMeta;this._data=ag(e,s)}else if(i!==e){if(i){Ra(i,this);const s=this._cachedMeta;gi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Zh(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=gl(e.vScale,e),e.stack!==i.stack&&(s=!0,gi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&ml(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:s}=this,{iScale:r,_stacked:o}=i,a=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,d,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{ot(s[t])?f=this.parseArrayData(i,s,t,e):it(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const g=()=>d[a]===null||c&&d[a]<c[a];for(u=0;u<e;++u)i._parsed[u+t]=d=f[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&ml(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:o}=t,a=r.axis,l=o.axis,c=r.getLabels(),u=r===o,d=new Array(s);let f,g,p;for(f=0,g=s;f<g;++f)p=f+i,d[f]={[a]:u||r.parse(c[p],p),[l]:o.parse(e[p],p)};return d}parseArrayData(t,e,i,s){const{xScale:r,yScale:o}=t,a=new Array(s);let l,c,u,d;for(l=0,c=s;l<c;++l)u=l+i,d=e[u],a[l]={x:r.parse(d[0],u),y:o.parse(d[1],u)};return a}parseObjectData(t,e,i,s){const{xScale:r,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,d,f,g;for(u=0,d=s;u<d;++u)f=u+i,g=e[f],c[u]={x:r.parse(qe(g,a),f),y:o.parse(qe(g,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,o=e[t.axis],a={keys:hl(s,!0),values:e._stacks[t.axis]._visualValues};return fl(a,o,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let o=r===null?NaN:r;const a=s&&i._stacks[e.axis];s&&a&&(s.values=a,o=fl(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,o=s.length,a=this._getOtherScale(t),l=fg(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=cg(a);let f,g;function p(){g=s[f];const y=g[a.axis];return!vt(g[t.axis])||u>y||d<y}for(f=0;f<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++f);if(r){for(f=o-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,g,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,o;for(s=0,r=e.length;s<r;++s)o=e[s][t.axis],vt(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=og(Z(this.options.clip,rg(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,a,l),u=a;u<a+l;++u){const d=s[u];d.hidden||(d.active&&c?o.push(d):d.draw(t,r))}for(u=0;u<o.length;++u)o[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];r=o.$context||(o.$context=hg(this.getContext(),t,o)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=dg(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,o=t+"-"+e,a=r[o],l=this.enableOptionSharing&&Qt(i);if(a)return yl(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Tt.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(f,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(yl(y,l))),y}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,o=`animation-${e}`,a=r[o];if(a)return a;let l;if(s.options.animation!==!1){const u=this.chart.config,d=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(f,this.getContext(t,i,e))}const c=new Pr(s,l&&l.animations);return l&&l._cacheable&&(r[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Rr(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),o=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:o}}updateElement(t,e,i,s){Rr(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Rr(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=i.length,r=e.length,o=Math.min(r,s);o&&this.parse(0,o),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,o=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=o;a--)c[a]=c[a-e]};for(l(r),a=t;a<o;++a)r[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&gi(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}O(be,"defaults",{}),O(be,"datasetElementType",null),O(be,"dataElementType",null);function gg(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Aa(i.sort((s,r)=>s-r))}return n._cache.$bar}function pg(n){const t=n.iScale,e=gg(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(Qt(a)&&(i=Math.min(i,Math.abs(o-a)||i)),a=o)};for(s=0,r=e.length;s<r;++s)o=t.getPixelForValue(e[s]),l();for(a=void 0,s=0,r=t.ticks.length;s<r;++s)o=t.getPixelForTick(s),l();return i}function mg(n,t,e,i){const s=e.barThickness;let r,o;return tt(s)?(r=t.min*e.categoryPercentage,o=e.barPercentage):(r=s*i,o=1),{chunk:r/i,ratio:o,start:t.pixels[n]-r/2}}function yg(n,t,e,i){const s=t.pixels,r=s[n];let o=n>0?s[n-1]:null,a=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;o===null&&(o=r-(a===null?t.end-t.start:a-r)),a===null&&(a=r+r-o);const c=r-(r-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/i,ratio:e.barPercentage,start:c}}function bg(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),o=Math.min(s,r),a=Math.max(s,r);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:o,max:a}}function bl(n,t,e,i){return ot(n)?bg(n,t,e,i):t[e.axis]=e.parse(n,i),t}function _l(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,f;for(c=e,u=e+i;c<u;++c)f=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(bl(f,d,r,c));return l}function Ar(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function _g(n,t,e){return n!==0?Se(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function xg(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function wg(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:u}=xg(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[xl(u,o,a,l)]=!0,s=c)),r[xl(s,o,a,l)]=!0,n.borderSkipped=r}function xl(n,t,e,i){return i?(n=kg(n,t,e),n=wl(n,e,t)):n=wl(n,t,e),n}function kg(n,t,e){return n===t?e:n===e?t:n}function wl(n,t,e){return n==="start"?t:n==="end"?e:n}function Sg(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class pi extends be{parsePrimitiveData(t,e,i,s){return _l(t,e,i,s)}parseArrayData(t,e,i,s){return _l(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?a:l,u=o.axis==="x"?a:l,d=[];let f,g,p,y;for(f=i,g=i+s;f<g;++f)y=e[f],p={},p[r.axis]=r.parse(qe(y,c),f),d.push(bl(qe(y,u),p,o,f));return d}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),o=r._custom,a=Ar(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),u=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(e,s);for(let g=e;g<e+i;g++){const p=this.getParsed(g),y=r||tt(p[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(g),_=this._calculateBarIndexPixels(g,u),w=(p._stacks||{})[a.axis],S={horizontal:c,base:y.base,enableBorderRadius:!w||Ar(p._custom)||o===w._top||o===w._bottom,x:c?y.head:_.center,y:c?_.center:y.head,height:c?_.size:Math.abs(y.size),width:c?Math.abs(y.size):_.size};f&&(S.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const v=S.options||t[g].options;wg(S,v,w,o),Sg(S,v,u.ratio),this.updateElement(t[g],g,S,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),r=i.options.stacked,o=[],a=l=>{const c=l.controller.getParsed(e),u=c&&c[l.vScale.axis];if(tt(u)||isNaN(u))return!0};for(const l of s)if(!(e!==void 0&&a(l))&&((r===!1||o.indexOf(l.stack)===-1||r===void 0&&l.stack===void 0)&&o.push(l.stack),l.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,o;for(r=0,o=e.data.length;r<o;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const a=t.barThickness;return{min:a||pg(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:o}}=this,a=r||0,l=this.getParsed(t),c=l._custom,u=Ar(c);let d=l[e.axis],f=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(f=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&Se(d)!==Se(c.barEnd)&&(f=0),f+=d);const _=!tt(r)&&!u?r:f;let w=e.getPixelForValue(_);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+g):p=w,y=p-w,Math.abs(y)<o){y=_g(y,e,a)*o,d===a&&(w-=y/2);const S=e.getPixelForDecimal(0),v=e.getPixelForDecimal(1),P=Math.min(S,v),M=Math.max(S,v);w=Math.max(Math.min(w,M),P),p=w+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(w))}if(w===e.getPixelForValue(a)){const S=Se(y)*e.getLineWidthForValue(a)/2;w+=S,y-=S}return{size:y,base:w,head:p,center:p+y/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,o=Z(s.maxBarThickness,1/0);let a,l;if(e.grouped){const c=r?this._getStackCount(t):e.stackCount,u=s.barThickness==="flex"?yg(t,e,s,c):mg(t,e,s,c),d=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0);a=u.start+u.chunk*d+u.chunk/2,l=Math.min(o,u.chunk*u.ratio)}else a=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(o,e.min*e.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}O(pi,"id","bar"),O(pi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),O(pi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class as extends be{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let o=0;o<r.length;o++)r[o]._custom=this.resolveDataElementOptions(o+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=Z(a[2],this.resolveDataElementOptions(o+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let o=0;o<r.length;o++){const a=e[i+o];r[o]._custom=Z(a&&a.r&&+a.r,this.resolveDataElementOptions(o+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y),c=o._custom;return{label:i[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=o.axis,d=a.axis;for(let f=e;f<e+i;f++){const g=t[f],p=!r&&this.getParsed(f),y={},_=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),w=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(_)||isNaN(w),c&&(y.options=l||this.resolveDataElementOptions(f,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,f,y,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=Z(i&&i._custom,r),s}}O(as,"id","bubble"),O(as,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),O(as,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function vg(n,t,e){let i=1,s=1,r=0,o=0;if(t<mt){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),f=Math.sin(l),g=(v,P,M)=>ai(v,a,l,!0)?1:Math.max(P,P*e,M,M*e),p=(v,P,M)=>ai(v,a,l,!0)?-1:Math.min(P,P*e,M,M*e),y=g(0,c,d),_=g(bt,u,f),w=p(rt,c,d),S=p(rt+bt,u,f);i=(y-w)/2,s=(_-S)/2,r=-(y+w)/2,o=-(_+S)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class Je extends be{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(it(i[t])){const{key:l="value"}=this._parsing;r=c=>+qe(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Nt(this.options.rotation-90)}_getCircumference(){return Nt(this.options.circumference)}_getRotationExtents(){let t=mt,e=-mt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),o=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+o)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,a=Math.max((Math.min(i.width,i.height)-o)/2,0),l=Math.min(Bh(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=vg(d,u,l),_=(i.width-o)/f,w=(i.height-o)/g,S=Math.max(Math.min(_,w)/2,0),v=Sa(this.options.radius,S),P=Math.max(v*l,0),M=(v-P)/this._getVisibleDatasetWeightTotal();this.offsetX=p*v,this.offsetY=y*v,s.total=this.calculateTotal(),this.outerRadius=v-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/mt)}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,u=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=r&&c.animateScale,g=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:y,includeOptions:_}=this._getSharedOptions(e,s);let w=this._getRotation(),S;for(S=0;S<e;++S)w+=this._circumference(S,r);for(S=e;S<e+i;++S){const v=this._circumference(S,r),P=t[S],M={x:u+this.offsetX,y:d+this.offsetY,startAngle:w,endAngle:w+v,circumference:v,outerRadius:p,innerRadius:g};_&&(M.options=y||this.resolveDataElementOptions(S,P.active?"active":s)),w+=v,this.updateElement(P,S,M,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?mt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ci(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,o,a,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){o=i.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.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(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}O(Je,"id","doughnut"),O(Je,"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"}),O(Je,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(Je,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class mi extends be{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,o=this.chart._animationsDisabled;let{start:a,count:l}=Na(e,s,o);this._drawStart=a,this._drawCount=l,Fa(e)&&(a=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:d}=this._getSharedOptions(e,s),f=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,_=Ge(p)?p:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||r||s==="none",S=e+i,v=t.length;let P=e>0&&this.getParsed(e-1);for(let M=0;M<v;++M){const C=t[M],T=w?C:{};if(M<e||M>=S){T.skip=!0;continue}const b=this.getParsed(M),x=tt(b[g]),D=T[f]=o.getPixelForValue(b[f],M),E=T[g]=r||x?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,b,l):b[g],M);T.skip=isNaN(D)||isNaN(E)||x,T.stop=M>0&&Math.abs(b[f]-P[f])>_,y&&(T.parsed=b,T.raw=c.data[M]),d&&(T.options=u||this.resolveDataElementOptions(M,C.active?"active":s)),w||this.updateElement(C,M,T,s),P=b}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}O(mi,"id","line"),O(mi,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(mi,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class yi extends be{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ci(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return Qa.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),o=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),a=(r-o)/t.getVisibleDatasetCount();this.outerRadius=r-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,i,s){const r=s==="reset",o=this.chart,l=o.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,d=c.yCenter,f=c.getIndexAngle(0)-.5*rt;let g=f,p;const y=360/this.countVisibleElements();for(p=0;p<e;++p)g+=this._computeAngle(p,s,y);for(p=e;p<e+i;p++){const _=t[p];let w=g,S=g+this._computeAngle(p,s,y),v=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=S,r&&(l.animateScale&&(v=0),l.animateRotate&&(w=S=f));const P={x:u,y:d,innerRadius:0,outerRadius:v,startAngle:w,endAngle:S,options:this.resolveDataElementOptions(p,_.active?"active":s)};this.updateElement(_,p,P,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Nt(this.resolveDataElementOptions(t,e).angle||i):0}}O(yi,"id","polarArea"),O(yi,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(yi,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,o)=>{const l=t.getDatasetMeta(0).controller.getStyle(o);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(o),index:o}})}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 Lr extends Je{}O(Lr,"id","pie"),O(Lr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ls extends be{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return Qa.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const o=this.resolveDatasetElementOptions(t);this.options.showLine||(o.borderWidth=0);const a={_loop:!0,_fullLoop:r.length===s.length,options:o};this.updateElement(i,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,o=s==="reset";for(let a=e;a<e+i;a++){const l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),u=r.getPointPositionForValue(a,this.getParsed(a).r),d=o?r.xCenter:u.x,f=o?r.yCenter:u.y,g={x:d,y:f,angle:u.angle,skip:isNaN(d)||isNaN(f),options:c};this.updateElement(l,a,g,s)}}}O(ls,"id","radar"),O(ls,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),O(ls,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class cs extends be{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,o=this.getParsed(t),a=s.getLabelForValue(o.x),l=r.getLabelForValue(o.y);return{label:i[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:o}=Na(e,i,s);if(this._drawStart=r,this._drawCount=o,Fa(e)&&(r=0,o=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,o,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:o,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),d=this.getSharedOptions(u),f=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:_}=this.options,w=Ge(y)?y:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||s==="none";let v=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const M=t[P],C=this.getParsed(P),T=S?M:{},b=tt(C[p]),x=T[g]=o.getPixelForValue(C[g],P),D=T[p]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,C,l):C[p],P);T.skip=isNaN(x)||isNaN(D)||b,T.stop=P>0&&Math.abs(C[g]-v[g])>w,_&&(T.parsed=C,T.raw=c.data[P]),f&&(T.options=d||this.resolveDataElementOptions(P,M.active?"active":s)),S||this.updateElement(M,P,T,s),v=C}this.updateSharedOptions(d,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),o=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,o)/2}}O(cs,"id","scatter"),O(cs,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(cs,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Dg=Object.freeze({__proto__:null,BarController:pi,BubbleController:as,DoughnutController:Je,LineController:mi,PieController:Lr,PolarAreaController:yi,RadarController:ls,ScatterController:cs});function _n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ir{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(Ir.prototype,t)}init(){}formats(){return _n()}parse(){return _n()}format(){return _n()}add(){return _n()}diff(){return _n()}startOf(){return _n()}endOf(){return _n()}}var kl={_date:Ir};function Mg(n,t,e,i){const{controller:s,data:r,_sorted:o}=n,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&o&&r.length){const l=a._reversePixels?Gh:Ae;if(i){if(s._sharedOptions){const c=r[0],u=typeof c.getRange=="function"&&c.getRange(t);if(u){const d=l(r,t,e-u),f=l(r,t,e+u);return{lo:d.lo,hi:f.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function bi(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),o=e[t];for(let a=0,l=r.length;a<l;++a){const{index:c,data:u}=r[a],{lo:d,hi:f}=Mg(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Tg(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,o=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(o,2))}}function Nr(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||bi(n,e,t,function(a,l,c){!s&&!Le(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Cg(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Pa(o,{x:t.x,y:t.y});ai(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return bi(n,e,t,r),s}function Og(n,t,e,i,s,r){let o=[];const a=Tg(e);let l=Number.POSITIVE_INFINITY;function c(u,d,f){const g=u.inRange(t.x,t.y,s);if(i&&!g)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!g)return;const _=a(t,p);_<l?(o=[{element:u,datasetIndex:d,index:f}],l=_):_===l&&o.push({element:u,datasetIndex:d,index:f})}return bi(n,e,t,c),o}function Fr(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Cg(n,t,e,s):Og(n,t,e,i,s,r)}function Sl(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return bi(n,e,t,(l,c,u)=>{l[o](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),a=a||l.inRange(t.x,t.y,s))}),i&&!a?[]:r}var Br={evaluateInteractionItems:bi,modes:{index(n,t,e,i){const s=Qe(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?Nr(n,s,r,i,o):Fr(n,s,r,!1,i,o),l=[];return a.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const u=a[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 s=Qe(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?Nr(n,s,r,i,o):Fr(n,s,r,!1,i,o);if(a.length>0){const l=a[0].datasetIndex,c=n.getDatasetMeta(l).data;a=[];for(let u=0;u<c.length;++u)a.push({element:c[u],datasetIndex:l,index:u})}return a},point(n,t,e,i){const s=Qe(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Nr(n,s,r,i,o)},nearest(n,t,e,i){const s=Qe(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Fr(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=Qe(t,n);return Sl(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Qe(t,n);return Sl(n,s,"y",e.intersect,i)}}};const vl=["left","top","right","bottom"];function _i(n,t){return n.filter(e=>e.pos===t)}function Dl(n,t){return n.filter(e=>vl.indexOf(e.pos)===-1&&e.box.axis===t)}function xi(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function Pg(n){const t=[];let e,i,s,r,o,a;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:o,stackWeight:a=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&r+o,stackWeight:a});return t}function Eg(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!vl.includes(s))continue;const o=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=r}return t}function Rg(n,t){const e=Eg(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,o,a;for(r=0,o=n.length;r<o;++r){a=n[r];const{fullSize:l}=a.box,c=e[a.stack],u=c&&a.stackWeight/c.weight;a.horizontal?(a.width=u?u*i:l&&t.availableWidth,a.height=s):(a.width=i,a.height=u?u*s:l&&t.availableHeight)}return e}function Ag(n){const t=Pg(n),e=xi(t.filter(c=>c.box.fullSize),!0),i=xi(_i(t,"left"),!0),s=xi(_i(t,"right")),r=xi(_i(t,"top"),!0),o=xi(_i(t,"bottom")),a=Dl(t,"x"),l=Dl(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:_i(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function Ml(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Tl(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 Lg(n,t,e,i){const{pos:s,box:r}=e,o=n.maxPadding;if(!it(s)){e.size&&(n[s]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?r.height:r.width),e.size=d.size/d.count,n[s]+=e.size}r.getPadding&&Tl(o,r.getPadding());const a=Math.max(0,t.outerWidth-Ml(o,n,"left","right")),l=Math.max(0,t.outerHeight-Ml(o,n,"top","bottom")),c=a!==n.w,u=l!==n.h;return n.w=a,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Ig(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Ng(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{r[o]=Math.max(t[o],e[o])}),r}return i(n?["left","right"]:["top","bottom"])}function wi(n,t,e,i){const s=[];let r,o,a,l,c,u;for(r=0,o=n.length,c=0;r<o;++r){a=n[r],l=a.box,l.update(a.width||t.w,a.height||t.h,Ng(a.horizontal,t));const{same:d,other:f}=Lg(t,e,a,i);c|=d&&s.length,u=u||f,l.fullSize||s.push(a)}return c&&wi(s,t,e,i)||u}function us(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Cl(n,t,e,i){const s=e.padding;let{x:r,y:o}=t;for(const a of n){const l=a.box,c=i[a.stack]||{count:1,placed:0,weight:1},u=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*u,f=c.size||l.height;Qt(c.start)&&(o=c.start),l.fullSize?us(l,s.left,o,e.outerWidth-s.right-s.left,f):us(l,t.left+c.placed,o,d,f),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,f=c.size||l.width;Qt(c.start)&&(r=c.start),l.fullSize?us(l,r,s.top,f,e.outerHeight-s.bottom-s.top):us(l,r,t.top+c.placed,f,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var qt={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=Ft(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=Ag(n.boxes),l=a.vertical,c=a.horizontal;dt(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,_)=>_.box.options&&_.box.options.display===!1?y:y+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:o,vBoxMaxWidth:r/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},s);Tl(f,Ft(i));const g=Object.assign({maxPadding:f,w:r,h:o,x:s.left,y:s.top},s),p=Rg(l.concat(c),d);wi(a.fullSize,g,d,p),wi(l,g,d,p),wi(c,g,d,p)&&wi(l,g,d,p),Ig(g),Cl(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,Cl(a.rightAndBottom,g,d,p),n.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},dt(a.chartArea,y=>{const _=y.box;Object.assign(_,n.chartArea),_.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Ol{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Fg extends Ol{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ds="$chartjs",Bg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pl=n=>n===null||n==="";function zg(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ds]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Pl(s)){const r=el(n,"width");r!==void 0&&(n.width=r)}if(Pl(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=el(n,"height");r!==void 0&&(n.height=r)}return n}const El=Vf?{passive:!0}:!1;function Hg(n,t,e){n&&n.addEventListener(t,e,El)}function Wg(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,El)}function Yg(n,t){const e=Bg[n.type]||n.type,{x:i,y:s}=Qe(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function hs(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Vg(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hs(a.addedNodes,i),o=o&&!hs(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function jg(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||hs(a.removedNodes,i),o=o&&!hs(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ki=new Map;let Rl=0;function Al(){const n=window.devicePixelRatio;n!==Rl&&(Rl=n,ki.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function $g(n,t){ki.size||window.addEventListener("resize",Al),ki.set(n,t)}function Ug(n){ki.delete(n),ki.size||window.removeEventListener("resize",Al)}function qg(n,t,e){const i=n.canvas,s=i&&Or(i);if(!s)return;const r=Ia((a,l)=>{const c=s.clientWidth;e(a,l),c<s.clientWidth&&e()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return o.observe(s),$g(n,r),o}function zr(n,t,e){e&&e.disconnect(),t==="resize"&&Ug(n)}function Xg(n,t,e){const i=n.canvas,s=Ia(r=>{n.ctx!==null&&e(Yg(r,n))},n);return Hg(i,t,s),s}class Gg extends Ol{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(zg(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[ds])return!1;const i=e[ds].initial;["height","width"].forEach(r=>{const o=i[r];tt(o)?e.removeAttribute(r):e.setAttribute(r,o)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[ds],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:Vg,detach:jg,resize:qg}[e]||Xg;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:zr,detach:zr,resize:zr}[e]||Wg)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Yf(t,e,i,s)}isAttached(t){const e=t&&Or(t);return!!(e&&e.isConnected)}}function Kg(n){return!Cr()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Fg:Gg}class Vt{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Ge(this.x)&&Ge(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}O(Vt,"defaults",{}),O(Vt,"defaultRoutes");function Zg(n,t){const e=n.options.ticks,i=Qg(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?tp(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return ep(t,c,r,o/s),c;const u=Jg(r,t,s);if(o>0){let d,f;const g=o>1?Math.round((l-a)/(o-1)):null;for(fs(t,c,u,tt(g)?0:a-g,a),d=0,f=o-1;d<f;d++)fs(t,c,u,r[d],r[d+1]);return fs(t,c,u,l,tt(g)?t.length:l+g),c}return fs(t,c,u),c}function Qg(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Jg(n,t,e){const i=np(n),s=t.length/e;if(!i)return Math.max(s,1);const r=$h(i);for(let o=0,a=r.length-1;o<a;o++){const l=r[o];if(l>s)return l}return Math.max(s,1)}function tp(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function ep(n,t,e,i){let s=0,r=e[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===r&&(t.push(n[o]),s++,r=e[s*i])}function fs(n,t,e,i,s){const r=Z(i,0),o=Math.min(Z(s,n.length),n.length);let a=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)a++,u=Math.round(r+a*e);for(c=Math.max(r,0);c<o;c++)c===u&&(t.push(n[c]),a++,u=Math.round(r+a*e))}function np(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 ip=n=>n==="left"?"right":n==="right"?"left":n,Ll=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Il=(n,t)=>Math.min(t||n,n);function Nl(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function sp(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,o=n._endPixel,a=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,o-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-a||l>o+a)))return l}function rp(n,t){dt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function Si(n){return n.drawTicks?n.tickLength:0}function Fl(n,t){if(!n.display)return 0;const e=_t(n.font,t),i=Ft(n.padding);return(ot(n.text)?n.text.length:1)*e.lineHeight+i.height}function op(n,t){return Ze(n,{scale:t,type:"scale"})}function ap(n,t,e){return Ze(n,{tick:e,index:t,type:"tick"})}function lp(n,t,e){let i=br(n);return(e&&t!=="right"||!e&&t==="right")&&(i=ip(i)),i}function cp(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,f,g,p;const y=o-s,_=a-r;if(n.isHorizontal()){if(g=Ut(i,r,a),it(e)){const w=Object.keys(e)[0],S=e[w];p=u[w].getPixelForValue(S)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=Ll(n,e,t);f=a-r}else{if(it(e)){const w=Object.keys(e)[0],S=e[w];g=u[w].getPixelForValue(S)-_+t}else e==="center"?g=(c.left+c.right)/2-_+t:g=Ll(n,e,t);p=Ut(i,o,s),d=e==="left"?-bt:bt}return{titleX:g,titleY:p,maxWidth:f,rotation:d}}class xn extends Vt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=le(t,Number.POSITIVE_INFINITY),e=le(e,Number.NEGATIVE_INFINITY),i=le(i,Number.POSITIVE_INFINITY),s=le(s,Number.NEGATIVE_INFINITY),{min:le(t,i),max:le(e,s),minDefined:vt(t),maxDefined:vt(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),o;if(s&&r)return{min:e,max:i};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(e=Math.min(e,o.min)),r||(i=Math.max(i,o.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:le(e,le(i,e)),max:le(i,le(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(){ut(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:o}=this.options,a=o.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=xf(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Nl(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=Zg(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(){ut(this.options.afterUpdate,[this])}beforeSetDimensions(){ut(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(){ut(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ut(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ut(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=ut(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){ut(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ut(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Il(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),d=u.widest.width,f=u.highest.height,g=zt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:g/(i-1),d+6>a&&(a=g/(i-(t.offset?.5:1)),l=this.maxHeight-Si(t.grid)-e.padding-Fl(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),o=Ji(Math.min(Math.asin(zt((u.highest.height+6)/a,-1,1)),Math.asin(zt(l/c,-1,1))-Math.asin(zt(f/c,-1,1)))),o=Math.max(s,Math.min(r,o))),this.labelRotation=o}afterCalculateLabelRotation(){ut(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ut(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Fl(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Si(r)+l):(t.height=this.maxHeight,t.width=Si(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:f}=this._getLabelSizes(),g=i.padding*2,p=Nt(this.labelRotation),y=Math.cos(p),_=Math.sin(p);if(a){const w=i.mirror?0:_*d.width+y*f.height;t.height=Math.min(this.maxHeight,t.height+w+g)}else{const w=i.mirror?0:y*d.width+_*f.height;t.width=Math.min(this.maxWidth,t.width+w+g)}this._calculatePadding(c,u,_,y)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,g=0;l?c?(f=s*t.width,g=i*e.height):(f=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,g=e.width/2),this.paddingLeft=Math.max((f-u+o)*this.width/(this.width-u),0),this.paddingRight=Math.max((g-d+o)*this.width/(this.width-d),0)}else{let u=e.height/2,d=t.height/2;r==="start"?(u=0,d=t.height):r==="end"&&(u=e.height,d=0),this.paddingTop=u+o,this.paddingBottom=d+o}}_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(){ut(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++)tt(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=Nl(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,o=[],a=[],l=Math.floor(e/Il(e,i));let c=0,u=0,d,f,g,p,y,_,w,S,v,P,M;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=_=y.string,w=r[_]=r[_]||{data:{},gc:[]},S=y.lineHeight,v=P=0,!tt(p)&&!ot(p))v=ns(s,w.data,w.gc,v,p),P=S;else if(ot(p))for(f=0,g=p.length;f<g;++f)M=p[f],!tt(M)&&!ot(M)&&(v=ns(s,w.data,w.gc,v,M),P+=S);o.push(v),a.push(P),c=Math.max(v,c),u=Math.max(P,u)}rp(r,e);const C=o.indexOf(c),T=a.indexOf(u),b=x=>({width:o[x]||0,height:a[x]||0});return{first:b(0),last:b(e-1),widest:b(C),highest:b(T),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Xh(this._alignToPixels?pn(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=ap(this.getContext(),t,i))}return this.$context||(this.$context=op(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Nt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),o=t.autoSkipPadding||0,a=r?r.widest.width+o:0,l=r?r.highest.height+o:0;return this.isHorizontal()?l*i>a*s?a/i:l/s:l*s<a*i?l/i:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:o,border:a}=s,l=r.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Si(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,_=y/2,w=function(j){return pn(i,j,y)};let S,v,P,M,C,T,b,x,D,E,A,F;if(o==="top")S=w(this.bottom),T=this.bottom-f,x=S-_,E=w(t.top)+_,F=t.bottom;else if(o==="bottom")S=w(this.top),E=t.top,F=w(t.bottom)-_,T=S+_,x=this.top+f;else if(o==="left")S=w(this.right),C=this.right-f,b=S-_,D=w(t.left)+_,A=t.right;else if(o==="right")S=w(this.left),D=t.left,A=w(t.right)-_,C=S+_,b=this.left+f;else if(e==="x"){if(o==="center")S=w((t.top+t.bottom)/2+.5);else if(it(o)){const j=Object.keys(o)[0],N=o[j];S=w(this.chart.scales[j].getPixelForValue(N))}E=t.top,F=t.bottom,T=S+_,x=T+f}else if(e==="y"){if(o==="center")S=w((t.left+t.right)/2);else if(it(o)){const j=Object.keys(o)[0],N=o[j];S=w(this.chart.scales[j].getPixelForValue(N))}C=S-_,b=C-f,D=t.left,A=t.right}const $=Z(s.ticks.maxTicksLimit,d),K=Math.max(1,Math.ceil(d/$));for(v=0;v<d;v+=K){const j=this.getContext(v),N=r.setContext(j),st=a.setContext(j),B=N.lineWidth,At=N.color,wt=st.dash||[],H=st.dashOffset,L=N.tickWidth,z=N.tickColor,V=N.tickBorderDash||[],q=N.tickBorderDashOffset;P=sp(this,v,l),P!==void 0&&(M=pn(i,P,B),c?C=b=D=A=M:T=x=E=F=M,g.push({tx1:C,ty1:T,tx2:b,ty2:x,x1:D,y1:E,x2:A,y2:F,width:B,color:At,borderDash:wt,borderDashOffset:H,tickWidth:L,tickColor:z,tickBorderDash:V,tickBorderDashOffset:q}))}return this._ticksLength=d,this._borderValue=S,g}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:u,mirror:d}=r,f=Si(i.grid),g=f+u,p=d?-u:g,y=-Nt(this.labelRotation),_=[];let w,S,v,P,M,C,T,b,x,D,E,A,F="middle";if(s==="top")C=this.bottom-p,T=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,T=this._getXAxisLabelAlignment();else if(s==="left"){const K=this._getYAxisLabelAlignment(f);T=K.textAlign,M=K.x}else if(s==="right"){const K=this._getYAxisLabelAlignment(f);T=K.textAlign,M=K.x}else if(e==="x"){if(s==="center")C=(t.top+t.bottom)/2+g;else if(it(s)){const K=Object.keys(s)[0],j=s[K];C=this.chart.scales[K].getPixelForValue(j)+g}T=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")M=(t.left+t.right)/2-g;else if(it(s)){const K=Object.keys(s)[0],j=s[K];M=this.chart.scales[K].getPixelForValue(j)}T=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const $=this._getLabelSizes();for(w=0,S=a.length;w<S;++w){v=a[w],P=v.label;const K=r.setContext(this.getContext(w));b=this.getPixelForTick(w)+r.labelOffset,x=this._resolveTickFontOptions(w),D=x.lineHeight,E=ot(P)?P.length:1;const j=E/2,N=K.color,st=K.textStrokeColor,B=K.textStrokeWidth;let At=T;o?(M=b,T==="inner"&&(w===S-1?At=this.options.reverse?"left":"right":w===0?At=this.options.reverse?"right":"left":At="center"),s==="top"?c==="near"||y!==0?A=-E*D+D/2:c==="center"?A=-$.highest.height/2-j*D+D:A=-$.highest.height+D/2:c==="near"||y!==0?A=D/2:c==="center"?A=$.highest.height/2-j*D:A=$.highest.height-E*D,d&&(A*=-1),y!==0&&!K.showLabelBackdrop&&(M+=D/2*Math.sin(y))):(C=b,A=(1-E)*D/2);let wt;if(K.showLabelBackdrop){const H=Ft(K.backdropPadding),L=$.heights[w],z=$.widths[w];let V=A-H.top,q=0-H.left;switch(F){case"middle":V-=L/2;break;case"bottom":V-=L;break}switch(T){case"center":q-=z/2;break;case"right":q-=z;break;case"inner":w===S-1?q-=z:w>0&&(q-=z/2);break}wt={left:q,top:V,width:z+H.width,height:L+H.height,color:K.backdropColor}}_.push({label:P,font:x,textOffset:A,options:{rotation:y,color:N,strokeColor:st,strokeWidth:B,textAlign:At,textBaseline:F,translation:[M,C],backdrop:wt}})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Nt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,o=this._getLabelSizes(),a=t+r,l=o.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-a,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+a,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:s,width:r,height:o}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,o),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,o;const a=(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(r=0,o=s.length;r<o;++r){const l=s[r];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),o=i.display?r.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,d,f;this.isHorizontal()?(c=pn(t,this.left,o)-o/2,u=pn(t,this.right,a)+a/2,d=f=l):(d=pn(t,this.top,o)-o/2,f=pn(t,this.bottom,a)+a/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,d),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&di(i,s);const r=this.getLabelItems(t);for(const o of r){const a=o.options,l=o.font,c=o.label,u=o.textOffset;mn(i,c,0,u,l,a)}s&&hi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=_t(i.font),o=Ft(i.padding),a=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||it(e)?(l+=o.bottom,ot(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=o.top;const{titleX:c,titleY:u,maxWidth:d,rotation:f}=cp(this,l,e,a);mn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:lp(a,e,s),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=Z(t.grid&&t.grid.z,-1),s=Z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==xn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,o;for(r=0,o=e.length;r<o;++r){const a=e[r];a[i]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return _t(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class gs{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;hp(e)&&(i=this.register(e));const s=this.items,r=t.id,o=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,up(t,o,i),this.override&&Tt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Tt[s]&&(delete Tt[s][i],this.override&&delete gn[i])}}function up(n,t,e){const i=si(Object.create(null),[e?Tt.get(e):{},Tt.get(t),n.defaults]);Tt.set(t,i),n.defaultRoutes&&dp(t,n.defaultRoutes),n.descriptors&&Tt.describe(t,n.descriptors)}function dp(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),o=t[e].split("."),a=o.pop(),l=o.join(".");Tt.route(r,s,l,a)})}function hp(n){return"id"in n&&"defaults"in n}class fp{constructor(){this.controllers=new gs(be,"datasets",!0),this.elements=new gs(Vt,"elements"),this.plugins=new gs(Object,"plugins"),this.scales=new gs(xn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):dt(s,o=>{const a=i||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,e,i){const s=pr(t);ut(i["before"+s],[],i),e[t](i),ut(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var ve=new fp;class gp{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const r=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall")),o}_notify(t,e,i,s){s=s||{};for(const r of t){const o=r.plugin,a=o[i],l=[e,s,r.options];if(ut(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){tt(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=Z(i.options&&i.options.plugins,{}),r=pp(i);return s===!1&&!e?[]:yp(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,o)=>r.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function pp(n){const t={},e=[],i=Object.keys(ve.plugins.items);for(let r=0;r<i.length;r++)e.push(ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const o=s[r];e.indexOf(o)===-1&&(e.push(o),t[o.id]=!0)}return{plugins:e,localIds:t}}function mp(n,t){return!t&&n===!1?null:n===!0?{}:n}function yp(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=mp(i[l],s);c!==null&&r.push({plugin:a,options:bp(n.config,{plugin:a,local:e[l]},c,o)})}return r}function bp(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),o=n.getOptionScopes(i,r);return e&&t.defaults&&o.push(t.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Hr(n,t){const e=Tt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function _p(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function xp(n,t){return n===t?"_index_":"_value_"}function Bl(n){if(n==="x"||n==="y"||n==="r")return n}function wp(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Wr(n,...t){if(Bl(n))return n;for(const e of t){const i=e.axis||wp(e.position)||n.length>1&&Bl(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function zl(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function kp(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 zl(n,"x",e[0])||zl(n,"y",e[0])}return{}}function Sp(n,t){const e=gn[n.type]||{scales:{}},i=t.scales||{},s=Hr(n.type,t),r=Object.create(null);return Object.keys(i).forEach(o=>{const a=i[o];if(!it(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=Wr(o,a,kp(o,n),Tt.scales[a.type]),c=xp(l,s),u=e.scales||{};r[o]=ri(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||Hr(a,t),u=(gn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const f=_p(d,l),g=o[f+"AxisID"]||f;r[g]=r[g]||Object.create(null),ri(r[g],[{axis:f},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];ri(a,[Tt.scales[a.type],Tt.scale])}),r}function Hl(n){const t=n.options||(n.options={});t.plugins=Z(t.plugins,{}),t.scales=Sp(n,t)}function Wl(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function vp(n){return n=n||{},n.data=Wl(n.data),Hl(n),n}const Yl=new Map,Vl=new Set;function ps(n,t){let e=Yl.get(n);return e||(e=t(),Yl.set(n,e),Vl.add(e)),e}const vi=(n,t,e)=>{const i=qe(t,e);i!==void 0&&n.add(i)};class Dp{constructor(t){this._config=vp(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=Wl(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(),Hl(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ps(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ps(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ps(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return ps(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(d=>vi(l,t,d))),u.forEach(d=>vi(l,s,d)),u.forEach(d=>vi(l,gn[r]||{},d)),u.forEach(d=>vi(l,Tt,d)),u.forEach(d=>vi(l,wr,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Vl.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,gn[e]||{},Tt.datasets[e]||{},{type:e},Tt,wr]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=jl(this._resolverCache,t,s);let l=o;if(Tp(o,e)){r.$shared=!1,i=Jt(i)?i():i;const c=this.createResolver(t,i,a);l=In(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=jl(this._resolverCache,t,i);return it(e)?In(r,e,void 0,s):r}}function jl(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:Dr(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Mp=n=>it(n)&&Object.getOwnPropertyNames(n).some(t=>Jt(n[t]));function Tp(n,t){const{isScriptable:e,isIndexable:i}=Ua(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(Jt(a)||Mp(a))||o&&ot(a))return!0}return!1}var Cp="4.4.3";const Op=["top","bottom","left","right","chartArea"];function $l(n,t){return n==="top"||n==="bottom"||Op.indexOf(n)===-1&&t==="x"}function Ul(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function ql(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),ut(e&&e.onComplete,[n],t)}function Pp(n){const t=n.chart,e=t.options.animation;ut(e&&e.onProgress,[n],t)}function Xl(n){return Cr()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const ms={},Gl=n=>{const t=Xl(n);return Object.values(ms).filter(e=>e.canvas===t).pop()};function Ep(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const o=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=o)}}}function Rp(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function ys(n,t,e){return n.options.clip?n[e]:t[e]}function Ap(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:ys(e,t,"left"),right:ys(e,t,"right"),top:ys(i,t,"top"),bottom:ys(i,t,"bottom")}:t}let fe=(cn=class{static register(...t){ve.add(...t),Kl()}static unregister(...t){ve.remove(...t),Kl()}constructor(t,e){const i=this.config=new Dp(e),s=Xl(t),r=Gl(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Kg(s)),this.platform.updateConfig(i);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Fh(),this.ctx=a,this.canvas=l,this.width=u,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Qh(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],ms[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Ie.listen(this,"complete",ql),Ie.listen(this,"progress",Pp),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return tt(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Va(this.canvas,this.ctx),this}stop(){return Ie.stop(this),this}resize(t,e){Ie.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,r),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,tl(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),ut(i.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};dt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((o,a)=>(o[a]=!1,o),{});let r=[];e&&(r=r.concat(Object.keys(e).map(o=>{const a=e[o],l=Wr(o,a),c=l==="r",u=l==="x";return{options:a,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),dt(r,o=>{const a=o.options,l=a.id,c=Wr(l,a),u=Z(a.type,o.dtype);(a.position===void 0||$l(a.position,c)!==$l(o.dposition))&&(a.position=o.dposition),s[l]=!0;let d=null;if(l in i&&i[l].type===u)d=i[l];else{const f=ve.getScale(u);d=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),dt(s,(o,a)=>{o||delete i[a]}),dt(i,o=>{qt.configure(this,o,o.options),qt.addBox(this,o)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ul("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let o=this.getDatasetMeta(i);const a=r.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=a,o.indexAxis=r.indexAxis||Hr(a,this.options),o.order=r.order||0,o.index=i,o.label=""+r.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const l=ve.getController(a),{datasetElementType:c,dataElementType:u}=Tt.datasets[a];Object.assign(l,{dataElementType:ve.getElement(u),datasetElementType:c&&ve.getElement(c)}),o.controller=new l(this,i),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){dt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:d}=this.getDatasetMeta(c),f=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(f),o=Math.max(+d.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),s||dt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ul("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){dt(this.scales,t=>{qt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ma(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const o=i==="_removeElements"?-r:r;Ep(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(o=>o[0]===r).map((o,a)=>a+","+o.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Ma(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;qt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],dt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),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,Jt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ie.has(this)?this.attached&&!Ie.running(this)&&Ie.start(this):(this.draw(),ql({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const o=e[s];(!t||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,r=Ap(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&di(e,{left:i.left===!1?0:r.left-i.left,right:i.right===!1?this.width:r.right+i.right,top:i.top===!1?0:r.top-i.top,bottom:i.bottom===!1?this.height:r.bottom+i.bottom}),t.controller.draw(),s&&hi(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Le(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Br.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ze(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),o=r.controller._resolveAnimations(void 0,s);Qt(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(r,{visible:i}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ie.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(),Va(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete ms[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=(r,o)=>{e.addEventListener(this,r,o),t[r]=o},s=(r,o,a)=>{r.offsetX=o,r.offsetY=a,this._eventHandler(r)};dt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",r),i("detach",o)};o=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){dt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},dt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,o,a,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:o})=>{const a=this.getDatasetMeta(r);if(!a)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:a.data[o],index:o}});!Gi(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(d=>u.datasetIndex===d.datasetIndex&&u.index===d.index)),o=r(e,t),a=i?t:r(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,o=e,a=this._getActiveElements(t,s,i,o),l=Vh(t),c=Rp(t,this._lastEvent,i,l);i&&(this._lastEvent=null,ut(r.onHover,[t,a,this],this),l&&ut(r.onClick,[t,a,this],this));const u=!Gi(a,s);return(u||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},O(cn,"defaults",Tt),O(cn,"instances",ms),O(cn,"overrides",gn),O(cn,"registry",ve),O(cn,"version",Cp),O(cn,"getChart",Gl),cn);function Kl(){return dt(fe.instances,n=>n._plugins.invalidate())}function Lp(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;n.beginPath(),n.arc(r,o,a,i-c,e+c),l>s?(c=s/l,n.arc(r,o,l,e+c,i-c,!0)):n.arc(r,o,s,e+bt,i-bt),n.closePath(),n.clip()}function Ip(n){return vr(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Np(n,t,e,i){const s=Ip(n.options.borderRadius),r=(e-t)/2,o=Math.min(r,i*t/2),a=l=>{const c=(e-Math.min(r,l))*i/2;return zt(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:zt(s.innerStart,0,o),innerEnd:zt(s.innerEnd,0,o)}}function Bn(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function bs(n,t,e,i,s,r){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:u}=t,d=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let g=0;const p=s-l;if(i){const K=u>0?u-i:0,j=d>0?d-i:0,N=(K+j)/2,st=N!==0?p*N/(N+i):p;g=(p-st)/2}const y=Math.max(.001,p*d-e/rt)/d,_=(p-y)/2,w=l+_+g,S=s-_-g,{outerStart:v,outerEnd:P,innerStart:M,innerEnd:C}=Np(t,f,d,S-w),T=d-v,b=d-P,x=w+v/T,D=S-P/b,E=f+M,A=f+C,F=w+M/E,$=S-C/A;if(n.beginPath(),r){const K=(x+D)/2;if(n.arc(o,a,d,x,K),n.arc(o,a,d,K,D),P>0){const B=Bn(b,D,o,a);n.arc(B.x,B.y,P,D,S+bt)}const j=Bn(A,S,o,a);if(n.lineTo(j.x,j.y),C>0){const B=Bn(A,$,o,a);n.arc(B.x,B.y,C,S+bt,$+Math.PI)}const N=(S-C/f+(w+M/f))/2;if(n.arc(o,a,f,S-C/f,N,!0),n.arc(o,a,f,N,w+M/f,!0),M>0){const B=Bn(E,F,o,a);n.arc(B.x,B.y,M,F+Math.PI,w-bt)}const st=Bn(T,w,o,a);if(n.lineTo(st.x,st.y),v>0){const B=Bn(T,x,o,a);n.arc(B.x,B.y,v,w-bt,x)}}else{n.moveTo(o,a);const K=Math.cos(x)*d+o,j=Math.sin(x)*d+a;n.lineTo(K,j);const N=Math.cos(D)*d+o,st=Math.sin(D)*d+a;n.lineTo(N,st)}n.closePath()}function Fp(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){bs(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%mt||mt))}return bs(n,t,e,i,l,s),n.fill(),l}function Bp(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:f}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=f,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){bs(n,t,e,i,p,s);for(let y=0;y<r;++y)n.stroke();isNaN(a)||(p=o+(a%mt||mt))}g&&Lp(n,t,p),r||(bs(n,t,e,i,p,s),n.stroke())}class Di extends Vt{constructor(e){super();O(this,"circumference");O(this,"endAngle");O(this,"fullCircles");O(this,"innerRadius");O(this,"outerRadius");O(this,"pixelMargin");O(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:o,distance:a}=Pa(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,y=Z(f,c-l)>=mt||ai(o,l,c),_=Re(a,u+g,d+g);return y&&_}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,d=(r+o)/2,f=(a+l+u+c)/2;return{x:i+Math.cos(d)*f,y:s+Math.sin(d)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,o=(i.spacing||0)/2,a=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>mt?Math.floor(s/mt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(rt,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Fp(e,this,u,o,a),Bp(e,this,u,o,a),e.restore()}}O(Di,"id","arc"),O(Di,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),O(Di,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(Di,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Zl(n,t,e=t){n.lineCap=Z(e.borderCapStyle,t.borderCapStyle),n.setLineDash(Z(e.borderDash,t.borderDash)),n.lineDashOffset=Z(e.borderDashOffset,t.borderDashOffset),n.lineJoin=Z(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=Z(e.borderWidth,t.borderWidth),n.strokeStyle=Z(e.borderColor,t.borderColor)}function zp(n,t,e){n.lineTo(e.x,e.y)}function Hp(n){return n.stepped?df:n.tension||n.cubicInterpolationMode==="monotone"?hf:zp}function Ql(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:o,end:a}=t,l=Math.max(s,o),c=Math.min(r,a),u=s<o&&r<o||s>a&&r>a;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Wp(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Ql(s,e,i),u=Hp(r);let{move:d=!0,reverse:f}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(f?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,f,r.stepped),y=p);return l&&(p=s[(a+(f?c:0))%o],u(n,y,p,f,r.stepped)),!!l}function Yp(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=Ql(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,f,g,p,y,_,w;const S=P=>(o+(c?a-P:P))%r,v=()=>{y!==_&&(n.lineTo(u,_),n.lineTo(u,y),n.lineTo(u,w))};for(l&&(g=s[S(0)],n.moveTo(g.x,g.y)),f=0;f<=a;++f){if(g=s[S(f)],g.skip)continue;const P=g.x,M=g.y,C=P|0;C===p?(M<y?y=M:M>_&&(_=M),u=(d*u+P)/++d):(v(),n.lineTo(P,M),p=C,d=0,y=_=M),w=M}v()}function Yr(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Yp:Wp}function Vp(n){return n.stepped?jf:n.tension||n.cubicInterpolationMode==="monotone"?$f:bn}function jp(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Zl(n,t.options),n.stroke(s)}function $p(n,t,e,i){const{segments:s,options:r}=t,o=Yr(t);for(const a of s)Zl(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Up=typeof Path2D=="function";function qp(n,t,e,i){Up&&!t.options.segment?jp(n,t,e,i):$p(n,t,e,i)}class tn extends Vt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Nf(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Zf(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,o=al(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=Vp(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:f}=o[c],g=r[d],p=r[f];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),_=l(g,p,y,i.stepped);_[e]=t[e],a.push(_)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Yr(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Yr(this);let o=this._loop;e=e||0,i=i||this.points.length-e;for(const a of s)o&=r(t,this,a,{start:e,end:e+i-1});return!!o}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),qp(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}O(tn,"id","line"),O(tn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),O(tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),O(tn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Jl(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class _s extends Vt{constructor(e){super();O(this,"parsed");O(this,"skip");O(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:o,y:a}=this.getProps(["x","y"],s);return Math.pow(e-o,2)+Math.pow(i-a,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return Jl(this,e,"x",i)}inYRange(e,i){return Jl(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Le(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Sr(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}O(_s,"id","point"),O(_s,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),O(_s,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function tc(n,t){const{x:e,y:i,base:s,width:r,height:o}=n.getProps(["x","y","base","width","height"],t);let a,l,c,u,d;return n.horizontal?(d=o/2,a=Math.min(e,s),l=Math.max(e,s),c=i-d,u=i+d):(d=r/2,a=e-d,l=e+d,c=Math.min(i,s),u=Math.max(i,s)),{left:a,top:c,right:l,bottom:u}}function en(n,t,e,i){return n?0:zt(t,e,i)}function Xp(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=$a(i);return{t:en(s.top,r.top,0,e),r:en(s.right,r.right,0,t),b:en(s.bottom,r.bottom,0,e),l:en(s.left,r.left,0,t)}}function Gp(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=Ke(s),o=Math.min(t,e),a=n.borderSkipped,l=i||it(s);return{topLeft:en(!l||a.top||a.left,r.topLeft,0,o),topRight:en(!l||a.top||a.right,r.topRight,0,o),bottomLeft:en(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:en(!l||a.bottom||a.right,r.bottomRight,0,o)}}function Kp(n){const t=tc(n),e=t.right-t.left,i=t.bottom-t.top,s=Xp(n,e/2,i/2),r=Gp(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function Vr(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&tc(n,i);return a&&(s||Re(t,a.left,a.right))&&(r||Re(e,a.top,a.bottom))}function Zp(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Qp(n,t){n.rect(t.x,t.y,t.w,t.h)}function jr(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,o=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+o,radius:n.radius}}class xs extends Vt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:o}=Kp(this),a=Zp(o.radius)?Ln:Qp;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,jr(o,e,r)),t.clip(),a(t,jr(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,jr(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Vr(this,t,e,i)}inXRange(t,e){return Vr(this,t,null,e)}inYRange(t,e){return Vr(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}O(xs,"id","bar"),O(xs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),O(xs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Jp=Object.freeze({__proto__:null,ArcElement:Di,BarElement:xs,LineElement:tn,PointElement:_s});const $r=["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)"],ec=$r.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function nc(n){return $r[n%$r.length]}function ic(n){return ec[n%ec.length]}function tm(n,t){return n.borderColor=nc(t),n.backgroundColor=ic(t),++t}function em(n,t){return n.backgroundColor=n.data.map(()=>nc(t++)),t}function nm(n,t){return n.backgroundColor=n.data.map(()=>ic(t++)),t}function im(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof Je?t=em(e,t):s instanceof yi?t=nm(e,t):s&&(t=tm(e,t))}}function sc(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function sm(n){return n&&(n.borderColor||n.backgroundColor)}var rm={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s;if(!e.forceOverride&&(sc(i)||sm(s)||r&&sc(r)))return;const o=im(n);i.forEach(o)}};function om(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const o=[],a=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,d,f,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let _=0,w=0,S;const v=Math.floor((d+1)*a)+1+t,P=Math.min(Math.floor((d+2)*a)+1,e)+t,M=P-v;for(S=v;S<P;S++)_+=n[S].x,w+=n[S].y;_/=M,w/=M;const C=Math.floor(d*a)+1+t,T=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:b,y:x}=n[u];for(g=p=-1,S=C;S<T;S++)p=.5*Math.abs((b-_)*(n[S].y-x)-(b-n[S].x)*(w-x)),p>g&&(g=p,f=n[S],y=S);o[l++]=f,u=y}return o[l++]=n[c],o}function am(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,f,g,p,y;const _=[],w=t+e-1,S=n[t].x,P=n[w].x-S;for(o=t;o<t+e;++o){a=n[o],l=(a.x-S)/P*i,c=a.y;const M=l|0;if(M===u)c<p?(p=c,d=o):c>y&&(y=c,f=o),s=(r*s+a.x)/++r;else{const C=o-1;if(!tt(d)&&!tt(f)){const T=Math.min(d,f),b=Math.max(d,f);T!==g&&T!==C&&_.push({...n[T],x:s}),b!==g&&b!==C&&_.push({...n[b],x:s})}o>0&&C!==g&&_.push(n[C]),_.push(a),u=M,r=0,p=y=c,d=f=g=o}}return _}function rc(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 oc(n){n.data.datasets.forEach(t=>{rc(t)})}function lm(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:o,max:a,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=zt(Ae(t,r.axis,o).lo,0,e-1)),c?s=zt(Ae(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var cm={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){oc(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:o,indexAxis:a}=s,l=n.getDatasetMeta(r),c=o||s.data;if(fi([a,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:f}=lm(l,c);const g=e.threshold||4*i;if(f<=g){rc(s);return}tt(o)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(y){this._data=y}}));let p;switch(e.algorithm){case"lttb":p=om(c,d,f,i,e);break;case"min-max":p=am(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){oc(n)}};function um(n,t,e){const i=n.segments,s=n.points,r=t.points,o=[];for(const a of i){let{start:l,end:c}=a;c=qr(l,c,s);const u=Ur(e,s[l],s[c],a.loop);if(!t.segments){o.push({source:a,target:u,start:s[l],end:s[c]});continue}const d=al(t,u);for(const f of d){const g=Ur(e,r[f.start],r[f.end],f.loop),p=ol(a,s,g);for(const y of p)o.push({source:y,target:f,start:{[e]:ac(u,g,"start",Math.max)},end:{[e]:ac(u,g,"end",Math.min)}})}}return o}function Ur(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=ce(s),r=ce(r)),{property:n,start:s,end:r}}function dm(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=qr(o,a,s);const l=s[o],c=s[a];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function qr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function ac(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function lc(n,t){let e=[],i=!1;return ot(n)?(i=!0,e=n):e=dm(n,t),e.length?new tn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function cc(n){return n&&n.fill!==!1}function hm(n,t,e){let s=n[t].fill;const r=[t];let o;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!vt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function fm(n,t,e){const i=ym(n);if(it(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return vt(s)&&Math.floor(s)===s?gm(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function gm(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function pm(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:it(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function mm(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:it(n)?i=n.value:i=t.getBaseValue(),i}function ym(n){const t=n.options,e=t.fill;let i=Z(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function bm(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=_m(t,e);a.push(lc({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)xm(s,o[u],a)}return new tn({points:s,options:{}})}function _m(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function xm(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=wm(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function wm(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,o=n.points;let a=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],d=o[u.start][e],f=o[u.end][e];if(Re(s,d,f)){a=s===d,l=s===f;break}}return{first:a,last:l,point:i}}class uc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:o}=this;return e=e||{start:0,end:mt},t.arc(s,r,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function km(n){const{chart:t,fill:e,line:i}=n;if(vt(e))return Sm(t,e);if(e==="stack")return bm(n);if(e==="shape")return!0;const s=vm(n);return s instanceof uc?s:lc(s,i)}function Sm(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function vm(n){return(n.scale||{}).getPointPositionForValue?Mm(n):Dm(n)}function Dm(n){const{scale:t={},fill:e}=n,i=pm(e,t);if(vt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Mm(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=mm(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new uc({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(o)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,o));return a}function Xr(n,t,e){const i=km(t),{line:s,scale:r,axis:o}=t,a=s.options,l=a.fill,c=a.backgroundColor,{above:u=c,below:d=c}=l||{};i&&s.points.length&&(di(n,e),Tm(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),hi(n))}function Tm(n,t){const{line:e,target:i,above:s,below:r,area:o,scale:a}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&r!==s&&(dc(n,i,o.top),hc(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),dc(n,i,o.bottom)),hc(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function dc(n,t,e){const{segments:i,points:s}=t;let r=!0,o=!1;n.beginPath();for(const a of i){const{start:l,end:c}=a,u=s[l],d=s[qr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),o=!!t.pathSegment(n,a,{move:o}),o?n.closePath():n.lineTo(d.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function hc(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=um(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:f=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=f,Cm(n,o,g&&Ur(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let y;if(g){p?n.closePath():fc(n,i,d,s);const _=!!i.pathSegment(n,c,{move:p,reverse:!0});y=p&&_,y||fc(n,i,u,s)}n.closePath(),n.fill(y?"evenodd":"nonzero"),n.restore()}}function Cm(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:r,start:o,end:a}=e||{};r==="x"&&(n.beginPath(),n.rect(o,i,a-o,s-i),n.clip())}function fc(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Om={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,o,a,l;for(o=0;o<i;++o)r=n.getDatasetMeta(o),a=r.dataset,l=null,a&&a.options&&a instanceof tn&&(l={visible:n.isDatasetVisible(o),index:o,fill:fm(a,o,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:a}),r.$filler=l,s.push(l);for(o=0;o<i;++o)l=s[o],!(!l||l.fill===!1)&&(l.fill=hm(s,o,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let o=s.length-1;o>=0;--o){const a=s[o].$filler;a&&(a.line.updateControlPoints(r,a.axis),i&&a.fill&&Xr(n.ctx,a,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;cc(r)&&Xr(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!cc(i)||e.drawTime!=="beforeDatasetDraw"||Xr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const gc=(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)}},Pm=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class pc extends Vt{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=ut(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=_t(i.font),r=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=gc(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(o,r,a,l)+10):(u=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+a;let d=t;r.textAlign="left",r.textBaseline="middle";let f=-1,g=-u;return this.legendItems.forEach((p,y)=>{const _=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+_+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,f++),l[y]={left:0,top:g,row:f,width:_,height:s},c[c.length-1]+=_+a}),d}_fitCols(t,e,i,s){const{ctx:r,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=o-t;let d=a,f=0,g=0,p=0,y=0;return this.legendItems.forEach((_,w)=>{const{itemWidth:S,itemHeight:v}=Em(i,e,r,_,s);w>0&&g+v+2*a>u&&(d+=f+a,c.push({width:f,height:g}),p+=f+a,y++,f=g=0),l[w]={left:p,top:g,col:y,width:S,height:v},f=Math.max(f,S),g+=v+a}),d+=f,c.push({width:f,height:g}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,o=Fn(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ut(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=Ut(i,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=Ut(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=Ut(i,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;di(t,this),this._draw(),hi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=Tt.color,l=Fn(t.rtl,this.left,this.width),c=_t(o.font),{padding:u}=o,d=c.size,f=d/2;let g;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:y,itemHeight:_}=gc(o,d),w=function(C,T,b){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const x=Z(b.lineWidth,1);if(s.fillStyle=Z(b.fillStyle,a),s.lineCap=Z(b.lineCap,"butt"),s.lineDashOffset=Z(b.lineDashOffset,0),s.lineJoin=Z(b.lineJoin,"miter"),s.lineWidth=x,s.strokeStyle=Z(b.strokeStyle,a),s.setLineDash(Z(b.lineDash,[])),o.usePointStyle){const D={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:x},E=l.xPlus(C,p/2),A=T+f;ja(s,D,E,A,o.pointStyleWidth&&p)}else{const D=T+Math.max((d-y)/2,0),E=l.leftForLtr(C,p),A=Ke(b.borderRadius);s.beginPath(),Object.values(A).some(F=>F!==0)?Ln(s,{x:E,y:D,w:p,h:y,radius:A}):s.rect(E,D,p,y),s.fill(),x!==0&&s.stroke()}s.restore()},S=function(C,T,b){mn(s,b.text,C,T+_/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},v=this.isHorizontal(),P=this._computeTitleHeight();v?g={x:Ut(r,this.left+u,this.right-i[0]),y:this.top+u+P,line:0}:g={x:this.left+u,y:Ut(r,this.top+P+u,this.bottom-e[0].height),line:0},nl(this.ctx,t.textDirection);const M=_+u;this.legendItems.forEach((C,T)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const b=s.measureText(C.text).width,x=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),D=p+f+b;let E=g.x,A=g.y;l.setWidth(this.width),v?T>0&&E+D+u>this.right&&(A=g.y+=M,g.line++,E=g.x=Ut(r,this.left+u,this.right-i[g.line])):T>0&&A+M>this.bottom&&(E=g.x=E+e[g.line].width+u,g.line++,A=g.y=Ut(r,this.top+P+u,this.bottom-e[g.line].height));const F=l.x(E);if(w(F,A,C),E=Jh(x,E+p+f,v?E+D:this.right,t.rtl),S(l.x(E),A,C),v)g.x+=D+u;else if(typeof C.text!="string"){const $=c.lineHeight;g.y+=mc(C,$)+u}else g.y+=M}),il(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_t(e.font),s=Ft(e.padding);if(!e.display)return;const r=Fn(t.rtl,this.left,this.width),o=this.ctx,a=e.position,l=i.size/2,c=s.top+l;let u,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,d=Ut(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((y,_)=>Math.max(y,_.height),0);u=c+Ut(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=Ut(a,d,d+f);o.textAlign=r.textAlign(br(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,mn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=_t(t.font),i=Ft(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Re(t,this.left,this.right)&&Re(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Re(t,s.left,s.left+s.width)&&Re(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Lm(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Pm(s,i);s&&!r&&ut(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&ut(e.onHover,[t,i,this],this)}else i&&ut(e.onClick,[t,i,this],this)}}function Em(n,t,e,i,s){const r=Rm(i,n,t,e),o=Am(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Rm(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,o)=>r.length>o.length?r:o)),t+e.size/2+i.measureText(s).width}function Am(n,t,e){let i=n;return typeof t.text!="string"&&(i=mc(t,e)),i}function mc(n,t){const e=n.text?n.text.length:0;return t*e}function Lm(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Im={id:"legend",_element:pc,start(n,t,e){const i=n.legend=new pc({ctx:n.ctx,options:e,chart:n});qt.configure(n,i,e),qt.addBox(n,i)},stop(n){qt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;qt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:o,borderRadius:a}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=Ft(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,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:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class Gr extends Vt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=ot(i.text)?i.text.length:1;this._padding=Ft(i.padding);const r=s*_t(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:o}=this,a=o.align;let l=0,c,u,d;return this.isHorizontal()?(u=Ut(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=Ut(a,s,e),l=rt*-.5):(u=r-t,d=Ut(a,e,s),l=rt*.5),c=s-e),{titleX:u,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=_t(e.font),r=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(r);mn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:br(e.align),textBaseline:"middle",translation:[o,a]})}}function Nm(n,t){const e=new Gr({ctx:n.ctx,options:t,chart:n});qt.configure(n,e,t),qt.addBox(n,e),n.titleBlock=e}var Fm={id:"title",_element:Gr,start(n,t,e){Nm(n,e)},stop(n){const t=n.titleBlock;qt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;qt.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 ws=new WeakMap;var Bm={id:"subtitle",start(n,t,e){const i=new Gr({ctx:n.ctx,options:e,chart:n});qt.configure(n,i,e),qt.addBox(n,i),ws.set(n,i)},stop(n){qt.removeBox(n,ws.get(n)),ws.delete(n)},beforeUpdate(n,t,e){const i=ws.get(n);qt.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 Mi={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();i.add(l.x),s+=l.y,++r}}return{x:[...i].reduce((a,l)=>a+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,o,a;for(r=0,o=n.length;r<o;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=An(t,c);u<s&&(s=u,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function De(n,t){return t&&(ot(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Ne(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function Xy(n,t){const{element:e,datasetIndex:r,index:i}=t,a=n.getDatasetMeta(r).controller,{label:s,value:o}=a.getLabelAndValue(i);return{chart:n,label:s,parsed:a.getParsed(i),raw:n.data.datasets[r].data[i],formattedValue:o,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:e}}function sd(n,t){const e=n.chart.ctx,{body:r,footer:i,title:a}=n,{boxWidth:s,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),d=a.length,f=i.length,p=r.length,y=Gt(t.padding);let x=y.height,g=0,m=r.reduce((w,T)=>w+T.before.length+T.lines.length+T.after.length,0);if(m+=n.beforeBody.length+n.afterBody.length,d&&(x+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),m){const w=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;x+=p*w+(m-p)*l.lineHeight+(m-1)*t.bodySpacing}f&&(x+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const b=function(w){g=Math.max(g,e.measureText(w).width+v)};return e.save(),e.font=c.string,Mt(n.title,b),e.font=l.string,Mt(n.beforeBody.concat(n.afterBody),b),v=t.displayColors?s+2+t.boxPadding:0,Mt(r,w=>{Mt(w.before,b),Mt(w.lines,b),Mt(w.after,b)}),v=0,e.font=u.string,Mt(n.footer,b),e.restore(),g+=y.width,{width:g,height:x}}function Gy(n,t){const{y:e,height:r}=t;return e<r/2?"top":e>n.height-r/2?"bottom":"center"}function Ky(n,t,e,r){const{x:i,width:a}=r,s=e.caretSize+e.caretPadding;if(n==="left"&&i+a+s>t.width||n==="right"&&i-a-s<0)return!0}function Qy(n,t,e,r){const{x:i,width:a}=e,{width:s,chartArea:{left:o,right:l}}=n;let c="center";return r==="center"?c=i<=(o+l)/2?"left":"right":i<=a/2?c="left":i>=s-a/2&&(c="right"),Ky(c,n,t,e)&&(c="center"),c}function od(n,t,e){const r=e.yAlign||t.yAlign||Gy(n,e);return{xAlign:e.xAlign||t.xAlign||Qy(n,t,e,r),yAlign:r}}function Zy(n,t){let{x:e,width:r}=n;return t==="right"?e-=r:t==="center"&&(e-=r/2),e}function Jy(n,t,e){let{y:r,height:i}=n;return t==="top"?r+=e:t==="bottom"?r-=i+e:r-=i/2,r}function ld(n,t,e,r){const{caretSize:i,caretPadding:a,cornerRadius:s}=n,{xAlign:o,yAlign:l}=e,c=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=dn(s);let y=Zy(t,o);const x=Jy(t,l,c);return l==="center"?o==="left"?y+=c:o==="right"&&(y-=c):o==="left"?y-=Math.max(u,f)+i:o==="right"&&(y+=Math.max(d,p)+i),{x:Qt(y,0,r.width-t.width),y:Qt(x,0,r.height-t.height)}}function $i(n,t,e){const r=Gt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-r.right:n.x+r.left}function cd(n){return Ne([],Ge(n))}function tv(n,t,e){return fn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ud(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const dd={beforeTitle:$e,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,r=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return e[t.dataIndex]}return""},afterTitle:$e,beforeBody:$e,beforeLabel:$e,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 st(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:$e,afterBody:$e,beforeFooter:$e,footer:$e,afterFooter:$e};function he(n,t,e,r){const i=n[t].call(e,r);return typeof i>"u"?dd[t].call(e,r):i}class bs extends te{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,r=this.options.setContext(this.getContext()),i=r.enabled&&e.options.animation&&r.animations,a=new Ja(this.chart,i);return i._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=tv(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:r}=e,i=he(r,"beforeTitle",this,t),a=he(r,"title",this,t),s=he(r,"afterTitle",this,t);let o=[];return o=Ne(o,Ge(i)),o=Ne(o,Ge(a)),o=Ne(o,Ge(s)),o}getBeforeBody(t,e){return cd(he(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:r}=e,i=[];return Mt(t,a=>{const s={before:[],lines:[],after:[]},o=ud(r,a);Ne(s.before,Ge(he(o,"beforeLabel",this,a))),Ne(s.lines,he(o,"label",this,a)),Ne(s.after,Ge(he(o,"afterLabel",this,a))),i.push(s)}),i}getAfterBody(t,e){return cd(he(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:r}=e,i=he(r,"beforeFooter",this,t),a=he(r,"footer",this,t),s=he(r,"afterFooter",this,t);let o=[];return o=Ne(o,Ge(i)),o=Ne(o,Ge(a)),o=Ne(o,Ge(s)),o}_createItems(t){const e=this._active,r=this.chart.data,i=[],a=[],s=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(Xy(this.chart,e[l]));return t.filter&&(o=o.filter((u,d,f)=>t.filter(u,d,f,r))),t.itemSort&&(o=o.sort((u,d)=>t.itemSort(u,d,r))),Mt(o,u=>{const d=ud(t.callbacks,u);i.push(he(d,"labelColor",this,u)),a.push(he(d,"labelPointStyle",this,u)),s.push(he(d,"labelTextColor",this,u))}),this.labelColors=i,this.labelPointStyles=a,this.labelTextColors=s,this.dataPoints=o,o}update(t,e){const r=this.options.setContext(this.getContext()),i=this._active;let a,s=[];if(!i.length)this.opacity!==0&&(a={opacity:0});else{const o=jr[r.position].call(this,i,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=sd(this,r),c=Object.assign({},o,l),u=od(this.chart,r,c),d=ld(r,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&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,r,i){const a=this.getCaretPosition(t,r,i);e.lineTo(a.x1,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x3,a.y3)}getCaretPosition(t,e,r){const{xAlign:i,yAlign:a}=this,{caretSize:s,cornerRadius:o}=r,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=dn(o),{x:f,y:p}=t,{width:y,height:x}=e;let g,m,v,b,w,T;return a==="center"?(w=p+x/2,i==="left"?(g=f,m=g-s,b=w+s,T=w-s):(g=f+y,m=g+s,b=w-s,T=w+s),v=g):(i==="left"?m=f+Math.max(l,u)+s:i==="right"?m=f+y-Math.max(c,d)-s:m=this.caretX,a==="top"?(b=p,w=b-s,g=m-s,v=m+s):(b=p+x,w=b+s,g=m+s,v=m-s),T=b),{x1:g,x2:m,x3:v,y1:b,y2:w,y3:T}}drawTitle(t,e,r){const i=this.title,a=i.length;let s,o,l;if(a){const c=rr(r.rtl,this.x,this.width);for(t.x=$i(this,r.titleAlign,r),e.textAlign=c.textAlign(r.titleAlign),e.textBaseline="middle",s=Rt(r.titleFont),o=r.titleSpacing,e.fillStyle=r.titleColor,e.font=s.string,l=0;l<a;++l)e.fillText(i[l],c.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+o,l+1===a&&(t.y+=r.titleMarginBottom-o)}}_drawColorBox(t,e,r,i,a){const s=this.labelColors[r],o=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=a,u=Rt(a.bodyFont),d=$i(this,"left",a),f=i.x(d),p=l<u.lineHeight?(u.lineHeight-l)/2:0,y=e.y+p;if(a.usePointStyle){const x={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},g=i.leftForLtr(f,c)+c/2,m=y+l/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,Va(t,x,g,m),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Va(t,x,g,m)}else{t.lineWidth=lt(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 x=i.leftForLtr(f,c),g=i.leftForLtr(i.xPlus(f,1),c-2),m=dn(s.borderRadius);Object.values(m).some(v=>v!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,tr(t,{x,y,w:c,h:l,radius:m}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),tr(t,{x:g,y:y+1,w:c-2,h:l-2,radius:m}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(x,y,c,l),t.strokeRect(x,y,c,l),t.fillStyle=s.backgroundColor,t.fillRect(g,y+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,e,r){const{body:i}=this,{bodySpacing:a,bodyAlign:s,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=r,d=Rt(r.bodyFont);let f=d.lineHeight,p=0;const y=rr(r.rtl,this.x,this.width),x=function(M){e.fillText(M,y.x(t.x+p),t.y+f/2),t.y+=f+a},g=y.textAlign(s);let m,v,b,w,T,S,C;for(e.textAlign=s,e.textBaseline="middle",e.font=d.string,t.x=$i(this,g,r),e.fillStyle=r.bodyColor,Mt(this.beforeBody,x),p=o&&g!=="right"?s==="center"?c/2+u:c+2+u:0,w=0,S=i.length;w<S;++w){for(m=i[w],v=this.labelTextColors[w],e.fillStyle=v,Mt(m.before,x),b=m.lines,o&&b.length&&(this._drawColorBox(e,t,w,y,r),f=Math.max(d.lineHeight,l)),T=0,C=b.length;T<C;++T)x(b[T]),f=d.lineHeight;Mt(m.after,x)}p=0,f=d.lineHeight,Mt(this.afterBody,x),t.y-=a}drawFooter(t,e,r){const i=this.footer,a=i.length;let s,o;if(a){const l=rr(r.rtl,this.x,this.width);for(t.x=$i(this,r.footerAlign,r),t.y+=r.footerMarginTop,e.textAlign=l.textAlign(r.footerAlign),e.textBaseline="middle",s=Rt(r.footerFont),e.fillStyle=r.footerColor,e.font=s.string,o=0;o<a;++o)e.fillText(i[o],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,e,r,i){const{xAlign:a,yAlign:s}=this,{x:o,y:l}=t,{width:c,height:u}=r,{topLeft:d,topRight:f,bottomLeft:p,bottomRight:y}=dn(i.cornerRadius);e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.beginPath(),e.moveTo(o+d,l),s==="top"&&this.drawCaret(t,e,r,i),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),s==="center"&&a==="right"&&this.drawCaret(t,e,r,i),e.lineTo(o+c,l+u-y),e.quadraticCurveTo(o+c,l+u,o+c-y,l+u),s==="bottom"&&this.drawCaret(t,e,r,i),e.lineTo(o+p,l+u),e.quadraticCurveTo(o,l+u,o,l+u-p),s==="center"&&a==="left"&&this.drawCaret(t,e,r,i),e.lineTo(o,l+d),e.quadraticCurveTo(o,l,o+d,l),e.closePath(),e.fill(),i.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,r=this.$animations,i=r&&r.x,a=r&&r.y;if(i||a){const s=jr[t.position].call(this,this._active,this._eventPosition);if(!s)return;const o=this._size=sd(this,t),l=Object.assign({},s,this._size),c=od(e,t,l),u=ld(t,l,c,e);(i._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 r=this.opacity;if(!r)return;this._updateAnimationTarget(e);const i={width:this.width,height:this.height},a={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=Gt(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=r,this.drawBackground(a,t,i,e),jc(t,e.textDirection),a.y+=s.top,this.drawTitle(a,t,e),this.drawBody(a,t,e),this.drawFooter(a,t,e),Vc(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const r=this._active,i=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=!yi(r,i),s=this._positionChanged(i,e);(a||s)&&(this._active=i,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,r=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const i=this.options,a=this._active||[],s=this._getActiveElements(t,a,e,r),o=this._positionChanged(s,t),l=e||!yi(s,a)||o;return l&&(this._active=s,(i.enabled||i.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,r,i){const a=this.options;if(t.type==="mouseout")return[];if(!i)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,a.mode,a,r);return a.reverse&&s.reverse(),s}_positionChanged(t,e){const{caretX:r,caretY:i,options:a}=this,s=jr[a.position].call(this,t,e);return s!==!1&&(r!==s.x||i!==s.y)}}H(bs,"positioners",jr);var ji={id:"tooltip",_element:bs,positioners:jr,afterInit(n,t,e){e&&(n.tooltip=new bs({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:dd},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"]},ev=Object.freeze({__proto__:null,Colors:py,Decimation:vy,Filler:Uy,Legend:$y,SubTitle:qy,Title:Vy,Tooltip:ji});const nv=(n,t,e,r)=>(typeof t=="string"?(e=n.push(t)-1,r.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function rv(n,t,e,r){const i=n.indexOf(t);if(i===-1)return nv(n,t,e,r);const a=n.lastIndexOf(t);return i!==a?e:i}const iv=(n,t)=>n===null?null:Qt(Math.round(n),0,t);function fd(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class xs extends In{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const r=this.getLabels();for(const{index:i,label:a}of e)r[i]===a&&r.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const r=this.getLabels();return e=isFinite(e)&&r[e]===t?e:rv(r,t,rt(e,t),this._addedLabels),iv(e,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:r,max:i}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),e||(i=this.getLabels().length-1)),this.min=r,this.max=i}buildTicks(){const t=this.min,e=this.max,r=this.options.offset,i=[];let a=this.getLabels();a=t===0&&e===a.length-1?a:a.slice(t,e+1),this._valueRange=Math.max(a.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=e;s++)i.push({value:s});return i}getLabelForValue(t){return fd.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}}H(xs,"id","category"),H(xs,"defaults",{ticks:{callback:fd}});function av(n,t){const e=[],{bounds:i,step:a,min:s,max:o,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,p=a||1,y=u-1,{min:x,max:g}=t,m=!st(s),v=!st(o),b=!st(c),w=(g-x)/(d+1);let T=mc((g-x)/y/p)*p,S,C,M,D;if(T<1e-14&&!m&&!v)return[{value:x},{value:g}];D=Math.ceil(g/T)-Math.floor(x/T),D>y&&(T=mc(D*T/y/p)*p),st(l)||(S=Math.pow(10,l),T=Math.ceil(T*S)/S),i==="ticks"?(C=Math.floor(x/T)*T,M=Math.ceil(g/T)*T):(C=x,M=g),m&&v&&a&&ng((o-s)/a,T/1e3)?(D=Math.round(Math.min((o-s)/T,u)),T=(o-s)/D,C=s,M=o):b?(C=m?s:C,M=v?o:M,D=c-1,T=(M-C)/D):(D=(M-C)/T,Dr(D,Math.round(D),T/1e3)?D=Math.round(D):D=Math.ceil(D));const O=Math.max(vc(T),vc(C));S=Math.pow(10,st(l)?O:l),C=Math.round(C*S)/S,M=Math.round(M*S)/S;let P=0;for(m&&(f&&C!==s?(e.push({value:s}),C<s&&P++,Dr(Math.round((C+P*T)*S)/S,s,hd(s,w,n))&&P++):C<s&&P++);P<D;++P){const E=Math.round((C+P*T)*S)/S;if(v&&E>o)break;e.push({value:E})}return v&&f&&M!==o?e.length&&Dr(e[e.length-1].value,o,hd(o,w,n))?e[e.length-1].value=o:e.push({value:o}):(!v||M===o)&&e.push({value:M}),e}function hd(n,t,{horizontal:e,minRotation:r}){const i=Xt(r),a=(e?Math.sin(i):Math.cos(i))||.001,s=.75*t*(""+n).length;return Math.min(t/a,s)}class Vi extends In{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 st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:r}=this.getUserBounds();let{min:i,max:a}=this;const s=l=>i=e?i:l,o=l=>a=r?a:l;if(t){const l=Le(i),c=Le(a);l<0&&c<0?o(0):l>0&&c>0&&s(0)}if(i===a){let l=a===0?1:Math.abs(a*.05);o(a+l),t||s(i-l)}this.min=i,this.max=a}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:r}=t,i;return r?(i=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,i>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${i} ticks. Limiting to 1000.`),i=1e3)):(i=this.computeTickLimit(),e=e||11),e&&(i=Math.min(e,i)),i}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const i={maxTicks:r,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=av(i,a);return t.bounds==="ticks"&&yc(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,r=this.max;if(super.configure(),this.options.offset&&t.length){const i=(r-e)/Math.max(t.length-1,1)/2;e-=i,r+=i}this._startValue=e,this._endValue=r,this._valueRange=r-e}getLabelForValue(t){return Cr(t,this.chart.options.locale,this.options.ticks.format)}}class _s extends Vi{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=It(t)?t:0,this.max=It(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,r=Xt(this.options.ticks.minRotation),i=(t?Math.sin(r):Math.cos(r))||.001,a=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,a.lineHeight/i))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}H(_s,"id","linear"),H(_s,"defaults",{ticks:{callback:Ti.formatters.numeric}});const Vr=n=>Math.floor(cn(n)),Nn=(n,t)=>Math.pow(10,Vr(n)+t);function pd(n){return n/Math.pow(10,Vr(n))===1}function gd(n,t,e){const r=Math.pow(10,e),i=Math.floor(n/r);return Math.ceil(t/r)-i}function sv(n,t){const e=t-n;let r=Vr(e);for(;gd(n,t,r)>10;)r++;for(;gd(n,t,r)<10;)r--;return Math.min(r,Vr(n))}function ov(n,{min:t,max:e}){t=be(n.min,t);const r=[],i=Vr(t);let a=sv(t,e),s=a<0?Math.pow(10,Math.abs(a)):1;const o=Math.pow(10,a),l=i>a?Math.pow(10,i):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)),f=be(n.min,Math.round((l+u+d*Math.pow(10,a))*s)/s);for(;f<e;)r.push({value:f,major:pd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,s=a>=0?1:s),f=Math.round((l+u+d*Math.pow(10,a))*s)/s;const p=be(n.max,f);return r.push({value:p,major:pd(p),significand:d}),r}class ws extends In{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const r=Vi.prototype.parse.apply(this,[t,e]);if(r===0){this._zero=!0;return}return It(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=It(t)?Math.max(0,t):null,this.max=It(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!It(this._userMin)&&(this.min=t===Nn(this.min,0)?Nn(this.min,-1):Nn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let r=this.min,i=this.max;const a=o=>r=t?r:o,s=o=>i=e?i:o;r===i&&(r<=0?(a(1),s(10)):(a(Nn(r,-1)),s(Nn(i,1)))),r<=0&&a(Nn(i,-1)),i<=0&&s(Nn(r,1)),this.min=r,this.max=i}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},r=ov(e,this);return t.bounds==="ticks"&&yc(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":Cr(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=cn(t),this._valueRange=cn(this.max)-cn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(cn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}H(ws,"id","logarithmic"),H(ws,"defaults",{ticks:{callback:Ti.formatters.logarithmic,major:{enabled:!0}}});function Ts(n){const t=n.ticks;if(t.display&&n.display){const e=Gt(t.backdropPadding);return rt(t.font&&t.font.size,Ut.font.size)+e.height}return 0}function lv(n,t,e){return e=mt(e)?e:[e],{w:bg(n,t.string,e),h:e.length*t.lineHeight}}function md(n,t,e,r,i){return n===r||n===i?{start:t-e/2,end:t+e/2}:n<r||n>i?{start:t-e,end:t}:{start:t,end:t+e}}function cv(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),r=[],i=[],a=n._pointLabels.length,s=n.options.pointLabels,o=s.centerPointLabels?dt/a:0;for(let l=0;l<a;l++){const c=s.setContext(n.getPointLabelContext(l));i[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+i[l],o),d=Rt(c.font),f=lv(n.ctx,d,n._pointLabels[l]);r[l]=f;const p=xe(n.getIndexAngle(l)+o),y=Math.round(_i(p)),x=md(y,u.x,f.w,0,180),g=md(y,u.y,f.h,90,270);uv(e,t,p,x,g)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=hv(n,r,i)}function uv(n,t,e,r,i){const a=Math.abs(Math.sin(e)),s=Math.abs(Math.cos(e));let o=0,l=0;r.start<t.l?(o=(t.l-r.start)/a,n.l=Math.min(n.l,t.l-o)):r.end>t.r&&(o=(r.end-t.r)/a,n.r=Math.max(n.r,t.r+o)),i.start<t.t?(l=(t.t-i.start)/s,n.t=Math.min(n.t,t.t-l)):i.end>t.b&&(l=(i.end-t.b)/s,n.b=Math.max(n.b,t.b+l))}function dv(n,t,e){const r=n.drawingArea,{extra:i,additionalAngle:a,padding:s,size:o}=e,l=n.getPointPosition(t,r+i+s,a),c=Math.round(_i(xe(l.angle+Et))),u=mv(l.y,o.h,c),d=pv(c),f=gv(l.x,o.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+o.w,bottom:u+o.h}}function fv(n,t){if(!t)return!0;const{left:e,top:r,right:i,bottom:a}=n;return!(qe({x:e,y:r},t)||qe({x:e,y:a},t)||qe({x:i,y:r},t)||qe({x:i,y:a},t))}function hv(n,t,e){const r=[],i=n._pointLabels.length,a=n.options,{centerPointLabels:s,display:o}=a.pointLabels,l={extra:Ts(a)/2,additionalAngle:s?dt/i:0};let c;for(let u=0;u<i;u++){l.padding=e[u],l.size=t[u];const d=dv(n,u,l);r.push(d),o==="auto"&&(d.visible=fv(d,c),d.visible&&(c=d))}return r}function pv(n){return n===0||n===180?"center":n<180?"left":"right"}function gv(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function mv(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function yv(n,t,e){const{left:r,top:i,right:a,bottom:s}=e,{backdropColor:o}=t;if(!st(o)){const l=dn(t.borderRadius),c=Gt(t.backdropPadding);n.fillStyle=o;const u=r-c.left,d=i-c.top,f=a-r+c.width,p=s-i+c.height;Object.values(l).some(y=>y!==0)?(n.beginPath(),tr(n,{x:u,y:d,w:f,h:p,radius:l}),n.fill()):n.fillRect(u,d,f,p)}}function vv(n,t){const{ctx:e,options:{pointLabels:r}}=n;for(let i=t-1;i>=0;i--){const a=n._pointLabelItems[i];if(!a.visible)continue;const s=r.setContext(n.getPointLabelContext(i));yv(e,s,a);const o=Rt(s.font),{x:l,y:c,textAlign:u}=a;En(e,n._pointLabels[i],l,c+o.lineHeight/2,o,{color:s.color,textAlign:u,textBaseline:"middle"})}}function yd(n,t,e,r){const{ctx:i}=n;if(e)i.arc(n.xCenter,n.yCenter,t,0,Ct);else{let a=n.getPointPosition(0,t);i.moveTo(a.x,a.y);for(let s=1;s<r;s++)a=n.getPointPosition(s,t),i.lineTo(a.x,a.y)}}function bv(n,t,e,r,i){const a=n.ctx,s=t.circular,{color:o,lineWidth:l}=t;!s&&!r||!o||!l||e<0||(a.save(),a.strokeStyle=o,a.lineWidth=l,a.setLineDash(i.dash),a.lineDashOffset=i.dashOffset,a.beginPath(),yd(n,e,s,r),a.closePath(),a.stroke(),a.restore())}function xv(n,t,e){return fn(n,{label:e,index:t,type:"pointLabel"})}class qr 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=Gt(Ts(this.options)/2),e=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(e,r)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=It(t)&&!isNaN(t)?t:0,this.max=It(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ts(this.options))}generateTickLabels(t){Vi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,r)=>{const i=Tt(this.options.pointLabels.callback,[e,r],this);return i||i===0?i:""}).filter((e,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?cv(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,r,i){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((r-i)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,r,i))}getIndexAngle(t){const e=Ct/(this._pointLabels.length||1),r=this.options.startAngle||0;return xe(t*e+Xt(r))}getDistanceFromCenterForValue(t){if(st(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(st(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 r=e[t];return xv(this.getContext(),t,r)}}getPointPosition(t,e,r=0){const i=this.getIndexAngle(t)-Et+r;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter,angle:i}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:r,right:i,bottom:a}=this._pointLabelItems[t];return{left:e,top:r,right:i,bottom:a}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),yd(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:r,grid:i,border:a}=e,s=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&vv(this,s),i.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),p=i.setContext(f),y=a.setContext(f);bv(this,p,l,s,y)}}),r.display){for(t.save(),o=s-1;o>=0;o--){const u=r.setContext(this.getPointLabelContext(o)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,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,r=e.ticks;if(!r.display)return;const i=this.getIndexAngle(0);let a,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(i),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=r.setContext(this.getContext(l)),u=Rt(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=Gt(c.backdropPadding);t.fillRect(-s/2-d.left,-a-u.size/2-d.top,s+d.width,u.size+d.height)}En(t,o.label,0,-a,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}H(qr,"id","radialLinear"),H(qr,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ti.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),H(qr,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),H(qr,"descriptors",{angleLines:{_fallback:"grid"}});const qi={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}},pe=Object.keys(qi);function vd(n,t){return n-t}function bd(n,t){if(st(t))return null;const e=n._adapter,{parser:r,round:i,isoWeekday:a}=n._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),It(s)||(s=typeof r=="string"?e.parse(s,r):e.parse(s)),s===null?null:(i&&(s=i==="week"&&(un(a)||a===!0)?e.startOf(s,"isoWeek",a):e.startOf(s,i)),+s)}function xd(n,t,e,r){const i=pe.length;for(let a=pe.indexOf(n);a<i-1;++a){const s=qi[pe[a]],o=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((e-t)/(o*s.size))<=r)return pe[a]}return pe[i-1]}function _v(n,t,e,r,i){for(let a=pe.length-1;a>=pe.indexOf(e);a--){const s=pe[a];if(qi[s].common&&n._adapter.diff(i,r,s)>=t-1)return s}return pe[e?pe.indexOf(e):0]}function wv(n){for(let t=pe.indexOf(n)+1,e=pe.length;t<e;++t)if(qi[pe[t]].common)return pe[t]}function _d(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:r,hi:i}=Wa(e,t),a=e[r]>=t?e[r]:e[i];n[a]=!0}}function Tv(n,t,e,r){const i=n._adapter,a=+i.startOf(t[0].value,r),s=t[t.length-1].value;let o,l;for(o=a;o<=s;o=+i.add(o,1,r))l=e[o],l>=0&&(t[l].major=!0);return t}function wd(n,t,e){const r=[],i={},a=t.length;let s,o;for(s=0;s<a;++s)o=t[s],i[o]=s,r.push({value:o,major:!1});return a===0||!e?r:Tv(n,r,i,e)}class Xr extends In{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 r=t.time||(t.time={}),i=this._adapter=new du._date(t.adapters.date);i.init(e),Mr(r.displayFormats,i.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:bd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,r=t.time.unit||"day";let{min:i,max:a,minDefined:s,maxDefined:o}=this.getUserBounds();function l(c){!s&&!isNaN(c.min)&&(i=Math.min(i,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))),i=It(i)&&!isNaN(i)?i:+e.startOf(Date.now(),r),a=It(a)&&!isNaN(a)?a:+e.endOf(Date.now(),r)+1,this.min=Math.min(i,a-1),this.max=Math.max(i+1,a)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],r=t[t.length-1]),{min:e,max:r}}buildTicks(){const t=this.options,e=t.time,r=t.ticks,i=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&i.length&&(this.min=this._userMin||i[0],this.max=this._userMax||i[i.length-1]);const a=this.min,s=this.max,o=sg(i,a,s);return this._unit=e.unit||(r.autoSkip?xd(e.minUnit,this.min,this.max,this._getLabelCapacity(a)):_v(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:wv(this._unit),this.initOffsets(i),t.reverse&&o.reverse(),wd(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,r=0,i,a;this.options.offset&&t.length&&(i=this.getDecimalForValue(t[0]),t.length===1?e=1-i:e=(this.getDecimalForValue(t[1])-i)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?r=a:r=(a-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;e=Qt(e,0,s),r=Qt(r,0,s),this._offsets={start:e,end:r,factor:1/(e+1+r)}}_generate(){const t=this._adapter,e=this.min,r=this.max,i=this.options,a=i.time,s=a.unit||xd(a.minUnit,e,r,this._getLabelCapacity(e)),o=rt(i.ticks.stepSize,1),l=s==="week"?a.isoWeekday:!1,c=un(l)||l===!0,u={};let d=e,f,p;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":s),t.diff(r,e,s)>1e5*o)throw new Error(e+" and "+r+" are too far apart with stepSize of "+o+" "+s);const y=i.ticks.source==="data"&&this.getDataTimestamps();for(f=d,p=0;f<r;f=+t.add(f,o,s),p++)_d(u,f,y);return(f===r||i.bounds==="ticks"||p===1)&&_d(u,f,y),Object.keys(u).sort(vd).map(x=>+x)}getLabelForValue(t){const e=this._adapter,r=this.options.time;return r.tooltipFormat?e.format(t,r.tooltipFormat):e.format(t,r.displayFormats.datetime)}format(t,e){const i=this.options.time.displayFormats,a=this._unit,s=e||i[a];return this._adapter.format(t,s)}_tickFormatFunction(t,e,r,i){const a=this.options,s=a.ticks.callback;if(s)return Tt(s,[t,e,r],this);const o=a.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],d=c&&o[c],f=r[e],p=c&&d&&f&&f.major;return this._adapter.format(t,i||(p?d:u))}generateTickLabels(t){let e,r,i;for(e=0,r=t.length;e<r;++e)i=t[e],i.label=this._tickFormatFunction(i.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+r)*e.factor)}getValueForPixel(t){const e=this._offsets,r=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,r=this.ctx.measureText(t).width,i=Xt(this.isHorizontal()?e.maxRotation:e.minRotation),a=Math.cos(i),s=Math.sin(i),o=this._resolveTickFontOptions(0).size;return{w:r*a+o*s,h:r*s+o*a}}_getLabelCapacity(t){const e=this.options.time,r=e.displayFormats,i=r[e.unit]||r.millisecond,a=this._tickFormatFunction(t,0,wd(this,[t],this._majorUnit),i),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,r;if(t.length)return t;const i=this.getMatchingVisibleMetas();if(this._normalized&&i.length)return this._cache.data=i[0].controller.getAllParsedValues(this);for(e=0,r=i.length;e<r;++e)t=t.concat(i[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,r;if(t.length)return t;const i=this.getLabels();for(e=0,r=i.length;e<r;++e)t.push(bd(this,i[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return wc(t.sort(vd))}}H(Xr,"id","time"),H(Xr,"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 Xi(n,t,e){let r=0,i=n.length-1,a,s,o,l;e?(t>=n[r].pos&&t<=n[i].pos&&({lo:r,hi:i}=Ve(n,"pos",t)),{pos:a,time:o}=n[r],{pos:s,time:l}=n[i]):(t>=n[r].time&&t<=n[i].time&&({lo:r,hi:i}=Ve(n,"time",t)),{time:a,pos:o}=n[r],{time:s,pos:l}=n[i]);const c=s-a;return c?o+(l-o)*(t-a)/c:o}class Ms extends Xr{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=Xi(e,this.min),this._tableRange=Xi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:r}=this,i=[],a=[];let s,o,l,c,u;for(s=0,o=t.length;s<o;++s)c=t[s],c>=e&&c<=r&&i.push(c);if(i.length<2)return[{time:e,pos:0},{time:r,pos:1}];for(s=0,o=i.length;s<o;++s)u=i[s+1],l=i[s-1],c=i[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 r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(e)||r.length===1)&&r.push(e),r.sort((i,a)=>i-a)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),r=this.getLabelTimestamps();return e.length&&r.length?t=this.normalize(e.concat(r)):t=e.length?e:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Xi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,r=this.getDecimalForPixel(t)/e.factor-e.end;return Xi(this._table,r*this._tableRange+this._minPos,!0)}}H(Ms,"id","timeseries"),H(Ms,"defaults",Xr.defaults);var Mv=Object.freeze({__proto__:null,CategoryScale:xs,LinearScale:_s,LogarithmicScale:ws,RadialLinearScale:qr,TimeScale:Xr,TimeSeriesScale:Ms});const Dv=[Lm,ly,ev,Mv],Sv=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],kv=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Cv=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ov=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Td=(n,t,e)=>{let r=n;return typeof t=="string"||Array.isArray(t)?r=n.toLocaleString(t,e):(t===!0||e!==void 0)&&(r=n.toLocaleString(void 0,e)),r};function Ds(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?Ov:Cv:t.binary?kv:Sv,r=t.space?" ":"";if(t.signed&&n===0)return` 0${r}${e[0]}`;const i=n<0,a=i?"-":t.signed?"+":"";i&&(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=Td(n,t.locale,s);return a+u+r+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=Td(Number(n),t.locale,s),c=e[o];return a+l+r+c}function Ke(n){"@babel/helpers - typeof";return Ke=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},Ke(n)}function At(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 J(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function nt(n){J(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||Ke(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 Md(n,t){J(2,arguments);var e=nt(n),r=At(t);return isNaN(r)?new Date(NaN):(r&&e.setDate(e.getDate()+r),e)}function Ss(n,t){J(2,arguments);var e=nt(n),r=At(t);if(isNaN(r))return new Date(NaN);if(!r)return e;var i=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+r+1,0);var s=a.getDate();return i>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),i),e)}function Gr(n,t){J(2,arguments);var e=nt(n).getTime(),r=At(t);return new Date(e+r)}var Pv=36e5;function Ev(n,t){J(2,arguments);var e=At(t);return Gr(n,e*Pv)}var Rv={};function yn(){return Rv}function Dd(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=yn(),d=At((e=(r=(i=(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&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(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 f=nt(n),p=f.getDay(),y=(p<d?7:0)+p-d;return f.setDate(f.getDate()-y),f.setHours(0,0,0,0),f}function Gi(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 ks(n){J(1,arguments);var t=nt(n);return t.setHours(0,0,0,0),t}var Av=864e5;function Lv(n,t){J(2,arguments);var e=ks(n),r=ks(t),i=e.getTime()-Gi(e),a=r.getTime()-Gi(r);return Math.round((i-a)/Av)}var Iv=6e4;function Nv(n,t){J(2,arguments);var e=At(t);return Gr(n,e*Iv)}function Fv(n,t){J(2,arguments);var e=At(t),r=e*3;return Ss(n,r)}function Uv(n,t){J(2,arguments);var e=At(t);return Gr(n,e*1e3)}function Bv(n,t){J(2,arguments);var e=At(t),r=e*7;return Md(n,r)}function Wv(n,t){J(2,arguments);var e=At(t);return Ss(n,e*12)}function Kr(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=e.getTime()-r.getTime();return i<0?-1:i>0?1:i}var Ki=6e4,Qr=36e5,zv=1e3;function Yv(n){return J(1,arguments),n instanceof Date||Ke(n)==="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Cs(n){if(J(1,arguments),!Yv(n)&&typeof n!="number")return!1;var t=nt(n);return!isNaN(Number(t))}function Hv(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=e.getFullYear()-r.getFullYear(),a=e.getMonth()-r.getMonth();return i*12+a}function $v(n,t){J(2,arguments);var e=nt(n),r=nt(t);return e.getFullYear()-r.getFullYear()}function Sd(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 kd(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Sd(e,r),a=Math.abs(Lv(e,r));e.setDate(e.getDate()-i*a);var s=+(Sd(e,r)===-i),o=i*(a-s);return o===0?0:o}function Qi(n,t){return J(2,arguments),nt(n).getTime()-nt(t).getTime()}var Cd={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},jv="trunc";function Zr(n){return n?Cd[n]:Cd[jv]}function Vv(n,t,e){J(2,arguments);var r=Qi(n,t)/Qr;return Zr(e==null?void 0:e.roundingMethod)(r)}function qv(n,t,e){J(2,arguments);var r=Qi(n,t)/Ki;return Zr(e==null?void 0:e.roundingMethod)(r)}function Od(n){J(1,arguments);var t=nt(n);return t.setHours(23,59,59,999),t}function Pd(n){J(1,arguments);var t=nt(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Xv(n){J(1,arguments);var t=nt(n);return Od(t).getTime()===Pd(t).getTime()}function Ed(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Kr(e,r),a=Math.abs(Hv(e,r)),s;if(a<1)s=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-i*a);var o=Kr(e,r)===-i;Xv(nt(n))&&a===1&&Kr(n,r)===1&&(o=!1),s=i*(a-Number(o))}return s===0?0:s}function Gv(n,t,e){J(2,arguments);var r=Ed(n,t)/3;return Zr(e==null?void 0:e.roundingMethod)(r)}function Kv(n,t,e){J(2,arguments);var r=Qi(n,t)/1e3;return Zr(e==null?void 0:e.roundingMethod)(r)}function Qv(n,t,e){J(2,arguments);var r=kd(n,t)/7;return Zr(e==null?void 0:e.roundingMethod)(r)}function Zv(n,t){J(2,arguments);var e=nt(n),r=nt(t),i=Kr(e,r),a=Math.abs($v(e,r));e.setFullYear(1584),r.setFullYear(1584);var s=Kr(e,r)===-i,o=i*(a-Number(s));return o===0?0:o}function Jv(n){J(1,arguments);var t=nt(n);return t.setSeconds(0,0),t}function tb(n){J(1,arguments);var t=nt(n),e=t.getMonth(),r=e-e%3;return t.setMonth(r,1),t.setHours(0,0,0,0),t}function eb(n){J(1,arguments);var t=nt(n);return t.setDate(1),t.setHours(0,0,0,0),t}function nb(n){J(1,arguments);var t=nt(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function rb(n){J(1,arguments);var t=nt(n),e=new Date(0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function ib(n){J(1,arguments);var t=nt(n);return t.setMinutes(59,59,999),t}function ab(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=yn(),d=At((e=(r=(i=(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&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(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 f=nt(n),p=f.getDay(),y=(p<d?-7:0)+6-(p-d);return f.setDate(f.getDate()+y),f.setHours(23,59,59,999),f}function sb(n){J(1,arguments);var t=nt(n);return t.setSeconds(59,999),t}function ob(n){J(1,arguments);var t=nt(n),e=t.getMonth(),r=e-e%3+3;return t.setMonth(r,0),t.setHours(23,59,59,999),t}function lb(n){J(1,arguments);var t=nt(n);return t.setMilliseconds(999),t}function Rd(n,t){J(2,arguments);var e=At(t);return Gr(n,-e)}var cb=864e5;function ub(n){J(1,arguments);var t=nt(n),e=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),i=e-r;return Math.floor(i/cb)+1}function ar(n){J(1,arguments);var t=1,e=nt(n),r=e.getUTCDay(),i=(r<t?7:0)+r-t;return e.setUTCDate(e.getUTCDate()-i),e.setUTCHours(0,0,0,0),e}function Ad(n){J(1,arguments);var t=nt(n),e=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(e+1,0,4),r.setUTCHours(0,0,0,0);var i=ar(r),a=new Date(0);a.setUTCFullYear(e,0,4),a.setUTCHours(0,0,0,0);var s=ar(a);return t.getTime()>=i.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function db(n){J(1,arguments);var t=Ad(n),e=new Date(0);e.setUTCFullYear(t,0,4),e.setUTCHours(0,0,0,0);var r=ar(e);return r}var fb=6048e5;function Ld(n){J(1,arguments);var t=nt(n),e=ar(t).getTime()-db(t).getTime();return Math.round(e/fb)+1}function Fn(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=yn(),d=At((e=(r=(i=(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&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(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 f=nt(n),p=f.getUTCDay(),y=(p<d?7:0)+p-d;return f.setUTCDate(f.getUTCDate()-y),f.setUTCHours(0,0,0,0),f}function Os(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=nt(n),d=u.getUTCFullYear(),f=yn(),p=At((e=(r=(i=(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&&i!==void 0?i:f.firstWeekContainsDate)!==null&&r!==void 0?r:(l=f.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=new Date(0);y.setUTCFullYear(d+1,0,p),y.setUTCHours(0,0,0,0);var x=Fn(y,t),g=new Date(0);g.setUTCFullYear(d,0,p),g.setUTCHours(0,0,0,0);var m=Fn(g,t);return u.getTime()>=x.getTime()?d+1:u.getTime()>=m.getTime()?d:d-1}function hb(n,t){var e,r,i,a,s,o,l,c;J(1,arguments);var u=yn(),d=At((e=(r=(i=(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&&i!==void 0?i:u.firstWeekContainsDate)!==null&&r!==void 0?r:(l=u.locale)===null||l===void 0||(c=l.options)===null||c===void 0?void 0:c.firstWeekContainsDate)!==null&&e!==void 0?e:1),f=Os(n,t),p=new Date(0);p.setUTCFullYear(f,0,d),p.setUTCHours(0,0,0,0);var y=Fn(p,t);return y}var pb=6048e5;function Id(n,t){J(1,arguments);var e=nt(n),r=Fn(e,t).getTime()-hb(e,t).getTime();return Math.round(r/pb)+1}function Dt(n,t){for(var e=n<0?"-":"",r=Math.abs(n).toString();r.length<t;)r="0"+r;return e+r}var gb={y:function(t,e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return Dt(e==="yy"?i%100:i,e.length)},M:function(t,e){var r=t.getUTCMonth();return e==="M"?String(r+1):Dt(r+1,2)},d:function(t,e){return Dt(t.getUTCDate(),e.length)},a:function(t,e){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h:function(t,e){return Dt(t.getUTCHours()%12||12,e.length)},H:function(t,e){return Dt(t.getUTCHours(),e.length)},m:function(t,e){return Dt(t.getUTCMinutes(),e.length)},s:function(t,e){return Dt(t.getUTCSeconds(),e.length)},S:function(t,e){var r=e.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,r-3));return Dt(a,e.length)}};const vn=gb;var sr={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mb={G:function(t,e,r){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(i,{width:"abbreviated"});case"GGGGG":return r.era(i,{width:"narrow"});case"GGGG":default:return r.era(i,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return r.ordinalNumber(a,{unit:"year"})}return vn.y(t,e)},Y:function(t,e,r,i){var a=Os(t,i),s=a>0?a:1-a;if(e==="YY"){var o=s%100;return Dt(o,2)}return e==="Yo"?r.ordinalNumber(s,{unit:"year"}):Dt(s,e.length)},R:function(t,e){var r=Ad(t);return Dt(r,e.length)},u:function(t,e){var r=t.getUTCFullYear();return Dt(r,e.length)},Q:function(t,e,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return Dt(i,2);case"Qo":return r.ordinalNumber(i,{unit:"quarter"});case"QQQ":return r.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,r){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return Dt(i,2);case"qo":return r.ordinalNumber(i,{unit:"quarter"});case"qqq":return r.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,r){var i=t.getUTCMonth();switch(e){case"M":case"MM":return vn.M(t,e);case"Mo":return r.ordinalNumber(i+1,{unit:"month"});case"MMM":return r.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,r){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return Dt(i+1,2);case"Lo":return r.ordinalNumber(i+1,{unit:"month"});case"LLL":return r.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,r,i){var a=Id(t,i);return e==="wo"?r.ordinalNumber(a,{unit:"week"}):Dt(a,e.length)},I:function(t,e,r){var i=Ld(t);return e==="Io"?r.ordinalNumber(i,{unit:"week"}):Dt(i,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getUTCDate(),{unit:"date"}):vn.d(t,e)},D:function(t,e,r){var i=ub(t);return e==="Do"?r.ordinalNumber(i,{unit:"dayOfYear"}):Dt(i,e.length)},E:function(t,e,r){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return r.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(i,{width:"short",context:"formatting"});case"EEEE":default:return r.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,r,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return Dt(s,2);case"eo":return r.ordinalNumber(s,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,i){var a=t.getUTCDay(),s=(a-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return Dt(s,e.length);case"co":return r.ordinalNumber(s,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){var i=t.getUTCDay(),a=i===0?7:i;switch(e){case"i":return String(a);case"ii":return Dt(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(i,{width:"short",context:"formatting"});case"iiii":default:return r.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,r){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){var i=t.getUTCHours(),a;switch(i===12?a=sr.noon:i===0?a=sr.midnight:a=i/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){var i=t.getUTCHours(),a;switch(i>=17?a=sr.evening:i>=12?a=sr.afternoon:i>=4?a=sr.morning:a=sr.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),r.ordinalNumber(i,{unit:"hour"})}return vn.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getUTCHours(),{unit:"hour"}):vn.H(t,e)},K:function(t,e,r){var i=t.getUTCHours()%12;return e==="Ko"?r.ordinalNumber(i,{unit:"hour"}):Dt(i,e.length)},k:function(t,e,r){var i=t.getUTCHours();return i===0&&(i=24),e==="ko"?r.ordinalNumber(i,{unit:"hour"}):Dt(i,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):vn.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):vn.s(t,e)},S:function(t,e){return vn.S(t,e)},X:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();if(s===0)return"Z";switch(e){case"X":return Fd(s);case"XXXX":case"XX":return Un(s);case"XXXXX":case"XXX":default:return Un(s,":")}},x:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"x":return Fd(s);case"xxxx":case"xx":return Un(s);case"xxxxx":case"xxx":default:return Un(s,":")}},O:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Nd(s,":");case"OOOO":default:return"GMT"+Un(s,":")}},z:function(t,e,r,i){var a=i._originalDate||t,s=a.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Nd(s,":");case"zzzz":default:return"GMT"+Un(s,":")}},t:function(t,e,r,i){var a=i._originalDate||t,s=Math.floor(a.getTime()/1e3);return Dt(s,e.length)},T:function(t,e,r,i){var a=i._originalDate||t,s=a.getTime();return Dt(s,e.length)}};function Nd(n,t){var e=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),a=r%60;if(a===0)return e+String(i);var s=t||"";return e+String(i)+s+Dt(a,2)}function Fd(n,t){if(n%60===0){var e=n>0?"-":"+";return e+Dt(Math.abs(n)/60,2)}return Un(n,t)}function Un(n,t){var e=t||"",r=n>0?"-":"+",i=Math.abs(n),a=Dt(Math.floor(i/60),2),s=Dt(i%60,2);return r+a+e+s}var Ud=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"})}},Bd=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"})}},yb=function(t,e){var r=t.match(/(P+)(p+)?/)||[],i=r[1],a=r[2];if(!a)return Ud(t,e);var s;switch(i){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}}",Ud(i,e)).replace("{{time}}",Bd(a,e))},Ps={p:Bd,P:yb},vb=["D","DD"],bb=["YY","YYYY"];function Wd(n){return vb.indexOf(n)!==-1}function zd(n){return bb.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 xb={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"}},_b=function(t,e,r){var i,a=xb[t];return typeof a=="string"?i=a:e===1?i=a.one:i=a.other.replace("{{count}}",e.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+i:i+" ago":i};const wb=_b;function Es(n){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.width?String(t.width):n.defaultWidth,r=n.formats[e]||n.formats[n.defaultWidth];return r}}var Tb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Mb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Db={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sb={date:Es({formats:Tb,defaultWidth:"full"}),time:Es({formats:Mb,defaultWidth:"full"}),dateTime:Es({formats:Db,defaultWidth:"full"})};const kb=Sb;var Cb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ob=function(t,e,r,i){return Cb[t]};const Pb=Ob;function Jr(n){return function(t,e){var r=e!=null&&e.context?String(e.context):"standalone",i;if(r==="formatting"&&n.formattingValues){var a=n.defaultFormattingWidth||n.defaultWidth,s=e!=null&&e.width?String(e.width):a;i=n.formattingValues[s]||n.formattingValues[a]}else{var o=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;i=n.values[l]||n.values[o]}var c=n.argumentCallback?n.argumentCallback(t):t;return i[c]}}var Eb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Rb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ab={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"]},Lb={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"]},Ib={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Nb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Fb=function(t,e){var r=Number(t),i=r%100;if(i>20||i<10)switch(i%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},Ub={ordinalNumber:Fb,era:Jr({values:Eb,defaultWidth:"wide"}),quarter:Jr({values:Rb,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Jr({values:Ab,defaultWidth:"wide"}),day:Jr({values:Lb,defaultWidth:"wide"}),dayPeriod:Jr({values:Ib,defaultWidth:"wide",formattingValues:Nb,defaultFormattingWidth:"wide"})};const Bb=Ub;function ti(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.width,i=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],a=t.match(i);if(!a)return null;var s=a[0],o=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?zb(o,function(d){return d.test(s)}):Wb(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 Wb(n,t){for(var e in n)if(n.hasOwnProperty(e)&&t(n[e]))return e}function zb(n,t){for(var e=0;e<n.length;e++)if(t(n[e]))return e}function Yb(n){return function(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.match(n.matchPattern);if(!r)return null;var i=r[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(i.length);return{value:s,rest:o}}}var Hb=/^(\d+)(th|st|nd|rd)?/i,$b=/\d+/i,jb={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},Vb={any:[/^b/i,/^(a|c)/i]},qb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xb={any:[/1/i,/2/i,/3/i,/4/i]},Gb={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Kb={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]},Qb={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Zb={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Jb={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},tx={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}},ex={ordinalNumber:Yb({matchPattern:Hb,parsePattern:$b,valueCallback:function(t){return parseInt(t,10)}}),era:ti({matchPatterns:jb,defaultMatchWidth:"wide",parsePatterns:Vb,defaultParseWidth:"any"}),quarter:ti({matchPatterns:qb,defaultMatchWidth:"wide",parsePatterns:Xb,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:ti({matchPatterns:Gb,defaultMatchWidth:"wide",parsePatterns:Kb,defaultParseWidth:"any"}),day:ti({matchPatterns:Qb,defaultMatchWidth:"wide",parsePatterns:Zb,defaultParseWidth:"any"}),dayPeriod:ti({matchPatterns:Jb,defaultMatchWidth:"any",parsePatterns:tx,defaultParseWidth:"any"})},nx={code:"en-US",formatDistance:wb,formatLong:kb,formatRelative:Pb,localize:Bb,match:ex,options:{weekStartsOn:0,firstWeekContainsDate:1}};const Yd=nx;var rx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ix=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ax=/^'([^]*?)'?$/,sx=/''/g,ox=/[a-zA-Z]/;function lx(n,t,e){var r,i,a,s,o,l,c,u,d,f,p,y,x,g,m,v,b,w;J(2,arguments);var T=String(t),S=yn(),C=(r=(i=e==null?void 0:e.locale)!==null&&i!==void 0?i:S.locale)!==null&&r!==void 0?r:Yd,M=At((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:S.firstWeekContainsDate)!==null&&s!==void 0?s:(d=S.locale)===null||d===void 0||(f=d.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(M>=1&&M<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var D=At((p=(y=(x=(g=e==null?void 0:e.weekStartsOn)!==null&&g!==void 0?g:e==null||(m=e.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.weekStartsOn)!==null&&x!==void 0?x:S.weekStartsOn)!==null&&y!==void 0?y:(b=S.locale)===null||b===void 0||(w=b.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(D>=0&&D<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var O=nt(n);if(!Cs(O))throw new RangeError("Invalid time value");var P=Gi(O),E=Rd(O,P),F={firstWeekContainsDate:M,weekStartsOn:D,locale:C,_originalDate:O},q=T.match(ix).map(function($){var Y=$[0];if(Y==="p"||Y==="P"){var I=Ps[Y];return I($,C.formatLong)}return $}).join("").match(rx).map(function($){if($==="''")return"'";var Y=$[0];if(Y==="'")return cx($);var I=mb[Y];if(I)return!(e!=null&&e.useAdditionalWeekYearTokens)&&zd($)&&Zi($,t,String(n)),!(e!=null&&e.useAdditionalDayOfYearTokens)&&Wd($)&&Zi($,t,String(n)),I(E,$,C.localize,F);if(Y.match(ox))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Y+"`");return $}).join("");return q}function cx(n){var t=n.match(ax);return t?t[1].replace(sx,"'"):n}function ux(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 Hd(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function dx(n,t){if(n){if(typeof n=="string")return Hd(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 Hd(n,t)}}function $d(n,t){var e=typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=dx(n))||t&&n&&typeof n.length=="number"){e&&(n=e);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(c){throw c},f:i}}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 G(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Rs(n,t){return Rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},Rs(n,t)}function pt(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&&Rs(n,t)}function Ji(n){return Ji=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ji(n)}function fx(){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 hx(n,t){if(t&&(Ke(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return G(n)}function gt(n){var t=fx();return function(){var r=Ji(n),i;if(t){var a=Ji(this).constructor;i=Reflect.construct(r,arguments,a)}else i=r.apply(this,arguments);return hx(this,i)}}function ft(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function px(n,t){if(Ke(n)!=="object"||n===null)return n;var e=n[Symbol.toPrimitive];if(e!==void 0){var r=e.call(n,t||"default");if(Ke(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(n)}function jd(n){var t=px(n,"string");return Ke(t)==="symbol"?t:String(t)}function Vd(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,jd(r.key),r)}}function ht(n,t,e){return t&&Vd(n.prototype,t),e&&Vd(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function V(n,t,e){return t=jd(t),t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var gx=10,qd=function(){function n(){ft(this,n),V(this,"priority",void 0),V(this,"subPriority",0)}return ht(n,[{key:"validate",value:function(e,r){return!0}}]),n}(),mx=function(n){pt(e,n);var t=gt(e);function e(r,i,a,s,o){var l;return ft(this,e),l=t.call(this),l.value=r,l.validateValue=i,l.setValue=a,l.priority=s,o&&(l.subPriority=o),l}return ht(e,[{key:"validate",value:function(i,a){return this.validateValue(i,this.value,a)}},{key:"set",value:function(i,a,s){return this.setValue(i,a,this.value,s)}}]),e}(qd),yx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",gx),V(G(r),"subPriority",-1),r}return ht(e,[{key:"set",value:function(i,a){if(a.timestampIsSet)return i;var s=new Date(0);return s.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),s.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),s}}]),e}(qd),xt=function(){function n(){ft(this,n),V(this,"incompatibleTokens",void 0),V(this,"priority",void 0),V(this,"subPriority",void 0)}return ht(n,[{key:"run",value:function(e,r,i,a){var s=this.parse(e,r,i,a);return s?{setter:new mx(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}},{key:"validate",value:function(e,r,i){return!0}}]),n}(),vx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",140),V(G(r),"incompatibleTokens",["R","u","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"G":case"GG":case"GGG":return s.era(i,{width:"abbreviated"})||s.era(i,{width:"narrow"});case"GGGGG":return s.era(i,{width:"narrow"});case"GGGG":default:return s.era(i,{width:"wide"})||s.era(i,{width:"abbreviated"})||s.era(i,{width:"narrow"})}}},{key:"set",value:function(i,a,s){return a.era=s,i.setUTCFullYear(s,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Vt={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}/},Fe={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 qt(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 Ue(n,t){var e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};var r=e[1]==="+"?1:-1,i=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:r*(i*Qr+a*Ki+s*zv),rest:t.slice(e[0].length)}}function Xd(n){return Bt(Vt.anyDigitsSigned,n)}function jt(n,t){switch(n){case 1:return Bt(Vt.singleDigit,t);case 2:return Bt(Vt.twoDigits,t);case 3:return Bt(Vt.threeDigits,t);case 4:return Bt(Vt.fourDigits,t);default:return Bt(new RegExp("^\\d{1,"+n+"}"),t)}}function ta(n,t){switch(n){case 1:return Bt(Vt.singleDigitSigned,t);case 2:return Bt(Vt.twoDigitsSigned,t);case 3:return Bt(Vt.threeDigitsSigned,t);case 4:return Bt(Vt.fourDigitsSigned,t);default:return Bt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function As(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 Gd(n,t){var e=t>0,r=e?t:1-t,i;if(r<=50)i=n||100;else{var a=r+50,s=Math.floor(a/100)*100,o=n>=a%100;i=n+s-(o?100:0)}return e?i:1-i}function Kd(n){return n%400===0||n%4===0&&n%100!==0}var bx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="yy"}};switch(a){case"y":return qt(jt(4,i),o);case"yo":return qt(s.ordinalNumber(i,{unit:"year"}),o);default:return qt(jt(a.length,i),o)}}},{key:"validate",value:function(i,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(i,a,s){var o=i.getUTCFullYear();if(s.isTwoDigitYear){var l=Gd(s.year,o);return i.setUTCFullYear(l,0,1),i.setUTCHours(0,0,0,0),i}var c=!("era"in a)||a.era===1?s.year:1-s.year;return i.setUTCFullYear(c,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(xt),xx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){var o=function(c){return{year:c,isTwoDigitYear:a==="YY"}};switch(a){case"Y":return qt(jt(4,i),o);case"Yo":return qt(s.ordinalNumber(i,{unit:"year"}),o);default:return qt(jt(a.length,i),o)}}},{key:"validate",value:function(i,a){return a.isTwoDigitYear||a.year>0}},{key:"set",value:function(i,a,s,o){var l=Os(i,o);if(s.isTwoDigitYear){var c=Gd(s.year,l);return i.setUTCFullYear(c,0,o.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Fn(i,o)}var u=!("era"in a)||a.era===1?s.year:1-s.year;return i.setUTCFullYear(u,0,o.firstWeekContainsDate),i.setUTCHours(0,0,0,0),Fn(i,o)}}]),e}(xt),_x=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a){return ta(a==="R"?4:a.length,i)}},{key:"set",value:function(i,a,s){var o=new Date(0);return o.setUTCFullYear(s,0,4),o.setUTCHours(0,0,0,0),ar(o)}}]),e}(xt),wx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",130),V(G(r),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a){return ta(a==="u"?4:a.length,i)}},{key:"set",value:function(i,a,s){return i.setUTCFullYear(s,0,1),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Tx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",120),V(G(r),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"Q":case"QQ":return jt(a.length,i);case"Qo":return s.ordinalNumber(i,{unit:"quarter"});case"QQQ":return s.quarter(i,{width:"abbreviated",context:"formatting"})||s.quarter(i,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(i,{width:"wide",context:"formatting"})||s.quarter(i,{width:"abbreviated",context:"formatting"})||s.quarter(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=1&&a<=4}},{key:"set",value:function(i,a,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Mx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",120),V(G(r),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"q":case"qq":return jt(a.length,i);case"qo":return s.ordinalNumber(i,{unit:"quarter"});case"qqq":return s.quarter(i,{width:"abbreviated",context:"standalone"})||s.quarter(i,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(i,{width:"wide",context:"standalone"})||s.quarter(i,{width:"abbreviated",context:"standalone"})||s.quarter(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=1&&a<=4}},{key:"set",value:function(i,a,s){return i.setUTCMonth((s-1)*3,1),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Dx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),V(G(r),"priority",110),r}return ht(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c-1};switch(a){case"M":return qt(Bt(Vt.month,i),o);case"MM":return qt(jt(2,i),o);case"Mo":return qt(s.ordinalNumber(i,{unit:"month"}),o);case"MMM":return s.month(i,{width:"abbreviated",context:"formatting"})||s.month(i,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(i,{width:"wide",context:"formatting"})||s.month(i,{width:"abbreviated",context:"formatting"})||s.month(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Sx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",110),V(G(r),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c-1};switch(a){case"L":return qt(Bt(Vt.month,i),o);case"LL":return qt(jt(2,i),o);case"Lo":return qt(s.ordinalNumber(i,{unit:"month"}),o);case"LLL":return s.month(i,{width:"abbreviated",context:"standalone"})||s.month(i,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(i,{width:"wide",context:"standalone"})||s.month(i,{width:"abbreviated",context:"standalone"})||s.month(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){return i.setUTCMonth(s,1),i.setUTCHours(0,0,0,0),i}}]),e}(xt);function kx(n,t,e){J(2,arguments);var r=nt(n),i=At(t),a=Id(r,e)-i;return r.setUTCDate(r.getUTCDate()-a*7),r}var Cx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",100),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"w":return Bt(Vt.week,i);case"wo":return s.ordinalNumber(i,{unit:"week"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=53}},{key:"set",value:function(i,a,s,o){return Fn(kx(i,s,o),o)}}]),e}(xt);function Ox(n,t){J(2,arguments);var e=nt(n),r=At(t),i=Ld(e)-r;return e.setUTCDate(e.getUTCDate()-i*7),e}var Px=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",100),V(G(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"I":return Bt(Vt.week,i);case"Io":return s.ordinalNumber(i,{unit:"week"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=53}},{key:"set",value:function(i,a,s){return ar(Ox(i,s))}}]),e}(xt),Ex=[31,28,31,30,31,30,31,31,30,31,30,31],Rx=[31,29,31,30,31,30,31,31,30,31,30,31],Ax=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"subPriority",1),V(G(r),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"d":return Bt(Vt.date,i);case"do":return s.ordinalNumber(i,{unit:"date"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){var s=i.getUTCFullYear(),o=Kd(s),l=i.getUTCMonth();return o?a>=1&&a<=Rx[l]:a>=1&&a<=Ex[l]}},{key:"set",value:function(i,a,s){return i.setUTCDate(s),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Lx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"subpriority",1),V(G(r),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"D":case"DD":return Bt(Vt.dayOfYear,i);case"Do":return s.ordinalNumber(i,{unit:"date"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){var s=i.getUTCFullYear(),o=Kd(s);return o?a>=1&&a<=366:a>=1&&a<=365}},{key:"set",value:function(i,a,s){return i.setUTCMonth(0,s),i.setUTCHours(0,0,0,0),i}}]),e}(xt);function Ls(n,t,e){var r,i,a,s,o,l,c,u;J(2,arguments);var d=yn(),f=At((r=(i=(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&&i!==void 0?i:(c=d.locale)===null||c===void 0||(u=c.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(f>=0&&f<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=nt(n),y=At(t),x=p.getUTCDay(),g=y%7,m=(g+7)%7,v=(m<f?7:0)+y-x;return p.setUTCDate(p.getUTCDate()+v),p}var Ix=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["D","i","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"E":case"EE":case"EEE":return s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Ls(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Nx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,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 qt(jt(a.length,i),l);case"eo":return qt(s.ordinalNumber(i,{unit:"day"}),l);case"eee":return s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"eeeee":return s.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Ls(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Fx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),r}return ht(e,[{key:"parse",value:function(i,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 qt(jt(a.length,i),l);case"co":return qt(s.ordinalNumber(i,{unit:"day"}),l);case"ccc":return s.day(i,{width:"abbreviated",context:"standalone"})||s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"});case"ccccc":return s.day(i,{width:"narrow",context:"standalone"});case"cccccc":return s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(i,{width:"wide",context:"standalone"})||s.day(i,{width:"abbreviated",context:"standalone"})||s.day(i,{width:"short",context:"standalone"})||s.day(i,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(i,a){return a>=0&&a<=6}},{key:"set",value:function(i,a,s,o){return i=Ls(i,s,o),i.setUTCHours(0,0,0,0),i}}]),e}(xt);function Ux(n,t){J(2,arguments);var e=At(t);e%7===0&&(e=e-7);var r=1,i=nt(n),a=i.getUTCDay(),s=e%7,o=(s+7)%7,l=(o<r?7:0)+e-a;return i.setUTCDate(i.getUTCDate()+l),i}var Bx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",90),V(G(r),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){var o=function(c){return c===0?7:c};switch(a){case"i":case"ii":return jt(a.length,i);case"io":return s.ordinalNumber(i,{unit:"day"});case"iii":return qt(s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o);case"iiiii":return qt(s.day(i,{width:"narrow",context:"formatting"}),o);case"iiiiii":return qt(s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o);case"iiii":default:return qt(s.day(i,{width:"wide",context:"formatting"})||s.day(i,{width:"abbreviated",context:"formatting"})||s.day(i,{width:"short",context:"formatting"})||s.day(i,{width:"narrow",context:"formatting"}),o)}}},{key:"validate",value:function(i,a){return a>=1&&a<=7}},{key:"set",value:function(i,a,s){return i=Ux(i,s),i.setUTCHours(0,0,0,0),i}}]),e}(xt),Wx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["b","B","H","k","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"a":case"aa":case"aaa":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(As(s),0,0,0),i}}]),e}(xt),zx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["a","B","H","k","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"b":case"bb":case"bbb":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(As(s),0,0,0),i}}]),e}(xt),Yx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",80),V(G(r),"incompatibleTokens",["a","b","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"B":case"BB":case"BBB":return s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(i,{width:"wide",context:"formatting"})||s.dayPeriod(i,{width:"abbreviated",context:"formatting"})||s.dayPeriod(i,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(i,a,s){return i.setUTCHours(As(s),0,0,0),i}}]),e}(xt),Hx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["H","K","k","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"h":return Bt(Vt.hour12h,i);case"ho":return s.ordinalNumber(i,{unit:"hour"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=12}},{key:"set",value:function(i,a,s){var o=i.getUTCHours()>=12;return o&&s<12?i.setUTCHours(s+12,0,0,0):!o&&s===12?i.setUTCHours(0,0,0,0):i.setUTCHours(s,0,0,0),i}}]),e}(xt),$x=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["a","b","h","K","k","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"H":return Bt(Vt.hour23h,i);case"Ho":return s.ordinalNumber(i,{unit:"hour"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=23}},{key:"set",value:function(i,a,s){return i.setUTCHours(s,0,0,0),i}}]),e}(xt),jx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["h","H","k","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"K":return Bt(Vt.hour11h,i);case"Ko":return s.ordinalNumber(i,{unit:"hour"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=11}},{key:"set",value:function(i,a,s){var o=i.getUTCHours()>=12;return o&&s<12?i.setUTCHours(s+12,0,0,0):i.setUTCHours(s,0,0,0),i}}]),e}(xt),Vx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",70),V(G(r),"incompatibleTokens",["a","b","h","H","K","t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"k":return Bt(Vt.hour24h,i);case"ko":return s.ordinalNumber(i,{unit:"hour"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=1&&a<=24}},{key:"set",value:function(i,a,s){var o=s<=24?s%24:s;return i.setUTCHours(o,0,0,0),i}}]),e}(xt),qx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",60),V(G(r),"incompatibleTokens",["t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"m":return Bt(Vt.minute,i);case"mo":return s.ordinalNumber(i,{unit:"minute"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=59}},{key:"set",value:function(i,a,s){return i.setUTCMinutes(s,0,0),i}}]),e}(xt),Xx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",50),V(G(r),"incompatibleTokens",["t","T"]),r}return ht(e,[{key:"parse",value:function(i,a,s){switch(a){case"s":return Bt(Vt.second,i);case"so":return s.ordinalNumber(i,{unit:"second"});default:return jt(a.length,i)}}},{key:"validate",value:function(i,a){return a>=0&&a<=59}},{key:"set",value:function(i,a,s){return i.setUTCSeconds(s,0),i}}]),e}(xt),Gx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",30),V(G(r),"incompatibleTokens",["t","T"]),r}return ht(e,[{key:"parse",value:function(i,a){var s=function(l){return Math.floor(l*Math.pow(10,-a.length+3))};return qt(jt(a.length,i),s)}},{key:"set",value:function(i,a,s){return i.setUTCMilliseconds(s),i}}]),e}(xt),Kx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",10),V(G(r),"incompatibleTokens",["t","T","x"]),r}return ht(e,[{key:"parse",value:function(i,a){switch(a){case"X":return Ue(Fe.basicOptionalMinutes,i);case"XX":return Ue(Fe.basic,i);case"XXXX":return Ue(Fe.basicOptionalSeconds,i);case"XXXXX":return Ue(Fe.extendedOptionalSeconds,i);case"XXX":default:return Ue(Fe.extended,i)}}},{key:"set",value:function(i,a,s){return a.timestampIsSet?i:new Date(i.getTime()-s)}}]),e}(xt),Qx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",10),V(G(r),"incompatibleTokens",["t","T","X"]),r}return ht(e,[{key:"parse",value:function(i,a){switch(a){case"x":return Ue(Fe.basicOptionalMinutes,i);case"xx":return Ue(Fe.basic,i);case"xxxx":return Ue(Fe.basicOptionalSeconds,i);case"xxxxx":return Ue(Fe.extendedOptionalSeconds,i);case"xxx":default:return Ue(Fe.extended,i)}}},{key:"set",value:function(i,a,s){return a.timestampIsSet?i:new Date(i.getTime()-s)}}]),e}(xt),Zx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",40),V(G(r),"incompatibleTokens","*"),r}return ht(e,[{key:"parse",value:function(i){return Xd(i)}},{key:"set",value:function(i,a,s){return[new Date(s*1e3),{timestampIsSet:!0}]}}]),e}(xt),Jx=function(n){pt(e,n);var t=gt(e);function e(){var r;ft(this,e);for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return r=t.call.apply(t,[this].concat(a)),V(G(r),"priority",20),V(G(r),"incompatibleTokens","*"),r}return ht(e,[{key:"parse",value:function(i){return Xd(i)}},{key:"set",value:function(i,a,s){return[new Date(s),{timestampIsSet:!0}]}}]),e}(xt),t_={G:new vx,y:new bx,Y:new xx,R:new _x,u:new wx,Q:new Tx,q:new Mx,M:new Dx,L:new Sx,w:new Cx,I:new Px,d:new Ax,D:new Lx,E:new Ix,e:new Nx,c:new Fx,i:new Bx,a:new Wx,b:new zx,B:new Yx,h:new Hx,H:new $x,K:new jx,k:new Vx,m:new qx,s:new Xx,S:new Gx,X:new Kx,x:new Qx,t:new Zx,T:new Jx},e_=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,n_=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,r_=/^'([^]*?)'?$/,i_=/''/g,a_=/\S/,s_=/[a-zA-Z]/;function o_(n,t,e,r){var i,a,s,o,l,c,u,d,f,p,y,x,g,m,v,b,w,T;J(3,arguments);var S=String(n),C=String(t),M=yn(),D=(i=(a=r==null?void 0:r.locale)!==null&&a!==void 0?a:M.locale)!==null&&i!==void 0?i:Yd;if(!D.match)throw new RangeError("locale must contain match property");var O=At((s=(o=(l=(c=r==null?void 0:r.firstWeekContainsDate)!==null&&c!==void 0?c:r==null||(u=r.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:(f=M.locale)===null||f===void 0||(p=f.options)===null||p===void 0?void 0:p.firstWeekContainsDate)!==null&&s!==void 0?s:1);if(!(O>=1&&O<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var P=At((y=(x=(g=(m=r==null?void 0:r.weekStartsOn)!==null&&m!==void 0?m:r==null||(v=r.locale)===null||v===void 0||(b=v.options)===null||b===void 0?void 0:b.weekStartsOn)!==null&&g!==void 0?g:M.weekStartsOn)!==null&&x!==void 0?x:(w=M.locale)===null||w===void 0||(T=w.options)===null||T===void 0?void 0:T.weekStartsOn)!==null&&y!==void 0?y:0);if(!(P>=0&&P<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(C==="")return S===""?nt(e):new Date(NaN);var E={firstWeekContainsDate:O,weekStartsOn:P,locale:D},F=[new yx],q=C.match(n_).map(function(N){var A=N[0];if(A in Ps){var Q=Ps[A];return Q(N,D.formatLong)}return N}).join("").match(e_),$=[],Y=$d(q),I;try{var it=function(){var A=I.value;!(r!=null&&r.useAdditionalWeekYearTokens)&&zd(A)&&Zi(A,C,n),!(r!=null&&r.useAdditionalDayOfYearTokens)&&Wd(A)&&Zi(A,C,n);var Q=A[0],X=t_[Q];if(X){var vt=X.incompatibleTokens;if(Array.isArray(vt)){var ct=$.find(function(_t){return vt.includes(_t.token)||_t.token===Q});if(ct)throw new RangeError("The format string mustn't contain `".concat(ct.fullToken,"` and `").concat(A,"` at the same time"))}else if(X.incompatibleTokens==="*"&&$.length>0)throw new RangeError("The format string mustn't contain `".concat(A,"` and any other token at the same time"));$.push({token:Q,fullToken:A});var Ot=X.run(S,A,D.match,E);if(!Ot)return{v:new Date(NaN)};F.push(Ot.setter),S=Ot.rest}else{if(Q.match(s_))throw new RangeError("Format string contains an unescaped latin alphabet character `"+Q+"`");if(A==="''"?A="'":Q==="'"&&(A=l_(A)),S.indexOf(A)===0)S=S.slice(A.length);else return{v:new Date(NaN)}}};for(Y.s();!(I=Y.n()).done;){var B=it();if(Ke(B)==="object")return B.v}}catch(N){Y.e(N)}finally{Y.f()}if(S.length>0&&a_.test(S))return new Date(NaN);var yt=F.map(function(N){return N.priority}).sort(function(N,A){return A-N}).filter(function(N,A,Q){return Q.indexOf(N)===A}).map(function(N){return F.filter(function(A){return A.priority===N}).sort(function(A,Q){return Q.subPriority-A.subPriority})}).map(function(N){return N[0]}),ut=nt(e);if(isNaN(ut.getTime()))return new Date(NaN);var z=Rd(ut,Gi(ut)),L={},U=$d(yt),j;try{for(U.s();!(j=U.n()).done;){var Z=j.value;if(!Z.validate(z,E))return new Date(NaN);var K=Z.set(z,L,E);Array.isArray(K)?(z=K[0],ux(L,K[1])):z=K}}catch(N){U.e(N)}finally{U.f()}return z}function l_(n){return n.match(r_)[1].replace(i_,"'")}function c_(n){J(1,arguments);var t=nt(n);return t.setMinutes(0,0,0),t}function u_(n){J(1,arguments);var t=nt(n);return t.setMilliseconds(0),t}function d_(n){J(1,arguments);var t=n/Qr;return Math.floor(t)}function Qd(n,t){var e;J(1,arguments);var r=At((e=t==null?void 0:t.additionalDigits)!==null&&e!==void 0?e:2);if(r!==2&&r!==1&&r!==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 i=g_(n),a;if(i.date){var s=m_(i.date,r);a=y_(s.restDateString,s.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var o=a.getTime(),l=0,c;if(i.time&&(l=v_(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(c=b_(i.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 ea={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},f_=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,h_=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,p_=/^([+-])(\d{2})(?::?(\d{2}))?$/;function g_(n){var t={},e=n.split(ea.dateTimeDelimiter),r;if(e.length>2)return t;if(/:/.test(e[0])?r=e[0]:(t.date=e[0],r=e[1],ea.timeZoneDelimiter.test(t.date)&&(t.date=n.split(ea.timeZoneDelimiter)[0],r=n.substr(t.date.length,n.length))),r){var i=ea.timezone.exec(r);i?(t.time=r.replace(i[1],""),t.timezone=i[1]):t.time=r}return t}function m_(n,t){var e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=n.match(e);if(!r)return{year:NaN,restDateString:""};var i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:n.slice((r[1]||r[2]).length)}}function y_(n,t){if(t===null)return new Date(NaN);var e=n.match(f_);if(!e)return new Date(NaN);var r=!!e[4],i=ei(e[1]),a=ei(e[2])-1,s=ei(e[3]),o=ei(e[4]),l=ei(e[5])-1;if(r)return M_(t,o,l)?x_(t,o,l):new Date(NaN);var c=new Date(0);return!w_(t,a,s)||!T_(t,i)?new Date(NaN):(c.setUTCFullYear(t,a,Math.max(i,s)),c)}function ei(n){return n?parseInt(n):1}function v_(n){var t=n.match(h_);if(!t)return NaN;var e=Is(t[1]),r=Is(t[2]),i=Is(t[3]);return D_(e,r,i)?e*Qr+r*Ki+i*1e3:NaN}function Is(n){return n&&parseFloat(n.replace(",","."))||0}function b_(n){if(n==="Z")return 0;var t=n.match(p_);if(!t)return 0;var e=t[1]==="+"?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return S_(r,i)?e*(r*Qr+i*Ki):NaN}function x_(n,t,e){var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=(t-1)*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var __=[31,null,31,30,31,30,31,31,30,31,30,31];function Zd(n){return n%400===0||n%4===0&&n%100!==0}function w_(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(__[t]||(Zd(n)?29:28))}function T_(n,t){return t>=1&&t<=(Zd(n)?366:365)}function M_(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function D_(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function S_(n,t){return t>=0&&t<=59}var ee=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(ee||{}),na=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(na||{}),Wt=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Wt||{}),or=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(or||{});const Ns=(n,t)=>{var i,a;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((s,o)=>o.rawValue-s.rawValue);if(e.body&&!n.locked){const s=e.labelColors,o=((a=(i=t.chart.config)==null?void 0:i.options)==null?void 0:a.indexAxis)==="y"?"x":"y",l=[ee.HORIZONTAL_BAR,ee.VERTICAL_BAR].includes(n.chartType),c=[na.GAUGE,ee.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[o];let p;if(n.units==="bytes")p=isNaN(f)?f:Ds(f);else{const x=n.translateUnit(n.units,f);p=`${n.units==="usd"?"$":""}${f%1===0?ia.format(f):ia.format(Number(f.toFixed(wf)))} ${x}`}const y=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:s[d].backgroundColor,borderColor:s[d].borderColor,label:y,value:p,rawValue:f}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},k_=n=>n&&n.datasets&&n.datasets.length,C_=n=>k_(n)&&n.datasets.some(t=>t.data.length),O_=n=>C_(n)&&n.datasets.some(t=>t.data.length>1),P_=n=>O_(n)&&n.datasets.some(t=>t.data[0]&&Cs(t.data[0].x)),E_=n=>P_(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Fs=(n,t,e)=>{const i=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-i):n.x-t*1.15*(1-i)},R_=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function Jd(n,t){let e;return(...r)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...r)},t)}}var ge=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bn(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Us={exports:{}},tf={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})(tf);var zt=tf.exports,Bs={exports:{}},Ws={exports:{}},ef={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(ef);var nf=ef.exports,zs={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(i.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+i.length+" present")}n.exports=t.default})(zs,zs.exports);var ae=zs.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(nf),i=e(ae);function a(s){return(0,i.default)(1,arguments),s instanceof Date||(0,r.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(Ws,Ws.exports);var A_=Ws.exports,Ys={exports:{}};(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(nf),i=e(ae);function a(s){(0,i.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,r.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})(Ys,Ys.exports);var Be=Ys.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(A_),i=e(Be),a=e(ae);function s(o){if((0,a.default)(1,arguments),!(0,r.default)(o)&&typeof o!="number")return!1;var l=(0,i.default)(o);return!isNaN(Number(l))}n.exports=t.default})(Bs,Bs.exports);var L_=Bs.exports,Hs={exports:{}},$s={exports:{}},js={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=t.default})(js,js.exports);var Wn=js.exports;const I_=Bn(Wn);(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Wn),i=e(Be),a=e(ae);function s(o,l){(0,a.default)(2,arguments);var c=(0,i.default)(o).getTime(),u=(0,r.default)(l);return new Date(c+u)}n.exports=t.default})($s,$s.exports);var N_=$s.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(N_),i=e(ae),a=e(Wn);function s(o,l){(0,i.default)(2,arguments);var c=(0,a.default)(l);return(0,r.default)(o,-c)}n.exports=t.default})(Hs,Hs.exports);var F_=Hs.exports,Vs={exports:{}},qs={exports:{}};(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Be),i=e(ae),a=864e5;function s(o){(0,i.default)(1,arguments);var l=(0,r.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})(qs,qs.exports);var U_=qs.exports,Xs={exports:{}},Gs={exports:{}};(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Be),i=e(ae);function a(s){(0,i.default)(1,arguments);var o=1,l=(0,r.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})(Gs,Gs.exports);var Ks=Gs.exports,Qs={exports:{}},Zs={exports:{}};(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Be),i=e(ae),a=e(Ks);function s(o){(0,i.default)(1,arguments);var l=(0,r.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),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var p=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=p.getTime()?c:c-1}n.exports=t.default})(Zs,Zs.exports);var rf=Zs.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(rf),i=e(Ks),a=e(ae);function s(o){(0,a.default)(1,arguments);var l=(0,r.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,i.default)(c);return u}n.exports=t.default})(Qs,Qs.exports);var B_=Qs.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Be),i=e(Ks),a=e(B_),s=e(ae),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,r.default)(c),d=(0,i.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})(Xs,Xs.exports);var W_=Xs.exports,Js={exports:{}},to={exports:{}},zn={};Object.defineProperty(zn,"__esModule",{value:!0}),zn.getDefaultOptions=z_,zn.setDefaultOptions=Y_;var af={};function z_(){return af}function Y_(n){af=n}(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=e(Be),i=e(ae),a=e(Wn),s=zn;function o(l,c){var u,d,f,p,y,x,g,m;(0,i.default)(1,arguments);var v=(0,s.getDefaultOptions)(),b=(0,a.default)((u=(d=(f=(p=c==null?void 0:c.weekStartsOn)!==null&&p!==void 0?p:c==null||(y=c.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:v.weekStartsOn)!==null&&d!==void 0?d:(g=v.locale)===null||g===void 0||(m=g.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&u!==void 0?u:0);if(!(b>=0&&b<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,r.default)(l),T=w.getUTCDay(),S=(T<b?7:0)+T-b;return w.setUTCDate(w.getUTCDate()-S),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(to,to.exports);var eo=to.exports,no={exports:{}},ro={exports:{}};(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Be),i=e(ae),a=e(eo),s=e(Wn),o=zn;function l(c,u){var d,f,p,y,x,g,m,v;(0,i.default)(1,arguments);var b=(0,r.default)(c),w=b.getUTCFullYear(),T=(0,o.getDefaultOptions)(),S=(0,s.default)((d=(f=(p=(y=u==null?void 0:u.firstWeekContainsDate)!==null&&y!==void 0?y:u==null||(x=u.locale)===null||x===void 0||(g=x.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&p!==void 0?p:T.firstWeekContainsDate)!==null&&f!==void 0?f:(m=T.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=new Date(0);C.setUTCFullYear(w+1,0,S),C.setUTCHours(0,0,0,0);var M=(0,a.default)(C,u),D=new Date(0);D.setUTCFullYear(w,0,S),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return b.getTime()>=M.getTime()?w+1:b.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(ro,ro.exports);var sf=ro.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(sf),i=e(ae),a=e(eo),s=e(Wn),o=zn;function l(c,u){var d,f,p,y,x,g,m,v;(0,i.default)(1,arguments);var b=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(p=(y=u==null?void 0:u.firstWeekContainsDate)!==null&&y!==void 0?y:u==null||(x=u.locale)===null||x===void 0||(g=x.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&p!==void 0?p:b.firstWeekContainsDate)!==null&&f!==void 0?f:(m=b.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1),T=(0,r.default)(c,u),S=new Date(0);S.setUTCFullYear(T,0,w),S.setUTCHours(0,0,0,0);var C=(0,a.default)(S,u);return C}n.exports=t.default})(no,no.exports);var H_=no.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Be),i=e(eo),a=e(H_),s=e(ae),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,r.default)(c),f=(0,i.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(Js,Js.exports);var $_=Js.exports,io={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){for(var a=r<0?"-":"",s=Math.abs(r).toString();s.length<i;)s="0"+s;return a+s}n.exports=t.default})(io,io.exports);var of=io.exports,ao={exports:{}};(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(of),i={y:function(o,l){var c=o.getUTCFullYear(),u=c>0?c:1-c;return(0,r.default)(l==="yy"?u%100:u,l.length)},M:function(o,l){var c=o.getUTCMonth();return l==="M"?String(c+1):(0,r.default)(c+1,2)},d:function(o,l){return(0,r.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,r.default)(o.getUTCHours()%12||12,l.length)},H:function(o,l){return(0,r.default)(o.getUTCHours(),l.length)},m:function(o,l){return(0,r.default)(o.getUTCMinutes(),l.length)},s:function(o,l){return(0,r.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,r.default)(d,l.length)}},a=i;t.default=a,n.exports=t.default})(ao,ao.exports);var j_=ao.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(U_),i=e(W_),a=e(rf),s=e($_),o=e(sf),l=e(of),c=e(j_),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(m,v,b){var w=m.getUTCFullYear()>0?1:0;switch(v){case"G":case"GG":case"GGG":return b.era(w,{width:"abbreviated"});case"GGGGG":return b.era(w,{width:"narrow"});case"GGGG":default:return b.era(w,{width:"wide"})}},y:function(m,v,b){if(v==="yo"){var w=m.getUTCFullYear(),T=w>0?w:1-w;return b.ordinalNumber(T,{unit:"year"})}return c.default.y(m,v)},Y:function(m,v,b,w){var T=(0,o.default)(m,w),S=T>0?T:1-T;if(v==="YY"){var C=S%100;return(0,l.default)(C,2)}return v==="Yo"?b.ordinalNumber(S,{unit:"year"}):(0,l.default)(S,v.length)},R:function(m,v){var b=(0,a.default)(m);return(0,l.default)(b,v.length)},u:function(m,v){var b=m.getUTCFullYear();return(0,l.default)(b,v.length)},Q:function(m,v,b){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 b.ordinalNumber(w,{unit:"quarter"});case"QQQ":return b.quarter(w,{width:"abbreviated",context:"formatting"});case"QQQQQ":return b.quarter(w,{width:"narrow",context:"formatting"});case"QQQQ":default:return b.quarter(w,{width:"wide",context:"formatting"})}},q:function(m,v,b){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 b.ordinalNumber(w,{unit:"quarter"});case"qqq":return b.quarter(w,{width:"abbreviated",context:"standalone"});case"qqqqq":return b.quarter(w,{width:"narrow",context:"standalone"});case"qqqq":default:return b.quarter(w,{width:"wide",context:"standalone"})}},M:function(m,v,b){var w=m.getUTCMonth();switch(v){case"M":case"MM":return c.default.M(m,v);case"Mo":return b.ordinalNumber(w+1,{unit:"month"});case"MMM":return b.month(w,{width:"abbreviated",context:"formatting"});case"MMMMM":return b.month(w,{width:"narrow",context:"formatting"});case"MMMM":default:return b.month(w,{width:"wide",context:"formatting"})}},L:function(m,v,b){var w=m.getUTCMonth();switch(v){case"L":return String(w+1);case"LL":return(0,l.default)(w+1,2);case"Lo":return b.ordinalNumber(w+1,{unit:"month"});case"LLL":return b.month(w,{width:"abbreviated",context:"standalone"});case"LLLLL":return b.month(w,{width:"narrow",context:"standalone"});case"LLLL":default:return b.month(w,{width:"wide",context:"standalone"})}},w:function(m,v,b,w){var T=(0,s.default)(m,w);return v==="wo"?b.ordinalNumber(T,{unit:"week"}):(0,l.default)(T,v.length)},I:function(m,v,b){var w=(0,i.default)(m);return v==="Io"?b.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,v.length)},d:function(m,v,b){return v==="do"?b.ordinalNumber(m.getUTCDate(),{unit:"date"}):c.default.d(m,v)},D:function(m,v,b){var w=(0,r.default)(m);return v==="Do"?b.ordinalNumber(w,{unit:"dayOfYear"}):(0,l.default)(w,v.length)},E:function(m,v,b){var w=m.getUTCDay();switch(v){case"E":case"EE":case"EEE":return b.day(w,{width:"abbreviated",context:"formatting"});case"EEEEE":return b.day(w,{width:"narrow",context:"formatting"});case"EEEEEE":return b.day(w,{width:"short",context:"formatting"});case"EEEE":default:return b.day(w,{width:"wide",context:"formatting"})}},e:function(m,v,b,w){var T=m.getUTCDay(),S=(T-w.weekStartsOn+8)%7||7;switch(v){case"e":return String(S);case"ee":return(0,l.default)(S,2);case"eo":return b.ordinalNumber(S,{unit:"day"});case"eee":return b.day(T,{width:"abbreviated",context:"formatting"});case"eeeee":return b.day(T,{width:"narrow",context:"formatting"});case"eeeeee":return b.day(T,{width:"short",context:"formatting"});case"eeee":default:return b.day(T,{width:"wide",context:"formatting"})}},c:function(m,v,b,w){var T=m.getUTCDay(),S=(T-w.weekStartsOn+8)%7||7;switch(v){case"c":return String(S);case"cc":return(0,l.default)(S,v.length);case"co":return b.ordinalNumber(S,{unit:"day"});case"ccc":return b.day(T,{width:"abbreviated",context:"standalone"});case"ccccc":return b.day(T,{width:"narrow",context:"standalone"});case"cccccc":return b.day(T,{width:"short",context:"standalone"});case"cccc":default:return b.day(T,{width:"wide",context:"standalone"})}},i:function(m,v,b){var w=m.getUTCDay(),T=w===0?7:w;switch(v){case"i":return String(T);case"ii":return(0,l.default)(T,v.length);case"io":return b.ordinalNumber(T,{unit:"day"});case"iii":return b.day(w,{width:"abbreviated",context:"formatting"});case"iiiii":return b.day(w,{width:"narrow",context:"formatting"});case"iiiiii":return b.day(w,{width:"short",context:"formatting"});case"iiii":default:return b.day(w,{width:"wide",context:"formatting"})}},a:function(m,v,b){var w=m.getUTCHours(),T=w/12>=1?"pm":"am";switch(v){case"a":case"aa":return b.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"aaa":return b.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return b.dayPeriod(T,{width:"narrow",context:"formatting"});case"aaaa":default:return b.dayPeriod(T,{width:"wide",context:"formatting"})}},b:function(m,v,b){var w=m.getUTCHours(),T;switch(w===12?T=u.noon:w===0?T=u.midnight:T=w/12>=1?"pm":"am",v){case"b":case"bb":return b.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"bbb":return b.dayPeriod(T,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return b.dayPeriod(T,{width:"narrow",context:"formatting"});case"bbbb":default:return b.dayPeriod(T,{width:"wide",context:"formatting"})}},B:function(m,v,b){var w=m.getUTCHours(),T;switch(w>=17?T=u.evening:w>=12?T=u.afternoon:w>=4?T=u.morning:T=u.night,v){case"B":case"BB":case"BBB":return b.dayPeriod(T,{width:"abbreviated",context:"formatting"});case"BBBBB":return b.dayPeriod(T,{width:"narrow",context:"formatting"});case"BBBB":default:return b.dayPeriod(T,{width:"wide",context:"formatting"})}},h:function(m,v,b){if(v==="ho"){var w=m.getUTCHours()%12;return w===0&&(w=12),b.ordinalNumber(w,{unit:"hour"})}return c.default.h(m,v)},H:function(m,v,b){return v==="Ho"?b.ordinalNumber(m.getUTCHours(),{unit:"hour"}):c.default.H(m,v)},K:function(m,v,b){var w=m.getUTCHours()%12;return v==="Ko"?b.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,v.length)},k:function(m,v,b){var w=m.getUTCHours();return w===0&&(w=24),v==="ko"?b.ordinalNumber(w,{unit:"hour"}):(0,l.default)(w,v.length)},m:function(m,v,b){return v==="mo"?b.ordinalNumber(m.getUTCMinutes(),{unit:"minute"}):c.default.m(m,v)},s:function(m,v,b){return v==="so"?b.ordinalNumber(m.getUTCSeconds(),{unit:"second"}):c.default.s(m,v)},S:function(m,v){return c.default.S(m,v)},X:function(m,v,b,w){var T=w._originalDate||m,S=T.getTimezoneOffset();if(S===0)return"Z";switch(v){case"X":return p(S);case"XXXX":case"XX":return y(S);case"XXXXX":case"XXX":default:return y(S,":")}},x:function(m,v,b,w){var T=w._originalDate||m,S=T.getTimezoneOffset();switch(v){case"x":return p(S);case"xxxx":case"xx":return y(S);case"xxxxx":case"xxx":default:return y(S,":")}},O:function(m,v,b,w){var T=w._originalDate||m,S=T.getTimezoneOffset();switch(v){case"O":case"OO":case"OOO":return"GMT"+f(S,":");case"OOOO":default:return"GMT"+y(S,":")}},z:function(m,v,b,w){var T=w._originalDate||m,S=T.getTimezoneOffset();switch(v){case"z":case"zz":case"zzz":return"GMT"+f(S,":");case"zzzz":default:return"GMT"+y(S,":")}},t:function(m,v,b,w){var T=w._originalDate||m,S=Math.floor(T.getTime()/1e3);return(0,l.default)(S,v.length)},T:function(m,v,b,w){var T=w._originalDate||m,S=T.getTime();return(0,l.default)(S,v.length)}};function f(g,m){var v=g>0?"-":"+",b=Math.abs(g),w=Math.floor(b/60),T=b%60;if(T===0)return v+String(w);var S=m||"";return v+String(w)+S+(0,l.default)(T,2)}function p(g,m){if(g%60===0){var v=g>0?"-":"+";return v+(0,l.default)(Math.abs(g)/60,2)}return y(g,m)}function y(g,m){var v=m||"",b=g>0?"-":"+",w=Math.abs(g),T=(0,l.default)(Math.floor(w/60),2),S=(0,l.default)(w%60,2);return b+T+v+S}var x=d;t.default=x,n.exports=t.default})(Vs,Vs.exports);var V_=Vs.exports,so={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"})}},r=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"})}},i=function(l,c){var u=l.match(/(P+)(p+)?/)||[],d=u[1],f=u[2];if(!f)return e(l,c);var p;switch(d){case"P":p=c.dateTime({width:"short"});break;case"PP":p=c.dateTime({width:"medium"});break;case"PPP":p=c.dateTime({width:"long"});break;case"PPPP":default:p=c.dateTime({width:"full"});break}return p.replace("{{date}}",e(d,c)).replace("{{time}}",r(f,c))},a={p:r,P:i},s=a;t.default=s,n.exports=t.default})(so,so.exports);var q_=so.exports,oo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=t.default})(oo,oo.exports);var lf=oo.exports;const cf=Bn(lf);var ni={};Object.defineProperty(ni,"__esModule",{value:!0}),ni.isProtectedDayOfYearToken=K_,ni.isProtectedWeekYearToken=Q_,ni.throwProtectedError=Z_;var X_=["D","DD"],G_=["YY","YYYY"];function K_(n){return X_.indexOf(n)!==-1}function Q_(n){return G_.indexOf(n)!==-1}function Z_(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 lo={exports:{}},co={exports:{}},uo={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"}},r=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},i=r;t.default=i,n.exports=t.default})(uo,uo.exports);var J_=uo.exports,fo={exports:{}},ho={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.width?String(i.width):r.defaultWidth,s=r.formats[a]||r.formats[r.defaultWidth];return s}}n.exports=t.default})(ho,ho.exports);var tw=ho.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(tw),i={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,r.default)({formats:i,defaultWidth:"full"}),time:(0,r.default)({formats:a,defaultWidth:"full"}),dateTime:(0,r.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(fo,fo.exports);var ew=fo.exports,po={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"},r=function(s,o,l,c){return e[s]},i=r;t.default=i,n.exports=t.default})(po,po.exports);var nw=po.exports,go={exports:{}},mo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&r.formattingValues){var l=r.defaultFormattingWidth||r.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=r.formattingValues[c]||r.formattingValues[l]}else{var u=r.defaultWidth,d=a!=null&&a.width?String(a.width):r.defaultWidth;o=r.values[d]||r.values[u]}var f=r.argumentCallback?r.argumentCallback(i):i;return o[f]}}n.exports=t.default})(mo,mo.exports);var rw=mo.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(rw),i={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(y,x){var g=Number(y),m=g%100;if(m>20||m<10)switch(m%10){case 1:return g+"st";case 2:return g+"nd";case 3:return g+"rd"}return g+"th"},d={ordinalNumber:u,era:(0,r.default)({values:i,defaultWidth:"wide"}),quarter:(0,r.default)({values:a,defaultWidth:"wide",argumentCallback:function(y){return y-1}}),month:(0,r.default)({values:s,defaultWidth:"wide"}),day:(0,r.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,r.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(go,go.exports);var iw=go.exports,yo={exports:{}},vo={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],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],p=Array.isArray(f)?i(f,function(g){return g.test(d)}):r(f,function(g){return g.test(d)}),y;y=a.valueCallback?a.valueCallback(p):p,y=o.valueCallback?o.valueCallback(y):y;var x=s.slice(d.length);return{value:y,rest:x}}}function r(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function i(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(vo,vo.exports);var aw=vo.exports,bo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.match(r.matchPattern);if(!s)return null;var o=s[0],l=i.match(r.parsePattern);if(!l)return null;var c=r.valueCallback?r.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=i.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(bo,bo.exports);var sw=bo.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(aw),i=e(sw),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},f={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]},p={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},y={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]},x={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},g={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,i.default)({matchPattern:a,parsePattern:s,valueCallback:function(w){return parseInt(w,10)}}),era:(0,r.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(w){return w+1}}),month:(0,r.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,r.default)({matchPatterns:p,defaultMatchWidth:"wide",parsePatterns:y,defaultParseWidth:"any"}),dayPeriod:(0,r.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:g,defaultParseWidth:"any"})},v=m;t.default=v,n.exports=t.default})(yo,yo.exports);var ow=yo.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(J_),i=e(ew),a=e(nw),s=e(iw),o=e(ow),l={code:"en-US",formatDistance:r.default,formatLong:i.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(co,co.exports);var lw=co.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(lw),i=r.default;t.default=i,n.exports=t.default})(lo,lo.exports);var cw=lo.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=b;var r=e(L_),i=e(F_),a=e(Be),s=e(V_),o=e(q_),l=e(lf),c=ni,u=e(Wn),d=e(ae),f=zn,p=e(cw),y=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,g=/^'([^]*?)'?$/,m=/''/g,v=/[a-zA-Z]/;function b(T,S,C){var M,D,O,P,E,F,q,$,Y,I,it,B,yt,ut,z,L,U,j;(0,d.default)(2,arguments);var Z=String(S),K=(0,f.getDefaultOptions)(),N=(M=(D=C==null?void 0:C.locale)!==null&&D!==void 0?D:K.locale)!==null&&M!==void 0?M:p.default,A=(0,u.default)((O=(P=(E=(F=C==null?void 0:C.firstWeekContainsDate)!==null&&F!==void 0?F:C==null||(q=C.locale)===null||q===void 0||($=q.options)===null||$===void 0?void 0:$.firstWeekContainsDate)!==null&&E!==void 0?E:K.firstWeekContainsDate)!==null&&P!==void 0?P:(Y=K.locale)===null||Y===void 0||(I=Y.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(A>=1&&A<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((it=(B=(yt=(ut=C==null?void 0:C.weekStartsOn)!==null&&ut!==void 0?ut:C==null||(z=C.locale)===null||z===void 0||(L=z.options)===null||L===void 0?void 0:L.weekStartsOn)!==null&&yt!==void 0?yt:K.weekStartsOn)!==null&&B!==void 0?B:(U=K.locale)===null||U===void 0||(j=U.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&it!==void 0?it:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var X=(0,a.default)(T);if(!(0,r.default)(X))throw new RangeError("Invalid time value");var vt=(0,l.default)(X),ct=(0,i.default)(X,vt),Ot={firstWeekContainsDate:A,weekStartsOn:Q,locale:N,_originalDate:X},_t=Z.match(x).map(function(et){var bt=et[0];if(bt==="p"||bt==="P"){var Nt=o.default[bt];return Nt(et,N.formatLong)}return et}).join("").match(y).map(function(et){if(et==="''")return"'";var bt=et[0];if(bt==="'")return w(et);var Nt=s.default[bt];if(Nt)return!(C!=null&&C.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),!(C!=null&&C.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),Nt(ct,et,N.localize,Ot);if(bt.match(v))throw new RangeError("Format string contains an unescaped latin alphabet character `"+bt+"`");return et}).join("");return _t}function w(T){var S=T.match(g);return S?S[1].replace(m,"'"):T}n.exports=t.default})(Us,Us.exports);var uw=Us.exports;const dw=Bn(uw);function uf(n,t,e){var r=pw(n,e.timeZone,e.locale);return r.formatToParts?fw(r,t):hw(r,t)}function fw(n,t){for(var e=n.formatToParts(t),r=e.length-1;r>=0;--r)if(e[r].type==="timeZoneName")return e[r].value}function hw(n,t){var e=n.format(t).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(e);return r?r[0].substr(1):""}function pw(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 gw(n,t){var e=bw(t);return e.formatToParts?yw(e,n):vw(e,n)}var mw={year:0,month:1,day:2,hour:3,minute:4,second:5};function yw(n,t){try{for(var e=n.formatToParts(t),r=[],i=0;i<e.length;i++){var a=mw[e[i].type];a>=0&&(r[a]=parseInt(e[i].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function vw(n,t){var e=n.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var xo={};function bw(n){if(!xo[n]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",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";xo[n]=e?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"}):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"})}return xo[n]}function df(n,t,e,r,i,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(r,i,a,s),o}var ff=36e5,xw=6e4,_o={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function wo(n,t,e){var r,i;if(!n||(r=_o.timezoneZ.exec(n),r))return 0;var a;if(r=_o.timezoneHH.exec(n),r)return a=parseInt(r[1],10),hf(a)?-(a*ff):NaN;if(r=_o.timezoneHHMM.exec(n),r){a=parseInt(r[2],10);var s=parseInt(r[3],10);return hf(a,s)?(i=Math.abs(a)*ff+s*xw,r[1]==="+"?-i:i):NaN}if(Tw(n)){t=new Date(t||Date.now());var o=e?t:_w(t),l=To(o,n),c=e?l:ww(t,l,n);return-c}return NaN}function _w(n){return df(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function To(n,t){var e=gw(n,t),r=df(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),i=n.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function ww(n,t,e){var r=n.getTime(),i=r-t,a=To(new Date(i),e);if(t===a)return t;i-=a-t;var s=To(new Date(i),e);return a===s?a:Math.max(a,s)}function hf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var pf={};function Tw(n){if(pf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),pf[n]=!0,!0}catch{return!1}}var Mw=60*1e3,Dw={X:function(n,t,e,r){var i=Mo(r.timeZone,n);if(i===0)return"Z";switch(t){case"X":return gf(i);case"XXXX":case"XX":return lr(i);case"XXXXX":case"XXX":default:return lr(i,":")}},x:function(n,t,e,r){var i=Mo(r.timeZone,n);switch(t){case"x":return gf(i);case"xxxx":case"xx":return lr(i);case"xxxxx":case"xxx":default:return lr(i,":")}},O:function(n,t,e,r){var i=Mo(r.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Sw(i,":");case"OOOO":default:return"GMT"+lr(i,":")}},z:function(n,t,e,r){switch(t){case"z":case"zz":case"zzz":return uf("short",n,r);case"zzzz":default:return uf("long",n,r)}}};function Mo(n,t){var e=n?wo(n,t,!0)/Mw:t.getTimezoneOffset();if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function ra(n,t){for(var e=n<0?"-":"",r=Math.abs(n).toString();r.length<t;)r="0"+r;return e+r}function lr(n,t){var e=t||"",r=n>0?"-":"+",i=Math.abs(n),a=ra(Math.floor(i/60),2),s=ra(Math.floor(i%60),2);return r+a+e+s}function gf(n,t){if(n%60===0){var e=n>0?"-":"+";return e+ra(Math.abs(n)/60,2)}return lr(n,t)}function Sw(n,t){var e=n>0?"-":"+",r=Math.abs(n),i=Math.floor(r/60),a=r%60;if(a===0)return e+String(i);var s=t||"";return e+String(i)+s+ra(a,2)}var kw=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Do=36e5,mf=6e4,Cw=2,se={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:kw};function yf(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||{},r=e.additionalDigits==null?Cw:I_(e.additionalDigits);if(r!==2&&r!==1&&r!==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 i=Ow(n),a=Pw(i.date,r),s=a.year,o=a.restDateString,l=Ew(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(i.time&&(u=Rw(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(d=wo(i.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=cf(new Date(c+u)),d=cf(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function Ow(n){var t={},e=se.dateTimePattern.exec(n),r;if(e?(t.date=e[1],r=e[3]):(e=se.datePattern.exec(n),e?(t.date=e[1],r=e[2]):(t.date=null,r=n)),r){var i=se.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function Pw(n,t){var e=se.YYY[t],r=se.YYYYY[t],i;if(i=se.YYYY.exec(n)||r.exec(n),i){var a=i[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(i=se.YY.exec(n)||e.exec(n),i){var s=i[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function Ew(n,t){if(t===null)return null;var e,r,i,a;if(n.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(e=se.MM.exec(n),e)return r=new Date(0),i=parseInt(e[1],10)-1,xf(t,i)?(r.setUTCFullYear(t,i),r):new Date(NaN);if(e=se.DDD.exec(n),e){r=new Date(0);var s=parseInt(e[1],10);return Iw(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(e=se.MMDD.exec(n),e){r=new Date(0),i=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return xf(t,i,o)?(r.setUTCFullYear(t,i,o),r):new Date(NaN)}if(e=se.Www.exec(n),e)return a=parseInt(e[1],10)-1,_f(t,a)?vf(t,a):new Date(NaN);if(e=se.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return _f(t,a,l)?vf(t,a,l):new Date(NaN)}return null}function Rw(n){var t,e,r;if(t=se.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),So(e)?e%24*Do:NaN;if(t=se.HHMM.exec(n),t)return e=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),So(e,r)?e%24*Do+r*mf:NaN;if(t=se.HHMMSS.exec(n),t){e=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return So(e,r,i)?e%24*Do+r*mf+i*1e3:NaN}return null}function vf(n,t,e){t=t||0,e=e||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=t*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var Aw=[31,28,31,30,31,30,31,31,30,31,30,31],Lw=[31,29,31,30,31,30,31,31,30,31,30,31];function bf(n){return n%400===0||n%4===0&&n%100!==0}function xf(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var r=bf(n);if(r&&e>Lw[t]||!r&&e>Aw[t])return!1}return!0}function Iw(n,t){if(t<1)return!1;var e=bf(n);return!(e&&t>366||!e&&t>365)}function _f(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function So(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Nw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ko(n,t,e){var r=String(t),i=e||{},a=r.match(Nw);if(a){var s=yf(i.originalDate||n,i);r=a.reduce(function(o,l){if(l[0]==="'")return o;var c=o.indexOf(l),u=o[c-1]==="'",d=o.replace(l,"'"+Dw[l[0]](s,l,null,i)+"'");return u?d.substring(0,c-1)+d.substring(c+1):d},r)}return dw(n,r,i)}var Co={exports:{}},Oo={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a]);return r}n.exports=t.default})(Oo,Oo.exports);var Fw=Oo.exports;(function(n,t){var e=zt.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=e(Fw);function i(a){return(0,r.default)({},a)}n.exports=t.default})(Co,Co.exports);var Uw=Co.exports;const Bw=Bn(Uw);function Ww(n,t,e){var r=yf(n,e),i=wo(t,r,!0),a=new Date(r.getTime()-i),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 zw(n,t,e,r){var i=Bw(r);return i.timeZone=t,i.originalDate=n,ko(Ww(n,t),e,i)}const wf=2,Tf=10,Mf=12,ia=new Intl.NumberFormat(((cp=document==null?void 0:document.documentElement)==null?void 0:cp.lang)||"en-US");function aa(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let r="MMM dd, YYY hh:mm a";t.short&&(r="MMM dd, YYY"),t.includeTZ&&(r+=" (z)");const i=new Date(n);return zw(i,e,r)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const sa=10,Df={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},Qe=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],cr=(n,t)=>(t||Qe)[n%Qe.length],Sf=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),r=parseInt(n.substring(2,4),16),i=parseInt(n.substring(4,6),16);e=e-t,r=r-t,i=i-t,e>255?e=255:e<0&&(e=0),r>255?r=255:r<0&&(r=0),i>255?i=255:i<0&&(i=0);const a=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),s=r.toString(16).length===1?"0"+r.toString(16):r.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16);return`#${a}${s}${o}`},kf="#6f7787",Cf={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},Yw=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Cf[t])==null?void 0:e.background)||"#fafafa"},Hw={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},$w={"4XX":"#FFBA81","5XX":"#FF8484"},jw={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},Vw="#dad4c7",qw=n=>{const t=Object.entries(Df).find(([e])=>new RegExp(e).test(n));return t&&t[1]||Df.standard},Xw={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Gw=2,Kw=0,Po=new Map,Eo=(n,t)=>t==="bytes"?Ds(n):t==="count/minute"?n.toFixed(2):ia.format(n),Of=n=>{const e=document.createElement("canvas").getContext("2d"),r=Rt({});return e.font=r.string,e.measureText(n).width},Qw=()=>{const n="label_height";if(!Po.has(n)){const t=Rt({});Po.set(n,t.lineHeight)}return Po.get(n)},Zw=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((r,i)=>isNaN(i)?r:r+i,0),0),Pf=(n,t)=>t.datasets.reduce((e,r,i)=>n.isDatasetVisible(i)?e+r.data.reduce((a,s)=>isNaN(s)?a:a+s,0):e,0),Ef=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Ro="#e0e4ea",Jw={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"]},ri=(n,t)=>{let e=1;const r=Jw[n],i=new Map;for(const a of t)i.set(a,r[e]),e=e%(r.length-1)+1;return i.set(-1,r[0]),i},Rf=new Map([[100,ri("100",[100,101,102,103])],[200,ri("200",[200,201,202,203,204,205,206,207,208,226])],[300,ri("300",[300,301,302,303,304,305,307,308])],[400,ri("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,ri("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Ao=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,r=Rf.get(e);return r===void 0?Ro:r.get(t)??r.get(-1)??Ro},t1=n=>{const t=Ao(n);return{solid:t,light:t}},oa={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Ao(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function e1(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};ji.positioners.barChartTooltipPosition=function(i,a){if(!i.length)return!1;const s=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,l=s.width/2,c=Fs(a,o,l),u=a.y,d=a.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},os.modes.customInteractionMode=function(i,a){const s=hn(a,i),o=[];return os.evaluateInteractionItems(i,i.options.indexAxis||"x",s,(l,c,u)=>{i.options.indexAxis==="y"&&l.inYRange(s.y,!0)&&i.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u}),i.options.indexAxis==="x"&&l.inXRange(s.x,!0)&&i.data.datasets[c].data[u]&&o.push({element:l,datasetIndex:c,index:u})}),o};const e=n.numLabels.value>25?Tf:Mf;return h.computed(()=>{var i,a,s,o,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,p){const y=this;if(y.chart.options.indexAxis===y.axis){f=y.getLabelForValue(p);const x=10;return f&&f.length>x?f.slice(0,x)+"...":f}return y.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!st((i=n.metricAxesTitle)==null?void 0:i.value):!st((a=n.dimensionAxesTitle)==null?void 0:a.value),text:n.indexAxis==="y"?(s=n.metricAxesTitle)==null?void 0:s.value:(o=n.dimensionAxesTitle)==null?void 0:o.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,p){const y=this;return y.chart.options.indexAxis===y.axis?(f=y.getLabelForValue(p),f&&f.length>sa?f.slice(0,sa)+"...":f):y.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{Ns(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}Me.register(...Dv);const n1=(n,t)=>{const e=t.datasets.map(i=>i.label),r=n.datasets.map(i=>i.label);return n.datasets.length===t.datasets.length&&e.every((i,a)=>i===r[a])};function r1(n,t,e,r,i){const a=h.shallowRef(null),s=(o,l)=>{if(t.value)return new Me(t.value,{type:n,data:o,plugins:r,options:l})};return h.onMounted(()=>{a.value=s(e.value,i.value)}),h.onBeforeUnmount(()=>{st(a.value)||a.value.destroy()}),h.watch(e,(o,l)=>{if(n1(l,o)&&!st(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 st(a.value)||a.value.destroy(),a.value=s(o,i.value)}),h.watch(t,()=>{st(a.value)||a.value.destroy(),a.value=s(e.value,i.value)}),h.watch(i,(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))&&(st(a.value)||a.value.destroy(),a.value=s(e.value,o))}),a}var Af={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:",",f=[],p=Math.round(c).toString().split("");return p.reverse().forEach(function(y,x){x&&x%3===0&&f.push(d),f.push(y)}),f.reverse().join("")}function e(c,u,d){var f=c/u,p=d.round?"round":"floor";return d.decimal===!1?(c=Math[p](f),c.toString()):(d.precision?c=f:c=f<10?Math[p](f*10)/10:Math[p](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var r=1e3,i=1e4,a=1e6,s=1e9,o=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var p=u.min10k?i:r;return c<p||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<a?d=e(c,r,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",f&&(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})()})(Af);var i1=Af.exports;const ii=Bn(i1);function a1(n,t,e){const{i18n:r}=St.useI18n(),{translateUnit:i}=St.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((s,o)=>{const l=o.total?o.total:o.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":Ds(l);else{const u=i(e.value,l);c=r&&r.t("legend.datapointValueDisplay",{value:ii(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${ii(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...s,[o.label]:{raw:l,formatted:c}}},{}))}}function s1(n){return h.computed(()=>{var i;if(!((i=n.value)!=null&&i.meta))return"";const e=n.value.meta.start_ms,r=n.value.meta.end_ms;return e&&r?`${aa(e)} - ${aa(r,{includeTZ:!0})}`:""})}function o1(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};return ji.positioners.doughnutChartTooltipPosition=function(r,i){if(!r.length)return!1;const a=this.chart.canvas.getBoundingClientRect(),s=n.tooltipState.width||this.width,o=a.width/2,l=Fs(i,s,o),c=i.y,u=i.x<o?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:r=>{Ns(n.tooltipState,r)}}}}))}}function l1(n){const t=h.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:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),r={enabled:!1,position:"lineChartTooltipPosition"};ji.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,f=n.tooltipState.height||this.height,p=u.width/2,y=u.height/2,x=Fs(c,d,p);let g=R_(c,f,y);const m=c.y<y?"top":"bottom",v=c.x<p?"left":"center";return f>u.height&&(g=0),{x,y:g,xAlign:v,yAlign:m}};const i=h.computed(()=>{switch(n.granularity.value){case"minutely":return"minute";case"hourly":return"hour";case"daily":return"day";default:return"day"}}),a=h.computed(()=>d_(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),s=h.computed(()=>["daily","weekly"].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.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:i.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:{...r,external:l=>{Ns(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function c1(n){const{isMultiMetric:t,hasDimensions:e,metricNames:r,barSegmentLabels:i,pivotRecords:a,rowLabels:s,colorPalette:o}=n,{i18n:l}=St.useI18n();return t?r.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:cr(r.indexOf(u),Qe),data:s.map((d,f)=>e?a[`${d.id},${u}`]||0:a[`${f},${u}`]||null)})):Array.from(i).flatMap((u,d)=>{if(!u)return[];const f={},p=Array.isArray(o)?cr(d,o):o[u.name]||cr(d);return f[u.name]=p,{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:p,data:s.map(y=>a[`${y.id},${u.id}`]||null)}})}function u1(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const i=t.value.data,{display:a,metric_names:s}=t.value.meta,o=a&&Object.keys(a),l=s&&s.length>1,c=a&&o&&o.length>0;if(!i.length||!s)return{datasets:[],labels:[]};const u=c&&o||s,d=u[0],f=u.length>1?u[1]:u[0],p=Object.fromEntries(l?i.flatMap(S=>s.map((C,M)=>{const D=S.event[d],O=c?`${D},${C}`:`${M},${C}`,P=S.event[C];return[O,P]})):i.map(S=>{const C=c?`${S.event[d]},${S.event[f]}`:`${d},${f}`,M=S.event[s[0]];return[C,M]})),y=Object.entries(p).sort(([,S],[,C])=>Number(C)-Number(S)).map(([S])=>S.split(",")[0]),x=a[d],g=a[f],m=c&&x&&Object.entries(x).map(([S,C])=>({id:S,name:C.name}))||s.map(S=>({id:S,name:S})),v=c&&g&&Object.entries(g).map(([S,C])=>({id:S,name:C.name}))||s.map(S=>({id:S,name:S}));if(d!=="status_code"&&d!=="status_code_grouped"&&(m.sort((S,C)=>y.indexOf(S.id)-y.indexOf(C.id)),v.sort((S,C)=>y.indexOf(S.id)-y.indexOf(C.id))),!m||!v)return{labels:[],datasets:[]};const b=c1({isMultiMetric:l,hasDimensions:c,metricNames:s,dimensionFieldNames:u,barSegmentLabels:v,pivotRecords:p,rowLabels:m,colorPalette:n.colorPalette||Qe});return{labels:c?m.map(S=>e&&e.te(`chartLabels.${S.name}`)&&e.t(`chartLabels.${S.name}`)||S.name):s.map(S=>e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S),datasets:b}}}catch(i){return console.error(i),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const d1=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((r,i)=>r+i*e),f1=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return Qd(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},h1=(n,t,e,r,i)=>{const s=Math.max(t-6e4,Math.max(...(i||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-r)/e)*e+r,l=Math.floor((s-r)/e)*e+r+e;return d1(o,l,e)};function p1(n,t){const{i18n:e}=St.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const i=t.value.data,{display:a,metric_names:s,start_ms:o,end_ms:l}=t.value.meta;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[u],f=a&&d&&Object.keys(d).map(T=>({id:T,name:d[T].name}))||s.map(T=>({id:T,name:T})),p=t.value.meta.granularity_ms;if(typeof p!="number"||isNaN(p)||!isFinite(p)||p===0)return console.error("Invalid step value:",p),{datasets:[],labels:[]};if(!i.length)return{datasets:[],labels:[]};const y=f1(o),x=h1(o,l,p,y,i),g=new Set,m=i!=null&&i.length?i.reduce((T,S)=>{const C=new Date(S.timestamp).valueOf(),M=S.event;for(const D of s)g.add(D),C in T||(T[C]={}),D in T[C]||(T[C][D]={});for(const D of s)f.forEach(O=>{M[u]===O.id||D===O.id?(T[C][D]||(T[C][D]={}),T[C][D][O.name]=Math.round(Number(M[D])*1e3)/1e3):c.length||(T[C][D]||(T[C][D]={}),T[C][D][O.name]=Math.round(Number(M[O.id])*1e3)/1e3)});return T},{}):{},v=s.length===1?s.flatMap(T=>f.map(S=>[T,S.name])):f.map(T=>[T.name,T.name]),b={},w=[...v].map(([T,S],C)=>{const M=x.map(E=>E in m&&T in m[E]?{x:E,y:m[E][T][S]||0}:{x:E,y:0});let{colorPalette:D,fill:O}=n;st(D)&&(D=Qe);const P=Array.isArray(D)?cr(C,D):D[S]||cr(C);return b[S]=P,{rawDimension:S,rawMetric:T,label:e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S,borderColor:P,backgroundColor:P,data:M,total:M.reduce((E,{y:F})=>E+Number(F),0),...Xw,fill:O,borderWidth:O?Kw:Gw}});return w.sort((T,S)=>Number(T.total)<Number(S.total)?-1:1),{datasets:w,colorMap:b}}}catch(i){return console.error(i),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const g1=(n,t)=>{h.watch([n,t],(e,r,i)=>{const[a,s]=e;!s||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(s,a),i(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(s)}))},{immediate:!0})};function m1(){const{i18n:n}=St.useI18n();return{translateUnit:(e,r)=>{const i=r===1,a=`chartUnits.${e}`;return e==="usd"?"":n.te(a)?n.t(a,{plural:i?"":"s"}):e}}}const St={useBarChartOptions:e1,useChartJSCommon:r1,useChartLegendValues:a1,useChartSelectedRange:s1,useExploreResultToDatasets:u1,useExploreResultToTimeDataset:p1,useDoughnutChartOptions:o1,useLinechartOptions:l1,useI18n:Mp,useReportChartDataForSynthetics:g1,useTranslatedUnits:m1};/*!
18
+ `):n}function zm(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:o,value:a}=r.getLabelAndValue(s);return{chart:n,label:o,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:a,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function yc(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:o,boxHeight:a}=t,l=_t(t.bodyFont),c=_t(t.titleFont),u=_t(t.footerFont),d=r.length,f=s.length,g=i.length,p=Ft(t.padding);let y=p.height,_=0,w=i.reduce((P,M)=>P+M.before.length+M.lines.length+M.after.length,0);if(w+=n.beforeBody.length+n.afterBody.length,d&&(y+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),w){const P=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;y+=g*P+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}f&&(y+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const v=function(P){_=Math.max(_,e.measureText(P).width+S)};return e.save(),e.font=c.string,dt(n.title,v),e.font=l.string,dt(n.beforeBody.concat(n.afterBody),v),S=t.displayColors?o+2+t.boxPadding:0,dt(i,P=>{dt(P.before,v),dt(P.lines,v),dt(P.after,v)}),S=0,e.font=u.string,dt(n.footer,v),e.restore(),_+=p.width,{width:_,height:y}}function Hm(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Wm(n,t,e,i){const{x:s,width:r}=i,o=e.caretSize+e.caretPadding;if(n==="left"&&s+r+o>t.width||n==="right"&&s-r-o<0)return!0}function Ym(n,t,e,i){const{x:s,width:r}=e,{width:o,chartArea:{left:a,right:l}}=n;let c="center";return i==="center"?c=s<=(a+l)/2?"left":"right":s<=r/2?c="left":s>=o-r/2&&(c="right"),Wm(c,n,t,e)&&(c="center"),c}function bc(n,t,e){const i=e.yAlign||t.yAlign||Hm(n,e);return{xAlign:e.xAlign||t.xAlign||Ym(n,t,e,i),yAlign:i}}function Vm(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function jm(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function _c(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:o}=n,{xAlign:a,yAlign:l}=e,c=s+r,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:g}=Ke(o);let p=Vm(t,a);const y=jm(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,f)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:zt(p,0,i.width-t.width),y:zt(y,0,i.height-t.height)}}function ks(n,t,e){const i=Ft(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function xc(n){return De([],Ne(n))}function $m(n,t,e){return Ze(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function wc(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const kc={beforeTitle:Ee,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Ee,beforeBody:Ee,beforeLabel:Ee,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return tt(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Ee,afterBody:Ee,beforeFooter:Ee,footer:Ee,afterFooter:Ee};function te(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?kc[t].call(e,i):s}class Kr extends Vt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new Pr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=$m(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=te(i,"beforeTitle",this,t),r=te(i,"title",this,t),o=te(i,"afterTitle",this,t);let a=[];return a=De(a,Ne(s)),a=De(a,Ne(r)),a=De(a,Ne(o)),a}getBeforeBody(t,e){return xc(te(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return dt(t,r=>{const o={before:[],lines:[],after:[]},a=wc(i,r);De(o.before,Ne(te(a,"beforeLabel",this,r))),De(o.lines,te(a,"label",this,r)),De(o.after,Ne(te(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return xc(te(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=te(i,"beforeFooter",this,t),r=te(i,"footer",this,t),o=te(i,"afterFooter",this,t);let a=[];return a=De(a,Ne(s)),a=De(a,Ne(r)),a=De(a,Ne(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],o=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(zm(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,f)=>t.filter(u,d,f,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),dt(a,u=>{const d=wc(t.callbacks,u);s.push(te(d,"labelColor",this,u)),r.push(te(d,"labelPointStyle",this,u)),o.push(te(d,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=o,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,o=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const a=Mi[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const l=this._size=yc(this,i),c=Object.assign({},a,l),u=bc(this.chart,i,c),d=_c(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:d}=Ke(a),{x:f,y:g}=t,{width:p,height:y}=e;let _,w,S,v,P,M;return r==="center"?(P=g+y/2,s==="left"?(_=f,w=_-o,v=P+o,M=P-o):(_=f+p,w=_+o,v=P-o,M=P+o),S=_):(s==="left"?w=f+Math.max(l,u)+o:s==="right"?w=f+p-Math.max(c,d)-o:w=this.caretX,r==="top"?(v=g,P=v-o,_=w-o,S=w+o):(v=g+y,P=v+o,_=w+o,S=w-o),M=v),{x1:_,x2:w,x3:S,y1:v,y2:P,y3:M}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Fn(i.rtl,this.x,this.width);for(t.x=ks(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",o=_t(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===r&&(t.y+=i.titleMarginBottom-a)}}_drawColorBox(t,e,i,s,r){const o=this.labelColors[i],a=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=_t(r.bodyFont),d=ks(this,"left",r),f=s.x(d),g=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+g;if(r.usePointStyle){const y={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},_=s.leftForLtr(f,c)+c/2,w=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Sr(t,y,_,w),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Sr(t,y,_,w)}else{t.lineWidth=it(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const y=s.leftForLtr(f,c),_=s.leftForLtr(s.xPlus(f,1),c-2),w=Ke(o.borderRadius);Object.values(w).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Ln(t,{x:y,y:p,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Ln(t,{x:_,y:p+1,w:c-2,h:l-2,radius:w}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(y,p,c,l),t.strokeRect(y,p,c,l),t.fillStyle=o.backgroundColor,t.fillRect(_,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:u}=i,d=_t(i.bodyFont);let f=d.lineHeight,g=0;const p=Fn(i.rtl,this.x,this.width),y=function(b){e.fillText(b,p.x(t.x+g),t.y+f/2),t.y+=f+r},_=p.textAlign(o);let w,S,v,P,M,C,T;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=ks(this,_,i),e.fillStyle=i.bodyColor,dt(this.beforeBody,y),g=a&&_!=="right"?o==="center"?c/2+u:c+2+u:0,P=0,C=s.length;P<C;++P){for(w=s[P],S=this.labelTextColors[P],e.fillStyle=S,dt(w.before,y),v=w.lines,a&&v.length&&(this._drawColorBox(e,t,P,p,i),f=Math.max(d.lineHeight,l)),M=0,T=v.length;M<T;++M)y(v[M]),f=d.lineHeight;dt(w.after,y)}g=0,f=d.lineHeight,dt(this.afterBody,y),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let o,a;if(r){const l=Fn(i.rtl,this.x,this.width);for(t.x=ks(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",o=_t(i.footerFont),e.fillStyle=i.footerColor,e.font=o.string,a=0;a<r;++a)e.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:u}=i,{topLeft:d,topRight:f,bottomLeft:g,bottomRight:p}=Ke(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(a+d,l),o==="top"&&this.drawCaret(t,e,i,s),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),o==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(a+c,l+u-p),e.quadraticCurveTo(a+c,l+u,a+c-p,l+u),o==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(a+g,l+u),e.quadraticCurveTo(a,l+u,a,l+u-g),o==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const o=Mi[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=yc(this,t),l=Object.assign({},o,this._size),c=bc(e,t,l),u=_c(t,l,c,e);(s._to!==u.x||r._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.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 s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ft(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),nl(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),il(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),r=!Gi(i,s),o=this._positionChanged(s,e);(r||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],o=this._getActiveElements(t,r,e,i),a=this._positionChanged(o,t),l=e||!Gi(o,r)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,o=Mi[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}O(Kr,"positioners",Mi);var Ss={id:"tooltip",_element:Kr,positioners:Mi,afterInit(n,t,e){e&&(n.tooltip=new Kr({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:kc},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:rm,Decimation:cm,Filler:Om,Legend:Im,SubTitle:Bm,Title:Fm,Tooltip:Ss});const qm=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Xm(n,t,e,i){const s=n.indexOf(t);if(s===-1)return qm(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Gm=(n,t)=>n===null?null:zt(Math.round(n),0,t);function Sc(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Zr extends xn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(tt(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:Xm(i,t,Z(e,t),this._addedLabels),Gm(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let o=t;o<=e;o++)s.push({value:o});return s}getLabelForValue(t){return Sc.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}}O(Zr,"id","category"),O(Zr,"defaults",{ticks:{callback:Sc}});function Km(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:f}=n,g=r||1,p=u-1,{min:y,max:_}=t,w=!tt(o),S=!tt(a),v=!tt(c),P=(_-y)/(d+1);let M=Ta((_-y)/p/g)*g,C,T,b,x;if(M<1e-14&&!w&&!S)return[{value:y},{value:_}];x=Math.ceil(_/M)-Math.floor(y/M),x>p&&(M=Ta(x*M/p/g)*g),tt(l)||(C=Math.pow(10,l),M=Math.ceil(M*C)/C),s==="ticks"?(T=Math.floor(y/M)*M,b=Math.ceil(_/M)*M):(T=y,b=_),w&&S&&r&&Uh((a-o)/r,M/1e3)?(x=Math.round(Math.min((a-o)/M,u)),M=(a-o)/x,T=o,b=a):v?(T=w?o:T,b=S?a:b,x=c-1,M=(b-T)/x):(x=(b-T)/M,oi(x,Math.round(x),M/1e3)?x=Math.round(x):x=Math.ceil(x));const D=Math.max(Oa(M),Oa(T));C=Math.pow(10,tt(l)?D:l),T=Math.round(T*C)/C,b=Math.round(b*C)/C;let E=0;for(w&&(f&&T!==o?(e.push({value:o}),T<o&&E++,oi(Math.round((T+E*M)*C)/C,o,vc(o,P,n))&&E++):T<o&&E++);E<x;++E){const A=Math.round((T+E*M)*C)/C;if(S&&A>a)break;e.push({value:A})}return S&&f&&b!==a?e.length&&oi(e[e.length-1].value,a,vc(a,P,n))?e[e.length-1].value=a:e.push({value:a}):(!S||b===a)&&e.push({value:b}),e}function vc(n,t,{horizontal:e,minRotation:i}){const s=Nt(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class vs extends xn{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 tt(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const o=l=>s=e?s:l,a=l=>r=i?r:l;if(t){const l=Se(s),c=Se(r);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);a(r+l),t||o(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,o=Km(s,r);return t.bounds==="ticks"&&Ca(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ci(t,this.chart.options.locale,this.options.ticks.format)}}class Qr extends vs{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=vt(t)?t:0,this.max=vt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Nt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(Qr,"id","linear"),O(Qr,"defaults",{ticks:{callback:es.formatters.numeric}});const Ti=n=>Math.floor(Xe(n)),wn=(n,t)=>Math.pow(10,Ti(n)+t);function Dc(n){return n/Math.pow(10,Ti(n))===1}function Mc(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Zm(n,t){const e=t-n;let i=Ti(e);for(;Mc(n,t,i)>10;)i++;for(;Mc(n,t,i)<10;)i--;return Math.min(i,Ti(n))}function Qm(n,{min:t,max:e}){t=le(n.min,t);const i=[],s=Ti(t);let r=Zm(t,e),o=r<0?Math.pow(10,Math.abs(r)):1;const a=Math.pow(10,r),l=s>r?Math.pow(10,s):0,c=Math.round((t-l)*o)/o,u=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-u)/Math.pow(10,r)),f=le(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;f<e;)i.push({value:f,major:Dc(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),f=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=le(n.max,f);return i.push({value:g,major:Dc(g),significand:d}),i}class Jr extends xn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=vs.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return vt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=vt(t)?Math.max(0,t):null,this.max=vt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!vt(this._userMin)&&(this.min=t===wn(this.min,0)?wn(this.min,-1):wn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=a=>i=t?i:a,o=a=>s=e?s:a;i===s&&(i<=0?(r(1),o(10)):(r(wn(i,-1)),o(wn(s,1)))),i<=0&&r(wn(s,-1)),s<=0&&o(wn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Qm(e,this);return t.bounds==="ticks"&&Ca(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":ci(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)}}O(Jr,"id","logarithmic"),O(Jr,"defaults",{ticks:{callback:es.formatters.logarithmic,major:{enabled:!0}}});function to(n){const t=n.ticks;if(t.display&&n.display){const e=Ft(t.backdropPadding);return Z(t.font&&t.font.size,Tt.font.size)+e.height}return 0}function Jm(n,t,e){return e=ot(e)?e:[e],{w:uf(n,t.string,e),h:e.length*t.lineHeight}}function Tc(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function ty(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,o=n.options.pointLabels,a=o.centerPointLabels?rt/r:0;for(let l=0;l<r;l++){const c=o.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],a),d=_t(c.font),f=Jm(n.ctx,d,n._pointLabels[l]);i[l]=f;const g=ce(n.getIndexAngle(l)+a),p=Math.round(Ji(g)),y=Tc(p,u.x,f.w,0,180),_=Tc(p,u.y,f.h,90,270);ey(e,t,g,y,_)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=sy(n,i,s)}function ey(n,t,e,i,s){const r=Math.abs(Math.sin(e)),o=Math.abs(Math.cos(e));let a=0,l=0;i.start<t.l?(a=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-a)):i.end>t.r&&(a=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/o,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/o,n.b=Math.max(n.b,t.b+l))}function ny(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:o,size:a}=e,l=n.getPointPosition(t,i+s+o,r),c=Math.round(Ji(ce(l.angle+bt))),u=ay(l.y,a.h,c),d=ry(c),f=oy(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:f,top:u,right:f+a.w,bottom:u+a.h}}function iy(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Le({x:e,y:i},t)||Le({x:e,y:r},t)||Le({x:s,y:i},t)||Le({x:s,y:r},t))}function sy(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:to(r)/2,additionalAngle:o?rt/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const d=ny(n,u,l);i.push(d),a==="auto"&&(d.visible=iy(d,c),d.visible&&(c=d))}return i}function ry(n){return n===0||n===180?"center":n<180?"left":"right"}function oy(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function ay(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function ly(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!tt(a)){const l=Ke(t.borderRadius),c=Ft(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,f=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Ln(n,{x:u,y:d,w:f,h:g,radius:l}),n.fill()):n.fillRect(u,d,f,g)}}function cy(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const o=i.setContext(n.getPointLabelContext(s));ly(e,o,r);const a=_t(o.font),{x:l,y:c,textAlign:u}=r;mn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function Cc(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,mt);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let o=1;o<i;o++)r=n.getPointPosition(o,t),s.lineTo(r.x,r.y)}}function uy(n,t,e,i,s){const r=n.ctx,o=t.circular,{color:a,lineWidth:l}=t;!o&&!i||!a||!l||e<0||(r.save(),r.strokeStyle=a,r.lineWidth=l,r.setLineDash(s.dash),r.lineDashOffset=s.dashOffset,r.beginPath(),Cc(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function dy(n,t,e){return Ze(n,{label:e,index:t,type:"pointLabel"})}class Ci extends vs{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=Ft(to(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=vt(t)&&!isNaN(t)?t:0,this.max=vt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/to(this.options))}generateTickLabels(t){vs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=ut(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?ty(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=mt/(this._pointLabels.length||1),i=this.options.startAngle||0;return ce(t*e+Nt(i))}getDistanceFromCenterForValue(t){if(tt(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(tt(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 dy(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-bt+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Cc(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,o=this._pointLabels.length;let a,l,c;if(e.pointLabels.display&&cy(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(d),g=s.setContext(f),p=r.setContext(f);uy(this,g,l,o,p)}}),i.display){for(t.save(),a=o-1;a>=0;a--){const u=i.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=u;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=_t(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,o=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=Ft(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}mn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}O(Ci,"id","radialLinear"),O(Ci,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:es.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(Ci,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(Ci,"descriptors",{angleLines:{_fallback:"grid"}});const Ds={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}},ee=Object.keys(Ds);function Oc(n,t){return n-t}function Pc(n,t){if(tt(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let o=t;return typeof i=="function"&&(o=i(o)),vt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(Ge(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function Ec(n,t,e,i){const s=ee.length;for(let r=ee.indexOf(n);r<s-1;++r){const o=Ds[ee[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ee[r]}return ee[s-1]}function hy(n,t,e,i,s){for(let r=ee.length-1;r>=ee.indexOf(e);r--){const o=ee[r];if(Ds[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ee[e?ee.indexOf(e):0]}function fy(n){for(let t=ee.indexOf(n)+1,e=ee.length;t<e;++t)if(Ds[ee[t]].common)return ee[t]}function Rc(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=yr(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function gy(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),o=t[t.length-1].value;let a,l;for(a=r;a<=o;a=+s.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function Ac(n,t,e){const i=[],s={},r=t.length;let o,a;for(o=0;o<r;++o)a=t[o],s[a]=o,i.push({value:a,major:!1});return r===0||!e?i:gy(n,i,s,e)}class Oi extends xn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new kl._date(t.adapters.date);s.init(e),ri(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null: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:s,max:r,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=vt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=vt(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,o=this.max,a=Kh(s,r,o);return this._unit=e.unit||(i.autoSkip?Ec(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):hy(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:fy(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),Ac(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;e=zt(e,0,o),i=zt(i,0,o),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,o=r.unit||Ec(r.minUnit,e,i,this._getLabelCapacity(e)),a=Z(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Ge(l)||l===!0,u={};let d=e,f,g;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":o),t.diff(i,e,o)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=d,g=0;f<i;f=+t.add(f,a,o),g++)Rc(u,f,p);return(f===i||s.bounds==="ticks"||g===1)&&Rc(u,f,p),Object.keys(u).sort(Oc).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 s=this.options.time.displayFormats,r=this._unit,o=e||s[r];return this._adapter.format(t,o)}_tickFormatFunction(t,e,i,s){const r=this.options,o=r.ticks.callback;if(o)return ut(o,[t,e,i],this);const a=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&a[l],d=c&&a[c],f=i[e],g=c&&d&&f&&f.major;return this._adapter.format(t,s||(g?d:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Nt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:i*r+a*o,h:i*o+a*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Ac(this,[t],this._majorUnit),s),o=this._getLabelSize(r),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Pc(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Aa(t.sort(Oc))}}O(Oi,"id","time"),O(Oi,"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 Ms(n,t,e){let i=0,s=n.length-1,r,o,a,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=Ae(n,"pos",t)),{pos:r,time:a}=n[i],{pos:o,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=Ae(n,"time",t)),{time:r,pos:a}=n[i],{time:o,pos:l}=n[s]);const c=o-r;return c?a+(l-a)*(t-r)/c:a}class eo extends Oi{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=Ms(e,this.min),this._tableRange=Ms(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let o,a,l,c,u;for(o=0,a=t.length;o<a;++o)c=t[o],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o<a;++o)u=s[o+1],l=s[o-1],c=s[o],Math.round((u+l)/2)!==c&&r.push({time:c,pos:o/(a-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_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(Ms(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ms(this._table,i*this._tableRange+this._minPos,!0)}}O(eo,"id","timeseries"),O(eo,"defaults",Oi.defaults);var py=Object.freeze({__proto__:null,CategoryScale:Zr,LinearScale:Qr,LogarithmicScale:Jr,RadialLinearScale:Ci,TimeScale:Oi,TimeSeriesScale:eo});const my=[Dg,Jp,Um,py],yy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],by=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],_y=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],xy=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Lc=(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 no(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?xy:_y:t.binary?by:yy,i=t.space?" ":"";if(t.signed&&n===0)return` 0${i}${e[0]}`;const s=n<0,r=s?"-":t.signed?"+":"";s&&(n=-n);let o;if(t.minimumFractionDigits!==void 0&&(o={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),n<1){const u=Lc(n,t.locale,o);return r+u+i+e[0]}const a=Math.min(Math.floor(t.binary?Math.log(n)/Math.log(1024):Math.log10(n)/3),e.length-1);n/=(t.binary?1024:1e3)**a,o||(n=n.toPrecision(3));const l=Lc(Number(n),t.locale,o),c=e[a];return r+l+i+c}function G(n){const t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function xt(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function Ts(n,t){const e=G(n);return isNaN(t)?xt(n,NaN):(t&&e.setDate(e.getDate()+t),e)}function io(n,t){const e=G(n);if(isNaN(t))return xt(n,NaN);if(!t)return e;const i=e.getDate(),s=xt(n,e.getTime());s.setMonth(e.getMonth()+t+1,0);const r=s.getDate();return i>=r?s:(e.setFullYear(s.getFullYear(),s.getMonth(),i),e)}function Cs(n,t){const e=+G(n);return xt(n,e+t)}const Ic=6048e5,wy=864e5,Pi=6e4,zn=36e5,ky=1e3;function Sy(n,t){return Cs(n,t*zn)}let vy={};function kn(){return vy}function Me(n,t){var a,l,c,u;const e=kn(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=G(n),r=s.getDay(),o=(r<i?7:0)+r-i;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Hn(n){return Me(n,{weekStartsOn:1})}function Nc(n){const t=G(n),e=t.getFullYear(),i=xt(n,0);i.setFullYear(e+1,0,4),i.setHours(0,0,0,0);const s=Hn(i),r=xt(n,0);r.setFullYear(e,0,4),r.setHours(0,0,0,0);const o=Hn(r);return t.getTime()>=s.getTime()?e+1:t.getTime()>=o.getTime()?e:e-1}function so(n){const t=G(n);return t.setHours(0,0,0,0),t}function Os(n){const t=G(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Fc(n,t){const e=so(n),i=so(t),s=+e-Os(e),r=+i-Os(i);return Math.round((s-r)/wy)}function Dy(n){const t=Nc(n),e=xt(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Hn(e)}function My(n,t){return Cs(n,t*Pi)}function Ty(n,t){const e=t*3;return io(n,e)}function Cy(n,t){return Cs(n,t*1e3)}function Oy(n,t){const e=t*7;return Ts(n,e)}function Py(n,t){return io(n,t*12)}function Ei(n,t){const e=G(n),i=G(t),s=e.getTime()-i.getTime();return s<0?-1:s>0?1:s}function Ey(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ro(n){if(!Ey(n)&&typeof n!="number")return!1;const t=G(n);return!isNaN(Number(t))}function Ry(n,t){const e=G(n),i=G(t),s=e.getFullYear()-i.getFullYear(),r=e.getMonth()-i.getMonth();return s*12+r}function Ay(n,t){const e=G(n),i=G(t);return e.getFullYear()-i.getFullYear()}function Bc(n,t){const e=G(n),i=G(t),s=zc(e,i),r=Math.abs(Fc(e,i));e.setDate(e.getDate()-s*r);const o=+(zc(e,i)===-s),a=s*(r-o);return a===0?0:a}function zc(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Ri(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function Ps(n,t){return+G(n)-+G(t)}function Ly(n,t,e){const i=Ps(n,t)/zn;return Ri(e==null?void 0:e.roundingMethod)(i)}function Iy(n,t,e){const i=Ps(n,t)/Pi;return Ri(e==null?void 0:e.roundingMethod)(i)}function Hc(n){const t=G(n);return t.setHours(23,59,59,999),t}function Wc(n){const t=G(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function Ny(n){const t=G(n);return+Hc(t)==+Wc(t)}function Yc(n,t){const e=G(n),i=G(t),s=Ei(e,i),r=Math.abs(Ry(e,i));let o;if(r<1)o=0;else{e.getMonth()===1&&e.getDate()>27&&e.setDate(30),e.setMonth(e.getMonth()-s*r);let a=Ei(e,i)===-s;Ny(G(n))&&r===1&&Ei(n,i)===1&&(a=!1),o=s*(r-Number(a))}return o===0?0:o}function Fy(n,t,e){const i=Yc(n,t)/3;return Ri(e==null?void 0:e.roundingMethod)(i)}function By(n,t,e){const i=Ps(n,t)/1e3;return Ri(e==null?void 0:e.roundingMethod)(i)}function zy(n,t,e){const i=Bc(n,t)/7;return Ri(e==null?void 0:e.roundingMethod)(i)}function Hy(n,t){const e=G(n),i=G(t),s=Ei(e,i),r=Math.abs(Ay(e,i));e.setFullYear(1584),i.setFullYear(1584);const o=Ei(e,i)===-s,a=s*(r-+o);return a===0?0:a}function Wy(n){const t=G(n);return t.setSeconds(0,0),t}function Yy(n){const t=G(n),e=t.getMonth(),i=e-e%3;return t.setMonth(i,1),t.setHours(0,0,0,0),t}function Vy(n){const t=G(n);return t.setDate(1),t.setHours(0,0,0,0),t}function jy(n){const t=G(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function Vc(n){const t=G(n),e=xt(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function $y(n){const t=G(n);return t.setMinutes(59,59,999),t}function Uy(n,t){var a,l,c,u;const e=kn(),i=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=G(n),r=s.getDay(),o=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+o),s.setHours(23,59,59,999),s}function qy(n){const t=G(n);return t.setSeconds(59,999),t}function Xy(n){const t=G(n),e=t.getMonth(),i=e-e%3+3;return t.setMonth(i,0),t.setHours(23,59,59,999),t}function Gy(n){const t=G(n);return t.setMilliseconds(999),t}const Ky={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"}},Zy=(n,t,e)=>{let i;const s=Ky[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function oo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Qy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},tb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},eb={date:oo({formats:Qy,defaultWidth:"full"}),time:oo({formats:Jy,defaultWidth:"full"}),dateTime:oo({formats:tb,defaultWidth:"full"})},nb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ib=(n,t,e,i)=>nb[n];function Ai(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const o=n.defaultFormattingWidth||n.defaultWidth,a=e!=null&&e.width?String(e.width):o;s=n.formattingValues[a]||n.formattingValues[o]}else{const o=n.defaultWidth,a=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[a]||n.values[o]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const sb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ob={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"]},ab={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"]},lb={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"}},cb={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"}},ub={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Ai({values:sb,defaultWidth:"wide"}),quarter:Ai({values:rb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ai({values:ob,defaultWidth:"wide"}),day:Ai({values:ab,defaultWidth:"wide"}),dayPeriod:Ai({values:lb,defaultWidth:"wide",formattingValues:cb,defaultFormattingWidth:"wide"})};function Li(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const o=r[0],a=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(a)?hb(a,d=>d.test(o)):db(a,d=>d.test(o));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(o.length);return{value:c,rest:u}}}function db(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function hb(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function fb(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let o=n.valueCallback?n.valueCallback(r[0]):r[0];o=e.valueCallback?e.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const gb=/^(\d+)(th|st|nd|rd)?/i,pb=/\d+/i,mb={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},yb={any:[/^b/i,/^(a|c)/i]},bb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_b={any:[/1/i,/2/i,/3/i,/4/i]},xb={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},wb={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]},kb={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},Sb={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]},vb={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},Db={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}},Mb={ordinalNumber:fb({matchPattern:gb,parsePattern:pb,valueCallback:n=>parseInt(n,10)}),era:Li({matchPatterns:mb,defaultMatchWidth:"wide",parsePatterns:yb,defaultParseWidth:"any"}),quarter:Li({matchPatterns:bb,defaultMatchWidth:"wide",parsePatterns:_b,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Li({matchPatterns:xb,defaultMatchWidth:"wide",parsePatterns:wb,defaultParseWidth:"any"}),day:Li({matchPatterns:kb,defaultMatchWidth:"wide",parsePatterns:Sb,defaultParseWidth:"any"}),dayPeriod:Li({matchPatterns:vb,defaultMatchWidth:"any",parsePatterns:Db,defaultParseWidth:"any"})},jc={code:"en-US",formatDistance:Zy,formatLong:eb,formatRelative:ib,localize:ub,match:Mb,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Tb(n){const t=G(n);return Fc(t,Vc(t))+1}function $c(n){const t=G(n),e=+Hn(t)-+Dy(t);return Math.round(e/Ic)+1}function ao(n,t){var u,d,f,g;const e=G(n),i=e.getFullYear(),s=kn(),r=(t==null?void 0:t.firstWeekContainsDate)??((d=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??s.firstWeekContainsDate??((g=(f=s.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=xt(n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Me(o,t),l=xt(n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Me(l,t);return e.getTime()>=a.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function Cb(n,t){var a,l,c,u;const e=kn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=ao(n,t),r=xt(n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Me(r,t)}function Uc(n,t){const e=G(n),i=+Me(e,t)-+Cb(e,t);return Math.round(i/Ic)+1}function ht(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const nn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return ht(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):ht(e+1,2)},d(n,t){return ht(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return ht(n.getHours()%12||12,t.length)},H(n,t){return ht(n.getHours(),t.length)},m(n,t){return ht(n.getMinutes(),t.length)},s(n,t){return ht(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return ht(s,t.length)}},Wn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qc={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return nn.y(n,t)},Y:function(n,t,e,i){const s=ao(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return ht(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):ht(r,t.length)},R:function(n,t){const e=Nc(n);return ht(e,t.length)},u:function(n,t){const e=n.getFullYear();return ht(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ht(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ht(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return nn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return ht(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Uc(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):ht(s,t.length)},I:function(n,t,e){const i=$c(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ht(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):nn.d(n,t)},D:function(n,t,e){const i=Tb(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ht(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return ht(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return ht(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ht(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Wn.noon:i===0?s=Wn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Wn.evening:i>=12?s=Wn.afternoon:i>=4?s=Wn.morning:s=Wn.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return nn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):nn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):nn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):nn.s(n,t)},S:function(n,t){return nn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Gc(i);case"XXXX":case"XX":return Sn(i);case"XXXXX":case"XXX":default:return Sn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Gc(i);case"xxxx":case"xx":return Sn(i);case"xxxxx":case"xxx":default:return Sn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Xc(i,":");case"OOOO":default:return"GMT"+Sn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Xc(i,":");case"zzzz":default:return"GMT"+Sn(i,":")}},t:function(n,t,e){const i=Math.trunc(n.getTime()/1e3);return ht(i,t.length)},T:function(n,t,e){const i=n.getTime();return ht(i,t.length)}};function Xc(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+ht(r,2)}function Gc(n,t){return n%60===0?(n>0?"-":"+")+ht(Math.abs(n)/60,2):Sn(n,t)}function Sn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=ht(Math.trunc(i/60),2),r=ht(i%60,2);return e+s+t+r}const Kc=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Zc=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},lo={p:Zc,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Kc(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Kc(i,t)).replace("{{time}}",Zc(s,t))}},Ob=/^D+$/,Pb=/^Y+$/,Eb=["D","DD","YY","YYYY"];function Qc(n){return Ob.test(n)}function Jc(n){return Pb.test(n)}function co(n,t,e){const i=Rb(n,t,e);if(console.warn(i),Eb.includes(n))throw new RangeError(i)}function Rb(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Ab=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Lb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ib=/^'([^]*?)'?$/,Nb=/''/g,Fb=/[a-zA-Z]/;function tu(n,t,e){var u,d,f,g,p,y,_,w;const i=kn(),s=(e==null?void 0:e.locale)??i.locale??jc,r=(e==null?void 0:e.firstWeekContainsDate)??((d=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??i.firstWeekContainsDate??((g=(f=i.locale)==null?void 0:f.options)==null?void 0:g.firstWeekContainsDate)??1,o=(e==null?void 0:e.weekStartsOn)??((y=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:y.weekStartsOn)??i.weekStartsOn??((w=(_=i.locale)==null?void 0:_.options)==null?void 0:w.weekStartsOn)??0,a=G(n);if(!ro(a))throw new RangeError("Invalid time value");let l=t.match(Lb).map(S=>{const v=S[0];if(v==="p"||v==="P"){const P=lo[v];return P(S,s.formatLong)}return S}).join("").match(Ab).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const v=S[0];if(v==="'")return{isToken:!1,value:Bb(S)};if(qc[v])return{isToken:!0,value:S};if(v.match(Fb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const v=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Jc(v)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Qc(v))&&co(v,t,String(n));const P=qc[v[0]];return P(a,v,s.localize,c)}).join("")}function Bb(n){const t=n.match(Ib);return t?t[1].replace(Nb,"'"):n}function zb(){return Object.assign({},kn())}function Hb(n){let e=G(n).getDay();return e===0&&(e=7),e}function Wb(n,t){const e=t instanceof Date?xt(t,0):new t(0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}const Yb=10;class eu{constructor(){O(this,"subPriority",0)}validate(t,e){return!0}}class Vb extends eu{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class jb extends eu{constructor(){super(...arguments);O(this,"priority",Yb);O(this,"subPriority",-1)}set(e,i){return i.timestampIsSet?e:xt(e,Wb(e,Date))}}class at{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new Vb(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class $b extends at{constructor(){super(...arguments);O(this,"priority",140);O(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Lt={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}/},Te={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 It(n,t){return n&&{value:t(n.value),rest:n.rest}}function Ct(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ce(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,o=e[5]?parseInt(e[5],10):0;return{value:i*(s*zn+r*Pi+o*ky),rest:t.slice(e[0].length)}}function nu(n){return Ct(Lt.anyDigitsSigned,n)}function Rt(n,t){switch(n){case 1:return Ct(Lt.singleDigit,t);case 2:return Ct(Lt.twoDigits,t);case 3:return Ct(Lt.threeDigits,t);case 4:return Ct(Lt.fourDigits,t);default:return Ct(new RegExp("^\\d{1,"+n+"}"),t)}}function Es(n,t){switch(n){case 1:return Ct(Lt.singleDigitSigned,t);case 2:return Ct(Lt.twoDigitsSigned,t);case 3:return Ct(Lt.threeDigitsSigned,t);case 4:return Ct(Lt.fourDigitsSigned,t);default:return Ct(new RegExp("^-?\\d{1,"+n+"}"),t)}}function uo(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 iu(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,o=Math.trunc(r/100)*100,a=n>=r%100;s=n+o-(a?100:0)}return e?s:1-s}function su(n){return n%400===0||n%4===0&&n%100!==0}class Ub extends at{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="yy"});switch(i){case"y":return It(Rt(4,e),r);case"yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Rt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const a=iu(s.year,r);return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}}class qb extends at{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=o=>({year:o,isTwoDigitYear:i==="YY"});switch(i){case"Y":return It(Rt(4,e),r);case"Yo":return It(s.ordinalNumber(e,{unit:"year"}),r);default:return It(Rt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=ao(e,r);if(s.isTwoDigitYear){const l=iu(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Me(e,r)}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Me(e,r)}}class Xb extends at{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Es(i==="R"?4:i.length,e)}set(e,i,s){const r=xt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Hn(r)}}class Gb extends at{constructor(){super(...arguments);O(this,"priority",130);O(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Es(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Kb extends at{constructor(){super(...arguments);O(this,"priority",120);O(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Rt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class Zb extends at{constructor(){super(...arguments);O(this,"priority",120);O(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Rt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class Qb extends at{constructor(){super(...arguments);O(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);O(this,"priority",110)}parse(e,i,s){const r=o=>o-1;switch(i){case"M":return It(Ct(Lt.month,e),r);case"MM":return It(Rt(2,e),r);case"Mo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class Jb extends at{constructor(){super(...arguments);O(this,"priority",110);O(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=o=>o-1;switch(i){case"L":return It(Ct(Lt.month,e),r);case"LL":return It(Rt(2,e),r);case"Lo":return It(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function t0(n,t,e){const i=G(n),s=Uc(i,e)-t;return i.setDate(i.getDate()-s*7),i}class e0 extends at{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return Ct(Lt.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Rt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Me(t0(e,s,r),r)}}function n0(n,t){const e=G(n),i=$c(e)-t;return e.setDate(e.getDate()-i*7),e}class i0 extends at{constructor(){super(...arguments);O(this,"priority",100);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return Ct(Lt.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Rt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return Hn(n0(e,s))}}const s0=[31,28,31,30,31,30,31,31,30,31,30,31],r0=[31,29,31,30,31,30,31,31,30,31,30,31];class o0 extends at{constructor(){super(...arguments);O(this,"priority",90);O(this,"subPriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return Ct(Lt.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Rt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=su(s),o=e.getMonth();return r?i>=1&&i<=r0[o]:i>=1&&i<=s0[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class a0 extends at{constructor(){super(...arguments);O(this,"priority",90);O(this,"subpriority",1);O(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return Ct(Lt.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Rt(i.length,e)}}validate(e,i){const s=e.getFullYear();return su(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function ho(n,t,e){var d,f,g,p;const i=kn(),s=(e==null?void 0:e.weekStartsOn)??((f=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(g=i.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??0,r=G(n),o=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(o+c)%7:(l+c)%7-(o+c)%7;return Ts(r,u)}class l0 extends at{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=ho(e,s,r),e.setHours(0,0,0,0),e}}class c0 extends at{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return It(Rt(i.length,e),o);case"eo":return It(s.ordinalNumber(e,{unit:"day"}),o);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=ho(e,s,r),e.setHours(0,0,0,0),e}}class u0 extends at{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const o=a=>{const l=Math.floor((a-1)/7)*7;return(a+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return It(Rt(i.length,e),o);case"co":return It(s.ordinalNumber(e,{unit:"day"}),o);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=ho(e,s,r),e.setHours(0,0,0,0),e}}function d0(n,t){const e=G(n),i=Hb(e),s=t-i;return Ts(e,s)}class h0 extends at{constructor(){super(...arguments);O(this,"priority",90);O(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=o=>o===0?7:o;switch(i){case"i":case"ii":return Rt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return It(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return It(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return It(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return It(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=d0(e,s),e.setHours(0,0,0,0),e}}class f0 extends at{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(uo(s),0,0,0),e}}class g0 extends at{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(uo(s),0,0,0),e}}class p0 extends at{constructor(){super(...arguments);O(this,"priority",80);O(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(uo(s),0,0,0),e}}class m0 extends at{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return Ct(Lt.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Rt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class y0 extends at{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return Ct(Lt.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Rt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class b0 extends at{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return Ct(Lt.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Rt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class _0 extends at{constructor(){super(...arguments);O(this,"priority",70);O(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return Ct(Lt.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Rt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class x0 extends at{constructor(){super(...arguments);O(this,"priority",60);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Ct(Lt.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Rt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class w0 extends at{constructor(){super(...arguments);O(this,"priority",50);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Ct(Lt.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Rt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class k0 extends at{constructor(){super(...arguments);O(this,"priority",30);O(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return It(Rt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class S0 extends at{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ce(Te.basicOptionalMinutes,e);case"XX":return Ce(Te.basic,e);case"XXXX":return Ce(Te.basicOptionalSeconds,e);case"XXXXX":return Ce(Te.extendedOptionalSeconds,e);case"XXX":default:return Ce(Te.extended,e)}}set(e,i,s){return i.timestampIsSet?e:xt(e,e.getTime()-Os(e)-s)}}class v0 extends at{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ce(Te.basicOptionalMinutes,e);case"xx":return Ce(Te.basic,e);case"xxxx":return Ce(Te.basicOptionalSeconds,e);case"xxxxx":return Ce(Te.extendedOptionalSeconds,e);case"xxx":default:return Ce(Te.extended,e)}}set(e,i,s){return i.timestampIsSet?e:xt(e,e.getTime()-Os(e)-s)}}class D0 extends at{constructor(){super(...arguments);O(this,"priority",40);O(this,"incompatibleTokens","*")}parse(e){return nu(e)}set(e,i,s){return[xt(e,s*1e3),{timestampIsSet:!0}]}}class M0 extends at{constructor(){super(...arguments);O(this,"priority",20);O(this,"incompatibleTokens","*")}parse(e){return nu(e)}set(e,i,s){return[xt(e,s),{timestampIsSet:!0}]}}const T0={G:new $b,y:new Ub,Y:new qb,R:new Xb,u:new Gb,Q:new Kb,q:new Zb,M:new Qb,L:new Jb,w:new e0,I:new i0,d:new o0,D:new a0,E:new l0,e:new c0,c:new u0,i:new h0,a:new f0,b:new g0,B:new p0,h:new m0,H:new y0,K:new b0,k:new _0,m:new x0,s:new w0,S:new k0,X:new S0,x:new v0,t:new D0,T:new M0},C0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,O0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,P0=/^'([^]*?)'?$/,E0=/''/g,R0=/\S/,A0=/[a-zA-Z]/;function L0(n,t,e,i){var y,_,w,S,v,P,M,C;const s=zb(),r=(i==null?void 0:i.locale)??s.locale??jc,o=(i==null?void 0:i.firstWeekContainsDate)??((_=(y=i==null?void 0:i.locale)==null?void 0:y.options)==null?void 0:_.firstWeekContainsDate)??s.firstWeekContainsDate??((S=(w=s.locale)==null?void 0:w.options)==null?void 0:S.firstWeekContainsDate)??1,a=(i==null?void 0:i.weekStartsOn)??((P=(v=i==null?void 0:i.locale)==null?void 0:v.options)==null?void 0:P.weekStartsOn)??s.weekStartsOn??((C=(M=s.locale)==null?void 0:M.options)==null?void 0:C.weekStartsOn)??0;if(t==="")return n===""?G(e):xt(e,NaN);const l={firstWeekContainsDate:o,weekStartsOn:a,locale:r},c=[new jb],u=t.match(O0).map(T=>{const b=T[0];if(b in lo){const x=lo[b];return x(T,r.formatLong)}return T}).join("").match(C0),d=[];for(let T of u){!(i!=null&&i.useAdditionalWeekYearTokens)&&Jc(T)&&co(T,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&Qc(T)&&co(T,t,n);const b=T[0],x=T0[b];if(x){const{incompatibleTokens:D}=x;if(Array.isArray(D)){const A=d.find(F=>D.includes(F.token)||F.token===b);if(A)throw new RangeError(`The format string mustn't contain \`${A.fullToken}\` and \`${T}\` at the same time`)}else if(x.incompatibleTokens==="*"&&d.length>0)throw new RangeError(`The format string mustn't contain \`${T}\` and any other token at the same time`);d.push({token:b,fullToken:T});const E=x.run(n,T,r.match,l);if(!E)return xt(e,NaN);c.push(E.setter),n=E.rest}else{if(b.match(A0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(T==="''"?T="'":b==="'"&&(T=I0(T)),n.indexOf(T)===0)n=n.slice(T.length);else return xt(e,NaN)}}if(n.length>0&&R0.test(n))return xt(e,NaN);const f=c.map(T=>T.priority).sort((T,b)=>b-T).filter((T,b,x)=>x.indexOf(T)===b).map(T=>c.filter(b=>b.priority===T).sort((b,x)=>x.subPriority-b.subPriority)).map(T=>T[0]);let g=G(e);if(isNaN(g.getTime()))return xt(e,NaN);const p={};for(const T of f){if(!T.validate(g,l))return xt(e,NaN);const b=T.set(g,p,l);Array.isArray(b)?(g=b[0],Object.assign(p,b[1])):g=b}return xt(e,g)}function I0(n){return n.match(P0)[1].replace(E0,"'")}function N0(n){const t=G(n);return t.setMinutes(0,0,0),t}function F0(n){const t=G(n);return t.setMilliseconds(0),t}function B0(n){const t=n/zn;return Math.trunc(t)}function ru(n,t){const e=(t==null?void 0:t.additionalDigits)??2,i=Y0(n);let s;if(i.date){const l=V0(i.date,e);s=j0(l.restDateString,l.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const r=s.getTime();let o=0,a;if(i.time&&(o=$0(i.time),isNaN(o)))return new Date(NaN);if(i.timezone){if(a=U0(i.timezone),isNaN(a))return new Date(NaN)}else{const l=new Date(r+o),c=new Date(0);return c.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),c.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),c}return new Date(r+o+a)}const Rs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},z0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,H0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,W0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Y0(n){const t={},e=n.split(Rs.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Rs.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Rs.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Rs.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function V0(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function j0(n,t){if(t===null)return new Date(NaN);const e=n.match(z0);if(!e)return new Date(NaN);const i=!!e[4],s=Ii(e[1]),r=Ii(e[2])-1,o=Ii(e[3]),a=Ii(e[4]),l=Ii(e[5])-1;if(i)return Z0(t,a,l)?q0(t,a,l):new Date(NaN);{const c=new Date(0);return!G0(t,r,o)||!K0(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function Ii(n){return n?parseInt(n):1}function $0(n){const t=n.match(H0);if(!t)return NaN;const e=fo(t[1]),i=fo(t[2]),s=fo(t[3]);return Q0(e,i,s)?e*zn+i*Pi+s*1e3:NaN}function fo(n){return n&&parseFloat(n.replace(",","."))||0}function U0(n){if(n==="Z")return 0;const t=n.match(W0);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return J0(i,s)?e*(i*zn+s*Pi):NaN}function q0(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const X0=[31,null,31,30,31,30,31,31,30,31,30,31];function ou(n){return n%400===0||n%4===0&&n%100!==0}function G0(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(X0[t]||(ou(n)?29:28))}function K0(n,t){return t>=1&&t<=(ou(n)?366:365)}function Z0(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Q0(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function J0(n,t){return t>=0&&t<=59}var jt=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))(jt||{}),As=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(As||{}),Ot=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Ot||{}),Yn=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(Yn||{});const go=(n,t)=>{var s,r;const{tooltip:e}=t;if(e.opacity===0&&!n.locked){n.showTooltip=!1;return}const i=n.chartTooltipSortFn||((o,a)=>a.rawValue-o.rawValue);if(e.body&&!n.locked){const o=e.labelColors,a=((r=(s=t.chart.config)==null?void 0:s.options)==null?void 0:r.indexAxis)==="y"?"x":"y",l=[jt.HORIZONTAL_BAR,jt.VERTICAL_BAR].includes(n.chartType),c=[As.GAUGE,jt.DOUGHNUT].includes(n.chartType);n.tooltipContext=l?e.dataPoints.length>1?e.dataPoints[0].label:"":e.dataPoints[0].parsed.x,n.tooltipSeries=e.dataPoints.map((u,d)=>{const f=c?u.parsed:u.parsed[a];let g;if(n.units==="bytes")g=isNaN(f)?f:no(f);else{const y=n.translateUnit(n.units,f);g=`${n.units==="usd"?"$":""}${f%1===0?Is.format(f):Is.format(Number(f.toFixed(wu)))} ${y}`}const p=l&&u.dataset.label!==u.label?u.dataset.label:c?u.dataset.labels[u.dataIndex]:u.dataset.label;return{backgroundColor:o[d].backgroundColor,borderColor:o[d].borderColor,label:p,value:g,rawValue:f}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},t_=n=>n&&n.datasets&&n.datasets.length,e_=n=>t_(n)&&n.datasets.some(t=>t.data.length),n_=n=>e_(n)&&n.datasets.some(t=>t.data.length>1),i_=n=>n_(n)&&n.datasets.some(t=>t.data[0]&&ro(t.data[0].x)),s_=n=>i_(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),po=(n,t,e)=>{const s=Math.min(t/1150,1);return n.x<e?n.x+t*.15*(1-s):n.x-t*1.15*(1-s)},r_=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function au(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}function lu(n,t,e){const i=l_(n,e.timeZone,e.locale);return"formatToParts"in i?o_(i,t):a_(i,t)}function o_(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function a_(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function l_(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function c_(n,t){const e=f_(t);return"formatToParts"in e?d_(e,n):h_(e,n)}const u_={year:0,month:1,day:2,hour:3,minute:4,second:5};function d_(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=u_[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function h_(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const mo={};function f_(n){if(!mo[n]){const t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",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";mo[n]=e?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"}):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"})}return mo[n]}function cu(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const uu=36e5,g_=6e4,yo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function bo(n,t,e){if(!n)return 0;let i=yo.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=yo.timezoneHH.exec(n),i)return s=parseInt(i[1],10),du(s)?-(s*uu):NaN;if(i=yo.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return du(s,o)?(r=Math.abs(s)*uu+o*g_,i[1]==="+"?-r:r):NaN}if(y_(n)){t=new Date(t||Date.now());const o=e?t:p_(t),a=_o(o,n);return-(e?a:m_(t,a,n))}return NaN}function p_(n){return cu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function _o(n,t){const e=c_(n,t),i=cu(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function m_(n,t,e){let s=n.getTime()-t;const r=_o(new Date(s),e);if(t===r)return t;s-=r-t;const o=_o(new Date(s),e);return r===o?r:Math.max(r,o)}function du(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const hu={};function y_(n){if(hu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),hu[n]=!0,!0}catch{return!1}}const b_=60*1e3,__={X:function(n,t,e){const i=xo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return fu(i);case"XXXX":case"XX":return Vn(i);case"XXXXX":case"XXX":default:return Vn(i,":")}},x:function(n,t,e){const i=xo(e.timeZone,n);switch(t){case"x":return fu(i);case"xxxx":case"xx":return Vn(i);case"xxxxx":case"xxx":default:return Vn(i,":")}},O:function(n,t,e){const i=xo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+x_(i,":");case"OOOO":default:return"GMT"+Vn(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return lu("short",n,e);case"zzzz":default:return lu("long",n,e)}}};function xo(n,t){const e=n?bo(n,t,!0)/b_:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ls(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Vn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ls(Math.floor(i/60),2),r=Ls(Math.floor(i%60),2);return e+s+t+r}function fu(n,t){return n%60===0?(n>0?"-":"+")+Ls(Math.abs(n)/60,2):Vn(n,t)}function x_(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Ls(r,2)}function gu(n){const 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-+t}const w_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,wo=36e5,pu=6e4,k_=2,Xt={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:w_};function mu(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?k_:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==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(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=S_(n),{year:s,restDateString:r}=v_(i.date,e),o=D_(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=M_(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=bo(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=gu(new Date(a+l)),c=gu(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function S_(n){const t={};let e=Xt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Xt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Xt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function v_(n,t){if(n){const e=Xt.YYY[t],i=Xt.YYYYY[t];let s=Xt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Xt.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function D_(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=Xt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,_u(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Xt.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return O_(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=Xt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return _u(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=Xt.Www.exec(n),r)return s=parseInt(r[1],10)-1,xu(s)?yu(t,s):new Date(NaN);if(r=Xt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return xu(s,o)?yu(t,s,o):new Date(NaN)}return null}function M_(n){let t,e,i=Xt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ko(t)?t%24*wo:NaN;if(i=Xt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ko(t,e)?t%24*wo+e*pu:NaN;if(i=Xt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ko(t,e,s)?t%24*wo+e*pu+s*1e3:NaN}return null}function yu(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const T_=[31,28,31,30,31,30,31,31,30,31,30,31],C_=[31,29,31,30,31,30,31,31,30,31,30,31];function bu(n){return n%400===0||n%4===0&&n%100!==0}function _u(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=bu(n);if(i&&e>C_[t]||!i&&e>T_[t])return!1}return!0}function O_(n,t){if(t<1)return!1;const e=bu(n);return!(e&&t>366||!e&&t>365)}function xu(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ko(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const P_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function So(n,t,e={}){t=String(t);const i=t.match(P_);if(i){const s=mu(e.originalDate||n,e);t=i.reduce(function(r,o){if(o[0]==="'")return r;const a=r.indexOf(o),l=r[a-1]==="'",c=r.replace(o,"'"+__[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return tu(n,t,e)}function E_(n,t,e){n=mu(n,e);const i=bo(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function R_(n,t,e,i){return i={...i,timeZone:t,originalDate:n},So(E_(n,t,{timeZone:i.timeZone}),e,i)}const wu=2,ku=10,Su=12,Is=new Intl.NumberFormat(((Jd=document==null?void 0:document.documentElement)==null?void 0:Jd.lang)||"en-US");function Ns(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 s=new Date(n);return R_(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Fs=10,vu={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},Fe=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],jn=(n,t)=>(t||Fe)[n%Fe.length],Du=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),o=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),a=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${o}${a}`},Mu="#6f7787",Tu={100:{background:"#f0f5fd",text:"#10599e"},200:{background:"#e5f7f4",text:"#1b6955"},300:{background:"#fff1d5",text:"#a06027"},400:{background:"#fee3b6",text:"#944d19"},500:{background:"#fedada",text:"#852021"}},A_=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Tu[t])==null?void 0:e.background)||"#fafafa"},L_={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},I_={"4XX":"#FFBA81","5XX":"#FF8484"},N_={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},F_="#dad4c7",B_=n=>{const t=Object.entries(vu).find(([e])=>new RegExp(e).test(n));return t&&t[1]||vu.standard},z_={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},H_=2,W_=0,vo=new Map,Do=(n,t)=>t==="bytes"?no(n):t==="count/minute"?n.toFixed(2):Is.format(n),Cu=n=>{const e=document.createElement("canvas").getContext("2d"),i=_t({});return e.font=i.string,e.measureText(n).width},Y_=()=>{const n="label_height";if(!vo.has(n)){const t=_t({});vo.set(n,t.lineHeight)}return vo.get(n)},V_=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),Ou=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,o)=>isNaN(o)?r:r+o,0):e,0),Pu=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Mo="#e0e4ea",j_={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"]},Ni=(n,t)=>{let e=1;const i=j_[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},Eu=new Map([[100,Ni("100",[100,101,102,103])],[200,Ni("200",[200,201,202,203,204,205,206,207,208,226])],[300,Ni("300",[300,301,302,303,304,305,307,308])],[400,Ni("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,Ni("500",[500,501,502,503,504,505,506,507,508,510,511])]]),To=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=Eu.get(e);return i===void 0?Mo:i.get(t)??i.get(-1)??Mo},$_=n=>{const t=To(n);return{solid:t,light:t}},Bs={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=To(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function U_(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ss.positioners.barChartTooltipPosition=function(s,r){if(!s.length)return!1;const o=this.chart.canvas.getBoundingClientRect(),a=n.tooltipState.width||this.width,l=o.width/2,c=po(r,a,l),u=r.y,d=r.x<l?"left":"center";return{x:c-n.tooltipState.offsetX,y:u-n.tooltipState.offsetY,xAlign:d}},Br.modes.customInteractionMode=function(s,r){const o=Qe(r,s),a=[];return Br.evaluateInteractionItems(s,s.options.indexAxis||"x",o,(l,c,u)=>{s.options.indexAxis==="y"&&l.inYRange(o.y,!0)&&s.data.datasets[c].data[u]&&a.push({element:l,datasetIndex:c,index:u}),s.options.indexAxis==="x"&&l.inXRange(o.x,!0)&&s.data.datasets[c].data[u]&&a.push({element:l,datasetIndex:c,index:u})}),a};const e=n.numLabels.value>25?ku:Su;return h.computed(()=>{var s,r,o,a,l,c,u,d;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:n.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:e,callback:function(f,g){const p=this;if(p.chart.options.indexAxis===p.axis){f=p.getLabelForValue(g);const y=10;return f&&f.length>y?f.slice(0,y)+"...":f}return p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="y"?!tt((s=n.metricAxesTitle)==null?void 0:s.value):!tt((r=n.dimensionAxesTitle)==null?void 0:r.value),text:n.indexAxis==="y"?(o=n.metricAxesTitle)==null?void 0:o.value:(a=n.dimensionAxesTitle)==null?void 0:a.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:n.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:e,callback:function(f,g){const p=this;return p.chart.options.indexAxis===p.axis?(f=p.getLabelForValue(g),f&&f.length>Fs?f.slice(0,Fs)+"...":f):p.getLabelForValue(Number(f))}},title:{display:n.indexAxis==="x"?!tt((l=n.metricAxesTitle)==null?void 0:l.value):!tt((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="x"?(u=n.metricAxesTitle)==null?void 0:u.value:(d=n.dimensionAxesTitle)==null?void 0:d.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:f=>{go(n.tooltipState,f)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}fe.register(...my);const q_=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function X_(n,t,e,i,s){const r=h.shallowRef(null),o=(a,l)=>{if(t.value)return new fe(t.value,{type:n,data:a,plugins:i,options:l})};return h.onMounted(()=>{r.value=o(e.value,s.value)}),h.onBeforeUnmount(()=>{tt(r.value)||r.value.destroy()}),h.watch(e,(a,l)=>{if(q_(l,a)&&!tt(r.value)){for(const[c,u]of a.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=a.labels,r.value.update()}else tt(r.value)||r.value.destroy(),r.value=o(a,s.value)}),h.watch(t,()=>{tt(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),h.watch(s,(a,l)=>{(a.indexAxis!==l.indexAxis||JSON.stringify(a.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(a.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(tt(r.value)||r.value.destroy(),r.value=o(e.value,a))}),r}var ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Co(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ru={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:",",f=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,y){y&&y%3===0&&f.push(d),f.push(p)}),f.reverse().join("")}function e(c,u,d){var f=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](f),c.toString()):(d.precision?c=f:c=f<10?Math[g](f*10)/10:Math[g](f),c=c.toString(),typeof d.decimal=="string"&&(c=c.replace(".",d.decimal)),c)}var i=1e3,s=1e4,r=1e6,o=1e9,a=1e12;function l(c,u){var d;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var g=u.min10k?s:i;return c<g||u.precision&&u.precision>Math.log10(c)?d=t(e(c,1,u),u):c<r?d=e(c,i,u)+"k":c<o?d=e(c,r,u)+"m":c<a?d=t(e(c,o,u),u)+"b":d=t(e(c,a,u),u)+"t",f&&(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})()})(Ru);var G_=Ru.exports;const Fi=Co(G_);function K_(n,t,e){const{i18n:i}=ft.useI18n(),{translateUnit:s}=ft.useTranslatedUnits();return{legendValues:h.computed(()=>n.value.datasets.reduce((o,a)=>{const l=a.total?a.total:a.data.reduce((u,d)=>u+(typeof d=="number"?Number(d)||0:Number(d&&d.y)||0),0);let c;if(e.value==="bytes")c=isNaN(l)?"0":no(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:Fi(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${Fi(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c}}},{}))}}function Z_(n){return h.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start_ms,i=n.value.meta.end_ms;return e&&i?`${Ns(e)} - ${Ns(i,{includeTZ:!0})}`:""})}function Q_(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return Ss.positioners.doughnutChartTooltipPosition=function(i,s){if(!i.length)return!1;const r=this.chart.canvas.getBoundingClientRect(),o=n.tooltipState.width||this.width,a=r.width/2,l=po(s,o,a),c=s.y,u=s.x<a?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:h.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{go(n.tooltipState,i)}}}}))}}function J_(n){const t=h.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:!tt((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}}}}),e=h.computed(()=>{var l,c;return{title:{display:!tt((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0}}),i={enabled:!1,position:"lineChartTooltipPosition"};Ss.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,f=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=po(c,d,g);let _=r_(c,f,p);const w=c.y<p?"top":"bottom",S=c.x<g?"left":"center";return f>u.height&&(_=0),{x:y,y:_,xAlign:S,yAlign:w}};const s=h.computed(()=>{switch(n.granularity.value){case"minutely":return"minute";case"hourly":return"hour";case"daily":return"day";default:return"day"}}),r=h.computed(()=>B0(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),o=h.computed(()=>["daily","weekly"].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:h.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:s.value,displayFormats:{minute:"h:mm:ss a",hour:r.value,day:o.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=>{go(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function tx(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=ft.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:jn(i.indexOf(u),Fe),data:o.map((d,f)=>e?r[`${d.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const f={},g=Array.isArray(a)?jn(d,a):a[u.name]||jn(d);return f[u.name]=g,{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:g,data:o.map(p=>r[`${p.id},${u.id}`]||null)}})}function ex(n,t){const{i18n:e}=ft.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o}=t.value.meta,a=r&&Object.keys(r),l=o&&o.length>1,c=r&&a&&a.length>0;if(!s.length||!o)return{datasets:[],labels:[]};const u=c&&a||o,d=u[0],f=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(C=>o.map((T,b)=>{const x=C.event[d],D=c?`${x},${T}`:`${b},${T}`,E=C.event[T];return[D,E]})):s.map(C=>{const T=c?`${C.event[d]},${C.event[f]}`:`${d},${f}`,b=C.event[o[0]];return[T,b]})),p=Object.entries(g).sort(([,C],[,T])=>Number(T)-Number(C)).map(([C])=>C.split(",")[0]),y=r[d],_=r[f],w=c&&y&&Object.entries(y).map(([C,T])=>({id:C,name:T.name}))||o.map(C=>({id:C,name:C})),S=c&&_&&Object.entries(_).map(([C,T])=>({id:C,name:T.name}))||o.map(C=>({id:C,name:C}));if(d!=="status_code"&&d!=="status_code_grouped"&&(w.sort((C,T)=>p.indexOf(C.id)-p.indexOf(T.id)),S.sort((C,T)=>p.indexOf(C.id)-p.indexOf(T.id))),!w||!S)return{labels:[],datasets:[]};const v=tx({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:u,barSegmentLabels:S,pivotRecords:g,rowLabels:w,colorPalette:n.colorPalette||Fe});return{labels:c?w.map(C=>e&&e.te(`chartLabels.${C.name}`)&&e.t(`chartLabels.${C.name}`)||C.name):o.map(C=>e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C),datasets:v}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const nx=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),ix=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return ru(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},sx=(n,t,e,i,s)=>{const o=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),a=Math.floor((n-i)/e)*e+i,l=Math.floor((o-i)/e)*e+i+e;return nx(a,l,e)};function rx(n,t){const{i18n:e}=ft.useI18n();return h.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:o,start_ms:a,end_ms:l}=t.value.meta;if(!o)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=r&&Object.keys(r)||o,u=c&&c[0],d=r[u],f=r&&d&&Object.keys(d).map(M=>({id:M,name:d[M].name}))||o.map(M=>({id:M,name:M})),g=t.value.meta.granularity_ms;if(typeof g!="number"||isNaN(g)||!isFinite(g)||g===0)return console.error("Invalid step value:",g),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const p=ix(a),y=sx(a,l,g,p,s),_=new Set,w=s!=null&&s.length?s.reduce((M,C)=>{const T=new Date(C.timestamp).valueOf(),b=C.event;for(const x of o)_.add(x),T in M||(M[T]={}),x in M[T]||(M[T][x]={});for(const x of o)f.forEach(D=>{b[u]===D.id||x===D.id?(M[T][x]||(M[T][x]={}),M[T][x][D.name]=Math.round(Number(b[x])*1e3)/1e3):c.length||(M[T][x]||(M[T][x]={}),M[T][x][D.name]=Math.round(Number(b[D.id])*1e3)/1e3)});return M},{}):{},S=o.length===1?o.flatMap(M=>f.map(C=>[M,C.name])):f.map(M=>[M.name,M.name]),v={},P=[...S].map(([M,C],T)=>{const b=y.map(A=>A in w&&M in w[A]?{x:A,y:w[A][M][C]||0}:{x:A,y:0});let{colorPalette:x,fill:D}=n;tt(x)&&(x=Fe);const E=Array.isArray(x)?jn(T,x):x[C]||jn(T);return v[C]=E,{rawDimension:C,rawMetric:M,label:e&&e.te(`chartLabels.${C}`)&&e.t(`chartLabels.${C}`)||C,borderColor:E,backgroundColor:E,data:b,total:b.reduce((A,{y:F})=>A+Number(F),0),...z_,fill:D,borderWidth:D?W_:H_}});return P.sort((M,C)=>Number(M.total)<Number(C.total)?-1:1),{datasets:P,colorMap:v}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const ox=(n,t)=>{h.watch([n,t],(e,i,s)=>{const[r,o]=e;!o||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(o,r),s(()=>{var a;(a=window._AnalyticsChartDataInternal)==null||a.delete(o)}))},{immediate:!0})};function ax(){const{i18n:n}=ft.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return e==="usd"?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const ft={useBarChartOptions:U_,useChartJSCommon:X_,useChartLegendValues:K_,useChartSelectedRange:Z_,useExploreResultToDatasets:ex,useExploreResultToTimeDataset:rx,useDoughnutChartOptions:Q_,useLinechartOptions:J_,useI18n:gh,useReportChartDataForSynthetics:ox,useTranslatedUnits:ax};/*!
20
19
  * chartjs-plugin-annotation v3.0.1
21
20
  * https://www.chartjs.org/chartjs-plugin-annotation/index
22
21
  * (c) 2023 chartjs-plugin-annotation Contributors
23
22
  * Released under the MIT License
24
- */const Lf={modes:{point(n,t){return la(n,t,{intersect:!0})},nearest(n,t,e){return b1(n,t,e)},x(n,t,e){return la(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return la(n,t,{intersect:e.intersect,axis:"y"})}}};function Lo(n,t,e){return(Lf.modes[e.mode]||Lf.modes.nearest)(n,t,e)}function y1(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 v1(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function la(n,t,e){return n.visibleElements.filter(r=>e.intersect?r.inRange(t.x,t.y):y1(r,t,e.axis))}function b1(n,t,e){let r=Number.POSITIVE_INFINITY;return la(n,t,e).reduce((i,a)=>{const s=a.getCenterPoint(),o=v1(t,s,e.axis),l=Jn(t,o);return l<r?(i=[a],r=l):l===r&&i.push(a),i},[]).sort((i,a)=>i._index-a._index).slice(0,1)}const x1=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,Yn=.001,ca=(n,t,e)=>Math.min(e,Math.max(t,n));function _1(n,t,e){for(const r of Object.keys(n))n[r]=ca(n[r],t,e);return n}function w1(n,t,e,r){if(!n||!t||e<=0)return!1;const i=r/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function If(n,{x:t,y:e,x2:r,y2:i},a,s){const o=s/2,l=n.x>=t-o-Yn&&n.x<=r+o+Yn,c=n.y>=e-o-Yn&&n.y<=i+o+Yn;return a==="x"?l:(a==="y"||l)&&c}function ur(n,t){const{centerX:e,centerY:r}=n.getProps(["centerX","centerY"],t);return{x:e,y:r}}function T1(n,t,e,r=!0){const i=e.split(".");let a=0;for(const s of t.split(".")){const o=i[a++];if(parseInt(s,10)<parseInt(o,10))break;if(x1(o,s)){if(r)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Nf=n=>typeof n=="string"&&n.endsWith("%"),Ff=n=>parseFloat(n)/100,Uf=n=>ca(Ff(n),0,1),ua=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),M1={box:n=>ua(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>ua(n.centerX,n.centerY),line:n=>ua(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>ua(n.centerX,n.centerY)};function Io(n,t){return t==="start"?0:t==="end"?n:Nf(t)?Uf(t)*n:n/2}function bn(n,t,e=!0){return typeof t=="number"?t:Nf(t)?(e?Uf(t):Ff(t))*n:n}function D1(n,t){const{x:e,width:r}=n,i=t.textAlign;return i==="center"?e+r/2:i==="end"||i==="right"?e+r:e}function No(n,t="center"){return lt(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}function Bf(n){return n&&(de(n.xValue)||de(n.yValue))}function ai(n,t,e){const r=e.init;if(r){if(r===!0)return zf(t,e)}else return;return S1(n,t,e)}function Wf(n,t,e){let r=!1;return t.forEach(i=>{fe(n[i])?(r=!0,e[i]=n[i]):de(e[i])&&delete e[i]}),r}function zf(n,t){const e=t.type||"line";return M1[e](n)}function S1(n,t,e){const r=Tt(e.init,[{chart:n,properties:t,options:e}]);if(r===!0)return zf(t,e);if(lt(r))return r}const Fo=new Map,k1=n=>isNaN(n)||n<=0,C1=n=>n.reduce(function(t,e){return t+=e.string,t},"");function da(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Uo(n,{x:t,y:e},r){r&&(n.translate(t,e),n.rotate(Xt(r)),n.translate(-t,-e))}function xn(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 dr(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Bo(n,t){const e=t.content;if(da(e))return{width:bn(e.width,t.width),height:bn(e.height,t.height)};const r=t.font,i=mt(r)?r.map(l=>Rt(l)):[Rt(r)],a=t.textStrokeWidth,s=mt(e)?e:[e],o=s.join()+C1(i)+a+(n._measureText?"-spriting":"");return Fo.has(o)||Fo.set(o,A1(n,s,i,a)),Fo.get(o)}function Yf(n,t,e){const{x:r,y:i,width:a,height:s}=t;n.save(),dr(n,e);const o=xn(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),tr(n,{x:r,y:i,w:a,h:s,radius:_1(dn(e.borderRadius),0,Math.min(a,s)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function O1(n,t,e){const r=e.content;if(da(r)){n.save(),n.globalAlpha=N1(e.opacity,r.style.opacity),n.drawImage(r,t.x,t.y,t.width,t.height),n.restore();return}const i=mt(r)?r:[r],a=e.font,s=mt(a)?a.map(d=>Rt(d)):[Rt(a)],o=e.color,l=mt(o)?o:[o],c=D1(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,P1(n,e)&&L1(n,{x:c,y:u},i,s),I1(n,{x:c,y:u},i,{fonts:s,colors:l}),n.restore()}function P1(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function E1(n,t,e,r){const{radius:i,options:a}=t,s=a.pointStyle,o=a.rotation;let l=(o||0)*Ba;if(da(s)){n.save(),n.translate(e,r),n.rotate(l),n.drawImage(s,-s.width/2,-s.height/2,s.width,s.height),n.restore();return}k1(i)||R1(n,{x:e,y:r,radius:i,rotation:o,style:s,rad:l})}function R1(n,{x:t,y:e,radius:r,rotation:i,style:a,rad:s}){let o,l,c,u;switch(n.beginPath(),a){default:n.arc(t,e,r,0,Ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(s)*r,e-Math.cos(s)*r),s+=xi,n.lineTo(t+Math.sin(s)*r,e-Math.cos(s)*r),s+=xi,n.lineTo(t+Math.sin(s)*r,e-Math.cos(s)*r),n.closePath();break;case"rectRounded":u=r*.516,c=r-u,o=Math.cos(s+Te)*c,l=Math.sin(s+Te)*c,n.arc(t-o,e-l,u,s-dt,s-Et),n.arc(t+l,e-o,u,s-Et,s),n.arc(t+o,e+l,u,s,s+Et),n.arc(t-l,e+o,u,s+Et,s+dt),n.closePath();break;case"rect":if(!i){c=Math.SQRT1_2*r,n.rect(t-c,e-c,2*c,2*c);break}s+=Te;case"rectRot":o=Math.cos(s)*r,l=Math.sin(s)*r,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+=Te;case"cross":o=Math.cos(s)*r,l=Math.sin(s)*r,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)*r,l=Math.sin(s)*r,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+=Te,o=Math.cos(s)*r,l=Math.sin(s)*r,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)*r,l=Math.sin(s)*r,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)*r,e+Math.sin(s)*r);break}n.fill()}function A1(n,t,e,r){n.save();const i=t.length;let a=0,s=r;for(let o=0;o<i;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+r),s+=l.lineHeight}return n.restore(),{width:a,height:s}}function L1(n,{x:t,y:e},r,i){n.beginPath();let a=0;r.forEach(function(s,o){const l=i[Math.min(o,i.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(s,t,e+c/2+a),a+=c}),n.stroke()}function I1(n,{x:t,y:e},r,{fonts:i,colors:a}){let s=0;r.forEach(function(o,l){const c=a[Math.min(l,a.length-1)],u=i[Math.min(l,i.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 N1(n,t){const e=un(n)?n:t;return un(e)?ca(e,0,1):1}const Hf={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 fr(n,t,e){return t=typeof t=="number"?t:n.parse(t),It(t)?n.getPixelForValue(t):e}function Hn(n,t,e){const r=t[e];if(r||e==="scaleID")return r;const i=e.charAt(0),a=Object.values(n).filter(s=>s.axis&&s.axis===i);return a.length?a[0].id:i}function $f(n,t){if(n){const e=n.options.reverse,r=fr(n,t.min,e?t.end:t.start),i=fr(n,t.max,e?t.start:t.end);return{start:r,end:i}}}function jf(n,t){const{chartArea:e,scales:r}=n,i=r[Hn(r,t,"xScaleID")],a=r[Hn(r,t,"yScaleID")];let s=e.width/2,o=e.height/2;return i&&(s=fr(i,t.xValue,i.left+i.width/2)),a&&(o=fr(a,t.yValue,a.top+a.height/2)),{x:s,y:o}}function Wo(n,t){const e=n.scales,r=e[Hn(e,t,"xScaleID")],i=e[Hn(e,t,"yScaleID")];if(!r&&!i)return{};let{left:a,right:s}=r||n.chartArea,{top:o,bottom:l}=i||n.chartArea;const c=Xf(r,{min:t.xMin,max:t.xMax,start:a,end:s});a=c.start,s=c.end;const u=Xf(i,{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 Vf(n,t){if(!Bf(t)){const e=Wo(n,t);let r=t.radius;(!r||isNaN(r))&&(r=Math.min(e.width,e.height)/2,t.radius=r);const i=r*2,a=e.centerX+t.xAdjust,s=e.centerY+t.yAdjust;return{x:a-r,y:s-r,x2:a+r,y2:s+r,centerX:a,centerY:s,width:i,height:i,radius:r}}return U1(n,t)}function F1(n,t){const{scales:e,chartArea:r}=n,i=e[t.scaleID],a={x:r.left,y:r.top,x2:r.right,y2:r.bottom};return i?B1(i,a,t):W1(e,a,t),a}function qf(n,t){const e=Wo(n,t);return e.initProperties=ai(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:H1(n,e,t),initProperties:e.initProperties}],e}function U1(n,t){const e=jf(n,t),r=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:r,height:r}}function Xf(n,t){const e=$f(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function B1(n,t,e){const r=fr(n,e.value,NaN),i=fr(n,e.endValue,r);n.isHorizontal()?(t.x=r,t.x2=i):(t.y=r,t.y2=i)}function W1(n,t,e){for(const r of Object.keys(Hf)){const i=n[Hn(n,e,r)];if(i){const{min:a,max:s,start:o,end:l,startProp:c,endProp:u}=Hf[r],d=$f(i,{min:e[a],max:e[s],start:i[o],end:i[l]});t[c]=d.start,t[u]=d.end}}}function z1({properties:n,options:t},e,r,i){const{x:a,x2:s,width:o}=n;return Gf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:r.x,padding:{start:i.left,end:i.right},adjust:t.label.xAdjust,size:e.width})}function Y1({properties:n,options:t},e,r,i){const{y:a,y2:s,height:o}=n;return Gf({start:a,end:s,size:o,borderWidth:t.borderWidth},{position:r.y,padding:{start:i.top,end:i.bottom},adjust:t.label.yAdjust,size:e.height})}function Gf(n,t){const{start:e,end:r,borderWidth:i}=n,{position:a,padding:{start:s,end:o},adjust:l}=t,c=r-i-e-s-o-t.size;return e+i/2+l+Io(c,a)}function H1(n,t,e){const r=e.label;r.backgroundColor="transparent",r.callout.display=!1;const i=No(r.position),a=Gt(r.padding),s=Bo(n.ctx,r),o=z1({properties:t,options:e},s,i,a),l=Y1({properties:t,options:e},s,i,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:r.rotation}}function $n(n,t,e){const r=Math.cos(e),i=Math.sin(e),a=t.x,s=t.y;return{x:a+r*(n.x-a)-i*(n.y-s),y:s+i*(n.x-a)+r*(n.y-s)}}const zo=["enter","leave"],Yo=zo.concat("click");function $1(n,t,e){t.listened=Wf(e,Yo,t.listeners),t.moveListened=!1,t._getElements=Lo,zo.forEach(r=>{fe(e[r])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(r=>{!t.listened&&fe(r.click)&&(t.listened=!0),t.moveListened||zo.forEach(i=>{fe(r[i])&&(t.listened=!0,t.moveListened=!0)})})}function j1(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return V1(n,t,e);case"click":return q1(n,t,e)}}function V1(n,t,e){if(!n.moveListened)return;let r;t.type==="mousemove"?r=Lo(n,t,e.interaction):r=[];const i=n.hovered;n.hovered=r;const a={state:n,event:t};let s=Kf(a,"leave",i,r);return Kf(a,"enter",r,i)||s}function Kf({state:n,event:t},e,r,i){let a;for(const s of r)i.indexOf(s)<0&&(a=Qf(s.options[e]||n.listeners[e],s,t)||a);return a}function q1(n,t,e){const r=n.listeners,i=Lo(n,t,e.interaction);let a;for(const s of i)a=Qf(s.options.click||r.click,s,t)||a;return a}function Qf(n,t,e){return Tt(n,[t.$context,e])===!0}const fa=["afterDraw","beforeDraw"];function X1(n,t,e){const r=t.visibleElements;t.hooked=Wf(e,fa,t.hooks),t.hooked||r.forEach(i=>{t.hooked||fa.forEach(a=>{fe(i.options[a])&&(t.hooked=!0)})})}function Zf(n,t,e){if(n.hooked){const r=t.options[e]||n.hooks[e];return Tt(r,[t.$context])}}function G1(n,t,e){const r=tT(n.scales,t,e);let i=Jf(t,r,"min","suggestedMin");i=Jf(t,r,"max","suggestedMax")||i,i&&fe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function K1(n,t){for(const e of n)Z1(e,t)}function Jf(n,t,e,r){if(It(t[e])&&!Q1(n.options,e,r)){const i=n[e]!==t[e];return n[e]=t[e],i}}function Q1(n,t,e){return de(n[t])||de(n[e])}function Z1(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const r=Hn(t,n,e);r&&!t[r]&&J1(n,e)&&console.warn(`No scale found with id '${r}' for annotation '${n.id}'`)}}function J1(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const r of["Min","Max","Value"])if(de(n[e+r]))return!0;return!1}function tT(n,t,e){const r=t.axis,i=t.id,a=r+"ScaleID",s={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===i?th(o,t,["value","endValue"],s):Hn(n,o,a)===i&&th(o,t,[r+"Min",r+"Max",r+"Value"],s);return s}function th(n,t,e,r){for(const i of e){const a=n[i];if(de(a)){const s=t.parse(a);r.min=Math.min(r.min,s),r.max=Math.max(r.max,s)}}}class hr extends te{inRange(t,e,r,i){const{x:a,y:s}=$n({x:t,y:e},this.getCenterPoint(i),Xt(-this.options.rotation));return If({x:a,y:s},this.getProps(["x","y","x2","y2"],i),r,this.options.borderWidth)}getCenterPoint(t){return ur(this,t)}draw(t){t.save(),Uo(t,this.getCenterPoint(),this.options.rotation),Yf(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return qf(t,e)}}hr.id="boxAnnotation",hr.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},hr.defaultRoutes={borderColor:"color",backgroundColor:"color"},hr.descriptors={label:{_fallback:!0}};const eh=["left","bottom","top","right"];class si extends te{inRange(t,e,r,i){const{x:a,y:s}=$n({x:t,y:e},this.getCenterPoint(i),Xt(-this.rotation));return If({x:a,y:s},this.getProps(["x","y","x2","y2"],i),r,this.options.borderWidth)}getCenterPoint(t){return ur(this,t)}draw(t){const e=this.options,r=!de(this._visible)||this._visible;!e.display||!e.content||!r||(t.save(),Uo(t,this.getCenterPoint(),this.rotation),nT(t,this),Yf(t,this,e),O1(t,cT(this),e),t.restore())}resolveElementProperties(t,e){let r;if(Bf(e))r=jf(t,e);else{const{centerX:o,centerY:l}=Wo(t,e);r={x:o,y:l}}const i=Gt(e.padding),a=Bo(t.ctx,e),s=eT(r,a,e,i);return{initProperties:ai(t,s,e),pointX:r.x,pointY:r.y,...s,rotation:e.rotation}}}si.id="labelAnnotation",si.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},si.defaultRoutes={borderColor:"color"};function eT(n,t,e,r){const i=t.width+r.width+e.borderWidth,a=t.height+r.height+e.borderWidth,s=No(e.position,"center"),o=nh(n.x,i,e.xAdjust,s.x),l=nh(n.y,a,e.yAdjust,s.y);return{x:o,y:l,x2:o+i,y2:l+a,width:i,height:a,centerX:o+i/2,centerY:l+a/2}}function nh(n,t,e=0,r){return n-Io(t,r)+e}function nT(n,t){const{pointX:e,pointY:r,options:i}=t,a=i.callout,s=a&&a.display&&oT(t,a);if(!s||uT(t,a,s))return;if(n.save(),n.beginPath(),!xn(n,a))return n.restore();const{separatorStart:l,separatorEnd:c}=rT(t,s),{sideStart:u,sideEnd:d}=aT(t,s,l);(a.margin>0||i.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 f=$n({x:e,y:r},t.getCenterPoint(),Xt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function rT(n,t){const{x:e,y:r,x2:i,y2:a}=n,s=iT(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+s,y:r},l={x:o.x,y:a}):(o={x:e,y:r+s},l={x:i,y:o.y}),{separatorStart:o,separatorEnd:l}}function iT(n,t){const{width:e,height:r,options:i}=n,a=i.callout.margin+i.borderWidth/2;return t==="right"?e+a:t==="bottom"?r+a:-a}function aT(n,t,e){const{y:r,width:i,height:a,options:s}=n,o=s.callout.start,l=sT(t,s.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:r+bn(a,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+bn(i,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function sT(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function oT(n,t){const e=t.position;return eh.includes(e)?e:lT(n,t)}function lT(n,t){const{x:e,y:r,x2:i,y2:a,width:s,height:o,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,p={x:u,y:d},y=t.start,x=bn(s,y),g=bn(o,y),m=[e,e+x,e+x,i],v=[r+g,a,r,a],b=[];for(let w=0;w<4;w++){const T=$n({x:m[w],y:v[w]},p,Xt(f));b.push({position:eh[w],distance:Jn(T,{x:l,y:c})})}return b.sort((w,T)=>w.distance-T.distance)[0].position}function cT({x:n,y:t,width:e,height:r,options:i}){const a=i.borderWidth/2,s=Gt(i.padding);return{x:n+s.left+a,y:t+s.top+a,width:e-s.left-s.right-i.borderWidth,height:r-s.top-s.bottom-i.borderWidth}}function uT(n,t,e){const{pointX:r,pointY:i}=n,a=t.margin;let s=r,o=i;return e==="left"?s+=a:e==="right"?s-=a:e==="top"?o+=a:e==="bottom"&&(o-=a),n.inRange(s,o)}const Ho=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),$o=(n,t,e)=>Ho(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,rh=(n,t,e)=>Ho(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,oi=n=>n*n,dT=(n,t,{x:e,y:r,x2:i,y2:a},s)=>s==="y"?{start:Math.min(r,a),end:Math.max(r,a),value:t}:{start:Math.min(e,i),end:Math.max(e,i),value:n},ih=(n,t,e,r)=>(1-r)*(1-r)*n+2*(1-r)*r*t+r*r*e,jo=(n,t,e,r)=>({x:ih(n.x,t.x,e.x,r),y:ih(n.y,t.y,e.y,r)}),ah=(n,t,e,r)=>2*(1-r)*(t-n)+2*r*(e-t),sh=(n,t,e,r)=>-Math.atan2(ah(n.x,t.x,e.x,r),ah(n.y,t.y,e.y,r))+.5*dt;class li extends te{inRange(t,e,r,i){const a=this.options.borderWidth/2;if(r!=="x"&&r!=="y"){const s={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){xn(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,p=l.isPointInStroke(o,d,f)||Vo(this,s,i);return l.restore(),p}const c=oi(a);return gT(this,s,c,i)||Vo(this,s,i)}return fT(this,{mouseX:t,mouseY:e},r,{hBorderWidth:a,useFinalPosition:i})}getCenterPoint(t){return ur(this,t)}draw(t){const{x:e,y:r,x2:i,y2:a,cp:s,options:o}=this;if(t.save(),!xn(t,o))return t.restore();dr(t,o);const l=Math.sqrt(Math.pow(i-e,2)+Math.pow(a-r,2));if(o.curve&&s)return TT(t,this,s,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=dh(this),p=Math.atan2(a-r,i-e);t.translate(e,r),t.rotate(p),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),qo(t,0,d,c),qo(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const r=F1(t,e),{x:i,y:a,x2:s,y2:o}=r,l=hT(r,t.chartArea),c=l?pT({x:i,y:a},{x:s,y:o},t.chartArea):{x:i,y:a,x2:s,y2:o,width:Math.abs(s-i),height:Math.abs(o-a)};if(c.centerX=(s+i)/2,c.centerY=(o+a)/2,c.initProperties=ai(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=wT(c,e,Jn(d,f))}const u=mT(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}li.id="lineAnnotation";const oh={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};li.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},oh),fill:!1,length:12,start:Object.assign({},oh),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({},si.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},li.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},li.defaultRoutes={borderColor:"color"};function fT(n,{mouseX:t,mouseY:e},r,{hBorderWidth:i,useFinalPosition:a}){const s=dT(t,e,n.getProps(["x","y","x2","y2"],a),r);return s.value>=s.start-i&&s.value<=s.end+i||Vo(n,{mouseX:t,mouseY:e},a,r)}function hT({x:n,y:t,x2:e,y2:r},{top:i,right:a,bottom:s,left:o}){return!(n<o&&e<o||n>a&&e>a||t<i&&r<i||t>s&&r>s)}function lh({x:n,y:t},e,{top:r,right:i,bottom:a,left:s}){return n<s&&(t=rh(s,{x:n,y:t},e),n=s),n>i&&(t=rh(i,{x:n,y:t},e),n=i),t<r&&(n=$o(r,{x:n,y:t},e),t=r),t>a&&(n=$o(a,{x:n,y:t},e),t=a),{x:n,y:t}}function pT(n,t,e){const{x:r,y:i}=lh(n,t,e),{x:a,y:s}=lh(t,n,e);return{x:r,y:i,x2:a,y2:s,width:Math.abs(a-r),height:Math.abs(s-i)}}function gT(n,{mouseX:t,mouseY:e},r=Yn,i){const{x:a,y:s,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],i),c=o-a,u=l-s,d=oi(c)+oi(u),f=d===0?-1:((t-a)*c+(e-s)*u)/d;let p,y;return f<0?(p=a,y=s):f>1?(p=o,y=l):(p=a+f*c,y=s+f*u),oi(t-p)+oi(e-y)<=r}function Vo(n,{mouseX:t,mouseY:e},r,i){const a=n.label;return a.options.display&&a.inRange(t,e,i,r)}function mT(n,t,e){const r=e.borderWidth,i=Gt(e.padding),a=Bo(n.ctx,e),s=a.width+i.width+r,o=a.height+i.height+r;return vT(t,e,{width:s,height:o,padding:i},n.chartArea)}function yT(n){const{x:t,y:e,x2:r,y2:i}=n,a=Math.atan2(i-e,r-t);return a>dt/2?a-dt:a<dt/-2?a+dt:a}function vT(n,t,e,r){const{width:i,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"?yT(n):Xt(t.rotation),f=bT(i,a,d),p=xT(n,t,{labelSize:f,padding:s},r),y=n.cp?jo(c,n.cp,u,p):Ho(c,u,p),x={size:f.w,min:r.left,max:r.right,padding:s.left},g={size:f.h,min:r.top,max:r.bottom,padding:s.top},m=uh(y.x,x)+o,v=uh(y.y,g)+l;return{x:m-i/2,y:v-a/2,x2:m+i/2,y2:v+a/2,centerX:m,centerY:v,pointX:y.x,pointY:y.y,width:i,height:a,rotation:_i(d)}}function bT(n,t,e){const r=Math.cos(e),i=Math.sin(e);return{w:Math.abs(n*r)+Math.abs(t*i),h:Math.abs(n*i)+Math.abs(t*r)}}function xT(n,t,e,r){let i;const a=_T(n,r);return t.position==="start"?i=ch({w:n.x2-n.x,h:n.y2-n.y},e,t,a):t.position==="end"?i=1-ch({w:n.x-n.x2,h:n.y-n.y2},e,t,a):i=Io(1,t.position),i}function ch(n,t,e,r){const{labelSize:i,padding:a}=t,s=n.w*r.dx,o=n.h*r.dy,l=s>0&&(i.w/2+a.left-r.x)/s,c=o>0&&(i.h/2+a.top-r.y)/o;return ca(Math.max(l,c),0,.25)}function _T(n,t){const{x:e,x2:r,y:i,y2:a}=n,s=Math.min(i,a)-t.top,o=Math.min(e,r)-t.left,l=t.bottom-Math.max(i,a),c=t.right-Math.max(e,r);return{x:Math.min(o,c),y:Math.min(s,l),dx:o<=c?1:-1,dy:s<=l?1:-1}}function uh(n,t){const{size:e,min:r,max:i,padding:a}=t,s=e/2;return e>i-r?(i+r)/2:(r>=n-a-s&&(n=r+a+s),i<=n+a+s&&(n=i-a-s),n)}function dh(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,r=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:r,startAdjust:fh(n,e),endAdjust:fh(n,r)}}function fh(n,t){if(!t||!t.display)return 0;const{length:e,width:r}=t,i=n.options.borderWidth/2,a={x:e,y:r+i};return Math.abs($o(0,a,{x:0,y:i}))}function qo(n,t,e,r){if(!r||!r.display)return;const{length:i,width:a,fill:s,backgroundColor:o,borderColor:l}=r,c=Math.abs(t-i)+e;n.beginPath(),dr(n,r),xn(n,r),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=r.borderShadowColor,n.stroke()}function wT(n,t,e){const{x:r,y:i,x2:a,y2:s,centerX:o,centerY:l}=n,c=Math.atan2(s-i,a-r),u=No(t.controlPoint,0),d={x:o+bn(e,u.x,!1),y:l+bn(e,u.y,!1)};return $n(d,{x:o,y:l},c)}function hh(n,{x:t,y:e},{angle:r,adjust:i},a){!a||!a.display||(n.save(),n.translate(t,e),n.rotate(r),qo(n,0,-i,a),n.restore())}function TT(n,t,e,r){const{x:i,y:a,x2:s,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=dh(t),p={x:i,y:a},y={x:s,y:o},x=sh(p,e,y,0),g=sh(p,e,y,1)-dt,m=jo(p,e,y,d/r),v=jo(p,e,y,1-f/r),b=new Path2D;n.beginPath(),b.moveTo(m.x,m.y),b.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(b),t.path=b,t.ctx=n,hh(n,m,{angle:x,adjust:d},c),hh(n,v,{angle:g,adjust:f},u)}class ci extends te{inRange(t,e,r,i){const a=this.options.rotation,s=this.options.borderWidth;if(r!=="x"&&r!=="y")return MT({x:t,y:e},this.getProps(["width","height","centerX","centerY"],i),a,s);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],i),d=s/2,f=r==="y"?{start:l,end:u}:{start:o,end:c},p=$n({x:t,y:e},this.getCenterPoint(i),Xt(-a));return p[r]>=f.start-d-Yn&&p[r]<=f.end+d+Yn}getCenterPoint(t){return ur(this,t)}draw(t){const{width:e,height:r,centerX:i,centerY:a,options:s}=this;t.save(),Uo(t,this.getCenterPoint(),s.rotation),dr(t,this.options),t.beginPath(),t.fillStyle=s.backgroundColor;const o=xn(t,s);t.ellipse(i,a,r/2,e/2,dt/2,0,2*dt),t.fill(),o&&(t.shadowColor=s.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return qf(t,e)}}ci.id="ellipseAnnotation",ci.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},hr.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},ci.defaultRoutes={borderColor:"color",backgroundColor:"color"},ci.descriptors={label:{_fallback:!0}};function MT(n,t,e,r){const{width:i,height:a,centerX:s,centerY:o}=t,l=i/2,c=a/2;if(l<=0||c<=0)return!1;const u=Xt(e||0),d=r/2||0,f=Math.cos(u),p=Math.sin(u),y=Math.pow(f*(n.x-s)+p*(n.y-o),2),x=Math.pow(p*(n.x-s)-f*(n.y-o),2);return y/Math.pow(l+d,2)+x/Math.pow(c+d,2)<=1.0001}class ha extends te{inRange(t,e,r,i){const{x:a,y:s,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],i),u=this.options.borderWidth;if(r!=="x"&&r!=="y")return w1({x:t,y:e},this.getCenterPoint(i),c/2,u);const d=u/2,f=r==="y"?{start:s,end:l,value:e}:{start:a,end:o,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return ur(this,t)}draw(t){const e=this.options,r=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,dr(t,e);const i=xn(t,e);E1(t,this,this.centerX,this.centerY),i&&!da(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=r}resolveElementProperties(t,e){const r=Vf(t,e);return r.initProperties=ai(t,r,e),r}}ha.id="pointAnnotation",ha.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},ha.defaultRoutes={borderColor:"color",backgroundColor:"color"};class pa extends te{inRange(t,e,r,i){if(r!=="x"&&r!=="y")return this.options.radius>=.1&&this.elements.length>1&&ST(this.elements,t,e,i);const a=$n({x:t,y:e},this.getCenterPoint(i),Xt(-this.options.rotation)),s=this.elements.map(c=>r==="y"?c.bY:c.bX),o=Math.min(...s),l=Math.max(...s);return a[r]>=o&&a[r]<=l}getCenterPoint(t){return ur(this,t)}draw(t){const{elements:e,options:r}=this;t.save(),t.beginPath(),t.fillStyle=r.backgroundColor,dr(t,r);const i=xn(t,r);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(),i&&(t.shadowColor=r.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const r=Vf(t,e),{sides:i,rotation:a}=e,s=[],o=2*dt/i;let l=a*Ba;for(let c=0;c<i;c++,l+=o){const u=DT(r,e,l);u.initProperties=ai(t,r,e),s.push(u)}return r.elements=s,r}}pa.id="polygonAnnotation",pa.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},pa.defaultRoutes={borderColor:"color",backgroundColor:"color"};function DT({centerX:n,centerY:t},{radius:e,borderWidth:r},i){const a=r/2,s=Math.sin(i),o=Math.cos(i),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 ST(n,t,e,r){let i=!1,a=n[n.length-1].getProps(["bX","bY"],r);for(const s of n){const o=s.getProps(["bX","bY"],r);o.bY>e!=a.bY>e&&t<(a.bX-o.bX)*(e-o.bY)/(a.bY-o.bY)+o.bX&&(i=!i),a=o}return i}const _n={box:hr,ellipse:ci,label:si,line:li,point:ha,polygon:pa};Object.keys(_n).forEach(n=>{Ut.describe(`elements.${_n[n].id}`,{_fallback:"plugins.annotation.common"})});const kT={update:Object.assign},CT=Yo.concat(fa),ph=(n,t)=>lt(t)?Ko(n,t):n,Xo=n=>n==="color"||n==="font";function Go(n="line"){return _n[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function OT(n,t,e,r){const i=ET(n,e.animations,r),a=t.annotations,s=LT(t.elements,a);for(let o=0;o<a.length;o++){const l=a[o],c=gh(s,o,l.type),u=l.setContext(AT(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=PT(d),"elements"in d&&(RT(c,d.elements,u,i),delete d.elements),de(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=mh(u),i.update(c,d)}}function PT(n){return isNaN(n.x)||isNaN(n.y)}function ET(n,t,e){return e==="reset"||e==="none"||e==="resize"?kT:new Ja(n,t)}function RT(n,t,e,r){const i=n.elements||(n.elements=[]);i.length=t.length;for(let a=0;a<t.length;a++){const s=t[a],o=s.properties,l=gh(i,a,s.type,s.initProperties),c=e[s.optionScope].override(s);o.options=mh(c),r.update(l,o)}}function gh(n,t,e,r){const i=_n[Go(e)];let a=n[t];return(!a||!(a instanceof i))&&(a=n[t]=new i,Object.assign(a,r)),a}function mh(n){const t=_n[Go(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Ko(n,t.defaults),Ko(n,t.defaultRoutes));for(const r of CT)e[r]=n[r];return e}function Ko(n,t){const e={};for(const r of Object.keys(t)){const i=t[r],a=n[r];Xo(r)&&mt(a)?e[r]=a.map(s=>ph(s,i)):e[r]=ph(a,i)}return e}function AT(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function LT(n,t){const e=t.length,r=n.length;if(r<e){const i=e-r;n.splice(r,0,...new Array(i))}else r>e&&n.splice(e,r-e);return n}var IT="3.0.1";const wn=new Map,NT=Yo.concat(fa);var yh={id:"annotation",version:IT,beforeRegister(){T1("chart.js","4.0",Me.version)},afterRegister(){Me.register(_n)},afterUnregister(){Me.unregister(_n)},beforeInit(n){wn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const r=wn.get(n),i=r.annotations=[];let a=e.annotations;lt(a)?Object.keys(a).forEach(s=>{const o=a[s];lt(o)&&(o.id=s,i.push(o))}):mt(a)&&i.push(...a),K1(i,n.scales)},afterDataLimits(n,t){const e=wn.get(n);G1(n,t.scale,e.annotations.filter(r=>r.display&&r.adjustScaleRange))},afterUpdate(n,t,e){const r=wn.get(n);$1(n,r,e),OT(n,r,e,t.mode),r.visibleElements=r.elements.filter(i=>!i.skip&&i.options.display),X1(n,r,e)},beforeDatasetsDraw(n,t,e){ga(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){ga(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){ga(n,"beforeDraw",e.clip)},afterDraw(n,t,e){ga(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const r=wn.get(n);j1(r,t.event,e)&&(t.changed=!0)},afterDestroy(n){wn.delete(n)},_getState(n){return wn.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=>!NT.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${_n[Go(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Xo,_fallback:!0},_indexable:Xo}},additionalOptionScopes:[""]};function ga(n,t,e){const{ctx:r,chartArea:i}=n,a=wn.get(n);e&&Pr(r,i);const s=FT(a.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of s)UT(r,i,a,o);e&&Er(r)}function FT(n,t){const e=[];for(const r of n)if(r.options.drawTime===t&&e.push({element:r,main:!0}),r.elements&&r.elements.length)for(const i of r.elements)i.options.display&&i.options.drawTime===t&&e.push({element:i});return e}function UT(n,t,e,r){const i=r.element;r.main?(Zf(e,i,"beforeDraw"),i.draw(n,t),Zf(e,i,"afterDraw")):i.draw(n,t)}const BT="#6c7489",WT="#995c00",zT="20px",vh="24px",YT="40px",HT="48px",$T={class:"tooltip-title"},jT={class:"title font-bold"},VT={key:1,class:"subtitle"},qT={class:"tooltip"},XT={key:0},GT={class:"display-label"},KT={class:"display-value"},QT=h.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=t,r=n,i=h.ref(null),a=h.ref(!1),s=h.ref({x:0,y:0}),o=h.ref({x:0,y:0}),l=h.ref({left:r.left,top:r.top});h.watch(i,p=>{if(p){const{width:y,height:x}=p.getBoundingClientRect();e("dimensions",{width:y,height:x})}}),h.watch(()=>r.locked,p=>{p?(l.value.left=r.left,l.value.top=r.top):p===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(p){if(i.value){a.value=!0;const y=window.getComputedStyle(i.value),x=y.transform||y.webkitTransform||y.mozTransform,g=new DOMMatrix(x),m=g.m41,v=g.m42;s.value={x:m,y:v},o.value={x:p.clientX,y:p.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(p){p.preventDefault(),p.stopPropagation(),a.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const y=p.clientX-o.value.x,x=p.clientY-o.value.y;l.value.left=`${s.value.x+y}px`,l.value.top=`${s.value.y+x}px`}))}function f(){a.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(p,y)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:i,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",$T,[h.createElementVNode("span",jT,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(ic.DragIcon),{key:0,class:"drag-icon",color:h.unref(BT)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",VT,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",qT,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:x,borderColor:g,label:m,value:v})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:m},[n.series.length?(h.openBlock(),h.createElementBlock("li",XT,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:x,"border-color":g})},null,4),h.createElementVNode("span",GT,h.toDisplayString(m),1),h.createElementVNode("span",KT,h.toDisplayString(v),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Ze=(n,t)=>{const e=n.__vccOpts||n;for(const[r,i]of t)e[r]=i;return e},Qo=Ze(QT,[["__scopeId","data-v-cd0df662"]]),ZT=["onClick"],JT=["title"],tM={key:0,class:"sub-label"},Zo=Ze(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(b=>({"143d7c82":o.value}));const t=n,e=h.ref(),r=h.ref([]),i=h.inject("showLegendValues",!0),a=h.inject("legendPosition",h.ref(Wt.Right)),s=h.ref([]),o=h.ref(vh),l=()=>{const b=e.value;if(!b||!r.value||b.children.length===0)return 0;const w=b.children[0].getBoundingClientRect().top;for(const T of r.value)if(T.getBoundingClientRect().top>w)return!0;return!1},c=h.computed(()=>t.items.length>2||a.value===Wt.Right),u=()=>{e.value&&a.value===Wt.Bottom&&(l()?o.value=HT:o.value=vh)},d=()=>{if(e.value&&a.value===Wt.Bottom){let b=0;r.value.forEach(T=>{const S=Array.from(T.children).reduce((C,M)=>C+M.offsetWidth,0);S>b&&(b=S)});const w=parseInt(YT,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${b+w}px)`}u()},f=()=>{if(t.items.length!==s.value.length)return s.value=t.items,!0;for(let b=0;b<t.items.length;b++)if(t.items[b].text!==s.value[b].text)return s.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{f()&&d()},{immediate:!0,flush:"post"});const p=h.ref(0),y=h.ref(0),x=new ResizeObserver(Jd(b=>{const w=b[0],T=w.contentRect.width,S=w.contentRect.height;T!==p.value&&S===y.value&&d(),p.value=T,y.value=S},100));h.watch(()=>a.value,()=>{d()}),h.onMounted(()=>{s.value=t.items,e.value&&x.observe(e.value),window.requestAnimationFrame(()=>{d()})}),h.onBeforeUnmount(()=>{e.value&&x.unobserve(e.value)});const g=(b=0,w)=>{if(t.chartInstance===null)return;const T=t.chartInstance instanceof Me?t.chartInstance:t.chartInstance.chart;m(b,w)?T.hide(b,w):T.show(b,w),T.update()},m=(b=0,w)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const T=t.chartInstance instanceof Me?t.chartInstance:t.chartInstance.chart,S=T.getDatasetMeta(b);return S.dataset||w===void 0?T.isDatasetVisible(b):!(S.data.length&&S.data[w].hidden)},v=b=>({[Wt.Right]:"vertical",[Wt.Bottom]:"horizontal",[Wt.Hidden]:"hidden"})[b];return(b,w)=>h.unref(a)!==h.unref(Wt).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",v(h.unref(a))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:T,strokeStyle:S,text:C,datasetIndex:M,index:D,value:O})=>(h.openBlock(),h.createElementBlock("li",{key:C,ref_for:!0,ref_key:"legendItemsRef",ref:r,onClick:P=>g(M,D)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:T,"border-color":S})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!m(M,D)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":c.value}]),title:C},h.toDisplayString(C),11,JT),O&&h.unref(i)?(h.openBlock(),h.createElementBlock("div",tM,h.toDisplayString(O.formatted),1)):h.createCommentVNode("",!0)],2)],8,ZT))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-bf35eae8"]]);let ma;const eM=new Uint8Array(16);function nM(){if(!ma&&(ma=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ma))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ma(eM)}const ne=[];for(let n=0;n<256;++n)ne.push((n+256).toString(16).slice(1));function rM(n,t=0){return ne[n[t+0]]+ne[n[t+1]]+ne[n[t+2]]+ne[n[t+3]]+"-"+ne[n[t+4]]+ne[n[t+5]]+"-"+ne[n[t+6]]+ne[n[t+7]]+"-"+ne[n[t+8]]+ne[n[t+9]]+"-"+ne[n[t+10]]+ne[n[t+11]]+ne[n[t+12]]+ne[n[t+13]]+ne[n[t+14]]+ne[n[t+15]]}const bh={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Tn(n,t,e){if(bh.randomUUID&&!t&&!n)return bh.randomUUID();n=n||{};const r=n.random||(n.rng||nM)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){e=e||0;for(let i=0;i<16;++i)t[e+i]=r[i];return t}return rM(r)}const xh=(n,t)=>{const e=n.ctx,r=n.scales.y,i=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,r.bottom-a.y):e.strokeRect(i.left,a.y-a.height/2,a.x-i.left,a.height),e.restore()},_h={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&xh(n,this.clickedElements)},afterEvent:function(n,{event:t}){var i;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((i=n.options.interaction)==null?void 0:i.mode)||"index",r=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);r.length&&this.clicked?(this.clickedElements=r,xh(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}},wh=6,iM="100%",aM="100%",sM=20,oM=20,Th=6,lM=0,cM=10,uM=10,dM=1,fM=Ze(h.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:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=St.useI18n(),{translateUnit:r}=St.useTranslatedUnits(),i=h.ref(null),a=({chart:L},U)=>{var K;const j=L.data,Z=(K=j.labels)==null?void 0:K.indexOf(U);return j.datasets.reduce((N,A,Q)=>{if(L.isDatasetVisible(Q)){const X=A.data[Z];return isNaN(X)?N:N+X}else return N},0)},s=(L,U,j,Z)=>{const K=Z==="horizontal";U===null&&(U=e.t("entityNoName"));const N={type:"label",yValue:X=>K?U:a(X,U),xValue:X=>K?a(X,U):U},A={...N,position:K?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>K?0:-Math.abs(Qw()),content:X=>Eo(a(X,U),j)},Q={...N,content:X=>Ef(a(X,U),Pf(X.chart,L)),position:K?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:X=>K?Of(Eo(a(X,U),j)):0,color:kf};return{[`${U}-value`]:A,[`${U}-percent`]:Q}},o=h.ref(null),l=h.ref(),c=h.ref(Tn()),u=Tn(),d=Tn(),f=h.ref([]),p=h.ref(h.inject("legendPosition",Wt.Right)),y=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:-50}),x=h.toRef(t,"metricUnit"),g=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),m=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:x,translateUnit:r,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:g.value?ee.HORIZONTAL_BAR:ee.VERTICAL_BAR,chartTooltipSortFn:t.chartTooltipSortFn}),v=h.ref(0),b=()=>{var L;return t.annotations&&((L=t.chartData.labels)==null?void 0:L.reduce((U,j)=>Object.assign(U,s(t.chartData,j,x.value,t.orientation)),{}))},w={id:c.value,afterUpdate(L){v.value+=1,f.value=L.options.plugins.legend.labels.generateLabels(L).map(U=>({...U,value:t.legendValues&&t.legendValues[U.text]})).sort(t.chartLegendSortFn)}},T={id:u,afterUpdate(L){L.options.plugins.annotation.annotations=t.annotations?b():{}}},M=[w,{id:"axisHover",afterEvent(L,U){if(y.value.show=!1,U.event.type==="mousemove"){const j=U.event,Z=L.options.indexAxis,K=L.scales,N=L.scales[Z].getLabelForValue(Number(L.scales[Z].getValueForPixel(j[Z])));if((Q=>Q==="x"?j.y>K.x.top:j.x<K.y.right)(Z))if(m.locked||(m.showTooltip=!1),N.length>sa){const X=L.canvas.getContext("2d").measureText(N).width,vt=Math.abs(Math.round(j.x-X*.5)),ct=Math.round(j.x+X*.5);y.value.left=Z==="x"?`${(vt>0?vt:ct)-y.value.offset}px`:`${j.x-X*.5-y.value.offset}px`,y.value.top=`${j.y-50}px`,y.value.show=!0,y.value.text=N}else y.value.show=!1;else y.value.show=!1}}},{id:d,afterUpdate(L){L.options.layout.padding.right=g.value?I.value:0}},_h,...t.annotations?[T]:[]],D=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),O=h.ref(0),P=h.ref(0),E=new ResizeObserver(Jd(L=>{O.value=L[0].contentRect.width,P.value=L[0].contentRect.height},100)),F=h.computed(()=>{var U,j;const L=(j=(U=t.chartData)==null?void 0:U.labels)==null?void 0:j.length;return o.value&&L&&!g.value?`${Math.max(L*(sM+Th),O.value)}px`:iM}),q=h.computed(()=>{var U,j;const L=(j=(U=t.chartData)==null?void 0:U.labels)==null?void 0:j.length;return o.value&&L&&g.value?`${Math.max(L*(oM+Th),P.value)}px`:aM});St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&Me.register(yh),i.value&&(O.value=i.value.offsetWidth,P.value=i.value.offsetHeight,E.observe(i.value))}),h.onUnmounted(()=>{i.value&&E.unobserve(i.value)});const $=h.computed(()=>{const L=St.useBarChartOptions({tooltipState:m,legendID:c.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:g.value?"y":"x",numLabels:D});return{...L.value,plugins:{...L.value.plugins,annotation:{annotations:b(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*wh}}}}),Y=St.useChartJSCommon("bar",o,h.toRef(t,"chartData"),M,$),I=h.computed(()=>{v.value;const L=t.chartData.labels,U=t.chartData.datasets,j=L.map((N,A)=>U.reduce((Q,X)=>isNaN(Number(X.data[A]))?Q:Q+Number(X.data[A]),0)),Z=Y.value?Pf(Y.value,t.chartData):Zw(t.chartData);return j.map(N=>Of(Eo(N,x.value)+Ef(N,Z))).reduce((N,A)=>Math.max(N,A),0)+wh});h.onBeforeUnmount(()=>{Me.unregister(yh)});const it={[Wt.Right]:"legend-row",[Wt.Bottom]:"column"},B=h.computed(()=>{if(l.value&&Y.value){const L=window.devicePixelRatio,U=Y.value,j=U.scales.y.width*L+dM,Z=(U.scales.y.height+U.scales.y.top+U.scales.x.height)*L,K=l.value.getContext("2d");return K.scale(L,L),K.canvas.width=j,K.canvas.height=Z,K.canvas.style.width=`${j/L}px`,K.canvas.style.height=`${Z/L}px`,{scale:L,width:j*L,height:Z*L,targetCtx:K}}return null}),yt=L=>{const U=L.target;if(B.value&&Y.value&&!g.value){const j=B.value.scale,Z=B.value.targetCtx,K=B.value.width,N=B.value.height,A=Y.value,Q=A.canvas;Z.fillStyle="white",U.scrollLeft>=lM&&U.scrollLeft<=cM?(Z.globalCompositeOperation="source-over",Z.clearRect(0,0,K,N),Z.drawImage(Q,0,0,K,N,0,0,K,N),Z.globalCompositeOperation="destination-over",Z.fillRect(0,0,K,N)):(Z.globalCompositeOperation="source-over",Z.fillRect(0,(A.scales.y.height+A.scales.y.top+uM)*j,K,A.scales.x.height*j))}m.offsetY=U.scrollTop,m.offsetX=U.scrollLeft,y.value.offset=U.scrollLeft},ut=({width:L,height:U})=>{m.width=L,m.height=U};h.watch(()=>t.orientation,()=>{var L;if(l.value&&B.value){const U=B.value.width,j=B.value.height;((L=l.value)==null?void 0:L.getContext("2d")).clearRect(0,0,U,j)}m.showTooltip=!1,m.locked=!1}),h.watch(()=>t.annotations,L=>{Y.value&&(L?Y.value.options.plugins.annotation.annotations=b(t.chartData):delete Y.value.options.plugins.annotation.annotations)});const z=()=>{m.showTooltip&&(m.locked=!m.locked)};return(L,U)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",it[p.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:i,class:"chart-container","on:scroll":yt,onClick:U[0]||(U[0]=j=>z())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:F.value,height:q.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:o},null,512)],4)],544),y.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:y.value.top,left:y.value.left})},h.toDisplayString(y.value.text),5)):h.createCommentVNode("",!0),h.createVNode(Qo,{context:m.tooltipContext,left:m.left,locked:m.locked,series:m.tooltipSeries,"show-tooltip":m.showTooltip,"tooltip-title":n.tooltipTitle,top:m.top,onDimensions:ut},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(Zo,{id:c.value,"chart-instance":h.unref(Y),items:f.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6420fe94"]]);/*!
23
+ */const Au={modes:{point(n,t){return zs(n,t,{intersect:!0})},nearest(n,t,e){return ux(n,t,e)},x(n,t,e){return zs(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return zs(n,t,{intersect:e.intersect,axis:"y"})}}};function Oo(n,t,e){return(Au.modes[e.mode]||Au.modes.nearest)(n,t,e)}function lx(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 cx(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function zs(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):lx(i,t,e.axis))}function ux(n,t,e){let i=Number.POSITIVE_INFINITY;return zs(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=cx(t,o,e.axis),l=An(t,a);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}const dx=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,vn=.001,Hs=(n,t,e)=>Math.min(e,Math.max(t,n));function hx(n,t,e){for(const i of Object.keys(n))n[i]=Hs(n[i],t,e);return n}function fx(n,t,e,i){if(!n||!t||e<=0)return!1;const s=i/2;return Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+s,2)}function Lu(n,{x:t,y:e,x2:i,y2:s},r,o){const a=o/2,l=n.x>=t-a-vn&&n.x<=i+a+vn,c=n.y>=e-a-vn&&n.y<=s+a+vn;return r==="x"?l:(r==="y"||l)&&c}function $n(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function gx(n,t,e,i=!0){const s=e.split(".");let r=0;for(const o of t.split(".")){const a=s[r++];if(parseInt(o,10)<parseInt(a,10))break;if(dx(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Iu=n=>typeof n=="string"&&n.endsWith("%"),Nu=n=>parseFloat(n)/100,Fu=n=>Hs(Nu(n),0,1),Ws=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),px={box:n=>Ws(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>Ws(n.centerX,n.centerY),line:n=>Ws(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>Ws(n.centerX,n.centerY)};function Po(n,t){return t==="start"?0:t==="end"?n:Iu(t)?Fu(t)*n:n/2}function sn(n,t,e=!0){return typeof t=="number"?t:Iu(t)?(e?Fu(t):Nu(t))*n:n}function mx(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function Eo(n,t="center"){return it(n)?{x:Z(n.x,t),y:Z(n.y,t)}:(n=Z(n,t),{x:n,y:n})}function Bu(n){return n&&(Qt(n.xValue)||Qt(n.yValue))}function Bi(n,t,e){const i=e.init;if(i){if(i===!0)return Hu(t,e)}else return;return yx(n,t,e)}function zu(n,t,e){let i=!1;return t.forEach(s=>{Jt(n[s])?(i=!0,e[s]=n[s]):Qt(e[s])&&delete e[s]}),i}function Hu(n,t){const e=t.type||"line";return px[e](n)}function yx(n,t,e){const i=ut(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return Hu(t,e);if(it(i))return i}const Ro=new Map,bx=n=>isNaN(n)||n<=0,_x=n=>n.reduce(function(t,e){return t+=e.string,t},"");function Ys(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Ao(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Nt(i)),n.translate(-t,-e))}function rn(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 Un(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function Lo(n,t){const e=t.content;if(Ys(e))return{width:sn(e.width,t.width),height:sn(e.height,t.height)};const i=t.font,s=ot(i)?i.map(l=>_t(l)):[_t(i)],r=t.textStrokeWidth,o=ot(e)?e:[e],a=o.join()+_x(s)+r+(n._measureText?"-spriting":"");return Ro.has(a)||Ro.set(a,vx(n,o,s,r)),Ro.get(a)}function Wu(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),Un(n,e);const a=rn(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Ln(n,{x:i,y:s,w:r,h:o,radius:hx(Ke(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function xx(n,t,e){const i=e.content;if(Ys(i)){n.save(),n.globalAlpha=Tx(e.opacity,i.style.opacity),n.drawImage(i,t.x,t.y,t.width,t.height),n.restore();return}const s=ot(i)?i:[i],r=e.font,o=ot(r)?r.map(d=>_t(d)):[_t(r)],a=e.color,l=ot(a)?a:[a],c=mx(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,wx(n,e)&&Dx(n,{x:c,y:u},s,o),Mx(n,{x:c,y:u},s,{fonts:o,colors:l}),n.restore()}function wx(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function kx(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*mr;if(Ys(o)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(o,-o.width/2,-o.height/2,o.width,o.height),n.restore();return}bx(s)||Sx(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function Sx(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:o}){let a,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,mt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qi,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=Qi,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,a=Math.cos(o+he)*c,l=Math.sin(o+he)*c,n.arc(t-a,e-l,u,o-rt,o-bt),n.arc(t+l,e-a,u,o-bt,o),n.arc(t+a,e+l,u,o,o+bt),n.arc(t-l,e+a,u,o+bt,o+rt),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}o+=he;case"rectRot":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+l,e-a),n.lineTo(t+a,e+l),n.lineTo(t-l,e+a),n.closePath();break;case"crossRot":o+=he;case"cross":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"star":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a),o+=he,a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l),n.moveTo(t+l,e-a),n.lineTo(t-l,e+a);break;case"line":a=Math.cos(o)*i,l=Math.sin(o)*i,n.moveTo(t-a,e-l),n.lineTo(t+a,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(o)*i,e+Math.sin(o)*i);break}n.fill()}function vx(n,t,e,i){n.save();const s=t.length;let r=0,o=i;for(let a=0;a<s;a++){const l=e[Math.min(a,e.length-1)];n.font=l.string;const c=t[a];r=Math.max(r,n.measureText(c).width+i),o+=l.lineHeight}return n.restore(),{width:r,height:o}}function Dx(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(o,a){const l=s[Math.min(a,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(o,t,e+c/2+r),r+=c}),n.stroke()}function Mx(n,{x:t,y:e},i,{fonts:s,colors:r}){let o=0;i.forEach(function(a,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],d=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(a,t,e+d/2+o),o+=d,n.fill()})}function Tx(n,t){const e=Ge(n)?n:t;return Ge(e)?Hs(e,0,1):1}const Yu={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 qn(n,t,e){return t=typeof t=="number"?t:n.parse(t),vt(t)?n.getPixelForValue(t):e}function Dn(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(o=>o.axis&&o.axis===s);return r.length?r[0].id:s}function Vu(n,t){if(n){const e=n.options.reverse,i=qn(n,t.min,e?t.end:t.start),s=qn(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function ju(n,t){const{chartArea:e,scales:i}=n,s=i[Dn(i,t,"xScaleID")],r=i[Dn(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=qn(s,t.xValue,s.left+s.width/2)),r&&(a=qn(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function Io(n,t){const e=n.scales,i=e[Dn(e,t,"xScaleID")],s=e[Dn(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=qu(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=qu(s,{min:t.yMin,max:t.yMax,start:l,end:a});return a=u.start,l=u.end,{x:r,y:a,x2:o,y2:l,width:o-r,height:l-a,centerX:r+(o-r)/2,centerY:a+(l-a)/2}}function $u(n,t){if(!Bu(t)){const e=Io(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,o=e.centerY+t.yAdjust;return{x:r-i,y:o-i,x2:r+i,y2:o+i,centerX:r,centerY:o,width:s,height:s,radius:i}}return Ox(n,t)}function Cx(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?Px(s,r,t):Ex(e,r,t),r}function Uu(n,t){const e=Io(n,t);return e.initProperties=Bi(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:Lx(n,e,t),initProperties:e.initProperties}],e}function Ox(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 qu(n,t){const e=Vu(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function Px(n,t,e){const i=qn(n,e.value,NaN),s=qn(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function Ex(n,t,e){for(const i of Object.keys(Yu)){const s=n[Dn(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=Yu[i],d=Vu(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function Rx({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return Xu({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function Ax({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return Xu({start:r,end:o,size:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function Xu(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:o,end:a},adjust:l}=t,c=i-s-e-o-a-t.size;return e+s/2+l+Po(c,r)}function Lx(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=Eo(i.position),r=Ft(i.padding),o=Lo(n.ctx,i),a=Rx({properties:t,options:e},o,s,r),l=Ax({properties:t,options:e},o,s,r),c=o.width+r.width,u=o.height+r.height;return{x:a,y:l,x2:a+c,y2:l+u,width:c,height:u,centerX:a+c/2,centerY:l+u/2,rotation:i.rotation}}function Mn(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,o=t.y;return{x:r+i*(n.x-r)-s*(n.y-o),y:o+s*(n.x-r)+i*(n.y-o)}}const No=["enter","leave"],Fo=No.concat("click");function Ix(n,t,e){t.listened=zu(e,Fo,t.listeners),t.moveListened=!1,t._getElements=Oo,No.forEach(i=>{Jt(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Jt(i.click)&&(t.listened=!0),t.moveListened||No.forEach(s=>{Jt(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function Nx(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return Fx(n,t,e);case"click":return Bx(n,t,e)}}function Fx(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Oo(n,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=Gu(r,"leave",s,i);return Gu(r,"enter",i,s)||o}function Gu({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=Ku(o.options[e]||n.listeners[e],o,t)||r);return r}function Bx(n,t,e){const i=n.listeners,s=Oo(n,t,e.interaction);let r;for(const o of s)r=Ku(o.options.click||i.click,o,t)||r;return r}function Ku(n,t,e){return ut(n,[t.$context,e])===!0}const Vs=["afterDraw","beforeDraw"];function zx(n,t,e){const i=t.visibleElements;t.hooked=zu(e,Vs,t.hooks),t.hooked||i.forEach(s=>{t.hooked||Vs.forEach(r=>{Jt(s.options[r])&&(t.hooked=!0)})})}function Zu(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return ut(i,[t.$context])}}function Hx(n,t,e){const i=$x(n.scales,t,e);let s=Qu(t,i,"min","suggestedMin");s=Qu(t,i,"max","suggestedMax")||s,s&&Jt(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function Wx(n,t){for(const e of n)Vx(e,t)}function Qu(n,t,e,i){if(vt(t[e])&&!Yx(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Yx(n,t,e){return Qt(n[t])||Qt(n[e])}function Vx(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Dn(t,n,e);i&&!t[i]&&jx(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function jx(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(Qt(n[e+i]))return!0;return!1}function $x(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",o={min:Z(t.min,Number.NEGATIVE_INFINITY),max:Z(t.max,Number.POSITIVE_INFINITY)};for(const a of e)a.scaleID===s?Ju(a,t,["value","endValue"],o):Dn(n,a,r)===s&&Ju(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function Ju(n,t,e,i){for(const s of e){const r=n[s];if(Qt(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class Xn extends Vt{inRange(t,e,i,s){const{x:r,y:o}=Mn({x:t,y:e},this.getCenterPoint(s),Nt(-this.options.rotation));return Lu({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return $n(this,t)}draw(t){t.save(),Ao(t,this.getCenterPoint(),this.options.rotation),Wu(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Uu(t,e)}}Xn.id="boxAnnotation",Xn.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},Xn.defaultRoutes={borderColor:"color",backgroundColor:"color"},Xn.descriptors={label:{_fallback:!0}};const td=["left","bottom","top","right"];class zi extends Vt{inRange(t,e,i,s){const{x:r,y:o}=Mn({x:t,y:e},this.getCenterPoint(s),Nt(-this.rotation));return Lu({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return $n(this,t)}draw(t){const e=this.options,i=!Qt(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Ao(t,this.getCenterPoint(),this.rotation),qx(t,this),Wu(t,this,e),xx(t,tw(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Bu(e))i=ju(t,e);else{const{centerX:a,centerY:l}=Io(t,e);i={x:a,y:l}}const s=Ft(e.padding),r=Lo(t.ctx,e),o=Ux(i,r,e,s);return{initProperties:Bi(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}zi.id="labelAnnotation",zi.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},zi.defaultRoutes={borderColor:"color"};function Ux(n,t,e,i){const s=t.width+i.width+e.borderWidth,r=t.height+i.height+e.borderWidth,o=Eo(e.position,"center"),a=ed(n.x,s,e.xAdjust,o.x),l=ed(n.y,r,e.yAdjust,o.y);return{x:a,y:l,x2:a+s,y2:l+r,width:s,height:r,centerX:a+s/2,centerY:l+r/2}}function ed(n,t,e=0,i){return n-Po(t,i)+e}function qx(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&Qx(t,r);if(!o||ew(t,r,o))return;if(n.save(),n.beginPath(),!rn(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=Xx(t,o),{sideStart:u,sideEnd:d}=Kx(t,o,l);(r.margin>0||s.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 f=Mn({x:e,y:i},t.getCenterPoint(),Nt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function Xx(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=Gx(n,t);let a,l;return t==="left"||t==="right"?(a={x:e+o,y:i},l={x:a.x,y:r}):(a={x:e,y:i+o},l={x:s,y:a.y}),{separatorStart:a,separatorEnd:l}}function Gx(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function Kx(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=Zx(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+sn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+sn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function Zx(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function Qx(n,t){const e=t.position;return td.includes(e)?e:Jx(n,t)}function Jx(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:f}=n,g={x:u,y:d},p=t.start,y=sn(o,p),_=sn(a,p),w=[e,e+y,e+y,s],S=[i+_,r,i,r],v=[];for(let P=0;P<4;P++){const M=Mn({x:w[P],y:S[P]},g,Nt(f));v.push({position:td[P],distance:An(M,{x:l,y:c})})}return v.sort((P,M)=>P.distance-M.distance)[0].position}function tw({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Ft(s.padding);return{x:n+o.left+r,y:t+o.top+r,width:e-o.left-o.right-s.borderWidth,height:i-o.top-o.bottom-s.borderWidth}}function ew(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let o=i,a=s;return e==="left"?o+=r:e==="right"?o-=r:e==="top"?a+=r:e==="bottom"&&(a-=r),n.inRange(o,a)}const Bo=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),zo=(n,t,e)=>Bo(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,nd=(n,t,e)=>Bo(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Hi=n=>n*n,nw=(n,t,{x:e,y:i,x2:s,y2:r},o)=>o==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},id=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Ho=(n,t,e,i)=>({x:id(n.x,t.x,e.x,i),y:id(n.y,t.y,e.y,i)}),sd=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),rd=(n,t,e,i)=>-Math.atan2(sd(n.x,t.x,e.x,i),sd(n.y,t.y,e.y,i))+.5*rt;class Wi extends Vt{inRange(t,e,i,s){const r=this.options.borderWidth/2;if(i!=="x"&&i!=="y"){const o={mouseX:t,mouseY:e},{path:a,ctx:l}=this;if(a){rn(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,f)||Wo(this,o,s);return l.restore(),g}const c=Hi(r);return ow(this,o,c,s)||Wo(this,o,s)}return iw(this,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:s})}getCenterPoint(t){return $n(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!rn(t,a))return t.restore();Un(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return gw(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=ud(this),g=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(g),t.beginPath(),t.moveTo(0+d,0),t.lineTo(l-f,0),t.shadowColor=a.borderShadowColor,t.stroke(),Yo(t,0,d,c),Yo(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=Cx(t,e),{x:s,y:r,x2:o,y2:a}=i,l=sw(i,t.chartArea),c=l?rw({x:s,y:r},{x:o,y:a},t.chartArea):{x:s,y:r,x2:o,y2:a,width:Math.abs(o-s),height:Math.abs(a-r)};if(c.centerX=(o+s)/2,c.centerY=(a+r)/2,c.initProperties=Bi(t,c,e),e.curve){const d={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=fw(c,e,An(d,f))}const u=aw(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Wi.id="lineAnnotation";const od={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};Wi.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},od),fill:!1,length:12,start:Object.assign({},od),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({},zi.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},Wi.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Wi.defaultRoutes={borderColor:"color"};function iw(n,{mouseX:t,mouseY:e},i,{hBorderWidth:s,useFinalPosition:r}){const o=nw(t,e,n.getProps(["x","y","x2","y2"],r),i);return o.value>=o.start-s&&o.value<=o.end+s||Wo(n,{mouseX:t,mouseY:e},r,i)}function sw({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:o,left:a}){return!(n<a&&e<a||n>r&&e>r||t<s&&i<s||t>o&&i>o)}function ad({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=nd(o,{x:n,y:t},e),n=o),n>s&&(t=nd(s,{x:n,y:t},e),n=s),t<i&&(n=zo(i,{x:n,y:t},e),t=i),t>r&&(n=zo(r,{x:n,y:t},e),t=r),{x:n,y:t}}function rw(n,t,e){const{x:i,y:s}=ad(n,t,e),{x:r,y:o}=ad(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function ow(n,{mouseX:t,mouseY:e},i=vn,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Hi(c)+Hi(u),f=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return f<0?(g=r,p=o):f>1?(g=a,p=l):(g=r+f*c,p=o+f*u),Hi(t-g)+Hi(e-p)<=i}function Wo(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function aw(n,t,e){const i=e.borderWidth,s=Ft(e.padding),r=Lo(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return cw(t,e,{width:o,height:a,padding:s},n.chartArea)}function lw(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>rt/2?r-rt:r<rt/-2?r+rt:r}function cw(n,t,e,i){const{width:s,height:r,padding:o}=e,{xAdjust:a,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},d=t.rotation==="auto"?lw(n):Nt(t.rotation),f=uw(s,r,d),g=dw(n,t,{labelSize:f,padding:o},i),p=n.cp?Ho(c,n.cp,u,g):Bo(c,u,g),y={size:f.w,min:i.left,max:i.right,padding:o.left},_={size:f.h,min:i.top,max:i.bottom,padding:o.top},w=cd(p.x,y)+a,S=cd(p.y,_)+l;return{x:w-s/2,y:S-r/2,x2:w+s/2,y2:S+r/2,centerX:w,centerY:S,pointX:p.x,pointY:p.y,width:s,height:r,rotation:Ji(d)}}function uw(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function dw(n,t,e,i){let s;const r=hw(n,i);return t.position==="start"?s=ld({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-ld({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Po(1,t.position),s}function ld(n,t,e,i){const{labelSize:s,padding:r}=t,o=n.w*i.dx,a=n.h*i.dy,l=o>0&&(s.w/2+r.left-i.x)/o,c=a>0&&(s.h/2+r.top-i.y)/a;return Hs(Math.max(l,c),0,.25)}function hw(n,t){const{x:e,x2:i,y:s,y2:r}=n,o=Math.min(s,r)-t.top,a=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(a,c),y:Math.min(o,l),dx:a<=c?1:-1,dy:o<=l?1:-1}}function cd(n,t){const{size:e,min:i,max:s,padding:r}=t,o=e/2;return e>s-i?(s+i)/2:(i>=n-r-o&&(n=i+r+o),s<=n+r+o&&(n=s-r-o),n)}function ud(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:dd(n,e),endAdjust:dd(n,i)}}function dd(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(zo(0,r,{x:0,y:s}))}function Yo(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:o,backgroundColor:a,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Un(n,i),rn(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),o===!0?(n.fillStyle=a||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function fw(n,t,e){const{x:i,y:s,x2:r,y2:o,centerX:a,centerY:l}=n,c=Math.atan2(o-s,r-i),u=Eo(t.controlPoint,0),d={x:a+sn(e,u.x,!1),y:l+sn(e,u.y,!1)};return Mn(d,{x:a,y:l},c)}function hd(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),Yo(n,0,-s,r),n.restore())}function gw(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:f}=ud(t),g={x:s,y:r},p={x:o,y:a},y=rd(g,e,p,0),_=rd(g,e,p,1)-rt,w=Ho(g,e,p,d/i),S=Ho(g,e,p,1-f/i),v=new Path2D;n.beginPath(),v.moveTo(w.x,w.y),v.quadraticCurveTo(e.x,e.y,S.x,S.y),n.shadowColor=l.borderShadowColor,n.stroke(v),t.path=v,t.ctx=n,hd(n,w,{angle:y,adjust:d},c),hd(n,S,{angle:_,adjust:f},u)}class Yi extends Vt{inRange(t,e,i,s){const r=this.options.rotation,o=this.options.borderWidth;if(i!=="x"&&i!=="y")return pw({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,o);const{x:a,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),d=o/2,f=i==="y"?{start:l,end:u}:{start:a,end:c},g=Mn({x:t,y:e},this.getCenterPoint(s),Nt(-r));return g[i]>=f.start-d-vn&&g[i]<=f.end+d+vn}getCenterPoint(t){return $n(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Ao(t,this.getCenterPoint(),o.rotation),Un(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=rn(t,o);t.ellipse(s,r,i/2,e/2,rt/2,0,2*rt),t.fill(),a&&(t.shadowColor=o.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return Uu(t,e)}}Yi.id="ellipseAnnotation",Yi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},Xn.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},Yi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Yi.descriptors={label:{_fallback:!0}};function pw(n,t,e,i){const{width:s,height:r,centerX:o,centerY:a}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Nt(e||0),d=i/2||0,f=Math.cos(u),g=Math.sin(u),p=Math.pow(f*(n.x-o)+g*(n.y-a),2),y=Math.pow(g*(n.x-o)-f*(n.y-a),2);return p/Math.pow(l+d,2)+y/Math.pow(c+d,2)<=1.0001}class js extends Vt{inRange(t,e,i,s){const{x:r,y:o,x2:a,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=this.options.borderWidth;if(i!=="x"&&i!=="y")return fx({x:t,y:e},this.getCenterPoint(s),c/2,u);const d=u/2,f=i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t};return f.value>=f.start-d&&f.value<=f.end+d}getCenterPoint(t){return $n(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Un(t,e);const s=rn(t,e);kx(t,this,this.centerX,this.centerY),s&&!Ys(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=$u(t,e);return i.initProperties=Bi(t,i,e),i}}js.id="pointAnnotation",js.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},js.defaultRoutes={borderColor:"color",backgroundColor:"color"};class $s extends Vt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&yw(this.elements,t,e,s);const r=Mn({x:t,y:e},this.getCenterPoint(s),Nt(-this.options.rotation)),o=this.elements.map(c=>i==="y"?c.bY:c.bX),a=Math.min(...o),l=Math.max(...o);return r[i]>=a&&r[i]<=l}getCenterPoint(t){return $n(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Un(t,i);const s=rn(t,i);let r=!0;for(const o of e)r?(t.moveTo(o.x,o.y),r=!1):t.lineTo(o.x,o.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=$u(t,e),{sides:s,rotation:r}=e,o=[],a=2*rt/s;let l=r*mr;for(let c=0;c<s;c++,l+=a){const u=mw(i,e,l);u.initProperties=Bi(t,i,e),o.push(u)}return i.elements=o,i}}$s.id="polygonAnnotation",$s.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},$s.defaultRoutes={borderColor:"color",backgroundColor:"color"};function mw({centerX:n,centerY:t},{radius:e,borderWidth:i},s){const r=i/2,o=Math.sin(s),a=Math.cos(s),l={x:n+o*e,y:t-a*e};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:n+o*(e+r),bY:t-a*(e+r)}}}function yw(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const o of n){const a=o.getProps(["bX","bY"],i);a.bY>e!=r.bY>e&&t<(r.bX-a.bX)*(e-a.bY)/(r.bY-a.bY)+a.bX&&(s=!s),r=a}return s}const on={box:Xn,ellipse:Yi,label:zi,line:Wi,point:js,polygon:$s};Object.keys(on).forEach(n=>{Tt.describe(`elements.${on[n].id}`,{_fallback:"plugins.annotation.common"})});const bw={update:Object.assign},_w=Fo.concat(Vs),fd=(n,t)=>it(t)?$o(n,t):n,Vo=n=>n==="color"||n==="font";function jo(n="line"){return on[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function xw(n,t,e,i){const s=kw(n,e.animations,i),r=t.annotations,o=Dw(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=gd(o,a,l.type),u=l.setContext(vw(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=ww(d),"elements"in d&&(Sw(c,d.elements,u,s),delete d.elements),Qt(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=pd(u),s.update(c,d)}}function ww(n){return isNaN(n.x)||isNaN(n.y)}function kw(n,t,e){return e==="reset"||e==="none"||e==="resize"?bw:new Pr(n,t)}function Sw(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const o=t[r],a=o.properties,l=gd(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=pd(c),i.update(l,a)}}function gd(n,t,e,i){const s=on[jo(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function pd(n){const t=on[jo(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,$o(n,t.defaults),$o(n,t.defaultRoutes));for(const i of _w)e[i]=n[i];return e}function $o(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];Vo(i)&&ot(r)?e[i]=r.map(o=>fd(o,s)):e[i]=fd(r,s)}return e}function vw(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function Dw(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var Mw="3.0.1";const an=new Map,Tw=Fo.concat(Vs);var md={id:"annotation",version:Mw,beforeRegister(){gx("chart.js","4.0",fe.version)},afterRegister(){fe.register(on)},afterUnregister(){fe.unregister(on)},beforeInit(n){an.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=an.get(n),s=i.annotations=[];let r=e.annotations;it(r)?Object.keys(r).forEach(o=>{const a=r[o];it(a)&&(a.id=o,s.push(a))}):ot(r)&&s.push(...r),Wx(s,n.scales)},afterDataLimits(n,t){const e=an.get(n);Hx(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=an.get(n);Ix(n,i,e),xw(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),zx(n,i,e)},beforeDatasetsDraw(n,t,e){Us(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Us(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){Us(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Us(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=an.get(n);Nx(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){an.delete(n)},_getState(n){return an.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=>!Tw.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${on[jo(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Vo,_fallback:!0},_indexable:Vo}},additionalOptionScopes:[""]};function Us(n,t,e){const{ctx:i,chartArea:s}=n,r=an.get(n);e&&di(i,s);const o=Cw(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)Ow(i,s,r,a);e&&hi(i)}function Cw(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function Ow(n,t,e,i){const s=i.element;i.main?(Zu(e,s,"beforeDraw"),s.draw(n,t),Zu(e,s,"afterDraw")):s.draw(n,t)}const Pw="#6c7489",Ew="#995c00",Rw="20px",yd="24px",Aw="40px",Lw="48px",Iw={class:"tooltip-title"},Nw={class:"title font-bold"},Fw={key:1,class:"subtitle"},Bw={class:"tooltip"},zw={key:0},Hw={class:"display-label"},Ww={class:"display-value"},Yw=h.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=t,i=n,s=h.ref(null),r=h.ref(!1),o=h.ref({x:0,y:0}),a=h.ref({x:0,y:0}),l=h.ref({left:i.left,top:i.top});h.watch(s,g=>{if(g){const{width:p,height:y}=g.getBoundingClientRect();e("dimensions",{width:p,height:y})}}),h.watch(()=>i.locked,g=>{g?(l.value.left=i.left,l.value.top=i.top):g===!1&&(e("top",l.value.top),e("left",l.value.left))});function c(g){if(s.value){r.value=!0;const p=window.getComputedStyle(s.value),y=p.transform||p.webkitTransform||p.mozTransform,_=new DOMMatrix(y),w=_.m41,S=_.m42;o.value={x:w,y:S},a.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",f)}}let u=null;function d(g){g.preventDefault(),g.stopPropagation(),r.value&&(u!==null&&window.cancelAnimationFrame(u),u=window.requestAnimationFrame(()=>{const p=g.clientX-a.value.x,y=g.clientY-a.value.y;l.value.left=`${o.value.x+p}px`,l.value.top=`${o.value.y+y}px`}))}function f(){r.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",f)}return(g,p)=>n.showTooltip?(h.openBlock(),h.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:h.normalizeClass(["tooltip-container",{locked:n.locked}]),style:h.normalizeStyle({transform:n.locked?`translate(${l.value.left}, ${l.value.top})`:`translate(${n.left}, ${n.top})`,left:"0",top:"0",pointerEvents:n.locked?"all":"none"}),onMousedown:c},[h.createElementVNode("div",Iw,[h.createElementVNode("span",Nw,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(pa.DragIcon),{key:0,class:"drag-icon",color:h.unref(Pw)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",Fw,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",Bw,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.series,({backgroundColor:y,borderColor:_,label:w,value:S})=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:w},[n.series.length?(h.openBlock(),h.createElementBlock("li",zw,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:y,"border-color":_})},null,4),h.createElementVNode("span",Hw,h.toDisplayString(w),1),h.createElementVNode("span",Ww,h.toDisplayString(S),1)])):h.createCommentVNode("",!0)],64))),128))])],38)):h.createCommentVNode("",!0)}}),Be=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},Uo=Be(Yw,[["__scopeId","data-v-cd0df662"]]),Vw=["onClick"],jw=["title"],$w={key:0,class:"sub-label"},qo=Be(h.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){h.useCssVars(v=>({"143d7c82":a.value}));const t=n,e=h.ref(),i=h.ref([]),s=h.inject("showLegendValues",!0),r=h.inject("legendPosition",h.ref(Ot.Right)),o=h.ref([]),a=h.ref(yd),l=()=>{const v=e.value;if(!v||!i.value||v.children.length===0)return 0;const P=v.children[0].getBoundingClientRect().top;for(const M of i.value)if(M.getBoundingClientRect().top>P)return!0;return!1},c=h.computed(()=>t.items.length>2||r.value===Ot.Right),u=()=>{e.value&&r.value===Ot.Bottom&&(l()?a.value=Lw:a.value=yd)},d=()=>{if(e.value&&r.value===Ot.Bottom){let v=0;i.value.forEach(M=>{const C=Array.from(M.children).reduce((T,b)=>T+b.offsetWidth,0);C>v&&(v=C)});const P=parseInt(Aw,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${v+P}px)`}u()},f=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let v=0;v<t.items.length;v++)if(t.items[v].text!==o.value[v].text)return o.value=t.items,!0;return!1};h.watch(()=>t.items,()=>{f()&&d()},{immediate:!0,flush:"post"});const g=h.ref(0),p=h.ref(0),y=new ResizeObserver(au(v=>{const P=v[0],M=P.contentRect.width,C=P.contentRect.height;M!==g.value&&C===p.value&&d(),g.value=M,p.value=C},100));h.watch(()=>r.value,()=>{d()}),h.onMounted(()=>{o.value=t.items,e.value&&y.observe(e.value),window.requestAnimationFrame(()=>{d()})}),h.onBeforeUnmount(()=>{e.value&&y.unobserve(e.value)});const _=(v=0,P)=>{if(t.chartInstance===null)return;const M=t.chartInstance instanceof fe?t.chartInstance:t.chartInstance.chart;w(v,P)?M.hide(v,P):M.show(v,P),M.update()},w=(v=0,P)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const M=t.chartInstance instanceof fe?t.chartInstance:t.chartInstance.chart,C=M.getDatasetMeta(v);return C.dataset||P===void 0?M.isDatasetVisible(v):!(C.data.length&&C.data[P].hidden)},S=v=>({[Ot.Right]:"vertical",[Ot.Bottom]:"horizontal",[Ot.Hidden]:"hidden"})[v];return(v,P)=>h.unref(r)!==h.unref(Ot).Hidden?(h.openBlock(),h.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:h.normalizeClass(["legend-container",S(h.unref(r))]),"data-testid":"legend"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(n.items,({fillStyle:M,strokeStyle:C,text:T,datasetIndex:b,index:x,value:D})=>(h.openBlock(),h.createElementBlock("li",{key:T,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:E=>_(b,x)},[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:M,"border-color":C})},null,4),h.createElementVNode("div",{class:h.normalizeClass(["label-container",{"strike-through":!w(b,x)}])},[h.createElementVNode("div",{class:h.normalizeClass(["label",{"truncate-label":c.value}]),title:T},h.toDisplayString(T),11,jw),D&&h.unref(s)?(h.openBlock(),h.createElementBlock("div",$w,h.toDisplayString(D.formatted),1)):h.createCommentVNode("",!0)],2)],8,Vw))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-bf35eae8"]]);let qs;const Uw=new Uint8Array(16);function qw(){if(!qs&&(qs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!qs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return qs(Uw)}const $t=[];for(let n=0;n<256;++n)$t.push((n+256).toString(16).slice(1));function Xw(n,t=0){return $t[n[t+0]]+$t[n[t+1]]+$t[n[t+2]]+$t[n[t+3]]+"-"+$t[n[t+4]]+$t[n[t+5]]+"-"+$t[n[t+6]]+$t[n[t+7]]+"-"+$t[n[t+8]]+$t[n[t+9]]+"-"+$t[n[t+10]]+$t[n[t+11]]+$t[n[t+12]]+$t[n[t+13]]+$t[n[t+14]]+$t[n[t+15]]}const bd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ln(n,t,e){if(bd.randomUUID&&!t&&!n)return bd.randomUUID();n=n||{};const i=n.random||(n.rng||qw)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,t){e=e||0;for(let s=0;s<16;++s)t[e+s]=i[s];return t}return Xw(i)}const _d=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()},xd={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&_d(n,this.clickedElements)},afterEvent:function(n,{event:t}){var s;if(t.type!=="click"||!t.native)return;this.clicked=!this.clicked;const e=((s=n.options.interaction)==null?void 0:s.mode)||"index",i=n.getElementsAtEventForMode(t.native,e,{intersect:!1},!0);i.length&&this.clicked?(this.clickedElements=i,_d(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}},wd=6,Gw="100%",Kw="100%",Zw=20,Qw=20,kd=6,Jw=0,t1=10,e1=10,n1=1,i1=Be(h.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:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{i18n:e}=ft.useI18n(),{translateUnit:i}=ft.useTranslatedUnits(),s=h.ref(null),r=({chart:L},z)=>{var Q;const V=L.data,q=(Q=V.labels)==null?void 0:Q.indexOf(z);return V.datasets.reduce((Y,W,et)=>{if(L.isDatasetVisible(et)){const X=W.data[q];return isNaN(X)?Y:Y+X}else return Y},0)},o=(L,z,V,q)=>{const Q=q==="horizontal";z===null&&(z=e.t("entityNoName"));const Y={type:"label",yValue:X=>Q?z:r(X,z),xValue:X=>Q?r(X,z):z},W={...Y,position:Q?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>Q?0:-Math.abs(Y_()),content:X=>Do(r(X,z),V)},et={...Y,content:X=>Pu(r(X,z),Ou(X.chart,L)),position:Q?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:X=>Q?Cu(Do(r(X,z),V)):0,color:Mu};return{[`${z}-value`]:W,[`${z}-percent`]:et}},a=h.ref(null),l=h.ref(),c=h.ref(ln()),u=ln(),d=ln(),f=h.ref([]),g=h.ref(h.inject("legendPosition",Ot.Right)),p=h.ref({show:!1,top:"0px",left:"0px",text:"",offset:-50}),y=h.toRef(t,"metricUnit"),_=h.computed(()=>h.toRef(t,"orientation").value==="horizontal"),w=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:y,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:_.value?jt.HORIZONTAL_BAR:jt.VERTICAL_BAR,chartTooltipSortFn:t.chartTooltipSortFn}),S=h.ref(0),v=()=>{var L;return t.annotations&&((L=t.chartData.labels)==null?void 0:L.reduce((z,V)=>Object.assign(z,o(t.chartData,V,y.value,t.orientation)),{}))},P={id:c.value,afterUpdate(L){S.value+=1,f.value=L.options.plugins.legend.labels.generateLabels(L).map(z=>({...z,value:t.legendValues&&t.legendValues[z.text]})).sort(t.chartLegendSortFn)}},M={id:u,afterUpdate(L){L.options.plugins.annotation.annotations=t.annotations?v():{}}},b=[P,{id:"axisHover",afterEvent(L,z){if(p.value.show=!1,z.event.type==="mousemove"){const V=z.event,q=L.options.indexAxis,Q=L.scales,Y=L.scales[q].getLabelForValue(Number(L.scales[q].getValueForPixel(V[q])));if((et=>et==="x"?V.y>Q.x.top:V.x<Q.y.right)(q))if(w.locked||(w.showTooltip=!1),Y.length>Fs){const X=L.canvas.getContext("2d").measureText(Y).width,kt=Math.abs(Math.round(V.x-X*.5)),lt=Math.round(V.x+X*.5);p.value.left=q==="x"?`${(kt>0?kt:lt)-p.value.offset}px`:`${V.x-X*.5-p.value.offset}px`,p.value.top=`${V.y-50}px`,p.value.show=!0,p.value.text=Y}else p.value.show=!1;else p.value.show=!1}}},{id:d,afterUpdate(L){L.options.layout.padding.right=_.value?N.value:0}},xd,...t.annotations?[M]:[]],x=h.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),D=h.ref(0),E=h.ref(0),A=new ResizeObserver(au(L=>{D.value=L[0].contentRect.width,E.value=L[0].contentRect.height},100)),F=h.computed(()=>{var z,V;const L=(V=(z=t.chartData)==null?void 0:z.labels)==null?void 0:V.length;return a.value&&L&&!_.value?`${Math.max(L*(Zw+kd),D.value)}px`:Gw}),$=h.computed(()=>{var z,V;const L=(V=(z=t.chartData)==null?void 0:z.labels)==null?void 0:V.length;return a.value&&L&&_.value?`${Math.max(L*(Qw+kd),E.value)}px`:Kw});ft.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey")),h.onMounted(()=>{t.annotations&&fe.register(md),s.value&&(D.value=s.value.offsetWidth,E.value=s.value.offsetHeight,A.observe(s.value))}),h.onUnmounted(()=>{s.value&&A.unobserve(s.value)});const K=h.computed(()=>{const L=ft.useBarChartOptions({tooltipState:w,legendID:c.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle"),indexAxis:_.value?"y":"x",numLabels:x});return{...L.value,plugins:{...L.value.plugins,annotation:{annotations:v(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*wd}}}}),j=ft.useChartJSCommon("bar",a,h.toRef(t,"chartData"),b,K),N=h.computed(()=>{S.value;const L=t.chartData.labels,z=t.chartData.datasets,V=L.map((Y,W)=>z.reduce((et,X)=>isNaN(Number(X.data[W]))?et:et+Number(X.data[W]),0)),q=j.value?Ou(j.value,t.chartData):V_(t.chartData);return V.map(Y=>Cu(Do(Y,y.value)+Pu(Y,q))).reduce((Y,W)=>Math.max(Y,W),0)+wd});h.onBeforeUnmount(()=>{fe.unregister(md)});const st={[Ot.Right]:"legend-row",[Ot.Bottom]:"column"},B=h.computed(()=>{if(l.value&&j.value){const L=window.devicePixelRatio,z=j.value,V=z.scales.y.width*L+n1,q=(z.scales.y.height+z.scales.y.top+z.scales.x.height)*L,Q=l.value.getContext("2d");return Q.scale(L,L),Q.canvas.width=V,Q.canvas.height=q,Q.canvas.style.width=`${V/L}px`,Q.canvas.style.height=`${q/L}px`,{scale:L,width:V*L,height:q*L,targetCtx:Q}}return null}),At=L=>{const z=L.target;if(B.value&&j.value&&!_.value){const V=B.value.scale,q=B.value.targetCtx,Q=B.value.width,Y=B.value.height,W=j.value,et=W.canvas;q.fillStyle="white",z.scrollLeft>=Jw&&z.scrollLeft<=t1?(q.globalCompositeOperation="source-over",q.clearRect(0,0,Q,Y),q.drawImage(et,0,0,Q,Y,0,0,Q,Y),q.globalCompositeOperation="destination-over",q.fillRect(0,0,Q,Y)):(q.globalCompositeOperation="source-over",q.fillRect(0,(W.scales.y.height+W.scales.y.top+e1)*V,Q,W.scales.x.height*V))}w.offsetY=z.scrollTop,w.offsetX=z.scrollLeft,p.value.offset=z.scrollLeft},wt=({width:L,height:z})=>{w.width=L,w.height=z};h.watch(()=>t.orientation,()=>{var L;if(l.value&&B.value){const z=B.value.width,V=B.value.height;((L=l.value)==null?void 0:L.getContext("2d")).clearRect(0,0,z,V)}w.showTooltip=!1,w.locked=!1}),h.watch(()=>t.annotations,L=>{j.value&&(L?j.value.options.plugins.annotation.annotations=v(t.chartData):delete j.value.options.plugins.annotation.annotations)});const H=()=>{w.showTooltip&&(w.locked=!w.locked)};return(L,z)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",st[g.value]])},[h.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),h.createElementVNode("div",{ref_key:"chartContainerRef",ref:s,class:"chart-container","on:scroll":At,onClick:z[0]||(z[0]=V=>H())},[h.createElementVNode("div",{class:"chart-body",style:h.normalizeStyle({width:F.value,height:$.value})},[h.createElementVNode("canvas",{ref_key:"canvas",ref:a},null,512)],4)],544),p.value.show?(h.openBlock(),h.createElementBlock("div",{key:0,class:"axis-tooltip",style:h.normalizeStyle({top:p.value.top,left:p.value.left})},h.toDisplayString(p.value.text),5)):h.createCommentVNode("",!0),h.createVNode(Uo,{context:w.tooltipContext,left:w.left,locked:w.locked,series:w.tooltipSeries,"show-tooltip":w.showTooltip,"tooltip-title":n.tooltipTitle,top:w.top,onDimensions:wt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),h.createVNode(qo,{id:c.value,"chart-instance":h.unref(j),items:f.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6420fe94"]]);/*!
25
24
  * chartjs-adapter-date-fns v3.0.0
26
25
  * https://www.chartjs.org
27
26
  * (c) 2022 chartjs-adapter-date-fns Contributors
28
27
  * Released under the MIT license
29
- */const hM={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"};du._date.override({_id:"date-fns",formats:function(){return hM},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=nt(n):e==="string"&&(typeof t=="string"?n=o_(n,t,new Date,this.options):n=Qd(n,this.options)),Cs(n)?n.getTime():null},format:function(n,t){return lx(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Gr(n,t);case"second":return Uv(n,t);case"minute":return Nv(n,t);case"hour":return Ev(n,t);case"day":return Md(n,t);case"week":return Bv(n,t);case"month":return Ss(n,t);case"quarter":return Fv(n,t);case"year":return Wv(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Qi(n,t);case"second":return Kv(n,t);case"minute":return qv(n,t);case"hour":return Vv(n,t);case"day":return kd(n,t);case"week":return Qv(n,t);case"month":return Ed(n,t);case"quarter":return Gv(n,t);case"year":return Zv(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return u_(n);case"minute":return Jv(n);case"hour":return c_(n);case"day":return ks(n);case"week":return Dd(n);case"isoWeek":return Dd(n,{weekStartsOn:+e});case"month":return eb(n);case"quarter":return tb(n);case"year":return rb(n);default:return n}},endOf:function(n,t){switch(t){case"second":return lb(n);case"minute":return sb(n);case"hour":return ib(n);case"day":return Od(n);case"week":return ab(n);case"month":return Pd(n);case"quarter":return ob(n);case"year":return nb(n);default:return n}}});const Mh={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},pM={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Mh,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},gM=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function pr(n){return h.isProxy(n)?h.toRaw(n):n}function mM(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function yM(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Dh(n,t){n.labels=t}function Sh(n,t,e){const r=[];n.datasets=t.map(i=>{const a=n.datasets.find(s=>s[e]===i[e]);return!a||!i.data||r.includes(a)?{...i}:(r.push(a),Object.assign(a,i),a)})}function vM(n,t){const e={labels:[],datasets:[]};return Dh(e,n.labels),Sh(e,n.datasets,t),e}const bM=h.defineComponent({props:pM,setup(n,t){let{expose:e,slots:r}=t;const i=h.ref(null),a=h.shallowRef(null);e({chart:a});const s=()=>{if(!i.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:p}=n,y=vM(u,p),x=mM(y,u);a.value=new Me(i.value,{type:c,data:x,options:{...d},plugins:f})},o=()=>{const c=h.toRaw(a.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),a.value=null},n.destroyDelay):(c.destroy(),a.value=null))},l=c=>{c.update(n.updateMode)};return h.onMounted(s),h.onUnmounted(o),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[p,y]=u;const x=h.toRaw(a.value);if(!x)return;let g=!1;if(d){const m=pr(d),v=pr(p);m&&m!==v&&(yM(x,m),g=!0)}if(f){const m=pr(f.labels),v=pr(y.labels),b=pr(f.datasets),w=pr(y.datasets);m!==v&&(Dh(x.config.data,m),g=!0),b&&b!==w&&(Sh(x.config.data,b,n.datasetIdKey),g=!0)}g&&h.nextTick(()=>{l(x)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:i},[h.h("p",{},[r.default?r.default():""])])}});function Jo(n,t){return Me.register(t),h.defineComponent({props:Mh,setup(e,r){let{expose:i}=r;const a=h.shallowRef(null),s=o=>{a.value=o==null?void 0:o.chart};return i({chart:a}),()=>h.h(bM,gM({ref:s},{type:n,...e}))}})}const xM=Jo("bar",Lr),kh=Jo("doughnut",pn),_M=Jo("line",Ir),wM={class:"chart-container"},TM=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Wt.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Qe}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),r=h.ref(Tn()),i=h.ref(Tn()),a=h.ref([]),s=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:ee.DOUGHNUT}),o={id:r.value,afterUpdate(x){a.value=x.options.plugins.legend.labels.generateLabels(x).map(g=>({...g,value:t.legendValues&&t.legendValues[g.text],hidden:!1}))}},l=h.computed(()=>[o]),c=h.computed(()=>[t.chartData.datasets.reduce((g,m)=>(g.labels.push(m.label),g.backgroundColor.push(m.backgroundColor),g.borderColor.push(Sf(m.backgroundColor,50)),g.data.push(m.data.reduce((v,b)=>v+b,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=St.useDoughnutChartOptions({tooltipState:s,legendID:r.value}),f=h.ref(),p=x=>({[Wt.Right]:"legend-row",[Wt.Bottom]:"column",[Wt.Hidden]:"hidden"})[x],y=({width:x,height:g})=>{s.width=x,s.height=g};return(x,g)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",p(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",wM,[h.createVNode(h.unref(kh),{ref_key:"chartInstance",ref:f,"chart-id":i.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(Qo,{left:s.left,series:s.tooltipSeries,"show-tooltip":s.showTooltip,"tooltip-title":n.tooltipTitle,top:s.top,unit:n.metricUnit,onDimensions:y},null,8,["left","series","show-tooltip","tooltip-title","top","unit"])]),h.createVNode(Zo,{id:r.value,"chart-instance":f.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),MM=Ze(TM,[["__scopeId","data-v-07ea8b82"]]);var DM=Object.defineProperty,SM=(n,t,e)=>t in n?DM(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,We=(n,t,e)=>SM(n,typeof t!="symbol"?t+"":t,e),Yt=(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))(Yt||{});const kM=["secondly","minutely","hourly","daily","weekly","trend"],ui=n=>n.filter(t=>t!=="time"),Ch=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],CM=ui(Ch),Oh=[...Ch,"application","consumer","iso_code"],OM=ui(Oh),PM=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],EM=ui(PM),RM=[...Oh,"auth_type","client_ip","consumer_group","country_code","header_host","header_user_agent","http_method","request_id","response_header_content_type","response_source","request_uri","service_port","service_protocol","sse","upstream_status_code","upstream_status_code_grouped","upstream_uri","websocket"];ui(RM),ui(["latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","response_body_size","request_body_size","ai_count"]),new Set(CM),new Set(OM),new Set(EM);function tl(n){"@babel/helpers - typeof";return tl=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},tl(n)}function ya(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 ze(n,t){if(t.length<n)throw new TypeError(n+" argument"+(n>1?"s":"")+" required, but only "+t.length+" present")}function gr(n){ze(1,arguments);var t=Object.prototype.toString.call(n);return n instanceof Date||tl(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 Ph(n,t){ze(2,arguments);var e=gr(n),r=ya(t);return isNaN(r)?new Date(NaN):(r&&e.setDate(e.getDate()+r),e)}function AM(n,t){ze(2,arguments);var e=gr(n),r=ya(t);if(isNaN(r))return new Date(NaN);if(!r)return e;var i=e.getDate(),a=new Date(e.getTime());a.setMonth(e.getMonth()+r+1,0);var s=a.getDate();return i>=s?a:(e.setFullYear(a.getFullYear(),a.getMonth(),i),e)}var LM={};function IM(){return LM}function va(n,t){var e,r,i,a,s,o,l,c;ze(1,arguments);var u=IM(),d=ya((e=(r=(i=(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&&i!==void 0?i:u.weekStartsOn)!==null&&r!==void 0?r:(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 f=gr(n),p=f.getDay(),y=(p<d?7:0)+p-d;return f.setDate(f.getDate()-y),f.setHours(0,0,0,0),f}function Eh(n){ze(1,arguments);var t=gr(n);return t.setHours(0,0,0,0),t}var NM=60,FM=3600;function mr(n){ze(1,arguments);var t=gr(n);return t.setDate(1),t.setHours(0,0,0,0),t}function UM(n){ze(1,arguments);var t=gr(n),e=t.getFullYear(),r=t.getMonth(),i=new Date(0);return i.setFullYear(e,r+1,0),i.setHours(0,0,0,0),i.getDate()}function BM(n){return ze(1,arguments),Math.floor(n*FM)}function WM(n){ze(1,arguments);var t=n/NM;return Math.floor(t)}function Rh(n,t){ze(2,arguments);var e=ya(t);return AM(n,-e)}function el(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ah={exports:{}},Lh={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})(Lh);var Ht=Lh.exports,nl={exports:{}},rl={exports:{}},Ih={exports:{}};(function(n){function t(e){"@babel/helpers - typeof";return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},n.exports.__esModule=!0,n.exports.default=n.exports,t(e)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Ih);var Nh=Ih.exports,il={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(i.length<r)throw new TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+i.length+" present")}n.exports=t.default})(il,il.exports);var oe=il.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Nh),i=e(oe);function a(s){return(0,i.default)(1,arguments),s instanceof Date||(0,r.default)(s)==="object"&&Object.prototype.toString.call(s)==="[object Date]"}n.exports=t.default})(rl,rl.exports);var zM=rl.exports,al={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Nh),i=e(oe);function a(s){(0,i.default)(1,arguments);var o=Object.prototype.toString.call(s);return s instanceof Date||(0,r.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})(al,al.exports);var Ye=al.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(zM),i=e(Ye),a=e(oe);function s(o){if((0,a.default)(1,arguments),!(0,r.default)(o)&&typeof o!="number")return!1;var l=(0,i.default)(o);return!isNaN(Number(l))}n.exports=t.default})(nl,nl.exports);var YM=nl.exports,sl={exports:{}},ol={exports:{}},ll={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){if(r===null||r===!0||r===!1)return NaN;var i=Number(r);return isNaN(i)?i:i<0?Math.ceil(i):Math.floor(i)}n.exports=t.default})(ll,ll.exports);var jn=ll.exports;const HM=el(jn);(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(jn),i=e(Ye),a=e(oe);function s(o,l){(0,a.default)(2,arguments);var c=(0,i.default)(o).getTime(),u=(0,r.default)(l);return new Date(c+u)}n.exports=t.default})(ol,ol.exports);var $M=ol.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e($M),i=e(oe),a=e(jn);function s(o,l){(0,i.default)(2,arguments);var c=(0,a.default)(l);return(0,r.default)(o,-c)}n.exports=t.default})(sl,sl.exports);var jM=sl.exports,cl={exports:{}},ul={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Ye),i=e(oe),a=864e5;function s(o){(0,i.default)(1,arguments);var l=(0,r.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})(ul,ul.exports);var VM=ul.exports,dl={exports:{}},fl={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var r=e(Ye),i=e(oe);function a(s){(0,i.default)(1,arguments);var o=1,l=(0,r.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})(fl,fl.exports);var hl=fl.exports,pl={exports:{}},gl={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Ye),i=e(oe),a=e(hl);function s(o){(0,i.default)(1,arguments);var l=(0,r.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),f=new Date(0);f.setUTCFullYear(c,0,4),f.setUTCHours(0,0,0,0);var p=(0,a.default)(f);return l.getTime()>=d.getTime()?c+1:l.getTime()>=p.getTime()?c:c-1}n.exports=t.default})(gl,gl.exports);var Fh=gl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;var r=e(Fh),i=e(hl),a=e(oe);function s(o){(0,a.default)(1,arguments);var l=(0,r.default)(o),c=new Date(0);c.setUTCFullYear(l,0,4),c.setUTCHours(0,0,0,0);var u=(0,i.default)(c);return u}n.exports=t.default})(pl,pl.exports);var qM=pl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(hl),a=e(qM),s=e(oe),o=6048e5;function l(c){(0,s.default)(1,arguments);var u=(0,r.default)(c),d=(0,i.default)(u).getTime()-(0,a.default)(u).getTime();return Math.round(d/o)+1}n.exports=t.default})(dl,dl.exports);var XM=dl.exports,ml={exports:{}},yl={exports:{}},Vn={};Object.defineProperty(Vn,"__esModule",{value:!0}),Vn.getDefaultOptions=GM,Vn.setDefaultOptions=KM;var Uh={};function GM(){return Uh}function KM(n){Uh=n}(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var r=e(Ye),i=e(oe),a=e(jn),s=Vn;function o(l,c){var u,d,f,p,y,x,g,m;(0,i.default)(1,arguments);var v=(0,s.getDefaultOptions)(),b=(0,a.default)((u=(d=(f=(p=c==null?void 0:c.weekStartsOn)!==null&&p!==void 0?p:c==null||(y=c.locale)===null||y===void 0||(x=y.options)===null||x===void 0?void 0:x.weekStartsOn)!==null&&f!==void 0?f:v.weekStartsOn)!==null&&d!==void 0?d:(g=v.locale)===null||g===void 0||(m=g.options)===null||m===void 0?void 0:m.weekStartsOn)!==null&&u!==void 0?u:0);if(!(b>=0&&b<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var w=(0,r.default)(l),T=w.getUTCDay(),S=(T<b?7:0)+T-b;return w.setUTCDate(w.getUTCDate()-S),w.setUTCHours(0,0,0,0),w}n.exports=t.default})(yl,yl.exports);var vl=yl.exports,bl={exports:{}},xl={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(oe),a=e(vl),s=e(jn),o=Vn;function l(c,u){var d,f,p,y,x,g,m,v;(0,i.default)(1,arguments);var b=(0,r.default)(c),w=b.getUTCFullYear(),T=(0,o.getDefaultOptions)(),S=(0,s.default)((d=(f=(p=(y=u==null?void 0:u.firstWeekContainsDate)!==null&&y!==void 0?y:u==null||(x=u.locale)===null||x===void 0||(g=x.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&p!==void 0?p:T.firstWeekContainsDate)!==null&&f!==void 0?f:(m=T.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var C=new Date(0);C.setUTCFullYear(w+1,0,S),C.setUTCHours(0,0,0,0);var M=(0,a.default)(C,u),D=new Date(0);D.setUTCFullYear(w,0,S),D.setUTCHours(0,0,0,0);var O=(0,a.default)(D,u);return b.getTime()>=M.getTime()?w+1:b.getTime()>=O.getTime()?w:w-1}n.exports=t.default})(xl,xl.exports);var Bh=xl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Bh),i=e(oe),a=e(vl),s=e(jn),o=Vn;function l(c,u){var d,f,p,y,x,g,m,v;(0,i.default)(1,arguments);var b=(0,o.getDefaultOptions)(),w=(0,s.default)((d=(f=(p=(y=u==null?void 0:u.firstWeekContainsDate)!==null&&y!==void 0?y:u==null||(x=u.locale)===null||x===void 0||(g=x.options)===null||g===void 0?void 0:g.firstWeekContainsDate)!==null&&p!==void 0?p:b.firstWeekContainsDate)!==null&&f!==void 0?f:(m=b.locale)===null||m===void 0||(v=m.options)===null||v===void 0?void 0:v.firstWeekContainsDate)!==null&&d!==void 0?d:1),T=(0,r.default)(c,u),S=new Date(0);S.setUTCFullYear(T,0,w),S.setUTCHours(0,0,0,0);var C=(0,a.default)(S,u);return C}n.exports=t.default})(bl,bl.exports);var QM=bl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var r=e(Ye),i=e(vl),a=e(QM),s=e(oe),o=6048e5;function l(c,u){(0,s.default)(1,arguments);var d=(0,r.default)(c),f=(0,i.default)(d,u).getTime()-(0,a.default)(d,u).getTime();return Math.round(f/o)+1}n.exports=t.default})(ml,ml.exports);var ZM=ml.exports,_l={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){for(var a=r<0?"-":"",s=Math.abs(r).toString();s.length<i;)s="0"+s;return a+s}n.exports=t.default})(_l,_l.exports);var Wh=_l.exports,wl={exports:{}};(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(Wh),i={y:function(s,o){var l=s.getUTCFullYear(),c=l>0?l:1-l;return(0,r.default)(o==="yy"?c%100:c,o.length)},M:function(s,o){var l=s.getUTCMonth();return o==="M"?String(l+1):(0,r.default)(l+1,2)},d:function(s,o){return(0,r.default)(s.getUTCDate(),o.length)},a:function(s,o){var l=s.getUTCHours()/12>=1?"pm":"am";switch(o){case"a":case"aa":return l.toUpperCase();case"aaa":return l;case"aaaaa":return l[0];case"aaaa":default:return l==="am"?"a.m.":"p.m."}},h:function(s,o){return(0,r.default)(s.getUTCHours()%12||12,o.length)},H:function(s,o){return(0,r.default)(s.getUTCHours(),o.length)},m:function(s,o){return(0,r.default)(s.getUTCMinutes(),o.length)},s:function(s,o){return(0,r.default)(s.getUTCSeconds(),o.length)},S:function(s,o){var l=o.length,c=s.getUTCMilliseconds(),u=Math.floor(c*Math.pow(10,l-3));return(0,r.default)(u,o.length)}},a=i;t.default=a,n.exports=t.default})(wl,wl.exports);var JM=wl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(VM),i=e(XM),a=e(Fh),s=e(ZM),o=e(Bh),l=e(Wh),c=e(JM),u={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},d={G:function(g,m,v){var b=g.getUTCFullYear()>0?1:0;switch(m){case"G":case"GG":case"GGG":return v.era(b,{width:"abbreviated"});case"GGGGG":return v.era(b,{width:"narrow"});case"GGGG":default:return v.era(b,{width:"wide"})}},y:function(g,m,v){if(m==="yo"){var b=g.getUTCFullYear(),w=b>0?b:1-b;return v.ordinalNumber(w,{unit:"year"})}return c.default.y(g,m)},Y:function(g,m,v,b){var w=(0,o.default)(g,b),T=w>0?w:1-w;if(m==="YY"){var S=T%100;return(0,l.default)(S,2)}return m==="Yo"?v.ordinalNumber(T,{unit:"year"}):(0,l.default)(T,m.length)},R:function(g,m){var v=(0,a.default)(g);return(0,l.default)(v,m.length)},u:function(g,m){var v=g.getUTCFullYear();return(0,l.default)(v,m.length)},Q:function(g,m,v){var b=Math.ceil((g.getUTCMonth()+1)/3);switch(m){case"Q":return String(b);case"QQ":return(0,l.default)(b,2);case"Qo":return v.ordinalNumber(b,{unit:"quarter"});case"QQQ":return v.quarter(b,{width:"abbreviated",context:"formatting"});case"QQQQQ":return v.quarter(b,{width:"narrow",context:"formatting"});case"QQQQ":default:return v.quarter(b,{width:"wide",context:"formatting"})}},q:function(g,m,v){var b=Math.ceil((g.getUTCMonth()+1)/3);switch(m){case"q":return String(b);case"qq":return(0,l.default)(b,2);case"qo":return v.ordinalNumber(b,{unit:"quarter"});case"qqq":return v.quarter(b,{width:"abbreviated",context:"standalone"});case"qqqqq":return v.quarter(b,{width:"narrow",context:"standalone"});case"qqqq":default:return v.quarter(b,{width:"wide",context:"standalone"})}},M:function(g,m,v){var b=g.getUTCMonth();switch(m){case"M":case"MM":return c.default.M(g,m);case"Mo":return v.ordinalNumber(b+1,{unit:"month"});case"MMM":return v.month(b,{width:"abbreviated",context:"formatting"});case"MMMMM":return v.month(b,{width:"narrow",context:"formatting"});case"MMMM":default:return v.month(b,{width:"wide",context:"formatting"})}},L:function(g,m,v){var b=g.getUTCMonth();switch(m){case"L":return String(b+1);case"LL":return(0,l.default)(b+1,2);case"Lo":return v.ordinalNumber(b+1,{unit:"month"});case"LLL":return v.month(b,{width:"abbreviated",context:"standalone"});case"LLLLL":return v.month(b,{width:"narrow",context:"standalone"});case"LLLL":default:return v.month(b,{width:"wide",context:"standalone"})}},w:function(g,m,v,b){var w=(0,s.default)(g,b);return m==="wo"?v.ordinalNumber(w,{unit:"week"}):(0,l.default)(w,m.length)},I:function(g,m,v){var b=(0,i.default)(g);return m==="Io"?v.ordinalNumber(b,{unit:"week"}):(0,l.default)(b,m.length)},d:function(g,m,v){return m==="do"?v.ordinalNumber(g.getUTCDate(),{unit:"date"}):c.default.d(g,m)},D:function(g,m,v){var b=(0,r.default)(g);return m==="Do"?v.ordinalNumber(b,{unit:"dayOfYear"}):(0,l.default)(b,m.length)},E:function(g,m,v){var b=g.getUTCDay();switch(m){case"E":case"EE":case"EEE":return v.day(b,{width:"abbreviated",context:"formatting"});case"EEEEE":return v.day(b,{width:"narrow",context:"formatting"});case"EEEEEE":return v.day(b,{width:"short",context:"formatting"});case"EEEE":default:return v.day(b,{width:"wide",context:"formatting"})}},e:function(g,m,v,b){var w=g.getUTCDay(),T=(w-b.weekStartsOn+8)%7||7;switch(m){case"e":return String(T);case"ee":return(0,l.default)(T,2);case"eo":return v.ordinalNumber(T,{unit:"day"});case"eee":return v.day(w,{width:"abbreviated",context:"formatting"});case"eeeee":return v.day(w,{width:"narrow",context:"formatting"});case"eeeeee":return v.day(w,{width:"short",context:"formatting"});case"eeee":default:return v.day(w,{width:"wide",context:"formatting"})}},c:function(g,m,v,b){var w=g.getUTCDay(),T=(w-b.weekStartsOn+8)%7||7;switch(m){case"c":return String(T);case"cc":return(0,l.default)(T,m.length);case"co":return v.ordinalNumber(T,{unit:"day"});case"ccc":return v.day(w,{width:"abbreviated",context:"standalone"});case"ccccc":return v.day(w,{width:"narrow",context:"standalone"});case"cccccc":return v.day(w,{width:"short",context:"standalone"});case"cccc":default:return v.day(w,{width:"wide",context:"standalone"})}},i:function(g,m,v){var b=g.getUTCDay(),w=b===0?7:b;switch(m){case"i":return String(w);case"ii":return(0,l.default)(w,m.length);case"io":return v.ordinalNumber(w,{unit:"day"});case"iii":return v.day(b,{width:"abbreviated",context:"formatting"});case"iiiii":return v.day(b,{width:"narrow",context:"formatting"});case"iiiiii":return v.day(b,{width:"short",context:"formatting"});case"iiii":default:return v.day(b,{width:"wide",context:"formatting"})}},a:function(g,m,v){var b=g.getUTCHours(),w=b/12>=1?"pm":"am";switch(m){case"a":case"aa":return v.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"aaa":return v.dayPeriod(w,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return v.dayPeriod(w,{width:"narrow",context:"formatting"});case"aaaa":default:return v.dayPeriod(w,{width:"wide",context:"formatting"})}},b:function(g,m,v){var b=g.getUTCHours(),w;switch(b===12?w=u.noon:b===0?w=u.midnight:w=b/12>=1?"pm":"am",m){case"b":case"bb":return v.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"bbb":return v.dayPeriod(w,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return v.dayPeriod(w,{width:"narrow",context:"formatting"});case"bbbb":default:return v.dayPeriod(w,{width:"wide",context:"formatting"})}},B:function(g,m,v){var b=g.getUTCHours(),w;switch(b>=17?w=u.evening:b>=12?w=u.afternoon:b>=4?w=u.morning:w=u.night,m){case"B":case"BB":case"BBB":return v.dayPeriod(w,{width:"abbreviated",context:"formatting"});case"BBBBB":return v.dayPeriod(w,{width:"narrow",context:"formatting"});case"BBBB":default:return v.dayPeriod(w,{width:"wide",context:"formatting"})}},h:function(g,m,v){if(m==="ho"){var b=g.getUTCHours()%12;return b===0&&(b=12),v.ordinalNumber(b,{unit:"hour"})}return c.default.h(g,m)},H:function(g,m,v){return m==="Ho"?v.ordinalNumber(g.getUTCHours(),{unit:"hour"}):c.default.H(g,m)},K:function(g,m,v){var b=g.getUTCHours()%12;return m==="Ko"?v.ordinalNumber(b,{unit:"hour"}):(0,l.default)(b,m.length)},k:function(g,m,v){var b=g.getUTCHours();return b===0&&(b=24),m==="ko"?v.ordinalNumber(b,{unit:"hour"}):(0,l.default)(b,m.length)},m:function(g,m,v){return m==="mo"?v.ordinalNumber(g.getUTCMinutes(),{unit:"minute"}):c.default.m(g,m)},s:function(g,m,v){return m==="so"?v.ordinalNumber(g.getUTCSeconds(),{unit:"second"}):c.default.s(g,m)},S:function(g,m){return c.default.S(g,m)},X:function(g,m,v,b){var w=b._originalDate||g,T=w.getTimezoneOffset();if(T===0)return"Z";switch(m){case"X":return p(T);case"XXXX":case"XX":return y(T);case"XXXXX":case"XXX":default:return y(T,":")}},x:function(g,m,v,b){var w=b._originalDate||g,T=w.getTimezoneOffset();switch(m){case"x":return p(T);case"xxxx":case"xx":return y(T);case"xxxxx":case"xxx":default:return y(T,":")}},O:function(g,m,v,b){var w=b._originalDate||g,T=w.getTimezoneOffset();switch(m){case"O":case"OO":case"OOO":return"GMT"+f(T,":");case"OOOO":default:return"GMT"+y(T,":")}},z:function(g,m,v,b){var w=b._originalDate||g,T=w.getTimezoneOffset();switch(m){case"z":case"zz":case"zzz":return"GMT"+f(T,":");case"zzzz":default:return"GMT"+y(T,":")}},t:function(g,m,v,b){var w=b._originalDate||g,T=Math.floor(w.getTime()/1e3);return(0,l.default)(T,m.length)},T:function(g,m,v,b){var w=b._originalDate||g,T=w.getTime();return(0,l.default)(T,m.length)}};function f(g,m){var v=g>0?"-":"+",b=Math.abs(g),w=Math.floor(b/60),T=b%60;if(T===0)return v+String(w);var S=m||"";return v+String(w)+S+(0,l.default)(T,2)}function p(g,m){if(g%60===0){var v=g>0?"-":"+";return v+(0,l.default)(Math.abs(g)/60,2)}return y(g,m)}function y(g,m){var v=m||"",b=g>0?"-":"+",w=Math.abs(g),T=(0,l.default)(Math.floor(w/60),2),S=(0,l.default)(w%60,2);return b+T+v+S}var x=d;t.default=x,n.exports=t.default})(cl,cl.exports);var tD=cl.exports,Tl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(o,l){switch(o){case"P":return l.date({width:"short"});case"PP":return l.date({width:"medium"});case"PPP":return l.date({width:"long"});case"PPPP":default:return l.date({width:"full"})}},r=function(o,l){switch(o){case"p":return l.time({width:"short"});case"pp":return l.time({width:"medium"});case"ppp":return l.time({width:"long"});case"pppp":default:return l.time({width:"full"})}},i=function(o,l){var c=o.match(/(P+)(p+)?/)||[],u=c[1],d=c[2];if(!d)return e(o,l);var f;switch(u){case"P":f=l.dateTime({width:"short"});break;case"PP":f=l.dateTime({width:"medium"});break;case"PPP":f=l.dateTime({width:"long"});break;case"PPPP":default:f=l.dateTime({width:"full"});break}return f.replace("{{date}}",e(u,l)).replace("{{time}}",r(d,l))},a={p:r,P:i},s=a;t.default=s,n.exports=t.default})(Tl,Tl.exports);var eD=Tl.exports,Ml={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){var i=new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()));return i.setUTCFullYear(r.getFullYear()),r.getTime()-i.getTime()}n.exports=t.default})(Ml,Ml.exports);var zh=Ml.exports;const Yh=el(zh);var di={};Object.defineProperty(di,"__esModule",{value:!0}),di.isProtectedDayOfYearToken=iD,di.isProtectedWeekYearToken=aD,di.throwProtectedError=sD;var nD=["D","DD"],rD=["YY","YYYY"];function iD(n){return nD.indexOf(n)!==-1}function aD(n){return rD.indexOf(n)!==-1}function sD(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 Dl={exports:{}},Sl={exports:{}},kl={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"}},r=function(a,s,o){var l,c=e[a];return typeof c=="string"?l=c:s===1?l=c.one:l=c.other.replace("{{count}}",s.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+l:l+" ago":l},i=r;t.default=i,n.exports=t.default})(kl,kl.exports);var oD=kl.exports,Cl={exports:{}},Ol={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=i.width?String(i.width):r.defaultWidth,s=r.formats[a]||r.formats[r.defaultWidth];return s}}n.exports=t.default})(Ol,Ol.exports);var lD=Ol.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(lD),i={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,r.default)({formats:i,defaultWidth:"full"}),time:(0,r.default)({formats:a,defaultWidth:"full"}),dateTime:(0,r.default)({formats:s,defaultWidth:"full"})},l=o;t.default=l,n.exports=t.default})(Cl,Cl.exports);var cD=Cl.exports,Pl={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"},r=function(a,s,o,l){return e[a]},i=r;t.default=i,n.exports=t.default})(Pl,Pl.exports);var uD=Pl.exports,El={exports:{}},Rl={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i,a){var s=a!=null&&a.context?String(a.context):"standalone",o;if(s==="formatting"&&r.formattingValues){var l=r.defaultFormattingWidth||r.defaultWidth,c=a!=null&&a.width?String(a.width):l;o=r.formattingValues[c]||r.formattingValues[l]}else{var u=r.defaultWidth,d=a!=null&&a.width?String(a.width):r.defaultWidth;o=r.values[d]||r.values[u]}var f=r.argumentCallback?r.argumentCallback(i):i;return o[f]}}n.exports=t.default})(Rl,Rl.exports);var dD=Rl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(dD),i={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 x=Number(p),g=x%100;if(g>20||g<10)switch(g%10){case 1:return x+"st";case 2:return x+"nd";case 3:return x+"rd"}return x+"th"},d={ordinalNumber:u,era:(0,r.default)({values:i,defaultWidth:"wide"}),quarter:(0,r.default)({values:a,defaultWidth:"wide",argumentCallback:function(p){return p-1}}),month:(0,r.default)({values:s,defaultWidth:"wide"}),day:(0,r.default)({values:o,defaultWidth:"wide"}),dayPeriod:(0,r.default)({values:l,defaultWidth:"wide",formattingValues:c,defaultFormattingWidth:"wide"})},f=d;t.default=f,n.exports=t.default})(El,El.exports);var fD=El.exports,Al={exports:{}},Ll={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],f=l&&a.parsePatterns[l]||a.parsePatterns[a.defaultParseWidth],p=Array.isArray(f)?i(f,function(g){return g.test(d)}):r(f,function(g){return g.test(d)}),y;y=a.valueCallback?a.valueCallback(p):p,y=o.valueCallback?o.valueCallback(y):y;var x=s.slice(d.length);return{value:y,rest:x}}}function r(a,s){for(var o in a)if(a.hasOwnProperty(o)&&s(a[o]))return o}function i(a,s){for(var o=0;o<a.length;o++)if(s(a[o]))return o}n.exports=t.default})(Ll,Ll.exports);var hD=Ll.exports,Il={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r){return function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=i.match(r.matchPattern);if(!s)return null;var o=s[0],l=i.match(r.parsePattern);if(!l)return null;var c=r.valueCallback?r.valueCallback(l[0]):l[0];c=a.valueCallback?a.valueCallback(c):c;var u=i.slice(o.length);return{value:c,rest:u}}}n.exports=t.default})(Il,Il.exports);var pD=Il.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(hD),i=e(pD),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},f={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]},p={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},y={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]},x={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},g={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,i.default)({matchPattern:a,parsePattern:s,valueCallback:function(b){return parseInt(b,10)}}),era:(0,r.default)({matchPatterns:o,defaultMatchWidth:"wide",parsePatterns:l,defaultParseWidth:"any"}),quarter:(0,r.default)({matchPatterns:c,defaultMatchWidth:"wide",parsePatterns:u,defaultParseWidth:"any",valueCallback:function(b){return b+1}}),month:(0,r.default)({matchPatterns:d,defaultMatchWidth:"wide",parsePatterns:f,defaultParseWidth:"any"}),day:(0,r.default)({matchPatterns:p,defaultMatchWidth:"wide",parsePatterns:y,defaultParseWidth:"any"}),dayPeriod:(0,r.default)({matchPatterns:x,defaultMatchWidth:"any",parsePatterns:g,defaultParseWidth:"any"})},v=m;t.default=v,n.exports=t.default})(Al,Al.exports);var gD=Al.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(oD),i=e(cD),a=e(uD),s=e(fD),o=e(gD),l={code:"en-US",formatDistance:r.default,formatLong:i.default,formatRelative:a.default,localize:s.default,match:o.default,options:{weekStartsOn:0,firstWeekContainsDate:1}},c=l;t.default=c,n.exports=t.default})(Sl,Sl.exports);var mD=Sl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=e(mD),i=r.default;t.default=i,n.exports=t.default})(Dl,Dl.exports);var yD=Dl.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=b;var r=e(YM),i=e(jM),a=e(Ye),s=e(tD),o=e(eD),l=e(zh),c=di,u=e(jn),d=e(oe),f=Vn,p=e(yD),y=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,g=/^'([^]*?)'?$/,m=/''/g,v=/[a-zA-Z]/;function b(T,S,C){var M,D,O,P,E,F,q,$,Y,I,it,B,yt,ut,z,L,U,j;(0,d.default)(2,arguments);var Z=String(S),K=(0,f.getDefaultOptions)(),N=(M=(D=C==null?void 0:C.locale)!==null&&D!==void 0?D:K.locale)!==null&&M!==void 0?M:p.default,A=(0,u.default)((O=(P=(E=(F=C==null?void 0:C.firstWeekContainsDate)!==null&&F!==void 0?F:C==null||(q=C.locale)===null||q===void 0||($=q.options)===null||$===void 0?void 0:$.firstWeekContainsDate)!==null&&E!==void 0?E:K.firstWeekContainsDate)!==null&&P!==void 0?P:(Y=K.locale)===null||Y===void 0||(I=Y.options)===null||I===void 0?void 0:I.firstWeekContainsDate)!==null&&O!==void 0?O:1);if(!(A>=1&&A<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var Q=(0,u.default)((it=(B=(yt=(ut=C==null?void 0:C.weekStartsOn)!==null&&ut!==void 0?ut:C==null||(z=C.locale)===null||z===void 0||(L=z.options)===null||L===void 0?void 0:L.weekStartsOn)!==null&&yt!==void 0?yt:K.weekStartsOn)!==null&&B!==void 0?B:(U=K.locale)===null||U===void 0||(j=U.options)===null||j===void 0?void 0:j.weekStartsOn)!==null&&it!==void 0?it:0);if(!(Q>=0&&Q<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var X=(0,a.default)(T);if(!(0,r.default)(X))throw new RangeError("Invalid time value");var vt=(0,l.default)(X),ct=(0,i.default)(X,vt),Ot={firstWeekContainsDate:A,weekStartsOn:Q,locale:N,_originalDate:X},_t=Z.match(x).map(function(et){var bt=et[0];if(bt==="p"||bt==="P"){var Nt=o.default[bt];return Nt(et,N.formatLong)}return et}).join("").match(y).map(function(et){if(et==="''")return"'";var bt=et[0];if(bt==="'")return w(et);var Nt=s.default[bt];if(Nt)return!(C!=null&&C.useAdditionalWeekYearTokens)&&(0,c.isProtectedWeekYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),!(C!=null&&C.useAdditionalDayOfYearTokens)&&(0,c.isProtectedDayOfYearToken)(et)&&(0,c.throwProtectedError)(et,S,String(T)),Nt(ct,et,N.localize,Ot);if(bt.match(v))throw new RangeError("Format string contains an unescaped latin alphabet character `"+bt+"`");return et}).join("");return _t}function w(T){var S=T.match(g);return S?S[1].replace(m,"'"):T}n.exports=t.default})(Ah,Ah.exports);function vD(n,t){var e=wD(t);return e.formatToParts?xD(e,n):_D(e,n)}var bD={year:0,month:1,day:2,hour:3,minute:4,second:5};function xD(n,t){try{for(var e=n.formatToParts(t),r=[],i=0;i<e.length;i++){var a=bD[e[i].type];a>=0&&(r[a]=parseInt(e[i].value,10))}return r}catch(s){if(s instanceof RangeError)return[NaN];throw s}}function _D(n,t){var e=n.format(t),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[r[3],r[1],r[2],r[4],r[5],r[6]]}var Nl={};function wD(n){if(!Nl[n]){var t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",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";Nl[n]=e?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"}):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"})}return Nl[n]}function Fl(n,t,e,r,i,a,s){var o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(r,i,a,s),o}var Hh=36e5,TD=6e4,Ul={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ba(n,t,e){var r,i;if(!n||(r=Ul.timezoneZ.exec(n),r))return 0;var a;if(r=Ul.timezoneHH.exec(n),r)return a=parseInt(r[1],10),$h(a)?-(a*Hh):NaN;if(r=Ul.timezoneHHMM.exec(n),r){a=parseInt(r[2],10);var s=parseInt(r[3],10);return $h(a,s)?(i=Math.abs(a)*Hh+s*TD,r[1]==="+"?-i:i):NaN}if(SD(n)){t=new Date(t||Date.now());var o=e?t:MD(t),l=Bl(o,n),c=e?l:DD(t,l,n);return-c}return NaN}function MD(n){return Fl(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Bl(n,t){var e=vD(n,t),r=Fl(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime(),i=n.getTime(),a=i%1e3;return i-=a>=0?a:1e3+a,r-i}function DD(n,t,e){var r=n.getTime(),i=r-t,a=Bl(new Date(i),e);if(t===a)return t;i-=a-t;var s=Bl(new Date(i),e);return a===s?a:Math.max(a,s)}function $h(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}var jh={};function SD(n){if(jh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),jh[n]=!0,!0}catch{return!1}}var kD=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;const Vh=kD;var Wl=36e5,qh=6e4,CD=2,le={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:Vh};function zl(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||{},r=e.additionalDigits==null?CD:HM(e.additionalDigits);if(r!==2&&r!==1&&r!==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 i=OD(n),a=PD(i.date,r),s=a.year,o=a.restDateString,l=ED(o,s);if(isNaN(l))return new Date(NaN);if(l){var c=l.getTime(),u=0,d;if(i.time&&(u=RD(i.time),isNaN(u)))return new Date(NaN);if(i.timeZone||e.timeZone){if(d=ba(i.timeZone||e.timeZone,new Date(c+u)),isNaN(d))return new Date(NaN)}else d=Yh(new Date(c+u)),d=Yh(new Date(c+u+d));return new Date(c+u+d)}else return new Date(NaN)}function OD(n){var t={},e=le.dateTimePattern.exec(n),r;if(e?(t.date=e[1],r=e[3]):(e=le.datePattern.exec(n),e?(t.date=e[1],r=e[2]):(t.date=null,r=n)),r){var i=le.timeZone.exec(r);i?(t.time=r.replace(i[1],""),t.timeZone=i[1].trim()):t.time=r}return t}function PD(n,t){var e=le.YYY[t],r=le.YYYYY[t],i;if(i=le.YYYY.exec(n)||r.exec(n),i){var a=i[1];return{year:parseInt(a,10),restDateString:n.slice(a.length)}}if(i=le.YY.exec(n)||e.exec(n),i){var s=i[1];return{year:parseInt(s,10)*100,restDateString:n.slice(s.length)}}return{year:null}}function ED(n,t){if(t===null)return null;var e,r,i,a;if(n.length===0)return r=new Date(0),r.setUTCFullYear(t),r;if(e=le.MM.exec(n),e)return r=new Date(0),i=parseInt(e[1],10)-1,Kh(t,i)?(r.setUTCFullYear(t,i),r):new Date(NaN);if(e=le.DDD.exec(n),e){r=new Date(0);var s=parseInt(e[1],10);return ID(t,s)?(r.setUTCFullYear(t,0,s),r):new Date(NaN)}if(e=le.MMDD.exec(n),e){r=new Date(0),i=parseInt(e[1],10)-1;var o=parseInt(e[2],10);return Kh(t,i,o)?(r.setUTCFullYear(t,i,o),r):new Date(NaN)}if(e=le.Www.exec(n),e)return a=parseInt(e[1],10)-1,Qh(t,a)?Xh(t,a):new Date(NaN);if(e=le.WwwD.exec(n),e){a=parseInt(e[1],10)-1;var l=parseInt(e[2],10)-1;return Qh(t,a,l)?Xh(t,a,l):new Date(NaN)}return null}function RD(n){var t,e,r;if(t=le.HH.exec(n),t)return e=parseFloat(t[1].replace(",",".")),Yl(e)?e%24*Wl:NaN;if(t=le.HHMM.exec(n),t)return e=parseInt(t[1],10),r=parseFloat(t[2].replace(",",".")),Yl(e,r)?e%24*Wl+r*qh:NaN;if(t=le.HHMMSS.exec(n),t){e=parseInt(t[1],10),r=parseInt(t[2],10);var i=parseFloat(t[3].replace(",","."));return Yl(e,r,i)?e%24*Wl+r*qh+i*1e3:NaN}return null}function Xh(n,t,e){t=t||0,e=e||0;var r=new Date(0);r.setUTCFullYear(n,0,4);var i=r.getUTCDay()||7,a=t*7+e+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var AD=[31,28,31,30,31,30,31,31,30,31,30,31],LD=[31,29,31,30,31,30,31,31,30,31,30,31];function Gh(n){return n%400===0||n%4===0&&n%100!==0}function Kh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;var r=Gh(n);if(r&&e>LD[t]||!r&&e>AD[t])return!1}return!0}function ID(n,t){if(t<1)return!1;var e=Gh(n);return!(e&&t>366||!e&&t>365)}function Qh(n,t,e){return!(t<0||t>52||e!=null&&(e<0||e>6))}function Yl(n,t,e){return!(n!=null&&(n<0||n>=25)||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}var Hl={exports:{}},$l={exports:{}};(function(n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=e;function e(r,i){if(r==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(r[a]=i[a]);return r}n.exports=t.default})($l,$l.exports);var ND=$l.exports;(function(n,t){var e=Ht.default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var r=e(ND);function i(a){return(0,r.default)({},a)}n.exports=t.default})(Hl,Hl.exports);var FD=Hl.exports;const UD=el(FD);function BD(n,t,e){var r=zl(n,e),i=ba(t,r,!0),a=new Date(r.getTime()-i),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 WD(n,t){return-ba(n,t)}function zD(n,t,e){if(typeof n=="string"&&!n.match(Vh)){var r=UD(e);return r.timeZone=t,zl(n,r)}var i=zl(n,e),a=Fl(i.getFullYear(),i.getMonth(),i.getDate(),i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()).getTime(),s=ba(t,new Date(a));return new Date(a+s)}const YD={secondly:1e3,minutely:60*1e3,hourly:60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function jl(n){return n&&kM.find(t=>n<=YD[t])||null}const yr=(n,t)=>new Date(n.getTime()-WD(t,n));class Pe{constructor(t){We(this,"timeframeText"),We(this,"key"),We(this,"display"),We(this,"timeframeLength"),We(this,"allowedTiers"),We(this,"defaultResponseGranularity"),We(this,"dataGranularity"),We(this,"isRelative"),We(this,"_startCustom"),We(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("minutely"),e>=2&&e<=7*24&&t.add("hourly"),e>=2*24&&t.add("daily"),e>=2*24*14&&t.add("weekly"),t}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=zD(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return BD(e,t)}}class HD extends Pe{rawStart(t){let e=va(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=yr(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class $D extends Pe{rawStart(t){let e=mr(this.tzAdjustedDate(t));return t&&(e=yr(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class jD extends Pe{rawEnd(t){let e=va(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=yr(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let r=va(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(r=yr(r,t)),r}}class VD extends Pe{rawEnd(t){let e=mr(this.tzAdjustedDate(t));return t&&(e=yr(e,t)),e}rawStart(t){let e=mr(Rh(this.tzAdjustedDate(t),1));return t&&(e=yr(e,t)),e}}Yt.FIFTEEN_MIN,new Pe({key:Yt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.ONE_HOUR,new Pe({key:Yt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.SIX_HOUR,new Pe({key:Yt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.TWELVE_HOUR,new Pe({key:Yt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.ONE_DAY,new Pe({key:Yt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Yt.SEVEN_DAY,new Pe({key:Yt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Yt.THIRTY_DAY,new Pe({key:Yt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Yt.CURRENT_WEEK,new HD({key:Yt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=va(new Date,{weekStartsOn:1});return(Eh(Ph(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.CURRENT_MONTH,new $D({key:Yt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=mr(new Date);return(Eh(Ph(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.PREVIOUS_WEEK,new jD({key:Yt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Yt.PREVIOUS_MONTH,new VD({key:Yt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=mr(new Date),e=mr(Rh(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=qD(t,e)),60*60*24*UM(new Date().setMonth(new Date().getMonth()-1))+BM(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function qD(n,t){return WM(n.getTimezoneOffset()-t.getTimezoneOffset())}const Zh=(n,t,e,r)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,r),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},Vl={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;Zh(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Zh(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},XD=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:ee.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},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:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=St.useTranslatedUnits(),r=h.ref(),i=h.ref(Tn()),a=h.ref(Tn()),s=h.ref([]),o=h.ref(),l=h.ref(h.inject("legendPosition",Wt.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:i.value,afterUpdate(m){s.value=m.options.plugins.legend.labels.generateLabels(m).map(v=>({...v,value:t.legendValues&&t.legendValues[v.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,_h,...t.type===ee.TIMESERIES_LINE?[Vl]:[]]),{options:f}=St.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),granularity:h.toRef(t,"granularity"),legendID:i.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")});St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const p=m=>aa(m,{short:["daily","weekly"].includes(t.granularity)}),y=m=>({[Wt.Right]:"legend-row",[Wt.Bottom]:"column",[Wt.Hidden]:"hidden"})[m],x=({width:m,height:v})=>{c.width=m,c.height=v},g=()=>{var m,v,b;c.locked=!c.locked,r.value&&((v=(m=r.value.chart.tooltip)==null?void 0:m.dataPoints)!=null&&v.length)&&(Vl.clickedSegment=c.locked?(b=r.value.chart.tooltip)==null?void 0:b.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete Vl.clickedSegment}),(m,v)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",y(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:v[0]||(v[0]=b=>g())},[n.type===h.unref(ee).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(_M),{key:0,ref_key:"chartInstance",ref:r,"chart-id":a.value,data:n.chartData,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(ee).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(xM),{key:1,ref_key:"chartInstance",ref:r,"chart-id":a.value,data:n.chartData,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(Qo,{ref_key:"tooltipElement",ref:o,context:p(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:x,onLeft:v[1]||(v[1]=b=>c.left=b),onTop:v[2]||(v[2]=b=>c.top=b)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(Zo,{id:i.value,"chart-instance":r.value,"data-testid":"legend",items:s.value},null,8,["id","chart-instance","items"])],2))}}),GD=Ze(XD,[["__scopeId","data-v-206a4c39"]]);var qn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(qn||{}),xa={exports:{}};xa.exports,function(n,t){var e=200,r="Expected a function",i="__lodash_hash_undefined__",a=1,s=2,o=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",p="[object Error]",y="[object Function]",x="[object GeneratorFunction]",g="[object Map]",m="[object Number]",v="[object Object]",b="[object Promise]",w="[object RegExp]",T="[object Set]",S="[object String]",C="[object Symbol]",M="[object WeakMap]",D="[object ArrayBuffer]",O="[object DataView]",P="[object Float32Array]",E="[object Float64Array]",F="[object Int8Array]",q="[object Int16Array]",$="[object Int32Array]",Y="[object Uint8Array]",I="[object Uint8ClampedArray]",it="[object Uint16Array]",B="[object Uint32Array]",yt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ut=/^\w*$/,z=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,U=/[\\^$.*+?()[\]{}|]/g,j=/\\(\\)?/g,Z=/^\[object .+?Constructor\]$/,K=/^(?:0|[1-9]\d*)$/,N={};N[P]=N[E]=N[F]=N[q]=N[$]=N[Y]=N[I]=N[it]=N[B]=!0,N[c]=N[u]=N[D]=N[d]=N[O]=N[f]=N[p]=N[y]=N[g]=N[m]=N[v]=N[w]=N[T]=N[S]=N[M]=!1;var A=typeof ge=="object"&&ge&&ge.Object===Object&&ge,Q=typeof self=="object"&&self&&self.Object===Object&&self,X=A||Q||Function("return this")(),vt=t&&!t.nodeType&&t,ct=vt&&!0&&n&&!n.nodeType&&n,Ot=ct&&ct.exports===vt,_t=Ot&&A.process,et=function(){try{return _t&&_t.binding("util")}catch{}}(),bt=et&&et.isTypedArray;function Nt(_,k){for(var R=-1,W=_?_.length:0;++R<W;)if(k(_[R],R,_))return!0;return!1}function De(_){return function(k){return k==null?void 0:k[_]}}function Ee(_,k){for(var R=-1,W=Array(_);++R<_;)W[R]=k(R);return W}function me(_){return function(k){return _(k)}}function Lt(_,k){return _==null?void 0:_[k]}function Ft(_){var k=!1;if(_!=null&&typeof _.toString!="function")try{k=!!(_+"")}catch{}return k}function Je(_){var k=-1,R=Array(_.size);return _.forEach(function(W,ot){R[++k]=[ot,W]}),R}function kt(_,k){return function(R){return _(k(R))}}function Dn(_){var k=-1,R=Array(_.size);return _.forEach(function(W){R[++k]=W}),R}var Re=Array.prototype,tn=Function.prototype,_e=Object.prototype,Se=X["__core-js_shared__"],Ae=function(){var _=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return _?"Symbol(src)_1."+_:""}(),ce=tn.toString,ye=_e.hasOwnProperty,Kt=_e.toString,_a=RegExp("^"+ce.call(ye).replace(U,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vr=X.Symbol,up=X.Uint8Array,uk=_e.propertyIsEnumerable,dk=Re.splice,fk=kt(Object.keys,Object),Gl=br(X,"DataView"),fi=br(X,"Map"),Kl=br(X,"Promise"),Ql=br(X,"Set"),Zl=br(X,"WeakMap"),hi=br(Object,"create"),hk=Gn(Gl),pk=Gn(fi),gk=Gn(Kl),mk=Gn(Ql),yk=Gn(Zl),wa=vr?vr.prototype:void 0,Jl=wa?wa.valueOf:void 0,dp=wa?wa.toString:void 0;function Xn(_){var k=-1,R=_?_.length:0;for(this.clear();++k<R;){var W=_[k];this.set(W[0],W[1])}}function vk(){this.__data__=hi?hi(null):{}}function bk(_){return this.has(_)&&delete this.__data__[_]}function xk(_){var k=this.__data__;if(hi){var R=k[_];return R===i?void 0:R}return ye.call(k,_)?k[_]:void 0}function _k(_){var k=this.__data__;return hi?k[_]!==void 0:ye.call(k,_)}function wk(_,k){var R=this.__data__;return R[_]=hi&&k===void 0?i:k,this}Xn.prototype.clear=vk,Xn.prototype.delete=bk,Xn.prototype.get=xk,Xn.prototype.has=_k,Xn.prototype.set=wk;function en(_){var k=-1,R=_?_.length:0;for(this.clear();++k<R;){var W=_[k];this.set(W[0],W[1])}}function Tk(){this.__data__=[]}function Mk(_){var k=this.__data__,R=Ma(k,_);if(R<0)return!1;var W=k.length-1;return R==W?k.pop():dk.call(k,R,1),!0}function Dk(_){var k=this.__data__,R=Ma(k,_);return R<0?void 0:k[R][1]}function Sk(_){return Ma(this.__data__,_)>-1}function kk(_,k){var R=this.__data__,W=Ma(R,_);return W<0?R.push([_,k]):R[W][1]=k,this}en.prototype.clear=Tk,en.prototype.delete=Mk,en.prototype.get=Dk,en.prototype.has=Sk,en.prototype.set=kk;function nn(_){var k=-1,R=_?_.length:0;for(this.clear();++k<R;){var W=_[k];this.set(W[0],W[1])}}function Ck(){this.__data__={hash:new Xn,map:new(fi||en),string:new Xn}}function Ok(_){return Da(this,_).delete(_)}function Pk(_){return Da(this,_).get(_)}function Ek(_){return Da(this,_).has(_)}function Rk(_,k){return Da(this,_).set(_,k),this}nn.prototype.clear=Ck,nn.prototype.delete=Ok,nn.prototype.get=Pk,nn.prototype.has=Ek,nn.prototype.set=Rk;function Ta(_){var k=-1,R=_?_.length:0;for(this.__data__=new nn;++k<R;)this.add(_[k])}function Ak(_){return this.__data__.set(_,i),this}function Lk(_){return this.__data__.has(_)}Ta.prototype.add=Ta.prototype.push=Ak,Ta.prototype.has=Lk;function rn(_){this.__data__=new en(_)}function Ik(){this.__data__=new en}function Nk(_){return this.__data__.delete(_)}function Fk(_){return this.__data__.get(_)}function Uk(_){return this.__data__.has(_)}function Bk(_,k){var R=this.__data__;if(R instanceof en){var W=R.__data__;if(!fi||W.length<e-1)return W.push([_,k]),this;R=this.__data__=new nn(W)}return R.set(_,k),this}rn.prototype.clear=Ik,rn.prototype.delete=Nk,rn.prototype.get=Fk,rn.prototype.has=Uk,rn.prototype.set=Bk;function Wk(_,k){var R=Kn(_)||bp(_)?Ee(_.length,String):[],W=R.length,ot=!!W;for(var tt in _)(k||ye.call(_,tt))&&!(ot&&(tt=="length"||gp(tt,W)))&&R.push(tt);return R}function Ma(_,k){for(var R=_.length;R--;)if(vp(_[R][0],k))return R;return-1}var zk=eC();function Yk(_,k){return _&&zk(_,k,Pa)}function fp(_,k){k=Sa(k,_)?[k]:hp(k);for(var R=0,W=k.length;_!=null&&R<W;)_=_[ka(k[R++])];return R&&R==W?_:void 0}function Hk(_){return Kt.call(_)}function $k(_,k){return _!=null&&k in Object(_)}function tc(_,k,R,W,ot){return _===k?!0:_==null||k==null||!Ca(_)&&!Oa(k)?_!==_&&k!==k:jk(_,k,tc,R,W,ot)}function jk(_,k,R,W,ot,tt){var wt=Kn(_),Pt=Kn(k),$t=u,Zt=u;wt||($t=Sn(_),$t=$t==c?v:$t),Pt||(Zt=Sn(k),Zt=Zt==c?v:Zt);var ue=$t==v&&!Ft(_),ve=Zt==v&&!Ft(k),Jt=$t==Zt;if(Jt&&!ue)return tt||(tt=new rn),wt||dC(_)?pp(_,k,R,W,ot,tt):nC(_,k,$t,R,W,ot,tt);if(!(ot&s)){var ke=ue&&ye.call(_,"__wrapped__"),Ce=ve&&ye.call(k,"__wrapped__");if(ke||Ce){var kn=ke?_.value():_,an=Ce?k.value():k;return tt||(tt=new rn),R(kn,an,W,ot,tt)}}return Jt?(tt||(tt=new rn),rC(_,k,R,W,ot,tt)):!1}function Vk(_,k,R,W){var ot=R.length,tt=ot,wt=!W;if(_==null)return!tt;for(_=Object(_);ot--;){var Pt=R[ot];if(wt&&Pt[2]?Pt[1]!==_[Pt[0]]:!(Pt[0]in _))return!1}for(;++ot<tt;){Pt=R[ot];var $t=Pt[0],Zt=_[$t],ue=Pt[1];if(wt&&Pt[2]){if(Zt===void 0&&!($t in _))return!1}else{var ve=new rn;if(W)var Jt=W(Zt,ue,$t,_,k,ve);if(!(Jt===void 0?tc(ue,Zt,W,a|s,ve):Jt))return!1}}return!0}function qk(_){if(!Ca(_)||oC(_))return!1;var k=_p(_)||Ft(_)?_a:Z;return k.test(Gn(_))}function Xk(_){return Oa(_)&&nc(_.length)&&!!N[Kt.call(_)]}function Gk(_){return typeof _=="function"?_:_==null?mC:typeof _=="object"?Kn(_)?Zk(_[0],_[1]):Qk(_):yC(_)}function Kk(_){if(!lC(_))return fk(_);var k=[];for(var R in Object(_))ye.call(_,R)&&R!="constructor"&&k.push(R);return k}function Qk(_){var k=iC(_);return k.length==1&&k[0][2]?yp(k[0][0],k[0][1]):function(R){return R===_||Vk(R,_,k)}}function Zk(_,k){return Sa(_)&&mp(k)?yp(ka(_),k):function(R){var W=hC(R,_);return W===void 0&&W===k?pC(R,_):tc(k,W,void 0,a|s)}}function Jk(_){return function(k){return fp(k,_)}}function tC(_){if(typeof _=="string")return _;if(rc(_))return dp?dp.call(_):"";var k=_+"";return k=="0"&&1/_==-o?"-0":k}function hp(_){return Kn(_)?_:cC(_)}function eC(_){return function(k,R,W){for(var ot=-1,tt=Object(k),wt=W(k),Pt=wt.length;Pt--;){var $t=wt[_?Pt:++ot];if(R(tt[$t],$t,tt)===!1)break}return k}}function pp(_,k,R,W,ot,tt){var wt=ot&s,Pt=_.length,$t=k.length;if(Pt!=$t&&!(wt&&$t>Pt))return!1;var Zt=tt.get(_);if(Zt&&tt.get(k))return Zt==k;var ue=-1,ve=!0,Jt=ot&a?new Ta:void 0;for(tt.set(_,k),tt.set(k,_);++ue<Pt;){var ke=_[ue],Ce=k[ue];if(W)var kn=wt?W(Ce,ke,ue,k,_,tt):W(ke,Ce,ue,_,k,tt);if(kn!==void 0){if(kn)continue;ve=!1;break}if(Jt){if(!Nt(k,function(an,Qn){if(!Jt.has(Qn)&&(ke===an||R(ke,an,W,ot,tt)))return Jt.add(Qn)})){ve=!1;break}}else if(!(ke===Ce||R(ke,Ce,W,ot,tt))){ve=!1;break}}return tt.delete(_),tt.delete(k),ve}function nC(_,k,R,W,ot,tt,wt){switch(R){case O:if(_.byteLength!=k.byteLength||_.byteOffset!=k.byteOffset)return!1;_=_.buffer,k=k.buffer;case D:return!(_.byteLength!=k.byteLength||!W(new up(_),new up(k)));case d:case f:case m:return vp(+_,+k);case p:return _.name==k.name&&_.message==k.message;case w:case S:return _==k+"";case g:var Pt=Je;case T:var $t=tt&s;if(Pt||(Pt=Dn),_.size!=k.size&&!$t)return!1;var Zt=wt.get(_);if(Zt)return Zt==k;tt|=a,wt.set(_,k);var ue=pp(Pt(_),Pt(k),W,ot,tt,wt);return wt.delete(_),ue;case C:if(Jl)return Jl.call(_)==Jl.call(k)}return!1}function rC(_,k,R,W,ot,tt){var wt=ot&s,Pt=Pa(_),$t=Pt.length,Zt=Pa(k),ue=Zt.length;if($t!=ue&&!wt)return!1;for(var ve=$t;ve--;){var Jt=Pt[ve];if(!(wt?Jt in k:ye.call(k,Jt)))return!1}var ke=tt.get(_);if(ke&&tt.get(k))return ke==k;var Ce=!0;tt.set(_,k),tt.set(k,_);for(var kn=wt;++ve<$t;){Jt=Pt[ve];var an=_[Jt],Qn=k[Jt];if(W)var wp=wt?W(Qn,an,Jt,k,_,tt):W(an,Qn,Jt,_,k,tt);if(!(wp===void 0?an===Qn||R(an,Qn,W,ot,tt):wp)){Ce=!1;break}kn||(kn=Jt=="constructor")}if(Ce&&!kn){var Ea=_.constructor,Ra=k.constructor;Ea!=Ra&&"constructor"in _&&"constructor"in k&&!(typeof Ea=="function"&&Ea instanceof Ea&&typeof Ra=="function"&&Ra instanceof Ra)&&(Ce=!1)}return tt.delete(_),tt.delete(k),Ce}function Da(_,k){var R=_.__data__;return sC(k)?R[typeof k=="string"?"string":"hash"]:R.map}function iC(_){for(var k=Pa(_),R=k.length;R--;){var W=k[R],ot=_[W];k[R]=[W,ot,mp(ot)]}return k}function br(_,k){var R=Lt(_,k);return qk(R)?R:void 0}var Sn=Hk;(Gl&&Sn(new Gl(new ArrayBuffer(1)))!=O||fi&&Sn(new fi)!=g||Kl&&Sn(Kl.resolve())!=b||Ql&&Sn(new Ql)!=T||Zl&&Sn(new Zl)!=M)&&(Sn=function(_){var k=Kt.call(_),R=k==v?_.constructor:void 0,W=R?Gn(R):void 0;if(W)switch(W){case hk:return O;case pk:return g;case gk:return b;case mk:return T;case yk:return M}return k});function aC(_,k,R){k=Sa(k,_)?[k]:hp(k);for(var W,ot=-1,wt=k.length;++ot<wt;){var tt=ka(k[ot]);if(!(W=_!=null&&R(_,tt)))break;_=_[tt]}if(W)return W;var wt=_?_.length:0;return!!wt&&nc(wt)&&gp(tt,wt)&&(Kn(_)||bp(_))}function gp(_,k){return k=k??l,!!k&&(typeof _=="number"||K.test(_))&&_>-1&&_%1==0&&_<k}function Sa(_,k){if(Kn(_))return!1;var R=typeof _;return R=="number"||R=="symbol"||R=="boolean"||_==null||rc(_)?!0:ut.test(_)||!yt.test(_)||k!=null&&_ in Object(k)}function sC(_){var k=typeof _;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?_!=="__proto__":_===null}function oC(_){return!!Ae&&Ae in _}function lC(_){var k=_&&_.constructor,R=typeof k=="function"&&k.prototype||_e;return _===R}function mp(_){return _===_&&!Ca(_)}function yp(_,k){return function(R){return R==null?!1:R[_]===k&&(k!==void 0||_ in Object(R))}}var cC=ec(function(_){_=fC(_);var k=[];return z.test(_)&&k.push(""),_.replace(L,function(R,W,ot,tt){k.push(ot?tt.replace(j,"$1"):W||R)}),k});function ka(_){if(typeof _=="string"||rc(_))return _;var k=_+"";return k=="0"&&1/_==-o?"-0":k}function Gn(_){if(_!=null){try{return ce.call(_)}catch{}try{return _+""}catch{}}return""}function ec(_,k){if(typeof _!="function"||k&&typeof k!="function")throw new TypeError(r);var R=function(){var W=arguments,ot=k?k.apply(this,W):W[0],tt=R.cache;if(tt.has(ot))return tt.get(ot);var wt=_.apply(this,W);return R.cache=tt.set(ot,wt),wt};return R.cache=new(ec.Cache||nn),R}ec.Cache=nn;function vp(_,k){return _===k||_!==_&&k!==k}function bp(_){return uC(_)&&ye.call(_,"callee")&&(!uk.call(_,"callee")||Kt.call(_)==c)}var Kn=Array.isArray;function xp(_){return _!=null&&nc(_.length)&&!_p(_)}function uC(_){return Oa(_)&&xp(_)}function _p(_){var k=Ca(_)?Kt.call(_):"";return k==y||k==x}function nc(_){return typeof _=="number"&&_>-1&&_%1==0&&_<=l}function Ca(_){var k=typeof _;return!!_&&(k=="object"||k=="function")}function Oa(_){return!!_&&typeof _=="object"}function rc(_){return typeof _=="symbol"||Oa(_)&&Kt.call(_)==C}var dC=bt?me(bt):Xk;function fC(_){return _==null?"":tC(_)}function hC(_,k,R){var W=_==null?void 0:fp(_,k);return W===void 0?R:W}function pC(_,k){return _!=null&&aC(_,k,$k)}function Pa(_){return xp(_)?Wk(_):Kk(_)}function gC(_,k){var R={};return k=Gk(k),Yk(_,function(W,ot,tt){R[k(W,ot,tt)]=W}),R}function mC(_){return _}function yC(_){return Sa(_)?De(ka(_)):Jk(_)}n.exports=gC}(xa,xa.exports);var KD=xa.exports;const QD=Bn(KD);var ZD=1/0,JD=9007199254740991,tS="[object Arguments]",eS="[object Function]",nS="[object GeneratorFunction]",rS="[object Symbol]",iS=typeof ge=="object"&&ge&&ge.Object===Object&&ge,aS=typeof self=="object"&&self&&self.Object===Object&&self,sS=iS||aS||Function("return this")();function oS(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function lS(n,t){for(var e=-1,r=n?n.length:0,i=Array(r);++e<r;)i[e]=t(n[e],e,n);return i}function cS(n,t){for(var e=-1,r=t.length,i=n.length;++e<r;)n[i+e]=t[e];return n}var ql=Object.prototype,uS=ql.hasOwnProperty,Xl=ql.toString,Jh=sS.Symbol,dS=ql.propertyIsEnumerable,tp=Jh?Jh.isConcatSpreadable:void 0,ep=Math.max;function np(n,t,e,r,i){var a=-1,s=n.length;for(e||(e=gS),i||(i=[]);++a<s;){var o=n[a];t>0&&e(o)?t>1?np(o,t-1,e,r,i):cS(i,o):r||(i[i.length]=o)}return i}function fS(n,t){return n=Object(n),hS(n,t,function(e,r){return r in n})}function hS(n,t,e){for(var r=-1,i=t.length,a={};++r<i;){var s=t[r],o=n[s];e(o,s)&&(a[s]=o)}return a}function pS(n,t){return t=ep(t===void 0?n.length-1:t,0),function(){for(var e=arguments,r=-1,i=ep(e.length-t,0),a=Array(i);++r<i;)a[r]=e[t+r];r=-1;for(var s=Array(t+1);++r<t;)s[r]=e[r];return s[t]=a,oS(n,this,s)}}function gS(n){return vS(n)||yS(n)||!!(tp&&n&&n[tp])}function mS(n){if(typeof n=="string"||MS(n))return n;var t=n+"";return t=="0"&&1/n==-ZD?"-0":t}function yS(n){return xS(n)&&uS.call(n,"callee")&&(!dS.call(n,"callee")||Xl.call(n)==tS)}var vS=Array.isArray;function bS(n){return n!=null&&wS(n.length)&&!_S(n)}function xS(n){return rp(n)&&bS(n)}function _S(n){var t=TS(n)?Xl.call(n):"";return t==eS||t==nS}function wS(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=JD}function TS(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function rp(n){return!!n&&typeof n=="object"}function MS(n){return typeof n=="symbol"||rp(n)&&Xl.call(n)==rS}var DS=pS(function(n,t){return n==null?{}:fS(n,lS(np(t,1),mS))}),SS=DS;const kS=Bn(SS);var ip={exports:{}};(function(n,t){(function(e,r){r()})(ge,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function r(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function i(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function a(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var s=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ge=="object"&&ge.global===ge?ge:void 0,o=s.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=s.saveAs||(typeof window!="object"||window!==s?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,d){var f=s.URL||s.webkitURL,p=document.createElement("a");u=u||c.name||"download",p.download=u,p.rel="noopener",typeof c=="string"?(p.href=c,p.origin===location.origin?a(p):i(p.href)?r(c,u,d):a(p,p.target="_blank")):(p.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(p.href)},4e4),setTimeout(function(){a(p)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(i(c))r(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){a(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return r(c,u,d);var p=c.type==="application/octet-stream",y=/constructor/i.test(s.HTMLElement)||s.safari,x=/CriOS\/[\d]+/.test(navigator.userAgent);if((x||p&&y||o)&&typeof FileReader<"u"){var g=new FileReader;g.onloadend=function(){var b=g.result;b=x?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=b:location=b,f=null},g.readAsDataURL(c)}else{var m=s.URL||s.webkitURL,v=m.createObjectURL(c);f?f.location=v:location.href=v,f=null,setTimeout(function(){m.revokeObjectURL(v)},4e4)}});s.saveAs=l.saveAs=l,n.exports=l})})(ip);var CS=ip.exports,ap={exports:{}};/* @license
28
+ */const s1={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"};kl._date.override({_id:"date-fns",formats:function(){return s1},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=G(n):e==="string"&&(typeof t=="string"?n=L0(n,t,new Date,this.options):n=ru(n,this.options)),ro(n)?n.getTime():null},format:function(n,t){return tu(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Cs(n,t);case"second":return Cy(n,t);case"minute":return My(n,t);case"hour":return Sy(n,t);case"day":return Ts(n,t);case"week":return Oy(n,t);case"month":return io(n,t);case"quarter":return Ty(n,t);case"year":return Py(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ps(n,t);case"second":return By(n,t);case"minute":return Iy(n,t);case"hour":return Ly(n,t);case"day":return Bc(n,t);case"week":return zy(n,t);case"month":return Yc(n,t);case"quarter":return Fy(n,t);case"year":return Hy(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return F0(n);case"minute":return Wy(n);case"hour":return N0(n);case"day":return so(n);case"week":return Me(n);case"isoWeek":return Me(n,{weekStartsOn:+e});case"month":return Vy(n);case"quarter":return Yy(n);case"year":return Vc(n);default:return n}},endOf:function(n,t){switch(t){case"second":return Gy(n);case"minute":return qy(n);case"hour":return $y(n);case"day":return Hc(n);case"week":return Uy(n);case"month":return Wc(n);case"quarter":return Xy(n);case"year":return jy(n);default:return n}}});const Sd={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},r1={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Sd,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},o1=h.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Gn(n){return h.isProxy(n)?h.toRaw(n):n}function a1(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function l1(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function vd(n,t){n.labels=t}function Dd(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(o=>o[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function c1(n,t){const e={labels:[],datasets:[]};return vd(e,n.labels),Dd(e,n.datasets,t),e}const u1=h.defineComponent({props:r1,setup(n,t){let{expose:e,slots:i}=t;const s=h.ref(null),r=h.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:f,datasetIdKey:g}=n,p=c1(u,g),y=a1(p,u);r.value=new fe(s.value,{type:c,data:y,options:{...d},plugins:f})},a=()=>{const c=h.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return h.onMounted(o),h.onUnmounted(a),h.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,f]=c,[g,p]=u;const y=h.toRaw(r.value);if(!y)return;let _=!1;if(d){const w=Gn(d),S=Gn(g);w&&w!==S&&(l1(y,w),_=!0)}if(f){const w=Gn(f.labels),S=Gn(p.labels),v=Gn(f.datasets),P=Gn(p.datasets);w!==S&&(vd(y.config.data,w),_=!0),v&&v!==P&&(Dd(y.config.data,v,n.datasetIdKey),_=!0)}_&&h.nextTick(()=>{l(y)})},{deep:!0}),()=>h.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[h.h("p",{},[i.default?i.default():""])])}});function Xo(n,t){return fe.register(t),h.defineComponent({props:Sd,setup(e,i){let{expose:s}=i;const r=h.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>h.h(u1,o1({ref:o},{type:n,...e}))}})}const d1=Xo("bar",pi),Md=Xo("doughnut",Je),h1=Xo("line",mi),f1={class:"chart-container"},g1=h.defineComponent({__name:"DoughnutChart",props:{chartData:{type:Object,required:!1,default:null},tooltipTitle:{type:String,required:!0},metricUnit:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Ot.Right},legendValues:{type:Object,required:!1,default:null},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Fe}},setup(n){const t=n,{translateUnit:e}=ft.useTranslatedUnits(),i=h.ref(ln()),s=h.ref(ln()),r=h.ref([]),o=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:jt.DOUGHNUT}),a={id:i.value,afterUpdate(y){r.value=y.options.plugins.legend.labels.generateLabels(y).map(_=>({..._,value:t.legendValues&&t.legendValues[_.text],hidden:!1}))}},l=h.computed(()=>[a]),c=h.computed(()=>[t.chartData.datasets.reduce((_,w)=>(_.labels.push(w.label),_.backgroundColor.push(w.backgroundColor),_.borderColor.push(Du(w.backgroundColor,50)),_.data.push(w.data.reduce((S,v)=>S+v,0)),_),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=h.computed(()=>({...t.chartData,datasets:c.value}));ft.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const{options:d}=ft.useDoughnutChartOptions({tooltipState:o,legendID:i.value}),f=h.ref(),g=y=>({[Ot.Right]:"legend-row",[Ot.Bottom]:"column",[Ot.Hidden]:"hidden"})[y],p=({width:y,height:_})=>{o.width=y,o.height=_};return(y,_)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[h.createElementVNode("div",f1,[h.createVNode(h.unref(Md),{ref_key:"chartInstance",ref:f,"chart-id":s.value,data:u.value,options:h.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),h.createVNode(Uo,{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"])]),h.createVNode(qo,{id:i.value,"chart-instance":f.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),p1=Be(g1,[["__scopeId","data-v-07ea8b82"]]);var m1=Object.defineProperty,y1=(n,t,e)=>t in n?m1(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Oe=(n,t,e)=>y1(n,typeof t!="symbol"?t+"":t,e),Pt=(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))(Pt||{});const b1=["secondly","minutely","hourly","daily","weekly","trend"],Vi=n=>n.filter(t=>t!=="time"),Td=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],_1=Vi(Td),Cd=[...Td,"application","consumer","iso_code"],x1=Vi(Cd),w1=["control_plane","control_plane_group","gateway_service","consumer","application","route","ai_provider","ai_response_model","ai_request_model","llm_cache_status","llm_embeddings_provider","llm_embeddings_model","time"],k1=Vi(w1),S1=[...Cd,"auth_type","client_ip","consumer_group","country_code","header_host","header_user_agent","http_method","request_id","response_header_content_type","response_source","request_uri","service_port","service_protocol","sse","upstream_status_code","upstream_status_code_grouped","upstream_uri","websocket"];Vi(S1),Vi(["latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","response_body_size","request_body_size","ai_count"]),new Set(_1),new Set(x1),new Set(k1);function Kn(n){const t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function Xs(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function Od(n,t){const e=Kn(n);return isNaN(t)?Xs(n,NaN):(t&&e.setDate(e.getDate()+t),e)}function v1(n,t){const e=Kn(n);if(isNaN(t))return Xs(n,NaN);if(!t)return e;const i=e.getDate(),s=Xs(n,e.getTime());s.setMonth(e.getMonth()+t+1,0);const r=s.getDate();return i>=r?s:(e.setFullYear(s.getFullYear(),s.getMonth(),i),e)}const D1=60,M1=3600;let T1={};function C1(){return T1}function Gs(n,t){var e,i,s,r;const o=C1(),a=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??o.weekStartsOn??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=Kn(n),c=l.getDay(),u=(c<a?7:0)+c-a;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Pd(n){const t=Kn(n);return t.setHours(0,0,0,0),t}function Zn(n){const t=Kn(n);return t.setDate(1),t.setHours(0,0,0,0),t}function O1(n){const t=Kn(n),e=t.getFullYear(),i=t.getMonth(),s=Xs(n,0);return s.setFullYear(e,i+1,0),s.setHours(0,0,0,0),s.getDate()}function P1(n){return Math.trunc(n*M1)}function E1(n){const t=n/D1;return Math.trunc(t)}function Ed(n,t){return v1(n,-t)}function R1(n,t){const e=N1(t);return"formatToParts"in e?L1(e,n):I1(e,n)}const A1={year:0,month:1,day:2,hour:3,minute:4,second:5};function L1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=A1[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function I1(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Go={};function N1(n){if(!Go[n]){const t=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",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";Go[n]=e?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"}):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"})}return Go[n]}function Ko(n,t,e,i,s,r,o){const a=new Date(0);return a.setUTCFullYear(n,t,e),a.setUTCHours(i,s,r,o),a}const Rd=36e5,F1=6e4,Zo={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ks(n,t,e){if(!n)return 0;let i=Zo.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Zo.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Ad(s)?-(s*Rd):NaN;if(i=Zo.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Ad(s,o)?(r=Math.abs(s)*Rd+o*F1,i[1]==="+"?-r:r):NaN}if(H1(n)){t=new Date(t||Date.now());const o=e?t:B1(t),a=Qo(o,n);return-(e?a:z1(t,a,n))}return NaN}function B1(n){return Ko(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Qo(n,t){const e=R1(n,t),i=Ko(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function z1(n,t,e){let i=n.getTime()-t;const s=Qo(new Date(i),e);if(t===s)return t;i-=s-t;const r=Qo(new Date(i),e);return s===r?s:Math.max(s,r)}function Ad(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Ld={};function H1(n){if(Ld[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Ld[n]=!0,!0}catch{return!1}}function Id(n){const 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-+t}const Nd=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Jo=36e5,Fd=6e4,W1=2,Gt={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:Nd};function ta(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?W1:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==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(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=Y1(n),{year:s,restDateString:r}=V1(i.date,e),o=j1(r,s);if(o===null||isNaN(o.getTime()))return new Date(NaN);if(o){const a=o.getTime();let l=0,c;if(i.time&&(l=$1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ks(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Id(new Date(a+l)),c=Id(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Y1(n){const t={};let e=Gt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Gt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Gt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function V1(n,t){if(n){const e=Gt.YYY[t],i=Gt.YYYYY[t];let s=Gt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Gt.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function j1(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=Gt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Hd(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Gt.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return X1(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=Gt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Hd(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=Gt.Www.exec(n),r)return s=parseInt(r[1],10)-1,Wd(s)?Bd(t,s):new Date(NaN);if(r=Gt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return Wd(s,o)?Bd(t,s,o):new Date(NaN)}return null}function $1(n){let t,e,i=Gt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ea(t)?t%24*Jo:NaN;if(i=Gt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ea(t,e)?t%24*Jo+e*Fd:NaN;if(i=Gt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ea(t,e,s)?t%24*Jo+e*Fd+s*1e3:NaN}return null}function Bd(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const U1=[31,28,31,30,31,30,31,31,30,31,30,31],q1=[31,29,31,30,31,30,31,31,30,31,30,31];function zd(n){return n%400===0||n%4===0&&n%100!==0}function Hd(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=zd(n);if(i&&e>q1[t]||!i&&e>U1[t])return!1}return!0}function X1(n,t){if(t<1)return!1;const e=zd(n);return!(e&&t>366||!e&&t>365)}function Wd(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ea(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}function G1(n,t,e){n=ta(n,e);const i=Ks(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function K1(n,t,e){if(typeof n=="string"&&!n.match(Nd))return ta(n,{...e,timeZone:t});n=ta(n,e);const i=Ko(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Ks(t,new Date(i));return new Date(i+s)}function Z1(n,t){return-Ks(n,t)}const Q1={secondly:1e3,minutely:60*1e3,hourly:60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function na(n){return n&&b1.find(t=>n<=Q1[t])||null}const Qn=(n,t)=>new Date(n.getTime()-Z1(t,n));class _e{constructor(t){Oe(this,"timeframeText"),Oe(this,"key"),Oe(this,"display"),Oe(this,"timeframeLength"),Oe(this,"allowedTiers"),Oe(this,"defaultResponseGranularity"),Oe(this,"dataGranularity"),Oe(this,"isRelative"),Oe(this,"_startCustom"),Oe(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("minutely"),e>=2&&e<=7*24&&t.add("hourly"),e>=2*24&&t.add("daily"),e>=2*24*14&&t.add("weekly"),t}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=K1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return G1(e,t)}}class J1 extends _e{rawStart(t){let e=Gs(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Qn(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class tk extends _e{rawStart(t){let e=Zn(this.tzAdjustedDate(t));return t&&(e=Qn(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class ek extends _e{rawEnd(t){let e=Gs(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Qn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=Gs(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Qn(i,t)),i}}class nk extends _e{rawEnd(t){let e=Zn(this.tzAdjustedDate(t));return t&&(e=Qn(e,t)),e}rawStart(t){let e=Zn(Ed(this.tzAdjustedDate(t),1));return t&&(e=Qn(e,t)),e}}Pt.FIFTEEN_MIN,new _e({key:Pt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Pt.ONE_HOUR,new _e({key:Pt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Pt.SIX_HOUR,new _e({key:Pt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Pt.TWELVE_HOUR,new _e({key:Pt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Pt.ONE_DAY,new _e({key:Pt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Pt.SEVEN_DAY,new _e({key:Pt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Pt.THIRTY_DAY,new _e({key:Pt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Pt.CURRENT_WEEK,new J1({key:Pt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Gs(new Date,{weekStartsOn:1});return(Pd(Od(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Pt.CURRENT_MONTH,new tk({key:Pt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Zn(new Date);return(Pd(Od(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Pt.PREVIOUS_WEEK,new ek({key:Pt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Pt.PREVIOUS_MONTH,new nk({key:Pt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Zn(new Date),e=Zn(Ed(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=ik(t,e)),60*60*24*O1(new Date().setMonth(new Date().getMonth()-1))+P1(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function ik(n,t){return E1(n.getTimezoneOffset()-t.getTimezoneOffset())}const Yd=(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()},ia={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;Yd(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Yd(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},sk=h.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:jt.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},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:""},chartLegendSortFn:{type:Function,required:!1,default:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,required:!1,default:(n,t)=>t.rawValue-n.rawValue}},setup(n){const t=n,{translateUnit:e}=ft.useTranslatedUnits(),i=h.ref(),s=h.ref(ln()),r=h.ref(ln()),o=h.ref([]),a=h.ref(),l=h.ref(h.inject("legendPosition",Ot.Right)),c=h.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:h.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:t.type,locked:!1,chartTooltipSortFn:t.chartTooltipSortFn}),u={id:s.value,afterUpdate(w){o.value=w.options.plugins.legend.labels.generateLabels(w).map(S=>({...S,value:t.legendValues&&t.legendValues[S.text]})).sort(t.chartLegendSortFn)}},d=h.computed(()=>[u,xd,...t.type===jt.TIMESERIES_LINE?[ia]:[]]),{options:f}=ft.useLinechartOptions({tooltipState:c,timeRangeMs:h.toRef(t,"timeRangeMs"),granularity:h.toRef(t,"granularity"),legendID:s.value,stacked:h.toRef(t,"stacked"),metricAxesTitle:h.toRef(t,"metricAxesTitle"),dimensionAxesTitle:h.toRef(t,"dimensionAxesTitle")});ft.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const g=w=>Ns(w,{short:["daily","weekly"].includes(t.granularity)}),p=w=>({[Ot.Right]:"legend-row",[Ot.Bottom]:"column",[Ot.Hidden]:"hidden"})[w],y=({width:w,height:S})=>{c.width=w,c.height=S},_=()=>{var w,S,v;c.locked=!c.locked,i.value&&((S=(w=i.value.chart.tooltip)==null?void 0:w.dataPoints)!=null&&S.length)&&(ia.clickedSegment=c.locked?(v=i.value.chart.tooltip)==null?void 0:v.dataPoints[0]:void 0)};return h.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete ia.clickedSegment}),(w,S)=>(h.openBlock(),h.createElementBlock("div",{class:h.normalizeClass(["chart-parent",p(l.value)]),"data-testid":"line-chart-parent"},[h.createElementVNode("div",{class:"chart-container",onClick:S[0]||(S[0]=v=>_())},[n.type===h.unref(jt).TIMESERIES_LINE?(h.openBlock(),h.createBlock(h.unref(h1),{key:0,ref_key:"chartInstance",ref:i,"chart-id":r.value,data:n.chartData,"data-testid":"time-series-line-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===h.unref(jt).TIMESERIES_BAR?(h.openBlock(),h.createBlock(h.unref(d1),{key:1,ref_key:"chartInstance",ref:i,"chart-id":r.value,data:n.chartData,"data-testid":"time-series-bar-chart",options:h.unref(f),plugins:d.value},null,8,["chart-id","data","options","plugins"])):h.createCommentVNode("",!0)]),h.createVNode(Uo,{ref_key:"tooltipElement",ref:a,context:g(c.tooltipContext),"data-testid":"tooltip",left:c.left,locked:c.locked,series:c.tooltipSeries,"show-tooltip":c.showTooltip,"tooltip-title":n.tooltipTitle,top:c.top,unit:n.metricUnit,onDimensions:y,onLeft:S[1]||(S[1]=v=>c.left=v),onTop:S[2]||(S[2]=v=>c.top=v)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),h.createVNode(qo,{id:s.value,"chart-instance":i.value,"data-testid":"legend",items:o.value},null,8,["id","chart-instance","items"])],2))}}),rk=Be(sk,[["__scopeId","data-v-206a4c39"]]);var Tn=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(Tn||{}),Zs={exports:{}};Zs.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,o=2,a=1/0,l=9007199254740991,c="[object Arguments]",u="[object Array]",d="[object Boolean]",f="[object Date]",g="[object Error]",p="[object Function]",y="[object GeneratorFunction]",_="[object Map]",w="[object Number]",S="[object Object]",v="[object Promise]",P="[object RegExp]",M="[object Set]",C="[object String]",T="[object Symbol]",b="[object WeakMap]",x="[object ArrayBuffer]",D="[object DataView]",E="[object Float32Array]",A="[object Float64Array]",F="[object Int8Array]",$="[object Int16Array]",K="[object Int32Array]",j="[object Uint8Array]",N="[object Uint8ClampedArray]",st="[object Uint16Array]",B="[object Uint32Array]",At=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wt=/^\w*$/,H=/^\./,L=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,V=/\\(\\)?/g,q=/^\[object .+?Constructor\]$/,Q=/^(?:0|[1-9]\d*)$/,Y={};Y[E]=Y[A]=Y[F]=Y[$]=Y[K]=Y[j]=Y[N]=Y[st]=Y[B]=!0,Y[c]=Y[u]=Y[x]=Y[d]=Y[D]=Y[f]=Y[g]=Y[p]=Y[_]=Y[w]=Y[S]=Y[P]=Y[M]=Y[C]=Y[b]=!1;var W=typeof ne=="object"&&ne&&ne.Object===Object&&ne,et=typeof self=="object"&&self&&self.Object===Object&&self,X=W||et||Function("return this")(),kt=t&&!t.nodeType&&t,lt=kt&&!0&&n&&!n.nodeType&&n,Ht=lt&&lt.exports===kt,Dt=Ht&&W.process,pt=function(){try{return Dt&&Dt.binding("util")}catch{}}(),ie=pt&&pt.isTypedArray;function se(m,k){for(var R=-1,I=m?m.length:0;++R<I;)if(k(m[R],R,m))return!0;return!1}function ge(m){return function(k){return k==null?void 0:k[m]}}function xe(m,k){for(var R=-1,I=Array(m);++R<m;)I[R]=k(R);return I}function re(m){return function(k){return m(k)}}function St(m,k){return m==null?void 0:m[k]}function Mt(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function ze(m){var k=-1,R=Array(m.size);return m.forEach(function(I,nt){R[++k]=[nt,I]}),R}function gt(m,k){return function(R){return m(k(R))}}function un(m){var k=-1,R=Array(m.size);return m.forEach(function(I){R[++k]=I}),R}var we=Array.prototype,He=Function.prototype,ue=Object.prototype,pe=X["__core-js_shared__"],ke=function(){var m=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Kt=He.toString,oe=ue.hasOwnProperty,Bt=ue.toString,Qs=RegExp("^"+Kt.call(oe).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Jn=X.Symbol,th=X.Uint8Array,xS=ue.propertyIsEnumerable,wS=we.splice,kS=gt(Object.keys,Object),oa=ti(X,"DataView"),ji=ti(X,"Map"),aa=ti(X,"Promise"),la=ti(X,"Set"),ca=ti(X,"WeakMap"),$i=ti(Object,"create"),SS=On(oa),vS=On(ji),DS=On(aa),MS=On(la),TS=On(ca),Js=Jn?Jn.prototype:void 0,ua=Js?Js.valueOf:void 0,eh=Js?Js.toString:void 0;function Cn(m){var k=-1,R=m?m.length:0;for(this.clear();++k<R;){var I=m[k];this.set(I[0],I[1])}}function CS(){this.__data__=$i?$i(null):{}}function OS(m){return this.has(m)&&delete this.__data__[m]}function PS(m){var k=this.__data__;if($i){var R=k[m];return R===s?void 0:R}return oe.call(k,m)?k[m]:void 0}function ES(m){var k=this.__data__;return $i?k[m]!==void 0:oe.call(k,m)}function RS(m,k){var R=this.__data__;return R[m]=$i&&k===void 0?s:k,this}Cn.prototype.clear=CS,Cn.prototype.delete=OS,Cn.prototype.get=PS,Cn.prototype.has=ES,Cn.prototype.set=RS;function We(m){var k=-1,R=m?m.length:0;for(this.clear();++k<R;){var I=m[k];this.set(I[0],I[1])}}function AS(){this.__data__=[]}function LS(m){var k=this.__data__,R=er(k,m);if(R<0)return!1;var I=k.length-1;return R==I?k.pop():wS.call(k,R,1),!0}function IS(m){var k=this.__data__,R=er(k,m);return R<0?void 0:k[R][1]}function NS(m){return er(this.__data__,m)>-1}function FS(m,k){var R=this.__data__,I=er(R,m);return I<0?R.push([m,k]):R[I][1]=k,this}We.prototype.clear=AS,We.prototype.delete=LS,We.prototype.get=IS,We.prototype.has=NS,We.prototype.set=FS;function Ye(m){var k=-1,R=m?m.length:0;for(this.clear();++k<R;){var I=m[k];this.set(I[0],I[1])}}function BS(){this.__data__={hash:new Cn,map:new(ji||We),string:new Cn}}function zS(m){return nr(this,m).delete(m)}function HS(m){return nr(this,m).get(m)}function WS(m){return nr(this,m).has(m)}function YS(m,k){return nr(this,m).set(m,k),this}Ye.prototype.clear=BS,Ye.prototype.delete=zS,Ye.prototype.get=HS,Ye.prototype.has=WS,Ye.prototype.set=YS;function tr(m){var k=-1,R=m?m.length:0;for(this.__data__=new Ye;++k<R;)this.add(m[k])}function VS(m){return this.__data__.set(m,s),this}function jS(m){return this.__data__.has(m)}tr.prototype.add=tr.prototype.push=VS,tr.prototype.has=jS;function Ve(m){this.__data__=new We(m)}function $S(){this.__data__=new We}function US(m){return this.__data__.delete(m)}function qS(m){return this.__data__.get(m)}function XS(m){return this.__data__.has(m)}function GS(m,k){var R=this.__data__;if(R instanceof We){var I=R.__data__;if(!ji||I.length<e-1)return I.push([m,k]),this;R=this.__data__=new Ye(I)}return R.set(m,k),this}Ve.prototype.clear=$S,Ve.prototype.delete=US,Ve.prototype.get=qS,Ve.prototype.has=XS,Ve.prototype.set=GS;function KS(m,k){var R=Pn(m)||ch(m)?xe(m.length,String):[],I=R.length,nt=!!I;for(var U in m)(k||oe.call(m,U))&&!(nt&&(U=="length"||rh(U,I)))&&R.push(U);return R}function er(m,k){for(var R=m.length;R--;)if(lh(m[R][0],k))return R;return-1}var ZS=dv();function QS(m,k){return m&&ZS(m,k,ar)}function nh(m,k){k=ir(k,m)?[k]:ih(k);for(var R=0,I=k.length;m!=null&&R<I;)m=m[sr(k[R++])];return R&&R==I?m:void 0}function JS(m){return Bt.call(m)}function tv(m,k){return m!=null&&k in Object(m)}function da(m,k,R,I,nt){return m===k?!0:m==null||k==null||!rr(m)&&!or(k)?m!==m&&k!==k:ev(m,k,da,R,I,nt)}function ev(m,k,R,I,nt,U){var ct=Pn(m),yt=Pn(k),Et=u,Wt=u;ct||(Et=dn(m),Et=Et==c?S:Et),yt||(Wt=dn(k),Wt=Wt==c?S:Wt);var Zt=Et==S&&!Mt(m),ae=Wt==S&&!Mt(k),Yt=Et==Wt;if(Yt&&!Zt)return U||(U=new Ve),ct||wv(m)?sh(m,k,R,I,nt,U):hv(m,k,Et,R,I,nt,U);if(!(nt&o)){var me=Zt&&oe.call(m,"__wrapped__"),ye=ae&&oe.call(k,"__wrapped__");if(me||ye){var hn=me?m.value():m,je=ye?k.value():k;return U||(U=new Ve),R(hn,je,I,nt,U)}}return Yt?(U||(U=new Ve),fv(m,k,R,I,nt,U)):!1}function nv(m,k,R,I){var nt=R.length,U=nt,ct=!I;if(m==null)return!U;for(m=Object(m);nt--;){var yt=R[nt];if(ct&&yt[2]?yt[1]!==m[yt[0]]:!(yt[0]in m))return!1}for(;++nt<U;){yt=R[nt];var Et=yt[0],Wt=m[Et],Zt=yt[1];if(ct&&yt[2]){if(Wt===void 0&&!(Et in m))return!1}else{var ae=new Ve;if(I)var Yt=I(Wt,Zt,Et,m,k,ae);if(!(Yt===void 0?da(Zt,Wt,I,r|o,ae):Yt))return!1}}return!0}function iv(m){if(!rr(m)||yv(m))return!1;var k=dh(m)||Mt(m)?Qs:q;return k.test(On(m))}function sv(m){return or(m)&&fa(m.length)&&!!Y[Bt.call(m)]}function rv(m){return typeof m=="function"?m:m==null?Mv:typeof m=="object"?Pn(m)?lv(m[0],m[1]):av(m):Tv(m)}function ov(m){if(!bv(m))return kS(m);var k=[];for(var R in Object(m))oe.call(m,R)&&R!="constructor"&&k.push(R);return k}function av(m){var k=gv(m);return k.length==1&&k[0][2]?ah(k[0][0],k[0][1]):function(R){return R===m||nv(R,m,k)}}function lv(m,k){return ir(m)&&oh(k)?ah(sr(m),k):function(R){var I=Sv(R,m);return I===void 0&&I===k?vv(R,m):da(k,I,void 0,r|o)}}function cv(m){return function(k){return nh(k,m)}}function uv(m){if(typeof m=="string")return m;if(ga(m))return eh?eh.call(m):"";var k=m+"";return k=="0"&&1/m==-a?"-0":k}function ih(m){return Pn(m)?m:_v(m)}function dv(m){return function(k,R,I){for(var nt=-1,U=Object(k),ct=I(k),yt=ct.length;yt--;){var Et=ct[m?yt:++nt];if(R(U[Et],Et,U)===!1)break}return k}}function sh(m,k,R,I,nt,U){var ct=nt&o,yt=m.length,Et=k.length;if(yt!=Et&&!(ct&&Et>yt))return!1;var Wt=U.get(m);if(Wt&&U.get(k))return Wt==k;var Zt=-1,ae=!0,Yt=nt&r?new tr:void 0;for(U.set(m,k),U.set(k,m);++Zt<yt;){var me=m[Zt],ye=k[Zt];if(I)var hn=ct?I(ye,me,Zt,k,m,U):I(me,ye,Zt,m,k,U);if(hn!==void 0){if(hn)continue;ae=!1;break}if(Yt){if(!se(k,function(je,En){if(!Yt.has(En)&&(me===je||R(me,je,I,nt,U)))return Yt.add(En)})){ae=!1;break}}else if(!(me===ye||R(me,ye,I,nt,U))){ae=!1;break}}return U.delete(m),U.delete(k),ae}function hv(m,k,R,I,nt,U,ct){switch(R){case D:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case x:return!(m.byteLength!=k.byteLength||!I(new th(m),new th(k)));case d:case f:case w:return lh(+m,+k);case g:return m.name==k.name&&m.message==k.message;case P:case C:return m==k+"";case _:var yt=ze;case M:var Et=U&o;if(yt||(yt=un),m.size!=k.size&&!Et)return!1;var Wt=ct.get(m);if(Wt)return Wt==k;U|=r,ct.set(m,k);var Zt=sh(yt(m),yt(k),I,nt,U,ct);return ct.delete(m),Zt;case T:if(ua)return ua.call(m)==ua.call(k)}return!1}function fv(m,k,R,I,nt,U){var ct=nt&o,yt=ar(m),Et=yt.length,Wt=ar(k),Zt=Wt.length;if(Et!=Zt&&!ct)return!1;for(var ae=Et;ae--;){var Yt=yt[ae];if(!(ct?Yt in k:oe.call(k,Yt)))return!1}var me=U.get(m);if(me&&U.get(k))return me==k;var ye=!0;U.set(m,k),U.set(k,m);for(var hn=ct;++ae<Et;){Yt=yt[ae];var je=m[Yt],En=k[Yt];if(I)var hh=ct?I(En,je,Yt,k,m,U):I(je,En,Yt,m,k,U);if(!(hh===void 0?je===En||R(je,En,I,nt,U):hh)){ye=!1;break}hn||(hn=Yt=="constructor")}if(ye&&!hn){var lr=m.constructor,cr=k.constructor;lr!=cr&&"constructor"in m&&"constructor"in k&&!(typeof lr=="function"&&lr instanceof lr&&typeof cr=="function"&&cr instanceof cr)&&(ye=!1)}return U.delete(m),U.delete(k),ye}function nr(m,k){var R=m.__data__;return mv(k)?R[typeof k=="string"?"string":"hash"]:R.map}function gv(m){for(var k=ar(m),R=k.length;R--;){var I=k[R],nt=m[I];k[R]=[I,nt,oh(nt)]}return k}function ti(m,k){var R=St(m,k);return iv(R)?R:void 0}var dn=JS;(oa&&dn(new oa(new ArrayBuffer(1)))!=D||ji&&dn(new ji)!=_||aa&&dn(aa.resolve())!=v||la&&dn(new la)!=M||ca&&dn(new ca)!=b)&&(dn=function(m){var k=Bt.call(m),R=k==S?m.constructor:void 0,I=R?On(R):void 0;if(I)switch(I){case SS:return D;case vS:return _;case DS:return v;case MS:return M;case TS:return b}return k});function pv(m,k,R){k=ir(k,m)?[k]:ih(k);for(var I,nt=-1,ct=k.length;++nt<ct;){var U=sr(k[nt]);if(!(I=m!=null&&R(m,U)))break;m=m[U]}if(I)return I;var ct=m?m.length:0;return!!ct&&fa(ct)&&rh(U,ct)&&(Pn(m)||ch(m))}function rh(m,k){return k=k??l,!!k&&(typeof m=="number"||Q.test(m))&&m>-1&&m%1==0&&m<k}function ir(m,k){if(Pn(m))return!1;var R=typeof m;return R=="number"||R=="symbol"||R=="boolean"||m==null||ga(m)?!0:wt.test(m)||!At.test(m)||k!=null&&m in Object(k)}function mv(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function yv(m){return!!ke&&ke in m}function bv(m){var k=m&&m.constructor,R=typeof k=="function"&&k.prototype||ue;return m===R}function oh(m){return m===m&&!rr(m)}function ah(m,k){return function(R){return R==null?!1:R[m]===k&&(k!==void 0||m in Object(R))}}var _v=ha(function(m){m=kv(m);var k=[];return H.test(m)&&k.push(""),m.replace(L,function(R,I,nt,U){k.push(nt?U.replace(V,"$1"):I||R)}),k});function sr(m){if(typeof m=="string"||ga(m))return m;var k=m+"";return k=="0"&&1/m==-a?"-0":k}function On(m){if(m!=null){try{return Kt.call(m)}catch{}try{return m+""}catch{}}return""}function ha(m,k){if(typeof m!="function"||k&&typeof k!="function")throw new TypeError(i);var R=function(){var I=arguments,nt=k?k.apply(this,I):I[0],U=R.cache;if(U.has(nt))return U.get(nt);var ct=m.apply(this,I);return R.cache=U.set(nt,ct),ct};return R.cache=new(ha.Cache||Ye),R}ha.Cache=Ye;function lh(m,k){return m===k||m!==m&&k!==k}function ch(m){return xv(m)&&oe.call(m,"callee")&&(!xS.call(m,"callee")||Bt.call(m)==c)}var Pn=Array.isArray;function uh(m){return m!=null&&fa(m.length)&&!dh(m)}function xv(m){return or(m)&&uh(m)}function dh(m){var k=rr(m)?Bt.call(m):"";return k==p||k==y}function fa(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=l}function rr(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function or(m){return!!m&&typeof m=="object"}function ga(m){return typeof m=="symbol"||or(m)&&Bt.call(m)==T}var wv=ie?re(ie):sv;function kv(m){return m==null?"":uv(m)}function Sv(m,k,R){var I=m==null?void 0:nh(m,k);return I===void 0?R:I}function vv(m,k){return m!=null&&pv(m,k,tv)}function ar(m){return uh(m)?KS(m):ov(m)}function Dv(m,k){var R={};return k=rv(k),QS(m,function(I,nt,U){R[k(I,nt,U)]=I}),R}function Mv(m){return m}function Tv(m){return ir(m)?ge(sr(m)):cv(m)}n.exports=Dv}(Zs,Zs.exports);var ok=Zs.exports;const ak=Co(ok);var lk=1/0,ck=9007199254740991,uk="[object Arguments]",dk="[object Function]",hk="[object GeneratorFunction]",fk="[object Symbol]",gk=typeof ne=="object"&&ne&&ne.Object===Object&&ne,pk=typeof self=="object"&&self&&self.Object===Object&&self,mk=gk||pk||Function("return this")();function yk(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function bk(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function _k(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var sa=Object.prototype,xk=sa.hasOwnProperty,ra=sa.toString,Vd=mk.Symbol,wk=sa.propertyIsEnumerable,jd=Vd?Vd.isConcatSpreadable:void 0,$d=Math.max;function Ud(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=Dk),s||(s=[]);++r<o;){var a=n[r];t>0&&e(a)?t>1?Ud(a,t-1,e,i,s):_k(s,a):i||(s[s.length]=a)}return s}function kk(n,t){return n=Object(n),Sk(n,t,function(e,i){return i in n})}function Sk(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var o=t[i],a=n[o];e(a,o)&&(r[o]=a)}return r}function vk(n,t){return t=$d(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=$d(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var o=Array(t+1);++i<t;)o[i]=e[i];return o[t]=r,yk(n,this,o)}}function Dk(n){return Ck(n)||Tk(n)||!!(jd&&n&&n[jd])}function Mk(n){if(typeof n=="string"||Lk(n))return n;var t=n+"";return t=="0"&&1/n==-lk?"-0":t}function Tk(n){return Pk(n)&&xk.call(n,"callee")&&(!wk.call(n,"callee")||ra.call(n)==uk)}var Ck=Array.isArray;function Ok(n){return n!=null&&Rk(n.length)&&!Ek(n)}function Pk(n){return qd(n)&&Ok(n)}function Ek(n){var t=Ak(n)?ra.call(n):"";return t==dk||t==hk}function Rk(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=ck}function Ak(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function qd(n){return!!n&&typeof n=="object"}function Lk(n){return typeof n=="symbol"||qd(n)&&ra.call(n)==fk}var Ik=vk(function(n,t){return n==null?{}:kk(n,bk(Ud(t,1),Mk))}),Nk=Ik;const Fk=Co(Nk);var Xd={exports:{}};(function(n,t){(function(e,i){i()})(ne,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,d){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,d)},f.onerror=function(){console.error("could not download file")},f.send()}function s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ne=="object"&&ne.global===ne?ne:void 0,a=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(c,u,d){var f=o.URL||o.webkitURL,g=document.createElement("a");u=u||c.name||"download",g.download=u,g.rel="noopener",typeof c=="string"?(g.href=c,g.origin===location.origin?r(g):s(g.href)?i(c,u,d):r(g,g.target="_blank")):(g.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(g.href)},4e4),setTimeout(function(){r(g)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,d){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,d),u);else if(s(c))i(c,u,d);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(f)})}}:function(c,u,d,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,d);var g=c.type==="application/octet-stream",p=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||g&&p||a)&&typeof FileReader<"u"){var _=new FileReader;_.onloadend=function(){var v=_.result;v=y?v:v.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=v:location=v,f=null},_.readAsDataURL(c)}else{var w=o.URL||o.webkitURL,S=w.createObjectURL(c);f?f.location=S:location.href=S,f=null,setTimeout(function(){w.revokeObjectURL(S)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(Xd);var Bk=Xd.exports,Gd={exports:{}};/* @license
30
29
  Papa Parse
31
30
  v5.4.1
32
31
  https://github.com/mholt/PapaParse
33
32
  License: MIT
34
- */(function(n,t){(function(e,r){n.exports=r()})(ge,function e(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},i=!r.document&&!!r.postMessage,a=r.IS_PAPA_WORKER||!1,s={},o=0,l={parse:function(M,D){var O=(D=D||{}).dynamicTyping||!1;if(C(O)&&(D.dynamicTypingFunction=O,O={}),D.dynamicTyping=O,D.transform=!!C(D.transform)&&D.transform,D.worker&&l.WORKERS_SUPPORTED){var P=function(){if(!l.WORKERS_SUPPORTED)return!1;var F=($=r.URL||r.webkitURL||null,Y=e.toString(),l.BLOB_URL||(l.BLOB_URL=$.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",Y,")();"],{type:"text/javascript"})))),q=new r.Worker(F),$,Y;return q.onmessage=v,q.id=o++,s[q.id]=q}();return P.userStep=D.step,P.userChunk=D.chunk,P.userComplete=D.complete,P.userError=D.error,D.step=C(D.step),D.chunk=C(D.chunk),D.complete=C(D.complete),D.error=C(D.error),delete D.worker,void P.postMessage({input:M,config:D,workerId:P.id})}var E=null;return l.NODE_STREAM_INPUT,typeof M=="string"?(M=function(F){return F.charCodeAt(0)===65279?F.slice(1):F}(M),E=D.download?new d(D):new p(D)):M.readable===!0&&C(M.read)&&C(M.on)?E=new y(D):(r.File&&M instanceof File||M instanceof Object)&&(E=new f(D)),E.stream(M)},unparse:function(M,D){var O=!1,P=!0,E=",",F=`\r
35
- `,q='"',$=q+q,Y=!1,I=null,it=!1;(function(){if(typeof D=="object"){if(typeof D.delimiter!="string"||l.BAD_DELIMITERS.filter(function(z){return D.delimiter.indexOf(z)!==-1}).length||(E=D.delimiter),(typeof D.quotes=="boolean"||typeof D.quotes=="function"||Array.isArray(D.quotes))&&(O=D.quotes),typeof D.skipEmptyLines!="boolean"&&typeof D.skipEmptyLines!="string"||(Y=D.skipEmptyLines),typeof D.newline=="string"&&(F=D.newline),typeof D.quoteChar=="string"&&(q=D.quoteChar),typeof D.header=="boolean"&&(P=D.header),Array.isArray(D.columns)){if(D.columns.length===0)throw new Error("Option columns is empty");I=D.columns}D.escapeChar!==void 0&&($=D.escapeChar+q),(typeof D.escapeFormulae=="boolean"||D.escapeFormulae instanceof RegExp)&&(it=D.escapeFormulae instanceof RegExp?D.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var B=new RegExp(g(q),"g");if(typeof M=="string"&&(M=JSON.parse(M)),Array.isArray(M)){if(!M.length||Array.isArray(M[0]))return yt(null,M,Y);if(typeof M[0]=="object")return yt(I||Object.keys(M[0]),M,Y)}else if(typeof M=="object")return typeof M.data=="string"&&(M.data=JSON.parse(M.data)),Array.isArray(M.data)&&(M.fields||(M.fields=M.meta&&M.meta.fields||I),M.fields||(M.fields=Array.isArray(M.data[0])?M.fields:typeof M.data[0]=="object"?Object.keys(M.data[0]):[]),Array.isArray(M.data[0])||typeof M.data[0]=="object"||(M.data=[M.data])),yt(M.fields||[],M.data||[],Y);throw new Error("Unable to serialize unrecognized input");function yt(z,L,U){var j="";typeof z=="string"&&(z=JSON.parse(z)),typeof L=="string"&&(L=JSON.parse(L));var Z=Array.isArray(z)&&0<z.length,K=!Array.isArray(L[0]);if(Z&&P){for(var N=0;N<z.length;N++)0<N&&(j+=E),j+=ut(z[N],N);0<L.length&&(j+=F)}for(var A=0;A<L.length;A++){var Q=Z?z.length:L[A].length,X=!1,vt=Z?Object.keys(L[A]).length===0:L[A].length===0;if(U&&!Z&&(X=U==="greedy"?L[A].join("").trim()==="":L[A].length===1&&L[A][0].length===0),U==="greedy"&&Z){for(var ct=[],Ot=0;Ot<Q;Ot++){var _t=K?z[Ot]:Ot;ct.push(L[A][_t])}X=ct.join("").trim()===""}if(!X){for(var et=0;et<Q;et++){0<et&&!vt&&(j+=E);var bt=Z&&K?z[et]:et;j+=ut(L[A][bt],et)}A<L.length-1&&(!U||0<Q&&!vt)&&(j+=F)}}return j}function ut(z,L){if(z==null)return"";if(z.constructor===Date)return JSON.stringify(z).slice(1,25);var U=!1;it&&typeof z=="string"&&it.test(z)&&(z="'"+z,U=!0);var j=z.toString().replace(B,$);return(U=U||O===!0||typeof O=="function"&&O(z,L)||Array.isArray(O)&&O[L]||function(Z,K){for(var N=0;N<K.length;N++)if(-1<Z.indexOf(K[N]))return!0;return!1}(j,l.BAD_DELIMITERS)||-1<j.indexOf(E)||j.charAt(0)===" "||j.charAt(j.length-1)===" ")?q+j+q:j}}};if(l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
36
- `,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!i&&!!r.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=m,l.ParserHandle=x,l.NetworkStreamer=d,l.FileStreamer=f,l.StringStreamer=p,l.ReadableStreamStreamer=y,r.jQuery){var c=r.jQuery;c.fn.parse=function(M){var D=M.config||{},O=[];return this.each(function(F){if(!(c(this).prop("tagName").toUpperCase()==="INPUT"&&c(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var q=0;q<this.files.length;q++)O.push({file:this.files[q],inputElem:this,instanceConfig:c.extend({},D)})}),P(),this;function P(){if(O.length!==0){var F,q,$,Y,I=O[0];if(C(M.before)){var it=M.before(I.file,I.inputElem);if(typeof it=="object"){if(it.action==="abort")return F="AbortError",q=I.file,$=I.inputElem,Y=it.reason,void(C(M.error)&&M.error({name:F},q,$,Y));if(it.action==="skip")return void E();typeof it.config=="object"&&(I.instanceConfig=c.extend(I.instanceConfig,it.config))}else if(it==="skip")return void E()}var B=I.instanceConfig.complete;I.instanceConfig.complete=function(yt){C(B)&&B(yt,I.file,I.inputElem),E()},l.parse(I.file,I.instanceConfig)}else C(M.complete)&&M.complete()}function E(){O.splice(0,1),P()}}}function u(M){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(D){var O=T(D);O.chunkSize=parseInt(O.chunkSize),D.step||D.chunk||(O.chunkSize=null),this._handle=new x(O),(this._handle.streamer=this)._config=O}).call(this,M),this.parseChunk=function(D,O){if(this.isFirstChunk&&C(this._config.beforeFirstChunk)){var P=this._config.beforeFirstChunk(D);P!==void 0&&(D=P)}this.isFirstChunk=!1,this._halted=!1;var E=this._partialLine+D;this._partialLine="";var F=this._handle.parse(E,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var q=F.meta.cursor;this._finished||(this._partialLine=E.substring(q-this._baseIndex),this._baseIndex=q),F&&F.data&&(this._rowCount+=F.data.length);var $=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(a)r.postMessage({results:F,workerId:l.WORKER_ID,finished:$});else if(C(this._config.chunk)&&!O){if(this._config.chunk(F,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);F=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(F.data),this._completeResults.errors=this._completeResults.errors.concat(F.errors),this._completeResults.meta=F.meta),this._completed||!$||!C(this._config.complete)||F&&F.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),$||F&&F.meta.paused||this._nextChunk(),F}this._halted=!0},this._sendError=function(D){C(this._config.error)?this._config.error(D):a&&this._config.error&&r.postMessage({workerId:l.WORKER_ID,error:D,finished:!1})}}function d(M){var D;(M=M||{}).chunkSize||(M.chunkSize=l.RemoteChunkSize),u.call(this,M),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(O){this._input=O,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(D=new XMLHttpRequest,this._config.withCredentials&&(D.withCredentials=this._config.withCredentials),i||(D.onload=S(this._chunkLoaded,this),D.onerror=S(this._chunkError,this)),D.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var O=this._config.downloadRequestHeaders;for(var P in O)D.setRequestHeader(P,O[P])}if(this._config.chunkSize){var E=this._start+this._config.chunkSize-1;D.setRequestHeader("Range","bytes="+this._start+"-"+E)}try{D.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}i&&D.status===0&&this._chunkError()}},this._chunkLoaded=function(){D.readyState===4&&(D.status<200||400<=D.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:D.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(O){var P=O.getResponseHeader("Content-Range");return P===null?-1:parseInt(P.substring(P.lastIndexOf("/")+1))}(D),this.parseChunk(D.responseText)))},this._chunkError=function(O){var P=D.statusText||O;this._sendError(new Error(P))}}function f(M){var D,O;(M=M||{}).chunkSize||(M.chunkSize=l.LocalChunkSize),u.call(this,M);var P=typeof FileReader<"u";this.stream=function(E){this._input=E,O=E.slice||E.webkitSlice||E.mozSlice,P?((D=new FileReader).onload=S(this._chunkLoaded,this),D.onerror=S(this._chunkError,this)):D=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var E=this._input;if(this._config.chunkSize){var F=Math.min(this._start+this._config.chunkSize,this._input.size);E=O.call(E,this._start,F)}var q=D.readAsText(E,this._config.encoding);P||this._chunkLoaded({target:{result:q}})},this._chunkLoaded=function(E){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(E.target.result)},this._chunkError=function(){this._sendError(D.error)}}function p(M){var D;u.call(this,M=M||{}),this.stream=function(O){return D=O,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var O,P=this._config.chunkSize;return P?(O=D.substring(0,P),D=D.substring(P)):(O=D,D=""),this._finished=!D,this.parseChunk(O)}}}function y(M){u.call(this,M=M||{});var D=[],O=!0,P=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(E){this._input=E,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){P&&D.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),D.length?this.parseChunk(D.shift()):O=!0},this._streamData=S(function(E){try{D.push(typeof E=="string"?E:E.toString(this._config.encoding)),O&&(O=!1,this._checkIsFinished(),this.parseChunk(D.shift()))}catch(F){this._streamError(F)}},this),this._streamError=S(function(E){this._streamCleanUp(),this._sendError(E)},this),this._streamEnd=S(function(){this._streamCleanUp(),P=!0,this._streamData("")},this),this._streamCleanUp=S(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function x(M){var D,O,P,E=Math.pow(2,53),F=-E,q=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,$=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Y=this,I=0,it=0,B=!1,yt=!1,ut=[],z={data:[],errors:[],meta:{}};if(C(M.step)){var L=M.step;M.step=function(A){if(z=A,Z())j();else{if(j(),z.data.length===0)return;I+=A.data.length,M.preview&&I>M.preview?O.abort():(z.data=z.data[0],L(z,Y))}}}function U(A){return M.skipEmptyLines==="greedy"?A.join("").trim()==="":A.length===1&&A[0].length===0}function j(){return z&&P&&(N("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),P=!1),M.skipEmptyLines&&(z.data=z.data.filter(function(A){return!U(A)})),Z()&&function(){if(!z)return;function A(X,vt){C(M.transformHeader)&&(X=M.transformHeader(X,vt)),ut.push(X)}if(Array.isArray(z.data[0])){for(var Q=0;Z()&&Q<z.data.length;Q++)z.data[Q].forEach(A);z.data.splice(0,1)}else z.data.forEach(A)}(),function(){if(!z||!M.header&&!M.dynamicTyping&&!M.transform)return z;function A(X,vt){var ct,Ot=M.header?{}:[];for(ct=0;ct<X.length;ct++){var _t=ct,et=X[ct];M.header&&(_t=ct>=ut.length?"__parsed_extra":ut[ct]),M.transform&&(et=M.transform(et,_t)),et=K(_t,et),_t==="__parsed_extra"?(Ot[_t]=Ot[_t]||[],Ot[_t].push(et)):Ot[_t]=et}return M.header&&(ct>ut.length?N("FieldMismatch","TooManyFields","Too many fields: expected "+ut.length+" fields but parsed "+ct,it+vt):ct<ut.length&&N("FieldMismatch","TooFewFields","Too few fields: expected "+ut.length+" fields but parsed "+ct,it+vt)),Ot}var Q=1;return!z.data.length||Array.isArray(z.data[0])?(z.data=z.data.map(A),Q=z.data.length):z.data=A(z.data,0),M.header&&z.meta&&(z.meta.fields=ut),it+=Q,z}()}function Z(){return M.header&&ut.length===0}function K(A,Q){return X=A,M.dynamicTypingFunction&&M.dynamicTyping[X]===void 0&&(M.dynamicTyping[X]=M.dynamicTypingFunction(X)),(M.dynamicTyping[X]||M.dynamicTyping)===!0?Q==="true"||Q==="TRUE"||Q!=="false"&&Q!=="FALSE"&&(function(vt){if(q.test(vt)){var ct=parseFloat(vt);if(F<ct&&ct<E)return!0}return!1}(Q)?parseFloat(Q):$.test(Q)?new Date(Q):Q===""?null:Q):Q;var X}function N(A,Q,X,vt){var ct={type:A,code:Q,message:X};vt!==void 0&&(ct.row=vt),z.errors.push(ct)}this.parse=function(A,Q,X){var vt=M.quoteChar||'"';if(M.newline||(M.newline=function(_t,et){_t=_t.substring(0,1048576);var bt=new RegExp(g(et)+"([^]*?)"+g(et),"gm"),Nt=(_t=_t.replace(bt,"")).split("\r"),De=_t.split(`
37
- `),Ee=1<De.length&&De[0].length<Nt[0].length;if(Nt.length===1||Ee)return`
38
- `;for(var me=0,Lt=0;Lt<Nt.length;Lt++)Nt[Lt][0]===`
39
- `&&me++;return me>=Nt.length/2?`\r
40
- `:"\r"}(A,vt)),P=!1,M.delimiter)C(M.delimiter)&&(M.delimiter=M.delimiter(A),z.meta.delimiter=M.delimiter);else{var ct=function(_t,et,bt,Nt,De){var Ee,me,Lt,Ft;De=De||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Je=0;Je<De.length;Je++){var kt=De[Je],Dn=0,Re=0,tn=0;Lt=void 0;for(var _e=new m({comments:Nt,delimiter:kt,newline:et,preview:10}).parse(_t),Se=0;Se<_e.data.length;Se++)if(bt&&U(_e.data[Se]))tn++;else{var Ae=_e.data[Se].length;Re+=Ae,Lt!==void 0?0<Ae&&(Dn+=Math.abs(Ae-Lt),Lt=Ae):Lt=Ae}0<_e.data.length&&(Re/=_e.data.length-tn),(me===void 0||Dn<=me)&&(Ft===void 0||Ft<Re)&&1.99<Re&&(me=Dn,Ee=kt,Ft=Re)}return{successful:!!(M.delimiter=Ee),bestDelimiter:Ee}}(A,M.newline,M.skipEmptyLines,M.comments,M.delimitersToGuess);ct.successful?M.delimiter=ct.bestDelimiter:(P=!0,M.delimiter=l.DefaultDelimiter),z.meta.delimiter=M.delimiter}var Ot=T(M);return M.preview&&M.header&&Ot.preview++,D=A,O=new m(Ot),z=O.parse(D,Q,X),j(),B?{meta:{paused:!0}}:z||{meta:{paused:!1}}},this.paused=function(){return B},this.pause=function(){B=!0,O.abort(),D=C(M.chunk)?"":D.substring(O.getCharIndex())},this.resume=function(){Y.streamer._halted?(B=!1,Y.streamer.parseChunk(D,!0)):setTimeout(Y.resume,3)},this.aborted=function(){return yt},this.abort=function(){yt=!0,O.abort(),z.meta.aborted=!0,C(M.complete)&&M.complete(z),D=""}}function g(M){return M.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m(M){var D,O=(M=M||{}).delimiter,P=M.newline,E=M.comments,F=M.step,q=M.preview,$=M.fastMode,Y=D=M.quoteChar===void 0||M.quoteChar===null?'"':M.quoteChar;if(M.escapeChar!==void 0&&(Y=M.escapeChar),(typeof O!="string"||-1<l.BAD_DELIMITERS.indexOf(O))&&(O=","),E===O)throw new Error("Comment character same as delimiter");E===!0?E="#":(typeof E!="string"||-1<l.BAD_DELIMITERS.indexOf(E))&&(E=!1),P!==`
41
- `&&P!=="\r"&&P!==`\r
42
- `&&(P=`
43
- `);var I=0,it=!1;this.parse=function(B,yt,ut){if(typeof B!="string")throw new Error("Input must be a string");var z=B.length,L=O.length,U=P.length,j=E.length,Z=C(F),K=[],N=[],A=[],Q=I=0;if(!B)return ce();if(M.header&&!yt){var X=B.split(P)[0].split(O),vt=[],ct={},Ot=!1;for(var _t in X){var et=X[_t];C(M.transformHeader)&&(et=M.transformHeader(et,_t));var bt=et,Nt=ct[et]||0;for(0<Nt&&(Ot=!0,bt=et+"_"+Nt),ct[et]=Nt+1;vt.includes(bt);)bt=bt+"_"+Nt;vt.push(bt)}if(Ot){var De=B.split(P);De[0]=vt.join(O),B=De.join(P)}}if($||$!==!1&&B.indexOf(D)===-1){for(var Ee=B.split(P),me=0;me<Ee.length;me++){if(A=Ee[me],I+=A.length,me!==Ee.length-1)I+=P.length;else if(ut)return ce();if(!E||A.substring(0,j)!==E){if(Z){if(K=[],tn(A.split(O)),ye(),it)return ce()}else tn(A.split(O));if(q&&q<=me)return K=K.slice(0,q),ce(!0)}}return ce()}for(var Lt=B.indexOf(O,I),Ft=B.indexOf(P,I),Je=new RegExp(g(Y)+g(D),"g"),kt=B.indexOf(D,I);;)if(B[I]!==D)if(E&&A.length===0&&B.substring(I,I+j)===E){if(Ft===-1)return ce();I=Ft+U,Ft=B.indexOf(P,I),Lt=B.indexOf(O,I)}else if(Lt!==-1&&(Lt<Ft||Ft===-1))A.push(B.substring(I,Lt)),I=Lt+L,Lt=B.indexOf(O,I);else{if(Ft===-1)break;if(A.push(B.substring(I,Ft)),Ae(Ft+U),Z&&(ye(),it))return ce();if(q&&K.length>=q)return ce(!0)}else for(kt=I,I++;;){if((kt=B.indexOf(D,kt+1))===-1)return ut||N.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:K.length,index:I}),Se();if(kt===z-1)return Se(B.substring(I,kt).replace(Je,D));if(D!==Y||B[kt+1]!==Y){if(D===Y||kt===0||B[kt-1]!==Y){Lt!==-1&&Lt<kt+1&&(Lt=B.indexOf(O,kt+1)),Ft!==-1&&Ft<kt+1&&(Ft=B.indexOf(P,kt+1));var Dn=_e(Ft===-1?Lt:Math.min(Lt,Ft));if(B.substr(kt+1+Dn,L)===O){A.push(B.substring(I,kt).replace(Je,D)),B[I=kt+1+Dn+L]!==D&&(kt=B.indexOf(D,I)),Lt=B.indexOf(O,I),Ft=B.indexOf(P,I);break}var Re=_e(Ft);if(B.substring(kt+1+Re,kt+1+Re+U)===P){if(A.push(B.substring(I,kt).replace(Je,D)),Ae(kt+1+Re+U),Lt=B.indexOf(O,I),kt=B.indexOf(D,I),Z&&(ye(),it))return ce();if(q&&K.length>=q)return ce(!0);break}N.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:K.length,index:I}),kt++}}else kt++}return Se();function tn(Kt){K.push(Kt),Q=I}function _e(Kt){var _a=0;if(Kt!==-1){var vr=B.substring(kt+1,Kt);vr&&vr.trim()===""&&(_a=vr.length)}return _a}function Se(Kt){return ut||(Kt===void 0&&(Kt=B.substring(I)),A.push(Kt),I=z,tn(A),Z&&ye()),ce()}function Ae(Kt){I=Kt,tn(A),A=[],Ft=B.indexOf(P,I)}function ce(Kt){return{data:K,errors:N,meta:{delimiter:O,linebreak:P,aborted:it,truncated:!!Kt,cursor:Q+(yt||0)}}}function ye(){F(ce()),K=[],N=[]}},this.abort=function(){it=!0},this.getCharIndex=function(){return I}}function v(M){var D=M.data,O=s[D.workerId],P=!1;if(D.error)O.userError(D.error,D.file);else if(D.results&&D.results.data){var E={abort:function(){P=!0,b(D.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:w,resume:w};if(C(O.userStep)){for(var F=0;F<D.results.data.length&&(O.userStep({data:D.results.data[F],errors:D.results.errors,meta:D.results.meta},E),!P);F++);delete D.results}else C(O.userChunk)&&(O.userChunk(D.results,E,D.file),delete D.results)}D.finished&&!P&&b(D.workerId,D.results)}function b(M,D){var O=s[M];C(O.userComplete)&&O.userComplete(D),O.terminate(),delete s[M]}function w(){throw new Error("Not implemented.")}function T(M){if(typeof M!="object"||M===null)return M;var D=Array.isArray(M)?[]:{};for(var O in M)D[O]=T(M[O]);return D}function S(M,D){return function(){M.apply(D,arguments)}}function C(M){return typeof M=="function"}return a&&(r.onmessage=function(M){var D=M.data;if(l.WORKER_ID===void 0&&D&&(l.WORKER_ID=D.workerId),typeof D.input=="string")r.postMessage({workerId:l.WORKER_ID,results:l.parse(D.input,D.config),finished:!0});else if(r.File&&D.input instanceof File||D.input instanceof Object){var O=l.parse(D.input,D.config);O&&r.postMessage({workerId:l.WORKER_ID,results:O,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(p.prototype=Object.create(p.prototype)).constructor=p,(y.prototype=Object.create(u.prototype)).constructor=y,l})})(ap);var OS=ap.exports;const PS=["id"],ES=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,r=n,i=h.computed(()=>`export_${new Date().getTime()}`),a=h.computed(()=>{const u=l();return u.length?u:null}),s=()=>{const u=r.labels;if(typeof r.fields!==qn.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===qn.Object?d=>QD(d,(f,p)=>u[p]||p):d=>d},o=()=>{const u=r.fields;if(typeof r.fields!==qn.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>kS(d,u):d=>d},l=()=>{if(typeof r.fields===qn.Undefined&&typeof r.labels===qn.Undefined)return r.data;const u=s(),d=o();return r.data.map(f=>u(d(f)))},c=()=>{if(!(a!=null&&a.value)){console.warn("No data to export");return}e("export-started",a.value);let u=OS.unparse(a.value,Object.assign({delimiter:r.delimiter,encoding:r.encoding}));if(r.separatorExcel&&(u="SEP="+r.delimiter+`\r
44
- `+u),r.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",r.filename),!r.testing){const d=new Blob([u],{type:"text/csv;charset="+r.encoding});CS.saveAs(d,r.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:i.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,PS))}}),RS=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(r,i)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(ES,{data:r.rows,fields:e.value,filename:r.filename,labels:r.headers},{default:h.withCtx(()=>[h.renderSlot(r.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),AS={class:"kong-ui-public-csv-export-modal"},LS={key:0,class:"selected-range"},IS={key:1,class:"text-muted",tag:"span"},sp=3,op=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=St.useI18n(),r=n,i=t,a=`${r.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,s=h.ref(!0),o=h.computed(()=>{var x,g;return!!((g=(x=r.chartData)==null?void 0:x.data)!=null&&g.length)}),l=h.ref(1),c=h.computed(()=>p.value.rows.length),u=St.useChartSelectedRange(h.toRef(r,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(sp,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{i("toggleModal",!1)},p=h.computed(()=>{var T,S,C;if(!o.value||!((T=r.chartData)!=null&&T.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const x=r.chartData.data.some(M=>M.timestamp!==r.chartData.data[0].timestamp),g=r.chartData.data.map(M=>{const D=new Date(M.timestamp);return{...Object.keys(M.event).reduce((P,E)=>{if(E in r.chartData.meta.display){const F=M.event[E],q=r.chartData.meta.display[E];P[E]=F&&q&&q[F].name||M.event[E]}else P[E]=M.event[E];return P},{}),...x?{timestamp:ko(D,"yyyy-MM-dd HH:mm:ss"),tzOffset:ko(D,"XXX")}:{}}});let m=[];x&&(m=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const v="display"in r.chartData.meta&&((S=r.chartData.meta)!=null&&S.display)?(C=r.chartData.meta)==null?void 0:C.display:{},b=[...m,...Object.keys(v).map(M=>({label:e.t(`chartLabels.${M}`),key:M})),...r.chartData.meta.metric_names.map(M=>({label:e.t(`chartLabels.${M}`),key:M}))],w=b.reduce((M,D)=>(M[D.key]=D.label,M),{});return{headers:b,csvHeaders:w,rows:g}}),y=()=>{const{rows:x}=p.value;return s.value=!1,{total:Number(x.length)||0,data:x.slice(0,sp)}};return h.watch(p,()=>{l.value++}),(x,g)=>{const m=h.resolveComponent("KEmptyState"),v=h.resolveComponent("KTable"),b=h.resolveComponent("KButton"),w=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",AS,[h.createVNode(w,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:h.withKeys(f,["esc"])},{default:h.withCtx(()=>{var T;return[h.createElementVNode("div",null,[o.value?(h.openBlock(),h.createElementBlock("div",LS,[h.createElementVNode("p",null,h.toDisplayString(x.modalDescription?x.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(h.unref(u)),1)])):h.createCommentVNode("",!0),h.createVNode(v,{class:"vitals-table","disable-pagination":"",fetcher:y,"fetcher-cache-key":String(l.value),headers:((T=p.value)==null?void 0:T.headers)||[],"row-hover":!1,sortable:!1},{"empty-state":h.withCtx(()=>[h.createVNode(m,{"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),default:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!s.value&&o.value?(h.openBlock(),h.createElementBlock("div",IS,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(b,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(RS,{class:"vitals-report-export-button",filename:a,headers:p.value.csvHeaders,rows:p.value.rows},{default:h.withCtx(()=>[h.createVNode(b,{appearance:"primary","data-testid":"csv-download-button",disabled:s.value||!o.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),lp=h.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=St.useI18n(),r=h.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),i=h.ref(!1),a=o=>{i.value=o},s=()=>{a(!0)};return(o,l)=>{const c=h.resolveComponent("KButton");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(s,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.text||h.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),i.value?(h.openBlock(),h.createBlock(op,{key:0,"chart-data":n.data,filename:r.value,onToggleModal:a},null,8,["chart-data","filename"])):h.createCommentVNode("",!0)],64)}}}),NS={class:"analytics-chart-shell"},FS={key:0,class:"chart-header"},US={key:0,class:"chart-title"},BS={class:"chart-header-icons-wrapper"},WS={key:1,class:"chart-export-button"},zS={key:2,class:"analytics-chart-parent"},YS=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Wt.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=St.useI18n(),r=h.toRef(t,"chartData"),i=h.computed(()=>p.value?St.useExploreResultToTimeDataset({fill:t.chartOptions.stacked,colorPalette:t.chartOptions.chartDatasetColors||oa},h.toRef(t,"chartData")).value:St.useExploreResultToDatasets({fill:t.chartOptions.stacked,colorPalette:t.chartOptions.chartDatasetColors||oa},h.toRef(t,"chartData")).value),a=h.computed(()=>{var O;return(O=t.chartData)!=null&&O.meta?"start_ms"in t.chartData.meta?t.chartData.meta.end_ms-t.chartData.meta.start_ms:void 0:0}),s=h.computed(()=>{var O;return(O=t.chartData.meta)!=null&&O.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),o=h.computed(()=>t.showLegendValues&&t.legendPosition!==Wt.Bottom),{legendValues:l}=St.useChartLegendValues(i,t.chartOptions.type,s),c=h.computed(()=>{var O,P,E;return((E=(P=(O=t.chartData)==null?void 0:O.meta)==null?void 0:P.limit)==null?void 0:E.toString())||null}),u=h.computed(()=>{var O,P;return((P=(O=t.chartData)==null?void 0:O.meta)==null?void 0:P.truncated)||!1}),d=e.t("limitedResultsShown",{maxReturned:c.value}),f=h.computed(()=>[ee.VERTICAL_BAR.toString(),ee.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),p=h.computed(()=>[ee.TIMESERIES_BAR,ee.TIMESERIES_LINE].some(O=>O===t.chartOptions.type)),y=h.computed(()=>t.chartOptions.type===ee.DOUGHNUT),x=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),g=h.computed(()=>{var E,F,q;if(!((E=t.chartData)!=null&&E.meta.metric_names)||!((F=t.chartData)!=null&&F.meta.metric_units))return;const O=t.chartData.meta.metric_names[0],P=t.chartData.meta.metric_units[O];if(t.chartData.meta.metric_names.length>1){if(O.includes("latency"))return e.t("metricAxisTitles.latency_in",{unit:e.t(`chartUnits.${P}`,{plural:"s"})});if(O.includes("size"))return e.t("metricAxisTitles.size_in",{unit:e.t(`chartUnits.${P}`,{plural:"s"})})}return((q=t.chartOptions)==null?void 0:q.metricAxesTitle)||e.te(`metricAxisTitles.${O}`)&&e.te(`chartUnits.${P}`)&&e.t(`metricAxisTitles.${O}`,{unit:e.t(`chartUnits.${P}`,{plural:"s"})})||void 0}),m=h.computed(()=>{const O=p.value?"Time":Object.keys(t.chartData.meta.display||t.chartData.meta.metric_names)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${O}`)&&e.t(`chartLabels.${O}`)||void 0}),v=h.computed(()=>{const O=jl(Number(t.chartData.meta.granularity_ms));return e.t(`granularityAxisTitles.${O}`)}),b=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),w=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),T=h.computed(()=>p.value?E_(i.value):t.chartData&&t.chartData.meta&&t.chartData.data.length),S=h.computed(()=>T.value&&u.value&&c.value||t.chartTitle||t.allowCsvExport&&T.value),C=h.computed(()=>t.chartData.meta.granularity_ms?jl(t.chartData.meta.granularity_ms)||"hourly":jl(new Date(t.chartData.data[1].timestamp).getTime()-new Date(t.chartData.data[0].timestamp).getTime())||"hourly"),M=h.computed(()=>t.chartOptions.chartLegendSortFn?t.chartOptions.chartLegendSortFn:(O,P)=>O.text===e.t("chartLabels.____OTHER____")?1:P.text===e.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(O.text,10))&&!isNaN(parseInt(P.text,10))?O.text<P.text?-1:1:O.value&&P.value?P.value.raw-O.value.raw:0),D=h.computed(()=>t.chartOptions.chartTooltipSortFn?t.chartOptions.chartTooltipSortFn:(O,P)=>O.label===e.t("chartLabels.____OTHER____")?1:P.label===e.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(O.label,10))&&!isNaN(parseInt(P.label,10))?O.label<P.label?-1:1:O.value&&P.value?P.rawValue-O.rawValue:0);return h.provide("showLegendValues",o),h.provide("legendPosition",h.toRef(t,"legendPosition")),(O,P)=>{const E=h.resolveComponent("KTooltip"),F=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",NS,[S.value?(h.openBlock(),h.createElementBlock("div",FS,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",US,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",BS,[T.value&&u.value&&c.value?(h.openBlock(),h.createBlock(E,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(d)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(ic.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(WT)})`,decorative:"",size:h.unref(zT)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&T.value?(h.openBlock(),h.createElementBlock("div",WS,[h.createVNode(lp,{data:r.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0),T.value?(h.openBlock(),h.createElementBlock("div",zS,[p.value?(h.openBlock(),h.createBlock(GD,{key:0,"chart-data":i.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":D.value,"dimension-axes-title":v.value,fill:n.chartOptions.stacked,granularity:C.value,"legend-values":h.unref(l),"metric-axes-title":g.value,"metric-unit":s.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":a.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-title","type"])):f.value?(h.openBlock(),h.createBlock(fM,{key:1,annotations:n.showAnnotations,"chart-data":i.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":D.value,"data-testid":"bar-chart-container","dimension-axes-title":m.value,"legend-values":h.unref(l),"metric-axes-title":g.value,"metric-unit":s.value,orientation:x.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):y.value?(h.openBlock(),h.createBlock(MM,{key:2,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors||h.unref(oa),"legend-position":n.legendPosition,"legend-values":h.unref(l),"metric-unit":s.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(F,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(b.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(w.value),1)]),_:1}))])}}}),HS=Ze(YS,[["__scopeId","data-v-cb8778ab"]]),$S={class:"chart-parent","data-testid":"doughnut-chart-parent"},jS={class:"chart-totals-flex"},VS={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},qS=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:or.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Qe},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}=St.useI18n(),r=h.ref(Tn()),i=h.computed(()=>[t.chartData.datasets.reduce((y,x)=>(y.labels.push(x.label),y.borderColor.push(x.backgroundColor),y.backgroundColor.push(x.backgroundColor),y.data.push(x.data.reduce((g,m)=>g+m,0)),y),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),a=h.computed(()=>({...t.chartData,datasets:i.value}));St.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const s={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=h.ref(),l=h.computed(()=>{var p;return ii((p=i==null?void 0:i.value[0])==null?void 0:p.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var p,y;return ii(((p=i==null?void 0:i.value[0])==null?void 0:p.data[0])+((y=i==null?void 0:i.value[0])==null?void 0:y.data[1]),{capital:!0})}),u=h.computed(()=>{var p;return`color: ${(p=i==null?void 0:i.value[0])==null?void 0:p.backgroundColor[t.numerator]}`}),d=h.computed(()=>[or.Full,or.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===or.Full);return(p,y)=>(h.openBlock(),h.createElementBlock("div",$S,[h.createElementVNode("div",jS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",VS,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(kh),{ref_key:"chartInstance",ref:o,"chart-id":r.value,data:a.value,options:s},null,8,["chart-id","data","options"])],4)]))}}),XS=Ze(qS,[["__scopeId","data-v-18bc031c"]]),GS={class:"simple-chart-shell"},KS={key:1,class:"analytics-chart-parent"},QS=Ze(h.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}=St.useI18n(),r=h.computed(()=>{var c;const l=St.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Qe},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),i=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),a=h.computed(()=>t.chartOptions.type===na.GAUGE),s=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),o=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",GS,[o.value?(h.openBlock(),h.createElementBlock("div",KS,[a.value?(h.openBlock(),h.createBlock(XS,{key:0,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":i.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(s.value),1)]),_:1}))])}}}),[["__scopeId","data-v-a1582f51"]]),ZS={class:"top-n-card-title","data-testid":"top-n-card-title"},JS={class:"top-n-card-description","data-testid":"top-n-card-description"},tk={key:3,class:"top-n-table","data-testid":"top-n-table"},ek={class:"table-headings"},nk={class:"table-row"},rk={class:"column-1"},ik={class:"column-2"},ak={class:"table-body","data-testid":"top-n-data"},sk=["data-testid"],ok={class:"column-1"},lk={class:"column-2"},ck=Ze(h.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},titleTag:{type:String,default:"h2"}},setup(n){const t=n,{i18n:e}=St.useI18n(),r=h.computed(()=>t.data.data),i=h.computed(()=>{var y;return!!((y=r.value)!=null&&y.length)}),a=h.computed(()=>{var y,x;return(y=t.data.meta)!=null&&y.display&&((x=Object.keys(t.data.meta.display))==null?void 0:x[0])||""}),s=h.computed(()=>a.value?t.data.meta.display[a.value]:{}),o=h.computed(()=>{var y,x;return(x=(y=t.data.meta)==null?void 0:y.metric_names)!=null&&x.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>o.value?e.t(`chartLabels.${o.value}`)||o.value:""),c=h.computed(()=>{if(!i.value)return"";if(t.data.meta){if(s.value&&!Object.keys(s.value).length)return e.t("topNTable.errors.display");if(!o.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=y=>{const x=y.event;return String(x[a.value])},d=y=>{const x=u(y),g=s.value&&s.value[x];return g?g.name:"-"},f=y=>{const x=u(y),g=s.value&&s.value[x];return g?!!g.deleted:!1},p=y=>{if(!o.value)return"–";const g=y.event[o.value];return g?ii(g,{capital:!0,round:!0}):"–"};return(y,x)=>{const g=h.resolveComponent("KEmptyState"),m=h.resolveComponent("KSkeleton"),v=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(v,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(g,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(m,{key:1,"table-columns":2,type:"table"})):i.value?(h.openBlock(),h.createElementBlock("div",tk,[h.createElementVNode("div",ek,[h.createElementVNode("div",nk,[h.createElementVNode("div",rk,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",ik,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",ak,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(r.value,(b,w)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${w}`,class:"table-row","data-testid":`row-${u(b)}`},[h.createElementVNode("div",ok,[h.renderSlot(y.$slots,"name",{record:{id:u(b),name:d(b),deleted:f(b),dimension:a.value}},()=>[h.createTextVNode(h.toDisplayString(d(b)),1)],!0)]),h.createElementVNode("div",lk,"   "+h.toDisplayString(p(b)),1)],8,sk))),128))])])):(h.openBlock(),h.createBlock(g,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",ZS,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",JS,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-50809fdb"]]);at.AnalyticsChart=HS,at.ChartLegendPosition=Wt,at.ChartMetricDisplay=or,at.ChartTypes=ee,at.ChartTypesSimple=na,at.CsvExportButton=lp,at.CsvExportModal=op,at.DECIMAL_DISPLAY=wf,at.FONT_SIZE_REGULAR=Mf,at.FONT_SIZE_SMALL=Tf,at.MAX_LABEL_LENGTH=sa,at.OTHERS_COLOR=Vw,at.SimpleChart=QS,at.TopNTable=ck,at.ValidType=qn,at.accessibleGrey=kf,at.apiRequestStatusCodeColors=Cf,at.codesInSpec=Rf,at.darkenColor=Sf,at.datavisPalette=Qe,at.defaultStatusCodeColors=oa,at.errorRateColors=$w,at.formatTime=aa,at.latencyColors=jw,at.lightGrey=Ro,at.lookupColor=qw,at.lookupDatavisColor=cr,at.lookupStatusCodeCategoryColor=t1,at.lookupStatusCodeColor=Ao,at.numberFormatter=ia,at.statusCodeBadgeBackgroundColor=Yw,at.trafficColors=Hw,Object.defineProperty(at,Symbol.toStringTag,{value:"Module"})});
33
+ */(function(n,t){(function(e,i){n.exports=i()})(ne,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s=!i.document&&!!i.postMessage,r=i.IS_PAPA_WORKER||!1,o={},a=0,l={parse:function(b,x){var D=(x=x||{}).dynamicTyping||!1;if(T(D)&&(x.dynamicTypingFunction=D,D={}),x.dynamicTyping=D,x.transform=!!T(x.transform)&&x.transform,x.worker&&l.WORKERS_SUPPORTED){var E=function(){if(!l.WORKERS_SUPPORTED)return!1;var F=(K=i.URL||i.webkitURL||null,j=e.toString(),l.BLOB_URL||(l.BLOB_URL=K.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",j,")();"],{type:"text/javascript"})))),$=new i.Worker(F),K,j;return $.onmessage=S,$.id=a++,o[$.id]=$}();return E.userStep=x.step,E.userChunk=x.chunk,E.userComplete=x.complete,E.userError=x.error,x.step=T(x.step),x.chunk=T(x.chunk),x.complete=T(x.complete),x.error=T(x.error),delete x.worker,void E.postMessage({input:b,config:x,workerId:E.id})}var A=null;return l.NODE_STREAM_INPUT,typeof b=="string"?(b=function(F){return F.charCodeAt(0)===65279?F.slice(1):F}(b),A=x.download?new d(x):new g(x)):b.readable===!0&&T(b.read)&&T(b.on)?A=new p(x):(i.File&&b instanceof File||b instanceof Object)&&(A=new f(x)),A.stream(b)},unparse:function(b,x){var D=!1,E=!0,A=",",F=`\r
34
+ `,$='"',K=$+$,j=!1,N=null,st=!1;(function(){if(typeof x=="object"){if(typeof x.delimiter!="string"||l.BAD_DELIMITERS.filter(function(H){return x.delimiter.indexOf(H)!==-1}).length||(A=x.delimiter),(typeof x.quotes=="boolean"||typeof x.quotes=="function"||Array.isArray(x.quotes))&&(D=x.quotes),typeof x.skipEmptyLines!="boolean"&&typeof x.skipEmptyLines!="string"||(j=x.skipEmptyLines),typeof x.newline=="string"&&(F=x.newline),typeof x.quoteChar=="string"&&($=x.quoteChar),typeof x.header=="boolean"&&(E=x.header),Array.isArray(x.columns)){if(x.columns.length===0)throw new Error("Option columns is empty");N=x.columns}x.escapeChar!==void 0&&(K=x.escapeChar+$),(typeof x.escapeFormulae=="boolean"||x.escapeFormulae instanceof RegExp)&&(st=x.escapeFormulae instanceof RegExp?x.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var B=new RegExp(_($),"g");if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return At(null,b,j);if(typeof b[0]=="object")return At(N||Object.keys(b[0]),b,j)}else if(typeof b=="object")return typeof b.data=="string"&&(b.data=JSON.parse(b.data)),Array.isArray(b.data)&&(b.fields||(b.fields=b.meta&&b.meta.fields||N),b.fields||(b.fields=Array.isArray(b.data[0])?b.fields:typeof b.data[0]=="object"?Object.keys(b.data[0]):[]),Array.isArray(b.data[0])||typeof b.data[0]=="object"||(b.data=[b.data])),At(b.fields||[],b.data||[],j);throw new Error("Unable to serialize unrecognized input");function At(H,L,z){var V="";typeof H=="string"&&(H=JSON.parse(H)),typeof L=="string"&&(L=JSON.parse(L));var q=Array.isArray(H)&&0<H.length,Q=!Array.isArray(L[0]);if(q&&E){for(var Y=0;Y<H.length;Y++)0<Y&&(V+=A),V+=wt(H[Y],Y);0<L.length&&(V+=F)}for(var W=0;W<L.length;W++){var et=q?H.length:L[W].length,X=!1,kt=q?Object.keys(L[W]).length===0:L[W].length===0;if(z&&!q&&(X=z==="greedy"?L[W].join("").trim()==="":L[W].length===1&&L[W][0].length===0),z==="greedy"&&q){for(var lt=[],Ht=0;Ht<et;Ht++){var Dt=Q?H[Ht]:Ht;lt.push(L[W][Dt])}X=lt.join("").trim()===""}if(!X){for(var pt=0;pt<et;pt++){0<pt&&!kt&&(V+=A);var ie=q&&Q?H[pt]:pt;V+=wt(L[W][ie],pt)}W<L.length-1&&(!z||0<et&&!kt)&&(V+=F)}}return V}function wt(H,L){if(H==null)return"";if(H.constructor===Date)return JSON.stringify(H).slice(1,25);var z=!1;st&&typeof H=="string"&&st.test(H)&&(H="'"+H,z=!0);var V=H.toString().replace(B,K);return(z=z||D===!0||typeof D=="function"&&D(H,L)||Array.isArray(D)&&D[L]||function(q,Q){for(var Y=0;Y<Q.length;Y++)if(-1<q.indexOf(Q[Y]))return!0;return!1}(V,l.BAD_DELIMITERS)||-1<V.indexOf(A)||V.charAt(0)===" "||V.charAt(V.length-1)===" ")?$+V+$:V}}};if(l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
35
+ `,'"',l.BYTE_ORDER_MARK],l.WORKERS_SUPPORTED=!s&&!!i.Worker,l.NODE_STREAM_INPUT=1,l.LocalChunkSize=10485760,l.RemoteChunkSize=5242880,l.DefaultDelimiter=",",l.Parser=w,l.ParserHandle=y,l.NetworkStreamer=d,l.FileStreamer=f,l.StringStreamer=g,l.ReadableStreamStreamer=p,i.jQuery){var c=i.jQuery;c.fn.parse=function(b){var x=b.config||{},D=[];return this.each(function(F){if(!(c(this).prop("tagName").toUpperCase()==="INPUT"&&c(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var $=0;$<this.files.length;$++)D.push({file:this.files[$],inputElem:this,instanceConfig:c.extend({},x)})}),E(),this;function E(){if(D.length!==0){var F,$,K,j,N=D[0];if(T(b.before)){var st=b.before(N.file,N.inputElem);if(typeof st=="object"){if(st.action==="abort")return F="AbortError",$=N.file,K=N.inputElem,j=st.reason,void(T(b.error)&&b.error({name:F},$,K,j));if(st.action==="skip")return void A();typeof st.config=="object"&&(N.instanceConfig=c.extend(N.instanceConfig,st.config))}else if(st==="skip")return void A()}var B=N.instanceConfig.complete;N.instanceConfig.complete=function(At){T(B)&&B(At,N.file,N.inputElem),A()},l.parse(N.file,N.instanceConfig)}else T(b.complete)&&b.complete()}function A(){D.splice(0,1),E()}}}function u(b){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(x){var D=M(x);D.chunkSize=parseInt(D.chunkSize),x.step||x.chunk||(D.chunkSize=null),this._handle=new y(D),(this._handle.streamer=this)._config=D}).call(this,b),this.parseChunk=function(x,D){if(this.isFirstChunk&&T(this._config.beforeFirstChunk)){var E=this._config.beforeFirstChunk(x);E!==void 0&&(x=E)}this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+x;this._partialLine="";var F=this._handle.parse(A,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var $=F.meta.cursor;this._finished||(this._partialLine=A.substring($-this._baseIndex),this._baseIndex=$),F&&F.data&&(this._rowCount+=F.data.length);var K=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(r)i.postMessage({results:F,workerId:l.WORKER_ID,finished:K});else if(T(this._config.chunk)&&!D){if(this._config.chunk(F,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);F=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(F.data),this._completeResults.errors=this._completeResults.errors.concat(F.errors),this._completeResults.meta=F.meta),this._completed||!K||!T(this._config.complete)||F&&F.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),K||F&&F.meta.paused||this._nextChunk(),F}this._halted=!0},this._sendError=function(x){T(this._config.error)?this._config.error(x):r&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:x,finished:!1})}}function d(b){var x;(b=b||{}).chunkSize||(b.chunkSize=l.RemoteChunkSize),u.call(this,b),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(D){this._input=D,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(x=new XMLHttpRequest,this._config.withCredentials&&(x.withCredentials=this._config.withCredentials),s||(x.onload=C(this._chunkLoaded,this),x.onerror=C(this._chunkError,this)),x.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var D=this._config.downloadRequestHeaders;for(var E in D)x.setRequestHeader(E,D[E])}if(this._config.chunkSize){var A=this._start+this._config.chunkSize-1;x.setRequestHeader("Range","bytes="+this._start+"-"+A)}try{x.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}s&&x.status===0&&this._chunkError()}},this._chunkLoaded=function(){x.readyState===4&&(x.status<200||400<=x.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:x.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(D){var E=D.getResponseHeader("Content-Range");return E===null?-1:parseInt(E.substring(E.lastIndexOf("/")+1))}(x),this.parseChunk(x.responseText)))},this._chunkError=function(D){var E=x.statusText||D;this._sendError(new Error(E))}}function f(b){var x,D;(b=b||{}).chunkSize||(b.chunkSize=l.LocalChunkSize),u.call(this,b);var E=typeof FileReader<"u";this.stream=function(A){this._input=A,D=A.slice||A.webkitSlice||A.mozSlice,E?((x=new FileReader).onload=C(this._chunkLoaded,this),x.onerror=C(this._chunkError,this)):x=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var A=this._input;if(this._config.chunkSize){var F=Math.min(this._start+this._config.chunkSize,this._input.size);A=D.call(A,this._start,F)}var $=x.readAsText(A,this._config.encoding);E||this._chunkLoaded({target:{result:$}})},this._chunkLoaded=function(A){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(A.target.result)},this._chunkError=function(){this._sendError(x.error)}}function g(b){var x;u.call(this,b=b||{}),this.stream=function(D){return x=D,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var D,E=this._config.chunkSize;return E?(D=x.substring(0,E),x=x.substring(E)):(D=x,x=""),this._finished=!x,this.parseChunk(D)}}}function p(b){u.call(this,b=b||{});var x=[],D=!0,E=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(A){this._input=A,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){E&&x.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),x.length?this.parseChunk(x.shift()):D=!0},this._streamData=C(function(A){try{x.push(typeof A=="string"?A:A.toString(this._config.encoding)),D&&(D=!1,this._checkIsFinished(),this.parseChunk(x.shift()))}catch(F){this._streamError(F)}},this),this._streamError=C(function(A){this._streamCleanUp(),this._sendError(A)},this),this._streamEnd=C(function(){this._streamCleanUp(),E=!0,this._streamData("")},this),this._streamCleanUp=C(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(b){var x,D,E,A=Math.pow(2,53),F=-A,$=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,K=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,j=this,N=0,st=0,B=!1,At=!1,wt=[],H={data:[],errors:[],meta:{}};if(T(b.step)){var L=b.step;b.step=function(W){if(H=W,q())V();else{if(V(),H.data.length===0)return;N+=W.data.length,b.preview&&N>b.preview?D.abort():(H.data=H.data[0],L(H,j))}}}function z(W){return b.skipEmptyLines==="greedy"?W.join("").trim()==="":W.length===1&&W[0].length===0}function V(){return H&&E&&(Y("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),E=!1),b.skipEmptyLines&&(H.data=H.data.filter(function(W){return!z(W)})),q()&&function(){if(!H)return;function W(X,kt){T(b.transformHeader)&&(X=b.transformHeader(X,kt)),wt.push(X)}if(Array.isArray(H.data[0])){for(var et=0;q()&&et<H.data.length;et++)H.data[et].forEach(W);H.data.splice(0,1)}else H.data.forEach(W)}(),function(){if(!H||!b.header&&!b.dynamicTyping&&!b.transform)return H;function W(X,kt){var lt,Ht=b.header?{}:[];for(lt=0;lt<X.length;lt++){var Dt=lt,pt=X[lt];b.header&&(Dt=lt>=wt.length?"__parsed_extra":wt[lt]),b.transform&&(pt=b.transform(pt,Dt)),pt=Q(Dt,pt),Dt==="__parsed_extra"?(Ht[Dt]=Ht[Dt]||[],Ht[Dt].push(pt)):Ht[Dt]=pt}return b.header&&(lt>wt.length?Y("FieldMismatch","TooManyFields","Too many fields: expected "+wt.length+" fields but parsed "+lt,st+kt):lt<wt.length&&Y("FieldMismatch","TooFewFields","Too few fields: expected "+wt.length+" fields but parsed "+lt,st+kt)),Ht}var et=1;return!H.data.length||Array.isArray(H.data[0])?(H.data=H.data.map(W),et=H.data.length):H.data=W(H.data,0),b.header&&H.meta&&(H.meta.fields=wt),st+=et,H}()}function q(){return b.header&&wt.length===0}function Q(W,et){return X=W,b.dynamicTypingFunction&&b.dynamicTyping[X]===void 0&&(b.dynamicTyping[X]=b.dynamicTypingFunction(X)),(b.dynamicTyping[X]||b.dynamicTyping)===!0?et==="true"||et==="TRUE"||et!=="false"&&et!=="FALSE"&&(function(kt){if($.test(kt)){var lt=parseFloat(kt);if(F<lt&&lt<A)return!0}return!1}(et)?parseFloat(et):K.test(et)?new Date(et):et===""?null:et):et;var X}function Y(W,et,X,kt){var lt={type:W,code:et,message:X};kt!==void 0&&(lt.row=kt),H.errors.push(lt)}this.parse=function(W,et,X){var kt=b.quoteChar||'"';if(b.newline||(b.newline=function(Dt,pt){Dt=Dt.substring(0,1048576);var ie=new RegExp(_(pt)+"([^]*?)"+_(pt),"gm"),se=(Dt=Dt.replace(ie,"")).split("\r"),ge=Dt.split(`
36
+ `),xe=1<ge.length&&ge[0].length<se[0].length;if(se.length===1||xe)return`
37
+ `;for(var re=0,St=0;St<se.length;St++)se[St][0]===`
38
+ `&&re++;return re>=se.length/2?`\r
39
+ `:"\r"}(W,kt)),E=!1,b.delimiter)T(b.delimiter)&&(b.delimiter=b.delimiter(W),H.meta.delimiter=b.delimiter);else{var lt=function(Dt,pt,ie,se,ge){var xe,re,St,Mt;ge=ge||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ze=0;ze<ge.length;ze++){var gt=ge[ze],un=0,we=0,He=0;St=void 0;for(var ue=new w({comments:se,delimiter:gt,newline:pt,preview:10}).parse(Dt),pe=0;pe<ue.data.length;pe++)if(ie&&z(ue.data[pe]))He++;else{var ke=ue.data[pe].length;we+=ke,St!==void 0?0<ke&&(un+=Math.abs(ke-St),St=ke):St=ke}0<ue.data.length&&(we/=ue.data.length-He),(re===void 0||un<=re)&&(Mt===void 0||Mt<we)&&1.99<we&&(re=un,xe=gt,Mt=we)}return{successful:!!(b.delimiter=xe),bestDelimiter:xe}}(W,b.newline,b.skipEmptyLines,b.comments,b.delimitersToGuess);lt.successful?b.delimiter=lt.bestDelimiter:(E=!0,b.delimiter=l.DefaultDelimiter),H.meta.delimiter=b.delimiter}var Ht=M(b);return b.preview&&b.header&&Ht.preview++,x=W,D=new w(Ht),H=D.parse(x,et,X),V(),B?{meta:{paused:!0}}:H||{meta:{paused:!1}}},this.paused=function(){return B},this.pause=function(){B=!0,D.abort(),x=T(b.chunk)?"":x.substring(D.getCharIndex())},this.resume=function(){j.streamer._halted?(B=!1,j.streamer.parseChunk(x,!0)):setTimeout(j.resume,3)},this.aborted=function(){return At},this.abort=function(){At=!0,D.abort(),H.meta.aborted=!0,T(b.complete)&&b.complete(H),x=""}}function _(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(b){var x,D=(b=b||{}).delimiter,E=b.newline,A=b.comments,F=b.step,$=b.preview,K=b.fastMode,j=x=b.quoteChar===void 0||b.quoteChar===null?'"':b.quoteChar;if(b.escapeChar!==void 0&&(j=b.escapeChar),(typeof D!="string"||-1<l.BAD_DELIMITERS.indexOf(D))&&(D=","),A===D)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<l.BAD_DELIMITERS.indexOf(A))&&(A=!1),E!==`
40
+ `&&E!=="\r"&&E!==`\r
41
+ `&&(E=`
42
+ `);var N=0,st=!1;this.parse=function(B,At,wt){if(typeof B!="string")throw new Error("Input must be a string");var H=B.length,L=D.length,z=E.length,V=A.length,q=T(F),Q=[],Y=[],W=[],et=N=0;if(!B)return Kt();if(b.header&&!At){var X=B.split(E)[0].split(D),kt=[],lt={},Ht=!1;for(var Dt in X){var pt=X[Dt];T(b.transformHeader)&&(pt=b.transformHeader(pt,Dt));var ie=pt,se=lt[pt]||0;for(0<se&&(Ht=!0,ie=pt+"_"+se),lt[pt]=se+1;kt.includes(ie);)ie=ie+"_"+se;kt.push(ie)}if(Ht){var ge=B.split(E);ge[0]=kt.join(D),B=ge.join(E)}}if(K||K!==!1&&B.indexOf(x)===-1){for(var xe=B.split(E),re=0;re<xe.length;re++){if(W=xe[re],N+=W.length,re!==xe.length-1)N+=E.length;else if(wt)return Kt();if(!A||W.substring(0,V)!==A){if(q){if(Q=[],He(W.split(D)),oe(),st)return Kt()}else He(W.split(D));if($&&$<=re)return Q=Q.slice(0,$),Kt(!0)}}return Kt()}for(var St=B.indexOf(D,N),Mt=B.indexOf(E,N),ze=new RegExp(_(j)+_(x),"g"),gt=B.indexOf(x,N);;)if(B[N]!==x)if(A&&W.length===0&&B.substring(N,N+V)===A){if(Mt===-1)return Kt();N=Mt+z,Mt=B.indexOf(E,N),St=B.indexOf(D,N)}else if(St!==-1&&(St<Mt||Mt===-1))W.push(B.substring(N,St)),N=St+L,St=B.indexOf(D,N);else{if(Mt===-1)break;if(W.push(B.substring(N,Mt)),ke(Mt+z),q&&(oe(),st))return Kt();if($&&Q.length>=$)return Kt(!0)}else for(gt=N,N++;;){if((gt=B.indexOf(x,gt+1))===-1)return wt||Y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Q.length,index:N}),pe();if(gt===H-1)return pe(B.substring(N,gt).replace(ze,x));if(x!==j||B[gt+1]!==j){if(x===j||gt===0||B[gt-1]!==j){St!==-1&&St<gt+1&&(St=B.indexOf(D,gt+1)),Mt!==-1&&Mt<gt+1&&(Mt=B.indexOf(E,gt+1));var un=ue(Mt===-1?St:Math.min(St,Mt));if(B.substr(gt+1+un,L)===D){W.push(B.substring(N,gt).replace(ze,x)),B[N=gt+1+un+L]!==x&&(gt=B.indexOf(x,N)),St=B.indexOf(D,N),Mt=B.indexOf(E,N);break}var we=ue(Mt);if(B.substring(gt+1+we,gt+1+we+z)===E){if(W.push(B.substring(N,gt).replace(ze,x)),ke(gt+1+we+z),St=B.indexOf(D,N),gt=B.indexOf(x,N),q&&(oe(),st))return Kt();if($&&Q.length>=$)return Kt(!0);break}Y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Q.length,index:N}),gt++}}else gt++}return pe();function He(Bt){Q.push(Bt),et=N}function ue(Bt){var Qs=0;if(Bt!==-1){var Jn=B.substring(gt+1,Bt);Jn&&Jn.trim()===""&&(Qs=Jn.length)}return Qs}function pe(Bt){return wt||(Bt===void 0&&(Bt=B.substring(N)),W.push(Bt),N=H,He(W),q&&oe()),Kt()}function ke(Bt){N=Bt,He(W),W=[],Mt=B.indexOf(E,N)}function Kt(Bt){return{data:Q,errors:Y,meta:{delimiter:D,linebreak:E,aborted:st,truncated:!!Bt,cursor:et+(At||0)}}}function oe(){F(Kt()),Q=[],Y=[]}},this.abort=function(){st=!0},this.getCharIndex=function(){return N}}function S(b){var x=b.data,D=o[x.workerId],E=!1;if(x.error)D.userError(x.error,x.file);else if(x.results&&x.results.data){var A={abort:function(){E=!0,v(x.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(T(D.userStep)){for(var F=0;F<x.results.data.length&&(D.userStep({data:x.results.data[F],errors:x.results.errors,meta:x.results.meta},A),!E);F++);delete x.results}else T(D.userChunk)&&(D.userChunk(x.results,A,x.file),delete x.results)}x.finished&&!E&&v(x.workerId,x.results)}function v(b,x){var D=o[b];T(D.userComplete)&&D.userComplete(x),D.terminate(),delete o[b]}function P(){throw new Error("Not implemented.")}function M(b){if(typeof b!="object"||b===null)return b;var x=Array.isArray(b)?[]:{};for(var D in b)x[D]=M(b[D]);return x}function C(b,x){return function(){b.apply(x,arguments)}}function T(b){return typeof b=="function"}return r&&(i.onmessage=function(b){var x=b.data;if(l.WORKER_ID===void 0&&x&&(l.WORKER_ID=x.workerId),typeof x.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(x.input,x.config),finished:!0});else if(i.File&&x.input instanceof File||x.input instanceof Object){var D=l.parse(x.input,x.config);D&&i.postMessage({workerId:l.WORKER_ID,results:D,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(f.prototype=Object.create(u.prototype)).constructor=f,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,l})})(Gd);var zk=Gd.exports;const Hk=["id"],Wk=h.defineComponent({__name:"VueJsonCsv",props:{data:{type:Array,required:!0},fields:{type:Array,required:!1,default:null},labels:{type:Object,required:!1,default:null},filename:{type:String,default:"report-data.csv"},delimiter:{type:String,default:",",required:!1},separatorExcel:{type:Boolean,default:!1},encoding:{type:String,default:"utf-8"},testing:{type:Boolean,required:!1,default:!1}},emits:["export-started","export-finished"],setup(n,{emit:t}){const e=t,i=n,s=h.computed(()=>`export_${new Date().getTime()}`),r=h.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==Tn.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===Tn.Object?d=>ak(d,(f,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==Tn.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>Fk(d,u):d=>d},l=()=>{if(typeof i.fields===Tn.Undefined&&typeof i.labels===Tn.Undefined)return i.data;const u=o(),d=a();return i.data.map(f=>u(d(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=zk.unparse(r.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
43
+ `+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const d=new Blob([u],{type:"text/csv;charset="+i.encoding});Bk.saveAs(d,i.filename)}};return(u,d)=>(h.openBlock(),h.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[h.renderSlot(u.$slots,"default",{},()=>[h.createTextVNode("Download "+h.toDisplayString(n.filename),1)])],8,Hk))}}),Yk=h.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=h.computed(()=>Object.keys(t.headers));return(i,s)=>(h.openBlock(),h.createElementBlock("div",null,[h.createVNode(Wk,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:h.withCtx(()=>[h.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),Vk={class:"kong-ui-public-csv-export-modal"},jk={key:0,class:"selected-range"},$k={key:1,class:"text-muted",tag:"span"},Kd=3,Zd=h.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=ft.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=h.ref(!0),a=h.computed(()=>{var y,_;return!!((_=(y=i.chartData)==null?void 0:y.data)!=null&&_.length)}),l=h.ref(1),c=h.computed(()=>g.value.rows.length),u=ft.useChartSelectedRange(h.toRef(i,"chartData")),d=h.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(Kd,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),f=()=>{s("toggleModal",!1)},g=h.computed(()=>{var M,C,T;if(!a.value||!((M=i.chartData)!=null&&M.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const y=i.chartData.data.some(b=>b.timestamp!==i.chartData.data[0].timestamp),_=i.chartData.data.map(b=>{const x=new Date(b.timestamp);return{...Object.keys(b.event).reduce((E,A)=>{if(A in i.chartData.meta.display){const F=b.event[A],$=i.chartData.meta.display[A];E[A]=F&&$&&$[F].name||b.event[A]}else E[A]=b.event[A];return E},{}),...y?{timestamp:So(x,"yyyy-MM-dd HH:mm:ss"),tzOffset:So(x,"XXX")}:{}}});let w=[];y&&(w=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const S="display"in i.chartData.meta&&((C=i.chartData.meta)!=null&&C.display)?(T=i.chartData.meta)==null?void 0:T.display:{},v=[...w,...Object.keys(S).map(b=>({label:e.t(`chartLabels.${b}`),key:b})),...i.chartData.meta.metric_names.map(b=>({label:e.t(`chartLabels.${b}`),key:b}))],P=v.reduce((b,x)=>(b[x.key]=x.label,b),{});return{headers:v,csvHeaders:P,rows:_}}),p=()=>{const{rows:y}=g.value;return o.value=!1,{total:Number(y.length)||0,data:y.slice(0,Kd)}};return h.watch(g,()=>{l.value++}),(y,_)=>{const w=h.resolveComponent("KEmptyState"),S=h.resolveComponent("KTable"),v=h.resolveComponent("KButton"),P=h.resolveComponent("KModal");return h.openBlock(),h.createElementBlock("div",Vk,[h.createVNode(P,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:h.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:f,onKeyup:h.withKeys(f,["esc"])},{default:h.withCtx(()=>{var M;return[h.createElementVNode("div",null,[a.value?(h.openBlock(),h.createElementBlock("div",jk,[h.createElementVNode("p",null,h.toDisplayString(y.modalDescription?y.modalDescription:h.unref(e).t("csvExport.exportDescription")),1),h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.exportTimeRange"))+": "+h.toDisplayString(h.unref(u)),1)])):h.createCommentVNode("",!0),h.createVNode(S,{class:"vitals-table","disable-pagination":"",fetcher:p,"fetcher-cache-key":String(l.value),headers:((M=g.value)==null?void 0:M.headers)||[],"row-hover":!1,sortable:!1},{"empty-state":h.withCtx(()=>[h.createVNode(w,{"action-button-visible":!1},{title:h.withCtx(()=>[h.createElementVNode("h5",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRange")),1)]),default:h.withCtx(()=>[h.createElementVNode("p",null,h.toDisplayString(h.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(h.openBlock(),h.createElementBlock("div",$k,h.toDisplayString(d.value),1)):h.createCommentVNode("",!0)])]}),"footer-actions":h.withCtx(()=>[h.createVNode(v,{appearance:"tertiary",class:"cancel-btn",onClick:f},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.cancelButton")),1)]),_:1}),h.createVNode(Yk,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:h.withCtx(()=>[h.createVNode(v,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),Qd=h.defineComponent({__name:"CsvExportButton",props:{data:{type:Object,required:!0},text:{type:String,required:!1,default:void 0},buttonAppearance:{type:String,required:!1,default:()=>"tertiary"},filenamePrefix:{type:String,required:!1,default:void 0}},setup(n){const t=n,{i18n:e}=ft.useI18n(),i=h.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),s=h.ref(!1),r=a=>{s.value=a},o=()=>{r(!0)};return(a,l)=>{const c=h.resolveComponent("KButton");return h.openBlock(),h.createElementBlock(h.Fragment,null,[h.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:h.withModifiers(o,["prevent"])},{default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.text||h.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),s.value?(h.openBlock(),h.createBlock(Zd,{key:0,"chart-data":n.data,filename:i.value,onToggleModal:r},null,8,["chart-data","filename"])):h.createCommentVNode("",!0)],64)}}}),Uk={class:"analytics-chart-shell"},qk={key:0,class:"chart-header"},Xk={key:0,class:"chart-title"},Gk={class:"chart-header-icons-wrapper"},Kk={key:1,class:"chart-export-button"},Zk={key:2,class:"analytics-chart-parent"},Qk=h.defineComponent({__name:"AnalyticsChart",props:{allowCsvExport:{type:Boolean,required:!1,default:!1},chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},tooltipTitle:{type:String,required:!1,default:""},emptyStateTitle:{type:String,required:!1,default:""},emptyStateDescription:{type:String,required:!1,default:""},chartTitle:{type:String,required:!1,default:""},filenamePrefix:{type:String,required:!1,default:""},legendPosition:{type:String,required:!1,default:Ot.Right},syntheticsDataKey:{type:String,required:!1,default:""},showLegendValues:{type:Boolean,required:!1,default:!0},showAnnotations:{type:Boolean,required:!1,default:!0}},setup(n){const t=n,{i18n:e}=ft.useI18n(),i=h.toRef(t,"chartData"),s=h.computed(()=>g.value?ft.useExploreResultToTimeDataset({fill:t.chartOptions.stacked,colorPalette:t.chartOptions.chartDatasetColors||Bs},h.toRef(t,"chartData")).value:ft.useExploreResultToDatasets({fill:t.chartOptions.stacked,colorPalette:t.chartOptions.chartDatasetColors||Bs},h.toRef(t,"chartData")).value),r=h.computed(()=>{var D;return(D=t.chartData)!=null&&D.meta?"start_ms"in t.chartData.meta?t.chartData.meta.end_ms-t.chartData.meta.start_ms:void 0:0}),o=h.computed(()=>{var D;return(D=t.chartData.meta)!=null&&D.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),a=h.computed(()=>t.showLegendValues&&t.legendPosition!==Ot.Bottom),{legendValues:l}=ft.useChartLegendValues(s,t.chartOptions.type,o),c=h.computed(()=>{var D,E,A;return((A=(E=(D=t.chartData)==null?void 0:D.meta)==null?void 0:E.limit)==null?void 0:A.toString())||null}),u=h.computed(()=>{var D,E;return((E=(D=t.chartData)==null?void 0:D.meta)==null?void 0:E.truncated)||!1}),d=e.t("limitedResultsShown",{maxReturned:c.value}),f=h.computed(()=>[jt.VERTICAL_BAR.toString(),jt.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),g=h.computed(()=>[jt.TIMESERIES_BAR,jt.TIMESERIES_LINE].some(D=>D===t.chartOptions.type)),p=h.computed(()=>t.chartOptions.type===jt.DOUGHNUT),y=h.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),_=h.computed(()=>{var A,F,$;if(!((A=t.chartData)!=null&&A.meta.metric_names)||!((F=t.chartData)!=null&&F.meta.metric_units))return;const D=t.chartData.meta.metric_names[0],E=t.chartData.meta.metric_units[D];if(t.chartData.meta.metric_names.length>1){if(D.includes("latency"))return e.t("metricAxisTitles.latency_in",{unit:e.t(`chartUnits.${E}`,{plural:"s"})});if(D.includes("size"))return e.t("metricAxisTitles.size_in",{unit:e.t(`chartUnits.${E}`,{plural:"s"})})}return(($=t.chartOptions)==null?void 0:$.metricAxesTitle)||e.te(`metricAxisTitles.${D}`)&&e.te(`chartUnits.${E}`)&&e.t(`metricAxisTitles.${D}`,{unit:e.t(`chartUnits.${E}`,{plural:"s"})})||void 0}),w=h.computed(()=>{const D=g.value?"Time":Object.keys(t.chartData.meta.display||t.chartData.meta.metric_names)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${D}`)&&e.t(`chartLabels.${D}`)||void 0}),S=h.computed(()=>{const D=na(Number(t.chartData.meta.granularity_ms));return e.t(`granularityAxisTitles.${D}`)}),v=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),P=h.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),M=h.computed(()=>g.value?s_(s.value):t.chartData&&t.chartData.meta&&t.chartData.data.length),C=h.computed(()=>M.value&&u.value&&c.value||t.chartTitle||t.allowCsvExport&&M.value),T=h.computed(()=>t.chartData.meta.granularity_ms?na(t.chartData.meta.granularity_ms)||"hourly":na(new Date(t.chartData.data[1].timestamp).getTime()-new Date(t.chartData.data[0].timestamp).getTime())||"hourly"),b=h.computed(()=>t.chartOptions.chartLegendSortFn?t.chartOptions.chartLegendSortFn:(D,E)=>D.text===e.t("chartLabels.____OTHER____")?1:E.text===e.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(D.text,10))&&!isNaN(parseInt(E.text,10))?D.text<E.text?-1:1:D.value&&E.value?E.value.raw-D.value.raw:0),x=h.computed(()=>t.chartOptions.chartTooltipSortFn?t.chartOptions.chartTooltipSortFn:(D,E)=>D.label===e.t("chartLabels.____OTHER____")?1:E.label===e.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(D.label,10))&&!isNaN(parseInt(E.label,10))?D.label<E.label?-1:1:D.value&&E.value?E.rawValue-D.rawValue:0);return h.provide("showLegendValues",a),h.provide("legendPosition",h.toRef(t,"legendPosition")),(D,E)=>{const A=h.resolveComponent("KTooltip"),F=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",Uk,[C.value?(h.openBlock(),h.createElementBlock("div",qk,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",Xk,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",Gk,[M.value&&u.value&&c.value?(h.openBlock(),h.createBlock(A,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(d)),1)]),default:h.withCtx(()=>[h.createVNode(h.unref(pa.WarningIcon),{color:`var(--kui-color-text-warning, ${h.unref(Ew)})`,decorative:"",size:h.unref(Rw)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&M.value?(h.openBlock(),h.createElementBlock("div",Kk,[h.createVNode(Qd,{data:i.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):h.createCommentVNode("",!0)])):h.createCommentVNode("",!0),M.value?(h.openBlock(),h.createElementBlock("div",Zk,[g.value?(h.openBlock(),h.createBlock(rk,{key:0,"chart-data":s.value,"chart-legend-sort-fn":b.value,"chart-tooltip-sort-fn":x.value,"dimension-axes-title":S.value,fill:n.chartOptions.stacked,granularity:T.value,"legend-values":h.unref(l),"metric-axes-title":_.value,"metric-unit":o.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"time-range-ms":r.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","legend-values","metric-axes-title","metric-unit","stacked","synthetics-data-key","time-range-ms","tooltip-title","type"])):f.value?(h.openBlock(),h.createBlock(i1,{key:1,annotations:n.showAnnotations,"chart-data":s.value,"chart-legend-sort-fn":b.value,"chart-tooltip-sort-fn":x.value,"data-testid":"bar-chart-container","dimension-axes-title":w.value,"legend-values":h.unref(l),"metric-axes-title":_.value,"metric-unit":o.value,orientation:y.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-title"])):p.value?(h.openBlock(),h.createBlock(p1,{key:2,"chart-data":s.value,"dataset-colors":n.chartOptions.chartDatasetColors||h.unref(Bs),"legend-position":n.legendPosition,"legend-values":h.unref(l),"metric-unit":o.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-title"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(F,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(v.value),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(P.value),1)]),_:1}))])}}}),Jk=Be(Qk,[["__scopeId","data-v-cb8778ab"]]),tS={class:"chart-parent","data-testid":"doughnut-chart-parent"},eS={class:"chart-totals-flex"},nS={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},iS=h.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:Yn.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:Fe},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}=ft.useI18n(),i=h.ref(ln()),s=h.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((_,w)=>_+w,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=h.computed(()=>({...t.chartData,datasets:s.value}));ft.useReportChartDataForSynthetics(h.toRef(t,"chartData"),h.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=h.ref(),l=h.computed(()=>{var g;return Fi((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=h.computed(()=>{var g,p;return Fi(((g=s==null?void 0:s.value[0])==null?void 0:g.data[0])+((p=s==null?void 0:s.value[0])==null?void 0:p.data[1]),{capital:!0})}),u=h.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=h.computed(()=>[Yn.Full,Yn.SingleMetric].includes(t.metricDisplay)),f=h.computed(()=>t.metricDisplay===Yn.Full);return(g,p)=>(h.openBlock(),h.createElementBlock("div",tS,[h.createElementVNode("div",eS,[d.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:h.normalizeStyle(u.value)},h.toDisplayString(l.value),5)):h.createCommentVNode("",!0),f.value?(h.openBlock(),h.createElementBlock("div",nS,h.toDisplayString(h.unref(e).t("total"))+": "+h.toDisplayString(c.value),1)):h.createCommentVNode("",!0)]),h.createElementVNode("div",{class:"chart-container",style:h.normalizeStyle({height:n.height,width:n.width})},[h.createVNode(h.unref(Md),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),sS=Be(iS,[["__scopeId","data-v-18bc031c"]]),rS={class:"simple-chart-shell"},oS={key:1,class:"analytics-chart-parent"},aS=Be(h.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}=ft.useI18n(),i=h.computed(()=>{var c;const l=ft.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||Fe},h.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),s=h.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=h.computed(()=>t.chartOptions.type===As.GAUGE),o=h.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),a=h.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=h.resolveComponent("KEmptyState");return h.openBlock(),h.createElementBlock("div",rS,[a.value?(h.openBlock(),h.createElementBlock("div",oS,[r.value?(h.openBlock(),h.createBlock(sS,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):h.createCommentVNode("",!0)])):(h.openBlock(),h.createBlock(u,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-a1582f51"]]),lS={class:"top-n-card-title","data-testid":"top-n-card-title"},cS={class:"top-n-card-description","data-testid":"top-n-card-description"},uS={key:3,class:"top-n-table","data-testid":"top-n-table"},dS={class:"table-headings"},hS={class:"table-row"},fS={class:"column-1"},gS={class:"column-2"},pS={class:"table-body","data-testid":"top-n-data"},mS=["data-testid"],yS={class:"column-1"},bS={class:"column-2"},_S=Be(h.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},titleTag:{type:String,default:"h2"}},setup(n){const t=n,{i18n:e}=ft.useI18n(),i=h.computed(()=>t.data.data),s=h.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=h.computed(()=>{var p,y;return(p=t.data.meta)!=null&&p.display&&((y=Object.keys(t.data.meta.display))==null?void 0:y[0])||""}),o=h.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=h.computed(()=>{var p,y;return(y=(p=t.data.meta)==null?void 0:p.metric_names)!=null&&y.length?t.data.meta.metric_names[0]:""}),l=h.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=h.computed(()=>{if(!s.value)return"";if(t.data.meta){if(o.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!a.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),u=p=>{const y=p.event;return String(y[r.value])},d=p=>{const y=u(p),_=o.value&&o.value[y];return _?_.name:"-"},f=p=>{const y=u(p),_=o.value&&o.value[y];return _?!!_.deleted:!1},g=p=>{if(!a.value)return"–";const _=p.event[a.value];return _?Fi(_,{capital:!0,round:!0}):"–"};return(p,y)=>{const _=h.resolveComponent("KEmptyState"),w=h.resolveComponent("KSkeleton"),S=h.resolveComponent("KCard");return h.openBlock(),h.createBlock(S,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},h.createSlots({default:h.withCtx(()=>[c.value?(h.openBlock(),h.createBlock(_,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(h.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(c.value),1)]),_:1})):n.isLoading?(h.openBlock(),h.createBlock(w,{key:1,"table-columns":2,type:"table"})):s.value?(h.openBlock(),h.createElementBlock("div",uS,[h.createElementVNode("div",dS,[h.createElementVNode("div",hS,[h.createElementVNode("div",fS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",gS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",pS,[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(i.value,(v,P)=>(h.openBlock(),h.createElementBlock("div",{key:`entry-${P}`,class:"table-row","data-testid":`row-${u(v)}`},[h.createElementVNode("div",yS,[h.renderSlot(p.$slots,"name",{record:{id:u(v),name:d(v),deleted:f(v),dimension:r.value}},()=>[h.createTextVNode(h.toDisplayString(d(v)),1)],!0)]),h.createElementVNode("div",bS,"   "+h.toDisplayString(g(v)),1)],8,mS))),128))])])):(h.openBlock(),h.createBlock(_,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:h.withCtx(()=>[h.createTextVNode(h.toDisplayString(n.emptyStateTitle||h.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:h.withCtx(()=>[h.createElementVNode("span",lS,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",cS,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-50809fdb"]]);J.AnalyticsChart=Jk,J.ChartLegendPosition=Ot,J.ChartMetricDisplay=Yn,J.ChartTypes=jt,J.ChartTypesSimple=As,J.CsvExportButton=Qd,J.CsvExportModal=Zd,J.DECIMAL_DISPLAY=wu,J.FONT_SIZE_REGULAR=Su,J.FONT_SIZE_SMALL=ku,J.MAX_LABEL_LENGTH=Fs,J.OTHERS_COLOR=F_,J.SimpleChart=aS,J.TopNTable=_S,J.ValidType=Tn,J.accessibleGrey=Mu,J.apiRequestStatusCodeColors=Tu,J.codesInSpec=Eu,J.darkenColor=Du,J.datavisPalette=Fe,J.defaultStatusCodeColors=Bs,J.errorRateColors=I_,J.formatTime=Ns,J.latencyColors=N_,J.lightGrey=Mo,J.lookupColor=B_,J.lookupDatavisColor=jn,J.lookupStatusCodeCategoryColor=$_,J.lookupStatusCodeColor=To,J.numberFormatter=Is,J.statusCodeBadgeBackgroundColor=A_,J.trafficColors=L_,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});