@kong-ui-public/analytics-chart 4.5.2 → 4.6.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,43 +1,43 @@
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 Tv=Object.defineProperty;var Cv=(J,h,fn)=>h in J?Tv(J,h,{enumerable:!0,configurable:!0,writable:!0,value:fn}):J[h]=fn;var O=(J,h,fn)=>Cv(J,typeof h!="symbol"?h+"":h,fn);var cn,Qd;const hh={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 fh(){const n=fn.createI18n("en-us",hh);return{i18n:n,i18nT:fn.i18nTComponent(n)}}/*!
1
+ (function(J,f){typeof exports=="object"&&typeof module<"u"?f(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"],f):(J=typeof globalThis<"u"?globalThis:J||self,f(J["kong-ui-publicvitals-chart"]={},J.Vue,J["kong-ui-public-i18n"],J.KongIcons))})(this,function(J,f,bn,Da){"use strict";var aD=Object.defineProperty;var lD=(J,f,bn)=>f in J?aD(J,f,{enumerable:!0,configurable:!0,writable:!0,value:bn}):J[f]=bn;var O=(J,f,bn)=>lD(J,typeof f!="symbol"?f+"":f,bn);var gn,wh;const Ih={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 Nh(){const n=bn.createI18n("en-us",Ih);return{i18n:n,i18nT:bn.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 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"],gh=n=>ur[n&15],ph=n=>ur[(n&240)>>4]+ur[n&15],Ui=n=>(n&240)>>4===(n&15),mh=n=>Ui(n.r)&&Ui(n.g)&&Ui(n.b)&&Ui(n.a);function yh(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 bh=(n,t)=>n<255?t(n):"";function _h(n){var t=mh(n)?gh:ph;return n?"#"+t(n.r)+t(n.g)+t(n.b)+bh(n.a,t):void 0}const xh=/^(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 wh(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 kh(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 Sh(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=Sh(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 vh(n,t,e){return hr(kh,n,t,e)}function Dh(n,t,e){return hr(wh,n,t,e)}function ba(n){return(n%360+360)%360}function Mh(n){const t=xh.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=vh(s,r,o):t[1]==="hsv"?i=Dh(s,r,o):i=fr(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Th(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 Ch(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 Oh(){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 Ph(n){qi||(qi=Oh(),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 Eh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Rh(n){const t=Eh.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 Ah(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 Lh(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 Ih(n){return n.charAt(0)==="r"?Rh(n):Mh(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=yh(t)||Ph(t)||Ih(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?Ah(this._rgb):void 0}hexString(){return this._valid?_h(this._rgb):void 0}hslString(){return this._valid?Ch(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=Lh(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 Th(this._rgb,t),this}}/*!
6
+ */function li(n){return n+.5|0}const Ge=(n,t,e)=>Math.max(Math.min(n,e),t);function ci(n){return Ge(li(n*2.55),0,255)}function Ke(n){return Ge(li(n*255),0,255)}function Ae(n){return Ge(li(n/2.55)/100,0,1)}function Ta(n){return Ge(li(n*100),0,100)}const fe={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},wr=[..."0123456789ABCDEF"],Fh=n=>wr[n&15],Bh=n=>wr[(n&240)>>4]+wr[n&15],ns=n=>(n&240)>>4===(n&15),zh=n=>ns(n.r)&&ns(n.g)&&ns(n.b)&&ns(n.a);function Hh(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&fe[n[1]]*17,g:255&fe[n[2]]*17,b:255&fe[n[3]]*17,a:t===5?fe[n[4]]*17:255}:(t===7||t===9)&&(e={r:fe[n[1]]<<4|fe[n[2]],g:fe[n[3]]<<4|fe[n[4]],b:fe[n[5]]<<4|fe[n[6]],a:t===9?fe[n[7]]<<4|fe[n[8]]:255})),e}const Wh=(n,t)=>n<255?t(n):"";function Yh(n){var t=zh(n)?Fh:Bh;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Wh(n.a,t):void 0}const Vh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ca(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 jh(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 $h(n,t,e){const i=Ca(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 Uh(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 vr(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=Uh(e,i,s,u,r),l=l*60+.5),[l|0,c||0,a]}function kr(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Ke)}function Sr(n,t,e){return kr(Ca,n,t,e)}function qh(n,t,e){return kr($h,n,t,e)}function Xh(n,t,e){return kr(jh,n,t,e)}function Pa(n){return(n%360+360)%360}function Gh(n){const t=Vh.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?ci(+t[5]):Ke(+t[5]));const s=Pa(+t[2]),r=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?i=qh(s,r,o):t[1]==="hsv"?i=Xh(s,r,o):i=Sr(s,r,o),{r:i[0],g:i[1],b:i[2],a:e}}function Kh(n,t){var e=vr(n);e[0]=Pa(e[0]+t),e=Sr(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Zh(n){if(!n)return;const t=vr(n),e=t[0],i=Ta(t[1]),s=Ta(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ae(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Oa={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"},Ea={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 Qh(){const n={},t=Object.keys(Ea),e=Object.keys(Oa);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,Oa[r]);r=parseInt(Ea[o],16),n[a]=[r>>16&255,r>>8&255,r&255]}return n}let is;function Jh(n){is||(is=Qh(),is.transparent=[0,0,0,0]);const t=is[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const tf=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ef(n){const t=tf.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const o=+t[7];e=t[8]?ci(o):Ge(o*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?ci(i):Ge(i,0,255)),s=255&(t[4]?ci(s):Ge(s,0,255)),r=255&(t[6]?ci(r):Ge(r,0,255)),{r:i,g:s,b:r,a:e}}}function nf(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ae(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Mr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Bn=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function sf(n,t,e){const i=Bn(Ae(n.r)),s=Bn(Ae(n.g)),r=Bn(Ae(n.b));return{r:Ke(Mr(i+e*(Bn(Ae(t.r))-i))),g:Ke(Mr(s+e*(Bn(Ae(t.g))-s))),b:Ke(Mr(r+e*(Bn(Ae(t.b))-r))),a:n.a+e*(t.a-n.a)}}function ss(n,t,e){if(n){let i=vr(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Sr(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ra(n,t){return n&&Object.assign(t||{},n)}function Aa(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=Ke(n[3]))):(t=Ra(n,{r:0,g:0,b:0,a:1}),t.a=Ke(t.a)),t}function rf(n){return n.charAt(0)==="r"?ef(n):Gh(n)}class ui{constructor(t){if(t instanceof ui)return t;const e=typeof t;let i;e==="object"?i=Aa(t):e==="string"&&(i=Hh(t)||Jh(t)||rf(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ra(this._rgb);return t&&(t.a=Ae(t.a)),t}set rgb(t){this._rgb=Aa(t)}rgbString(){return this._valid?nf(this._rgb):void 0}hexString(){return this._valid?Yh(this._rgb):void 0}hslString(){return this._valid?Zh(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=sf(this._rgb,t._rgb,e)),this}clone(){return new ui(this.rgb)}alpha(t){return this._rgb.a=Ke(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=li(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 ss(this._rgb,2,t),this}darken(t){return ss(this._rgb,2,-t),this}saturate(t){return ss(this._rgb,1,t),this}desaturate(t){return ss(this._rgb,1,-t),this}rotate(t){return Kh(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 Ee(){}const Nh=(()=>{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 Fh=(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 Bh(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||Bh;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:zh})}function zh(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 Hh(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 Wh(n){const t=Hh(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]=Wh(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 Yh(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const rt=Math.PI,mt=2*rt,Vh=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 jh(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 $h(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 Uh(n,t){return(n-t+Vh)%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 qh(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),Xh=(n,t,e)=>yr(n,e,i=>n[i][t]>=e);function Gh(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 Kh(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 Zh(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,Qh=(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 Jh=["x","y","borderWidth","radius","tension"],tf=["color","borderColor","backgroundColor"];function ef(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:tf},numbers:{type:"number",properties:Jh}}),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 nf(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Wa=new Map;function sf(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 sf(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=rf(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 rf(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 of(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 af{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 af({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ef,nf,of]);function lf(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 cf(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 uf(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 df(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 hf(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 ff(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 gf(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,hf(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&gf(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),ff(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 pf=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,mf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yf(n,t){const e=(""+n).match(pf);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 bf=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]=bf(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(mf)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Z(n.family,t.family),lineHeight:yf(Z(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Z(n.weight,t.weight),string:""};return s.string=lf(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 _f(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,()=>Tf(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,()=>wf(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 xf=(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 wf(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return Jt(a)&&o.isScriptable(t)&&(a=kf(t,a,n,e)),ot(a)&&a.length&&(a=Sf(t,a,n,o.isIndexable)),Mr(t,a)&&(a=In(a,s,r&&r[t],o)),a}function kf(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 Sf(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 vf=(n,t)=>n===!0?t:typeof n=="string"?qe(t,n):void 0;function Df(n,t,e,i,s){for(const r of t){const o=vf(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,()=>Mf(t,e,i))}function Ga(n,t,e,i,s){for(;e;)e=Df(n,t,e,i,s);return e}function Mf(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return ot(s)&&it(e)?e:s||{}}function Tf(n,t,e,i){let s;for(const r of t)if(s=Ka(xf(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=Cf(n._scopes)),t}function Cf(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 Of=Number.EPSILON||1e-14,Nn=(n,t)=>t<n.length&&!n[t].skip&&n[t],Ja=n=>n==="x"?"y":"x";function Pf(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 Ef(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,Of)){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 Rf(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 Af(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]}Ef(n,s,r),Rf(n,r,t)}function is(n,t,e){return Math.max(Math.min(n,e),t)}function Lf(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 If(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Af(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=Pf(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&&Lf(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 Nf(n,t){return rs(n).getPropertyValue(t)}const Ff=["top","right","bottom","left"];function yn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Ff[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Bf=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function zf(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(Bf(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}=zf(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 Hf(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 Wf(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=Hf(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 Yf=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=Nf(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 Vf(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 jf(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 $f=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}}},Uf=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?$f(t,e):Uf()}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:Uh,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 qf(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}=qf(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 Xf(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 Gf(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 Kf(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=Xf(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,Gf(e,o,l,c),e,t)}function ll(n,t,e,i){return!i||!i.setContext||!e?t:Zf(n,t,e,i)}function Zf(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}))),Qf(_,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 Qf(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)}/*!
11
+ */function Le(){}const of=(()=>{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 Mt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ue(n,t){return Mt(n)?n:t}function Z(n,t){return typeof n>"u"?t:n}const af=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,La=(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 rs(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 os(n){if(ot(n))return n.map(os);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]]=os(n[e[s]]);return t}return n}function Ia(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function lf(n,t,e,i){if(!Ia(n))return;const s=t[n],r=e[n];it(s)&&it(r)?di(s,r,i):t[n]=os(r)}function di(n,t,e){const i=ot(t)?t:[t],s=i.length;if(!it(n))return n;e=e||{};const r=e.merger||lf;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 hi(n,t){return di(n,t,{merger:cf})}function cf(n,t,e){if(!Ia(n))return;const i=t[n],s=e[n];it(i)&&it(s)?hi(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=os(s))}const Na={"":n=>n,x:n=>n.x,y:n=>n.y};function uf(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 df(n){const t=uf(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Ze(n,t){return(Na[t]||(Na[t]=df(t)))(n)}function Dr(n){return n.charAt(0).toUpperCase()+n.slice(1)}const te=n=>typeof n<"u",ee=n=>typeof n=="function",Fa=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function hf(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const rt=Math.PI,yt=2*rt,ff=yt+rt,as=Number.POSITIVE_INFINITY,Tr=rt/180,xt=rt/2,ge=rt/4,ls=rt*2/3,Qe=Math.log10,De=Math.sign;function fi(n,t,e){return Math.abs(n-t)<e}function Ba(n){const t=Math.round(n);n=fi(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Qe(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function gf(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 Je(n){return!isNaN(parseFloat(n))&&isFinite(n)}function pf(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function za(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 Ft(n){return n*(rt/180)}function cs(n){return n*(180/rt)}function Ha(n){if(!Mt(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Wa(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+=yt),{angle:r,distance:s}}function zn(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function mf(n,t){return(n-t+ff)%yt-rt}function de(n){return(n%yt+yt)%yt}function gi(n,t,e,i){const s=de(n),r=de(t),o=de(e),a=de(r-s),l=de(o-s),c=de(s-r),u=de(s-o);return s===r||s===o||i&&r===o||a>l&&c<u}function Ht(n,t,e){return Math.max(t,Math.min(e,n))}function yf(n){return Ht(n,-32768,32767)}function Ie(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Cr(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 Ne=(n,t,e,i)=>Cr(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),bf=(n,t,e)=>Cr(n,e,i=>n[i][t]>=e);function xf(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 Ya=["push","pop","shift","splice","unshift"];function _f(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ya.forEach(e=>{const i="_onData"+Dr(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 Va(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)&&(Ya.forEach(r=>{delete n[r]}),delete n._chartjs)}function ja(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const $a=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ua(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,$a.call(window,()=>{i=!1,n.apply(t,e)}))}}function wf(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Pr=n=>n==="start"?"left":n==="end"?"right":"center",qt=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,vf=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function qa(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:h}=o.getUserBounds();d&&(s=Ht(Math.min(Ne(a,l,c).lo,e?i:Ne(t,l,o.getPixelForValue(c)).lo),0,i-1)),h?r=Ht(Math.max(Ne(a,o.axis,u,!0).hi+1,e?0:Ne(t,l,o.getPixelForValue(u),!0).hi+1),s,i)-s:r=i-s}return{start:s,count:r}}function Xa(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 us=n=>n===0||n===1,Ga=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*yt/e)),Ka=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*yt/e)+1,pi={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*xt)+1,easeOutSine:n=>Math.sin(n*xt),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=>us(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=>us(n)?n:Ga(n,.075,.3),easeOutElastic:n=>us(n)?n:Ka(n,.075,.3),easeInOutElastic(n){return us(n)?n:n<.5?.5*Ga(n*2,.1125,.45):.5+.5*Ka(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-pi.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?pi.easeInBounce(n*2)*.5:pi.easeOutBounce(n*2-1)*.5+.5};function Or(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Za(n){return Or(n)?n:new ui(n)}function Er(n){return Or(n)?n:new ui(n).saturate(.5).darken(.1).hexString()}const kf=["x","y","borderWidth","radius","tension"],Sf=["color","borderColor","backgroundColor"];function Mf(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:Sf},numbers:{type:"number",properties:kf}}),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 Df(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Qa=new Map;function Tf(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Qa.get(e);return i||(i=new Intl.NumberFormat(n,t),Qa.set(e,i)),i}function mi(n,t,e){return Tf(t,e).format(n)}const Ja={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=Cf(n,e)}const o=Qe(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),mi(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Qe(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Ja.numeric.call(this,n,t,e):""}};function Cf(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 ds={formatters:Ja};function Pf(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:ds.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 xn=Object.create(null),Rr=Object.create(null);function yi(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 Ar(n,t,e){return typeof t=="string"?di(yi(n,t),e):di(yi(n,""),t)}class Of{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)=>Er(s.backgroundColor),this.hoverBorderColor=(i,s)=>Er(s.borderColor),this.hoverColor=(i,s)=>Er(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 Ar(this,t,e)}get(t){return yi(this,t)}describe(t,e){return Ar(Rr,t,e)}override(t,e){return Ar(xn,t,e)}route(t,e,i,s){const r=yi(this,t),o=yi(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 Ct=new Of({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Mf,Df,Pf]);function Ef(n){return!n||tt(n.size)||tt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function hs(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 Rf(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,h;for(l=0;l<a;l++)if(d=e[l],d!=null&&!ot(d))o=hs(n,s,r,o,d);else if(ot(d))for(c=0,u=d.length;c<u;c++)h=d[c],h!=null&&!ot(h)&&(o=hs(n,s,r,o,h));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 _n(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 tl(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Lr(n,t,e,i){el(n,t,e,i,null)}function el(n,t,e,i,s){let r,o,a,l,c,u,d,h;const g=t.pointStyle,p=t.rotation,y=t.radius;let x=(p||0)*Tr;if(g&&typeof g=="object"&&(r=g.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),n.restore();return}if(!(isNaN(y)||y<=0)){switch(n.beginPath(),g){default:s?n.ellipse(e,i,s/2,y,0,0,yt):n.arc(e,i,y,0,yt),n.closePath();break;case"triangle":u=s?s/2:y,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=ls,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),x+=ls,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*y),n.closePath();break;case"rectRounded":c=y*.516,l=y-c,o=Math.cos(x+ge)*l,d=Math.cos(x+ge)*(s?s/2-c:l),a=Math.sin(x+ge)*l,h=Math.sin(x+ge)*(s?s/2-c:l),n.arc(e-d,i-a,c,x-rt,x-xt),n.arc(e+h,i-o,c,x-xt,x),n.arc(e+d,i+a,c,x,x+xt),n.arc(e-h,i+o,c,x+xt,x+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}x+=ge;case"rectRot":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,h=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+h,i-o),n.lineTo(e+d,i+a),n.lineTo(e-h,i+o),n.closePath();break;case"crossRot":x+=ge;case"cross":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,h=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o);break;case"star":d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,h=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o),x+=ge,d=Math.cos(x)*(s?s/2:y),o=Math.cos(x)*y,a=Math.sin(x)*y,h=Math.sin(x)*(s?s/2:y),n.moveTo(e-d,i-a),n.lineTo(e+d,i+a),n.moveTo(e+h,i-o),n.lineTo(e-h,i+o);break;case"line":o=s?s/2:Math.cos(x)*y,a=Math.sin(x)*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(x)*(s?s/2:y),i+Math.sin(x)*y);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Fe(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 bi(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function xi(n){n.restore()}function Af(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 Lf(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 If(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 Nf(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 Ff(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function wn(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,If(n,r),l=0;l<o.length;++l)c=o[l],r.backdrop&&Ff(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),Nf(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function Hn(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,xt,!0),n.lineTo(e+s-o.bottomRight,i+r),n.arc(e+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,xt,0,!0),n.lineTo(e+s,i+o.topRight),n.arc(e+s-o.topRight,i+o.topRight,o.topRight,0,-xt,!0),n.lineTo(e+o.topLeft,i)}const Bf=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,zf=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Hf(n,t){const e=(""+n).match(Bf);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 Wf=n=>+n||0;function Ir(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]=Wf(r(o));return e}function nl(n){return Ir(n,{top:"y",right:"x",bottom:"y",left:"x"})}function tn(n){return Ir(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Bt(n){const t=nl(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function _t(n,t){n=n||{},t=t||Ct.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(zf)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Z(n.family,t.family),lineHeight:Hf(Z(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:Z(n.weight,t.weight),string:""};return s.string=Ef(s),s}function _i(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 Yf(n,t,e){const{min:i,max:s}=n,r=La(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 en(n,t){return Object.assign(Object.create(n),t)}function Nr(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=al("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>Nr([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 sl(a,l,()=>Kf(l,t,n,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(a,l){return ll(a).includes(l)},ownKeys(a){return ll(a)},set(a,l,c){const u=a._storage||(a._storage=s());return a[l]=u[l]=c,delete a._keys,!0}})}function Wn(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:il(n,i),setContext:r=>Wn(n,r,e,i),override:r=>Wn(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 sl(r,o,()=>jf(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 il(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:ee(e)?e:()=>e,isIndexable:ee(i)?i:()=>i}}const Vf=(n,t)=>n?n+Dr(t):t,Fr=(n,t)=>it(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function sl(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function jf(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=n;let a=i[t];return ee(a)&&o.isScriptable(t)&&(a=$f(t,a,n,e)),ot(a)&&a.length&&(a=Uf(t,a,n,o.isIndexable)),Fr(t,a)&&(a=Wn(a,s,r&&r[t],o)),a}function $f(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),Fr(n,l)&&(l=Br(s._scopes,s,n,l)),l}function Uf(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=Br(c,s,n,u);t.push(Wn(d,r,o&&o[n],a))}}return t}function rl(n,t,e){return ee(n)?n(t,e):n}const qf=(n,t)=>n===!0?t:typeof n=="string"?Ze(t,n):void 0;function Xf(n,t,e,i,s){for(const r of t){const o=qf(e,r);if(o){n.add(o);const a=rl(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 Br(n,t,e,i){const s=t._rootScopes,r=rl(t._fallback,e,i),o=[...n,...s],a=new Set;a.add(i);let l=ol(a,o,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=ol(a,o,r,l,i),l===null)?!1:Nr(Array.from(a),[""],s,r,()=>Gf(t,e,i))}function ol(n,t,e,i,s){for(;e;)e=Xf(n,t,e,i,s);return e}function Gf(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return ot(s)&&it(e)?e:s||{}}function Kf(n,t,e,i){let s;for(const r of t)if(s=al(Vf(r,n),e),typeof s<"u")return Fr(n,s)?Br(e,i,n,s):s}function al(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function ll(n){let t=n._keys;return t||(t=n._keys=Zf(n._scopes)),t}function Zf(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 cl(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(Ze(u,r),c)};return o}const Qf=Number.EPSILON||1e-14,Yn=(n,t)=>t<n.length&&!n[t].skip&&n[t],ul=n=>n==="x"?"y":"x";function Jf(n,t,e,i){const s=n.skip?t:n,r=t,o=e.skip?t:e,a=zn(r,s),l=zn(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,h=i*u;return{previous:{x:r.x-d*(o.x-s.x),y:r.y-d*(o.y-s.y)},next:{x:r.x+h*(o.x-s.x),y:r.y+h*(o.y-s.y)}}}function tg(n,t,e){const i=n.length;let s,r,o,a,l,c=Yn(n,0);for(let u=0;u<i-1;++u)if(l=c,c=Yn(n,u+1),!(!l||!c)){if(fi(t[u],0,Qf)){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 eg(n,t,e="x"){const i=ul(e),s=n.length;let r,o,a,l=Yn(n,0);for(let c=0;c<s;++c){if(o=a,a=l,l=Yn(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 ng(n,t="x"){const e=ul(t),i=n.length,s=Array(i).fill(0),r=Array(i);let o,a,l,c=Yn(n,0);for(o=0;o<i;++o)if(a=l,l=c,c=Yn(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?De(s[o-1])!==De(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}tg(n,s,r),eg(n,r,t)}function fs(n,t,e){return Math.max(Math.min(n,e),t)}function ig(n,t){let e,i,s,r,o,a=Fe(n[0],t);for(e=0,i=n.length;e<i;++e)o=r,r=a,a=e<i-1&&Fe(n[e+1],t),r&&(s=n[e],o&&(s.cp1x=fs(s.cp1x,t.left,t.right),s.cp1y=fs(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=fs(s.cp2x,t.left,t.right),s.cp2y=fs(s.cp2y,t.top,t.bottom)))}function sg(n,t,e,i,s){let r,o,a,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")ng(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=Jf(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&&ig(n,e)}function zr(){return typeof window<"u"&&typeof document<"u"}function Hr(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function gs(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 ps=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function rg(n,t){return ps(n).getPropertyValue(t)}const og=["top","right","bottom","left"];function vn(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=og[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const ag=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function lg(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let o=!1,a,l;if(ag(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 nn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=ps(e),r=s.boxSizing==="border-box",o=vn(s,"padding"),a=vn(s,"border","width"),{x:l,y:c,box:u}=lg(n,e),d=o.left+(u&&a.left),h=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-h)/p*e.height/i)}}function cg(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&Hr(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const o=r.getBoundingClientRect(),a=ps(r),l=vn(a,"border","width"),c=vn(a,"padding");t=o.width-c.width-l.width,e=o.height-c.height-l.height,i=gs(a.maxWidth,r,"clientWidth"),s=gs(a.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||as,maxHeight:s||as}}const ms=n=>Math.round(n*10)/10;function ug(n,t,e,i){const s=ps(n),r=vn(s,"margin"),o=gs(s.maxWidth,n,"clientWidth")||as,a=gs(s.maxHeight,n,"clientHeight")||as,l=cg(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const h=vn(s,"border","width"),g=vn(s,"padding");c-=g.width+h.width,u-=g.height+h.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=ms(Math.min(c,o,l.maxWidth)),u=ms(Math.min(u,a,l.maxHeight)),c&&!u&&(u=ms(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ms(Math.floor(u*i))),{width:c,height:u}}function dl(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 dg=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};zr()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function hl(n,t){const e=rg(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function kn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function hg(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 fg(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},o=kn(n,s,e),a=kn(s,r,e),l=kn(r,t,e),c=kn(o,a,e),u=kn(a,l,e);return kn(c,u,e)}const gg=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}}},pg=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Vn(n,t,e){return n?gg(t,e):pg()}function fl(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 gl(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function pl(n){return n==="angle"?{between:gi,compare:mf,normalize:de}:{between:Ie,compare:(t,e)=>t-e,normalize:t=>t}}function ml({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 mg(n,t,e){const{property:i,start:s,end:r}=e,{between:o,normalize:a}=pl(i),l=t.length;let{start:c,end:u,loop:d}=n,h,g;if(d){for(c+=l,u+=l,h=0,g=l;h<g&&o(a(t[c%l][i]),s,r);++h)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:d,style:n.style}}function yl(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,o=t.length,{compare:a,between:l,normalize:c}=pl(i),{start:u,end:d,loop:h,style:g}=mg(n,t,e),p=[];let y=!1,x=null,w,v,S;const P=()=>l(s,S,w)&&a(s,S)!==0,D=()=>a(r,w)===0||l(r,S,w),C=()=>y||P(),T=()=>!y||D();for(let b=u,_=u;b<=d;++b)v=t[b%o],!v.skip&&(w=c(v[i]),w!==S&&(y=l(w,s,r),x===null&&C()&&(x=a(w,s)===0?b:_),x!==null&&T()&&(p.push(ml({start:x,end:b,loop:h,count:o,style:g})),x=null),_=b,S=w));return x!==null&&p.push(ml({start:x,end:d,loop:h,count:o,style:g})),p}function bl(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=yl(i[s],n.points,t);r.length&&e.push(...r)}return e}function yg(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 bg(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 xg(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:o,end:a}=yg(e,s,r,i);if(i===!0)return xl(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 xl(n,bg(e,o,l,c),e,t)}function xl(n,t,e,i){return!i||!i.setContext||!e?t:_g(n,t,e,i)}function _g(n,t,e,i){const s=n._chart.getContext(),r=_l(n.options),{_datasetIndex:o,options:{spanGaps:a}}=n,l=e.length,c=[];let u=r,d=t[0].start,h=d;function g(p,y,x,w){const v=a?-1:1;if(p!==y){for(p+=l;e[p%l].skip;)p-=v;for(;e[y%l].skip;)y+=v;p%l!==y%l&&(c.push({start:p%l,end:y%l,loop:x,style:w}),u=w,d=y%l)}}for(const p of t){d=a?d:p.start;let y=e[d%l],x;for(h=d+1;h<=p.end;h++){const w=e[h%l];x=_l(i.setContext(en(s,{type:"segment",p0:y,p1:w,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:o}))),wg(x,u)&&g(d,h-1,p.loop,u),y=w,u=x}d<h-1&&g(d,h-1,p.loop,u)}return c}function _l(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function wg(n,t){if(!t)return!1;const e=[],i=function(s,r){return Or(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 Jf{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 Jf;const ul="transparent",tg={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 eg{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||tg[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=ig(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&ng(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 eg(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 ng(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 ig(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 sg(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 rg(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 og(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 ag(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function lg(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 cg(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=ag(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]=cg(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 ug(n,t){return Ze(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function dg(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),hg=(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=og(e,s)}else if(i!==e){if(i){Ra(i,this);const s=this._cachedMeta;gi(s),s._parsed=[]}e&&Object.isExtensible(e)&&Kh(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=hg(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=lg(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=rg(Z(this.options.clip,sg(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=dg(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=ug(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 fg(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 gg(n){const t=n.iScale,e=fg(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 pg(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 mg(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 yg(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)?yg(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 bg(n,t,e){return n!==0?Se(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function _g(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 xg(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}=_g(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=wg(n,t,e),n=wl(n,e,t)):n=wl(n,t,e),n}function wg(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 kg(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;xg(S,v,w,o),kg(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||gg(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=bg(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"?mg(t,e,s,c):pg(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 Sg(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(Fh(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:g,offsetX:p,offsetY:y}=Sg(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 vg=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 Dg(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?Xh: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}=Dg(r[a],t,o,s);for(let g=d;g<=f;++g){const p=u[g];p.skip||i(p,c,g)}}}function Mg(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 Tg(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 Cg(n,t,e,i,s,r){let o=[];const a=Mg(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?Tg(n,t,e,s):Cg(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 Og(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 Pg(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 Eg(n,t){const e=Pg(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 Rg(n){const t=Og(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 Ag(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 Lg(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 Ig(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,Ig(a.horizontal,t));const{same:d,other:f}=Ag(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=Rg(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=Eg(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),Lg(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 Ng extends Ol{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ds="$chartjs",Fg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pl=n=>n===null||n==="";function Bg(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=Yf?{passive:!0}:!1;function zg(n,t,e){n&&n.addEventListener(t,e,El)}function Hg(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,El)}function Wg(n,t){const e=Fg[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 Yg(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 Vg(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 jg(n,t){ki.size||window.addEventListener("resize",Al),ki.set(n,t)}function $g(n){ki.delete(n),ki.size||window.removeEventListener("resize",Al)}function Ug(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),jg(n,r),o}function zr(n,t,e){e&&e.disconnect(),t==="resize"&&$g(n)}function qg(n,t,e){const i=n.canvas,s=Ia(r=>{n.ctx!==null&&e(Wg(r,n))},n);return zg(i,t,s),s}class Xg extends Ol{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Bg(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:Yg,detach:Vg,resize:Ug}[e]||qg;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]||Hg)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Wf(t,e,i,s)}isAttached(t){const e=t&&Or(t);return!!(e&&e.isConnected)}}function Gg(n){return!Cr()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ng:Xg}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 Kg(n,t){const e=n.options.ticks,i=Zg(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Jg(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return tp(t,c,r,o/s),c;const u=Qg(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 Zg(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 Qg(n,t,e){const i=ep(n),s=t.length/e;if(!i)return Math.max(s,1);const r=jh(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 Jg(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function tp(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 ep(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 np=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 ip(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 sp(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 rp(n,t){return Ze(n,{scale:t,type:"scale"})}function op(n,t,e){return Ze(n,{tick:e,index:t,type:"tick"})}function ap(n,t,e){let i=br(n);return(e&&t!=="right"||!e&&t==="right")&&(i=np(i)),i}function lp(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=_f(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=Kg(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)}sp(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 qh(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=op(this.getContext(),t,i))}return this.$context||(this.$context=rp(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=ip(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}=lp(this,l,e,a);mn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:f,textAlign:ap(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;dp(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,cp(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 cp(n,t,e){const i=si(Object.create(null),[e?Tt.get(e):{},Tt.get(t),n.defaults]);Tt.set(t,i),n.defaultRoutes&&up(t,n.defaultRoutes),n.descriptors&&Tt.describe(t,n.descriptors)}function up(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 dp(n){return"id"in n&&"defaults"in n}class hp{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 hp;class fp{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=gp(i);return s===!1&&!e?[]:mp(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 gp(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 pp(n,t){return!t&&n===!1?null:n===!0?{}:n}function mp(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=pp(i[l],s);c!==null&&r.push({plugin:a,options:yp(n.config,{plugin:a,local:e[l]},c,o)})}return r}function yp(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 bp(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function _p(n,t){return n===t?"_index_":"_value_"}function Bl(n){if(n==="x"||n==="y"||n==="r")return n}function xp(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||xp(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 wp(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 kp(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,wp(o,n),Tt.scales[a.type]),c=_p(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=bp(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=kp(n,t)}function Wl(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Sp(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 vp{constructor(t){this._config=Sp(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(Mp(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 Dp=n=>it(n)&&Object.getOwnPropertyNames(n).some(t=>Jt(n[t]));function Mp(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)||Dp(a))||o&&ot(a))return!0}return!1}var Tp="4.4.3";const Cp=["top","bottom","left","right","chartArea"];function $l(n,t){return n==="top"||n==="bottom"||Cp.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 Op(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 Pp(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 Ep(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 Rp(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 vp(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||Gg(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=Nh(),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 fp,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Zh(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",Op),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;Pp(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=Rp(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=Yh(t),c=Ep(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",Tp),O(cn,"getChart",Gl),cn);function Kl(){return dt(fe.instances,n=>n._plugins.invalidate())}function Ap(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 Lp(n){return vr(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ip(n,t,e,i){const s=Lp(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}=Ip(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 Np(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 Fp(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&&Ap(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,Np(e,this,u,o,a),Fp(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 Bp(n,t,e){n.lineTo(e.x,e.y)}function zp(n){return n.stepped?uf:n.tension||n.cubicInterpolationMode==="monotone"?df:Bp}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 Hp(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=Ql(s,e,i),u=zp(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 Wp(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?Wp:Hp}function Yp(n){return n.stepped?Vf:n.tension||n.cubicInterpolationMode==="monotone"?jf:bn}function Vp(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 jp(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 $p=typeof Path2D=="function";function Up(n,t,e,i){$p&&!t.options.segment?Vp(n,t,e,i):jp(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;If(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=Kf(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=Yp(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(),Up(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 qp(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 Xp(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 Gp(n){const t=tc(n),e=t.right-t.left,i=t.bottom-t.top,s=qp(n,e/2,i/2),r=Xp(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 Kp(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Zp(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}=Gp(this),a=Kp(o.radius)?Ln:Zp;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 Qp=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 Jp(n,t){return n.borderColor=nc(t),n.backgroundColor=ic(t),++t}function tm(n,t){return n.backgroundColor=n.data.map(()=>nc(t++)),t}function em(n,t){return n.backgroundColor=n.data.map(()=>ic(t++)),t}function nm(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof Je?t=tm(e,t):s instanceof yi?t=em(e,t):s&&(t=Jp(e,t))}}function sc(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function im(n){return n&&(n.borderColor||n.backgroundColor)}var sm={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)||im(s)||r&&sc(r)))return;const o=nm(n);i.forEach(o)}};function rm(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 om(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 am(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 lm={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}=am(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=rm(c,d,f,i,e);break;case"min-max":p=om(c,d,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){oc(n)}};function cm(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 um(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=um(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 dm(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 hm(n,t,e){const i=mm(n);if(it(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return vt(s)&&Math.floor(s)===s?fm(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function fm(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function gm(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 pm(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 mm(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 ym(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=bm(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++)_m(s,o[u],a)}return new tn({points:s,options:{}})}function bm(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 _m(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=xm(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function xm(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 wm(n){const{chart:t,fill:e,line:i}=n;if(vt(e))return km(t,e);if(e==="stack")return ym(n);if(e==="shape")return!0;const s=Sm(n);return s instanceof uc?s:lc(s,i)}function km(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Sm(n){return(n.scale||{}).getPointPositionForValue?Dm(n):vm(n)}function vm(n){const{scale:t={},fill:e}=n,i=gm(e,t);if(vt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Dm(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=pm(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=wm(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),Mm(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),hi(n))}function Mm(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=cm(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,Tm(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 Tm(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 Cm={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:hm(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=dm(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)}},Om=(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}=Pm(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=Qh(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(!Am(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Om(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 Pm(n,t,e,i,s){const r=Em(i,n,t,e),o=Rm(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function Em(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 Rm(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 Am(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Lm={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 Im(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 Nm={id:"title",_element:Gr,start(n,t,e){Im(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 Fm={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(`
16
+ */class vg{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=$a.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 Be=new vg;const wl="transparent",kg={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Za(n||wl),s=i.valid&&Za(t||wl);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Sg{constructor(t,e,i,s){const r=e[i];s=_i([t.to,s,r,t.from]);const o=_i([t.from,r,s]);this._active=!0,this._fn=t.fn||kg[t.type||typeof o],this._easing=pi[t.easing]||pi.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=_i([t.to,e,s,t.from]),this._from=_i([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 Wr{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!it(t))return;const e=Object.keys(Ct.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=Dg(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Mg(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 h=i.get(c);if(d)if(h&&d.active()){d.update(h,u,a);continue}else d.cancel();if(!h||!h.duration){t[c]=u;continue}r[c]=d=new Sg(h,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 Be.add(this._chart,i),!0}}function Mg(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 Dg(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 vl(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 Tg(n,t,e){if(e===!1)return!1;const i=vl(n,e),s=vl(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Cg(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 kl(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 Sl(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],Mt(c)&&(r||t===0||De(t)===De(c))&&(t+=c)}return t}}function Pg(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 Ml(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Og(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Eg(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 Rg(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Dl(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 Tl(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=Og(r,o,i),d=t.length;let h;for(let g=0;g<d;++g){const p=t[g],{[l]:y,[c]:x}=p,w=p._stacks||(p._stacks={});h=w[c]=Rg(s,u,y),h[a]=x,h._top=Dl(h,o,!0,i.type),h._bottom=Dl(h,o,!1,i.type);const v=h._visualValues||(h._visualValues={});v[a]=x}}function Yr(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Ag(n,t){return en(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Lg(n,t,e){return en(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function wi(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 Vr=n=>n==="reset"||n==="none",Cl=(n,t)=>t?n:Object.assign({},n),Ig=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:kl(e,!0),values:null};class _e{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=Ml(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&&wi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(d,h,g,p)=>d==="x"?h:d==="r"?p:g,r=e.xAxisID=Z(i.xAxisID,Yr(t,"x")),o=e.yAxisID=Z(i.yAxisID,Yr(t,"y")),a=e.rAxisID=Z(i.rAxisID,Yr(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&&Va(this._data,this),t._stacked&&wi(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(it(e)){const s=this._cachedMeta;this._data=Pg(e,s)}else if(i!==e){if(i){Va(i,this);const s=this._cachedMeta;wi(s),s._parsed=[]}e&&Object.isExtensible(e)&&_f(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=Ml(e.vScale,e),e.stack!==i.stack&&(s=!0,wi(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&Tl(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,h;if(this._parsing===!1)i._parsed=s,i._sorted=!0,h=s;else{ot(s[t])?h=this.parseArrayData(i,s,t,e):it(s[t])?h=this.parseObjectData(i,s,t,e):h=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=h[u],l&&(g()&&(l=!1),c=d);i._sorted=l}o&&Tl(this,h)}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 h,g,p;for(h=0,g=s;h<g;++h)p=h+i,d[h]={[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,h,g;for(u=0,d=s;u<d;++u)h=u+i,g=e[h],c[u]={x:r.parse(Ze(g,a),h),y:o.parse(Ze(g,l),h)};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:kl(s,!0),values:e._stacks[t.axis]._visualValues};return Sl(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=Sl(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=Ig(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:d}=Eg(a);let h,g;function p(){g=s[h];const y=g[a.axis];return!Mt(g[t.axis])||u>y||d<y}for(h=0;h<o&&!(!p()&&(this.updateRangeFromParsed(c,t,g,l),r));++h);if(r){for(h=o-1;h>=0;--h)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],Mt(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=Cg(Z(this.options.clip,Tg(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=Lg(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=Ag(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&&te(i);if(a)return Cl(a,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),d=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),u),g=Object.keys(Ct.elements[t]),p=()=>this.getContext(i,s,e),y=c.resolveNamedOptions(h,g,p,d);return y.$shared&&(y.$shared=l,r[o]=Object.freeze(Cl(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),h=u.getOptionScopes(this.getDataset(),d);l=u.createResolver(h,this.getContext(t,i,e))}const c=new Wr(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||Vr(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){Vr(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Vr(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&&wi(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(_e,"defaults",{}),O(_e,"datasetElementType",null),O(_e,"dataElementType",null);function Ng(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=ja(i.sort((s,r)=>s-r))}return n._cache.$bar}function Fg(n){const t=n.iScale,e=Ng(t,n.type);let i=t._length,s,r,o,a;const l=()=>{o===32767||o===-32768||(te(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 Bg(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 zg(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 Hg(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 Pl(n,t,e,i){return ot(n)?Hg(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Ol(n,t,e,i){const s=n.iScale,r=n.vScale,o=s.getLabels(),a=s===r,l=[];let c,u,d,h;for(c=e,u=e+i;c<u;++c)h=t[c],d={},d[s.axis]=a||s.parse(o[c],c),l.push(Pl(h,d,r,c));return l}function jr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Wg(n,t,e){return n!==0?De(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Yg(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 Vg(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}=Yg(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[El(u,o,a,l)]=!0,s=c)),r[El(s,o,a,l)]=!0,n.borderSkipped=r}function El(n,t,e,i){return i?(n=jg(n,t,e),n=Rl(n,e,t)):n=Rl(n,t,e),n}function jg(n,t,e){return n===t?e:n===e?t:n}function Rl(n,t,e){return n==="start"?t:n==="end"?e:n}function $g(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class vi extends _e{parsePrimitiveData(t,e,i,s){return Ol(t,e,i,s)}parseArrayData(t,e,i,s){return Ol(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 h,g,p,y;for(h=i,g=i+s;h<g;++h)y=e[h],p={},p[r.axis]=r.parse(Ze(y,c),h),d.push(Pl(Ze(y,u),p,o,h));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=jr(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:h}=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),x=this._calculateBarIndexPixels(g,u),w=(p._stacks||{})[a.axis],v={horizontal:c,base:y.base,enableBorderRadius:!w||jr(p._custom)||o===w._top||o===w._bottom,x:c?y.head:x.center,y:c?x.center:y.head,height:c?x.size:Math.abs(y.size),width:c?Math.abs(y.size):x.size};h&&(v.options=d||this.resolveDataElementOptions(g,t[g].active?"active":s));const S=v.options||t[g].options;Vg(v,S,w,o),$g(v,S,u.ratio),this.updateElement(t[g],g,v,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||Fg(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=jr(c);let d=l[e.axis],h=0,g=i?this.applyStack(e,l,i):d,p,y;g!==d&&(h=g-d,g=d),u&&(d=c.barStart,g=c.barEnd-c.barStart,d!==0&&De(d)!==De(c.barEnd)&&(h=0),h+=d);const x=!tt(r)&&!u?r:h;let w=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(h+g):p=w,y=p-w,Math.abs(y)<o){y=Wg(y,e,a)*o,d===a&&(w-=y/2);const v=e.getPixelForDecimal(0),S=e.getPixelForDecimal(1),P=Math.min(v,S),D=Math.max(v,S);w=Math.max(Math.min(w,D),P),p=w+y,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(w))}if(w===e.getPixelForValue(a)){const v=De(y)*e.getLineWidthForValue(a)/2;w+=v,y-=v}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"?zg(t,e,s,c):Bg(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(vi,"id","bar"),O(vi,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),O(vi,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class ys extends _e{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 h=e;h<e+i;h++){const g=t[h],p=!r&&this.getParsed(h),y={},x=y[u]=r?o.getPixelForDecimal(.5):o.getPixelForValue(p[u]),w=y[d]=r?a.getBasePixel():a.getPixelForValue(p[d]);y.skip=isNaN(x)||isNaN(w),c&&(y.options=l||this.resolveDataElementOptions(h,g.active?"active":s),r&&(y.options.radius=0)),this.updateElement(g,h,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(ys,"id","bubble"),O(ys,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),O(ys,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Ug(n,t,e){let i=1,s=1,r=0,o=0;if(t<yt){const a=n,l=a+t,c=Math.cos(a),u=Math.sin(a),d=Math.cos(l),h=Math.sin(l),g=(S,P,D)=>gi(S,a,l,!0)?1:Math.max(P,P*e,D,D*e),p=(S,P,D)=>gi(S,a,l,!0)?-1:Math.min(P,P*e,D,D*e),y=g(0,c,d),x=g(xt,u,h),w=p(rt,c,d),v=p(rt+xt,u,h);i=(y-w)/2,s=(x-v)/2,r=-(y+w)/2,o=-(x+v)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:o}}class sn extends _e{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=>+Ze(i[c],l)}let o,a;for(o=t,a=t+e;o<a;++o)s._parsed[o]=r(o)}}_getRotation(){return Ft(this.options.rotation-90)}_getCircumference(){return Ft(this.options.circumference)}_getRotationExtents(){let t=yt,e=-yt;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(af(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:u,rotation:d}=this._getRotationExtents(),{ratioX:h,ratioY:g,offsetX:p,offsetY:y}=Ug(d,u,l),x=(i.width-o)/h,w=(i.height-o)/g,v=Math.max(Math.min(x,w)/2,0),S=La(this.options.radius,v),P=Math.max(S*l,0),D=(S-P)/this._getVisibleDatasetWeightTotal();this.offsetX=p*S,this.offsetY=y*S,s.total=this.calculateTotal(),this.outerRadius=S-D*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-D*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/yt)}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,h=r&&c.animateScale,g=h?0:this.innerRadius,p=h?0:this.outerRadius,{sharedOptions:y,includeOptions:x}=this._getSharedOptions(e,s);let w=this._getRotation(),v;for(v=0;v<e;++v)w+=this._circumference(v,r);for(v=e;v<e+i;++v){const S=this._circumference(v,r),P=t[v],D={x:u+this.offsetX,y:d+this.offsetY,startAngle:w,endAngle:w+S,circumference:S,outerRadius:p,innerRadius:g};x&&(D.options=y||this.resolveDataElementOptions(v,P.active?"active":s)),w+=S,this.updateElement(P,v,D,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)?yt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=mi(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(sn,"id","doughnut"),O(sn,"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(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(sn,"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 ki extends _e{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}=qa(e,s,o);this._drawStart=a,this._drawCount=l,Xa(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),h=o.axis,g=a.axis,{spanGaps:p,segment:y}=this.options,x=Je(p)?p:Number.POSITIVE_INFINITY,w=this.chart._animationsDisabled||r||s==="none",v=e+i,S=t.length;let P=e>0&&this.getParsed(e-1);for(let D=0;D<S;++D){const C=t[D],T=w?C:{};if(D<e||D>=v){T.skip=!0;continue}const b=this.getParsed(D),_=tt(b[g]),M=T[h]=o.getPixelForValue(b[h],D),E=T[g]=r||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,b,l):b[g],D);T.skip=isNaN(M)||isNaN(E)||_,T.stop=D>0&&Math.abs(b[h]-P[h])>x,y&&(T.parsed=b,T.raw=c.data[D]),d&&(T.options=u||this.resolveDataElementOptions(D,C.active?"active":s)),w||this.updateElement(C,D,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(ki,"id","line"),O(ki,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(ki,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Si extends _e{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=mi(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return cl.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,h=c.getIndexAngle(0)-.5*rt;let g=h,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 x=t[p];let w=g,v=g+this._computeAngle(p,s,y),S=o.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;g=v,r&&(l.animateScale&&(S=0),l.animateRotate&&(w=v=h));const P={x:u,y:d,innerRadius:0,outerRadius:S,startAngle:w,endAngle:v,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,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)?Ft(this.resolveDataElementOptions(t,e).angle||i):0}}O(Si,"id","polarArea"),O(Si,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(Si,"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 $r extends sn{}O($r,"id","pie"),O($r,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class bs extends _e{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 cl.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,h=o?r.yCenter:u.y,g={x:d,y:h,angle:u.angle,skip:isNaN(d)||isNaN(h),options:c};this.updateElement(l,a,g,s)}}}O(bs,"id","radar"),O(bs,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),O(bs,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class xs extends _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);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}=qa(e,i,s);if(this._drawStart=r,this._drawCount=o,Xa(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),h=this.includeOptions(s,d),g=o.axis,p=a.axis,{spanGaps:y,segment:x}=this.options,w=Je(y)?y:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none";let S=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const D=t[P],C=this.getParsed(P),T=v?D:{},b=tt(C[p]),_=T[g]=o.getPixelForValue(C[g],P),M=T[p]=r||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,C,l):C[p],P);T.skip=isNaN(_)||isNaN(M)||b,T.stop=P>0&&Math.abs(C[g]-S[g])>w,x&&(T.parsed=C,T.raw=c.data[P]),h&&(T.options=d||this.resolveDataElementOptions(P,D.active?"active":s)),v||this.updateElement(D,P,T,s),S=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(xs,"id","scatter"),O(xs,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(xs,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var qg=Object.freeze({__proto__:null,BarController:vi,BubbleController:ys,DoughnutController:sn,LineController:ki,PieController:$r,PolarAreaController:Si,RadarController:bs,ScatterController:xs});function Sn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ur{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(Ur.prototype,t)}init(){}formats(){return Sn()}parse(){return Sn()}format(){return Sn()}add(){return Sn()}diff(){return Sn()}startOf(){return Sn()}endOf(){return Sn()}}var Al={_date:Ur};function Xg(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?bf:Ne;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),h=l(r,t,e+u);return{lo:d.lo,hi:h.hi}}}}else return l(r,t,e)}return{lo:0,hi:r.length-1}}function Mi(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:h}=Xg(r[a],t,o,s);for(let g=d;g<=h;++g){const p=u[g];p.skip||i(p,c,g)}}}function Gg(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 qr(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||Mi(n,e,t,function(a,l,c){!s&&!Fe(a,n.chartArea,0)||a.inRange(t.x,t.y,i)&&r.push({element:a,datasetIndex:l,index:c})},!0),r}function Kg(n,t,e,i){let s=[];function r(o,a,l){const{startAngle:c,endAngle:u}=o.getProps(["startAngle","endAngle"],i),{angle:d}=Wa(o,{x:t.x,y:t.y});gi(d,c,u)&&s.push({element:o,datasetIndex:a,index:l})}return Mi(n,e,t,r),s}function Zg(n,t,e,i,s,r){let o=[];const a=Gg(e);let l=Number.POSITIVE_INFINITY;function c(u,d,h){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 x=a(t,p);x<l?(o=[{element:u,datasetIndex:d,index:h}],l=x):x===l&&o.push({element:u,datasetIndex:d,index:h})}return Mi(n,e,t,c),o}function Xr(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?Kg(n,t,e,s):Zg(n,t,e,i,s,r)}function Ll(n,t,e,i,s){const r=[],o=e==="x"?"inXRange":"inYRange";let a=!1;return Mi(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 Gr={evaluateInteractionItems:Mi,modes:{index(n,t,e,i){const s=nn(t,n),r=e.axis||"x",o=e.includeInvisible||!1,a=e.intersect?qr(n,s,r,i,o):Xr(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=nn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;let a=e.intersect?qr(n,s,r,i,o):Xr(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=nn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return qr(n,s,r,i,o)},nearest(n,t,e,i){const s=nn(t,n),r=e.axis||"xy",o=e.includeInvisible||!1;return Xr(n,s,r,e.intersect,i,o)},x(n,t,e,i){const s=nn(t,n);return Ll(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=nn(t,n);return Ll(n,s,"y",e.intersect,i)}}};const Il=["left","top","right","bottom"];function Di(n,t){return n.filter(e=>e.pos===t)}function Nl(n,t){return n.filter(e=>Il.indexOf(e.pos)===-1&&e.box.axis===t)}function Ti(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 Qg(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 Jg(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Il.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 tp(n,t){const e=Jg(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 ep(n){const t=Qg(n),e=Ti(t.filter(c=>c.box.fullSize),!0),i=Ti(Di(t,"left"),!0),s=Ti(Di(t,"right")),r=Ti(Di(t,"top"),!0),o=Ti(Di(t,"bottom")),a=Nl(t,"x"),l=Nl(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Di(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(o).concat(a)}}function Fl(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Bl(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 np(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&&Bl(o,r.getPadding());const a=Math.max(0,t.outerWidth-Fl(o,n,"left","right")),l=Math.max(0,t.outerHeight-Fl(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 ip(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 sp(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 Ci(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,sp(a.horizontal,t));const{same:d,other:h}=np(t,e,a,i);c|=d&&s.length,u=u||h,l.fullSize||s.push(a)}return c&&Ci(s,t,e,i)||u}function _s(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 zl(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,h=c.size||l.height;te(c.start)&&(o=c.start),l.fullSize?_s(l,s.left,o,e.outerWidth-s.right-s.left,h):_s(l,t.left+c.placed,o,d,h),c.start=o,c.placed+=d,o=l.bottom}else{const d=t.h*u,h=c.size||l.width;te(c.start)&&(r=c.start),l.fullSize?_s(l,r,s.top,h,e.outerHeight-s.bottom-s.top):_s(l,r,t.top+c.placed,h,d),c.start=r,c.placed+=d,r=l.right}}t.x=r,t.y=o}var Xt={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=Bt(n.options.layout.padding),r=Math.max(t-s.width,0),o=Math.max(e-s.height,0),a=ep(n.boxes),l=a.vertical,c=a.horizontal;dt(n.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=l.reduce((y,x)=>x.box.options&&x.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}),h=Object.assign({},s);Bl(h,Bt(i));const g=Object.assign({maxPadding:h,w:r,h:o,x:s.left,y:s.top},s),p=tp(l.concat(c),d);Ci(a.fullSize,g,d,p),Ci(l,g,d,p),Ci(c,g,d,p)&&Ci(l,g,d,p),ip(g),zl(a.leftAndTop,g,d,p),g.x+=g.w,g.y+=g.h,zl(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 x=y.box;Object.assign(x,n.chartArea),x.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class Hl{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 rp extends Hl{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ws="$chartjs",op={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Wl=n=>n===null||n==="";function ap(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ws]={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",Wl(s)){const r=hl(n,"width");r!==void 0&&(n.width=r)}if(Wl(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=hl(n,"height");r!==void 0&&(n.height=r)}return n}const Yl=dg?{passive:!0}:!1;function lp(n,t,e){n&&n.addEventListener(t,e,Yl)}function cp(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Yl)}function up(n,t){const e=op[n.type]||n.type,{x:i,y:s}=nn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vs(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function dp(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||vs(a.addedNodes,i),o=o&&!vs(a.removedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function hp(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let o=!1;for(const a of r)o=o||vs(a.removedNodes,i),o=o&&!vs(a.addedNodes,i);o&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Pi=new Map;let Vl=0;function jl(){const n=window.devicePixelRatio;n!==Vl&&(Vl=n,Pi.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function fp(n,t){Pi.size||window.addEventListener("resize",jl),Pi.set(n,t)}function gp(n){Pi.delete(n),Pi.size||window.removeEventListener("resize",jl)}function pp(n,t,e){const i=n.canvas,s=i&&Hr(i);if(!s)return;const r=Ua((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),fp(n,r),o}function Kr(n,t,e){e&&e.disconnect(),t==="resize"&&gp(n)}function mp(n,t,e){const i=n.canvas,s=Ua(r=>{n.ctx!==null&&e(up(r,n))},n);return lp(i,t,s),s}class yp extends Hl{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ap(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[ws])return!1;const i=e[ws].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[ws],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),o={attach:dp,detach:hp,resize:pp}[e]||mp;s[e]=o(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Kr,detach:Kr,resize:Kr}[e]||cp)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ug(t,e,i,s)}isAttached(t){const e=t&&Hr(t);return!!(e&&e.isConnected)}}function bp(n){return!zr()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?rp:yp}class jt{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 Je(this.x)&&Je(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(jt,"defaults",{}),O(jt,"defaultRoutes");function xp(n,t){const e=n.options.ticks,i=_p(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?vp(t):[],o=r.length,a=r[0],l=r[o-1],c=[];if(o>s)return kp(t,c,r,o/s),c;const u=wp(r,t,s);if(o>0){let d,h;const g=o>1?Math.round((l-a)/(o-1)):null;for(ks(t,c,u,tt(g)?0:a-g,a),d=0,h=o-1;d<h;d++)ks(t,c,u,r[d],r[d+1]);return ks(t,c,u,l,tt(g)?t.length:l+g),c}return ks(t,c,u),c}function _p(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 wp(n,t,e){const i=Sp(n),s=t.length/e;if(!i)return Math.max(s,1);const r=gf(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 vp(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function kp(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 ks(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 Sp(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 Mp=n=>n==="left"?"right":n==="right"?"left":n,$l=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Ul=(n,t)=>Math.min(t||n,n);function ql(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 Dp(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 Tp(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 Oi(n){return n.drawTicks?n.tickLength:0}function Xl(n,t){if(!n.display)return 0;const e=_t(n.font,t),i=Bt(n.padding);return(ot(n.text)?n.text.length:1)*e.lineHeight+i.height}function Cp(n,t){return en(n,{scale:t,type:"scale"})}function Pp(n,t,e){return en(n,{tick:e,index:t,type:"tick"})}function Op(n,t,e){let i=Pr(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Mp(i)),i}function Ep(n,t,e,i){const{top:s,left:r,bottom:o,right:a,chart:l}=n,{chartArea:c,scales:u}=l;let d=0,h,g,p;const y=o-s,x=a-r;if(n.isHorizontal()){if(g=qt(i,r,a),it(e)){const w=Object.keys(e)[0],v=e[w];p=u[w].getPixelForValue(v)+y-t}else e==="center"?p=(c.bottom+c.top)/2+y-t:p=$l(n,e,t);h=a-r}else{if(it(e)){const w=Object.keys(e)[0],v=e[w];g=u[w].getPixelForValue(v)-x+t}else e==="center"?g=(c.left+c.right)/2-x+t:g=$l(n,e,t);p=qt(i,o,s),d=e==="left"?-xt:xt}return{titleX:g,titleY:p,maxWidth:h,rotation:d}}class Mn extends jt{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=ue(t,Number.POSITIVE_INFINITY),e=ue(e,Number.NEGATIVE_INFINITY),i=ue(i,Number.POSITIVE_INFINITY),s=ue(s,Number.NEGATIVE_INFINITY),{min:ue(t,i),max:ue(e,s),minDefined:Mt(t),maxDefined:Mt(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:ue(e,ue(i,e)),max:ue(i,ue(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=Yf(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?ql(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=xp(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=Ul(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,h=u.highest.height,g=Ht(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-Oi(t.grid)-e.padding-Xl(t.title,this.chart.options.font),c=Math.sqrt(d*d+h*h),o=cs(Math.min(Math.asin(Ht((u.highest.height+6)/a,-1,1)),Math.asin(Ht(l/c,-1,1))-Math.asin(Ht(h/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=Xl(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Oi(r)+l):(t.height=this.maxHeight,t.width=Oi(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:d,highest:h}=this._getLabelSizes(),g=i.padding*2,p=Ft(this.labelRotation),y=Math.cos(p),x=Math.sin(p);if(a){const w=i.mirror?0:x*d.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+w+g)}else{const w=i.mirror?0:y*d.width+x*h.height;t.width=Math.min(this.maxWidth,t.width+w+g)}this._calculatePadding(c,u,x,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 h=0,g=0;l?c?(h=s*t.width,g=i*e.height):(h=i*t.height,g=s*e.width):r==="start"?g=e.width:r==="end"?h=t.width:r!=="inner"&&(h=t.width/2,g=e.width/2),this.paddingLeft=Math.max((h-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=ql(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/Ul(e,i));let c=0,u=0,d,h,g,p,y,x,w,v,S,P,D;for(d=0;d<e;d+=l){if(p=t[d].label,y=this._resolveTickFontOptions(d),s.font=x=y.string,w=r[x]=r[x]||{data:{},gc:[]},v=y.lineHeight,S=P=0,!tt(p)&&!ot(p))S=hs(s,w.data,w.gc,S,p),P=v;else if(ot(p))for(h=0,g=p.length;h<g;++h)D=p[h],!tt(D)&&!ot(D)&&(S=hs(s,w.data,w.gc,S,D),P+=v);o.push(S),a.push(P),c=Math.max(S,c),u=Math.max(P,u)}Tp(r,e);const C=o.indexOf(c),T=a.indexOf(u),b=_=>({width:o[_]||0,height:a[_]||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 yf(this._alignToPixels?_n(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=Pp(this.getContext(),t,i))}return this.$context||(this.$context=Cp(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ft(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),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),h=Oi(r),g=[],p=a.setContext(this.getContext()),y=p.display?p.width:0,x=y/2,w=function(j){return _n(i,j,y)};let v,S,P,D,C,T,b,_,M,E,A,F;if(o==="top")v=w(this.bottom),T=this.bottom-h,_=v-x,E=w(t.top)+x,F=t.bottom;else if(o==="bottom")v=w(this.top),E=t.top,F=w(t.bottom)-x,T=v+x,_=this.top+h;else if(o==="left")v=w(this.right),C=this.right-h,b=v-x,M=w(t.left)+x,A=t.right;else if(o==="right")v=w(this.left),M=t.left,A=w(t.right)-x,C=v+x,b=this.left+h;else if(e==="x"){if(o==="center")v=w((t.top+t.bottom)/2+.5);else if(it(o)){const j=Object.keys(o)[0],N=o[j];v=w(this.chart.scales[j].getPixelForValue(N))}E=t.top,F=t.bottom,T=v+x,_=T+h}else if(e==="y"){if(o==="center")v=w((t.left+t.right)/2);else if(it(o)){const j=Object.keys(o)[0],N=o[j];v=w(this.chart.scales[j].getPixelForValue(N))}C=v-x,b=C-h,M=t.left,A=t.right}const $=Z(s.ticks.maxTicksLimit,d),K=Math.max(1,Math.ceil(d/$));for(S=0;S<d;S+=K){const j=this.getContext(S),N=r.setContext(j),st=a.setContext(j),B=N.lineWidth,Lt=N.color,vt=st.dash||[],H=st.dashOffset,L=N.tickWidth,z=N.tickColor,V=N.tickBorderDash||[],q=N.tickBorderDashOffset;P=Dp(this,S,l),P!==void 0&&(D=_n(i,P,B),c?C=b=M=A=D:T=_=E=F=D,g.push({tx1:C,ty1:T,tx2:b,ty2:_,x1:M,y1:E,x2:A,y2:F,width:B,color:Lt,borderDash:vt,borderDashOffset:H,tickWidth:L,tickColor:z,tickBorderDash:V,tickBorderDashOffset:q}))}return this._ticksLength=d,this._borderValue=v,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,h=Oi(i.grid),g=h+u,p=d?-u:g,y=-Ft(this.labelRotation),x=[];let w,v,S,P,D,C,T,b,_,M,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(h);T=K.textAlign,D=K.x}else if(s==="right"){const K=this._getYAxisLabelAlignment(h);T=K.textAlign,D=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")D=(t.left+t.right)/2-g;else if(it(s)){const K=Object.keys(s)[0],j=s[K];D=this.chart.scales[K].getPixelForValue(j)}T=this._getYAxisLabelAlignment(h).textAlign}e==="y"&&(l==="start"?F="top":l==="end"&&(F="bottom"));const $=this._getLabelSizes();for(w=0,v=a.length;w<v;++w){S=a[w],P=S.label;const K=r.setContext(this.getContext(w));b=this.getPixelForTick(w)+r.labelOffset,_=this._resolveTickFontOptions(w),M=_.lineHeight,E=ot(P)?P.length:1;const j=E/2,N=K.color,st=K.textStrokeColor,B=K.textStrokeWidth;let Lt=T;o?(D=b,T==="inner"&&(w===v-1?Lt=this.options.reverse?"left":"right":w===0?Lt=this.options.reverse?"right":"left":Lt="center"),s==="top"?c==="near"||y!==0?A=-E*M+M/2:c==="center"?A=-$.highest.height/2-j*M+M:A=-$.highest.height+M/2:c==="near"||y!==0?A=M/2:c==="center"?A=$.highest.height/2-j*M:A=$.highest.height-E*M,d&&(A*=-1),y!==0&&!K.showLabelBackdrop&&(D+=M/2*Math.sin(y))):(C=b,A=(1-E)*M/2);let vt;if(K.showLabelBackdrop){const H=Bt(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===v-1?q-=z:w>0&&(q-=z/2);break}vt={left:q,top:V,width:z+H.width,height:L+H.height,color:K.backdropColor}}x.push({label:P,font:_,textOffset:A,options:{rotation:y,color:N,strokeColor:st,strokeWidth:B,textAlign:Lt,textBaseline:F,translation:[D,C],backdrop:vt}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ft(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding: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,h;this.isHorizontal()?(c=_n(t,this.left,o)-o/2,u=_n(t,this.right,a)+a/2,d=h=l):(d=_n(t,this.top,o)-o/2,h=_n(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,h),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&bi(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;wn(i,c,0,u,l,a)}s&&xi(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=_t(i.font),o=Bt(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:h}=Ep(this,l,e,a);wn(t,i.text,0,0,r,{color:i.color,maxWidth:d,rotation:h,textAlign:Op(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!==Mn.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 Ss{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;Lp(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,Rp(t,o,i),this.override&&Ct.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 Ct[s]&&(delete Ct[s][i],this.override&&delete xn[i])}}function Rp(n,t,e){const i=di(Object.create(null),[e?Ct.get(e):{},Ct.get(t),n.defaults]);Ct.set(t,i),n.defaultRoutes&&Ap(t,n.defaultRoutes),n.descriptors&&Ct.describe(t,n.descriptors)}function Ap(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(".");Ct.route(r,s,l,a)})}function Lp(n){return"id"in n&&"defaults"in n}class Ip{constructor(){this.controllers=new Ss(_e,"datasets",!0),this.elements=new Ss(jt,"elements"),this.plugins=new Ss(Object,"plugins"),this.scales=new Ss(Mn,"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=Dr(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 Te=new Ip;class Np{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=Fp(i);return s===!1&&!e?[]:zp(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 Fp(n){const t={},e=[],i=Object.keys(Te.plugins.items);for(let r=0;r<i.length;r++)e.push(Te.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 Bp(n,t){return!t&&n===!1?null:n===!0?{}:n}function zp(n,{plugins:t,localIds:e},i,s){const r=[],o=n.getContext();for(const a of t){const l=a.id,c=Bp(i[l],s);c!==null&&r.push({plugin:a,options:Hp(n.config,{plugin:a,local:e[l]},c,o)})}return r}function Hp(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 Zr(n,t){const e=Ct.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Wp(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Yp(n,t){return n===t?"_index_":"_value_"}function Gl(n){if(n==="x"||n==="y"||n==="r")return n}function Vp(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Qr(n,...t){if(Gl(n))return n;for(const e of t){const i=e.axis||Vp(e.position)||n.length>1&&Gl(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Kl(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function jp(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 Kl(n,"x",e[0])||Kl(n,"y",e[0])}return{}}function $p(n,t){const e=xn[n.type]||{scales:{}},i=t.scales||{},s=Zr(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=Qr(o,a,jp(o,n),Ct.scales[a.type]),c=Yp(l,s),u=e.scales||{};r[o]=hi(Object.create(null),[{axis:l},a,u[l],u[c]])}),n.data.datasets.forEach(o=>{const a=o.type||n.type,l=o.indexAxis||Zr(a,t),u=(xn[a]||{}).scales||{};Object.keys(u).forEach(d=>{const h=Wp(d,l),g=o[h+"AxisID"]||h;r[g]=r[g]||Object.create(null),hi(r[g],[{axis:h},i[g],u[d]])})}),Object.keys(r).forEach(o=>{const a=r[o];hi(a,[Ct.scales[a.type],Ct.scale])}),r}function Zl(n){const t=n.options||(n.options={});t.plugins=Z(t.plugins,{}),t.scales=$p(n,t)}function Ql(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Up(n){return n=n||{},n.data=Ql(n.data),Zl(n),n}const Jl=new Map,tc=new Set;function Ms(n,t){let e=Jl.get(n);return e||(e=t(),Jl.set(n,e),tc.add(e)),e}const Ei=(n,t,e)=>{const i=Ze(t,e);i!==void 0&&n.add(i)};class qp{constructor(t){this._config=Up(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=Ql(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(),Zl(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ms(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ms(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ms(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ms(`${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=>Ei(l,t,d))),u.forEach(d=>Ei(l,s,d)),u.forEach(d=>Ei(l,xn[r]||{},d)),u.forEach(d=>Ei(l,Ct,d)),u.forEach(d=>Ei(l,Rr,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),tc.has(e)&&o.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,xn[e]||{},Ct.datasets[e]||{},{type:e},Ct,Rr]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:o,subPrefixes:a}=ec(this._resolverCache,t,s);let l=o;if(Gp(o,e)){r.$shared=!1,i=ee(i)?i():i;const c=this.createResolver(t,i,a);l=Wn(o,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=ec(this._resolverCache,t,i);return it(e)?Wn(r,e,void 0,s):r}}function ec(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:Nr(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(s,r)),r}const Xp=n=>it(n)&&Object.getOwnPropertyNames(n).some(t=>ee(n[t]));function Gp(n,t){const{isScriptable:e,isIndexable:i}=il(n);for(const s of t){const r=e(s),o=i(s),a=(o||r)&&n[s];if(r&&(ee(a)||Xp(a))||o&&ot(a))return!0}return!1}var Kp="4.4.3";const Zp=["top","bottom","left","right","chartArea"];function nc(n,t){return n==="top"||n==="bottom"||Zp.indexOf(n)===-1&&t==="x"}function ic(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function sc(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),ut(e&&e.onComplete,[n],t)}function Qp(n){const t=n.chart,e=t.options.animation;ut(e&&e.onProgress,[n],t)}function rc(n){return zr()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ds={},oc=n=>{const t=rc(n);return Object.values(Ds).filter(e=>e.canvas===t).pop()};function Jp(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 tm(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Ts(n,t,e){return n.options.clip?n[e]:t[e]}function em(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Ts(e,t,"left"),right:Ts(e,t,"right"),top:Ts(i,t,"top"),bottom:Ts(i,t,"bottom")}:t}let pe=(gn=class{static register(...t){Te.add(...t),ac()}static unregister(...t){Te.remove(...t),ac()}constructor(t,e){const i=this.config=new qp(e),s=rc(t),r=oc(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||bp(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=of(),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 Np,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=wf(d=>this.update(d),o.resizeDelay||0),this._dataChanges=[],Ds[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Be.listen(this,"complete",sc),Be.listen(this,"progress",Qp),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 Te}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():dl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return tl(this.canvas,this.ctx),this}stop(){return Be.stop(this),this}resize(t,e){Be.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,dl(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=Qr(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=Qr(l,a),u=Z(a.type,o.dtype);(a.position===void 0||nc(a.position,c)!==nc(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 h=Te.getScale(u);d=new h({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=>{Xt.configure(this,o,o.options),Xt.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(ic("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||Zr(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=Te.getController(a),{datasetElementType:c,dataElementType:u}=Ct.datasets[a];Object.assign(l,{dataElementType:Te.getElement(u),datasetElementType:c&&Te.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),h=!s&&r.indexOf(d)===-1;d.buildOrUpdateElements(h),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(ic("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=>{Xt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Fa(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;Jp(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(!Fa(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;Xt.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,ee(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&&(Be.has(this)?this.attached&&!Be.running(this)&&Be.start(this):(this.draw(),sc({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=em(t,this.chartArea),o={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&bi(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&&xi(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(t){return Fe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=Gr.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=en(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);te(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(),Be.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(),tl(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ds[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}});!rs(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=hf(t),c=tm(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=!rs(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(gn,"defaults",Ct),O(gn,"instances",Ds),O(gn,"overrides",xn),O(gn,"registry",Te),O(gn,"version",Kp),O(gn,"getChart",oc),gn);function ac(){return dt(pe.instances,n=>n._plugins.invalidate())}function nm(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+xt,i-xt),n.closePath(),n.clip()}function im(n){return Ir(n,["outerStart","outerEnd","innerStart","innerEnd"])}function sm(n,t,e,i){const s=im(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 Ht(l,0,Math.min(r,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Ht(s.innerStart,0,o),innerEnd:Ht(s.innerEnd,0,o)}}function jn(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Cs(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),h=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,x=(p-y)/2,w=l+x+g,v=s-x-g,{outerStart:S,outerEnd:P,innerStart:D,innerEnd:C}=sm(t,h,d,v-w),T=d-S,b=d-P,_=w+S/T,M=v-P/b,E=h+D,A=h+C,F=w+D/E,$=v-C/A;if(n.beginPath(),r){const K=(_+M)/2;if(n.arc(o,a,d,_,K),n.arc(o,a,d,K,M),P>0){const B=jn(b,M,o,a);n.arc(B.x,B.y,P,M,v+xt)}const j=jn(A,v,o,a);if(n.lineTo(j.x,j.y),C>0){const B=jn(A,$,o,a);n.arc(B.x,B.y,C,v+xt,$+Math.PI)}const N=(v-C/h+(w+D/h))/2;if(n.arc(o,a,h,v-C/h,N,!0),n.arc(o,a,h,N,w+D/h,!0),D>0){const B=jn(E,F,o,a);n.arc(B.x,B.y,D,F+Math.PI,w-xt)}const st=jn(T,w,o,a);if(n.lineTo(st.x,st.y),S>0){const B=jn(T,_,o,a);n.arc(B.x,B.y,S,w-xt,_)}}else{n.moveTo(o,a);const K=Math.cos(_)*d+o,j=Math.sin(_)*d+a;n.lineTo(K,j);const N=Math.cos(M)*d+o,st=Math.sin(M)*d+a;n.lineTo(N,st)}n.closePath()}function rm(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a}=t;let l=t.endAngle;if(r){Cs(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(a)||(l=o+(a%yt||yt))}return Cs(n,t,e,i,l,s),n.fill(),l}function om(n,t,e,i,s){const{fullCircles:r,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:d,borderDashOffset:h}=l,g=l.borderAlign==="inner";if(!c)return;n.setLineDash(d||[]),n.lineDashOffset=h,g?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let p=t.endAngle;if(r){Cs(n,t,e,i,p,s);for(let y=0;y<r;++y)n.stroke();isNaN(a)||(p=o+(a%yt||yt))}g&&nm(n,t,p),r||(Cs(n,t,e,i,p,s),n.stroke())}class Ri extends jt{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}=Wa(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),g=(this.options.spacing+this.options.borderWidth)/2,y=Z(h,c-l)>=yt||gi(o,l,c),x=Ie(a,u+g,d+g);return y&&x}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,h=(a+l+u+c)/2;return{x:i+Math.cos(d)*h,y:s+Math.sin(d)*h}}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>yt?Math.floor(s/yt):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,rm(e,this,u,o,a),om(e,this,u,o,a),e.restore()}}O(Ri,"id","arc"),O(Ri,"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(Ri,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(Ri,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function lc(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 am(n,t,e){n.lineTo(e.x,e.y)}function lm(n){return n.stepped?Af:n.tension||n.cubicInterpolationMode==="monotone"?Lf:am}function cc(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 cm(n,t,e,i){const{points:s,options:r}=t,{count:o,start:a,loop:l,ilen:c}=cc(s,e,i),u=lm(r);let{move:d=!0,reverse:h}=i||{},g,p,y;for(g=0;g<=c;++g)p=s[(a+(h?c-g:g))%o],!p.skip&&(d?(n.moveTo(p.x,p.y),d=!1):u(n,y,p,h,r.stepped),y=p);return l&&(p=s[(a+(h?c:0))%o],u(n,y,p,h,r.stepped)),!!l}function um(n,t,e,i){const s=t.points,{count:r,start:o,ilen:a}=cc(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,d=0,h,g,p,y,x,w;const v=P=>(o+(c?a-P:P))%r,S=()=>{y!==x&&(n.lineTo(u,x),n.lineTo(u,y),n.lineTo(u,w))};for(l&&(g=s[v(0)],n.moveTo(g.x,g.y)),h=0;h<=a;++h){if(g=s[v(h)],g.skip)continue;const P=g.x,D=g.y,C=P|0;C===p?(D<y?y=D:D>x&&(x=D),u=(d*u+P)/++d):(S(),n.lineTo(P,D),p=C,d=0,y=x=D),w=D}S()}function Jr(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?um:cm}function dm(n){return n.stepped?hg:n.tension||n.cubicInterpolationMode==="monotone"?fg:kn}function hm(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),lc(n,t.options),n.stroke(s)}function fm(n,t,e,i){const{segments:s,options:r}=t,o=Jr(t);for(const a of s)lc(n,r,a.style),n.beginPath(),o(n,t,a,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const gm=typeof Path2D=="function";function pm(n,t,e,i){gm&&!t.options.segment?hm(n,t,e,i):fm(n,t,e,i)}class rn extends jt{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;sg(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=xg(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=bl(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],l=dm(i);let c,u;for(c=0,u=o.length;c<u;++c){const{start:d,end:h}=o[c],g=r[d],p=r[h];if(g===p){a.push(g);continue}const y=Math.abs((s-g[e])/(p[e]-g[e])),x=l(g,p,y,i.stepped);x[e]=t[e],a.push(x)}return a.length===1?a[0]:a}pathSegment(t,e,i){return Jr(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=Jr(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(),pm(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}O(rn,"id","line"),O(rn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),O(rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),O(rn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function uc(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Ps extends jt{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 uc(this,e,"x",i)}inYRange(e,i){return uc(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||!Fe(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Lr(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}O(Ps,"id","point"),O(Ps,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),O(Ps,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function dc(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 on(n,t,e,i){return n?0:Ht(t,e,i)}function mm(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=nl(i);return{t:on(s.top,r.top,0,e),r:on(s.right,r.right,0,t),b:on(s.bottom,r.bottom,0,e),l:on(s.left,r.left,0,t)}}function ym(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=tn(s),o=Math.min(t,e),a=n.borderSkipped,l=i||it(s);return{topLeft:on(!l||a.top||a.left,r.topLeft,0,o),topRight:on(!l||a.top||a.right,r.topRight,0,o),bottomLeft:on(!l||a.bottom||a.left,r.bottomLeft,0,o),bottomRight:on(!l||a.bottom||a.right,r.bottomRight,0,o)}}function bm(n){const t=dc(n),e=t.right-t.left,i=t.bottom-t.top,s=mm(n,e/2,i/2),r=ym(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 to(n,t,e,i){const s=t===null,r=e===null,a=n&&!(s&&r)&&dc(n,i);return a&&(s||Ie(t,a.left,a.right))&&(r||Ie(e,a.top,a.bottom))}function xm(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function _m(n,t){n.rect(t.x,t.y,t.w,t.h)}function eo(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 Os extends jt{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}=bm(this),a=xm(o.radius)?Hn:_m;t.save(),(o.w!==r.w||o.h!==r.h)&&(t.beginPath(),a(t,eo(o,e,r)),t.clip(),a(t,eo(r,-e,o)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),a(t,eo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return to(this,t,e,i)}inXRange(t,e){return to(this,t,null,e)}inYRange(t,e){return to(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(Os,"id","bar"),O(Os,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),O(Os,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var wm=Object.freeze({__proto__:null,ArcElement:Ri,BarElement:Os,LineElement:rn,PointElement:Ps});const no=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],hc=no.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function fc(n){return no[n%no.length]}function gc(n){return hc[n%hc.length]}function vm(n,t){return n.borderColor=fc(t),n.backgroundColor=gc(t),++t}function km(n,t){return n.backgroundColor=n.data.map(()=>fc(t++)),t}function Sm(n,t){return n.backgroundColor=n.data.map(()=>gc(t++)),t}function Mm(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=km(e,t):s instanceof Si?t=Sm(e,t):s&&(t=vm(e,t))}}function pc(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Dm(n){return n&&(n.borderColor||n.backgroundColor)}var Tm={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&&(pc(i)||Dm(s)||r&&pc(r)))return;const o=Mm(n);i.forEach(o)}};function Cm(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,h,g,p,y;for(o[l++]=n[u],d=0;d<r-2;d++){let x=0,w=0,v;const S=Math.floor((d+1)*a)+1+t,P=Math.min(Math.floor((d+2)*a)+1,e)+t,D=P-S;for(v=S;v<P;v++)x+=n[v].x,w+=n[v].y;x/=D,w/=D;const C=Math.floor(d*a)+1+t,T=Math.min(Math.floor((d+1)*a)+1,e)+t,{x:b,y:_}=n[u];for(g=p=-1,v=C;v<T;v++)p=.5*Math.abs((b-x)*(n[v].y-_)-(b-n[v].x)*(w-_)),p>g&&(g=p,h=n[v],y=v);o[l++]=h,u=y}return o[l++]=n[c],o}function Pm(n,t,e,i){let s=0,r=0,o,a,l,c,u,d,h,g,p,y;const x=[],w=t+e-1,v=n[t].x,P=n[w].x-v;for(o=t;o<t+e;++o){a=n[o],l=(a.x-v)/P*i,c=a.y;const D=l|0;if(D===u)c<p?(p=c,d=o):c>y&&(y=c,h=o),s=(r*s+a.x)/++r;else{const C=o-1;if(!tt(d)&&!tt(h)){const T=Math.min(d,h),b=Math.max(d,h);T!==g&&T!==C&&x.push({...n[T],x:s}),b!==g&&b!==C&&x.push({...n[b],x:s})}o>0&&C!==g&&x.push(n[C]),x.push(a),u=D,r=0,p=y=c,d=h=g=o}}return x}function mc(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 yc(n){n.data.datasets.forEach(t=>{mc(t)})}function Om(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=Ht(Ne(t,r.axis,o).lo,0,e-1)),c?s=Ht(Ne(t,r.axis,a).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Em={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){yc(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(_i([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:h}=Om(l,c);const g=e.threshold||4*i;if(h<=g){mc(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=Cm(c,d,h,i,e);break;case"min-max":p=Pm(c,d,h,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){yc(n)}};function Rm(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=so(l,c,s);const u=io(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=bl(t,u);for(const h of d){const g=io(e,r[h.start],r[h.end],h.loop),p=yl(a,s,g);for(const y of p)o.push({source:y,target:h,start:{[e]:bc(u,g,"start",Math.max)},end:{[e]:bc(u,g,"end",Math.min)}})}}return o}function io(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=de(s),r=de(r)),{property:n,start:s,end:r}}function Am(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:o,end:a})=>{a=so(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 so(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function bc(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function xc(n,t){let e=[],i=!1;return ot(n)?(i=!0,e=n):e=Am(n,t),e.length?new rn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function _c(n){return n&&n.fill!==!1}function Lm(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(!Mt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;r.push(s),s=o.fill}return!1}function Im(n,t,e){const i=zm(n);if(it(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Mt(s)&&Math.floor(s)===s?Nm(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Nm(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Fm(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 Bm(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 zm(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 Hm(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,o=i.points,a=Wm(t,e);a.push(xc({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++)Ym(s,o[u],a)}return new rn({points:s,options:{}})}function Wm(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 Ym(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:o,last:a,point:l}=Vm(r,t,"x");if(!(!l||o&&a)){if(o)i.unshift(l);else if(n.push(l),!a)break}}n.push(...i)}function Vm(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],h=o[u.end][e];if(Ie(s,d,h)){a=s===d,l=s===h;break}}return{first:a,last:l,point:i}}class wc{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:yt},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 jm(n){const{chart:t,fill:e,line:i}=n;if(Mt(e))return $m(t,e);if(e==="stack")return Hm(n);if(e==="shape")return!0;const s=Um(n);return s instanceof wc?s:xc(s,i)}function $m(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Um(n){return(n.scale||{}).getPointPositionForValue?Xm(n):qm(n)}function qm(n){const{scale:t={},fill:e}=n,i=Fm(e,t);if(Mt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Xm(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,o=Bm(e,t,r),a=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new wc({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 ro(n,t,e){const i=jm(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&&(bi(n,e),Gm(n,{line:s,target:i,above:u,below:d,area:e,scale:r,axis:o}),xi(n))}function Gm(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&&(vc(n,i,o.top),kc(n,{line:e,target:i,color:s,scale:a,property:l}),n.restore(),n.save(),vc(n,i,o.bottom)),kc(n,{line:e,target:i,color:r,scale:a,property:l}),n.restore()}function vc(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[so(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 kc(n,t){const{line:e,target:i,property:s,color:r,scale:o}=t,a=Rm(e,i,s);for(const{source:l,target:c,start:u,end:d}of a){const{style:{backgroundColor:h=r}={}}=l,g=i!==!0;n.save(),n.fillStyle=h,Km(n,o,g&&io(s,u,d)),n.beginPath();const p=!!e.pathSegment(n,l);let y;if(g){p?n.closePath():Sc(n,i,d,s);const x=!!i.pathSegment(n,c,{move:p,reverse:!0});y=p&&x,y||Sc(n,i,u,s)}n.closePath(),n.fill(y?"evenodd":"nonzero"),n.restore()}}function Km(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 Sc(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Zm={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 rn&&(l={visible:n.isDatasetVisible(o),index:o,fill:Im(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=Lm(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&&ro(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;_c(r)&&ro(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!_c(i)||e.drawTime!=="beforeDatasetDraw"||ro(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Mc=(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)}},Qm=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Dc extends jt{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}=Mc(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 h=-1,g=-u;return this.legendItems.forEach((p,y)=>{const x=i+e/2+r.measureText(p.text).width;(y===0||c[c.length-1]+x+2*a>o)&&(d+=u,c[c.length-(y>0?0:1)]=0,g+=u,h++),l[y]={left:0,top:g,row:h,width:x,height:s},c[c.length-1]+=x+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,h=0,g=0,p=0,y=0;return this.legendItems.forEach((x,w)=>{const{itemWidth:v,itemHeight:S}=Jm(i,e,r,x,s);w>0&&g+S+2*a>u&&(d+=h+a,c.push({width:h,height:g}),p+=h+a,y++,h=g=0),l[w]={left:p,top:g,col:y,width:v,height:S},h=Math.max(h,v),g+=S+a}),d+=h,c.push({width:h,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=Vn(r,this.left,this.width);if(this.isHorizontal()){let a=0,l=qt(i,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=qt(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=qt(i,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=qt(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;bi(t,this),this._draw(),xi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:o}=t,a=Ct.color,l=Vn(t.rtl,this.left,this.width),c=_t(o.font),{padding:u}=o,d=c.size,h=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:x}=Mc(o,d),w=function(C,T,b){if(isNaN(p)||p<=0||isNaN(y)||y<0)return;s.save();const _=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=_,s.strokeStyle=Z(b.strokeStyle,a),s.setLineDash(Z(b.lineDash,[])),o.usePointStyle){const M={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},E=l.xPlus(C,p/2),A=T+h;el(s,M,E,A,o.pointStyleWidth&&p)}else{const M=T+Math.max((d-y)/2,0),E=l.leftForLtr(C,p),A=tn(b.borderRadius);s.beginPath(),Object.values(A).some(F=>F!==0)?Hn(s,{x:E,y:M,w:p,h:y,radius:A}):s.rect(E,M,p,y),s.fill(),_!==0&&s.stroke()}s.restore()},v=function(C,T,b){wn(s,b.text,C,T+x/2,c,{strikethrough:b.hidden,textAlign:l.textAlign(b.textAlign)})},S=this.isHorizontal(),P=this._computeTitleHeight();S?g={x:qt(r,this.left+u,this.right-i[0]),y:this.top+u+P,line:0}:g={x:this.left+u,y:qt(r,this.top+P+u,this.bottom-e[0].height),line:0},fl(this.ctx,t.textDirection);const D=x+u;this.legendItems.forEach((C,T)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const b=s.measureText(C.text).width,_=l.textAlign(C.textAlign||(C.textAlign=o.textAlign)),M=p+h+b;let E=g.x,A=g.y;l.setWidth(this.width),S?T>0&&E+M+u>this.right&&(A=g.y+=D,g.line++,E=g.x=qt(r,this.left+u,this.right-i[g.line])):T>0&&A+D>this.bottom&&(E=g.x=E+e[g.line].width+u,g.line++,A=g.y=qt(r,this.top+P+u,this.bottom-e[g.line].height));const F=l.x(E);if(w(F,A,C),E=vf(_,E+p+h,S?E+M:this.right,t.rtl),v(l.x(E),A,C),S)g.x+=M+u;else if(typeof C.text!="string"){const $=c.lineHeight;g.y+=Tc(C,$)+u}else g.y+=D}),gl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=_t(e.font),s=Bt(e.padding);if(!e.display)return;const r=Vn(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,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+c,d=qt(t.align,d,this.right-h);else{const p=this.columnSizes.reduce((y,x)=>Math.max(y,x.height),0);u=c+qt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const g=qt(a,d,d+h);o.textAlign=r.textAlign(Pr(a)),o.textBaseline="middle",o.strokeStyle=e.color,o.fillStyle=e.color,o.font=i.string,wn(o,e.text,g,u,i)}_computeTitleHeight(){const t=this.options.title,e=_t(t.font),i=Bt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Ie(t,this.left,this.right)&&Ie(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Ie(t,s.left,s.left+s.width)&&Ie(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!ny(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=Qm(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 Jm(n,t,e,i,s){const r=ty(i,n,t,e),o=ey(s,i,t.lineHeight);return{itemWidth:r,itemHeight:o}}function ty(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 ey(n,t,e){let i=n;return typeof t.text!="string"&&(i=Tc(t,e)),i}function Tc(n,t){const e=n.text?n.text.length:0;return t*e}function ny(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var iy={id:"legend",_element:Dc,start(n,t,e){const i=n.legend=new Dc({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i)},stop(n){Xt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;Xt.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=Bt(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 oo extends jt{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=Bt(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=qt(a,i,r),d=e+t,c=r-i):(o.position==="left"?(u=i+t,d=qt(a,s,e),l=rt*-.5):(u=r-t,d=qt(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);wn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Pr(e.align),textBaseline:"middle",translation:[o,a]})}}function sy(n,t){const e=new oo({ctx:n.ctx,options:t,chart:n});Xt.configure(n,e,t),Xt.addBox(n,e),n.titleBlock=e}var ry={id:"title",_element:oo,start(n,t,e){sy(n,e)},stop(n){const t=n.titleBlock;Xt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;Xt.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 Es=new WeakMap;var oy={id:"subtitle",start(n,t,e){const i=new oo({ctx:n.ctx,options:e,chart:n});Xt.configure(n,i,e),Xt.addBox(n,i),Es.set(n,i)},stop(n){Xt.removeBox(n,Es.get(n)),Es.delete(n)},beforeUpdate(n,t,e){const i=Es.get(n);Xt.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 Ai={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=zn(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 Ce(n,t){return t&&(ot(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function ze(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
17
17
  `)>-1?n.split(`
18
- `):n}function Bm(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 zm(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Hm(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 Wm(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"),Hm(c,n,t,e)&&(c="center"),c}function bc(n,t,e){const i=e.yAlign||t.yAlign||zm(n,e);return{xAlign:e.xAlign||t.xAlign||Wm(n,t,e,i),yAlign:i}}function Ym(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Vm(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=Ym(t,a);const y=Vm(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 jm(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=jm(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(Bm(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"]},$m=Object.freeze({__proto__:null,Colors:sm,Decimation:lm,Filler:Cm,Legend:Lm,SubTitle:Fm,Title:Nm,Tooltip:Ss});const Um=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function qm(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Um(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const Xm=(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:qm(i,t,Z(e,t),this._addedLabels),Xm(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 Gm(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&&$h((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=Gm(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 Km(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 Zm(n,{min:t,max:e}){t=le(n.min,t);const i=[],s=Ti(t);let r=Km(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=Zm(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 Qm(n,t,e){return e=ot(e)?e:[e],{w:cf(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 Jm(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=Qm(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);ty(e,t,g,y,_)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=iy(n,i,s)}function ty(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 ey(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=oy(l.y,a.h,c),d=sy(c),f=ry(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 ny(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 iy(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=ey(n,u,l);i.push(d),a==="auto"&&(d.visible=ny(d,c),d.visible&&(c=d))}return i}function sy(n){return n===0||n===180?"center":n<180?"left":"right"}function ry(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function oy(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function ay(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 ly(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));ay(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 cy(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 uy(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?Jm(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 uy(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&&ly(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);cy(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 dy(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 hy(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 fy(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:fy(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=Gh(s,r,o);return this._unit=e.unit||(i.autoSkip?Ec(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):dy(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:hy(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 gy=Object.freeze({__proto__:null,CategoryScale:Zr,LinearScale:Qr,LogarithmicScale:Jr,RadialLinearScale:Ci,TimeScale:Oi,TimeSeriesScale:eo});const py=[vg,Qp,$m,gy],my=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],yy=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],by=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],_y=["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?_y:by:t.binary?yy:my,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,xy=864e5,Pi=6e4,zn=36e5,wy=1e3;function ky(n,t){return Cs(n,t*zn)}let Sy={};function kn(){return Sy}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)/xy)}function vy(n){const t=Nc(n),e=xt(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Hn(e)}function Dy(n,t){return Cs(n,t*Pi)}function My(n,t){const e=t*3;return io(n,e)}function Ty(n,t){return Cs(n,t*1e3)}function Cy(n,t){const e=t*7;return Ts(n,e)}function Oy(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 Py(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ro(n){if(!Py(n)&&typeof n!="number")return!1;const t=G(n);return!isNaN(Number(t))}function Ey(n,t){const e=G(n),i=G(t),s=e.getFullYear()-i.getFullYear(),r=e.getMonth()-i.getMonth();return s*12+r}function Ry(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 Ay(n,t,e){const i=Ps(n,t)/zn;return Ri(e==null?void 0:e.roundingMethod)(i)}function Ly(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 Iy(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(Ey(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;Iy(G(n))&&r===1&&Ei(n,i)===1&&(a=!1),o=s*(r-Number(a))}return o===0?0:o}function Ny(n,t,e){const i=Yc(n,t)/3;return Ri(e==null?void 0:e.roundingMethod)(i)}function Fy(n,t,e){const i=Ps(n,t)/1e3;return Ri(e==null?void 0:e.roundingMethod)(i)}function By(n,t,e){const i=Bc(n,t)/7;return Ri(e==null?void 0:e.roundingMethod)(i)}function zy(n,t){const e=G(n),i=G(t),s=Ei(e,i),r=Math.abs(Ry(e,i));e.setFullYear(1584),i.setFullYear(1584);const o=Ei(e,i)===-s,a=s*(r-+o);return a===0?0:a}function Hy(n){const t=G(n);return t.setSeconds(0,0),t}function Wy(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 Yy(n){const t=G(n);return t.setDate(1),t.setHours(0,0,0,0),t}function Vy(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 jy(n){const t=G(n);return t.setMinutes(59,59,999),t}function $y(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 Uy(n){const t=G(n);return t.setSeconds(59,999),t}function qy(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 Xy(n){const t=G(n);return t.setMilliseconds(999),t}const Gy={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"}},Ky=(n,t,e)=>{let i;const s=Gy[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 Zy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Qy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Jy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},tb={date:oo({formats:Zy,defaultWidth:"full"}),time:oo({formats:Qy,defaultWidth:"full"}),dateTime:oo({formats:Jy,defaultWidth:"full"})},eb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},nb=(n,t,e,i)=>eb[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 ib={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},sb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rb={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"]},ob={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"]},ab={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"}},lb={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"}},cb={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:ib,defaultWidth:"wide"}),quarter:Ai({values:sb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ai({values:rb,defaultWidth:"wide"}),day:Ai({values:ob,defaultWidth:"wide"}),dayPeriod:Ai({values:ab,defaultWidth:"wide",formattingValues:lb,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)?db(a,d=>d.test(o)):ub(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 ub(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function db(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function hb(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 fb=/^(\d+)(th|st|nd|rd)?/i,gb=/\d+/i,pb={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},mb={any:[/^b/i,/^(a|c)/i]},yb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},bb={any:[/1/i,/2/i,/3/i,/4/i]},_b={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},xb={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]},wb={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},kb={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]},Sb={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},vb={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}},Db={ordinalNumber:hb({matchPattern:fb,parsePattern:gb,valueCallback:n=>parseInt(n,10)}),era:Li({matchPatterns:pb,defaultMatchWidth:"wide",parsePatterns:mb,defaultParseWidth:"any"}),quarter:Li({matchPatterns:yb,defaultMatchWidth:"wide",parsePatterns:bb,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Li({matchPatterns:_b,defaultMatchWidth:"wide",parsePatterns:xb,defaultParseWidth:"any"}),day:Li({matchPatterns:wb,defaultMatchWidth:"wide",parsePatterns:kb,defaultParseWidth:"any"}),dayPeriod:Li({matchPatterns:Sb,defaultMatchWidth:"any",parsePatterns:vb,defaultParseWidth:"any"})},jc={code:"en-US",formatDistance:Ky,formatLong:tb,formatRelative:nb,localize:cb,match:Db,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Mb(n){const t=G(n);return Fc(t,Vc(t))+1}function $c(n){const t=G(n),e=+Hn(t)-+vy(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 Tb(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)-+Tb(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=Mb(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))}},Cb=/^D+$/,Ob=/^Y+$/,Pb=["D","DD","YY","YYYY"];function Qc(n){return Cb.test(n)}function Jc(n){return Ob.test(n)}function co(n,t,e){const i=Eb(n,t,e);if(console.warn(i),Pb.includes(n))throw new RangeError(i)}function Eb(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 Rb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ab=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Lb=/^'([^]*?)'?$/,Ib=/''/g,Nb=/[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(Ab).map(S=>{const v=S[0];if(v==="p"||v==="P"){const P=lo[v];return P(S,s.formatLong)}return S}).join("").match(Rb).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const v=S[0];if(v==="'")return{isToken:!1,value:Fb(S)};if(qc[v])return{isToken:!0,value:S};if(v.match(Nb))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 Fb(n){const t=n.match(Lb);return t?t[1].replace(Ib,"'"):n}function Bb(){return Object.assign({},kn())}function zb(n){let e=G(n).getDay();return e===0&&(e=7),e}function Hb(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 Wb=10;class eu{constructor(){O(this,"subPriority",0)}validate(t,e){return!0}}class Yb 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 Vb extends eu{constructor(){super(...arguments);O(this,"priority",Wb);O(this,"subPriority",-1)}set(e,i){return i.timestampIsSet?e:xt(e,Hb(e,Date))}}class at{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new Yb(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class jb 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*wy),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 $b 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 Ub 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 qb 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 Xb 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 Gb 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 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:"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 Zb 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 Qb 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 Jb(n,t,e){const i=G(n),s=Uc(i,e)-t;return i.setDate(i.getDate()-s*7),i}class t0 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(Jb(e,s,r),r)}}function e0(n,t){const e=G(n),i=$c(e)-t;return e.setDate(e.getDate()-i*7),e}class n0 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(e0(e,s))}}const i0=[31,28,31,30,31,30,31,31,30,31,30,31],s0=[31,29,31,30,31,30,31,31,30,31,30,31];class r0 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<=s0[o]:i>=1&&i<=i0[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class o0 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 a0 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 l0 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 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","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 u0(n,t){const e=G(n),i=zb(e),s=t-i;return Ts(e,s)}class d0 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=u0(e,s),e.setHours(0,0,0,0),e}}class h0 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 f0 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 g0 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 p0 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 m0 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 y0 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 b0 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 _0 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 x0 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 w0 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 k0 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 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",40);O(this,"incompatibleTokens","*")}parse(e){return nu(e)}set(e,i,s){return[xt(e,s*1e3),{timestampIsSet:!0}]}}class D0 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 M0={G:new jb,y:new $b,Y:new Ub,R:new qb,u:new Xb,Q:new Gb,q:new Kb,M:new Zb,L:new Qb,w:new t0,I:new n0,d:new r0,D:new o0,E:new a0,e:new l0,c:new c0,i:new d0,a:new h0,b:new f0,B:new g0,h:new p0,H:new m0,K:new y0,k:new b0,m:new _0,s:new x0,S:new w0,X:new k0,x:new S0,t:new v0,T:new D0},T0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,C0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,O0=/^'([^]*?)'?$/,P0=/''/g,E0=/\S/,R0=/[a-zA-Z]/;function A0(n,t,e,i){var y,_,w,S,v,P,M,C;const s=Bb(),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 Vb],u=t.match(C0).map(T=>{const b=T[0];if(b in lo){const x=lo[b];return x(T,r.formatLong)}return T}).join("").match(T0),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=M0[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(R0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(T==="''"?T="'":b==="'"&&(T=L0(T)),n.indexOf(T)===0)n=n.slice(T.length);else return xt(e,NaN)}}if(n.length>0&&E0.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 L0(n){return n.match(O0)[1].replace(P0,"'")}function I0(n){const t=G(n);return t.setMinutes(0,0,0),t}function N0(n){const t=G(n);return t.setMilliseconds(0),t}function F0(n){const t=n/zn;return Math.trunc(t)}function ru(n,t){const e=(t==null?void 0:t.additionalDigits)??2,i=W0(n);let s;if(i.date){const l=Y0(i.date,e);s=V0(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=j0(i.time),isNaN(o)))return new Date(NaN);if(i.timezone){if(a=$0(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+-].*)$/},B0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,z0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,H0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function W0(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 Y0(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 V0(n,t){if(t===null)return new Date(NaN);const e=n.match(B0);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 K0(t,a,l)?U0(t,a,l):new Date(NaN);{const c=new Date(0);return!X0(t,r,o)||!G0(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function Ii(n){return n?parseInt(n):1}function j0(n){const t=n.match(z0);if(!t)return NaN;const e=fo(t[1]),i=fo(t[2]),s=fo(t[3]);return Z0(e,i,s)?e*zn+i*Pi+s*1e3:NaN}function fo(n){return n&&parseFloat(n.replace(",","."))||0}function $0(n){if(n==="Z")return 0;const t=n.match(H0);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Q0(i,s)?e*(i*zn+s*Pi):NaN}function U0(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 q0=[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 X0(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(q0[t]||(ou(n)?29:28))}function G0(n,t){return t>=1&&t<=(ou(n)?366:365)}function K0(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Z0(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function Q0(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}},J0=n=>n&&n.datasets&&n.datasets.length,t_=n=>J0(n)&&n.datasets.some(t=>t.data.length),e_=n=>t_(n)&&n.datasets.some(t=>t.data.length>1),n_=n=>e_(n)&&n.datasets.some(t=>t.data[0]&&ro(t.data[0].x)),i_=n=>n_(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)},s_=(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=a_(n,e.timeZone,e.locale);return"formatToParts"in i?r_(i,t):o_(i,t)}function r_(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 o_(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function a_(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function l_(n,t){const e=h_(t);return"formatToParts"in e?u_(e,n):d_(e,n)}const c_={year:0,month:1,day:2,hour:3,minute:4,second:5};function u_(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=c_[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 d_(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 h_(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,f_=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*f_,i[1]==="+"?-r:r):NaN}if(m_(n)){t=new Date(t||Date.now());const o=e?t:g_(t),a=_o(o,n);return-(e?a:p_(t,a,n))}return NaN}function g_(n){return cu(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function _o(n,t){const e=l_(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 p_(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 m_(n){if(hu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),hu[n]=!0,!0}catch{return!1}}const y_=60*1e3,b_={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"+__(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)/y_:(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 __(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 x_=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,wo=36e5,pu=6e4,w_=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:x_};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?w_: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=k_(n),{year:s,restDateString:r}=S_(i.date,e),o=v_(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=D_(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 k_(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 S_(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 v_(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 C_(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 D_(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 M_=[31,28,31,30,31,30,31,31,30,31,30,31],T_=[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>T_[t]||!i&&e>M_[t])return!1}return!0}function C_(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 O_=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function So(n,t,e={}){t=String(t);const i=t.match(O_);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,"'"+b_[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return tu(n,t,e)}function P_(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 E_(n,t,e,i){return i={...i,timeZone:t,originalDate:n},So(P_(n,t,{timeZone:i.timeZone}),e,i)}const wu=2,ku=10,Su=12,Is=new Intl.NumberFormat(((Qd=document==null?void 0:document.documentElement)==null?void 0:Qd.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 E_(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"}},R_=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Tu[t])==null?void 0:e.background)||"#fafafa"},A_={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},L_={"4XX":"#FFBA81","5XX":"#FF8484"},I_={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},N_="#dad4c7",F_=n=>{const t=Object.entries(vu).find(([e])=>new RegExp(e).test(n));return t&&t[1]||vu.standard},B_={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},z_=2,H_=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},W_=()=>{const n="label_height";if(!vo.has(n)){const t=_t({});vo.set(n,t.lineHeight)}return vo.get(n)},Y_=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",V_={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=V_[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},j_=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 $_(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(...py);const U_=(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 q_(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(U_(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 X_=Ru.exports;const Fi=Co(X_);function G_(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 K_(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 Z_(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 Q_(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 _=s_(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(()=>F0(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 J_(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 tx(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=J_({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 ex=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),nx=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},ix=(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 ex(a,l,e)};function sx(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=nx(a),y=ix(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),...B_,fill:D,borderWidth:D?H_:z_}});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 rx=(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 ox(){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:$_,useChartJSCommon:q_,useChartLegendValues:G_,useChartSelectedRange:K_,useExploreResultToDatasets:tx,useExploreResultToTimeDataset:sx,useDoughnutChartOptions:Z_,useLinechartOptions:Q_,useI18n:fh,useReportChartDataForSynthetics:rx,useTranslatedUnits:ox};/*!
18
+ `):n}function ay(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 Cc(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,h=s.length,g=i.length,p=Bt(t.padding);let y=p.height,x=0,w=i.reduce((P,D)=>P+D.before.length+D.lines.length+D.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}h&&(y+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let v=0;const S=function(P){x=Math.max(x,e.measureText(P).width+v)};return e.save(),e.font=c.string,dt(n.title,S),e.font=l.string,dt(n.beforeBody.concat(n.afterBody),S),v=t.displayColors?o+2+t.boxPadding:0,dt(i,P=>{dt(P.before,S),dt(P.lines,S),dt(P.after,S)}),v=0,e.font=u.string,dt(n.footer,S),e.restore(),x+=p.width,{width:x,height:y}}function ly(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function cy(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 uy(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"),cy(c,n,t,e)&&(c="center"),c}function Pc(n,t,e){const i=e.yAlign||t.yAlign||ly(n,e);return{xAlign:e.xAlign||t.xAlign||uy(n,t,e,i),yAlign:i}}function dy(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function hy(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Oc(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:h,bottomRight:g}=tn(o);let p=dy(t,a);const y=hy(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(u,h)+s:a==="right"&&(p+=Math.max(d,g)+s),{x:Ht(p,0,i.width-t.width),y:Ht(y,0,i.height-t.height)}}function Rs(n,t,e){const i=Bt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Ec(n){return Ce([],ze(n))}function fy(n,t,e){return en(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Rc(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Ac={beforeTitle:Le,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:Le,beforeBody:Le,beforeLabel:Le,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:Le,afterBody:Le,beforeFooter:Le,footer:Le,afterFooter:Le};function ne(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Ac[t].call(e,i):s}class ao extends jt{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 Wr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=fy(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ne(i,"beforeTitle",this,t),r=ne(i,"title",this,t),o=ne(i,"afterTitle",this,t);let a=[];return a=Ce(a,ze(s)),a=Ce(a,ze(r)),a=Ce(a,ze(o)),a}getBeforeBody(t,e){return Ec(ne(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return dt(t,r=>{const o={before:[],lines:[],after:[]},a=Rc(i,r);Ce(o.before,ze(ne(a,"beforeLabel",this,r))),Ce(o.lines,ne(a,"label",this,r)),Ce(o.after,ze(ne(a,"afterLabel",this,r))),s.push(o)}),s}getAfterBody(t,e){return Ec(ne(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ne(i,"beforeFooter",this,t),r=ne(i,"footer",this,t),o=ne(i,"afterFooter",this,t);let a=[];return a=Ce(a,ze(s)),a=Ce(a,ze(r)),a=Ce(a,ze(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(ay(this.chart,e[l]));return t.filter&&(a=a.filter((u,d,h)=>t.filter(u,d,h,i))),t.itemSort&&(a=a.sort((u,d)=>t.itemSort(u,d,i))),dt(a,u=>{const d=Rc(t.callbacks,u);s.push(ne(d,"labelColor",this,u)),r.push(ne(d,"labelPointStyle",this,u)),o.push(ne(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=Ai[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=Cc(this,i),c=Object.assign({},a,l),u=Pc(this.chart,i,c),d=Oc(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}=tn(a),{x:h,y:g}=t,{width:p,height:y}=e;let x,w,v,S,P,D;return r==="center"?(P=g+y/2,s==="left"?(x=h,w=x-o,S=P+o,D=P-o):(x=h+p,w=x+o,S=P-o,D=P+o),v=x):(s==="left"?w=h+Math.max(l,u)+o:s==="right"?w=h+p-Math.max(c,d)-o:w=this.caretX,r==="top"?(S=g,P=S-o,x=w-o,v=w+o):(S=g+y,P=S+o,x=w+o,v=w-o),D=S),{x1:x,x2:w,x3:v,y1:S,y2:P,y3:D}}drawTitle(t,e,i){const s=this.title,r=s.length;let o,a,l;if(r){const c=Vn(i.rtl,this.x,this.width);for(t.x=Rs(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=Rs(this,"left",r),h=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},x=s.leftForLtr(h,c)+c/2,w=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Lr(t,y,x,w),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,Lr(t,y,x,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(h,c),x=s.leftForLtr(s.xPlus(h,1),c-2),w=tn(o.borderRadius);Object.values(w).some(v=>v!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,Hn(t,{x:y,y:p,w:c,h:l,radius:w}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),Hn(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(x,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 h=d.lineHeight,g=0;const p=Vn(i.rtl,this.x,this.width),y=function(b){e.fillText(b,p.x(t.x+g),t.y+h/2),t.y+=h+r},x=p.textAlign(o);let w,v,S,P,D,C,T;for(e.textAlign=o,e.textBaseline="middle",e.font=d.string,t.x=Rs(this,x,i),e.fillStyle=i.bodyColor,dt(this.beforeBody,y),g=a&&x!=="right"?o==="center"?c/2+u:c+2+u:0,P=0,C=s.length;P<C;++P){for(w=s[P],v=this.labelTextColors[P],e.fillStyle=v,dt(w.before,y),S=w.lines,a&&S.length&&(this._drawColorBox(e,t,P,p,i),h=Math.max(d.lineHeight,l)),D=0,T=S.length;D<T;++D)y(S[D]),h=d.lineHeight;dt(w.after,y)}g=0,h=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=Vn(i.rtl,this.x,this.width);for(t.x=Rs(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:h,bottomLeft:g,bottomRight:p}=tn(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-h,l),e.quadraticCurveTo(a+c,l,a+c,l+h),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=Ai[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Cc(this,t),l=Object.assign({},o,this._size),c=Pc(e,t,l),u=Oc(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=Bt(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),fl(t,e.textDirection),r.y+=o.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),gl(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=!rs(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||!rs(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=Ai[r.position].call(this,t,e);return o!==!1&&(i!==o.x||s!==o.y)}}O(ao,"positioners",Ai);var As={id:"tooltip",_element:ao,positioners:Ai,afterInit(n,t,e){e&&(n.tooltip=new ao({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:Ac},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"]},gy=Object.freeze({__proto__:null,Colors:Tm,Decimation:Em,Filler:Zm,Legend:iy,SubTitle:oy,Title:ry,Tooltip:As});const py=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function my(n,t,e,i){const s=n.indexOf(t);if(s===-1)return py(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const yy=(n,t)=>n===null?null:Ht(Math.round(n),0,t);function Lc(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class lo extends Mn{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:my(i,t,Z(e,t),this._addedLabels),yy(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 Lc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}O(lo,"id","category"),O(lo,"defaults",{ticks:{callback:Lc}});function by(n,t){const e=[],{bounds:s,step:r,min:o,max:a,precision:l,count:c,maxTicks:u,maxDigits:d,includeBounds:h}=n,g=r||1,p=u-1,{min:y,max:x}=t,w=!tt(o),v=!tt(a),S=!tt(c),P=(x-y)/(d+1);let D=Ba((x-y)/p/g)*g,C,T,b,_;if(D<1e-14&&!w&&!v)return[{value:y},{value:x}];_=Math.ceil(x/D)-Math.floor(y/D),_>p&&(D=Ba(_*D/p/g)*g),tt(l)||(C=Math.pow(10,l),D=Math.ceil(D*C)/C),s==="ticks"?(T=Math.floor(y/D)*D,b=Math.ceil(x/D)*D):(T=y,b=x),w&&v&&r&&pf((a-o)/r,D/1e3)?(_=Math.round(Math.min((a-o)/D,u)),D=(a-o)/_,T=o,b=a):S?(T=w?o:T,b=v?a:b,_=c-1,D=(b-T)/_):(_=(b-T)/D,fi(_,Math.round(_),D/1e3)?_=Math.round(_):_=Math.ceil(_));const M=Math.max(Ha(D),Ha(T));C=Math.pow(10,tt(l)?M:l),T=Math.round(T*C)/C,b=Math.round(b*C)/C;let E=0;for(w&&(h&&T!==o?(e.push({value:o}),T<o&&E++,fi(Math.round((T+E*D)*C)/C,o,Ic(o,P,n))&&E++):T<o&&E++);E<_;++E){const A=Math.round((T+E*D)*C)/C;if(v&&A>a)break;e.push({value:A})}return v&&h&&b!==a?e.length&&fi(e[e.length-1].value,a,Ic(a,P,n))?e[e.length-1].value=a:e.push({value:a}):(!v||b===a)&&e.push({value:b}),e}function Ic(n,t,{horizontal:e,minRotation:i}){const s=Ft(i),r=(e?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+n).length;return Math.min(t/r,o)}class Ls extends Mn{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=De(s),c=De(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=by(s,r);return t.bounds==="ticks"&&za(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 mi(t,this.chart.options.locale,this.options.ticks.format)}}class co extends Ls{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?t:0,this.max=Mt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Ft(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,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(co,"id","linear"),O(co,"defaults",{ticks:{callback:ds.formatters.numeric}});const Li=n=>Math.floor(Qe(n)),Dn=(n,t)=>Math.pow(10,Li(n)+t);function Nc(n){return n/Math.pow(10,Li(n))===1}function Fc(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function xy(n,t){const e=t-n;let i=Li(e);for(;Fc(n,t,i)>10;)i++;for(;Fc(n,t,i)<10;)i--;return Math.min(i,Li(n))}function _y(n,{min:t,max:e}){t=ue(n.min,t);const i=[],s=Li(t);let r=xy(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)),h=ue(n.min,Math.round((l+u+d*Math.pow(10,r))*o)/o);for(;h<e;)i.push({value:h,major:Nc(h),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(r++,d=2,o=r>=0?1:o),h=Math.round((l+u+d*Math.pow(10,r))*o)/o;const g=ue(n.max,h);return i.push({value:g,major:Nc(g),significand:d}),i}class uo extends Mn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Ls.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return Mt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Mt(t)?Math.max(0,t):null,this.max=Mt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Mt(this._userMin)&&(this.min=t===Dn(this.min,0)?Dn(this.min,-1):Dn(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(Dn(i,-1)),o(Dn(s,1)))),i<=0&&r(Dn(s,-1)),s<=0&&o(Dn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=_y(e,this);return t.bounds==="ticks"&&za(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":mi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Qe(t),this._valueRange=Qe(this.max)-Qe(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Qe(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}O(uo,"id","logarithmic"),O(uo,"defaults",{ticks:{callback:ds.formatters.logarithmic,major:{enabled:!0}}});function ho(n){const t=n.ticks;if(t.display&&n.display){const e=Bt(t.backdropPadding);return Z(t.font&&t.font.size,Ct.font.size)+e.height}return 0}function wy(n,t,e){return e=ot(e)?e:[e],{w:Rf(n,t.string,e),h:e.length*t.lineHeight}}function Bc(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 vy(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),h=wy(n.ctx,d,n._pointLabels[l]);i[l]=h;const g=de(n.getIndexAngle(l)+a),p=Math.round(cs(g)),y=Bc(p,u.x,h.w,0,180),x=Bc(p,u.y,h.h,90,270);ky(e,t,g,y,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=Dy(n,i,s)}function ky(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 Sy(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(cs(de(l.angle+xt))),u=Py(l.y,a.h,c),d=Ty(c),h=Cy(l.x,a.w,d);return{visible:!0,x:l.x,y:u,textAlign:d,left:h,top:u,right:h+a.w,bottom:u+a.h}}function My(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(Fe({x:e,y:i},t)||Fe({x:e,y:r},t)||Fe({x:s,y:i},t)||Fe({x:s,y:r},t))}function Dy(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:o,display:a}=r.pointLabels,l={extra:ho(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=Sy(n,u,l);i.push(d),a==="auto"&&(d.visible=My(d,c),d.visible&&(c=d))}return i}function Ty(n){return n===0||n===180?"center":n<180?"left":"right"}function Cy(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Py(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Oy(n,t,e){const{left:i,top:s,right:r,bottom:o}=e,{backdropColor:a}=t;if(!tt(a)){const l=tn(t.borderRadius),c=Bt(t.backdropPadding);n.fillStyle=a;const u=i-c.left,d=s-c.top,h=r-i+c.width,g=o-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),Hn(n,{x:u,y:d,w:h,h:g,radius:l}),n.fill()):n.fillRect(u,d,h,g)}}function Ey(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));Oy(e,o,r);const a=_t(o.font),{x:l,y:c,textAlign:u}=r;wn(e,n._pointLabels[s],l,c+a.lineHeight/2,a,{color:o.color,textAlign:u,textBaseline:"middle"})}}function zc(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,yt);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 Ry(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(),zc(n,e,o,i),r.closePath(),r.stroke(),r.restore())}function Ay(n,t,e){return en(n,{label:e,index:t,type:"pointLabel"})}class Ii extends Ls{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=Bt(ho(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=Mt(t)&&!isNaN(t)?t:0,this.max=Mt(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ho(this.options))}generateTickLabels(t){Ls.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?vy(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=yt/(this._pointLabels.length||1),i=this.options.startAngle||0;return de(t*e+Ft(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 Ay(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-xt+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(),zc(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&&Ey(this,o),s.display&&this.ticks.forEach((u,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const h=this.getContext(d),g=s.setContext(h),p=r.setContext(h);Ry(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:h}=u;!h||!d||(t.lineWidth=h,t.strokeStyle=d,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(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=Bt(c.backdropPadding);t.fillRect(-o/2-d.left,-r-u.size/2-d.top,o+d.width,u.size+d.height)}wn(t,a.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}O(Ii,"id","radialLinear"),O(Ii,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ds.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(Ii,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(Ii,"descriptors",{angleLines:{_fallback:"grid"}});const Is={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}},ie=Object.keys(Is);function Hc(n,t){return n-t}function Wc(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)),Mt(o)||(o=typeof i=="string"?e.parse(o,i):e.parse(o)),o===null?null:(s&&(o=s==="week"&&(Je(r)||r===!0)?e.startOf(o,"isoWeek",r):e.startOf(o,s)),+o)}function Yc(n,t,e,i){const s=ie.length;for(let r=ie.indexOf(n);r<s-1;++r){const o=Is[ie[r]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((e-t)/(a*o.size))<=i)return ie[r]}return ie[s-1]}function Ly(n,t,e,i,s){for(let r=ie.length-1;r>=ie.indexOf(e);r--){const o=ie[r];if(Is[o].common&&n._adapter.diff(s,i,o)>=t-1)return o}return ie[e?ie.indexOf(e):0]}function Iy(n){for(let t=ie.indexOf(n)+1,e=ie.length;t<e;++t)if(Is[ie[t]].common)return ie[t]}function Vc(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Cr(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function Ny(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 jc(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:Ny(n,i,s,e)}class Ni extends Mn{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 Al._date(t.adapters.date);s.init(e),hi(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:Wc(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=Mt(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=Mt(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=xf(s,r,o);return this._unit=e.unit||(i.autoSkip?Yc(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):Ly(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Iy(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),jc(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=Ht(e,0,o),i=Ht(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||Yc(r.minUnit,e,i,this._getLabelCapacity(e)),a=Z(s.ticks.stepSize,1),l=o==="week"?r.isoWeekday:!1,c=Je(l)||l===!0,u={};let d=e,h,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(h=d,g=0;h<i;h=+t.add(h,a,o),g++)Vc(u,h,p);return(h===i||s.bounds==="ticks"||g===1)&&Vc(u,h,p),Object.keys(u).sort(Hc).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],h=i[e],g=c&&d&&h&&h.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=Ft(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,jc(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(Wc(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ja(t.sort(Hc))}}O(Ni,"id","time"),O(Ni,"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 Ns(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}=Ne(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}=Ne(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 fo extends Ni{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=Ns(e,this.min),this._tableRange=Ns(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(Ns(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ns(this._table,i*this._tableRange+this._minPos,!0)}}O(fo,"id","timeseries"),O(fo,"defaults",Ni.defaults);var Fy=Object.freeze({__proto__:null,CategoryScale:lo,LinearScale:co,LogarithmicScale:uo,RadialLinearScale:Ii,TimeScale:Ni,TimeSeriesScale:fo});const By=[qg,wm,gy,Fy],zy=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Hy=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Wy=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Yy=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],$c=(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 go(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?Yy:Wy:t.binary?Hy:zy,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=$c(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=$c(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 wt(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function Fs(n,t){const e=G(n);return isNaN(t)?wt(n,NaN):(t&&e.setDate(e.getDate()+t),e)}function po(n,t){const e=G(n);if(isNaN(t))return wt(n,NaN);if(!t)return e;const i=e.getDate(),s=wt(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 Bs(n,t){const e=+G(n);return wt(n,e+t)}const Uc=6048e5,Vy=864e5,Fi=6e4,$n=36e5,jy=1e3;function $y(n,t){return Bs(n,t*$n)}let Uy={};function Tn(){return Uy}function Pe(n,t){var a,l,c,u;const e=Tn(),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 Un(n){return Pe(n,{weekStartsOn:1})}function qc(n){const t=G(n),e=t.getFullYear(),i=wt(n,0);i.setFullYear(e+1,0,4),i.setHours(0,0,0,0);const s=Un(i),r=wt(n,0);r.setFullYear(e,0,4),r.setHours(0,0,0,0);const o=Un(r);return t.getTime()>=s.getTime()?e+1:t.getTime()>=o.getTime()?e:e-1}function mo(n){const t=G(n);return t.setHours(0,0,0,0),t}function zs(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 Xc(n,t){const e=mo(n),i=mo(t),s=+e-zs(e),r=+i-zs(i);return Math.round((s-r)/Vy)}function qy(n){const t=qc(n),e=wt(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Un(e)}function Xy(n,t){return Bs(n,t*Fi)}function Gy(n,t){const e=t*3;return po(n,e)}function Ky(n,t){return Bs(n,t*1e3)}function Zy(n,t){const e=t*7;return Fs(n,e)}function Qy(n,t){return po(n,t*12)}function Bi(n,t){const e=G(n),i=G(t),s=e.getTime()-i.getTime();return s<0?-1:s>0?1:s}function Jy(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function yo(n){if(!Jy(n)&&typeof n!="number")return!1;const t=G(n);return!isNaN(Number(t))}function tb(n,t){const e=G(n),i=G(t),s=e.getFullYear()-i.getFullYear(),r=e.getMonth()-i.getMonth();return s*12+r}function eb(n,t){const e=G(n),i=G(t);return e.getFullYear()-i.getFullYear()}function Gc(n,t){const e=G(n),i=G(t),s=Kc(e,i),r=Math.abs(Xc(e,i));e.setDate(e.getDate()-s*r);const o=+(Kc(e,i)===-s),a=s*(r-o);return a===0?0:a}function Kc(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 zi(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function Hs(n,t){return+G(n)-+G(t)}function nb(n,t,e){const i=Hs(n,t)/$n;return zi(e==null?void 0:e.roundingMethod)(i)}function ib(n,t,e){const i=Hs(n,t)/Fi;return zi(e==null?void 0:e.roundingMethod)(i)}function Zc(n){const t=G(n);return t.setHours(23,59,59,999),t}function Qc(n){const t=G(n),e=t.getMonth();return t.setFullYear(t.getFullYear(),e+1,0),t.setHours(23,59,59,999),t}function sb(n){const t=G(n);return+Zc(t)==+Qc(t)}function Jc(n,t){const e=G(n),i=G(t),s=Bi(e,i),r=Math.abs(tb(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=Bi(e,i)===-s;sb(G(n))&&r===1&&Bi(n,i)===1&&(a=!1),o=s*(r-Number(a))}return o===0?0:o}function rb(n,t,e){const i=Jc(n,t)/3;return zi(e==null?void 0:e.roundingMethod)(i)}function ob(n,t,e){const i=Hs(n,t)/1e3;return zi(e==null?void 0:e.roundingMethod)(i)}function ab(n,t,e){const i=Gc(n,t)/7;return zi(e==null?void 0:e.roundingMethod)(i)}function lb(n,t){const e=G(n),i=G(t),s=Bi(e,i),r=Math.abs(eb(e,i));e.setFullYear(1584),i.setFullYear(1584);const o=Bi(e,i)===-s,a=s*(r-+o);return a===0?0:a}function cb(n){const t=G(n);return t.setSeconds(0,0),t}function ub(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 db(n){const t=G(n);return t.setDate(1),t.setHours(0,0,0,0),t}function hb(n){const t=G(n),e=t.getFullYear();return t.setFullYear(e+1,0,0),t.setHours(23,59,59,999),t}function tu(n){const t=G(n),e=wt(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}function fb(n){const t=G(n);return t.setMinutes(59,59,999),t}function gb(n,t){var a,l,c,u;const e=Tn(),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 pb(n){const t=G(n);return t.setSeconds(59,999),t}function mb(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 yb(n){const t=G(n);return t.setMilliseconds(999),t}const bb={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"}},xb=(n,t,e)=>{let i;const s=bb[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 bo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const _b={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kb={date:bo({formats:_b,defaultWidth:"full"}),time:bo({formats:wb,defaultWidth:"full"}),dateTime:bo({formats:vb,defaultWidth:"full"})},Sb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mb=(n,t,e,i)=>Sb[n];function Hi(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 Db={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Tb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Cb={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"]},Pb={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"]},Ob={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"}},Eb={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"}},Rb={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:Hi({values:Db,defaultWidth:"wide"}),quarter:Hi({values:Tb,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Hi({values:Cb,defaultWidth:"wide"}),day:Hi({values:Pb,defaultWidth:"wide"}),dayPeriod:Hi({values:Ob,defaultWidth:"wide",formattingValues:Eb,defaultFormattingWidth:"wide"})};function Wi(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)?Lb(a,d=>d.test(o)):Ab(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 Ab(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Lb(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Ib(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 Nb=/^(\d+)(th|st|nd|rd)?/i,Fb=/\d+/i,Bb={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},zb={any:[/^b/i,/^(a|c)/i]},Hb={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wb={any:[/1/i,/2/i,/3/i,/4/i]},Yb={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},Vb={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]},jb={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},$b={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]},Ub={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},qb={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}},Xb={ordinalNumber:Ib({matchPattern:Nb,parsePattern:Fb,valueCallback:n=>parseInt(n,10)}),era:Wi({matchPatterns:Bb,defaultMatchWidth:"wide",parsePatterns:zb,defaultParseWidth:"any"}),quarter:Wi({matchPatterns:Hb,defaultMatchWidth:"wide",parsePatterns:Wb,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Wi({matchPatterns:Yb,defaultMatchWidth:"wide",parsePatterns:Vb,defaultParseWidth:"any"}),day:Wi({matchPatterns:jb,defaultMatchWidth:"wide",parsePatterns:$b,defaultParseWidth:"any"}),dayPeriod:Wi({matchPatterns:Ub,defaultMatchWidth:"any",parsePatterns:qb,defaultParseWidth:"any"})},eu={code:"en-US",formatDistance:xb,formatLong:kb,formatRelative:Mb,localize:Rb,match:Xb,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Gb(n){const t=G(n);return Xc(t,tu(t))+1}function nu(n){const t=G(n),e=+Un(t)-+qy(t);return Math.round(e/Uc)+1}function xo(n,t){var u,d,h,g;const e=G(n),i=e.getFullYear(),s=Tn(),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=(h=s.locale)==null?void 0:h.options)==null?void 0:g.firstWeekContainsDate)??1,o=wt(n,0);o.setFullYear(i+1,0,r),o.setHours(0,0,0,0);const a=Pe(o,t),l=wt(n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=Pe(l,t);return e.getTime()>=a.getTime()?i+1:e.getTime()>=c.getTime()?i:i-1}function Kb(n,t){var a,l,c,u;const e=Tn(),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=xo(n,t),r=wt(n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),Pe(r,t)}function iu(n,t){const e=G(n),i=+Pe(e,t)-+Kb(e,t);return Math.round(i/Uc)+1}function ht(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const an={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)}},qn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},su={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 an.y(n,t)},Y:function(n,t,e,i){const s=xo(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=qc(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 an.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=iu(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):ht(s,t.length)},I:function(n,t,e){const i=nu(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"}):an.d(n,t)},D:function(n,t,e){const i=Gb(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=qn.noon:i===0?s=qn.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=qn.evening:i>=12?s=qn.afternoon:i>=4?s=qn.morning:s=qn.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 an.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):an.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"}):an.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):an.s(n,t)},S:function(n,t){return an.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return ou(i);case"XXXX":case"XX":return Cn(i);case"XXXXX":case"XXX":default:return Cn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return ou(i);case"xxxx":case"xx":return Cn(i);case"xxxxx":case"xxx":default:return Cn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ru(i,":");case"OOOO":default:return"GMT"+Cn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ru(i,":");case"zzzz":default:return"GMT"+Cn(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 ru(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 ou(n,t){return n%60===0?(n>0?"-":"+")+ht(Math.abs(n)/60,2):Cn(n,t)}function Cn(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 au=(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"})}},lu=(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"})}},_o={p:lu,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return au(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}}",au(i,t)).replace("{{time}}",lu(s,t))}},Zb=/^D+$/,Qb=/^Y+$/,Jb=["D","DD","YY","YYYY"];function cu(n){return Zb.test(n)}function uu(n){return Qb.test(n)}function wo(n,t,e){const i=t0(n,t,e);if(console.warn(i),Jb.includes(n))throw new RangeError(i)}function t0(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 e0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,n0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,i0=/^'([^]*?)'?$/,s0=/''/g,r0=/[a-zA-Z]/;function du(n,t,e){var u,d,h,g,p,y,x,w;const i=Tn(),s=(e==null?void 0:e.locale)??i.locale??eu,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=(h=i.locale)==null?void 0:h.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=(x=i.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,a=G(n);if(!yo(a))throw new RangeError("Invalid time value");let l=t.match(n0).map(v=>{const S=v[0];if(S==="p"||S==="P"){const P=_o[S];return P(v,s.formatLong)}return v}).join("").match(e0).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const S=v[0];if(S==="'")return{isToken:!1,value:o0(v)};if(su[S])return{isToken:!0,value:v};if(S.match(r0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:r,weekStartsOn:o,locale:s};return l.map(v=>{if(!v.isToken)return v.value;const S=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&uu(S)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&cu(S))&&wo(S,t,String(n));const P=su[S[0]];return P(a,S,s.localize,c)}).join("")}function o0(n){const t=n.match(i0);return t?t[1].replace(s0,"'"):n}function a0(){return Object.assign({},Tn())}function l0(n){let e=G(n).getDay();return e===0&&(e=7),e}function c0(n,t){const e=t instanceof Date?wt(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 u0=10;class hu{constructor(){O(this,"subPriority",0)}validate(t,e){return!0}}class d0 extends hu{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 h0 extends hu{constructor(){super(...arguments);O(this,"priority",u0);O(this,"subPriority",-1)}set(e,i){return i.timestampIsSet?e:wt(e,c0(e,Date))}}class at{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new d0(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class f0 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 It={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}/},Oe={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 Nt(n,t){return n&&{value:t(n.value),rest:n.rest}}function Pt(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function Ee(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*$n+r*Fi+o*jy),rest:t.slice(e[0].length)}}function fu(n){return Pt(It.anyDigitsSigned,n)}function At(n,t){switch(n){case 1:return Pt(It.singleDigit,t);case 2:return Pt(It.twoDigits,t);case 3:return Pt(It.threeDigits,t);case 4:return Pt(It.fourDigits,t);default:return Pt(new RegExp("^\\d{1,"+n+"}"),t)}}function Ws(n,t){switch(n){case 1:return Pt(It.singleDigitSigned,t);case 2:return Pt(It.twoDigitsSigned,t);case 3:return Pt(It.threeDigitsSigned,t);case 4:return Pt(It.fourDigitsSigned,t);default:return Pt(new RegExp("^-?\\d{1,"+n+"}"),t)}}function vo(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 gu(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 pu(n){return n%400===0||n%4===0&&n%100!==0}class g0 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 Nt(At(4,e),r);case"yo":return Nt(s.ordinalNumber(e,{unit:"year"}),r);default:return Nt(At(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=gu(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 p0 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 Nt(At(4,e),r);case"Yo":return Nt(s.ordinalNumber(e,{unit:"year"}),r);default:return Nt(At(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const o=xo(e,r);if(s.isTwoDigitYear){const l=gu(s.year,o);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),Pe(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),Pe(e,r)}}class m0 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 Ws(i==="R"?4:i.length,e)}set(e,i,s){const r=wt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Un(r)}}class y0 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 Ws(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class b0 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 At(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class x0 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 At(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class _0 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 Nt(Pt(It.month,e),r);case"MM":return Nt(At(2,e),r);case"Mo":return Nt(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 w0 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 Nt(Pt(It.month,e),r);case"LL":return Nt(At(2,e),r);case"Lo":return Nt(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 v0(n,t,e){const i=G(n),s=iu(i,e)-t;return i.setDate(i.getDate()-s*7),i}class k0 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 Pt(It.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return At(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return Pe(v0(e,s,r),r)}}function S0(n,t){const e=G(n),i=nu(e)-t;return e.setDate(e.getDate()-i*7),e}class M0 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 Pt(It.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return At(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return Un(S0(e,s))}}const D0=[31,28,31,30,31,30,31,31,30,31,30,31],T0=[31,29,31,30,31,30,31,31,30,31,30,31];class C0 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 Pt(It.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return At(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=pu(s),o=e.getMonth();return r?i>=1&&i<=T0[o]:i>=1&&i<=D0[o]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class P0 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 Pt(It.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return At(i.length,e)}}validate(e,i){const s=e.getFullYear();return pu(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 ko(n,t,e){var d,h,g,p;const i=Tn(),s=(e==null?void 0:e.weekStartsOn)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.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 Fs(r,u)}class O0 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=ko(e,s,r),e.setHours(0,0,0,0),e}}class E0 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 Nt(At(i.length,e),o);case"eo":return Nt(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=ko(e,s,r),e.setHours(0,0,0,0),e}}class R0 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 Nt(At(i.length,e),o);case"co":return Nt(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=ko(e,s,r),e.setHours(0,0,0,0),e}}function A0(n,t){const e=G(n),i=l0(e),s=t-i;return Fs(e,s)}class L0 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 At(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Nt(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 Nt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Nt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Nt(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=A0(e,s),e.setHours(0,0,0,0),e}}class I0 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(vo(s),0,0,0),e}}class N0 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(vo(s),0,0,0),e}}class F0 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(vo(s),0,0,0),e}}class B0 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 Pt(It.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return At(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const 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 z0 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 Pt(It.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return At(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class H0 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 Pt(It.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return At(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class W0 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 Pt(It.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return At(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class Y0 extends at{constructor(){super(...arguments);O(this,"priority",60);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return Pt(It.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return At(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class V0 extends at{constructor(){super(...arguments);O(this,"priority",50);O(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return Pt(It.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return At(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class j0 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 Nt(At(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class $0 extends at{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return Ee(Oe.basicOptionalMinutes,e);case"XX":return Ee(Oe.basic,e);case"XXXX":return Ee(Oe.basicOptionalSeconds,e);case"XXXXX":return Ee(Oe.extendedOptionalSeconds,e);case"XXX":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:wt(e,e.getTime()-zs(e)-s)}}class U0 extends at{constructor(){super(...arguments);O(this,"priority",10);O(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return Ee(Oe.basicOptionalMinutes,e);case"xx":return Ee(Oe.basic,e);case"xxxx":return Ee(Oe.basicOptionalSeconds,e);case"xxxxx":return Ee(Oe.extendedOptionalSeconds,e);case"xxx":default:return Ee(Oe.extended,e)}}set(e,i,s){return i.timestampIsSet?e:wt(e,e.getTime()-zs(e)-s)}}class q0 extends at{constructor(){super(...arguments);O(this,"priority",40);O(this,"incompatibleTokens","*")}parse(e){return fu(e)}set(e,i,s){return[wt(e,s*1e3),{timestampIsSet:!0}]}}class X0 extends at{constructor(){super(...arguments);O(this,"priority",20);O(this,"incompatibleTokens","*")}parse(e){return fu(e)}set(e,i,s){return[wt(e,s),{timestampIsSet:!0}]}}const G0={G:new f0,y:new g0,Y:new p0,R:new m0,u:new y0,Q:new b0,q:new x0,M:new _0,L:new w0,w:new k0,I:new M0,d:new C0,D:new P0,E:new O0,e:new E0,c:new R0,i:new L0,a:new I0,b:new N0,B:new F0,h:new B0,H:new z0,K:new H0,k:new W0,m:new Y0,s:new V0,S:new j0,X:new $0,x:new U0,t:new q0,T:new X0},K0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Q0=/^'([^]*?)'?$/,J0=/''/g,tx=/\S/,ex=/[a-zA-Z]/;function nx(n,t,e,i){var y,x,w,v,S,P,D,C;const s=a0(),r=(i==null?void 0:i.locale)??s.locale??eu,o=(i==null?void 0:i.firstWeekContainsDate)??((x=(y=i==null?void 0:i.locale)==null?void 0:y.options)==null?void 0:x.firstWeekContainsDate)??s.firstWeekContainsDate??((v=(w=s.locale)==null?void 0:w.options)==null?void 0:v.firstWeekContainsDate)??1,a=(i==null?void 0:i.weekStartsOn)??((P=(S=i==null?void 0:i.locale)==null?void 0:S.options)==null?void 0:P.weekStartsOn)??s.weekStartsOn??((C=(D=s.locale)==null?void 0:D.options)==null?void 0:C.weekStartsOn)??0;if(t==="")return n===""?G(e):wt(e,NaN);const l={firstWeekContainsDate:o,weekStartsOn:a,locale:r},c=[new h0],u=t.match(Z0).map(T=>{const b=T[0];if(b in _o){const _=_o[b];return _(T,r.formatLong)}return T}).join("").match(K0),d=[];for(let T of u){!(i!=null&&i.useAdditionalWeekYearTokens)&&uu(T)&&wo(T,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&cu(T)&&wo(T,t,n);const b=T[0],_=G0[b];if(_){const{incompatibleTokens:M}=_;if(Array.isArray(M)){const A=d.find(F=>M.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(_.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=_.run(n,T,r.match,l);if(!E)return wt(e,NaN);c.push(E.setter),n=E.rest}else{if(b.match(ex))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");if(T==="''"?T="'":b==="'"&&(T=ix(T)),n.indexOf(T)===0)n=n.slice(T.length);else return wt(e,NaN)}}if(n.length>0&&tx.test(n))return wt(e,NaN);const h=c.map(T=>T.priority).sort((T,b)=>b-T).filter((T,b,_)=>_.indexOf(T)===b).map(T=>c.filter(b=>b.priority===T).sort((b,_)=>_.subPriority-b.subPriority)).map(T=>T[0]);let g=G(e);if(isNaN(g.getTime()))return wt(e,NaN);const p={};for(const T of h){if(!T.validate(g,l))return wt(e,NaN);const b=T.set(g,p,l);Array.isArray(b)?(g=b[0],Object.assign(p,b[1])):g=b}return wt(e,g)}function ix(n){return n.match(Q0)[1].replace(J0,"'")}function sx(n){const t=G(n);return t.setMinutes(0,0,0),t}function rx(n){const t=G(n);return t.setMilliseconds(0),t}function ox(n){const t=n/$n;return Math.trunc(t)}function mu(n,t){const e=(t==null?void 0:t.additionalDigits)??2,i=ux(n);let s;if(i.date){const l=dx(i.date,e);s=hx(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=fx(i.time),isNaN(o)))return new Date(NaN);if(i.timezone){if(a=gx(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 Ys={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ax=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,lx=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,cx=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ux(n){const t={},e=n.split(Ys.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],Ys.timeZoneDelimiter.test(t.date)&&(t.date=n.split(Ys.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=Ys.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function dx(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 hx(n,t){if(t===null)return new Date(NaN);const e=n.match(ax);if(!e)return new Date(NaN);const i=!!e[4],s=Yi(e[1]),r=Yi(e[2])-1,o=Yi(e[3]),a=Yi(e[4]),l=Yi(e[5])-1;if(i)return xx(t,a,l)?px(t,a,l):new Date(NaN);{const c=new Date(0);return!yx(t,r,o)||!bx(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,o)),c)}}function Yi(n){return n?parseInt(n):1}function fx(n){const t=n.match(lx);if(!t)return NaN;const e=So(t[1]),i=So(t[2]),s=So(t[3]);return _x(e,i,s)?e*$n+i*Fi+s*1e3:NaN}function So(n){return n&&parseFloat(n.replace(",","."))||0}function gx(n){if(n==="Z")return 0;const t=n.match(cx);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return wx(i,s)?e*(i*$n+s*Fi):NaN}function px(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 mx=[31,null,31,30,31,30,31,31,30,31,30,31];function yu(n){return n%400===0||n%4===0&&n%100!==0}function yx(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(mx[t]||(yu(n)?29:28))}function bx(n,t){return t>=1&&t<=(yu(n)?366:365)}function xx(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function _x(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function wx(n,t){return t>=0&&t<=59}var $t=(n=>(n.DOUGHNUT="Doughnut",n.HORIZONTAL_BAR="HorizontalBar",n.VERTICAL_BAR="VerticalBar",n.TIMESERIES_LINE="Line",n.TIMESERIES_BAR="TimeSeriesBar",n))($t||{}),Vs=(n=>(n.GAUGE="Gauge",n.TOPN="TopN",n))(Vs||{}),Ot=(n=>(n.Hidden="hidden",n.Right="right",n.Bottom="bottom",n))(Ot||{}),Xn=(n=>(n.Hidden="hidden",n.SingleMetric="single",n.Full="full",n))(Xn||{});const Mo=(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=[$t.HORIZONTAL_BAR,$t.VERTICAL_BAR].includes(n.chartType),c=[Vs.GAUGE,$t.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 h=c?u.parsed:u.parsed[a];let g;if(n.units==="bytes")g=isNaN(h)?h:go(h);else{const y=n.translateUnit(n.units,h);g=`${n.units==="usd"?"$":""}${h%1===0?js.format(h):js.format(Number(h.toFixed(xu)))} ${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:h}}).sort(i),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},vx=n=>n&&n.datasets&&n.datasets.length,kx=n=>vx(n)&&n.datasets.some(t=>t.data.length),Sx=n=>kx(n)&&n.datasets.some(t=>t.data.length>1),Mx=n=>Sx(n)&&n.datasets.some(t=>t.data[0]&&yo(t.data[0].x)),Dx=n=>Mx(n)&&n.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),Do=(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)},Tx=(n,t,e)=>n.y<e?n.y+t*.15:n.y-t*.5;function bu(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const xu=2,_u=10,wu=12,js=new Intl.NumberFormat(((wh=document==null?void 0:document.documentElement)==null?void 0:wh.lang)||"en-US"),$s=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"}},He=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Gn=(n,t)=>(t||He)[n%He.length],ku=(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}`},Su="#6f7787",Mu={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"}},Cx=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=Mu[t])==null?void 0:e.background)||"#fafafa"},Px={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},Ox={"4XX":"#FFBA81","5XX":"#FF8484"},Ex={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},Rx="#dad4c7",Ax=n=>{const t=Object.entries(vu).find(([e])=>new RegExp(e).test(n));return t&&t[1]||vu.standard},Lx={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},Ix=2,Nx=0,To=new Map,Co=(n,t)=>t==="bytes"?go(n):t==="count/minute"?n.toFixed(2):js.format(n),Du=n=>{const e=document.createElement("canvas").getContext("2d"),i=_t({});return e.font=i.string,e.measureText(n).width},Fx=()=>{const n="label_height";if(!To.has(n)){const t=_t({});To.set(n,t.lineHeight)}return To.get(n)},Bx=n=>n.datasets.reduce((t,e)=>t+e.data.reduce((i,s)=>isNaN(s)?i:i+s,0),0),Tu=(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),Cu=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,Po="#e0e4ea",zx={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"]},Vi=(n,t)=>{let e=1;const i=zx[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},Pu=new Map([[100,Vi("100",[100,101,102,103])],[200,Vi("200",[200,201,202,203,204,205,206,207,208,226])],[300,Vi("300",[300,301,302,303,304,305,307,308])],[400,Vi("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,Vi("500",[500,501,502,503,504,505,506,507,508,510,511])]]),Oo=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=Pu.get(e);return i===void 0?Po:i.get(t)??i.get(-1)??Po},Hx=n=>{const t=Oo(n);return{solid:t,light:t}},Us={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=Oo(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function Wx(n){const t={enabled:!1,position:"barChartTooltipPosition",callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};As.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=Do(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}},Gr.modes.customInteractionMode=function(s,r){const o=nn(r,s),a=[];return Gr.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?_u:wu;return f.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(h,g){const p=this;if(p.chart.options.indexAxis===p.axis){h=p.getLabelForValue(g);const y=10;return h&&h.length>y?h.slice(0,y)+"...":h}return p.getLabelForValue(Number(h))}},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(h,g){const p=this;return p.chart.options.indexAxis===p.axis?(h=p.getLabelForValue(g),h&&h.length>$s?h.slice(0,$s)+"...":h):p.getLabelForValue(Number(h))}},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:h=>{Mo(n.tooltipState,h)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}})}pe.register(...By);const Yx=(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 Vx(n,t,e,i,s){const r=f.shallowRef(null),o=(a,l)=>{if(t.value)return new pe(t.value,{type:n,data:a,plugins:i,options:l})};return f.onMounted(()=>{r.value=o(e.value,s.value)}),f.onBeforeUnmount(()=>{tt(r.value)||r.value.destroy()}),f.watch(e,(a,l)=>{if(Yx(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)}),f.watch(t,()=>{tt(r.value)||r.value.destroy(),r.value=o(e.value,s.value)}),f.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 se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ou={exports:{}};(function(n){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var d=typeof u.separator=="string"?u.separator:",",h=[],g=Math.round(c).toString().split("");return g.reverse().forEach(function(p,y){y&&y%3===0&&h.push(d),h.push(p)}),h.reverse().join("")}function e(c,u,d){var h=c/u,g=d.round?"round":"floor";return d.decimal===!1?(c=Math[g](h),c.toString()):(d.precision?c=h:c=h<10?Math[g](h*10)/10:Math[g](h),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 h=c<0;h&&(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",h&&(d="-"+d),u.capital&&(d=d.toUpperCase()),u.prefix&&(d=u.prefix+d),u.suffix&&(d=d+u.suffix),d}l.addCommas=t,n.exports=l})()})(Ou);var jx=Ou.exports;const ji=Eo(jx);function $x(n,t,e){const{i18n:i}=gt.useI18n(),{translateUnit:s}=gt.useTranslatedUnits();return{legendValues:f.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":go(l);else{const u=s(e.value,l);c=i&&i.t("legend.datapointValueDisplay",{value:ji(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}}),unit:u})||`${ji(l,{capital:!0,...e.value==="usd"&&{prefix:"$"}})} ${e.value}`}return{...o,[a.label]:{raw:l,formatted:c}}},{}))}}var Ux=Object.defineProperty,qx=(n,t,e)=>t in n?Ux(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Re=(n,t,e)=>qx(n,typeof t!="symbol"?t+"":t,e),Et=(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))(Et||{});const Xx=["secondly","minutely","hourly","daily","weekly","trend"],$i=n=>n.filter(t=>t!=="time"),Eu=["api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","route","status_code","status_code_grouped","time"],Gx=$i(Eu),Kx=[...Eu,"application","consumer","iso_code"],Zx=$i(Kx),Qx=["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"],Jx=$i(Qx);$i(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","data_plane_node","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","upstream_uri","websocket"]),$i(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","response_body_size","request_body_size","status_code","status_code_grouped","upstream_status_code","upstream_status_code_grouped"]),new Set(Gx),new Set(Zx),new Set(Jx);function Gt(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 we(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function Ru(n,t){const e=Gt(n);return isNaN(t)?we(n,NaN):(t&&e.setDate(e.getDate()+t),e)}function t_(n,t){const e=Gt(n);if(isNaN(t))return we(n,NaN);if(!t)return e;const i=e.getDate(),s=we(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 Au=6048e5,e_=864e5,n_=60,i_=3600;let s_={};function qs(){return s_}function We(n,t){var e,i,s,r;const o=qs(),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=Gt(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 Xs(n){return We(n,{weekStartsOn:1})}function Lu(n){const t=Gt(n),e=t.getFullYear(),i=we(n,0);i.setFullYear(e+1,0,4),i.setHours(0,0,0,0);const s=Xs(i),r=we(n,0);r.setFullYear(e,0,4),r.setHours(0,0,0,0);const o=Xs(r);return t.getTime()>=s.getTime()?e+1:t.getTime()>=o.getTime()?e:e-1}function Gs(n){const t=Gt(n);return t.setHours(0,0,0,0),t}function Iu(n){const t=Gt(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 r_(n,t){const e=Gs(n),i=Gs(t),s=+e-Iu(e),r=+i-Iu(i);return Math.round((s-r)/e_)}function o_(n){const t=Lu(n),e=we(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Xs(e)}function a_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function l_(n){if(!a_(n)&&typeof n!="number")return!1;const t=Gt(n);return!isNaN(Number(t))}function Kn(n){const t=Gt(n);return t.setDate(1),t.setHours(0,0,0,0),t}function c_(n){const t=Gt(n),e=we(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}const u_={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"}},d_=(n,t,e)=>{let i;const s=u_[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 Ro(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const h_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},f_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},g_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},p_={date:Ro({formats:h_,defaultWidth:"full"}),time:Ro({formats:f_,defaultWidth:"full"}),dateTime:Ro({formats:g_,defaultWidth:"full"})},m_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},y_=(n,t,e,i)=>m_[n];function Ui(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 b_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},x_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},__={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"]},w_={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"]},v_={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"}},k_={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"}},S_=(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"},M_={ordinalNumber:S_,era:Ui({values:b_,defaultWidth:"wide"}),quarter:Ui({values:x_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ui({values:__,defaultWidth:"wide"}),day:Ui({values:w_,defaultWidth:"wide"}),dayPeriod:Ui({values:v_,defaultWidth:"wide",formattingValues:k_,defaultFormattingWidth:"wide"})};function qi(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)?T_(a,d=>d.test(o)):D_(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 D_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function T_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function C_(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 P_=/^(\d+)(th|st|nd|rd)?/i,O_=/\d+/i,E_={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},R_={any:[/^b/i,/^(a|c)/i]},A_={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},L_={any:[/1/i,/2/i,/3/i,/4/i]},I_={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},N_={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},F_={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},B_={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]},z_={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},H_={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}},W_={ordinalNumber:C_({matchPattern:P_,parsePattern:O_,valueCallback:n=>parseInt(n,10)}),era:qi({matchPatterns:E_,defaultMatchWidth:"wide",parsePatterns:R_,defaultParseWidth:"any"}),quarter:qi({matchPatterns:A_,defaultMatchWidth:"wide",parsePatterns:L_,defaultParseWidth:"any",valueCallback:n=>n+1}),month:qi({matchPatterns:I_,defaultMatchWidth:"wide",parsePatterns:N_,defaultParseWidth:"any"}),day:qi({matchPatterns:F_,defaultMatchWidth:"wide",parsePatterns:B_,defaultParseWidth:"any"}),dayPeriod:qi({matchPatterns:z_,defaultMatchWidth:"any",parsePatterns:H_,defaultParseWidth:"any"})},Y_={code:"en-US",formatDistance:d_,formatLong:p_,formatRelative:y_,localize:M_,match:W_,options:{weekStartsOn:0,firstWeekContainsDate:1}};function V_(n){const t=Gt(n);return r_(t,c_(t))+1}function j_(n){const t=Gt(n),e=+Xs(t)-+o_(t);return Math.round(e/Au)+1}function Nu(n,t){var e,i,s,r;const o=Gt(n),a=o.getFullYear(),l=qs(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=we(n,0);u.setFullYear(a+1,0,c),u.setHours(0,0,0,0);const d=We(u,t),h=we(n,0);h.setFullYear(a,0,c),h.setHours(0,0,0,0);const g=We(h,t);return o.getTime()>=d.getTime()?a+1:o.getTime()>=g.getTime()?a:a-1}function $_(n,t){var e,i,s,r;const o=qs(),a=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??o.firstWeekContainsDate??((r=(s=o.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Nu(n,t),c=we(n,0);return c.setFullYear(l,0,a),c.setHours(0,0,0,0),We(c,t)}function U_(n,t){const e=Gt(n),i=+We(e,t)-+$_(e,t);return Math.round(i/Au)+1}function ft(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const ln={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return ft(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):ft(e+1,2)},d(n,t){return ft(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 ft(n.getHours()%12||12,t.length)},H(n,t){return ft(n.getHours(),t.length)},m(n,t){return ft(n.getMinutes(),t.length)},s(n,t){return ft(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return ft(s,t.length)}},Zn={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fu={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 ln.y(n,t)},Y:function(n,t,e,i){const s=Nu(n,i),r=s>0?s:1-s;if(t==="YY"){const o=r%100;return ft(o,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):ft(r,t.length)},R:function(n,t){const e=Lu(n);return ft(e,t.length)},u:function(n,t){const e=n.getFullYear();return ft(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 ft(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 ft(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 ln.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 ft(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=U_(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):ft(s,t.length)},I:function(n,t,e){const i=j_(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):ft(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):ln.d(n,t)},D:function(n,t,e){const i=V_(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):ft(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 ft(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 ft(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 ft(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 i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Zn.noon:i===0?s=Zn.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=Zn.evening:i>=12?s=Zn.afternoon:i>=4?s=Zn.morning:s=Zn.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 ln.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):ln.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):ln.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):ln.s(n,t)},S:function(n,t){return ln.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return zu(i);case"XXXX":case"XX":return Pn(i);case"XXXXX":case"XXX":default:return Pn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return zu(i);case"xxxx":case"xx":return Pn(i);case"xxxxx":case"xxx":default:return Pn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Bu(i,":");case"OOOO":default:return"GMT"+Pn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Bu(i,":");case"zzzz":default:return"GMT"+Pn(i,":")}},t:function(n,t,e){const i=Math.trunc(n.getTime()/1e3);return ft(i,t.length)},T:function(n,t,e){const i=n.getTime();return ft(i,t.length)}};function Bu(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+ft(r,2)}function zu(n,t){return n%60===0?(n>0?"-":"+")+ft(Math.abs(n)/60,2):Pn(n,t)}function Pn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=ft(Math.trunc(i/60),2),r=ft(i%60,2);return e+s+t+r}const Hu=(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"})}},Wu=(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"})}},q_=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Hu(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}}",Hu(i,t)).replace("{{time}}",Wu(s,t))},X_={p:Wu,P:q_},G_=/^D+$/,K_=/^Y+$/,Z_=["D","DD","YY","YYYY"];function Q_(n){return G_.test(n)}function J_(n){return K_.test(n)}function tw(n,t,e){const i=ew(n,t,e);if(console.warn(i),Z_.includes(n))throw new RangeError(i)}function ew(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 nw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,iw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sw=/^'([^]*?)'?$/,rw=/''/g,ow=/[a-zA-Z]/;function aw(n,t,e){var i,s,r,o,a,l,c,u;const d=qs(),h=(e==null?void 0:e.locale)??d.locale??Y_,g=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??d.firstWeekContainsDate??((o=(r=d.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(a=e==null?void 0:e.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??d.weekStartsOn??((u=(c=d.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,y=Gt(n);if(!l_(y))throw new RangeError("Invalid time value");let x=t.match(iw).map(v=>{const S=v[0];if(S==="p"||S==="P"){const P=X_[S];return P(v,h.formatLong)}return v}).join("").match(nw).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const S=v[0];if(S==="'")return{isToken:!1,value:lw(v)};if(Fu[S])return{isToken:!0,value:v};if(S.match(ow))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:v}});h.localize.preprocessor&&(x=h.localize.preprocessor(y,x));const w={firstWeekContainsDate:g,weekStartsOn:p,locale:h};return x.map(v=>{if(!v.isToken)return v.value;const S=v.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&J_(S)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Q_(S))&&tw(S,t,String(n));const P=Fu[S[0]];return P(y,S,h.localize,w)}).join("")}function lw(n){const t=n.match(sw);return t?t[1].replace(rw,"'"):n}function cw(n){const t=Gt(n),e=t.getFullYear(),i=t.getMonth(),s=we(n,0);return s.setFullYear(e,i+1,0),s.setHours(0,0,0,0),s.getDate()}function uw(n){return Math.trunc(n*i_)}function dw(n){const t=n/n_;return Math.trunc(t)}function Yu(n,t){return t_(n,-t)}function Vu(n,t,e){const i=gw(n,e.timeZone,e.locale);return"formatToParts"in i?hw(i,t):fw(i,t)}function hw(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 fw(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function gw(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function pw(n,t){const e=xw(t);return"formatToParts"in e?yw(e,n):bw(e,n)}const mw={year:0,month:1,day:2,hour:3,minute:4,second:5};function yw(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=mw[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 bw(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 Ao={};function xw(n){if(!Ao[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";Ao[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 Ao[n]}function Lo(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 ju=36e5,_w=6e4,Io={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Xi(n,t,e){if(!n)return 0;let i=Io.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Io.timezoneHH.exec(n),i)return s=parseInt(i[1],10),$u(s)?-(s*ju):NaN;if(i=Io.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return $u(s,o)?(r=Math.abs(s)*ju+o*_w,i[1]==="+"?-r:r):NaN}if(kw(n)){t=new Date(t||Date.now());const o=e?t:ww(t),a=No(o,n);return-(e?a:vw(t,a,n))}return NaN}function ww(n){return Lo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function No(n,t){const e=pw(n,t),i=Lo(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 vw(n,t,e){let i=n.getTime()-t;const s=No(new Date(i),e);if(t===s)return t;i-=s-t;const r=No(new Date(i),e);return s===r?s:Math.max(s,r)}function $u(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Uu={};function kw(n){if(Uu[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Uu[n]=!0,!0}catch{return!1}}const Sw=60*1e3,Mw={X:function(n,t,e){const i=Fo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return qu(i);case"XXXX":case"XX":return Qn(i);case"XXXXX":case"XXX":default:return Qn(i,":")}},x:function(n,t,e){const i=Fo(e.timeZone,n);switch(t){case"x":return qu(i);case"xxxx":case"xx":return Qn(i);case"xxxxx":case"xxx":default:return Qn(i,":")}},O:function(n,t,e){const i=Fo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+Dw(i,":");case"OOOO":default:return"GMT"+Qn(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Vu("short",n,e);case"zzzz":default:return Vu("long",n,e)}}};function Fo(n,t){const e=n?Xi(n,t,!0)/Sw:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Ks(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Qn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Ks(Math.floor(i/60),2),r=Ks(Math.floor(i%60),2);return e+s+t+r}function qu(n,t){return n%60===0?(n>0?"-":"+")+Ks(Math.abs(n)/60,2):Qn(n,t)}function Dw(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+Ks(r,2)}function Xu(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 Gu=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Bo=36e5,Ku=6e4,Tw=2,Kt={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:Gu};function Zs(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?Tw: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=Cw(n),{year:s,restDateString:r}=Pw(i.date,e),o=Ow(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=Ew(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Xi(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=Xu(new Date(a+l)),c=Xu(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function Cw(n){const t={};let e=Kt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Kt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Kt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Pw(n,t){if(n){const e=Kt.YYY[t],i=Kt.YYYYY[t];let s=Kt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Kt.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 Ow(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=Kt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Ju(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Kt.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return Lw(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=Kt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return Ju(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=Kt.Www.exec(n),r)return s=parseInt(r[1],10)-1,td(s)?Zu(t,s):new Date(NaN);if(r=Kt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return td(s,o)?Zu(t,s,o):new Date(NaN)}return null}function Ew(n){let t,e,i=Kt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),zo(t)?t%24*Bo:NaN;if(i=Kt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),zo(t,e)?t%24*Bo+e*Ku:NaN;if(i=Kt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return zo(t,e,s)?t%24*Bo+e*Ku+s*1e3:NaN}return null}function Zu(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 Rw=[31,28,31,30,31,30,31,31,30,31,30,31],Aw=[31,29,31,30,31,30,31,31,30,31,30,31];function Qu(n){return n%400===0||n%4===0&&n%100!==0}function Ju(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Qu(n);if(i&&e>Aw[t]||!i&&e>Rw[t])return!1}return!0}function Lw(n,t){if(t<1)return!1;const e=Qu(n);return!(e&&t>366||!e&&t>365)}function td(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function zo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const Iw=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Nw(n,t,e={}){t=String(t);const i=t.match(Iw);if(i){const s=Zs(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,"'"+Mw[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return aw(n,t,e)}function ed(n,t,e){n=Zs(n,e);const i=Xi(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 Fw(n,t,e,i){return i={...i,timeZone:t,originalDate:n},Nw(ed(n,t,{timeZone:i.timeZone}),e,i)}function Bw(n,t,e){if(typeof n=="string"&&!n.match(Gu))return Zs(n,{...e,timeZone:t});n=Zs(n,e);const i=Lo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Xi(t,new Date(i));return new Date(i+s)}function zw(n,t){return-Xi(n,t)}function Ho(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 Fw(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const Hw={secondly:1e3,minutely:60*1e3,hourly:60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function Wo(n){return n&&Xx.find(t=>n<=Hw[t])||null}const Jn=(n,t)=>new Date(n.getTime()-zw(t,n));class ve{constructor(t){Re(this,"timeframeText"),Re(this,"key"),Re(this,"display"),Re(this,"timeframeLength"),Re(this,"allowedTiers"),Re(this,"defaultResponseGranularity"),Re(this,"dataGranularity"),Re(this,"isRelative"),Re(this,"_startCustom"),Re(this,"_endCustom"),this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(){const t=new Set,e=this.maximumTimeframeLength()/3600;return e<=6&&t.add("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=Bw(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return ed(e,t)}}class Ww extends ve{rawStart(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Jn(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class Yw extends ve{rawStart(t){let e=Kn(this.tzAdjustedDate(t));return t&&(e=Jn(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class Vw extends ve{rawEnd(t){let e=We(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Jn(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=We(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Jn(i,t)),i}}class jw extends ve{rawEnd(t){let e=Kn(this.tzAdjustedDate(t));return t&&(e=Jn(e,t)),e}rawStart(t){let e=Kn(Yu(this.tzAdjustedDate(t),1));return t&&(e=Jn(e,t)),e}}Et.FIFTEEN_MIN,new ve({key:Et.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Et.ONE_HOUR,new ve({key:Et.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Et.SIX_HOUR,new ve({key:Et.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Et.TWELVE_HOUR,new ve({key:Et.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Et.ONE_DAY,new ve({key:Et.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,allowedTiers:["free","trial","plus","enterprise"]}),Et.SEVEN_DAY,new ve({key:Et.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Et.THIRTY_DAY,new ve({key:Et.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,allowedTiers:["trial","plus","enterprise"]}),Et.CURRENT_WEEK,new Ww({key:Et.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=We(new Date,{weekStartsOn:1});return(Gs(Ru(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Et.CURRENT_MONTH,new Yw({key:Et.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Kn(new Date);return(Gs(Ru(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Et.PREVIOUS_WEEK,new Vw({key:Et.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Et.PREVIOUS_MONTH,new jw({key:Et.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Kn(new Date),e=Kn(Yu(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=$w(t,e)),60*60*24*cw(new Date().setMonth(new Date().getMonth()-1))+uw(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function $w(n,t){return dw(n.getTimezoneOffset()-t.getTimezoneOffset())}function Uw(n){return f.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?`${Ho(e)} - ${Ho(i,{includeTZ:!0})}`:""})}function qw(n){const t={enabled:!1,position:"doughnutChartTooltipPosition",callbacks:{label:i=>({label:i.dataset.label,value:i.label})}};return As.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=Do(s,o,a),c=s.y,u=s.x<a?"left":"center";return{x:l-n.tooltipState.offsetX,y:c,xAlign:u}},{options:f.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...t,external:i=>{Mo(n.tooltipState,i)}}}}))}}function Xw(n){const t=f.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=f.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"};As.positioners.lineChartTooltipPosition=function(l,c){if(!l.length||n.tooltipState.locked)return!1;const u=this.chart.canvas.getBoundingClientRect(),d=n.tooltipState.width||this.width,h=n.tooltipState.height||this.height,g=u.width/2,p=u.height/2,y=Do(c,d,g);let x=Tx(c,h,p);const w=c.y<p?"top":"bottom",v=c.x<g?"left":"center";return h>u.height&&(x=0),{x:y,y:x,xAlign:v,yAlign:w}};const s=f.computed(()=>{switch(n.granularity.value){case"minutely":return"minute";case"hourly":return"hour";case"daily":return"day";default:return"day"}}),r=f.computed(()=>ox(Number(n.timeRangeMs.value))>=24?"yyyy-MM-dd h:mm":"h:mm"),o=f.computed(()=>["daily","weekly"].includes(n.granularity.value)?"yyyy-MM-dd":"yyyy-MM-dd h:mm");return{options:f.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=>{Mo(n.tooltipState,l)}}},interaction:{mode:"index",intersect:!1}}))}}function Gw(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:o,colorPalette:a}=n,{i18n:l}=gt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:Gn(i.indexOf(u),He),data:o.map((d,h)=>e?r[`${d.id},${u}`]||0:r[`${h},${u}`]||null)})):Array.from(s).flatMap((u,d)=>{if(!u)return[];const h={},g=Array.isArray(a)?Gn(d,a):a[u.name]||Gn(d);return h[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 Kw(n,t){const{i18n:e}=gt.useI18n();return f.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],h=u.length>1?u[1]:u[0],g=Object.fromEntries(l?s.flatMap(C=>o.map((T,b)=>{const _=C.event[d],M=c?`${_},${T}`:`${b},${T}`,E=C.event[T];return[M,E]})):s.map(C=>{const T=c?`${C.event[d]},${C.event[h]}`:`${d},${h}`,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],x=r[h],w=c&&y&&Object.entries(y).map(([C,T])=>({id:C,name:T.name}))||o.map(C=>({id:C,name:C})),v=c&&x&&Object.entries(x).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)),v.sort((C,T)=>p.indexOf(C.id)-p.indexOf(T.id))),!w||!v)return{labels:[],datasets:[]};const S=Gw({isMultiMetric:l,hasDimensions:c,metricNames:o,dimensionFieldNames:u,barSegmentLabels:v,pivotRecords:g,rowLabels:w,colorPalette:n.colorPalette||He});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:S}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Zw=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),Qw=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return mu(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},Jw=(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 Zw(a,l,e)};function t1(n,t){const{i18n:e}=gt.useI18n();return f.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],h=r&&d&&Object.keys(d).map(D=>({id:D,name:d[D].name}))||o.map(D=>({id:D,name:D})),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=Qw(a),y=Jw(a,l,g,p,s),x=new Set,w=s!=null&&s.length?s.reduce((D,C)=>{const T=new Date(C.timestamp).valueOf(),b=C.event;for(const _ of o)x.add(_),T in D||(D[T]={}),_ in D[T]||(D[T][_]={});for(const _ of o)h.forEach(M=>{b[u]===M.id||_===M.id?(D[T][_]||(D[T][_]={}),D[T][_][M.name]=Math.round(Number(b[_])*1e3)/1e3):c.length||(D[T][_]||(D[T][_]={}),D[T][_][M.name]=Math.round(Number(b[M.id])*1e3)/1e3)});return D},{}):{},v=o.length===1?o.flatMap(D=>h.map(C=>[D,C.name])):h.map(D=>[D.name,D.name]),S={},P=[...v].map(([D,C],T)=>{const b=y.map(A=>A in w&&D in w[A]?{x:A,y:w[A][D][C]||0}:{x:A,y:0});let{colorPalette:_,fill:M}=n;tt(_)&&(_=He);const E=Array.isArray(_)?Gn(T,_):_[C]||Gn(T);return S[C]=E,{rawDimension:C,rawMetric:D,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),...Lx,fill:M,borderWidth:M?Nx:Ix}});return P.sort((D,C)=>Number(D.total)<Number(C.total)?-1:1),{datasets:P,colorMap:S}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const e1=(n,t)=>{f.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 n1(){const{i18n:n}=gt.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 gt={useBarChartOptions:Wx,useChartJSCommon:Vx,useChartLegendValues:$x,useChartSelectedRange:Uw,useExploreResultToDatasets:Kw,useExploreResultToTimeDataset:t1,useDoughnutChartOptions:qw,useLinechartOptions:Xw,useI18n:Nh,useReportChartDataForSynthetics:e1,useTranslatedUnits:n1};/*!
19
19
  * chartjs-plugin-annotation v3.0.1
20
20
  * https://www.chartjs.org/chartjs-plugin-annotation/index
21
21
  * (c) 2023 chartjs-plugin-annotation Contributors
22
22
  * Released under the MIT License
23
- */const Au={modes:{point(n,t){return zs(n,t,{intersect:!0})},nearest(n,t,e){return cx(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 ax(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 lx(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):ax(i,t,e.axis))}function cx(n,t,e){let i=Number.POSITIVE_INFINITY;return zs(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=lx(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 ux=(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 dx(n,t,e){for(const i of Object.keys(n))n[i]=Hs(n[i],t,e);return n}function hx(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 fx(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(ux(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}),gx={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 px(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 mx(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 gx[e](n)}function mx(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,yx=n=>isNaN(n)||n<=0,bx=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()+bx(s)+r+(n._measureText?"-spriting":"");return Ro.has(a)||Ro.set(a,Sx(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:dx(Ke(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function _x(n,t,e){const i=e.content;if(Ys(i)){n.save(),n.globalAlpha=Mx(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=px(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,xx(n,e)&&vx(n,{x:c,y:u},s,o),Dx(n,{x:c,y:u},s,{fonts:o,colors:l}),n.restore()}function xx(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function wx(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}yx(s)||kx(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function kx(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 Sx(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 vx(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 Dx(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 Mx(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 Cx(n,t)}function Tx(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?Ox(s,r,t):Px(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:Ax(n,e,t),initProperties:e.initProperties}],e}function Cx(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 Ox(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 Px(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 Ex({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 Rx({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 Ax(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=Ex({properties:t,options:e},o,s,r),l=Rx({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 Lx(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 Ix(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return Nx(n,t,e);case"click":return Fx(n,t,e)}}function Nx(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 Fx(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 Bx(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 zx(n,t,e){const i=jx(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 Hx(n,t){for(const e of n)Yx(e,t)}function Qu(n,t,e,i){if(vt(t[e])&&!Wx(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Wx(n,t,e){return Qt(n[t])||Qt(n[e])}function Yx(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=Dn(t,n,e);i&&!t[i]&&Vx(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Vx(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 jx(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),Ux(t,this),Wu(t,this,e),_x(t,Jx(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=$x(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 $x(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 Ux(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&Zx(t,r);if(!o||tw(t,r,o))return;if(n.save(),n.beginPath(),!rn(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=qx(t,o),{sideStart:u,sideEnd:d}=Gx(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 qx(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=Xx(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 Xx(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 Gx(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=Kx(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 Kx(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function Zx(n,t){const e=t.position;return td.includes(e)?e:Qx(n,t)}function Qx(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 Jx({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 tw(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,ew=(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 rw(this,o,c,s)||Wo(this,o,s)}return nw(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 fw(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=Tx(t,e),{x:s,y:r,x2:o,y2:a}=i,l=iw(i,t.chartArea),c=l?sw({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=hw(c,e,An(d,f))}const u=ow(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 nw(n,{mouseX:t,mouseY:e},i,{hBorderWidth:s,useFinalPosition:r}){const o=ew(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 iw({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 sw(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 rw(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 ow(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 lw(t,e,{width:o,height:a,padding:s},n.chartArea)}function aw(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 lw(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"?aw(n):Nt(t.rotation),f=cw(s,r,d),g=uw(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 cw(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 uw(n,t,e,i){let s;const r=dw(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 dw(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 hw(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 fw(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 gw({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 gw(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 hx({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);wx(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&&mw(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=pw(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 pw({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 mw(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 yw={update:Object.assign},bw=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 _w(n,t,e,i){const s=ww(n,e.animations,i),r=t.annotations,o=vw(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=gd(o,a,l.type),u=l.setContext(Sw(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=xw(d),"elements"in d&&(kw(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 xw(n){return isNaN(n.x)||isNaN(n.y)}function ww(n,t,e){return e==="reset"||e==="none"||e==="resize"?yw:new Pr(n,t)}function kw(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 bw)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 Sw(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function vw(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 Dw="3.0.1";const an=new Map,Mw=Fo.concat(Vs);var md={id:"annotation",version:Dw,beforeRegister(){fx("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),Hx(s,n.scales)},afterDataLimits(n,t){const e=an.get(n);zx(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=an.get(n);Lx(n,i,e),_w(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),Bx(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);Ix(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=>!Mw.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=Tw(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)Cw(i,s,r,a);e&&hi(i)}function Tw(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 Cw(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 Ow="#6c7489",Pw="#995c00",Ew="20px",yd="24px",Rw="40px",Aw="48px",Lw={class:"tooltip-title"},Iw={class:"title font-bold"},Nw={key:1,class:"subtitle"},Fw={class:"tooltip"},Bw={key:0},zw={class:"display-label"},Hw={class:"display-value"},Ww=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",Lw,[h.createElementVNode("span",Iw,h.toDisplayString(n.tooltipTitle),1),n.locked?(h.openBlock(),h.createBlock(h.unref(pa.DragIcon),{key:0,class:"drag-icon",color:h.unref(Ow)},null,8,["color"])):h.createCommentVNode("",!0),n.context?(h.openBlock(),h.createElementBlock("span",Nw,h.toDisplayString(n.context),1)):h.createCommentVNode("",!0)]),h.createElementVNode("ul",Fw,[(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",Bw,[h.createElementVNode("div",{class:"square-marker",style:h.normalizeStyle({background:y,"border-color":_})},null,4),h.createElementVNode("span",zw,h.toDisplayString(w),1),h.createElementVNode("span",Hw,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(Ww,[["__scopeId","data-v-cd0df662"]]),Yw=["onClick"],Vw=["title"],jw={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=Aw: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(Rw,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,Vw),D&&h.unref(s)?(h.openBlock(),h.createElementBlock("div",jw,h.toDisplayString(D.formatted),1)):h.createCommentVNode("",!0)],2)],8,Yw))),128))],2)):h.createCommentVNode("",!0)}}),[["__scopeId","data-v-bf35eae8"]]);let qs;const $w=new Uint8Array(16);function Uw(){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($w)}const $t=[];for(let n=0;n<256;++n)$t.push((n+256).toString(16).slice(1));function qw(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||Uw)();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 qw(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,Xw="100%",Gw="100%",Kw=20,Zw=20,kd=6,Qw=0,Jw=10,t1=10,e1=1,n1=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(W_()),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*(Kw+kd),D.value)}px`:Xw}),$=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),E.value)}px`:Gw});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):Y_(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+e1,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>=Qw&&z.scrollLeft<=Jw?(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+t1)*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"]]);/*!
23
+ */const nd={modes:{point(n,t){return Qs(n,t,{intersect:!0})},nearest(n,t,e){return r1(n,t,e)},x(n,t,e){return Qs(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return Qs(n,t,{intersect:e.intersect,axis:"y"})}}};function Yo(n,t,e){return(nd.modes[e.mode]||nd.modes.nearest)(n,t,e)}function i1(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 s1(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function Qs(n,t,e){return n.visibleElements.filter(i=>e.intersect?i.inRange(t.x,t.y):i1(i,t,e.axis))}function r1(n,t,e){let i=Number.POSITIVE_INFINITY;return Qs(n,t,e).reduce((s,r)=>{const o=r.getCenterPoint(),a=s1(t,o,e.axis),l=zn(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 o1=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,On=.001,Js=(n,t,e)=>Math.min(e,Math.max(t,n));function a1(n,t,e){for(const i of Object.keys(n))n[i]=Js(n[i],t,e);return n}function l1(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 id(n,{x:t,y:e,x2:i,y2:s},r,o){const a=o/2,l=n.x>=t-a-On&&n.x<=i+a+On,c=n.y>=e-a-On&&n.y<=s+a+On;return r==="x"?l:(r==="y"||l)&&c}function ti(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function c1(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(o1(a,o)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const sd=n=>typeof n=="string"&&n.endsWith("%"),rd=n=>parseFloat(n)/100,od=n=>Js(rd(n),0,1),tr=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),u1={box:n=>tr(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>tr(n.centerX,n.centerY),line:n=>tr(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>tr(n.centerX,n.centerY)};function Vo(n,t){return t==="start"?0:t==="end"?n:sd(t)?od(t)*n:n/2}function cn(n,t,e=!0){return typeof t=="number"?t:sd(t)?(e?od(t):rd(t))*n:n}function d1(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 jo(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 ad(n){return n&&(te(n.xValue)||te(n.yValue))}function Gi(n,t,e){const i=e.init;if(i){if(i===!0)return cd(t,e)}else return;return h1(n,t,e)}function ld(n,t,e){let i=!1;return t.forEach(s=>{ee(n[s])?(i=!0,e[s]=n[s]):te(e[s])&&delete e[s]}),i}function cd(n,t){const e=t.type||"line";return u1[e](n)}function h1(n,t,e){const i=ut(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return cd(t,e);if(it(i))return i}const $o=new Map,f1=n=>isNaN(n)||n<=0,g1=n=>n.reduce(function(t,e){return t+=e.string,t},"");function er(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Uo(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Ft(i)),n.translate(-t,-e))}function un(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 ei(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function qo(n,t){const e=t.content;if(er(e))return{width:cn(e.width,t.width),height:cn(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()+g1(s)+r+(n._measureText?"-spriting":"");return $o.has(a)||$o.set(a,x1(n,o,s,r)),$o.get(a)}function ud(n,t,e){const{x:i,y:s,width:r,height:o}=t;n.save(),ei(n,e);const a=un(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),Hn(n,{x:i,y:s,w:r,h:o,radius:a1(tn(e.borderRadius),0,Math.min(r,o)/2)}),n.closePath(),n.fill(),a&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function p1(n,t,e){const i=e.content;if(er(i)){n.save(),n.globalAlpha=v1(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=d1(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,m1(n,e)&&_1(n,{x:c,y:u},s,o),w1(n,{x:c,y:u},s,{fonts:o,colors:l}),n.restore()}function m1(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function y1(n,t,e,i){const{radius:s,options:r}=t,o=r.pointStyle,a=r.rotation;let l=(a||0)*Tr;if(er(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}f1(s)||b1(n,{x:e,y:i,radius:s,rotation:a,style:o,rad:l})}function b1(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,yt),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=ls,n.lineTo(t+Math.sin(o)*i,e-Math.cos(o)*i),o+=ls,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+ge)*c,l=Math.sin(o+ge)*c,n.arc(t-a,e-l,u,o-rt,o-xt),n.arc(t+l,e-a,u,o-xt,o),n.arc(t+a,e+l,u,o,o+xt),n.arc(t-l,e+a,u,o+xt,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+=ge;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+=ge;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+=ge,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 x1(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 _1(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 w1(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 v1(n,t){const e=Je(n)?n:t;return Je(e)?Js(e,0,1):1}const dd={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 ni(n,t,e){return t=typeof t=="number"?t:n.parse(t),Mt(t)?n.getPixelForValue(t):e}function En(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 hd(n,t){if(n){const e=n.options.reverse,i=ni(n,t.min,e?t.end:t.start),s=ni(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function fd(n,t){const{chartArea:e,scales:i}=n,s=i[En(i,t,"xScaleID")],r=i[En(i,t,"yScaleID")];let o=e.width/2,a=e.height/2;return s&&(o=ni(s,t.xValue,s.left+s.width/2)),r&&(a=ni(r,t.yValue,r.top+r.height/2)),{x:o,y:a}}function Xo(n,t){const e=n.scales,i=e[En(e,t,"xScaleID")],s=e[En(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:o}=i||n.chartArea,{top:a,bottom:l}=s||n.chartArea;const c=md(i,{min:t.xMin,max:t.xMax,start:r,end:o});r=c.start,o=c.end;const u=md(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 gd(n,t){if(!ad(t)){const e=Xo(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 S1(n,t)}function k1(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?M1(s,r,t):D1(e,r,t),r}function pd(n,t){const e=Xo(n,t);return e.initProperties=Gi(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:P1(n,e,t),initProperties:e.initProperties}],e}function S1(n,t){const e=fd(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 md(n,t){const e=hd(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function M1(n,t,e){const i=ni(n,e.value,NaN),s=ni(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function D1(n,t,e){for(const i of Object.keys(dd)){const s=n[En(n,e,i)];if(s){const{min:r,max:o,start:a,end:l,startProp:c,endProp:u}=dd[i],d=hd(s,{min:e[r],max:e[o],start:s[a],end:s[l]});t[c]=d.start,t[u]=d.end}}}function T1({properties:n,options:t},e,i,s){const{x:r,x2:o,width:a}=n;return yd({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 C1({properties:n,options:t},e,i,s){const{y:r,y2:o,height:a}=n;return yd({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 yd(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+Vo(c,r)}function P1(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=jo(i.position),r=Bt(i.padding),o=qo(n.ctx,i),a=T1({properties:t,options:e},o,s,r),l=C1({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 Rn(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 Go=["enter","leave"],Ko=Go.concat("click");function O1(n,t,e){t.listened=ld(e,Ko,t.listeners),t.moveListened=!1,t._getElements=Yo,Go.forEach(i=>{ee(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&ee(i.click)&&(t.listened=!0),t.moveListened||Go.forEach(s=>{ee(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function E1(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return R1(n,t,e);case"click":return A1(n,t,e)}}function R1(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=Yo(n,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let o=bd(r,"leave",s,i);return bd(r,"enter",i,s)||o}function bd({state:n,event:t},e,i,s){let r;for(const o of i)s.indexOf(o)<0&&(r=xd(o.options[e]||n.listeners[e],o,t)||r);return r}function A1(n,t,e){const i=n.listeners,s=Yo(n,t,e.interaction);let r;for(const o of s)r=xd(o.options.click||i.click,o,t)||r;return r}function xd(n,t,e){return ut(n,[t.$context,e])===!0}const nr=["afterDraw","beforeDraw"];function L1(n,t,e){const i=t.visibleElements;t.hooked=ld(e,nr,t.hooks),t.hooked||i.forEach(s=>{t.hooked||nr.forEach(r=>{ee(s.options[r])&&(t.hooked=!0)})})}function _d(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return ut(i,[t.$context])}}function I1(n,t,e){const i=H1(n.scales,t,e);let s=wd(t,i,"min","suggestedMin");s=wd(t,i,"max","suggestedMax")||s,s&&ee(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function N1(n,t){for(const e of n)B1(e,t)}function wd(n,t,e,i){if(Mt(t[e])&&!F1(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function F1(n,t,e){return te(n[t])||te(n[e])}function B1(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=En(t,n,e);i&&!t[i]&&z1(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function z1(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(te(n[e+i]))return!0;return!1}function H1(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?vd(a,t,["value","endValue"],o):En(n,a,r)===s&&vd(a,t,[i+"Min",i+"Max",i+"Value"],o);return o}function vd(n,t,e,i){for(const s of e){const r=n[s];if(te(r)){const o=t.parse(r);i.min=Math.min(i.min,o),i.max=Math.max(i.max,o)}}}class ii extends jt{inRange(t,e,i,s){const{x:r,y:o}=Rn({x:t,y:e},this.getCenterPoint(s),Ft(-this.options.rotation));return id({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return ti(this,t)}draw(t){t.save(),Uo(t,this.getCenterPoint(),this.options.rotation),ud(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return pd(t,e)}}ii.id="boxAnnotation",ii.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},ii.defaultRoutes={borderColor:"color",backgroundColor:"color"},ii.descriptors={label:{_fallback:!0}};const kd=["left","bottom","top","right"];class Ki extends jt{inRange(t,e,i,s){const{x:r,y:o}=Rn({x:t,y:e},this.getCenterPoint(s),Ft(-this.rotation));return id({x:r,y:o},this.getProps(["x","y","x2","y2"],s),i,this.options.borderWidth)}getCenterPoint(t){return ti(this,t)}draw(t){const e=this.options,i=!te(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),Uo(t,this.getCenterPoint(),this.rotation),Y1(t,this),ud(t,this,e),p1(t,G1(this),e),t.restore())}resolveElementProperties(t,e){let i;if(ad(e))i=fd(t,e);else{const{centerX:a,centerY:l}=Xo(t,e);i={x:a,y:l}}const s=Bt(e.padding),r=qo(t.ctx,e),o=W1(i,r,e,s);return{initProperties:Gi(t,o,e),pointX:i.x,pointY:i.y,...o,rotation:e.rotation}}}Ki.id="labelAnnotation",Ki.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},Ki.defaultRoutes={borderColor:"color"};function W1(n,t,e,i){const s=t.width+i.width+e.borderWidth,r=t.height+i.height+e.borderWidth,o=jo(e.position,"center"),a=Sd(n.x,s,e.xAdjust,o.x),l=Sd(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 Sd(n,t,e=0,i){return n-Vo(t,i)+e}function Y1(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,o=r&&r.display&&q1(t,r);if(!o||K1(t,r,o))return;if(n.save(),n.beginPath(),!un(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=V1(t,o),{sideStart:u,sideEnd:d}=$1(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 h=Rn({x:e,y:i},t.getCenterPoint(),Ft(-t.rotation));n.lineTo(h.x,h.y),n.stroke(),n.restore()}function V1(n,t){const{x:e,y:i,x2:s,y2:r}=n,o=j1(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 j1(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 $1(n,t,e){const{y:i,width:s,height:r,options:o}=n,a=o.callout.start,l=U1(t,o.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+cn(r,a)},u={x:c.x+l,y:c.y}):(c={x:e.x+cn(s,a),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function U1(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function q1(n,t){const e=t.position;return kd.includes(e)?e:X1(n,t)}function X1(n,t){const{x:e,y:i,x2:s,y2:r,width:o,height:a,pointX:l,pointY:c,centerX:u,centerY:d,rotation:h}=n,g={x:u,y:d},p=t.start,y=cn(o,p),x=cn(a,p),w=[e,e+y,e+y,s],v=[i+x,r,i,r],S=[];for(let P=0;P<4;P++){const D=Rn({x:w[P],y:v[P]},g,Ft(h));S.push({position:kd[P],distance:zn(D,{x:l,y:c})})}return S.sort((P,D)=>P.distance-D.distance)[0].position}function G1({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,o=Bt(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 K1(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 Zo=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Qo=(n,t,e)=>Zo(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,Md=(n,t,e)=>Zo(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,Zi=n=>n*n,Z1=(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},Dd=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,Jo=(n,t,e,i)=>({x:Dd(n.x,t.x,e.x,i),y:Dd(n.y,t.y,e.y,i)}),Td=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),Cd=(n,t,e,i)=>-Math.atan2(Td(n.x,t.x,e.x,i),Td(n.y,t.y,e.y,i))+.5*rt;class Qi extends jt{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){un(l,this.options);const{chart:u}=this.$context,d=t*u.currentDevicePixelRatio,h=e*u.currentDevicePixelRatio,g=l.isPointInStroke(a,d,h)||ta(this,o,s);return l.restore(),g}const c=Zi(r);return ev(this,o,c,s)||ta(this,o,s)}return Q1(this,{mouseX:t,mouseY:e},i,{hBorderWidth:r,useFinalPosition:s})}getCenterPoint(t){return ti(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:o,options:a}=this;if(t.save(),!un(t,a))return t.restore();ei(t,a);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(a.curve&&o)return cv(t,this,o,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Ad(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-h,0),t.shadowColor=a.borderShadowColor,t.stroke(),ea(t,0,d,c),ea(t,l,-h,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=k1(t,e),{x:s,y:r,x2:o,y2:a}=i,l=J1(i,t.chartArea),c=l?tv({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=Gi(t,c,e),e.curve){const d={x:c.x,y:c.y},h={x:c.x2,y:c.y2};c.cp=lv(c,e,zn(d,h))}const u=nv(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Qi.id="lineAnnotation";const Pd={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};Qi.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Pd),fill:!1,length:12,start:Object.assign({},Pd),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({},Ki.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},Qi.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Qi.defaultRoutes={borderColor:"color"};function Q1(n,{mouseX:t,mouseY:e},i,{hBorderWidth:s,useFinalPosition:r}){const o=Z1(t,e,n.getProps(["x","y","x2","y2"],r),i);return o.value>=o.start-s&&o.value<=o.end+s||ta(n,{mouseX:t,mouseY:e},r,i)}function J1({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 Od({x:n,y:t},e,{top:i,right:s,bottom:r,left:o}){return n<o&&(t=Md(o,{x:n,y:t},e),n=o),n>s&&(t=Md(s,{x:n,y:t},e),n=s),t<i&&(n=Qo(i,{x:n,y:t},e),t=i),t>r&&(n=Qo(r,{x:n,y:t},e),t=r),{x:n,y:t}}function tv(n,t,e){const{x:i,y:s}=Od(n,t,e),{x:r,y:o}=Od(t,n,e);return{x:i,y:s,x2:r,y2:o,width:Math.abs(r-i),height:Math.abs(o-s)}}function ev(n,{mouseX:t,mouseY:e},i=On,s){const{x:r,y:o,x2:a,y2:l}=n.getProps(["x","y","x2","y2"],s),c=a-r,u=l-o,d=Zi(c)+Zi(u),h=d===0?-1:((t-r)*c+(e-o)*u)/d;let g,p;return h<0?(g=r,p=o):h>1?(g=a,p=l):(g=r+h*c,p=o+h*u),Zi(t-g)+Zi(e-p)<=i}function ta(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function nv(n,t,e){const i=e.borderWidth,s=Bt(e.padding),r=qo(n.ctx,e),o=r.width+s.width+i,a=r.height+s.height+i;return sv(t,e,{width:o,height:a,padding:s},n.chartArea)}function iv(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 sv(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"?iv(n):Ft(t.rotation),h=rv(s,r,d),g=ov(n,t,{labelSize:h,padding:o},i),p=n.cp?Jo(c,n.cp,u,g):Zo(c,u,g),y={size:h.w,min:i.left,max:i.right,padding:o.left},x={size:h.h,min:i.top,max:i.bottom,padding:o.top},w=Rd(p.x,y)+a,v=Rd(p.y,x)+l;return{x:w-s/2,y:v-r/2,x2:w+s/2,y2:v+r/2,centerX:w,centerY:v,pointX:p.x,pointY:p.y,width:s,height:r,rotation:cs(d)}}function rv(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 ov(n,t,e,i){let s;const r=av(n,i);return t.position==="start"?s=Ed({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Ed({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=Vo(1,t.position),s}function Ed(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 Js(Math.max(l,c),0,.25)}function av(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 Rd(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 Ad(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Ld(n,e),endAdjust:Ld(n,i)}}function Ld(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(Qo(0,r,{x:0,y:s}))}function ea(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(),ei(n,i),un(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 lv(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=jo(t.controlPoint,0),d={x:a+cn(e,u.x,!1),y:l+cn(e,u.y,!1)};return Rn(d,{x:a,y:l},c)}function Id(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),ea(n,0,-s,r),n.restore())}function cv(n,t,e,i){const{x:s,y:r,x2:o,y2:a,options:l}=t,{startOpts:c,endOpts:u,startAdjust:d,endAdjust:h}=Ad(t),g={x:s,y:r},p={x:o,y:a},y=Cd(g,e,p,0),x=Cd(g,e,p,1)-rt,w=Jo(g,e,p,d/i),v=Jo(g,e,p,1-h/i),S=new Path2D;n.beginPath(),S.moveTo(w.x,w.y),S.quadraticCurveTo(e.x,e.y,v.x,v.y),n.shadowColor=l.borderShadowColor,n.stroke(S),t.path=S,t.ctx=n,Id(n,w,{angle:y,adjust:d},c),Id(n,v,{angle:x,adjust:h},u)}class Ji extends jt{inRange(t,e,i,s){const r=this.options.rotation,o=this.options.borderWidth;if(i!=="x"&&i!=="y")return uv({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,h=i==="y"?{start:l,end:u}:{start:a,end:c},g=Rn({x:t,y:e},this.getCenterPoint(s),Ft(-r));return g[i]>=h.start-d-On&&g[i]<=h.end+d+On}getCenterPoint(t){return ti(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:o}=this;t.save(),Uo(t,this.getCenterPoint(),o.rotation),ei(t,this.options),t.beginPath(),t.fillStyle=o.backgroundColor;const a=un(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 pd(t,e)}}Ji.id="ellipseAnnotation",Ji.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,label:Object.assign({},ii.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},Ji.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ji.descriptors={label:{_fallback:!0}};function uv(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=Ft(e||0),d=i/2||0,h=Math.cos(u),g=Math.sin(u),p=Math.pow(h*(n.x-o)+g*(n.y-a),2),y=Math.pow(g*(n.x-o)-h*(n.y-a),2);return p/Math.pow(l+d,2)+y/Math.pow(c+d,2)<=1.0001}class ir extends jt{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 l1({x:t,y:e},this.getCenterPoint(s),c/2,u);const d=u/2,h=i==="y"?{start:o,end:l,value:e}:{start:r,end:a,value:t};return h.value>=h.start-d&&h.value<=h.end+d}getCenterPoint(t){return ti(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,ei(t,e);const s=un(t,e);y1(t,this,this.centerX,this.centerY),s&&!er(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=gd(t,e);return i.initProperties=Gi(t,i,e),i}}ir.id="pointAnnotation",ir.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},ir.defaultRoutes={borderColor:"color",backgroundColor:"color"};class sr extends jt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&hv(this.elements,t,e,s);const r=Rn({x:t,y:e},this.getCenterPoint(s),Ft(-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 ti(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,ei(t,i);const s=un(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=gd(t,e),{sides:s,rotation:r}=e,o=[],a=2*rt/s;let l=r*Tr;for(let c=0;c<s;c++,l+=a){const u=dv(i,e,l);u.initProperties=Gi(t,i,e),o.push(u)}return i.elements=o,i}}sr.id="polygonAnnotation",sr.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},sr.defaultRoutes={borderColor:"color",backgroundColor:"color"};function dv({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 hv(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 dn={box:ii,ellipse:Ji,label:Ki,line:Qi,point:ir,polygon:sr};Object.keys(dn).forEach(n=>{Ct.describe(`elements.${dn[n].id}`,{_fallback:"plugins.annotation.common"})});const fv={update:Object.assign},gv=Ko.concat(nr),Nd=(n,t)=>it(t)?sa(n,t):n,na=n=>n==="color"||n==="font";function ia(n="line"){return dn[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function pv(n,t,e,i){const s=yv(n,e.animations,i),r=t.annotations,o=_v(t.elements,r);for(let a=0;a<r.length;a++){const l=r[a],c=Fd(o,a,l.type),u=l.setContext(xv(n,c,l)),d=c.resolveElementProperties(n,u);d.skip=mv(d),"elements"in d&&(bv(c,d.elements,u,s),delete d.elements),te(c.x)||Object.assign(c,d),Object.assign(c,d.initProperties),d.options=Bd(u),s.update(c,d)}}function mv(n){return isNaN(n.x)||isNaN(n.y)}function yv(n,t,e){return e==="reset"||e==="none"||e==="resize"?fv:new Wr(n,t)}function bv(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=Fd(s,r,o.type,o.initProperties),c=e[o.optionScope].override(o);a.options=Bd(c),i.update(l,a)}}function Fd(n,t,e,i){const s=dn[ia(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Bd(n){const t=dn[ia(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,sa(n,t.defaults),sa(n,t.defaultRoutes));for(const i of gv)e[i]=n[i];return e}function sa(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];na(i)&&ot(r)?e[i]=r.map(o=>Nd(o,s)):e[i]=Nd(r,s)}return e}function xv(n,t,e){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,id:e.id,type:"annotation"}))}function _v(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 wv="3.0.1";const hn=new Map,vv=Ko.concat(nr);var zd={id:"annotation",version:wv,beforeRegister(){c1("chart.js","4.0",pe.version)},afterRegister(){pe.register(dn)},afterUnregister(){pe.unregister(dn)},beforeInit(n){hn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=hn.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),N1(s,n.scales)},afterDataLimits(n,t){const e=hn.get(n);I1(n,t.scale,e.annotations.filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=hn.get(n);O1(n,i,e),pv(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),L1(n,i,e)},beforeDatasetsDraw(n,t,e){rr(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){rr(n,"afterDatasetsDraw",e.clip)},beforeDraw(n,t,e){rr(n,"beforeDraw",e.clip)},afterDraw(n,t,e){rr(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=hn.get(n);E1(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){hn.delete(n)},_getState(n){return hn.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=>!vv.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${dn[ia(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:na,_fallback:!0},_indexable:na}},additionalOptionScopes:[""]};function rr(n,t,e){const{ctx:i,chartArea:s}=n,r=hn.get(n);e&&bi(i,s);const o=kv(r.visibleElements,t).sort((a,l)=>a.element.options.z-l.element.options.z);for(const a of o)Sv(i,s,r,a);e&&xi(i)}function kv(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 Sv(n,t,e,i){const s=i.element;i.main?(_d(e,s,"beforeDraw"),s.draw(n,t),_d(e,s,"afterDraw")):s.draw(n,t)}const Mv="#6c7489",Dv="#995c00",Tv="20px",Hd="24px",Cv="40px",Pv="48px",Ov={class:"tooltip-title"},Ev={class:"title font-bold"},Rv={key:1,class:"subtitle"},Av={class:"tooltip"},Lv={key:0},Iv={class:"display-label"},Nv={class:"display-value"},Fv=f.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=f.ref(null),r=f.ref(!1),o=f.ref({x:0,y:0}),a=f.ref({x:0,y:0}),l=f.ref({left:i.left,top:i.top});f.watch(s,g=>{if(g){const{width:p,height:y}=g.getBoundingClientRect();e("dimensions",{width:p,height:y})}}),f.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,x=new DOMMatrix(y),w=x.m41,v=x.m42;o.value={x:w,y:v},a.value={x:g.clientX,y:g.clientY},window.addEventListener("mousemove",d),window.addEventListener("mouseup",h)}}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 h(){r.value=!1,u!==null&&window.cancelAnimationFrame(u),window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",h)}return(g,p)=>n.showTooltip?(f.openBlock(),f.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:f.normalizeClass(["tooltip-container",{locked:n.locked}]),style:f.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},[f.createElementVNode("div",Ov,[f.createElementVNode("span",Ev,f.toDisplayString(n.tooltipTitle),1),n.locked?(f.openBlock(),f.createBlock(f.unref(Da.DragIcon),{key:0,class:"drag-icon",color:f.unref(Mv)},null,8,["color"])):f.createCommentVNode("",!0),n.context?(f.openBlock(),f.createElementBlock("span",Rv,f.toDisplayString(n.context),1)):f.createCommentVNode("",!0)]),f.createElementVNode("ul",Av,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.series,({backgroundColor:y,borderColor:x,label:w,value:v})=>(f.openBlock(),f.createElementBlock(f.Fragment,{key:w},[n.series.length?(f.openBlock(),f.createElementBlock("li",Lv,[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:y,"border-color":x})},null,4),f.createElementVNode("span",Iv,f.toDisplayString(w),1),f.createElementVNode("span",Nv,f.toDisplayString(v),1)])):f.createCommentVNode("",!0)],64))),128))])],38)):f.createCommentVNode("",!0)}}),Ye=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},ra=Ye(Fv,[["__scopeId","data-v-cd0df662"]]),Bv=["onClick"],zv=["title"],Hv={key:0,class:"sub-label"},oa=Ye(f.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){f.useCssVars(S=>({"143d7c82":a.value}));const t=n,e=f.ref(),i=f.ref([]),s=f.inject("showLegendValues",!0),r=f.inject("legendPosition",f.ref(Ot.Right)),o=f.ref([]),a=f.ref(Hd),l=()=>{const S=e.value;if(!S||!i.value||S.children.length===0)return 0;const P=S.children[0].getBoundingClientRect().top;for(const D of i.value)if(D.getBoundingClientRect().top>P)return!0;return!1},c=f.computed(()=>t.items.length>2||r.value===Ot.Right),u=()=>{e.value&&r.value===Ot.Bottom&&(l()?a.value=Pv:a.value=Hd)},d=()=>{if(e.value&&r.value===Ot.Bottom){let S=0;i.value.forEach(D=>{const C=Array.from(D.children).reduce((T,b)=>T+b.offsetWidth,0);C>S&&(S=C)});const P=parseInt(Cv,10);e.value.style.gridTemplateColumns=`repeat(auto-fit, ${S+P}px)`}u()},h=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let S=0;S<t.items.length;S++)if(t.items[S].text!==o.value[S].text)return o.value=t.items,!0;return!1};f.watch(()=>t.items,()=>{h()&&d()},{immediate:!0,flush:"post"});const g=f.ref(0),p=f.ref(0),y=new ResizeObserver(bu(S=>{const P=S[0],D=P.contentRect.width,C=P.contentRect.height;D!==g.value&&C===p.value&&d(),g.value=D,p.value=C},100));f.watch(()=>r.value,()=>{d()}),f.onMounted(()=>{o.value=t.items,e.value&&y.observe(e.value),window.requestAnimationFrame(()=>{d()})}),f.onBeforeUnmount(()=>{e.value&&y.unobserve(e.value)});const x=(S=0,P)=>{if(t.chartInstance===null)return;const D=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart;w(S,P)?D.hide(S,P):D.show(S,P),D.update()},w=(S=0,P)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const D=t.chartInstance instanceof pe?t.chartInstance:t.chartInstance.chart,C=D.getDatasetMeta(S);return C.dataset||P===void 0?D.isDatasetVisible(S):!(C.data.length&&C.data[P].hidden)},v=S=>({[Ot.Right]:"vertical",[Ot.Bottom]:"horizontal",[Ot.Hidden]:"hidden"})[S];return(S,P)=>f.unref(r)!==f.unref(Ot).Hidden?(f.openBlock(),f.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:e,class:f.normalizeClass(["legend-container",v(f.unref(r))]),"data-testid":"legend"},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(n.items,({fillStyle:D,strokeStyle:C,text:T,datasetIndex:b,index:_,value:M})=>(f.openBlock(),f.createElementBlock("li",{key:T,ref_for:!0,ref_key:"legendItemsRef",ref:i,onClick:E=>x(b,_)},[f.createElementVNode("div",{class:"square-marker",style:f.normalizeStyle({background:D,"border-color":C})},null,4),f.createElementVNode("div",{class:f.normalizeClass(["label-container",{"strike-through":!w(b,_)}])},[f.createElementVNode("div",{class:f.normalizeClass(["label",{"truncate-label":c.value}]),title:T},f.toDisplayString(T),11,zv),M&&f.unref(s)?(f.openBlock(),f.createElementBlock("div",Hv,f.toDisplayString(M.formatted),1)):f.createCommentVNode("",!0)],2)],8,Bv))),128))],2)):f.createCommentVNode("",!0)}}),[["__scopeId","data-v-bf35eae8"]]);let or;const Wv=new Uint8Array(16);function Yv(){if(!or&&(or=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!or))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return or(Wv)}const Ut=[];for(let n=0;n<256;++n)Ut.push((n+256).toString(16).slice(1));function Vv(n,t=0){return Ut[n[t+0]]+Ut[n[t+1]]+Ut[n[t+2]]+Ut[n[t+3]]+"-"+Ut[n[t+4]]+Ut[n[t+5]]+"-"+Ut[n[t+6]]+Ut[n[t+7]]+"-"+Ut[n[t+8]]+Ut[n[t+9]]+"-"+Ut[n[t+10]]+Ut[n[t+11]]+Ut[n[t+12]]+Ut[n[t+13]]+Ut[n[t+14]]+Ut[n[t+15]]}const Wd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function fn(n,t,e){if(Wd.randomUUID&&!t&&!n)return Wd.randomUUID();n=n||{};const i=n.random||(n.rng||Yv)();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 Vv(i)}const Yd=(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()},Vd={id:"highlightPlugin",clicked:!1,afterDatasetsDraw:function(n){this.clickedElements&&this.clickedElements.length&&Yd(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,Yd(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}},jd=6,jv="100%",$v="100%",Uv=20,qv=20,$d=6,Xv=0,Gv=10,Kv=10,Zv=1,Qv=Ye(f.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}=gt.useI18n(),{translateUnit:i}=gt.useTranslatedUnits(),s=f.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(Fx()),content:X=>Co(r(X,z),V)},et={...Y,content:X=>Cu(r(X,z),Tu(X.chart,L)),position:Q?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:X=>Q?Du(Co(r(X,z),V)):0,color:Su};return{[`${z}-value`]:W,[`${z}-percent`]:et}},a=f.ref(null),l=f.ref(),c=f.ref(fn()),u=fn(),d=fn(),h=f.ref([]),g=f.ref(f.inject("legendPosition",Ot.Right)),p=f.ref({show:!1,top:"0px",left:"0px",text:"",offset:-50}),y=f.toRef(t,"metricUnit"),x=f.computed(()=>f.toRef(t,"orientation").value==="horizontal"),w=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:y,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,locked:!1,chartType:x.value?$t.HORIZONTAL_BAR:$t.VERTICAL_BAR,chartTooltipSortFn:t.chartTooltipSortFn}),v=f.ref(0),S=()=>{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){v.value+=1,h.value=L.options.plugins.legend.labels.generateLabels(L).map(z=>({...z,value:t.legendValues&&t.legendValues[z.text]})).sort(t.chartLegendSortFn)}},D={id:u,afterUpdate(L){L.options.plugins.annotation.annotations=t.annotations?S():{}}},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>$s){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=x.value?N.value:0}},Vd,...t.annotations?[D]:[]],_=f.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),M=f.ref(0),E=f.ref(0),A=new ResizeObserver(bu(L=>{M.value=L[0].contentRect.width,E.value=L[0].contentRect.height},100)),F=f.computed(()=>{var z,V;const L=(V=(z=t.chartData)==null?void 0:z.labels)==null?void 0:V.length;return a.value&&L&&!x.value?`${Math.max(L*(Uv+$d),M.value)}px`:jv}),$=f.computed(()=>{var z,V;const L=(V=(z=t.chartData)==null?void 0:z.labels)==null?void 0:V.length;return a.value&&L&&x.value?`${Math.max(L*(qv+$d),E.value)}px`:$v});gt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey")),f.onMounted(()=>{t.annotations&&pe.register(zd),s.value&&(M.value=s.value.offsetWidth,E.value=s.value.offsetHeight,A.observe(s.value))}),f.onUnmounted(()=>{s.value&&A.unobserve(s.value)});const K=f.computed(()=>{const L=gt.useBarChartOptions({tooltipState:w,legendID:c.value,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle"),indexAxis:x.value?"y":"x",numLabels:_});return{...L.value,plugins:{...L.value.plugins,annotation:{annotations:S(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*jd}}}}),j=gt.useChartJSCommon("bar",a,f.toRef(t,"chartData"),b,K),N=f.computed(()=>{v.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?Tu(j.value,t.chartData):Bx(t.chartData);return V.map(Y=>Du(Co(Y,y.value)+Cu(Y,q))).reduce((Y,W)=>Math.max(Y,W),0)+jd});f.onBeforeUnmount(()=>{pe.unregister(zd)});const st={[Ot.Right]:"legend-row",[Ot.Bottom]:"column"},B=f.computed(()=>{if(l.value&&j.value){const L=window.devicePixelRatio,z=j.value,V=z.scales.y.width*L+Zv,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}),Lt=L=>{const z=L.target;if(B.value&&j.value&&!x.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>=Xv&&z.scrollLeft<=Gv?(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+Kv)*V,Q,W.scales.x.height*V))}w.offsetY=z.scrollTop,w.offsetX=z.scrollLeft,p.value.offset=z.scrollLeft},vt=({width:L,height:z})=>{w.width=L,w.height=z};f.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}),f.watch(()=>t.annotations,L=>{j.value&&(L?j.value.options.plugins.annotation.annotations=S(t.chartData):delete j.value.options.plugins.annotation.annotations)});const H=()=>{w.showTooltip&&(w.locked=!w.locked)};return(L,z)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",st[g.value]])},[f.createElementVNode("canvas",{ref_key:"axis",ref:l,class:"axis"},null,512),f.createElementVNode("div",{ref_key:"chartContainerRef",ref:s,class:"chart-container","on:scroll":Lt,onClick:z[0]||(z[0]=V=>H())},[f.createElementVNode("div",{class:"chart-body",style:f.normalizeStyle({width:F.value,height:$.value})},[f.createElementVNode("canvas",{ref_key:"canvas",ref:a},null,512)],4)],544),p.value.show?(f.openBlock(),f.createElementBlock("div",{key:0,class:"axis-tooltip",style:f.normalizeStyle({top:p.value.top,left:p.value.left})},f.toDisplayString(p.value.text),5)):f.createCommentVNode("",!0),f.createVNode(ra,{context:w.tooltipContext,left:w.left,locked:w.locked,series:w.tooltipSeries,"show-tooltip":w.showTooltip,"tooltip-title":n.tooltipTitle,top:w.top,onDimensions:vt},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top"]),f.createVNode(oa,{id:c.value,"chart-instance":f.unref(j),items:h.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6420fe94"]]);/*!
24
24
  * chartjs-adapter-date-fns v3.0.0
25
25
  * https://www.chartjs.org
26
26
  * (c) 2022 chartjs-adapter-date-fns Contributors
27
27
  * Released under the MIT license
28
- */const i1={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 i1},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=A0(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 Ty(n,t);case"minute":return Dy(n,t);case"hour":return ky(n,t);case"day":return Ts(n,t);case"week":return Cy(n,t);case"month":return io(n,t);case"quarter":return My(n,t);case"year":return Oy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Ps(n,t);case"second":return Fy(n,t);case"minute":return Ly(n,t);case"hour":return Ay(n,t);case"day":return Bc(n,t);case"week":return By(n,t);case"month":return Yc(n,t);case"quarter":return Ny(n,t);case"year":return zy(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return N0(n);case"minute":return Hy(n);case"hour":return I0(n);case"day":return so(n);case"week":return Me(n);case"isoWeek":return Me(n,{weekStartsOn:+e});case"month":return Yy(n);case"quarter":return Wy(n);case"year":return Vc(n);default:return n}},endOf:function(n,t){switch(t){case"second":return Xy(n);case"minute":return Uy(n);case"hour":return jy(n);case"day":return Hc(n);case"week":return $y(n);case"month":return Wc(n);case"quarter":return qy(n);case"year":return Vy(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}},s1={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Sd,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},r1=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 o1(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return h.isProxy(t)?new Proxy(n,{}):n}function a1(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 l1(n,t){const e={labels:[],datasets:[]};return vd(e,n.labels),Dd(e,n.datasets,t),e}const c1=h.defineComponent({props:s1,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=l1(u,g),y=o1(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&&(a1(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(c1,r1({ref:o},{type:n,...e}))}})}const u1=Xo("bar",pi),Md=Xo("doughnut",Je),d1=Xo("line",mi),h1={class:"chart-container"},f1=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",h1,[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))}}),g1=Be(f1,[["__scopeId","data-v-07ea8b82"]]);var p1=Object.defineProperty,m1=(n,t,e)=>t in n?p1(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Oe=(n,t,e)=>m1(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 y1=["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"],b1=Vi(Td),_1=[...Td,"application","consumer","iso_code"],x1=Vi(_1),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);Vi(["api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","data_plane_node","gateway_service","header_host","header_user_agent","http_method","iso_code","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","upstream_uri","websocket"]),Vi(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","response_body_size","request_body_size","status_code","status_code_grouped","upstream_status_code","upstream_status_code_grouped"]),new Set(b1),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 Cd(n,t){const e=Kn(n);return isNaN(t)?Xs(n,NaN):(t&&e.setDate(e.getDate()+t),e)}function S1(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 v1=60,D1=3600;let M1={};function T1(){return M1}function Gs(n,t){var e,i,s,r;const o=T1(),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 Od(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 C1(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 O1(n){return Math.trunc(n*D1)}function P1(n){const t=n/v1;return Math.trunc(t)}function Pd(n,t){return S1(n,-t)}function E1(n,t){const e=I1(t);return"formatToParts"in e?A1(e,n):L1(e,n)}const R1={year:0,month:1,day:2,hour:3,minute:4,second:5};function A1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=R1[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 L1(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 I1(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 Ed=36e5,N1=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),Rd(s)?-(s*Ed):NaN;if(i=Zo.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return Rd(s,o)?(r=Math.abs(s)*Ed+o*N1,i[1]==="+"?-r:r):NaN}if(z1(n)){t=new Date(t||Date.now());const o=e?t:F1(t),a=Qo(o,n);return-(e?a:B1(t,a,n))}return NaN}function F1(n){return Ko(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Qo(n,t){const e=E1(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 B1(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 Rd(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Ad={};function z1(n){if(Ad[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Ad[n]=!0,!0}catch{return!1}}function Ld(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 Id=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Jo=36e5,Nd=6e4,H1=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:Id};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?H1: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=W1(n),{year:s,restDateString:r}=Y1(i.date,e),o=V1(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=j1(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=Ld(new Date(a+l)),c=Ld(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function W1(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 Y1(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 V1(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,zd(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 q1(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 zd(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,Hd(s)?Fd(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 Hd(s,o)?Fd(t,s,o):new Date(NaN)}return null}function j1(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*Nd: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*Nd+s*1e3:NaN}return null}function Fd(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 $1=[31,28,31,30,31,30,31,31,30,31,30,31],U1=[31,29,31,30,31,30,31,31,30,31,30,31];function Bd(n){return n%400===0||n%4===0&&n%100!==0}function zd(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Bd(n);if(i&&e>U1[t]||!i&&e>$1[t])return!1}return!0}function q1(n,t){if(t<1)return!1;const e=Bd(n);return!(e&&t>366||!e&&t>365)}function Hd(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 X1(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 G1(n,t,e){if(typeof n=="string"&&!n.match(Id))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 K1(n,t){return-Ks(n,t)}const Z1={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&&y1.find(t=>n<=Z1[t])||null}const Qn=(n,t)=>new Date(n.getTime()-K1(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=G1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return X1(e,t)}}class Q1 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 J1 extends _e{rawStart(t){let e=Zn(this.tzAdjustedDate(t));return t&&(e=Qn(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class tk 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 ek extends _e{rawEnd(t){let e=Zn(this.tzAdjustedDate(t));return t&&(e=Qn(e,t)),e}rawStart(t){let e=Zn(Pd(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 Q1({key:Pt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=Gs(new Date,{weekStartsOn:1});return(Od(Cd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Pt.CURRENT_MONTH,new J1({key:Pt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Zn(new Date);return(Od(Cd(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Pt.PREVIOUS_WEEK,new tk({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 ek({key:Pt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Zn(new Date),e=Zn(Pd(new Date,1));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=nk(t,e)),60*60*24*C1(new Date().setMonth(new Date().getMonth()-1))+O1(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function nk(n,t){return P1(n.getTimezoneOffset()-t.getTimezoneOffset())}const Wd=(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;Wd(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Wd(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},ik=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(d1),{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(u1),{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))}}),sk=Be(ik,[["__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,Jd=X.Uint8Array,_S=ue.propertyIsEnumerable,xS=we.splice,wS=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"),kS=On(oa),SS=On(ji),vS=On(aa),DS=On(la),MS=On(ca),Js=Jn?Jn.prototype:void 0,ua=Js?Js.valueOf:void 0,th=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 TS(){this.__data__=$i?$i(null):{}}function CS(m){return this.has(m)&&delete this.__data__[m]}function OS(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 PS(m){var k=this.__data__;return $i?k[m]!==void 0:oe.call(k,m)}function ES(m,k){var R=this.__data__;return R[m]=$i&&k===void 0?s:k,this}Cn.prototype.clear=TS,Cn.prototype.delete=CS,Cn.prototype.get=OS,Cn.prototype.has=PS,Cn.prototype.set=ES;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 RS(){this.__data__=[]}function AS(m){var k=this.__data__,R=er(k,m);if(R<0)return!1;var I=k.length-1;return R==I?k.pop():xS.call(k,R,1),!0}function LS(m){var k=this.__data__,R=er(k,m);return R<0?void 0:k[R][1]}function IS(m){return er(this.__data__,m)>-1}function NS(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=RS,We.prototype.delete=AS,We.prototype.get=LS,We.prototype.has=IS,We.prototype.set=NS;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 FS(){this.__data__={hash:new Cn,map:new(ji||We),string:new Cn}}function BS(m){return nr(this,m).delete(m)}function zS(m){return nr(this,m).get(m)}function HS(m){return nr(this,m).has(m)}function WS(m,k){return nr(this,m).set(m,k),this}Ye.prototype.clear=FS,Ye.prototype.delete=BS,Ye.prototype.get=zS,Ye.prototype.has=HS,Ye.prototype.set=WS;function tr(m){var k=-1,R=m?m.length:0;for(this.__data__=new Ye;++k<R;)this.add(m[k])}function YS(m){return this.__data__.set(m,s),this}function VS(m){return this.__data__.has(m)}tr.prototype.add=tr.prototype.push=YS,tr.prototype.has=VS;function Ve(m){this.__data__=new We(m)}function jS(){this.__data__=new We}function $S(m){return this.__data__.delete(m)}function US(m){return this.__data__.get(m)}function qS(m){return this.__data__.has(m)}function XS(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=jS,Ve.prototype.delete=$S,Ve.prototype.get=US,Ve.prototype.has=qS,Ve.prototype.set=XS;function GS(m,k){var R=Pn(m)||lh(m)?xe(m.length,String):[],I=R.length,nt=!!I;for(var U in m)(k||oe.call(m,U))&&!(nt&&(U=="length"||sh(U,I)))&&R.push(U);return R}function er(m,k){for(var R=m.length;R--;)if(ah(m[R][0],k))return R;return-1}var KS=uv();function ZS(m,k){return m&&KS(m,k,ar)}function eh(m,k){k=ir(k,m)?[k]:nh(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 QS(m){return Bt.call(m)}function JS(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:tv(m,k,da,R,I,nt)}function tv(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||xv(m)?ih(m,k,R,I,nt,U):dv(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),hv(m,k,R,I,nt,U)):!1}function ev(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 nv(m){if(!rr(m)||mv(m))return!1;var k=uh(m)||Mt(m)?Qs:q;return k.test(On(m))}function iv(m){return or(m)&&fa(m.length)&&!!Y[Bt.call(m)]}function sv(m){return typeof m=="function"?m:m==null?Dv:typeof m=="object"?Pn(m)?av(m[0],m[1]):ov(m):Mv(m)}function rv(m){if(!yv(m))return wS(m);var k=[];for(var R in Object(m))oe.call(m,R)&&R!="constructor"&&k.push(R);return k}function ov(m){var k=fv(m);return k.length==1&&k[0][2]?oh(k[0][0],k[0][1]):function(R){return R===m||ev(R,m,k)}}function av(m,k){return ir(m)&&rh(k)?oh(sr(m),k):function(R){var I=kv(R,m);return I===void 0&&I===k?Sv(R,m):da(k,I,void 0,r|o)}}function lv(m){return function(k){return eh(k,m)}}function cv(m){if(typeof m=="string")return m;if(ga(m))return th?th.call(m):"";var k=m+"";return k=="0"&&1/m==-a?"-0":k}function nh(m){return Pn(m)?m:bv(m)}function uv(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 ih(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 dv(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 Jd(m),new Jd(k)));case d:case f:case w:return ah(+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=ih(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 hv(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 dh=ct?I(En,je,Yt,k,m,U):I(je,En,Yt,m,k,U);if(!(dh===void 0?je===En||R(je,En,I,nt,U):dh)){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 pv(k)?R[typeof k=="string"?"string":"hash"]:R.map}function fv(m){for(var k=ar(m),R=k.length;R--;){var I=k[R],nt=m[I];k[R]=[I,nt,rh(nt)]}return k}function ti(m,k){var R=St(m,k);return nv(R)?R:void 0}var dn=QS;(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 kS:return D;case SS:return _;case vS:return v;case DS:return M;case MS:return b}return k});function gv(m,k,R){k=ir(k,m)?[k]:nh(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)&&sh(U,ct)&&(Pn(m)||lh(m))}function sh(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 pv(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function mv(m){return!!ke&&ke in m}function yv(m){var k=m&&m.constructor,R=typeof k=="function"&&k.prototype||ue;return m===R}function rh(m){return m===m&&!rr(m)}function oh(m,k){return function(R){return R==null?!1:R[m]===k&&(k!==void 0||m in Object(R))}}var bv=ha(function(m){m=wv(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 ah(m,k){return m===k||m!==m&&k!==k}function lh(m){return _v(m)&&oe.call(m,"callee")&&(!_S.call(m,"callee")||Bt.call(m)==c)}var Pn=Array.isArray;function ch(m){return m!=null&&fa(m.length)&&!uh(m)}function _v(m){return or(m)&&ch(m)}function uh(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 xv=ie?re(ie):iv;function wv(m){return m==null?"":cv(m)}function kv(m,k,R){var I=m==null?void 0:eh(m,k);return I===void 0?R:I}function Sv(m,k){return m!=null&&gv(m,k,JS)}function ar(m){return ch(m)?GS(m):rv(m)}function vv(m,k){var R={};return k=sv(k),ZS(m,function(I,nt,U){R[k(I,nt,U)]=I}),R}function Dv(m){return m}function Mv(m){return ir(m)?ge(sr(m)):lv(m)}n.exports=vv}(Zs,Zs.exports);var rk=Zs.exports;const ok=Co(rk);var ak=1/0,lk=9007199254740991,ck="[object Arguments]",uk="[object Function]",dk="[object GeneratorFunction]",hk="[object Symbol]",fk=typeof ne=="object"&&ne&&ne.Object===Object&&ne,gk=typeof self=="object"&&self&&self.Object===Object&&self,pk=fk||gk||Function("return this")();function mk(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 yk(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 bk(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,_k=sa.hasOwnProperty,ra=sa.toString,Yd=pk.Symbol,xk=sa.propertyIsEnumerable,Vd=Yd?Yd.isConcatSpreadable:void 0,jd=Math.max;function $d(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=vk),s||(s=[]);++r<o;){var a=n[r];t>0&&e(a)?t>1?$d(a,t-1,e,i,s):bk(s,a):i||(s[s.length]=a)}return s}function wk(n,t){return n=Object(n),kk(n,t,function(e,i){return i in n})}function kk(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 Sk(n,t){return t=jd(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=jd(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,mk(n,this,o)}}function vk(n){return Tk(n)||Mk(n)||!!(Vd&&n&&n[Vd])}function Dk(n){if(typeof n=="string"||Ak(n))return n;var t=n+"";return t=="0"&&1/n==-ak?"-0":t}function Mk(n){return Ok(n)&&_k.call(n,"callee")&&(!xk.call(n,"callee")||ra.call(n)==ck)}var Tk=Array.isArray;function Ck(n){return n!=null&&Ek(n.length)&&!Pk(n)}function Ok(n){return Ud(n)&&Ck(n)}function Pk(n){var t=Rk(n)?ra.call(n):"";return t==uk||t==dk}function Ek(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=lk}function Rk(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Ud(n){return!!n&&typeof n=="object"}function Ak(n){return typeof n=="symbol"||Ud(n)&&ra.call(n)==hk}var Lk=Sk(function(n,t){return n==null?{}:wk(n,yk($d(t,1),Dk))}),Ik=Lk;const Nk=Co(Ik);var qd={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})})(qd);var Fk=qd.exports,Xd={exports:{}};/* @license
28
+ */const Jv={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"};Al._date.override({_id:"date-fns",formats:function(){return Jv},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=nx(n,t,new Date,this.options):n=mu(n,this.options)),yo(n)?n.getTime():null},format:function(n,t){return du(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Bs(n,t);case"second":return Ky(n,t);case"minute":return Xy(n,t);case"hour":return $y(n,t);case"day":return Fs(n,t);case"week":return Zy(n,t);case"month":return po(n,t);case"quarter":return Gy(n,t);case"year":return Qy(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Hs(n,t);case"second":return ob(n,t);case"minute":return ib(n,t);case"hour":return nb(n,t);case"day":return Gc(n,t);case"week":return ab(n,t);case"month":return Jc(n,t);case"quarter":return rb(n,t);case"year":return lb(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return rx(n);case"minute":return cb(n);case"hour":return sx(n);case"day":return mo(n);case"week":return Pe(n);case"isoWeek":return Pe(n,{weekStartsOn:+e});case"month":return db(n);case"quarter":return ub(n);case"year":return tu(n);default:return n}},endOf:function(n,t){switch(t){case"second":return yb(n);case"minute":return pb(n);case"hour":return fb(n);case"day":return Zc(n);case"week":return gb(n);case"month":return Qc(n);case"quarter":return mb(n);case"year":return hb(n);default:return n}}});const Ud={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},tk={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Ud,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},ek=f.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function si(n){return f.isProxy(n)?f.toRaw(n):n}function nk(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return f.isProxy(t)?new Proxy(n,{}):n}function ik(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function qd(n,t){n.labels=t}function Xd(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 sk(n,t){const e={labels:[],datasets:[]};return qd(e,n.labels),Xd(e,n.datasets,t),e}const rk=f.defineComponent({props:tk,setup(n,t){let{expose:e,slots:i}=t;const s=f.ref(null),r=f.shallowRef(null);e({chart:r});const o=()=>{if(!s.value)return;const{type:c,data:u,options:d,plugins:h,datasetIdKey:g}=n,p=sk(u,g),y=nk(p,u);r.value=new pe(s.value,{type:c,data:y,options:{...d},plugins:h})},a=()=>{const c=f.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 f.onMounted(o),f.onUnmounted(a),f.watch([()=>n.options,()=>n.data],(c,u)=>{let[d,h]=c,[g,p]=u;const y=f.toRaw(r.value);if(!y)return;let x=!1;if(d){const w=si(d),v=si(g);w&&w!==v&&(ik(y,w),x=!0)}if(h){const w=si(h.labels),v=si(p.labels),S=si(h.datasets),P=si(p.datasets);w!==v&&(qd(y.config.data,w),x=!0),S&&S!==P&&(Xd(y.config.data,S,n.datasetIdKey),x=!0)}x&&f.nextTick(()=>{l(y)})},{deep:!0}),()=>f.h("canvas",{role:"img",ariaLabel:n.ariaLabel,ariaDescribedby:n.ariaDescribedby,ref:s},[f.h("p",{},[i.default?i.default():""])])}});function aa(n,t){return pe.register(t),f.defineComponent({props:Ud,setup(e,i){let{expose:s}=i;const r=f.shallowRef(null),o=a=>{r.value=a==null?void 0:a.chart};return s({chart:r}),()=>f.h(rk,ek({ref:o},{type:n,...e}))}})}const ok=aa("bar",vi),Gd=aa("doughnut",sn),ak=aa("line",ki),lk={class:"chart-container"},ck=f.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:He}},setup(n){const t=n,{translateUnit:e}=gt.useTranslatedUnits(),i=f.ref(fn()),s=f.ref(fn()),r=f.ref([]),o=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartType:$t.DOUGHNUT}),a={id:i.value,afterUpdate(y){r.value=y.options.plugins.legend.labels.generateLabels(y).map(x=>({...x,value:t.legendValues&&t.legendValues[x.text],hidden:!1}))}},l=f.computed(()=>[a]),c=f.computed(()=>[t.chartData.datasets.reduce((x,w)=>(x.labels.push(w.label),x.backgroundColor.push(w.backgroundColor),x.borderColor.push(ku(w.backgroundColor,50)),x.data.push(w.data.reduce((v,S)=>v+S,0)),x),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),u=f.computed(()=>({...t.chartData,datasets:c.value}));gt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const{options:d}=gt.useDoughnutChartOptions({tooltipState:o,legendID:i.value}),h=f.ref(),g=y=>({[Ot.Right]:"legend-row",[Ot.Bottom]:"column",[Ot.Hidden]:"hidden"})[y],p=({width:y,height:x})=>{o.width=y,o.height=x};return(y,x)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",g(n.legendPosition)]),"data-testid":"doughnut-chart-parent"},[f.createElementVNode("div",lk,[f.createVNode(f.unref(Gd),{ref_key:"chartInstance",ref:h,"chart-id":s.value,data:u.value,options:f.unref(d),plugins:l.value},null,8,["chart-id","data","options","plugins"]),f.createVNode(ra,{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"])]),f.createVNode(oa,{id:i.value,"chart-instance":h.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),uk=Ye(ck,[["__scopeId","data-v-07ea8b82"]]),Kd=(n,t,e,i)=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle="#0275d8",n.stroke(),n.restore()},la={id:"linePlugin",afterDatasetsDraw:function(n){if(n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&!this.clickedSegment){const{x:t}=n.tooltip.dataPoints[0].element,e=n.ctx;Kd(e,t,n.scales.y.top,n.scales.y.bottom)}if(this.clickedSegment){const{x:t}=this.clickedSegment.element,e=n.ctx;Kd(e,t,n.scales.y.top,n.scales.y.bottom)}},beforeDestroy(){delete this.clickedSegment}},dk=f.defineComponent({__name:"TimeSeriesChart",props:{chartData:{type:Object,required:!1,default:null},type:{type:String,required:!1,default:$t.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}=gt.useTranslatedUnits(),i=f.ref(),s=f.ref(fn()),r=f.ref(fn()),o=f.ref([]),a=f.ref(),l=f.ref(f.inject("legendPosition",Ot.Right)),c=f.reactive({showTooltip:!1,tooltipContext:"",tooltipSeries:[],left:"",top:"",units:f.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(v=>({...v,value:t.legendValues&&t.legendValues[v.text]})).sort(t.chartLegendSortFn)}},d=f.computed(()=>[u,Vd,...t.type===$t.TIMESERIES_LINE?[la]:[]]),{options:h}=gt.useLinechartOptions({tooltipState:c,timeRangeMs:f.toRef(t,"timeRangeMs"),granularity:f.toRef(t,"granularity"),legendID:s.value,stacked:f.toRef(t,"stacked"),metricAxesTitle:f.toRef(t,"metricAxesTitle"),dimensionAxesTitle:f.toRef(t,"dimensionAxesTitle")});gt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const g=w=>Ho(w,{short:["daily","weekly"].includes(t.granularity)}),p=w=>({[Ot.Right]:"legend-row",[Ot.Bottom]:"column",[Ot.Hidden]:"hidden"})[w],y=({width:w,height:v})=>{c.width=w,c.height=v},x=()=>{var w,v,S;c.locked=!c.locked,i.value&&((v=(w=i.value.chart.tooltip)==null?void 0:w.dataPoints)!=null&&v.length)&&(la.clickedSegment=c.locked?(S=i.value.chart.tooltip)==null?void 0:S.dataPoints[0]:void 0)};return f.watch(()=>t.type,()=>{c.locked=!1,c.showTooltip=!1,delete la.clickedSegment}),(w,v)=>(f.openBlock(),f.createElementBlock("div",{class:f.normalizeClass(["chart-parent",p(l.value)]),"data-testid":"line-chart-parent"},[f.createElementVNode("div",{class:"chart-container",onClick:v[0]||(v[0]=S=>x())},[n.type===f.unref($t).TIMESERIES_LINE?(f.openBlock(),f.createBlock(f.unref(ak),{key:0,ref_key:"chartInstance",ref:i,"chart-id":r.value,data:n.chartData,"data-testid":"time-series-line-chart",options:f.unref(h),plugins:d.value},null,8,["chart-id","data","options","plugins"])):n.type===f.unref($t).TIMESERIES_BAR?(f.openBlock(),f.createBlock(f.unref(ok),{key:1,ref_key:"chartInstance",ref:i,"chart-id":r.value,data:n.chartData,"data-testid":"time-series-bar-chart",options:f.unref(h),plugins:d.value},null,8,["chart-id","data","options","plugins"])):f.createCommentVNode("",!0)]),f.createVNode(ra,{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:v[1]||(v[1]=S=>c.left=S),onTop:v[2]||(v[2]=S=>c.top=S)},null,8,["context","left","locked","series","show-tooltip","tooltip-title","top","unit"]),f.createVNode(oa,{id:s.value,"chart-instance":i.value,"data-testid":"legend",items:o.value},null,8,["id","chart-instance","items"])],2))}}),hk=Ye(dk,[["__scopeId","data-v-ee0f32c2"]]);var An=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(An||{}),ar={exports:{}};ar.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]",h="[object Date]",g="[object Error]",p="[object Function]",y="[object GeneratorFunction]",x="[object Map]",w="[object Number]",v="[object Object]",S="[object Promise]",P="[object RegExp]",D="[object Set]",C="[object String]",T="[object Symbol]",b="[object WeakMap]",_="[object ArrayBuffer]",M="[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]",Lt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,vt=/^\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[_]=Y[d]=Y[M]=Y[h]=Y[g]=Y[p]=Y[x]=Y[w]=Y[v]=Y[P]=Y[D]=Y[C]=Y[b]=!1;var W=typeof se=="object"&&se&&se.Object===Object&&se,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,Wt=lt&&lt.exports===kt,Dt=Wt&&W.process,mt=function(){try{return Dt&&Dt.binding("util")}catch{}}(),re=mt&&mt.isTypedArray;function oe(m,k){for(var R=-1,I=m?m.length:0;++R<I;)if(k(m[R],R,m))return!0;return!1}function me(m){return function(k){return k==null?void 0:k[m]}}function ke(m,k){for(var R=-1,I=Array(m);++R<m;)I[R]=k(R);return I}function ae(m){return function(k){return m(k)}}function St(m,k){return m==null?void 0:m[k]}function Tt(m){var k=!1;if(m!=null&&typeof m.toString!="function")try{k=!!(m+"")}catch{}return k}function Ve(m){var k=-1,R=Array(m.size);return m.forEach(function(I,nt){R[++k]=[nt,I]}),R}function pt(m,k){return function(R){return m(k(R))}}function pn(m){var k=-1,R=Array(m.size);return m.forEach(function(I){R[++k]=I}),R}var Se=Array.prototype,je=Function.prototype,he=Object.prototype,ye=X["__core-js_shared__"],Me=function(){var m=/[^.]+$/.exec(ye&&ye.keys&&ye.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""}(),Qt=je.toString,le=he.hasOwnProperty,zt=he.toString,cr=RegExp("^"+Qt.call(le).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),oi=X.Symbol,vh=X.Uint8Array,JS=he.propertyIsEnumerable,tM=Se.splice,eM=pt(Object.keys,Object),ya=ai(X,"DataView"),ts=ai(X,"Map"),ba=ai(X,"Promise"),xa=ai(X,"Set"),_a=ai(X,"WeakMap"),es=ai(Object,"create"),nM=In(ya),iM=In(ts),sM=In(ba),rM=In(xa),oM=In(_a),ur=oi?oi.prototype:void 0,wa=ur?ur.valueOf:void 0,kh=ur?ur.toString:void 0;function Ln(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 aM(){this.__data__=es?es(null):{}}function lM(m){return this.has(m)&&delete this.__data__[m]}function cM(m){var k=this.__data__;if(es){var R=k[m];return R===s?void 0:R}return le.call(k,m)?k[m]:void 0}function uM(m){var k=this.__data__;return es?k[m]!==void 0:le.call(k,m)}function dM(m,k){var R=this.__data__;return R[m]=es&&k===void 0?s:k,this}Ln.prototype.clear=aM,Ln.prototype.delete=lM,Ln.prototype.get=cM,Ln.prototype.has=uM,Ln.prototype.set=dM;function $e(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 hM(){this.__data__=[]}function fM(m){var k=this.__data__,R=hr(k,m);if(R<0)return!1;var I=k.length-1;return R==I?k.pop():tM.call(k,R,1),!0}function gM(m){var k=this.__data__,R=hr(k,m);return R<0?void 0:k[R][1]}function pM(m){return hr(this.__data__,m)>-1}function mM(m,k){var R=this.__data__,I=hr(R,m);return I<0?R.push([m,k]):R[I][1]=k,this}$e.prototype.clear=hM,$e.prototype.delete=fM,$e.prototype.get=gM,$e.prototype.has=pM,$e.prototype.set=mM;function Ue(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 yM(){this.__data__={hash:new Ln,map:new(ts||$e),string:new Ln}}function bM(m){return fr(this,m).delete(m)}function xM(m){return fr(this,m).get(m)}function _M(m){return fr(this,m).has(m)}function wM(m,k){return fr(this,m).set(m,k),this}Ue.prototype.clear=yM,Ue.prototype.delete=bM,Ue.prototype.get=xM,Ue.prototype.has=_M,Ue.prototype.set=wM;function dr(m){var k=-1,R=m?m.length:0;for(this.__data__=new Ue;++k<R;)this.add(m[k])}function vM(m){return this.__data__.set(m,s),this}function kM(m){return this.__data__.has(m)}dr.prototype.add=dr.prototype.push=vM,dr.prototype.has=kM;function qe(m){this.__data__=new $e(m)}function SM(){this.__data__=new $e}function MM(m){return this.__data__.delete(m)}function DM(m){return this.__data__.get(m)}function TM(m){return this.__data__.has(m)}function CM(m,k){var R=this.__data__;if(R instanceof $e){var I=R.__data__;if(!ts||I.length<e-1)return I.push([m,k]),this;R=this.__data__=new Ue(I)}return R.set(m,k),this}qe.prototype.clear=SM,qe.prototype.delete=MM,qe.prototype.get=DM,qe.prototype.has=TM,qe.prototype.set=CM;function PM(m,k){var R=Nn(m)||Eh(m)?ke(m.length,String):[],I=R.length,nt=!!I;for(var U in m)(k||le.call(m,U))&&!(nt&&(U=="length"||Th(U,I)))&&R.push(U);return R}function hr(m,k){for(var R=m.length;R--;)if(Oh(m[R][0],k))return R;return-1}var OM=jM();function EM(m,k){return m&&OM(m,k,br)}function Sh(m,k){k=gr(k,m)?[k]:Mh(k);for(var R=0,I=k.length;m!=null&&R<I;)m=m[pr(k[R++])];return R&&R==I?m:void 0}function RM(m){return zt.call(m)}function AM(m,k){return m!=null&&k in Object(m)}function va(m,k,R,I,nt){return m===k?!0:m==null||k==null||!mr(m)&&!yr(k)?m!==m&&k!==k:LM(m,k,va,R,I,nt)}function LM(m,k,R,I,nt,U){var ct=Nn(m),bt=Nn(k),Rt=u,Yt=u;ct||(Rt=mn(m),Rt=Rt==c?v:Rt),bt||(Yt=mn(k),Yt=Yt==c?v:Yt);var Jt=Rt==v&&!Tt(m),ce=Yt==v&&!Tt(k),Vt=Rt==Yt;if(Vt&&!Jt)return U||(U=new qe),ct||tD(m)?Dh(m,k,R,I,nt,U):$M(m,k,Rt,R,I,nt,U);if(!(nt&o)){var be=Jt&&le.call(m,"__wrapped__"),xe=ce&&le.call(k,"__wrapped__");if(be||xe){var yn=be?m.value():m,Xe=xe?k.value():k;return U||(U=new qe),R(yn,Xe,I,nt,U)}}return Vt?(U||(U=new qe),UM(m,k,R,I,nt,U)):!1}function IM(m,k,R,I){var nt=R.length,U=nt,ct=!I;if(m==null)return!U;for(m=Object(m);nt--;){var bt=R[nt];if(ct&&bt[2]?bt[1]!==m[bt[0]]:!(bt[0]in m))return!1}for(;++nt<U;){bt=R[nt];var Rt=bt[0],Yt=m[Rt],Jt=bt[1];if(ct&&bt[2]){if(Yt===void 0&&!(Rt in m))return!1}else{var ce=new qe;if(I)var Vt=I(Yt,Jt,Rt,m,k,ce);if(!(Vt===void 0?va(Jt,Yt,I,r|o,ce):Vt))return!1}}return!0}function NM(m){if(!mr(m)||KM(m))return!1;var k=Ah(m)||Tt(m)?cr:q;return k.test(In(m))}function FM(m){return yr(m)&&Sa(m.length)&&!!Y[zt.call(m)]}function BM(m){return typeof m=="function"?m:m==null?rD:typeof m=="object"?Nn(m)?WM(m[0],m[1]):HM(m):oD(m)}function zM(m){if(!ZM(m))return eM(m);var k=[];for(var R in Object(m))le.call(m,R)&&R!="constructor"&&k.push(R);return k}function HM(m){var k=qM(m);return k.length==1&&k[0][2]?Ph(k[0][0],k[0][1]):function(R){return R===m||IM(R,m,k)}}function WM(m,k){return gr(m)&&Ch(k)?Ph(pr(m),k):function(R){var I=nD(R,m);return I===void 0&&I===k?iD(R,m):va(k,I,void 0,r|o)}}function YM(m){return function(k){return Sh(k,m)}}function VM(m){if(typeof m=="string")return m;if(Ma(m))return kh?kh.call(m):"";var k=m+"";return k=="0"&&1/m==-a?"-0":k}function Mh(m){return Nn(m)?m:QM(m)}function jM(m){return function(k,R,I){for(var nt=-1,U=Object(k),ct=I(k),bt=ct.length;bt--;){var Rt=ct[m?bt:++nt];if(R(U[Rt],Rt,U)===!1)break}return k}}function Dh(m,k,R,I,nt,U){var ct=nt&o,bt=m.length,Rt=k.length;if(bt!=Rt&&!(ct&&Rt>bt))return!1;var Yt=U.get(m);if(Yt&&U.get(k))return Yt==k;var Jt=-1,ce=!0,Vt=nt&r?new dr:void 0;for(U.set(m,k),U.set(k,m);++Jt<bt;){var be=m[Jt],xe=k[Jt];if(I)var yn=ct?I(xe,be,Jt,k,m,U):I(be,xe,Jt,m,k,U);if(yn!==void 0){if(yn)continue;ce=!1;break}if(Vt){if(!oe(k,function(Xe,Fn){if(!Vt.has(Fn)&&(be===Xe||R(be,Xe,I,nt,U)))return Vt.add(Fn)})){ce=!1;break}}else if(!(be===xe||R(be,xe,I,nt,U))){ce=!1;break}}return U.delete(m),U.delete(k),ce}function $M(m,k,R,I,nt,U,ct){switch(R){case M:if(m.byteLength!=k.byteLength||m.byteOffset!=k.byteOffset)return!1;m=m.buffer,k=k.buffer;case _:return!(m.byteLength!=k.byteLength||!I(new vh(m),new vh(k)));case d:case h:case w:return Oh(+m,+k);case g:return m.name==k.name&&m.message==k.message;case P:case C:return m==k+"";case x:var bt=Ve;case D:var Rt=U&o;if(bt||(bt=pn),m.size!=k.size&&!Rt)return!1;var Yt=ct.get(m);if(Yt)return Yt==k;U|=r,ct.set(m,k);var Jt=Dh(bt(m),bt(k),I,nt,U,ct);return ct.delete(m),Jt;case T:if(wa)return wa.call(m)==wa.call(k)}return!1}function UM(m,k,R,I,nt,U){var ct=nt&o,bt=br(m),Rt=bt.length,Yt=br(k),Jt=Yt.length;if(Rt!=Jt&&!ct)return!1;for(var ce=Rt;ce--;){var Vt=bt[ce];if(!(ct?Vt in k:le.call(k,Vt)))return!1}var be=U.get(m);if(be&&U.get(k))return be==k;var xe=!0;U.set(m,k),U.set(k,m);for(var yn=ct;++ce<Rt;){Vt=bt[ce];var Xe=m[Vt],Fn=k[Vt];if(I)var Lh=ct?I(Fn,Xe,Vt,k,m,U):I(Xe,Fn,Vt,m,k,U);if(!(Lh===void 0?Xe===Fn||R(Xe,Fn,I,nt,U):Lh)){xe=!1;break}yn||(yn=Vt=="constructor")}if(xe&&!yn){var xr=m.constructor,_r=k.constructor;xr!=_r&&"constructor"in m&&"constructor"in k&&!(typeof xr=="function"&&xr instanceof xr&&typeof _r=="function"&&_r instanceof _r)&&(xe=!1)}return U.delete(m),U.delete(k),xe}function fr(m,k){var R=m.__data__;return GM(k)?R[typeof k=="string"?"string":"hash"]:R.map}function qM(m){for(var k=br(m),R=k.length;R--;){var I=k[R],nt=m[I];k[R]=[I,nt,Ch(nt)]}return k}function ai(m,k){var R=St(m,k);return NM(R)?R:void 0}var mn=RM;(ya&&mn(new ya(new ArrayBuffer(1)))!=M||ts&&mn(new ts)!=x||ba&&mn(ba.resolve())!=S||xa&&mn(new xa)!=D||_a&&mn(new _a)!=b)&&(mn=function(m){var k=zt.call(m),R=k==v?m.constructor:void 0,I=R?In(R):void 0;if(I)switch(I){case nM:return M;case iM:return x;case sM:return S;case rM:return D;case oM:return b}return k});function XM(m,k,R){k=gr(k,m)?[k]:Mh(k);for(var I,nt=-1,ct=k.length;++nt<ct;){var U=pr(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&&Sa(ct)&&Th(U,ct)&&(Nn(m)||Eh(m))}function Th(m,k){return k=k??l,!!k&&(typeof m=="number"||Q.test(m))&&m>-1&&m%1==0&&m<k}function gr(m,k){if(Nn(m))return!1;var R=typeof m;return R=="number"||R=="symbol"||R=="boolean"||m==null||Ma(m)?!0:vt.test(m)||!Lt.test(m)||k!=null&&m in Object(k)}function GM(m){var k=typeof m;return k=="string"||k=="number"||k=="symbol"||k=="boolean"?m!=="__proto__":m===null}function KM(m){return!!Me&&Me in m}function ZM(m){var k=m&&m.constructor,R=typeof k=="function"&&k.prototype||he;return m===R}function Ch(m){return m===m&&!mr(m)}function Ph(m,k){return function(R){return R==null?!1:R[m]===k&&(k!==void 0||m in Object(R))}}var QM=ka(function(m){m=eD(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 pr(m){if(typeof m=="string"||Ma(m))return m;var k=m+"";return k=="0"&&1/m==-a?"-0":k}function In(m){if(m!=null){try{return Qt.call(m)}catch{}try{return m+""}catch{}}return""}function ka(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(ka.Cache||Ue),R}ka.Cache=Ue;function Oh(m,k){return m===k||m!==m&&k!==k}function Eh(m){return JM(m)&&le.call(m,"callee")&&(!JS.call(m,"callee")||zt.call(m)==c)}var Nn=Array.isArray;function Rh(m){return m!=null&&Sa(m.length)&&!Ah(m)}function JM(m){return yr(m)&&Rh(m)}function Ah(m){var k=mr(m)?zt.call(m):"";return k==p||k==y}function Sa(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=l}function mr(m){var k=typeof m;return!!m&&(k=="object"||k=="function")}function yr(m){return!!m&&typeof m=="object"}function Ma(m){return typeof m=="symbol"||yr(m)&&zt.call(m)==T}var tD=re?ae(re):FM;function eD(m){return m==null?"":VM(m)}function nD(m,k,R){var I=m==null?void 0:Sh(m,k);return I===void 0?R:I}function iD(m,k){return m!=null&&XM(m,k,AM)}function br(m){return Rh(m)?PM(m):zM(m)}function sD(m,k){var R={};return k=BM(k),EM(m,function(I,nt,U){R[k(I,nt,U)]=I}),R}function rD(m){return m}function oD(m){return gr(m)?me(pr(m)):YM(m)}n.exports=sD}(ar,ar.exports);var fk=ar.exports;const gk=Eo(fk);var pk=1/0,mk=9007199254740991,yk="[object Arguments]",bk="[object Function]",xk="[object GeneratorFunction]",_k="[object Symbol]",wk=typeof se=="object"&&se&&se.Object===Object&&se,vk=typeof self=="object"&&self&&self.Object===Object&&self,kk=wk||vk||Function("return this")();function Sk(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 Mk(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 Dk(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var ca=Object.prototype,Tk=ca.hasOwnProperty,ua=ca.toString,Zd=kk.Symbol,Ck=ca.propertyIsEnumerable,Qd=Zd?Zd.isConcatSpreadable:void 0,Jd=Math.max;function th(n,t,e,i,s){var r=-1,o=n.length;for(e||(e=Rk),s||(s=[]);++r<o;){var a=n[r];t>0&&e(a)?t>1?th(a,t-1,e,i,s):Dk(s,a):i||(s[s.length]=a)}return s}function Pk(n,t){return n=Object(n),Ok(n,t,function(e,i){return i in n})}function Ok(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 Ek(n,t){return t=Jd(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Jd(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,Sk(n,this,o)}}function Rk(n){return Ik(n)||Lk(n)||!!(Qd&&n&&n[Qd])}function Ak(n){if(typeof n=="string"||Wk(n))return n;var t=n+"";return t=="0"&&1/n==-pk?"-0":t}function Lk(n){return Fk(n)&&Tk.call(n,"callee")&&(!Ck.call(n,"callee")||ua.call(n)==yk)}var Ik=Array.isArray;function Nk(n){return n!=null&&zk(n.length)&&!Bk(n)}function Fk(n){return eh(n)&&Nk(n)}function Bk(n){var t=Hk(n)?ua.call(n):"";return t==bk||t==xk}function zk(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=mk}function Hk(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function eh(n){return!!n&&typeof n=="object"}function Wk(n){return typeof n=="symbol"||eh(n)&&ua.call(n)==_k}var Yk=Ek(function(n,t){return n==null?{}:Pk(n,Mk(th(t,1),Ak))}),Vk=Yk;const jk=Eo(Vk);var nh={exports:{}};(function(n,t){(function(e,i){i()})(se,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 h=new XMLHttpRequest;h.open("GET",c),h.responseType="blob",h.onload=function(){l(h.response,u,d)},h.onerror=function(){console.error("could not download file")},h.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 se=="object"&&se.global===se?se: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 h=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=h.createObjectURL(c),setTimeout(function(){h.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 h=document.createElement("a");h.href=c,h.target="_blank",setTimeout(function(){r(h)})}}:function(c,u,d,h){if(h=h||open("","_blank"),h&&(h.document.title=h.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 x=new FileReader;x.onloadend=function(){var S=x.result;S=y?S:S.replace(/^data:[^;]*;/,"data:attachment/file;"),h?h.location.href=S:location=S,h=null},x.readAsDataURL(c)}else{var w=o.URL||o.webkitURL,v=w.createObjectURL(c);h?h.location=v:location.href=v,h=null,setTimeout(function(){w.revokeObjectURL(v)},4e4)}});o.saveAs=l.saveAs=l,n.exports=l})})(nh);var $k=nh.exports,ih={exports:{}};/* @license
29
29
  Papa Parse
30
30
  v5.4.1
31
31
  https://github.com/mholt/PapaParse
32
32
  License: MIT
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!==`
33
+ */(function(n,t){(function(e,i){n.exports=i()})(se,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,_){var M=(_=_||{}).dynamicTyping||!1;if(T(M)&&(_.dynamicTypingFunction=M,M={}),_.dynamicTyping=M,_.transform=!!T(_.transform)&&_.transform,_.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=v,$.id=a++,o[$.id]=$}();return E.userStep=_.step,E.userChunk=_.chunk,E.userComplete=_.complete,E.userError=_.error,_.step=T(_.step),_.chunk=T(_.chunk),_.complete=T(_.complete),_.error=T(_.error),delete _.worker,void E.postMessage({input:b,config:_,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=_.download?new d(_):new g(_)):b.readable===!0&&T(b.read)&&T(b.on)?A=new p(_):(i.File&&b instanceof File||b instanceof Object)&&(A=new h(_)),A.stream(b)},unparse:function(b,_){var M=!1,E=!0,A=",",F=`\r
34
+ `,$='"',K=$+$,j=!1,N=null,st=!1;(function(){if(typeof _=="object"){if(typeof _.delimiter!="string"||l.BAD_DELIMITERS.filter(function(H){return _.delimiter.indexOf(H)!==-1}).length||(A=_.delimiter),(typeof _.quotes=="boolean"||typeof _.quotes=="function"||Array.isArray(_.quotes))&&(M=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(j=_.skipEmptyLines),typeof _.newline=="string"&&(F=_.newline),typeof _.quoteChar=="string"&&($=_.quoteChar),typeof _.header=="boolean"&&(E=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");N=_.columns}_.escapeChar!==void 0&&(K=_.escapeChar+$),(typeof _.escapeFormulae=="boolean"||_.escapeFormulae instanceof RegExp)&&(st=_.escapeFormulae instanceof RegExp?_.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var B=new RegExp(x($),"g");if(typeof b=="string"&&(b=JSON.parse(b)),Array.isArray(b)){if(!b.length||Array.isArray(b[0]))return Lt(null,b,j);if(typeof b[0]=="object")return Lt(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])),Lt(b.fields||[],b.data||[],j);throw new Error("Unable to serialize unrecognized input");function Lt(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+=vt(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=[],Wt=0;Wt<et;Wt++){var Dt=Q?H[Wt]:Wt;lt.push(L[W][Dt])}X=lt.join("").trim()===""}if(!X){for(var mt=0;mt<et;mt++){0<mt&&!kt&&(V+=A);var re=q&&Q?H[mt]:mt;V+=vt(L[W][re],mt)}W<L.length-1&&(!z||0<et&&!kt)&&(V+=F)}}return V}function vt(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||M===!0||typeof M=="function"&&M(H,L)||Array.isArray(M)&&M[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=h,l.StringStreamer=g,l.ReadableStreamStreamer=p,i.jQuery){var c=i.jQuery;c.fn.parse=function(b){var _=b.config||{},M=[];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;$++)M.push({file:this.files[$],inputElem:this,instanceConfig:c.extend({},_)})}),E(),this;function E(){if(M.length!==0){var F,$,K,j,N=M[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(Lt){T(B)&&B(Lt,N.file,N.inputElem),A()},l.parse(N.file,N.instanceConfig)}else T(b.complete)&&b.complete()}function A(){M.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(_){var M=D(_);M.chunkSize=parseInt(M.chunkSize),_.step||_.chunk||(M.chunkSize=null),this._handle=new y(M),(this._handle.streamer=this)._config=M}).call(this,b),this.parseChunk=function(_,M){if(this.isFirstChunk&&T(this._config.beforeFirstChunk)){var E=this._config.beforeFirstChunk(_);E!==void 0&&(_=E)}this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+_;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)&&!M){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(_){T(this._config.error)?this._config.error(_):r&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:_,finished:!1})}}function d(b){var _;(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(M){this._input=M,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),s||(_.onload=C(this._chunkLoaded,this),_.onerror=C(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var M=this._config.downloadRequestHeaders;for(var E in M)_.setRequestHeader(E,M[E])}if(this._config.chunkSize){var A=this._start+this._config.chunkSize-1;_.setRequestHeader("Range","bytes="+this._start+"-"+A)}try{_.send(this._config.downloadRequestBody)}catch(F){this._chunkError(F.message)}s&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:_.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(M){var E=M.getResponseHeader("Content-Range");return E===null?-1:parseInt(E.substring(E.lastIndexOf("/")+1))}(_),this.parseChunk(_.responseText)))},this._chunkError=function(M){var E=_.statusText||M;this._sendError(new Error(E))}}function h(b){var _,M;(b=b||{}).chunkSize||(b.chunkSize=l.LocalChunkSize),u.call(this,b);var E=typeof FileReader<"u";this.stream=function(A){this._input=A,M=A.slice||A.webkitSlice||A.mozSlice,E?((_=new FileReader).onload=C(this._chunkLoaded,this),_.onerror=C(this._chunkError,this)):_=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=M.call(A,this._start,F)}var $=_.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(_.error)}}function g(b){var _;u.call(this,b=b||{}),this.stream=function(M){return _=M,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var M,E=this._config.chunkSize;return E?(M=_.substring(0,E),_=_.substring(E)):(M=_,_=""),this._finished=!_,this.parseChunk(M)}}}function p(b){u.call(this,b=b||{});var _=[],M=!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&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):M=!0},this._streamData=C(function(A){try{_.push(typeof A=="string"?A:A.toString(this._config.encoding)),M&&(M=!1,this._checkIsFinished(),this.parseChunk(_.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 _,M,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,Lt=!1,vt=[],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?M.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)),vt.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,Wt=b.header?{}:[];for(lt=0;lt<X.length;lt++){var Dt=lt,mt=X[lt];b.header&&(Dt=lt>=vt.length?"__parsed_extra":vt[lt]),b.transform&&(mt=b.transform(mt,Dt)),mt=Q(Dt,mt),Dt==="__parsed_extra"?(Wt[Dt]=Wt[Dt]||[],Wt[Dt].push(mt)):Wt[Dt]=mt}return b.header&&(lt>vt.length?Y("FieldMismatch","TooManyFields","Too many fields: expected "+vt.length+" fields but parsed "+lt,st+kt):lt<vt.length&&Y("FieldMismatch","TooFewFields","Too few fields: expected "+vt.length+" fields but parsed "+lt,st+kt)),Wt}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=vt),st+=et,H}()}function q(){return b.header&&vt.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,mt){Dt=Dt.substring(0,1048576);var re=new RegExp(x(mt)+"([^]*?)"+x(mt),"gm"),oe=(Dt=Dt.replace(re,"")).split("\r"),me=Dt.split(`
36
+ `),ke=1<me.length&&me[0].length<oe[0].length;if(oe.length===1||ke)return`
37
+ `;for(var ae=0,St=0;St<oe.length;St++)oe[St][0]===`
38
+ `&&ae++;return ae>=oe.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,mt,re,oe,me){var ke,ae,St,Tt;me=me||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var Ve=0;Ve<me.length;Ve++){var pt=me[Ve],pn=0,Se=0,je=0;St=void 0;for(var he=new w({comments:oe,delimiter:pt,newline:mt,preview:10}).parse(Dt),ye=0;ye<he.data.length;ye++)if(re&&z(he.data[ye]))je++;else{var Me=he.data[ye].length;Se+=Me,St!==void 0?0<Me&&(pn+=Math.abs(Me-St),St=Me):St=Me}0<he.data.length&&(Se/=he.data.length-je),(ae===void 0||pn<=ae)&&(Tt===void 0||Tt<Se)&&1.99<Se&&(ae=pn,ke=pt,Tt=Se)}return{successful:!!(b.delimiter=ke),bestDelimiter:ke}}(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 Wt=D(b);return b.preview&&b.header&&Wt.preview++,_=W,M=new w(Wt),H=M.parse(_,et,X),V(),B?{meta:{paused:!0}}:H||{meta:{paused:!1}}},this.paused=function(){return B},this.pause=function(){B=!0,M.abort(),_=T(b.chunk)?"":_.substring(M.getCharIndex())},this.resume=function(){j.streamer._halted?(B=!1,j.streamer.parseChunk(_,!0)):setTimeout(j.resume,3)},this.aborted=function(){return Lt},this.abort=function(){Lt=!0,M.abort(),H.meta.aborted=!0,T(b.complete)&&b.complete(H),_=""}}function x(b){return b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(b){var _,M=(b=b||{}).delimiter,E=b.newline,A=b.comments,F=b.step,$=b.preview,K=b.fastMode,j=_=b.quoteChar===void 0||b.quoteChar===null?'"':b.quoteChar;if(b.escapeChar!==void 0&&(j=b.escapeChar),(typeof M!="string"||-1<l.BAD_DELIMITERS.indexOf(M))&&(M=","),A===M)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<l.BAD_DELIMITERS.indexOf(A))&&(A=!1),E!==`
40
40
  `&&E!=="\r"&&E!==`\r
41
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})})(Xd);var Bk=Xd.exports;const zk=["id"],Hk=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=>ok(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=>Nk(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=Bk.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});Fk.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,zk))}}),Wk=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(Hk,{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"])]))}}),Yk={class:"kong-ui-public-csv-export-modal"},Vk={key:0,class:"selected-range"},jk={key:1,class:"text-muted",tag:"span"},Gd=3,Kd=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(Gd,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,Gd)}};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",Yk,[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",Vk,[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",jk,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(Wk,{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"])])}}}),Zd=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(Kd,{key:0,"chart-data":n.data,filename:i.value,onToggleModal:r},null,8,["chart-data","filename"])):h.createCommentVNode("",!0)],64)}}}),$k={class:"analytics-chart-shell"},Uk={key:0,class:"chart-header"},qk={key:0,class:"chart-title"},Xk={class:"chart-header-icons-wrapper"},Gk={key:1,class:"chart-export-button"},Kk={key:2,class:"analytics-chart-parent"},Zk=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?i_(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",$k,[C.value?(h.openBlock(),h.createElementBlock("div",Uk,[n.chartTitle?(h.openBlock(),h.createElementBlock("div",qk,h.toDisplayString(n.chartTitle),1)):h.createCommentVNode("",!0),h.createElementVNode("div",Xk,[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(Pw)})`,decorative:"",size:h.unref(Ew)},null,8,["color","size"])]),_:1})):h.createCommentVNode("",!0)]),n.allowCsvExport&&M.value?(h.openBlock(),h.createElementBlock("div",Gk,[h.createVNode(Zd,{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",Kk,[g.value?(h.openBlock(),h.createBlock(sk,{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(n1,{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(g1,{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}))])}}}),Qk=Be(Zk,[["__scopeId","data-v-cb8778ab"]]),Jk={class:"chart-parent","data-testid":"doughnut-chart-parent"},tS={class:"chart-totals-flex"},eS={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},nS=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",Jk,[h.createElementVNode("div",tS,[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",eS,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)]))}}),iS=Be(nS,[["__scopeId","data-v-18bc031c"]]),sS={class:"simple-chart-shell"},rS={key:1,class:"analytics-chart-parent"},oS=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",sS,[a.value?(h.openBlock(),h.createElementBlock("div",rS,[r.value?(h.openBlock(),h.createBlock(iS,{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"]]),aS={class:"top-n-card-title","data-testid":"top-n-card-title"},lS={class:"top-n-card-description","data-testid":"top-n-card-description"},cS={key:3,class:"top-n-table","data-testid":"top-n-table"},uS={class:"table-headings"},dS={class:"table-row"},hS={class:"column-1"},fS={class:"column-2"},gS={class:"table-body","data-testid":"top-n-data"},pS=["data-testid"],mS={class:"column-1"},yS={class:"column-2"},bS=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",cS,[h.createElementVNode("div",uS,[h.createElementVNode("div",dS,[h.createElementVNode("div",hS,h.toDisplayString(h.unref(e).t("topNTable.nameLabel")),1),h.createElementVNode("div",fS,h.toDisplayString(l.value),1)])]),h.createElementVNode("div",gS,[(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",mS,[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",yS,"   "+h.toDisplayString(g(v)),1)],8,pS))),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",aS,h.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:h.withCtx(()=>[h.createElementVNode("div",lS,h.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-50809fdb"]]);J.AnalyticsChart=Qk,J.ChartLegendPosition=Ot,J.ChartMetricDisplay=Yn,J.ChartTypes=jt,J.ChartTypesSimple=As,J.CsvExportButton=Zd,J.CsvExportModal=Kd,J.DECIMAL_DISPLAY=wu,J.FONT_SIZE_REGULAR=Su,J.FONT_SIZE_SMALL=ku,J.MAX_LABEL_LENGTH=Fs,J.OTHERS_COLOR=N_,J.SimpleChart=oS,J.TopNTable=bS,J.ValidType=Tn,J.accessibleGrey=Mu,J.apiRequestStatusCodeColors=Tu,J.codesInSpec=Eu,J.darkenColor=Du,J.datavisPalette=Fe,J.defaultStatusCodeColors=Bs,J.errorRateColors=L_,J.formatTime=Ns,J.latencyColors=I_,J.lightGrey=Mo,J.lookupColor=F_,J.lookupDatavisColor=jn,J.lookupStatusCodeCategoryColor=j_,J.lookupStatusCodeColor=To,J.numberFormatter=Is,J.statusCodeBadgeBackgroundColor=R_,J.trafficColors=A_,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});
42
+ `);var N=0,st=!1;this.parse=function(B,Lt,vt){if(typeof B!="string")throw new Error("Input must be a string");var H=B.length,L=M.length,z=E.length,V=A.length,q=T(F),Q=[],Y=[],W=[],et=N=0;if(!B)return Qt();if(b.header&&!Lt){var X=B.split(E)[0].split(M),kt=[],lt={},Wt=!1;for(var Dt in X){var mt=X[Dt];T(b.transformHeader)&&(mt=b.transformHeader(mt,Dt));var re=mt,oe=lt[mt]||0;for(0<oe&&(Wt=!0,re=mt+"_"+oe),lt[mt]=oe+1;kt.includes(re);)re=re+"_"+oe;kt.push(re)}if(Wt){var me=B.split(E);me[0]=kt.join(M),B=me.join(E)}}if(K||K!==!1&&B.indexOf(_)===-1){for(var ke=B.split(E),ae=0;ae<ke.length;ae++){if(W=ke[ae],N+=W.length,ae!==ke.length-1)N+=E.length;else if(vt)return Qt();if(!A||W.substring(0,V)!==A){if(q){if(Q=[],je(W.split(M)),le(),st)return Qt()}else je(W.split(M));if($&&$<=ae)return Q=Q.slice(0,$),Qt(!0)}}return Qt()}for(var St=B.indexOf(M,N),Tt=B.indexOf(E,N),Ve=new RegExp(x(j)+x(_),"g"),pt=B.indexOf(_,N);;)if(B[N]!==_)if(A&&W.length===0&&B.substring(N,N+V)===A){if(Tt===-1)return Qt();N=Tt+z,Tt=B.indexOf(E,N),St=B.indexOf(M,N)}else if(St!==-1&&(St<Tt||Tt===-1))W.push(B.substring(N,St)),N=St+L,St=B.indexOf(M,N);else{if(Tt===-1)break;if(W.push(B.substring(N,Tt)),Me(Tt+z),q&&(le(),st))return Qt();if($&&Q.length>=$)return Qt(!0)}else for(pt=N,N++;;){if((pt=B.indexOf(_,pt+1))===-1)return vt||Y.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:Q.length,index:N}),ye();if(pt===H-1)return ye(B.substring(N,pt).replace(Ve,_));if(_!==j||B[pt+1]!==j){if(_===j||pt===0||B[pt-1]!==j){St!==-1&&St<pt+1&&(St=B.indexOf(M,pt+1)),Tt!==-1&&Tt<pt+1&&(Tt=B.indexOf(E,pt+1));var pn=he(Tt===-1?St:Math.min(St,Tt));if(B.substr(pt+1+pn,L)===M){W.push(B.substring(N,pt).replace(Ve,_)),B[N=pt+1+pn+L]!==_&&(pt=B.indexOf(_,N)),St=B.indexOf(M,N),Tt=B.indexOf(E,N);break}var Se=he(Tt);if(B.substring(pt+1+Se,pt+1+Se+z)===E){if(W.push(B.substring(N,pt).replace(Ve,_)),Me(pt+1+Se+z),St=B.indexOf(M,N),pt=B.indexOf(_,N),q&&(le(),st))return Qt();if($&&Q.length>=$)return Qt(!0);break}Y.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:Q.length,index:N}),pt++}}else pt++}return ye();function je(zt){Q.push(zt),et=N}function he(zt){var cr=0;if(zt!==-1){var oi=B.substring(pt+1,zt);oi&&oi.trim()===""&&(cr=oi.length)}return cr}function ye(zt){return vt||(zt===void 0&&(zt=B.substring(N)),W.push(zt),N=H,je(W),q&&le()),Qt()}function Me(zt){N=zt,je(W),W=[],Tt=B.indexOf(E,N)}function Qt(zt){return{data:Q,errors:Y,meta:{delimiter:M,linebreak:E,aborted:st,truncated:!!zt,cursor:et+(Lt||0)}}}function le(){F(Qt()),Q=[],Y=[]}},this.abort=function(){st=!0},this.getCharIndex=function(){return N}}function v(b){var _=b.data,M=o[_.workerId],E=!1;if(_.error)M.userError(_.error,_.file);else if(_.results&&_.results.data){var A={abort:function(){E=!0,S(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(T(M.userStep)){for(var F=0;F<_.results.data.length&&(M.userStep({data:_.results.data[F],errors:_.results.errors,meta:_.results.meta},A),!E);F++);delete _.results}else T(M.userChunk)&&(M.userChunk(_.results,A,_.file),delete _.results)}_.finished&&!E&&S(_.workerId,_.results)}function S(b,_){var M=o[b];T(M.userComplete)&&M.userComplete(_),M.terminate(),delete o[b]}function P(){throw new Error("Not implemented.")}function D(b){if(typeof b!="object"||b===null)return b;var _=Array.isArray(b)?[]:{};for(var M in b)_[M]=D(b[M]);return _}function C(b,_){return function(){b.apply(_,arguments)}}function T(b){return typeof b=="function"}return r&&(i.onmessage=function(b){var _=b.data;if(l.WORKER_ID===void 0&&_&&(l.WORKER_ID=_.workerId),typeof _.input=="string")i.postMessage({workerId:l.WORKER_ID,results:l.parse(_.input,_.config),finished:!0});else if(i.File&&_.input instanceof File||_.input instanceof Object){var M=l.parse(_.input,_.config);M&&i.postMessage({workerId:l.WORKER_ID,results:M,finished:!0})}}),(d.prototype=Object.create(u.prototype)).constructor=d,(h.prototype=Object.create(u.prototype)).constructor=h,(g.prototype=Object.create(g.prototype)).constructor=g,(p.prototype=Object.create(u.prototype)).constructor=p,l})})(ih);var Uk=ih.exports;const qk=["id"],Xk=f.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=f.computed(()=>`export_${new Date().getTime()}`),r=f.computed(()=>{const u=l();return u.length?u:null}),o=()=>{const u=i.labels;if(typeof i.fields!==An.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===An.Object?d=>gk(d,(h,g)=>u[g]||g):d=>d},a=()=>{const u=i.fields;if(typeof i.fields!==An.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?d=>jk(d,u):d=>d},l=()=>{if(typeof i.fields===An.Undefined&&typeof i.labels===An.Undefined)return i.data;const u=o(),d=a();return i.data.map(h=>u(d(h)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=Uk.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});$k.saveAs(d,i.filename)}};return(u,d)=>(f.openBlock(),f.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[f.renderSlot(u.$slots,"default",{},()=>[f.createTextVNode("Download "+f.toDisplayString(n.filename),1)])],8,qk))}}),Gk=f.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=f.computed(()=>Object.keys(t.headers));return(i,s)=>(f.openBlock(),f.createElementBlock("div",null,[f.createVNode(Xk,{data:i.rows,fields:e.value,filename:i.filename,labels:i.headers},{default:f.withCtx(()=>[f.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}});function sh(n,t,e){const i=Qk(n,e.timeZone,e.locale);return"formatToParts"in i?Kk(i,t):Zk(i,t)}function Kk(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 Zk(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function Qk(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function Jk(n,t){const e=iS(t);return"formatToParts"in e?eS(e,n):nS(e,n)}const tS={year:0,month:1,day:2,hour:3,minute:4,second:5};function eS(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=tS[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 nS(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 da={};function iS(n){if(!da[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";da[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 da[n]}function rh(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 oh=36e5,sS=6e4,ha={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ah(n,t,e){if(!n)return 0;let i=ha.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=ha.timezoneHH.exec(n),i)return s=parseInt(i[1],10),lh(s)?-(s*oh):NaN;if(i=ha.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const o=parseInt(i[3],10);return lh(s,o)?(r=Math.abs(s)*oh+o*sS,i[1]==="+"?-r:r):NaN}if(aS(n)){t=new Date(t||Date.now());const o=e?t:rS(t),a=fa(o,n);return-(e?a:oS(t,a,n))}return NaN}function rS(n){return rh(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function fa(n,t){const e=Jk(n,t),i=rh(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 oS(n,t,e){let s=n.getTime()-t;const r=fa(new Date(s),e);if(t===r)return t;s-=r-t;const o=fa(new Date(s),e);return r===o?r:Math.max(r,o)}function lh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const ch={};function aS(n){if(ch[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),ch[n]=!0,!0}catch{return!1}}const lS=60*1e3,cS={X:function(n,t,e){const i=ga(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return uh(i);case"XXXX":case"XX":return ri(i);case"XXXXX":case"XXX":default:return ri(i,":")}},x:function(n,t,e){const i=ga(e.timeZone,n);switch(t){case"x":return uh(i);case"xxxx":case"xx":return ri(i);case"xxxxx":case"xxx":default:return ri(i,":")}},O:function(n,t,e){const i=ga(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+uS(i,":");case"OOOO":default:return"GMT"+ri(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return sh("short",n,e);case"zzzz":default:return sh("long",n,e)}}};function ga(n,t){const e=n?ah(n,t,!0)/lS:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function lr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function ri(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=lr(Math.floor(i/60),2),r=lr(Math.floor(i%60),2);return e+s+t+r}function uh(n,t){return n%60===0?(n>0?"-":"+")+lr(Math.abs(n)/60,2):ri(n,t)}function uS(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+lr(r,2)}function dh(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 dS=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,pa=36e5,hh=6e4,hS=2,Zt={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:dS};function fS(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?hS: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=gS(n),{year:s,restDateString:r}=pS(i.date,e),o=mS(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=yS(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=ah(i.timeZone||t.timeZone,new Date(a+l)),isNaN(c))return new Date(NaN)}else c=dh(new Date(a+l)),c=dh(new Date(a+l+c));return new Date(a+l+c)}else return new Date(NaN)}function gS(n){const t={};let e=Zt.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=Zt.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=Zt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function pS(n,t){if(n){const e=Zt.YYY[t],i=Zt.YYYYY[t];let s=Zt.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=Zt.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 mS(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=Zt.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,ph(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=Zt.DDD.exec(n),r){e=new Date(0);const o=parseInt(r[1],10);return _S(t,o)?(e.setUTCFullYear(t,0,o),e):new Date(NaN)}if(r=Zt.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const o=parseInt(r[2],10);return ph(t,i,o)?(e.setUTCFullYear(t,i,o),e):new Date(NaN)}if(r=Zt.Www.exec(n),r)return s=parseInt(r[1],10)-1,mh(s)?fh(t,s):new Date(NaN);if(r=Zt.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const o=parseInt(r[2],10)-1;return mh(s,o)?fh(t,s,o):new Date(NaN)}return null}function yS(n){let t,e,i=Zt.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ma(t)?t%24*pa:NaN;if(i=Zt.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ma(t,e)?t%24*pa+e*hh:NaN;if(i=Zt.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ma(t,e,s)?t%24*pa+e*hh+s*1e3:NaN}return null}function fh(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 bS=[31,28,31,30,31,30,31,31,30,31,30,31],xS=[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 ph(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=gh(n);if(i&&e>xS[t]||!i&&e>bS[t])return!1}return!0}function _S(n,t){if(t<1)return!1;const e=gh(n);return!(e&&t>366||!e&&t>365)}function mh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ma(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const wS=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function yh(n,t,e={}){t=String(t);const i=t.match(wS);if(i){const s=fS(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,"'"+cS[o[0]](s,o,e)+"'");return l?c.substring(0,a-1)+c.substring(a+1):c},t)}return du(n,t,e)}const vS={class:"kong-ui-public-csv-export-modal"},kS={key:0,class:"selected-range"},SS={key:1,class:"text-muted",tag:"span"},bh=3,xh=f.defineComponent({__name:"CsvExportModal",props:{filename:{},modalDescription:{default:void 0},chartData:{}},emits:["toggleModal"],setup(n,{emit:t}){const{i18n:e}=gt.useI18n(),i=n,s=t,r=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,o=f.ref(!0),a=f.computed(()=>{var y,x;return!!((x=(y=i.chartData)==null?void 0:y.data)!=null&&x.length)}),l=f.ref(1),c=f.computed(()=>g.value.rows.length),u=gt.useChartSelectedRange(f.toRef(i,"chartData")),d=f.computed(()=>e.t("csvExport.previewRows",{rowsMax:Math.min(bh,c.value),rowsTotal:c.value,plural:c.value===1?"":"s"})),h=()=>{s("toggleModal",!1)},g=f.computed(()=>{var D,C,T;if(!a.value||!((D=i.chartData)!=null&&D.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const y=i.chartData.data.some(b=>b.timestamp!==i.chartData.data[0].timestamp),x=i.chartData.data.map(b=>{const _=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:yh(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:yh(_,"XXX")}:{}}});let w=[];y&&(w=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const v="display"in i.chartData.meta&&((C=i.chartData.meta)!=null&&C.display)?(T=i.chartData.meta)==null?void 0:T.display:{},S=[...w,...Object.keys(v).map(b=>({label:e.t(`chartLabels.${b}`),key:b})),...i.chartData.meta.metric_names.map(b=>({label:e.t(`chartLabels.${b}`),key:b}))],P=S.reduce((b,_)=>(b[_.key]=_.label,b),{});return{headers:S,csvHeaders:P,rows:x}}),p=()=>{const{rows:y}=g.value;return o.value=!1,{total:Number(y.length)||0,data:y.slice(0,bh)}};return f.watch(g,()=>{l.value++}),(y,x)=>{const w=f.resolveComponent("KEmptyState"),v=f.resolveComponent("KTable"),S=f.resolveComponent("KButton"),P=f.resolveComponent("KModal");return f.openBlock(),f.createElementBlock("div",vS,[f.createVNode(P,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:f.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:f.withKeys(h,["esc"])},{default:f.withCtx(()=>{var D;return[f.createElementVNode("div",null,[a.value?(f.openBlock(),f.createElementBlock("div",kS,[f.createElementVNode("p",null,f.toDisplayString(y.modalDescription?y.modalDescription:f.unref(e).t("csvExport.exportDescription")),1),f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.exportTimeRange"))+": "+f.toDisplayString(f.unref(u)),1)])):f.createCommentVNode("",!0),f.createVNode(v,{class:"vitals-table","disable-pagination":"",fetcher:p,"fetcher-cache-key":String(l.value),headers:((D=g.value)==null?void 0:D.headers)||[],"row-hover":!1,sortable:!1},{"empty-state":f.withCtx(()=>[f.createVNode(w,{"action-button-visible":!1},{title:f.withCtx(()=>[f.createElementVNode("h5",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRange")),1)]),default:f.withCtx(()=>[f.createElementVNode("p",null,f.toDisplayString(f.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"]),!o.value&&a.value?(f.openBlock(),f.createElementBlock("div",SS,f.toDisplayString(d.value),1)):f.createCommentVNode("",!0)])]}),"footer-actions":f.withCtx(()=>[f.createVNode(S,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.cancelButton")),1)]),_:1}),f.createVNode(Gk,{class:"vitals-report-export-button",filename:r,headers:g.value.csvHeaders,rows:g.value.rows},{default:f.withCtx(()=>[f.createVNode(S,{appearance:"primary","data-testid":"csv-download-button",disabled:o.value||!a.value},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),_h=f.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}=gt.useI18n(),i=f.computed(()=>t.filenamePrefix||e.t("csvExport.defaultFilename")),s=f.ref(!1),r=a=>{s.value=a},o=()=>{r(!0)};return(a,l)=>{const c=f.resolveComponent("KButton");return f.openBlock(),f.createElementBlock(f.Fragment,null,[f.createVNode(c,{appearance:n.buttonAppearance,class:"chart-export-button-display","data-testid":"csv-export-button",onClick:f.withModifiers(o,["prevent"])},{default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.text||f.unref(e).t("csvExport.exportButton")),1)]),_:1},8,["appearance"]),s.value?(f.openBlock(),f.createBlock(xh,{key:0,"chart-data":n.data,filename:i.value,onToggleModal:r},null,8,["chart-data","filename"])):f.createCommentVNode("",!0)],64)}}}),MS={class:"analytics-chart-shell"},DS={key:0,class:"chart-header"},TS={key:0,class:"chart-title"},CS={class:"chart-header-icons-wrapper"},PS={key:1,class:"chart-export-button"},OS={key:2,class:"analytics-chart-parent"},ES=f.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}=gt.useI18n(),i=f.toRef(t,"chartData"),s=f.computed(()=>g.value?gt.useExploreResultToTimeDataset({fill:t.chartOptions.stacked,colorPalette:t.chartOptions.chartDatasetColors||Us},f.toRef(t,"chartData")).value:gt.useExploreResultToDatasets({fill:t.chartOptions.stacked,colorPalette:t.chartOptions.chartDatasetColors||Us},f.toRef(t,"chartData")).value),r=f.computed(()=>{var M;return(M=t.chartData)!=null&&M.meta?"start_ms"in t.chartData.meta?t.chartData.meta.end_ms-t.chartData.meta.start_ms:void 0:0}),o=f.computed(()=>{var M;return(M=t.chartData.meta)!=null&&M.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),a=f.computed(()=>t.showLegendValues&&t.legendPosition!==Ot.Bottom),{legendValues:l}=gt.useChartLegendValues(s,t.chartOptions.type,o),c=f.computed(()=>{var M,E,A;return((A=(E=(M=t.chartData)==null?void 0:M.meta)==null?void 0:E.limit)==null?void 0:A.toString())||null}),u=f.computed(()=>{var M,E;return((E=(M=t.chartData)==null?void 0:M.meta)==null?void 0:E.truncated)||!1}),d=e.t("limitedResultsShown",{maxReturned:c.value}),h=f.computed(()=>[$t.VERTICAL_BAR.toString(),$t.HORIZONTAL_BAR.toString()].includes(t.chartOptions.type)),g=f.computed(()=>[$t.TIMESERIES_BAR,$t.TIMESERIES_LINE].some(M=>M===t.chartOptions.type)),p=f.computed(()=>t.chartOptions.type===$t.DOUGHNUT),y=f.computed(()=>t.chartOptions.type.includes("Vertical")?"vertical":"horizontal"),x=f.computed(()=>{var A,F,$;if(!((A=t.chartData)!=null&&A.meta.metric_names)||!((F=t.chartData)!=null&&F.meta.metric_units))return;const M=t.chartData.meta.metric_names[0],E=t.chartData.meta.metric_units[M];if(t.chartData.meta.metric_names.length>1){if(M.includes("latency"))return e.t("metricAxisTitles.latency_in",{unit:e.t(`chartUnits.${E}`,{plural:"s"})});if(M.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.${M}`)&&e.te(`chartUnits.${E}`)&&e.t(`metricAxisTitles.${M}`,{unit:e.t(`chartUnits.${E}`,{plural:"s"})})||void 0}),w=f.computed(()=>{const M=g.value?"Time":Object.keys(t.chartData.meta.display||t.chartData.meta.metric_names)[0];return t.chartOptions.dimensionAxesTitle||e.te(`chartLabels.${M}`)&&e.t(`chartLabels.${M}`)||void 0}),v=f.computed(()=>{const M=Wo(Number(t.chartData.meta.granularity_ms));return e.t(`granularityAxisTitles.${M}`)}),S=f.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),P=f.computed(()=>t.emptyStateDescription||e.t("noDataAvailableDescription")),D=f.computed(()=>g.value?Dx(s.value):t.chartData&&t.chartData.meta&&t.chartData.data.length),C=f.computed(()=>D.value&&u.value&&c.value||t.chartTitle||t.allowCsvExport&&D.value),T=f.computed(()=>t.chartData.meta.granularity_ms?Wo(t.chartData.meta.granularity_ms)||"hourly":Wo(new Date(t.chartData.data[1].timestamp).getTime()-new Date(t.chartData.data[0].timestamp).getTime())||"hourly"),b=f.computed(()=>t.chartOptions.chartLegendSortFn?t.chartOptions.chartLegendSortFn:(M,E)=>M.text===e.t("chartLabels.____OTHER____")?1:E.text===e.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(M.text,10))&&!isNaN(parseInt(E.text,10))?M.text<E.text?-1:1:M.value&&E.value?E.value.raw-M.value.raw:0),_=f.computed(()=>t.chartOptions.chartTooltipSortFn?t.chartOptions.chartTooltipSortFn:(M,E)=>M.label===e.t("chartLabels.____OTHER____")?1:E.label===e.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(M.label,10))&&!isNaN(parseInt(E.label,10))?M.label<E.label?-1:1:M.value&&E.value?E.rawValue-M.rawValue:0);return f.provide("showLegendValues",a),f.provide("legendPosition",f.toRef(t,"legendPosition")),(M,E)=>{const A=f.resolveComponent("KTooltip"),F=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",MS,[C.value?(f.openBlock(),f.createElementBlock("div",DS,[n.chartTitle?(f.openBlock(),f.createElementBlock("div",TS,f.toDisplayString(n.chartTitle),1)):f.createCommentVNode("",!0),f.createElementVNode("div",CS,[D.value&&u.value&&c.value?(f.openBlock(),f.createBlock(A,{key:0,class:"tooltip","max-width":"500",placement:"right"},{content:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(d)),1)]),default:f.withCtx(()=>[f.createVNode(f.unref(Da.WarningIcon),{color:`var(--kui-color-text-warning, ${f.unref(Dv)})`,decorative:"",size:f.unref(Tv)},null,8,["color","size"])]),_:1})):f.createCommentVNode("",!0)]),n.allowCsvExport&&D.value?(f.openBlock(),f.createElementBlock("div",PS,[f.createVNode(_h,{data:i.value,"filename-prefix":n.filenamePrefix},null,8,["data","filename-prefix"])])):f.createCommentVNode("",!0)])):f.createCommentVNode("",!0),D.value?(f.openBlock(),f.createElementBlock("div",OS,[g.value?(f.openBlock(),f.createBlock(hk,{key:0,"chart-data":s.value,"chart-legend-sort-fn":b.value,"chart-tooltip-sort-fn":_.value,"dimension-axes-title":v.value,fill:n.chartOptions.stacked,granularity:T.value,"legend-values":f.unref(l),"metric-axes-title":x.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"])):h.value?(f.openBlock(),f.createBlock(Qv,{key:1,annotations:n.showAnnotations,"chart-data":s.value,"chart-legend-sort-fn":b.value,"chart-tooltip-sort-fn":_.value,"data-testid":"bar-chart-container","dimension-axes-title":w.value,"legend-values":f.unref(l),"metric-axes-title":x.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?(f.openBlock(),f.createBlock(uk,{key:2,"chart-data":s.value,"dataset-colors":n.chartOptions.chartDatasetColors||f.unref(Us),"legend-position":n.legendPosition,"legend-values":f.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"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(F,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(S.value),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(P.value),1)]),_:1}))])}}}),RS=Ye(ES,[["__scopeId","data-v-cb8778ab"]]),AS={class:"chart-parent","data-testid":"doughnut-chart-parent"},LS={class:"chart-totals-flex"},IS={key:1,class:"metric-small","data-testid":"doughnut-chart-total"},NS=f.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:Xn.Hidden},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:He},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}=gt.useI18n(),i=f.ref(fn()),s=f.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((x,w)=>x+w,0)),p),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=f.computed(()=>({...t.chartData,datasets:s.value}));gt.useReportChartDataForSynthetics(f.toRef(t,"chartData"),f.toRef(t,"syntheticsDataKey"));const o={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},a=f.ref(),l=f.computed(()=>{var g;return ji((g=s==null?void 0:s.value[0])==null?void 0:g.data[t.numerator],{capital:!0})}),c=f.computed(()=>{var g,p;return ji(((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=f.computed(()=>{var g;return`color: ${(g=s==null?void 0:s.value[0])==null?void 0:g.backgroundColor[t.numerator]}`}),d=f.computed(()=>[Xn.Full,Xn.SingleMetric].includes(t.metricDisplay)),h=f.computed(()=>t.metricDisplay===Xn.Full);return(g,p)=>(f.openBlock(),f.createElementBlock("div",AS,[f.createElementVNode("div",LS,[d.value?(f.openBlock(),f.createElementBlock("div",{key:0,class:"metric-large","data-testid":"doughnut-chart-metric",style:f.normalizeStyle(u.value)},f.toDisplayString(l.value),5)):f.createCommentVNode("",!0),h.value?(f.openBlock(),f.createElementBlock("div",IS,f.toDisplayString(f.unref(e).t("total"))+": "+f.toDisplayString(c.value),1)):f.createCommentVNode("",!0)]),f.createElementVNode("div",{class:"chart-container",style:f.normalizeStyle({height:n.height,width:n.width})},[f.createVNode(f.unref(Gd),{ref_key:"chartInstance",ref:a,"chart-id":i.value,data:r.value,options:o},null,8,["chart-id","data","options"])],4)]))}}),FS=Ye(NS,[["__scopeId","data-v-18bc031c"]]),BS={class:"simple-chart-shell"},zS={key:1,class:"analytics-chart-parent"},HS=Ye(f.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}=gt.useI18n(),i=f.computed(()=>{var c;const l=gt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||He},f.toRef(t,"chartData")).value;return(c=t.chartOptions)!=null&&c.reverseDataset&&(l==null||l.datasets.reverse()),l}),s=f.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=f.computed(()=>t.chartOptions.type===Vs.GAUGE),o=f.computed(()=>t.emptyStateTitle||e.t("noDataAvailableTitle")),a=f.computed(()=>t.chartData&&t.chartData.meta&&t.chartData.data.length);return(l,c)=>{const u=f.resolveComponent("KEmptyState");return f.openBlock(),f.createElementBlock("div",BS,[a.value?(f.openBlock(),f.createElementBlock("div",zS,[r.value?(f.openBlock(),f.createBlock(FS,{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"])):f.createCommentVNode("",!0)])):(f.openBlock(),f.createBlock(u,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-a1582f51"]]),WS={class:"top-n-card-title","data-testid":"top-n-card-title"},YS={class:"top-n-card-description","data-testid":"top-n-card-description"},VS={key:3,class:"top-n-table","data-testid":"top-n-table"},jS={class:"table-headings"},$S={class:"table-row"},US={class:"column-1"},qS={class:"column-2"},XS={class:"table-body","data-testid":"top-n-data"},GS=["data-testid"],KS={class:"column-1"},ZS={class:"column-2"},QS=Ye(f.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}=gt.useI18n(),i=f.computed(()=>t.data.data),s=f.computed(()=>{var p;return!!((p=i.value)!=null&&p.length)}),r=f.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=f.computed(()=>r.value?t.data.meta.display[r.value]:{}),a=f.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=f.computed(()=>a.value?e.t(`chartLabels.${a.value}`)||a.value:""),c=f.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),x=o.value&&o.value[y];return x?x.name:"-"},h=p=>{const y=u(p),x=o.value&&o.value[y];return x?!!x.deleted:!1},g=p=>{if(!a.value)return"–";const x=p.event[a.value];return x?ji(x,{capital:!0,round:!0}):"–"};return(p,y)=>{const x=f.resolveComponent("KEmptyState"),w=f.resolveComponent("KSkeleton"),v=f.resolveComponent("KCard");return f.openBlock(),f.createBlock(v,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},f.createSlots({default:f.withCtx(()=>[c.value?(f.openBlock(),f.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(f.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(c.value),1)]),_:1})):n.isLoading?(f.openBlock(),f.createBlock(w,{key:1,"table-columns":2,type:"table"})):s.value?(f.openBlock(),f.createElementBlock("div",VS,[f.createElementVNode("div",jS,[f.createElementVNode("div",$S,[f.createElementVNode("div",US,f.toDisplayString(f.unref(e).t("topNTable.nameLabel")),1),f.createElementVNode("div",qS,f.toDisplayString(l.value),1)])]),f.createElementVNode("div",XS,[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(i.value,(S,P)=>(f.openBlock(),f.createElementBlock("div",{key:`entry-${P}`,class:"table-row","data-testid":`row-${u(S)}`},[f.createElementVNode("div",KS,[f.renderSlot(p.$slots,"name",{record:{id:u(S),name:d(S),deleted:h(S),dimension:r.value}},()=>[f.createTextVNode(f.toDisplayString(d(S)),1)],!0)]),f.createElementVNode("div",ZS,"   "+f.toDisplayString(g(S)),1)],8,GS))),128))])])):(f.openBlock(),f.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:f.withCtx(()=>[f.createTextVNode(f.toDisplayString(n.emptyStateTitle||f.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:f.withCtx(()=>[f.createElementVNode("span",WS,f.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:f.withCtx(()=>[f.createElementVNode("div",YS,f.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-50809fdb"]]);J.AnalyticsChart=RS,J.ChartLegendPosition=Ot,J.ChartMetricDisplay=Xn,J.ChartTypes=$t,J.ChartTypesSimple=Vs,J.CsvExportButton=_h,J.CsvExportModal=xh,J.DECIMAL_DISPLAY=xu,J.FONT_SIZE_REGULAR=wu,J.FONT_SIZE_SMALL=_u,J.MAX_LABEL_LENGTH=$s,J.OTHERS_COLOR=Rx,J.SimpleChart=HS,J.TopNTable=QS,J.ValidType=An,J.accessibleGrey=Su,J.apiRequestStatusCodeColors=Mu,J.codesInSpec=Pu,J.darkenColor=ku,J.datavisPalette=He,J.defaultStatusCodeColors=Us,J.errorRateColors=Ox,J.latencyColors=Ex,J.lightGrey=Po,J.lookupColor=Ax,J.lookupDatavisColor=Gn,J.lookupStatusCodeCategoryColor=Hx,J.lookupStatusCodeColor=Oo,J.numberFormatter=js,J.statusCodeBadgeBackgroundColor=Cx,J.trafficColors=Px,Object.defineProperty(J,Symbol.toStringTag,{value:"Module"})});