@kong-ui-public/analytics-chart 10.8.1-pr.2637.b25f7e003.0 → 10.8.1-pr.2637.cd79373fe.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
(function(ot,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","axios"],d):(ot=typeof globalThis<"u"?globalThis:ot||self,d(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,d,Qe,ne){"use strict";var aO=Object.defineProperty;var oO=(ot,d,Qe)=>d in ot?aO(ot,d,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):ot[d]=Qe;var R=(ot,d,Qe)=>oO(ot,typeof d!="symbol"?d+"":d,Qe);var zn;const kg={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",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",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)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",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)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count"},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)",api:"API"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",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)"}},singleValue:{valueError:"Invalid configuration"},new_timerange_label:"Time range",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function Mg(){const e=Qe.createI18n("en-us",kg);return{i18n:e,i18nT:Qe.i18nTComponent(e)}}/*!
|
|
1
|
+
(function(ot,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","axios"],d):(ot=typeof globalThis<"u"?globalThis:ot||self,d(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot["kong-ui-public-i18n"],ot.KongIcons))})(this,function(ot,d,Qe,ne){"use strict";var aO=Object.defineProperty;var oO=(ot,d,Qe)=>d in ot?aO(ot,d,{enumerable:!0,configurable:!0,writable:!0,value:Qe}):ot[d]=Qe;var R=(ot,d,Qe)=>oO(ot,typeof d!="symbol"?d+"":d,Qe);var zn;const kg={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",jumpToExplore:"Open in explorer",more_actions:"More actions",emptyEntityInfo:"Requests that do not have a value for the selected group",chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}"},csvExport:{dataError:"Error loading data",noDataRange:"No data in selected range",noDataRetry:"Please adjust the time period and try again",timeRangeSelected:"selected",exportPreview:"Export preview",exportAsCsv:"Export as CSV",exportTimeRange:"Time range",exportDescription:"Exports a CSV of the data represented in the chart.",maximumRecordAmount:"The number of groups is limited to {value}",previewRows:"Previewing {rowsMax} of {rowsTotal} row{plural}",downloadButton:"Export",cancelButton:"Cancel",UtcOffset:"UTC offset",Timestamp:"Timestamp"},query_errors:{forbidden:{message:"Data request forbidden",details:"To access this data, either filter for an entity you have access to or request analytics viewer access from your administrator."},time_range_exceeded:{message:"Time range exceeded",details:"The time range for this report is outside of your organization's data retention period"},timeout:{message:"Data request timed out",details:"We're sorry, the request timed out. Please consider using a shorter time period or try again later."},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",ai_plugin:"AI plugin",ai_provider:"Provider",ai_request_model:"Request model",ai_response_model:"Response model",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",response_latency_average:"Response latency (avg)",response_latency_p99:"Response latency (p99)",response_latency_p95:"Response latency (p95)",response_latency_p50:"Response latency (p50)",kong_latency_average:"Kong latency (avg)",kong_latency_p99:"Kong latency (p99)",kong_latency_p95:"Kong latency (p95)",kong_latency_p50:"Kong latency (p50)",llm_cache_status:"Cache status",llm_embeddings_model:"Embeddings model",llm_embeddings_provider:"Embeddings provider",upstream_latency_average:"Upstream latency (avg)",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)",response_size_average:"Response size (avg)",response_size_sum:"Response size (sum)",response_source:"Response source",request_size_p99:"Request size (p99)",request_size_p95:"Request size (p95)",request_size_p50:"Request size (p50)",request_size_average:"Request size (avg)",request_size_sum:"Request size (sum)",control_plane:"Control plane",control_plane_group:"Control plane group",consumer:"Consumer",country_code:"Country",country:"Country",data_plane_node:"Data plane node",data_plane_node_version:"Data plane node version",api_product:"API product",api_product_version:"API product version",portal:"Portal",realm:"Realm",runtime_group:"Runtime group",gateway_service:"Gateway service",route:"Route",application:"Application",status_code:"Status code",status_code_grouped:"Status code (grouped)",upstream_status_code:"Upstream status code",upstream_status_code_grouped:"Upstream status code group",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)","threshold-warning":"Warning threshold: {value}","threshold-error":"Error threshold: {value}","thatreshold-neutral":"Alert threshold: {value}",api:"API",vulnerability_count:"Vulnerability count"},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)",api:"API"},granularityAxisTitles:{tenSecondly:"@timestamp per 10 seconds",thirtySecondly:"@timestamp per 30 seconds",minutely:"@timestamp per minute",fiveMinutely:"@timestamp per 5 minutes",tenMinutely:"@timestamp per 10 minutes",thirtyMinutely:"@timestamp per 30 minutes",hourly:"@timestamp per hour",twoHourly:"@timestamp per 2 hours",twelveHourly:"@timestamp per 12 hours",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)"}},singleValue:{valueError:"Invalid configuration",trend:{not_available:"Not available"}},new_timerange_label:"Time range",sparkline_no_data:"No data",zoom_action_items:{zoom:"Zoom in",view_requests:"View requests",cancel:"Cancel",explore:"Explore"},zoom_time_range:{from:"From",to:"To"}};function Mg(){const e=Qe.createI18n("en-us",kg);return{i18n:e,i18nT:Qe.i18nTComponent(e)}}/*!
|
|
2
2
|
* @kurkle/color v0.3.4
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2024 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function Zi(e){return e+.5|0}const vn=(e,t,n)=>Math.max(Math.min(e,n),t);function Qi(e){return vn(Zi(e*2.55),0,255)}function Sn(e){return vn(Zi(e*255),0,255)}function Je(e){return vn(Zi(e/2.55)/100,0,1)}function Hc(e){return vn(Zi(e*100),0,100)}const Oe={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},Va=[..."0123456789ABCDEF"],Tg=e=>Va[e&15],Dg=e=>Va[(e&240)>>4]+Va[e&15],cs=e=>(e&240)>>4===(e&15),Cg=e=>cs(e.r)&&cs(e.g)&&cs(e.b)&&cs(e.a);function Eg(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Oe[e[1]]*17,g:255&Oe[e[2]]*17,b:255&Oe[e[3]]*17,a:t===5?Oe[e[4]]*17:255}:(t===7||t===9)&&(n={r:Oe[e[1]]<<4|Oe[e[2]],g:Oe[e[3]]<<4|Oe[e[4]],b:Oe[e[5]]<<4|Oe[e[6]],a:t===9?Oe[e[7]]<<4|Oe[e[8]]:255})),n}const Og=(e,t)=>e<255?t(e):"";function Pg(e){var t=Cg(e)?Tg:Dg;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Og(e.a,t):void 0}const Rg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Vc(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function Ag(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Ig(e,t,n){const i=Vc(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function Lg(e,t,n,i,r){return e===r?(t-n)/i+(t<n?6:0):t===r?(n-e)/i+2:(e-t)/i+4}function Wa(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,i,r),o=(s+a)/2;let l,
|
|
6
|
+
*/function Zi(e){return e+.5|0}const vn=(e,t,n)=>Math.max(Math.min(e,n),t);function Qi(e){return vn(Zi(e*2.55),0,255)}function Sn(e){return vn(Zi(e*255),0,255)}function Je(e){return vn(Zi(e/2.55)/100,0,1)}function Hc(e){return vn(Zi(e*100),0,100)}const Oe={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},Va=[..."0123456789ABCDEF"],Tg=e=>Va[e&15],Dg=e=>Va[(e&240)>>4]+Va[e&15],cs=e=>(e&240)>>4===(e&15),Cg=e=>cs(e.r)&&cs(e.g)&&cs(e.b)&&cs(e.a);function Eg(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&Oe[e[1]]*17,g:255&Oe[e[2]]*17,b:255&Oe[e[3]]*17,a:t===5?Oe[e[4]]*17:255}:(t===7||t===9)&&(n={r:Oe[e[1]]<<4|Oe[e[2]],g:Oe[e[3]]<<4|Oe[e[4]],b:Oe[e[5]]<<4|Oe[e[6]],a:t===9?Oe[e[7]]<<4|Oe[e[8]]:255})),n}const Og=(e,t)=>e<255?t(e):"";function Pg(e){var t=Cg(e)?Tg:Dg;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Og(e.a,t):void 0}const Rg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Vc(e,t,n){const i=t*Math.min(n,1-n),r=(s,a=(s+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[r(0),r(8),r(4)]}function Ag(e,t,n){const i=(r,s=(r+e/60)%6)=>n-n*t*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function Ig(e,t,n){const i=Vc(e,1,.5);let r;for(t+n>1&&(r=1/(t+n),t*=r,n*=r),r=0;r<3;r++)i[r]*=1-t-n,i[r]+=t;return i}function Lg(e,t,n,i,r){return e===r?(t-n)/i+(t<n?6:0):t===r?(n-e)/i+2:(e-t)/i+4}function Wa(e){const n=e.r/255,i=e.g/255,r=e.b/255,s=Math.max(n,i,r),a=Math.min(n,i,r),o=(s+a)/2;let c,l,u;return s!==a&&(u=s-a,l=o>.5?u/(2-s-a):u/(s+a),c=Lg(n,i,r,u,s),c=c*60+.5),[c|0,l||0,o]}function Ya(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Sn)}function $a(e,t,n){return Ya(Vc,e,t,n)}function Ng(e,t,n){return Ya(Ig,e,t,n)}function Fg(e,t,n){return Ya(Ag,e,t,n)}function Wc(e){return(e%360+360)%360}function Bg(e){const t=Rg.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?Qi(+t[5]):Sn(+t[5]));const r=Wc(+t[2]),s=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Ng(r,s,a):t[1]==="hsv"?i=Fg(r,s,a):i=$a(r,s,a),{r:i[0],g:i[1],b:i[2],a:n}}function zg(e,t){var n=Wa(e);n[0]=Wc(n[0]+t),n=$a(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Hg(e){if(!e)return;const t=Wa(e),n=t[0],i=Hc(t[1]),r=Hc(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${r}%, ${Je(e.a)})`:`hsl(${n}, ${i}%, ${r}%)`}const Yc={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"},$c={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 Vg(){const e={},t=Object.keys($c),n=Object.keys(Yc);let i,r,s,a,o;for(i=0;i<t.length;i++){for(a=o=t[i],r=0;r<n.length;r++)s=n[r],o=o.replace(s,Yc[s]);s=parseInt($c[a],16),e[o]=[s>>16&255,s>>8&255,s&255]}return e}let us;function Wg(e){us||(us=Vg(),us.transparent=[0,0,0,0]);const t=us[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Yg=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $g(e){const t=Yg.exec(e);let n=255,i,r,s;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?Qi(a):vn(a*255,0,255)}return i=+t[1],r=+t[3],s=+t[5],i=255&(t[2]?Qi(i):vn(i,0,255)),r=255&(t[4]?Qi(r):vn(r,0,255)),s=255&(t[6]?Qi(s):vn(s,0,255)),{r:i,g:r,b:s,a:n}}}function jg(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Je(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const ja=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,yi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Ug(e,t,n){const i=yi(Je(e.r)),r=yi(Je(e.g)),s=yi(Je(e.b));return{r:Sn(ja(i+n*(yi(Je(t.r))-i))),g:Sn(ja(r+n*(yi(Je(t.g))-r))),b:Sn(ja(s+n*(yi(Je(t.b))-s))),a:e.a+n*(t.a-e.a)}}function ds(e,t,n){if(e){let i=Wa(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=$a(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function jc(e,t){return e&&Object.assign(t||{},e)}function Uc(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Sn(e[3]))):(t=jc(e,{r:0,g:0,b:0,a:1}),t.a=Sn(t.a)),t}function qg(e){return e.charAt(0)==="r"?$g(e):Bg(e)}class Ji{constructor(t){if(t instanceof Ji)return t;const n=typeof t;let i;n==="object"?i=Uc(t):n==="string"&&(i=Eg(t)||Wg(t)||qg(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=jc(this._rgb);return t&&(t.a=Je(t.a)),t}set rgb(t){this._rgb=Uc(t)}rgbString(){return this._valid?jg(this._rgb):void 0}hexString(){return this._valid?Pg(this._rgb):void 0}hslString(){return this._valid?Hg(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,r=t.rgb;let s;const a=n===s?.5:n,o=2*a-1,c=i.a-r.a,l=((o*c===-1?o:(o+c)/(1+o*c))+1)/2;s=1-l,i.r=255&l*i.r+s*r.r+.5,i.g=255&l*i.g+s*r.g+.5,i.b=255&l*i.b+s*r.b+.5,i.a=a*i.a+(1-a)*r.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=Ug(this._rgb,t._rgb,n)),this}clone(){return new Ji(this.rgb)}alpha(t){return this._rgb.a=Sn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Zi(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.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 ds(this._rgb,2,t),this}darken(t){return ds(this._rgb,2,-t),this}saturate(t){return ds(this._rgb,1,t),this}desaturate(t){return ds(this._rgb,1,-t),this}rotate(t){return zg(this._rgb,t),this}}/*!
|
|
7
7
|
* Chart.js v4.5.0
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function tn(){}const Xg=(()=>{let e=0;return()=>e++})();function st(e){return e==null}function kt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ft(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function At(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function De(e,t){return At(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const Gg=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Mt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Tt(e,t,n,i){let r,s,a;if(kt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(ft(e))for(a=Object.keys(e),s=a.length,r=0;r<s;r++)t.call(n,e[a[r]],a[r])}function hs(e,t){let n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(r=e[n],s=t[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function fs(e){if(kt(e))return e.map(fs);if(ft(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let r=0;for(;r<i;++r)t[n[r]]=fs(e[n[r]]);return t}return e}function Xc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Kg(e,t,n,i){if(!Xc(e))return;const r=t[e],s=n[e];ft(r)&&ft(s)?tr(r,s,i):t[e]=fs(s)}function tr(e,t,n){const i=kt(t)?t:[t],r=i.length;if(!ft(e))return e;n=n||{};const s=n.merger||Kg;let a;for(let o=0;o<r;++o){if(a=i[o],!ft(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)s(l[c],e,a,n)}return e}function er(e,t){return tr(e,t,{merger:Zg})}function Zg(e,t,n){if(!Xc(e))return;const i=t[e],r=n[e];ft(i)&&ft(r)?er(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=fs(r))}const Gc={"":e=>e,x:e=>e.x,y:e=>e.y};function Qg(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Jg(e){const t=Qg(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function kn(e,t){return(Gc[t]||(Gc[t]=Jg(t)))(e)}function Ua(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ye=e=>typeof e<"u",be=e=>typeof e=="function",Kc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function tp(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const dt=Math.PI,Ot=2*dt,ep=Ot+dt,ms=Number.POSITIVE_INFINITY,qa=dt/180,Pt=dt/2,Pe=dt/4,gs=dt*2/3,Mn=Math.log10,Ye=Math.sign;function nr(e,t,n){return Math.abs(e-t)<n}function Zc(e){const t=Math.round(e);e=nr(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Mn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function np(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((r,s)=>r-s).pop(),t}function ip(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Tn(e){return!ip(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function rp(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Qc(e,t,n){let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function jt(e){return e*(dt/180)}function ps(e){return e*(180/dt)}function Jc(e){if(!At(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function ys(e,t){const n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*dt&&(s+=Ot),{angle:s,distance:r}}function bi(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function sp(e,t){return(e-t+ep)%Ot-dt}function se(e){return(e%Ot+Ot)%Ot}function ir(e,t,n,i){const r=se(e),s=se(t),a=se(n),o=se(s-r),l=se(a-r),c=se(r-s),u=se(r-a);return r===s||r===a||i&&s===a||o>l&&c<u}function Qt(e,t,n){return Math.max(t,Math.min(n,e))}function ap(e){return Qt(e,-32768,32767)}function en(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Xa(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const nn=(e,t,n,i)=>Xa(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),op=(e,t,n)=>Xa(e,n,i=>e[i][t]>=n);function lp(e,t,n){let i=0,r=e.length;for(;i<r&&e[i]<t;)i++;for(;r>i&&e[r-1]>n;)r--;return i>0||r<e.length?e.slice(i,r):e}const tu=["push","pop","shift","splice","unshift"];function cp(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),tu.forEach(n=>{const i="_onData"+Ua(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...s)}),a}})})}function eu(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(tu.forEach(s=>{delete e[s]}),delete e._chartjs)}function nu(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const iu=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function ru(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,iu.call(window,()=>{i=!1,e.apply(t,n)}))}}function up(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Ga=e=>e==="start"?"left":e==="end"?"right":"center",ae=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,dp=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function su(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:o,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:g}=a.getUserBounds();if(m){if(r=Math.min(nn(l,u,h).lo,n?i:nn(t,u,a.getPixelForValue(h)).lo),c){const p=l.slice(0,r+1).reverse().findIndex(x=>!st(x[o.axis]));r-=Math.max(0,p)}r=Qt(r,0,i-1)}if(g){let p=Math.max(nn(l,a.axis,f,!0).hi+1,n?0:nn(t,u,a.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(p-1).findIndex(S=>!st(S[o.axis]));p+=Math.max(0,x)}s=Qt(p,r,i)-r}else s=i-r}return{start:r,count:s}}function au(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const bs=e=>e===0||e===1,ou=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ot/n)),lu=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ot/n)+1,rr={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Pt)+1,easeOutSine:e=>Math.sin(e*Pt),easeInOutSine:e=>-.5*(Math.cos(dt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>bs(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>bs(e)?e:ou(e,.075,.3),easeOutElastic:e=>bs(e)?e:lu(e,.075,.3),easeInOutElastic(e){return bs(e)?e:e<.5?.5*ou(e*2,.1125,.45):.5+.5*lu(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-rr.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?rr.easeInBounce(e*2)*.5:rr.easeOutBounce(e*2-1)*.5+.5};function Ka(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function cu(e){return Ka(e)?e:new Ji(e)}function Za(e){return Ka(e)?e:new Ji(e).saturate(.5).darken(.1).hexString()}const hp=["x","y","borderWidth","radius","tension"],fp=["color","borderColor","backgroundColor"];function mp(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:fp},numbers:{type:"number",properties:hp}}),e.describe("animations",{_fallback:"animation"}),e.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 gp(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const uu=new Map;function pp(e,t){t=t||{};const n=e+JSON.stringify(t);let i=uu.get(n);return i||(i=new Intl.NumberFormat(e,t),uu.set(n,i)),i}function sr(e,t,n){return pp(t,n).format(e)}const du={values(e){return kt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(r="scientific"),s=yp(e,n)}const a=Mn(Math.abs(s)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),sr(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Mn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?du.numeric.call(this,e,t,n):""}};function yp(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var _s={formatters:du};function bp(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:_s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const jn=Object.create(null),Qa=Object.create(null);function ar(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];e=e[s]||(e[s]=Object.create(null))}return e}function Ja(e,t,n){return typeof t=="string"?tr(ar(e,t),n):tr(ar(e,""),t)}class _p{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Za(r.backgroundColor),this.hoverBorderColor=(i,r)=>Za(r.borderColor),this.hoverColor=(i,r)=>Za(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ja(this,t,n)}get(t){return ar(this,t)}describe(t,n){return Ja(Qa,t,n)}override(t,n){return Ja(jn,t,n)}route(t,n,i,r){const s=ar(this,t),a=ar(this,i),o="_"+n;Object.defineProperties(s,{[o]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[o],c=a[r];return ft(l)?Object.assign({},c,l):at(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(n=>n(this))}}var Rt=new _p({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[mp,gp,bp]);function xp(e){return!e||st(e.size)||st(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function xs(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function wp(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const o=n.length;let l,c,u,h,f;for(l=0;l<o;l++)if(h=n[l],h!=null&&!kt(h))a=xs(e,r,s,a,h);else if(kt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!kt(f)&&(a=xs(e,r,s,a,f));e.restore();const m=s.length/2;if(m>n.length){for(l=0;l<m;l++)delete r[s[l]];s.splice(0,m)}return a}function Un(e,t,n){const i=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*i)/i+r}function hu(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function to(e,t,n,i){fu(e,t,n,i,null)}function fu(e,t,n,i,r){let s,a,o,l,c,u,h,f;const m=t.pointStyle,g=t.rotation,p=t.radius;let x=(g||0)*qa;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(x),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),m){default:r?e.ellipse(n,i,r/2,p,0,0,Ot):e.arc(n,i,p,0,Ot),e.closePath();break;case"triangle":u=r?r/2:p,e.moveTo(n+Math.sin(x)*u,i-Math.cos(x)*p),x+=gs,e.lineTo(n+Math.sin(x)*u,i-Math.cos(x)*p),x+=gs,e.lineTo(n+Math.sin(x)*u,i-Math.cos(x)*p),e.closePath();break;case"rectRounded":c=p*.516,l=p-c,a=Math.cos(x+Pe)*l,h=Math.cos(x+Pe)*(r?r/2-c:l),o=Math.sin(x+Pe)*l,f=Math.sin(x+Pe)*(r?r/2-c:l),e.arc(n-h,i-o,c,x-dt,x-Pt),e.arc(n+f,i-a,c,x-Pt,x),e.arc(n+h,i+o,c,x,x+Pt),e.arc(n-f,i+a,c,x+Pt,x+dt),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,u=r?r/2:l,e.rect(n-u,i-l,2*u,2*l);break}x+=Pe;case"rectRot":h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+f,i-a),e.lineTo(n+h,i+o),e.lineTo(n-f,i+a),e.closePath();break;case"crossRot":x+=Pe;case"cross":h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"star":h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a),x+=Pe,h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"line":a=r?r/2:Math.cos(x)*p,o=Math.sin(x)*p,e.moveTo(n-a,i-o),e.lineTo(n+a,i+o);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(x)*(r?r/2:p),i+Math.sin(x)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function rn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function or(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function lr(e){e.restore()}function vp(e,t,n,i,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else r==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Sp(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function kp(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),st(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Mp(e,t,n,i,r){if(r.strikethrough||r.underline){const s=e.measureText(i),a=t-s.actualBoundingBoxLeft,o=t+s.actualBoundingBoxRight,l=n-s.actualBoundingBoxAscent,c=n+s.actualBoundingBoxDescent,u=r.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,u),e.lineTo(o,u),e.stroke()}}function Tp(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function qn(e,t,n,i,r,s={}){const a=kt(t)?t:[t],o=s.strokeWidth>0&&s.strokeColor!=="";let l,c;for(e.save(),e.font=r.string,kp(e,s),l=0;l<a.length;++l)c=a[l],s.backdrop&&Tp(e,s.backdrop),o&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),st(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(c,n,i,s.maxWidth)),e.fillText(c,n,i,s.maxWidth),Mp(e,n,i,c,s),i+=Number(r.lineHeight);e.restore()}function _i(e,t){const{x:n,y:i,w:r,h:s,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*dt,dt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,dt,Pt,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,Pt,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-Pt,!0),e.lineTo(n+a.topLeft,i)}const Dp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ep(e,t){const n=(""+e).match(Dp);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const Op=e=>+e||0;function eo(e,t){const n={},i=ft(t),r=i?Object.keys(t):t,s=ft(e)?i?a=>at(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=Op(s(a));return n}function mu(e){return eo(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Dn(e){return eo(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(e){const t=mu(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(e,t){e=e||{},t=t||Rt.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(Cp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:at(e.family,t.family),lineHeight:Ep(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return r.string=xp(r),r}function cr(e,t,n,i){let r,s,a;for(r=0,s=e.length;r<s;++r)if(a=e[r],a!==void 0&&a!==void 0)return a}function Pp(e,t,n){const{min:i,max:r}=e,s=qc(t,(r-i)/2),a=(o,l)=>n&&o===0?0:o+l;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Cn(e,t){return Object.assign(Object.create(e),t)}function no(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=_u("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:o=>no([o,...e],t,s,i)};return new Proxy(a,{deleteProperty(o,l){return delete o[l],delete o._keys,delete e[0][l],!0},get(o,l){return pu(o,l,()=>zp(l,t,e,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(o,l){return xu(o).includes(l)},ownKeys(o){return xu(o)},set(o,l,c){const u=o._storage||(o._storage=r());return o[l]=u[l]=c,delete o._keys,!0}})}function xi(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:gu(e,i),setContext:s=>xi(e,s,n,i),override:s=>xi(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,o){return pu(s,a,()=>Ap(s,a,o))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,o){return e[a]=o,delete s[a],!0}})}function gu(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:be(n)?n:()=>n,isIndexable:be(i)?i:()=>i}}const Rp=(e,t)=>e?e+Ua(t):t,io=(e,t)=>ft(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pu(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function Ap(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let o=i[t];return be(o)&&a.isScriptable(t)&&(o=Ip(t,o,e,n)),kt(o)&&o.length&&(o=Lp(t,o,e,a.isIndexable)),io(t,o)&&(o=xi(o,r,s&&s[t],a)),o}function Ip(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:o}=n;if(o.has(e))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+e);o.add(e);let l=t(s,a||i);return o.delete(e),io(e,l)&&(l=ro(r._scopes,r,e,l)),l}function Lp(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:o}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(ft(t[0])){const l=t,c=r._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=ro(c,r,e,u);t.push(xi(h,s,a&&a[e],o))}}return t}function yu(e,t,n){return be(e)?e(t,n):e}const Np=(e,t)=>e===!0?t:typeof e=="string"?kn(t,e):void 0;function Fp(e,t,n,i,r){for(const s of t){const a=Np(n,s);if(a){e.add(a);const o=yu(a._fallback,n,r);if(typeof o<"u"&&o!==n&&o!==i)return o}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function ro(e,t,n,i){const r=t._rootScopes,s=yu(t._fallback,n,i),a=[...e,...r],o=new Set;o.add(i);let l=bu(o,a,n,s||n,i);return l===null||typeof s<"u"&&s!==n&&(l=bu(o,a,s,l,i),l===null)?!1:no(Array.from(o),[""],r,s,()=>Bp(t,n,i))}function bu(e,t,n,i,r){for(;n;)n=Fp(e,t,n,i,r);return n}function Bp(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return kt(r)&&ft(n)?n:r||{}}function zp(e,t,n,i){let r;for(const s of t)if(r=_u(Rp(s,e),n),typeof r<"u")return io(e,r)?ro(n,i,e,r):r}function _u(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function xu(e){let t=e._keys;return t||(t=e._keys=Hp(e._scopes)),t}function Hp(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function wu(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+n,u=t[c],a[o]={r:r.parse(kn(u,s),c)};return a}const Vp=Number.EPSILON||1e-14,wi=(e,t)=>t<e.length&&!e[t].skip&&e[t],vu=e=>e==="x"?"y":"x";function Wp(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,o=bi(s,r),l=bi(a,s);let c=o/(o+l),u=l/(o+l);c=isNaN(c)?0:c,u=isNaN(u)?0:u;const h=i*c,f=i*u;return{previous:{x:s.x-h*(a.x-r.x),y:s.y-h*(a.y-r.y)},next:{x:s.x+f*(a.x-r.x),y:s.y+f*(a.y-r.y)}}}function Yp(e,t,n){const i=e.length;let r,s,a,o,l,c=wi(e,0);for(let u=0;u<i-1;++u)if(l=c,c=wi(e,u+1),!(!l||!c)){if(nr(t[u],0,Vp)){n[u]=n[u+1]=0;continue}r=n[u]/t[u],s=n[u+1]/t[u],o=Math.pow(r,2)+Math.pow(s,2),!(o<=9)&&(a=3/Math.sqrt(o),n[u]=r*a*t[u],n[u+1]=s*a*t[u])}}function $p(e,t,n="x"){const i=vu(n),r=e.length;let s,a,o,l=wi(e,0);for(let c=0;c<r;++c){if(a=o,o=l,l=wi(e,c+1),!o)continue;const u=o[n],h=o[i];a&&(s=(u-a[n])/3,o[`cp1${n}`]=u-s,o[`cp1${i}`]=h-s*t[c]),l&&(s=(l[n]-u)/3,o[`cp2${n}`]=u+s,o[`cp2${i}`]=h+s*t[c])}}function jp(e,t="x"){const n=vu(t),i=e.length,r=Array(i).fill(0),s=Array(i);let a,o,l,c=wi(e,0);for(a=0;a<i;++a)if(o=l,l=c,c=wi(e,a+1),!!l){if(c){const u=c[t]-l[t];r[a]=u!==0?(c[n]-l[n])/u:0}s[a]=o?c?Ye(r[a-1])!==Ye(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Yp(e,r,s),$p(e,s,t)}function ws(e,t,n){return Math.max(Math.min(e,n),t)}function Up(e,t){let n,i,r,s,a,o=rn(e[0],t);for(n=0,i=e.length;n<i;++n)a=s,s=o,o=n<i-1&&rn(e[n+1],t),s&&(r=e[n],a&&(r.cp1x=ws(r.cp1x,t.left,t.right),r.cp1y=ws(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=ws(r.cp2x,t.left,t.right),r.cp2y=ws(r.cp2y,t.top,t.bottom)))}function qp(e,t,n,i,r){let s,a,o,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")jp(e,r);else{let c=i?e[e.length-1]:e[0];for(s=0,a=e.length;s<a;++s)o=e[s],l=Wp(c,o,e[Math.min(s+1,a-(i?0:1))%a],t.tension),o.cp1x=l.previous.x,o.cp1y=l.previous.y,o.cp2x=l.next.x,o.cp2y=l.next.y,c=o}t.capBezierPoints&&Up(e,n)}function so(){return typeof window<"u"&&typeof document<"u"}function ao(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function vs(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const Ss=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Xp(e,t){return Ss(e).getPropertyValue(t)}const Gp=["top","right","bottom","left"];function Xn(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=Gp[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Kp=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Zp(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,o,l;if(Kp(r,s,e.target))o=r,l=s;else{const c=t.getBoundingClientRect();o=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:o,y:l,box:a}}function En(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=Ss(n),s=r.boxSizing==="border-box",a=Xn(r,"padding"),o=Xn(r,"border","width"),{x:l,y:c,box:u}=Zp(e,n),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:g}=t;return s&&(m-=a.width+o.width,g-=a.height+o.height),{x:Math.round((l-h)/m*n.width/i),y:Math.round((c-f)/g*n.height/i)}}function Qp(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&ao(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),o=Ss(s),l=Xn(o,"border","width"),c=Xn(o,"padding");t=a.width-c.width-l.width,n=a.height-c.height-l.height,i=vs(o.maxWidth,s,"clientWidth"),r=vs(o.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||ms,maxHeight:r||ms}}const ks=e=>Math.round(e*10)/10;function Jp(e,t,n,i){const r=Ss(e),s=Xn(r,"margin"),a=vs(r.maxWidth,e,"clientWidth")||ms,o=vs(r.maxHeight,e,"clientHeight")||ms,l=Qp(e,t,n);let{width:c,height:u}=l;if(r.boxSizing==="content-box"){const f=Xn(r,"border","width"),m=Xn(r,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-s.width),u=Math.max(0,i?c/i:u-s.height),c=ks(Math.min(c,a,l.maxWidth)),u=ks(Math.min(u,o,l.maxHeight)),c&&!u&&(u=ks(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=ks(Math.floor(u*i))),{width:c,height:u}}function Su(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const ty=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};so()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ku(e,t){const n=Xp(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Gn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function ey(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function ny(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=Gn(e,r,n),o=Gn(r,s,n),l=Gn(s,t,n),c=Gn(a,o,n),u=Gn(o,l,n);return Gn(c,u,n)}const iy=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},ry=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function vi(e,t,n){return e?iy(t,n):ry()}function Mu(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Tu(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Du(e){return e==="angle"?{between:ir,compare:sp,normalize:se}:{between:en,compare:(t,n)=>t-n,normalize:t=>t}}function Cu({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function sy(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:o}=Du(i),l=t.length;let{start:c,end:u,loop:h}=e,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&a(o(t[c%l][i]),r,s);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:e.style}}function Eu(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:o,between:l,normalize:c}=Du(i),{start:u,end:h,loop:f,style:m}=sy(e,t,n),g=[];let p=!1,x=null,S,v,k;const D=()=>l(r,k,S)&&o(r,k)!==0,M=()=>o(s,S)===0||l(s,k,S),P=()=>p||D(),E=()=>!p||M();for(let y=u,_=u;y<=h;++y)v=t[y%a],!v.skip&&(S=c(v[i]),S!==k&&(p=l(S,r,s),x===null&&P()&&(x=o(S,r)===0?y:_),x!==null&&E()&&(g.push(Cu({start:x,end:y,loop:f,count:a,style:m})),x=null),_=y,k=S));return x!==null&&g.push(Cu({start:x,end:h,loop:f,count:a,style:m})),g}function Ou(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Eu(i[r],e.points,t);s.length&&n.push(...s)}return n}function ay(e,t,n,i){let r=0,s=t-1;if(n&&!i)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function oy(e,t,n,i){const r=e.length,s=[];let a=t,o=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%r];c.skip||c.stop?o.skip||(i=!1,s.push({start:t%r,end:(l-1)%r,loop:i}),t=a=c.stop?l:null):(a=l,o.skip&&(t=l)),o=c}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function ly(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:o}=ay(n,r,s,i);if(i===!0)return Pu(e,[{start:a,end:o,loop:s}],n,t);const l=o<a?o+r:o,c=!!e._fullLoop&&a===0&&o===r-1;return Pu(e,oy(n,a,l,c),n,t)}function Pu(e,t,n,i){return!i||!i.setContext||!n?t:cy(e,t,n,i)}function cy(e,t,n,i){const r=e._chart.getContext(),s=Ru(e.options),{_datasetIndex:a,options:{spanGaps:o}}=e,l=n.length,c=[];let u=s,h=t[0].start,f=h;function m(g,p,x,S){const v=o?-1:1;if(g!==p){for(g+=l;n[g%l].skip;)g-=v;for(;n[p%l].skip;)p+=v;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:x,style:S}),u=S,h=p%l)}}for(const g of t){h=o?h:g.start;let p=n[h%l],x;for(f=h+1;f<=g.end;f++){const S=n[f%l];x=Ru(i.setContext(Cn(r,{type:"segment",p0:p,p1:S,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),uy(x,u)&&m(h,f-1,g.loop,u),p=S,u=x}h<f-1&&m(h,f-1,g.loop,u)}return c}function Ru(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function uy(e,t){if(!t)return!1;const n=[],i=function(r,s){return Ka(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Ms(e,t,n){return e.options.clip?e[n]:t[n]}function dy(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Ms(n,t,"left"),right:Ms(n,t,"right"),top:Ms(i,t,"top"),bottom:Ms(i,t,"bottom")}:t}function Au(e,t){const n=t._clip;if(n.disabled)return!1;const i=dy(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
|
11
|
+
*/function tn(){}const Xg=(()=>{let e=0;return()=>e++})();function st(e){return e==null}function kt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ft(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function At(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function De(e,t){return At(e)?e:t}function at(e,t){return typeof e>"u"?t:e}const Gg=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,qc=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Mt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Tt(e,t,n,i){let r,s,a;if(kt(e))for(s=e.length,r=0;r<s;r++)t.call(n,e[r],r);else if(ft(e))for(a=Object.keys(e),s=a.length,r=0;r<s;r++)t.call(n,e[a[r]],a[r])}function hs(e,t){let n,i,r,s;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(r=e[n],s=t[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function fs(e){if(kt(e))return e.map(fs);if(ft(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let r=0;for(;r<i;++r)t[n[r]]=fs(e[n[r]]);return t}return e}function Xc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Kg(e,t,n,i){if(!Xc(e))return;const r=t[e],s=n[e];ft(r)&&ft(s)?tr(r,s,i):t[e]=fs(s)}function tr(e,t,n){const i=kt(t)?t:[t],r=i.length;if(!ft(e))return e;n=n||{};const s=n.merger||Kg;let a;for(let o=0;o<r;++o){if(a=i[o],!ft(a))continue;const c=Object.keys(a);for(let l=0,u=c.length;l<u;++l)s(c[l],e,a,n)}return e}function er(e,t){return tr(e,t,{merger:Zg})}function Zg(e,t,n){if(!Xc(e))return;const i=t[e],r=n[e];ft(i)&&ft(r)?er(i,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=fs(r))}const Gc={"":e=>e,x:e=>e.x,y:e=>e.y};function Qg(e){const t=e.split("."),n=[];let i="";for(const r of t)i+=r,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function Jg(e){const t=Qg(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function kn(e,t){return(Gc[t]||(Gc[t]=Jg(t)))(e)}function Ua(e){return e.charAt(0).toUpperCase()+e.slice(1)}const ye=e=>typeof e<"u",be=e=>typeof e=="function",Kc=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function tp(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const dt=Math.PI,Ot=2*dt,ep=Ot+dt,ms=Number.POSITIVE_INFINITY,qa=dt/180,Pt=dt/2,Pe=dt/4,gs=dt*2/3,Mn=Math.log10,Ye=Math.sign;function nr(e,t,n){return Math.abs(e-t)<n}function Zc(e){const t=Math.round(e);e=nr(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Mn(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function np(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((r,s)=>r-s).pop(),t}function ip(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Tn(e){return!ip(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function rp(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Qc(e,t,n){let i,r,s;for(i=0,r=e.length;i<r;i++)s=e[i][n],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function jt(e){return e*(dt/180)}function ps(e){return e*(180/dt)}function Jc(e){if(!At(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function ys(e,t){const n=t.x-e.x,i=t.y-e.y,r=Math.sqrt(n*n+i*i);let s=Math.atan2(i,n);return s<-.5*dt&&(s+=Ot),{angle:s,distance:r}}function bi(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function sp(e,t){return(e-t+ep)%Ot-dt}function se(e){return(e%Ot+Ot)%Ot}function ir(e,t,n,i){const r=se(e),s=se(t),a=se(n),o=se(s-r),c=se(a-r),l=se(r-s),u=se(r-a);return r===s||r===a||i&&s===a||o>c&&l<u}function Qt(e,t,n){return Math.max(t,Math.min(n,e))}function ap(e){return Qt(e,-32768,32767)}function en(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Xa(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,r=0,s;for(;i-r>1;)s=r+i>>1,n(s)?r=s:i=s;return{lo:r,hi:i}}const nn=(e,t,n,i)=>Xa(e,n,i?r=>{const s=e[r][t];return s<n||s===n&&e[r+1][t]===n}:r=>e[r][t]<n),op=(e,t,n)=>Xa(e,n,i=>e[i][t]>=n);function lp(e,t,n){let i=0,r=e.length;for(;i<r&&e[i]<t;)i++;for(;r>i&&e[r-1]>n;)r--;return i>0||r<e.length?e.slice(i,r):e}const tu=["push","pop","shift","splice","unshift"];function cp(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),tu.forEach(n=>{const i="_onData"+Ua(n),r=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...s){const a=r.apply(this,s);return e._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...s)}),a}})})}function eu(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,r=i.indexOf(t);r!==-1&&i.splice(r,1),!(i.length>0)&&(tu.forEach(s=>{delete e[s]}),delete e._chartjs)}function nu(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const iu=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function ru(e,t){let n=[],i=!1;return function(...r){n=r,i||(i=!0,iu.call(window,()=>{i=!1,e.apply(t,n)}))}}function up(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Ga=e=>e==="start"?"left":e==="end"?"right":"center",ae=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,dp=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function su(e,t,n){const i=t.length;let r=0,s=i;if(e._sorted){const{iScale:a,vScale:o,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:g}=a.getUserBounds();if(m){if(r=Math.min(nn(c,u,h).lo,n?i:nn(t,u,a.getPixelForValue(h)).lo),l){const p=c.slice(0,r+1).reverse().findIndex(x=>!st(x[o.axis]));r-=Math.max(0,p)}r=Qt(r,0,i-1)}if(g){let p=Math.max(nn(c,a.axis,f,!0).hi+1,n?0:nn(t,u,a.getPixelForValue(f),!0).hi+1);if(l){const x=c.slice(p-1).findIndex(S=>!st(S[o.axis]));p+=Math.max(0,x)}s=Qt(p,r,i)-r}else s=i-r}return{start:r,count:s}}function au(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,r={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=r,!0;const s=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,r),s}const bs=e=>e===0||e===1,ou=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*Ot/n)),lu=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*Ot/n)+1,rr={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Pt)+1,easeOutSine:e=>Math.sin(e*Pt),easeInOutSine:e=>-.5*(Math.cos(dt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>bs(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>bs(e)?e:ou(e,.075,.3),easeOutElastic:e=>bs(e)?e:lu(e,.075,.3),easeInOutElastic(e){return bs(e)?e:e<.5?.5*ou(e*2,.1125,.45):.5+.5*lu(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-rr.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?rr.easeInBounce(e*2)*.5:rr.easeOutBounce(e*2-1)*.5+.5};function Ka(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function cu(e){return Ka(e)?e:new Ji(e)}function Za(e){return Ka(e)?e:new Ji(e).saturate(.5).darken(.1).hexString()}const hp=["x","y","borderWidth","radius","tension"],fp=["color","borderColor","backgroundColor"];function mp(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:fp},numbers:{type:"number",properties:hp}}),e.describe("animations",{_fallback:"animation"}),e.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 gp(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const uu=new Map;function pp(e,t){t=t||{};const n=e+JSON.stringify(t);let i=uu.get(n);return i||(i=new Intl.NumberFormat(e,t),uu.set(n,i)),i}function sr(e,t,n){return pp(t,n).format(e)}const du={values(e){return kt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let r,s=e;if(n.length>1){const l=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(l<1e-4||l>1e15)&&(r="scientific"),s=yp(e,n)}const a=Mn(Math.abs(s)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:r,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(c,this.options.ticks.format),sr(e,i,c)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Mn(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?du.numeric.call(this,e,t,n):""}};function yp(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var _s={formatters:du};function bp(e){e.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,n)=>n.lineWidth,tickColor:(t,n)=>n.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:_s.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const jn=Object.create(null),Qa=Object.create(null);function ar(e,t){if(!t)return e;const n=t.split(".");for(let i=0,r=n.length;i<r;++i){const s=n[i];e=e[s]||(e[s]=Object.create(null))}return e}function Ja(e,t,n){return typeof t=="string"?tr(ar(e,t),n):tr(ar(e,""),t)}class _p{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,r)=>Za(r.backgroundColor),this.hoverBorderColor=(i,r)=>Za(r.borderColor),this.hoverColor=(i,r)=>Za(r.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Ja(this,t,n)}get(t){return ar(this,t)}describe(t,n){return Ja(Qa,t,n)}override(t,n){return Ja(jn,t,n)}route(t,n,i,r){const s=ar(this,t),a=ar(this,i),o="_"+n;Object.defineProperties(s,{[o]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[o],l=a[r];return ft(c)?Object.assign({},l,c):at(c,l)},set(c){this[o]=c}}})}apply(t){t.forEach(n=>n(this))}}var Rt=new _p({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[mp,gp,bp]);function xp(e){return!e||st(e.size)||st(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function xs(e,t,n,i,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,n.push(r)),s>i&&(i=s),i}function wp(e,t,n,i){i=i||{};let r=i.data=i.data||{},s=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(r=i.data={},s=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const o=n.length;let c,l,u,h,f;for(c=0;c<o;c++)if(h=n[c],h!=null&&!kt(h))a=xs(e,r,s,a,h);else if(kt(h))for(l=0,u=h.length;l<u;l++)f=h[l],f!=null&&!kt(f)&&(a=xs(e,r,s,a,f));e.restore();const m=s.length/2;if(m>n.length){for(c=0;c<m;c++)delete r[s[c]];s.splice(0,m)}return a}function Un(e,t,n){const i=e.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((t-r)*i)/i+r}function hu(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function to(e,t,n,i){fu(e,t,n,i,null)}function fu(e,t,n,i,r){let s,a,o,c,l,u,h,f;const m=t.pointStyle,g=t.rotation,p=t.radius;let x=(g||0)*qa;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(x),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),m){default:r?e.ellipse(n,i,r/2,p,0,0,Ot):e.arc(n,i,p,0,Ot),e.closePath();break;case"triangle":u=r?r/2:p,e.moveTo(n+Math.sin(x)*u,i-Math.cos(x)*p),x+=gs,e.lineTo(n+Math.sin(x)*u,i-Math.cos(x)*p),x+=gs,e.lineTo(n+Math.sin(x)*u,i-Math.cos(x)*p),e.closePath();break;case"rectRounded":l=p*.516,c=p-l,a=Math.cos(x+Pe)*c,h=Math.cos(x+Pe)*(r?r/2-l:c),o=Math.sin(x+Pe)*c,f=Math.sin(x+Pe)*(r?r/2-l:c),e.arc(n-h,i-o,l,x-dt,x-Pt),e.arc(n+f,i-a,l,x-Pt,x),e.arc(n+h,i+o,l,x,x+Pt),e.arc(n-f,i+a,l,x+Pt,x+dt),e.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*p,u=r?r/2:c,e.rect(n-u,i-c,2*u,2*c);break}x+=Pe;case"rectRot":h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+f,i-a),e.lineTo(n+h,i+o),e.lineTo(n-f,i+a),e.closePath();break;case"crossRot":x+=Pe;case"cross":h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"star":h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a),x+=Pe,h=Math.cos(x)*(r?r/2:p),a=Math.cos(x)*p,o=Math.sin(x)*p,f=Math.sin(x)*(r?r/2:p),e.moveTo(n-h,i-o),e.lineTo(n+h,i+o),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"line":a=r?r/2:Math.cos(x)*p,o=Math.sin(x)*p,e.moveTo(n-a,i-o),e.lineTo(n+a,i+o);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(x)*(r?r/2:p),i+Math.sin(x)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function rn(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function or(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function lr(e){e.restore()}function vp(e,t,n,i,r){if(!t)return e.lineTo(n.x,n.y);if(r==="middle"){const s=(t.x+n.x)/2;e.lineTo(s,t.y),e.lineTo(s,n.y)}else r==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Sp(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function kp(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),st(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Mp(e,t,n,i,r){if(r.strikethrough||r.underline){const s=e.measureText(i),a=t-s.actualBoundingBoxLeft,o=t+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,l=n+s.actualBoundingBoxDescent,u=r.strikethrough?(c+l)/2:l;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(a,u),e.lineTo(o,u),e.stroke()}}function Tp(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function qn(e,t,n,i,r,s={}){const a=kt(t)?t:[t],o=s.strokeWidth>0&&s.strokeColor!=="";let c,l;for(e.save(),e.font=r.string,kp(e,s),c=0;c<a.length;++c)l=a[c],s.backdrop&&Tp(e,s.backdrop),o&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),st(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(l,n,i,s.maxWidth)),e.fillText(l,n,i,s.maxWidth),Mp(e,n,i,l,s),i+=Number(r.lineHeight);e.restore()}function _i(e,t){const{x:n,y:i,w:r,h:s,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*dt,dt,!0),e.lineTo(n,i+s-a.bottomLeft),e.arc(n+a.bottomLeft,i+s-a.bottomLeft,a.bottomLeft,dt,Pt,!0),e.lineTo(n+r-a.bottomRight,i+s),e.arc(n+r-a.bottomRight,i+s-a.bottomRight,a.bottomRight,Pt,0,!0),e.lineTo(n+r,i+a.topRight),e.arc(n+r-a.topRight,i+a.topRight,a.topRight,0,-Pt,!0),e.lineTo(n+a.topLeft,i)}const Dp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Cp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ep(e,t){const n=(""+e).match(Dp);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const Op=e=>+e||0;function eo(e,t){const n={},i=ft(t),r=i?Object.keys(t):t,s=ft(e)?i?a=>at(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of r)n[a]=Op(s(a));return n}function mu(e){return eo(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Dn(e){return eo(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(e){const t=mu(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function It(e,t){e=e||{},t=t||Rt.font;let n=at(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=at(e.style,t.style);i&&!(""+i).match(Cp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const r={family:at(e.family,t.family),lineHeight:Ep(at(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:at(e.weight,t.weight),string:""};return r.string=xp(r),r}function cr(e,t,n,i){let r,s,a;for(r=0,s=e.length;r<s;++r)if(a=e[r],a!==void 0&&a!==void 0)return a}function Pp(e,t,n){const{min:i,max:r}=e,s=qc(t,(r-i)/2),a=(o,c)=>n&&o===0?0:o+c;return{min:a(i,-Math.abs(s)),max:a(r,s)}}function Cn(e,t){return Object.assign(Object.create(e),t)}function no(e,t=[""],n,i,r=()=>e[0]){const s=n||e;typeof i>"u"&&(i=_u("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:i,_getTarget:r,override:o=>no([o,...e],t,s,i)};return new Proxy(a,{deleteProperty(o,c){return delete o[c],delete o._keys,delete e[0][c],!0},get(o,c){return pu(o,c,()=>zp(c,t,e,o))},getOwnPropertyDescriptor(o,c){return Reflect.getOwnPropertyDescriptor(o._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(o,c){return xu(o).includes(c)},ownKeys(o){return xu(o)},set(o,c,l){const u=o._storage||(o._storage=r());return o[c]=u[c]=l,delete o._keys,!0}})}function xi(e,t,n,i){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:gu(e,i),setContext:s=>xi(e,s,n,i),override:s=>xi(e.override(s),t,n,i)};return new Proxy(r,{deleteProperty(s,a){return delete s[a],delete e[a],!0},get(s,a,o){return pu(s,a,()=>Ap(s,a,o))},getOwnPropertyDescriptor(s,a){return s._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(s,a,o){return e[a]=o,delete s[a],!0}})}function gu(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:n,indexable:i,isScriptable:be(n)?n:()=>n,isIndexable:be(i)?i:()=>i}}const Rp=(e,t)=>e?e+Ua(t):t,io=(e,t)=>ft(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pu(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function Ap(e,t,n){const{_proxy:i,_context:r,_subProxy:s,_descriptors:a}=e;let o=i[t];return be(o)&&a.isScriptable(t)&&(o=Ip(t,o,e,n)),kt(o)&&o.length&&(o=Lp(t,o,e,a.isIndexable)),io(t,o)&&(o=xi(o,r,s&&s[t],a)),o}function Ip(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_stack:o}=n;if(o.has(e))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+e);o.add(e);let c=t(s,a||i);return o.delete(e),io(e,c)&&(c=ro(r._scopes,r,e,c)),c}function Lp(e,t,n,i){const{_proxy:r,_context:s,_subProxy:a,_descriptors:o}=n;if(typeof s.index<"u"&&i(e))return t[s.index%t.length];if(ft(t[0])){const c=t,l=r._scopes.filter(u=>u!==c);t=[];for(const u of c){const h=ro(l,r,e,u);t.push(xi(h,s,a&&a[e],o))}}return t}function yu(e,t,n){return be(e)?e(t,n):e}const Np=(e,t)=>e===!0?t:typeof e=="string"?kn(t,e):void 0;function Fp(e,t,n,i,r){for(const s of t){const a=Np(n,s);if(a){e.add(a);const o=yu(a._fallback,n,r);if(typeof o<"u"&&o!==n&&o!==i)return o}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function ro(e,t,n,i){const r=t._rootScopes,s=yu(t._fallback,n,i),a=[...e,...r],o=new Set;o.add(i);let c=bu(o,a,n,s||n,i);return c===null||typeof s<"u"&&s!==n&&(c=bu(o,a,s,c,i),c===null)?!1:no(Array.from(o),[""],r,s,()=>Bp(t,n,i))}function bu(e,t,n,i,r){for(;n;)n=Fp(e,t,n,i,r);return n}function Bp(e,t,n){const i=e._getTarget();t in i||(i[t]={});const r=i[t];return kt(r)&&ft(n)?n:r||{}}function zp(e,t,n,i){let r;for(const s of t)if(r=_u(Rp(s,e),n),typeof r<"u")return io(e,r)?ro(n,i,e,r):r}function _u(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function xu(e){let t=e._keys;return t||(t=e._keys=Hp(e._scopes)),t}function Hp(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(r=>!r.startsWith("_")))t.add(i);return Array.from(t)}function wu(e,t,n,i){const{iScale:r}=e,{key:s="r"}=this._parsing,a=new Array(i);let o,c,l,u;for(o=0,c=i;o<c;++o)l=o+n,u=t[l],a[o]={r:r.parse(kn(u,s),l)};return a}const Vp=Number.EPSILON||1e-14,wi=(e,t)=>t<e.length&&!e[t].skip&&e[t],vu=e=>e==="x"?"y":"x";function Wp(e,t,n,i){const r=e.skip?t:e,s=t,a=n.skip?t:n,o=bi(s,r),c=bi(a,s);let l=o/(o+c),u=c/(o+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;const h=i*l,f=i*u;return{previous:{x:s.x-h*(a.x-r.x),y:s.y-h*(a.y-r.y)},next:{x:s.x+f*(a.x-r.x),y:s.y+f*(a.y-r.y)}}}function Yp(e,t,n){const i=e.length;let r,s,a,o,c,l=wi(e,0);for(let u=0;u<i-1;++u)if(c=l,l=wi(e,u+1),!(!c||!l)){if(nr(t[u],0,Vp)){n[u]=n[u+1]=0;continue}r=n[u]/t[u],s=n[u+1]/t[u],o=Math.pow(r,2)+Math.pow(s,2),!(o<=9)&&(a=3/Math.sqrt(o),n[u]=r*a*t[u],n[u+1]=s*a*t[u])}}function $p(e,t,n="x"){const i=vu(n),r=e.length;let s,a,o,c=wi(e,0);for(let l=0;l<r;++l){if(a=o,o=c,c=wi(e,l+1),!o)continue;const u=o[n],h=o[i];a&&(s=(u-a[n])/3,o[`cp1${n}`]=u-s,o[`cp1${i}`]=h-s*t[l]),c&&(s=(c[n]-u)/3,o[`cp2${n}`]=u+s,o[`cp2${i}`]=h+s*t[l])}}function jp(e,t="x"){const n=vu(t),i=e.length,r=Array(i).fill(0),s=Array(i);let a,o,c,l=wi(e,0);for(a=0;a<i;++a)if(o=c,c=l,l=wi(e,a+1),!!c){if(l){const u=l[t]-c[t];r[a]=u!==0?(l[n]-c[n])/u:0}s[a]=o?l?Ye(r[a-1])!==Ye(r[a])?0:(r[a-1]+r[a])/2:r[a-1]:r[a]}Yp(e,r,s),$p(e,s,t)}function ws(e,t,n){return Math.max(Math.min(e,n),t)}function Up(e,t){let n,i,r,s,a,o=rn(e[0],t);for(n=0,i=e.length;n<i;++n)a=s,s=o,o=n<i-1&&rn(e[n+1],t),s&&(r=e[n],a&&(r.cp1x=ws(r.cp1x,t.left,t.right),r.cp1y=ws(r.cp1y,t.top,t.bottom)),o&&(r.cp2x=ws(r.cp2x,t.left,t.right),r.cp2y=ws(r.cp2y,t.top,t.bottom)))}function qp(e,t,n,i,r){let s,a,o,c;if(t.spanGaps&&(e=e.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")jp(e,r);else{let l=i?e[e.length-1]:e[0];for(s=0,a=e.length;s<a;++s)o=e[s],c=Wp(l,o,e[Math.min(s+1,a-(i?0:1))%a],t.tension),o.cp1x=c.previous.x,o.cp1y=c.previous.y,o.cp2x=c.next.x,o.cp2y=c.next.y,l=o}t.capBezierPoints&&Up(e,n)}function so(){return typeof window<"u"&&typeof document<"u"}function ao(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function vs(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const Ss=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Xp(e,t){return Ss(e).getPropertyValue(t)}const Gp=["top","right","bottom","left"];function Xn(e,t,n){const i={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=Gp[r];i[s]=parseFloat(e[t+"-"+s+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Kp=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Zp(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:r,offsetY:s}=i;let a=!1,o,c;if(Kp(r,s,e.target))o=r,c=s;else{const l=t.getBoundingClientRect();o=i.clientX-l.left,c=i.clientY-l.top,a=!0}return{x:o,y:c,box:a}}function En(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,r=Ss(n),s=r.boxSizing==="border-box",a=Xn(r,"padding"),o=Xn(r,"border","width"),{x:c,y:l,box:u}=Zp(e,n),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:g}=t;return s&&(m-=a.width+o.width,g-=a.height+o.height),{x:Math.round((c-h)/m*n.width/i),y:Math.round((l-f)/g*n.height/i)}}function Qp(e,t,n){let i,r;if(t===void 0||n===void 0){const s=e&&ao(e);if(!s)t=e.clientWidth,n=e.clientHeight;else{const a=s.getBoundingClientRect(),o=Ss(s),c=Xn(o,"border","width"),l=Xn(o,"padding");t=a.width-l.width-c.width,n=a.height-l.height-c.height,i=vs(o.maxWidth,s,"clientWidth"),r=vs(o.maxHeight,s,"clientHeight")}}return{width:t,height:n,maxWidth:i||ms,maxHeight:r||ms}}const ks=e=>Math.round(e*10)/10;function Jp(e,t,n,i){const r=Ss(e),s=Xn(r,"margin"),a=vs(r.maxWidth,e,"clientWidth")||ms,o=vs(r.maxHeight,e,"clientHeight")||ms,c=Qp(e,t,n);let{width:l,height:u}=c;if(r.boxSizing==="content-box"){const f=Xn(r,"border","width"),m=Xn(r,"padding");l-=m.width+f.width,u-=m.height+f.height}return l=Math.max(0,l-s.width),u=Math.max(0,i?l/i:u-s.height),l=ks(Math.min(l,a,c.maxWidth)),u=ks(Math.min(u,o,c.maxHeight)),l&&!u&&(u=ks(l/2)),(t!==void 0||n!==void 0)&&i&&c.height&&u>c.height&&(u=c.height,l=ks(Math.floor(u*i))),{width:l,height:u}}function Su(e,t,n){const i=t||1,r=Math.floor(e.height*i),s=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==r||a.width!==s?(e.currentDevicePixelRatio=i,a.height=r,a.width=s,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const ty=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};so()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function ku(e,t){const n=Xp(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Gn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function ey(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function ny(e,t,n,i){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},a=Gn(e,r,n),o=Gn(r,s,n),c=Gn(s,t,n),l=Gn(a,o,n),u=Gn(o,c,n);return Gn(l,u,n)}const iy=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},ry=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function vi(e,t,n){return e?iy(t,n):ry()}function Mu(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Tu(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Du(e){return e==="angle"?{between:ir,compare:sp,normalize:se}:{between:en,compare:(t,n)=>t-n,normalize:t=>t}}function Cu({start:e,end:t,count:n,loop:i,style:r}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:r}}function sy(e,t,n){const{property:i,start:r,end:s}=n,{between:a,normalize:o}=Du(i),c=t.length;let{start:l,end:u,loop:h}=e,f,m;if(h){for(l+=c,u+=c,f=0,m=c;f<m&&a(o(t[l%c][i]),r,s);++f)l--,u--;l%=c,u%=c}return u<l&&(u+=c),{start:l,end:u,loop:h,style:e.style}}function Eu(e,t,n){if(!n)return[e];const{property:i,start:r,end:s}=n,a=t.length,{compare:o,between:c,normalize:l}=Du(i),{start:u,end:h,loop:f,style:m}=sy(e,t,n),g=[];let p=!1,x=null,S,v,k;const D=()=>c(r,k,S)&&o(r,k)!==0,M=()=>o(s,S)===0||c(s,k,S),P=()=>p||D(),E=()=>!p||M();for(let y=u,_=u;y<=h;++y)v=t[y%a],!v.skip&&(S=l(v[i]),S!==k&&(p=c(S,r,s),x===null&&P()&&(x=o(S,r)===0?y:_),x!==null&&E()&&(g.push(Cu({start:x,end:y,loop:f,count:a,style:m})),x=null),_=y,k=S));return x!==null&&g.push(Cu({start:x,end:h,loop:f,count:a,style:m})),g}function Ou(e,t){const n=[],i=e.segments;for(let r=0;r<i.length;r++){const s=Eu(i[r],e.points,t);s.length&&n.push(...s)}return n}function ay(e,t,n,i){let r=0,s=t-1;if(n&&!i)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,n&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function oy(e,t,n,i){const r=e.length,s=[];let a=t,o=e[t],c;for(c=t+1;c<=n;++c){const l=e[c%r];l.skip||l.stop?o.skip||(i=!1,s.push({start:t%r,end:(c-1)%r,loop:i}),t=a=l.stop?c:null):(a=c,o.skip&&(t=c)),o=l}return a!==null&&s.push({start:t%r,end:a%r,loop:i}),s}function ly(e,t){const n=e.points,i=e.options.spanGaps,r=n.length;if(!r)return[];const s=!!e._loop,{start:a,end:o}=ay(n,r,s,i);if(i===!0)return Pu(e,[{start:a,end:o,loop:s}],n,t);const c=o<a?o+r:o,l=!!e._fullLoop&&a===0&&o===r-1;return Pu(e,oy(n,a,c,l),n,t)}function Pu(e,t,n,i){return!i||!i.setContext||!n?t:cy(e,t,n,i)}function cy(e,t,n,i){const r=e._chart.getContext(),s=Ru(e.options),{_datasetIndex:a,options:{spanGaps:o}}=e,c=n.length,l=[];let u=s,h=t[0].start,f=h;function m(g,p,x,S){const v=o?-1:1;if(g!==p){for(g+=c;n[g%c].skip;)g-=v;for(;n[p%c].skip;)p+=v;g%c!==p%c&&(l.push({start:g%c,end:p%c,loop:x,style:S}),u=S,h=p%c)}}for(const g of t){h=o?h:g.start;let p=n[h%c],x;for(f=h+1;f<=g.end;f++){const S=n[f%c];x=Ru(i.setContext(Cn(r,{type:"segment",p0:p,p1:S,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:a}))),uy(x,u)&&m(h,f-1,g.loop,u),p=S,u=x}h<f-1&&m(h,f-1,g.loop,u)}return l}function Ru(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function uy(e,t){if(!t)return!1;const n=[],i=function(r,s){return Ka(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Ms(e,t,n){return e.options.clip?e[n]:t[n]}function dy(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Ms(n,t,"left"),right:Ms(n,t,"right"),top:Ms(i,t,"top"),bottom:Ms(i,t,"bottom")}:t}function Au(e,t){const n=t._clip;if(n.disabled)return!1;const i=dy(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}/*!
|
|
12
12
|
* Chart.js v4.5.0
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class hy{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],a=n.duration;s.forEach(o=>o({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=iu.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,o=!1,l;for(;a>=0;--a)l=s[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(s[a]=s[s.length-1],s.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var sn=new hy;const Iu="transparent",fy={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=cu(e||Iu),r=i.valid&&cu(t||Iu);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class my{constructor(t,n,i,r){const s=n[i];r=cr([t.to,r,s,t.from]);const a=cr([t.from,s,r]);this._active=!0,this._fn=t.fn||fy[t.type||typeof a],this._easing=rr[t.easing]||rr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=cr([t.to,n,r,t.from]),this._from=cr([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,o=this._to;let l;if(this._active=s!==o&&(a||n<i),!this._active){this._target[r]=o,this._notify(!0);return}if(n<0){this._target[r]=s;return}l=n/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[r]=this._fn(s,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class oo{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ft(t))return;const n=Object.keys(Rt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!ft(s))return;const a={};for(const o of n)a[o]=s[o];(kt(s.properties)&&s.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,n){const i=n.options,r=py(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&gy(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),o=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){r.push(...this._animateOptions(t,n));continue}const u=n[c];let h=s[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,u,o);continue}else h.cancel();if(!f||!f.duration){t[c]=u;continue}s[c]=h=new my(f,t,c,u),r.push(h)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return sn.add(this._chart,i),!0}}function gy(e,t){const n=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=e[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function py(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Lu(e,t){const n=e&&e.options||{},i=n.reverse,r=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function yy(e,t,n){if(n===!1)return!1;const i=Lu(e,n),r=Lu(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function by(e){let t,n,i,r;return ft(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:e===!1}}function Nu(e,t){const n=[],i=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function Fu(e,t,n,i={}){const r=e.keys,s=i.mode==="single";let a,o,l,c;if(t===null)return;let u=!1;for(a=0,o=r.length;a<o;++a){if(l=+r[a],l===n){if(u=!0,i.all)continue;break}c=e.values[l],At(c)&&(s||t===0||Ye(t)===Ye(c))&&(t+=c)}return!u&&!i.all?0:t}function _y(e,t){const{iScale:n,vScale:i}=t,r=n.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(e),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[r]:u,[s]:e[u]};return o}function lo(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function xy(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function wy(e){const{min:t,max:n,minDefined:i,maxDefined:r}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function vy(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Bu(e,t,n,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=e[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function zu(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:o}=i,l=s.axis,c=a.axis,u=xy(s,a,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[l]:p,[c]:x}=g,S=g._stacks||(g._stacks={});f=S[c]=vy(r,u,p),f[o]=x,f._top=Bu(f,a,!0,i.type),f._bottom=Bu(f,a,!1,i.type);const v=f._visualValues||(f._visualValues={});v[o]=x}}function co(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Sy(e,t){return Cn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ky(e,t,n){return Cn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ur(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const uo=e=>e==="reset"||e==="none",Hu=(e,t)=>t?e:Object.assign({},e),My=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Nu(n,!0),values:null};class Be{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=lo(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&&ur(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,s=n.xAxisID=at(i.xAxisID,co(t,"x")),a=n.yAxisID=at(i.yAxisID,co(t,"y")),o=n.rAxisID=at(i.rAxisID,co(t,"r")),l=n.indexAxis,c=n.iAxisID=r(l,s,a,o),u=n.vAxisID=r(l,a,s,o);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(o),n.iScale=this.getScaleForId(c),n.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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&eu(this._data,this),t._stacked&&ur(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(ft(n)){const r=this._cachedMeta;this._data=_y(n,r)}else if(i!==n){if(i){eu(i,this);const r=this._cachedMeta;ur(r),r._parsed=[]}n&&Object.isExtensible(n)&&cp(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=lo(n.vScale,n),n.stack!==i.stack&&(r=!0,ur(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(zu(this,n._parsed),n._stacked=lo(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,o=s.axis;let l=t===0&&n===r.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{kt(r[t])?f=this.parseArrayData(i,r,t,n):ft(r[t])?f=this.parseObjectData(i,r,t,n):f=this.parsePrimitiveData(i,r,t,n);const m=()=>h[o]===null||c&&h[o]<c[o];for(u=0;u<n;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&zu(this,f)}parsePrimitiveData(t,n,i,r){const{iScale:s,vScale:a}=t,o=s.axis,l=a.axis,c=s.getLabels(),u=s===a,h=new Array(r);let f,m,g;for(f=0,m=r;f<m;++f)g=f+i,h[f]={[o]:u||s.parse(c[g],g),[l]:a.parse(n[g],g)};return h}parseArrayData(t,n,i,r){const{xScale:s,yScale:a}=t,o=new Array(r);let l,c,u,h;for(l=0,c=r;l<c;++l)u=l+i,h=n[u],o[l]={x:s.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,n,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(r);let u,h,f,m;for(u=0,h=r;u<h;++u)f=u+i,m=n[f],c[u]={x:s.parse(kn(m,o),f),y:a.parse(kn(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const r=this.chart,s=this._cachedMeta,a=n[t.axis],o={keys:Nu(r,!0),values:n._stacks[t.axis]._visualValues};return Fu(o,a,s.index,{mode:i})}updateRangeFromParsed(t,n,i,r){const s=i[n.axis];let a=s===null?NaN:s;const o=r&&i._stacks[n.axis];r&&o&&(r.values=o,a=Fu(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,o=this._getOtherScale(t),l=My(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=wy(o);let f,m;function g(){m=r[f];const p=m[o.axis];return!At(m[t.axis])||u>p||h<p}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(c,t,m,l),s));++f);if(s){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r<s;++r)a=n[r][t.axis],At(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=by(at(this.options.clip,yy(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||r.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,s,o,l),u=o;u<o+l;++u){const h=r[u];h.hidden||(h.active&&c?a.push(h):h.draw(t,s))}for(u=0;u<a.length;++u)a[u].draw(t,s)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=ky(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Sy(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const r=n==="active",s=this._cachedDataOpts,a=t+"-"+n,o=s[a],l=this.enableOptionSharing&&ye(i);if(o)return Hu(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=r?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Rt.elements[t]),g=()=>this.getContext(i,r,n),p=c.resolveNamedOptions(f,m,g,h);return p.$shared&&(p.$shared=l,s[a]=Object.freeze(Hu(p,l))),p}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,o=s[a];if(o)return o;let l;if(r.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,n))}const c=new oo(r,l&&l.animations);return l&&l._cacheable&&(s[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||uo(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){uo(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!uo(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,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 n=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const r=i.length,s=n.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,n,i=!0){const r=this._cachedMeta,s=r.data,a=t+n;let o;const l=c=>{for(c.length+=n,o=c.length-1;o>=a;o--)c[o]=c[o-n]};for(l(s),o=t;o<a;++o)s[o]=new this.dataElementType;this._parsing&&l(r._parsed),this.parse(t,n),i&&this.updateElements(s,t,n,"reset")}updateElements(t,n,i,r){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,n);i._stacked&&ur(i,r)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,r]=t;this[n](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(Be,"defaults",{}),R(Be,"datasetElementType",null),R(Be,"dataElementType",null);function Ty(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=nu(i.sort((r,s)=>r-s))}return e._cache.$bar}function Dy(e){const t=e.iScale,n=Ty(t,e.type);let i=t._length,r,s,a,o;const l=()=>{a===32767||a===-32768||(ye(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(r=0,s=n.length;r<s;++r)a=t.getPixelForValue(n[r]),l();for(o=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),l();return i}function Cy(e,t,n,i){const r=n.barThickness;let s,a;return st(r)?(s=t.min*n.categoryPercentage,a=n.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[e]-s/2}}function Ey(e,t,n,i){const r=t.pixels,s=r[e];let a=e>0?r[e-1]:null,o=e<r.length-1?r[e+1]:null;const l=n.categoryPercentage;a===null&&(a=s-(o===null?t.end-t.start:o-s)),o===null&&(o=s+s-a);const c=s-(s-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:n.barPercentage,start:c}}function Oy(e,t,n,i){const r=n.parse(e[0],i),s=n.parse(e[1],i),a=Math.min(r,s),o=Math.max(r,s);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:r,end:s,min:a,max:o}}function Vu(e,t,n,i){return kt(e)?Oy(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Wu(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),o=r===s,l=[];let c,u,h,f;for(c=n,u=n+i;c<u;++c)f=t[c],h={},h[r.axis]=o||r.parse(a[c],c),l.push(Vu(f,h,s,c));return l}function ho(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Py(e,t,n){return e!==0?Ye(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Ry(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:t,top:r,bottom:s}}function Ay(e,t,n,i){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:l,top:c,bottom:u}=Ry(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=c:(n._bottom||0)===i?r=u:(s[Yu(u,a,o,l)]=!0,r=c)),s[Yu(r,a,o,l)]=!0,e.borderSkipped=s}function Yu(e,t,n,i){return i?(e=Iy(e,t,n),e=$u(e,n,t)):e=$u(e,t,n),e}function Iy(e,t,n){return e===t?n:e===n?t:e}function $u(e,t,n){return e==="start"?t:e==="end"?n:e}function Ly(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class dr extends Be{parsePrimitiveData(t,n,i,r){return Wu(t,n,i,r)}parseArrayData(t,n,i,r){return Wu(t,n,i,r)}parseObjectData(t,n,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=s.axis==="x"?o:l,u=a.axis==="x"?o:l,h=[];let f,m,g,p;for(f=i,m=i+r;f<m;++f)p=n[f],g={},g[s.axis]=s.parse(kn(p,c),f),h.push(Vu(kn(p,u),g,a,f));return h}updateRangeFromParsed(t,n,i,r){super.updateRangeFromParsed(t,n,i,r);const s=i._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(t),a=s._custom,o=ho(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,r);for(let m=n;m<n+i;m++){const g=this.getParsed(m),p=s||st(g[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),S=(g._stacks||{})[o.axis],v={horizontal:c,base:p.base,enableBorderRadius:!S||ho(g._custom)||a===S._top||a===S._bottom,x:c?p.head:x.center,y:c?x.center:p.head,height:c?x.size:Math.abs(p.size),width:c?Math.abs(p.size):x.size};f&&(v.options=h||this.resolveDataElementOptions(m,t[m].active?"active":r));const k=v.options||t[m].options;Ay(v,k,S,a),Ly(v,k,u.ratio),this.updateElement(t[m],m,v,r)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(n),l=o&&o[i.axis],c=u=>{const h=u._parsed.find(m=>m[i.axis]===l),f=h&&h[u.vScale.axis];if(st(f)||isNaN(f))return!0};for(const u of r)if(!(n!==void 0&&c(u))&&((s===!1||a.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[at(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const o=t.barThickness;return{min:o||Dy(n),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,o=s||0,l=this.getParsed(t),c=l._custom,u=ho(c);let h=l[n.axis],f=0,m=i?this.applyStack(n,l,i):h,g,p;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&Ye(h)!==Ye(c.barEnd)&&(f=0),f+=h);const x=!st(s)&&!u?s:f;let S=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(f+m):g=S,p=g-S,Math.abs(p)<a){p=Py(p,n,o)*a,h===o&&(S-=p/2);const v=n.getPixelForDecimal(0),k=n.getPixelForDecimal(1),D=Math.min(v,k),M=Math.max(v,k);S=Math.max(Math.min(S,M),D),g=S+p,i&&!u&&(l._stacks[n.axis]._visualValues[r]=n.getValueForPixel(g)-n.getValueForPixel(S))}if(S===n.getPixelForValue(o)){const v=Ye(p)*n.getLineWidthForValue(o)/2;S+=v,p-=v}return{size:p,base:S,head:g,center:g+p/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=at(r.maxBarThickness,1/0);let o,l;const c=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(t):n.stackCount,h=r.barThickness==="flex"?Ey(t,n,r,u*c):Cy(t,n,r,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(at(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+m;o=h.start+h.chunk*g+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,n.min*n.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}R(dr,"id","bar"),R(dr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(dr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ts extends Be{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,r){const s=super.parsePrimitiveData(t,n,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,n,i,r){const s=super.parseArrayData(t,n,i,r);for(let a=0;a<s.length;a++){const o=n[i+a];s[a]._custom=at(o[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,n,i,r){const s=super.parseObjectData(t,n,i,r);for(let a=0;a<s.length;a++){const o=n[i+a];s[a]._custom=at(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),o=r.getLabelForValue(a.x),l=s.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,r),u=a.axis,h=o.axis;for(let f=n;f<n+i;f++){const m=t[f],g=!s&&this.getParsed(f),p={},x=p[u]=s?a.getPixelForDecimal(.5):a.getPixelForValue(g[u]),S=p[h]=s?o.getBasePixel():o.getPixelForValue(g[h]);p.skip=isNaN(x)||isNaN(S),c&&(p.options=l||this.resolveDataElementOptions(f,m.active?"active":r),s&&(p.options.radius=0)),this.updateElement(m,f,p,r)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=at(i&&i._custom,s),r}}R(Ts,"id","bubble"),R(Ts,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(Ts,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Ny(e,t,n){let i=1,r=1,s=0,a=0;if(t<Ot){const o=e,l=o+t,c=Math.cos(o),u=Math.sin(o),h=Math.cos(l),f=Math.sin(l),m=(k,D,M)=>ir(k,o,l,!0)?1:Math.max(D,D*n,M,M*n),g=(k,D,M)=>ir(k,o,l,!0)?-1:Math.min(D,D*n,M,M*n),p=m(0,c,h),x=m(Pt,u,f),S=g(dt,c,h),v=g(dt+Pt,u,f);i=(p-S)/2,r=(x-v)/2,s=-(p+S)/2,a=-(x+v)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class an extends Be{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;s=c=>+kn(i[c],l)}let a,o;for(a=t,o=t+n;a<o;++a)r._parsed[a]=s(a)}}_getRotation(){return jt(this.options.rotation-90)}_getCircumference(){return jt(this.options.circumference)}_getRotationExtents(){let t=Ot,n=-Ot;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),n=Math.max(n,s+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(Gg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:p}=Ny(h,u,l),x=(i.width-a)/f,S=(i.height-a)/m,v=Math.max(Math.min(x,S)/2,0),k=qc(this.options.radius,v),D=Math.max(k*l,0),M=(k-D)/this._getVisibleDatasetWeightTotal();this.offsetX=g*k,this.offsetY=p*k,r.total=this.calculateTotal(),this.outerRadius=k-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*c,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/Ot)}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=s&&c.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:p,includeOptions:x}=this._getSharedOptions(n,r);let S=this._getRotation(),v;for(v=0;v<n;++v)S+=this._circumference(v,s);for(v=n;v<n+i;++v){const k=this._circumference(v,s),D=t[v],M={x:u+this.offsetX,y:h+this.offsetY,startAngle:S,endAngle:S+k,circumference:k,outerRadius:g,innerRadius:m};x&&(M.options=p||this.resolveDataElementOptions(v,D.active?"active":r)),S+=k,this.updateElement(D,v,M,r)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,r;for(r=0;r<n.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ot*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=sr(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const i=this.chart;let r,s,a,o,l;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,o=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)l=o.resolveDataElementOptions(r),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(an,"id","doughnut"),R(an,"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"}),R(an,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(an,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class hr extends Be{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:o,count:l}=su(n,r,a);this._drawStart=o,this._drawCount=l,au(n)&&(o=0,l=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(r,o,l,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,r),f=a.axis,m=o.axis,{spanGaps:g,segment:p}=this.options,x=Tn(g)?g:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||s||r==="none",v=n+i,k=t.length;let D=n>0&&this.getParsed(n-1);for(let M=0;M<k;++M){const P=t[M],E=S?P:{};if(M<n||M>=v){E.skip=!0;continue}const y=this.getParsed(M),_=st(y[m]),T=E[f]=a.getPixelForValue(y[f],M),O=E[m]=s||_?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,y,l):y[m],M);E.skip=isNaN(T)||isNaN(O)||_,E.stop=M>0&&Math.abs(y[f]-D[f])>x,p&&(E.parsed=y,E.raw=c.data[M]),h&&(E.options=u||this.resolveDataElementOptions(M,P.active?"active":r)),S||this.updateElement(P,M,E,r),D=y}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(hr,"id","line"),R(hr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(hr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class fr extends Be{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=sr(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return wu.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),o=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*dt;let m=f,g;const p=360/this.countVisibleElements();for(g=0;g<n;++g)m+=this._computeAngle(g,r,p);for(g=n;g<n+i;g++){const x=t[g];let S=m,v=m+this._computeAngle(g,r,p),k=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=v,s&&(l.animateScale&&(k=0),l.animateRotate&&(S=v=f));const D={x:u,y:h,innerRadius:0,outerRadius:k,startAngle:S,endAngle:v,options:this.resolveDataElementOptions(g,x.active?"active":r)};this.updateElement(x,g,D,r)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?jt(this.resolveDataElementOptions(t,n).angle||i):0}}R(fr,"id","polarArea"),R(fr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(fr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:r,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class fo extends an{}R(fo,"id","pie"),R(fo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ds extends Be{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return wu.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let o=n;o<n+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":r),u=s.getPointPositionForValue(o,this.getParsed(o).r),h=a?s.xCenter:u.x,f=a?s.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,o,m,r)}}}R(Ds,"id","radar"),R(Ds,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Ds,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cs extends Be{getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),o=r.getLabelForValue(a.x),l=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:a}=su(n,i,r);if(this._drawStart=s,this._drawCount=a,au(n)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=n;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(n,r),h=this.getSharedOptions(u),f=this.includeOptions(r,h),m=a.axis,g=o.axis,{spanGaps:p,segment:x}=this.options,S=Tn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||r==="none";let k=n>0&&this.getParsed(n-1);for(let D=n;D<n+i;++D){const M=t[D],P=this.getParsed(D),E=v?M:{},y=st(P[g]),_=E[m]=a.getPixelForValue(P[m],D),T=E[g]=s||y?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,P,l):P[g],D);E.skip=isNaN(_)||isNaN(T)||y,E.stop=D>0&&Math.abs(P[m]-k[m])>S,x&&(E.parsed=P,E.raw=c.data[D]),f&&(E.options=h||this.resolveDataElementOptions(D,M.active?"active":r)),v||this.updateElement(M,D,E,r),k=P}this.updateSharedOptions(h,r,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let o=0;for(let l=n.length-1;l>=0;--l)o=Math.max(o,n[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}R(Cs,"id","scatter"),R(Cs,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(Cs,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Fy=Object.freeze({__proto__:null,BarController:dr,BubbleController:Ts,DoughnutController:an,LineController:hr,PieController:fo,PolarAreaController:fr,RadarController:Ds,ScatterController:Cs});function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mo{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(mo.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}}var ju={_date:mo};function By(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,o=r._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&s.length){const c=o._reversePixels?op:nn;if(i){if(r._sharedOptions){const u=s[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(s,t,n-h),m=c(s,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(s,t,n);if(l){const{vScale:h}=r._cachedMeta,{_parsed:f}=e,m=f.slice(0,u.lo+1).reverse().findIndex(p=>!st(p[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(p=>!st(p[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function mr(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let o=0,l=s.length;o<l;++o){const{index:c,data:u}=s[o],{lo:h,hi:f}=By(s[o],t,a,r);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,c,m)}}}function zy(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function go(e,t,n,i,r){const s=[];return!r&&!e.isPointInArea(t)||mr(e,n,t,function(o,l,c){!r&&!rn(o,e.chartArea,0)||o.inRange(t.x,t.y,i)&&s.push({element:o,datasetIndex:l,index:c})},!0),s}function Hy(e,t,n,i){let r=[];function s(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=ys(a,{x:t.x,y:t.y});ir(h,c,u)&&r.push({element:a,datasetIndex:o,index:l})}return mr(e,n,t,s),r}function Vy(e,t,n,i,r,s){let a=[];const o=zy(n);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,r);if(i&&!m)return;const g=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(g))&&!m)return;const x=o(t,g);x<l?(a=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&a.push({element:u,datasetIndex:h,index:f})}return mr(e,n,t,c),a}function po(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?Hy(e,t,n,r):Vy(e,t,n,i,r,s)}function Uu(e,t,n,i,r){const s=[],a=n==="x"?"inXRange":"inYRange";let o=!1;return mr(e,n,t,(l,c,u)=>{l[a]&&l[a](t[n],r)&&(s.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,r))}),i&&!o?[]:s}var yo={evaluateInteractionItems:mr,modes:{index(e,t,n,i){const r=En(t,e),s=n.axis||"x",a=n.includeInvisible||!1,o=n.intersect?go(e,r,s,i,a):po(e,r,s,!1,i,a),l=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const u=o[0].index,h=c.data[u];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:u})}),l):[]},dataset(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let o=n.intersect?go(e,r,s,i,a):po(e,r,s,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=e.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return go(e,r,s,i,a)},nearest(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return po(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=En(t,e);return Uu(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=En(t,e);return Uu(e,r,"y",n.intersect,i)}}};const qu=["left","top","right","bottom"];function gr(e,t){return e.filter(n=>n.pos===t)}function Xu(e,t){return e.filter(n=>qu.indexOf(n.pos)===-1&&n.box.axis===t)}function pr(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function Wy(e){const t=[];let n,i,r,s,a,o;for(n=0,i=(e||[]).length;n<i;++n)r=e[n],{position:s,options:{stack:a,stackWeight:o=1}}=r,t.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:o});return t}function Yy(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!qu.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function $y(e,t){const n=Yy(e),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,o;for(s=0,a=e.length;s<a;++s){o=e[s];const{fullSize:l}=o.box,c=n[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=r):(o.width=i,o.height=u?u*r:l&&t.availableHeight)}return n}function jy(e){const t=Wy(e),n=pr(t.filter(c=>c.box.fullSize),!0),i=pr(gr(t,"left"),!0),r=pr(gr(t,"right")),s=pr(gr(t,"top"),!0),a=pr(gr(t,"bottom")),o=Xu(t,"x"),l=Xu(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(l).concat(a).concat(o),chartArea:gr(t,"chartArea"),vertical:i.concat(r).concat(l),horizontal:s.concat(a).concat(o)}}function Gu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Ku(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Uy(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!ft(r)){n.size&&(e[r]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?s.height:s.width),n.size=h.size/h.count,e[r]+=n.size}s.getPadding&&Ku(a,s.getPadding());const o=Math.max(0,t.outerWidth-Gu(a,e,"left","right")),l=Math.max(0,t.outerHeight-Gu(a,e,"top","bottom")),c=o!==e.w,u=l!==e.h;return e.w=o,e.h=l,n.horizontal?{same:c,other:u}:{same:u,other:c}}function qy(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Xy(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function yr(e,t,n,i){const r=[];let s,a,o,l,c,u;for(s=0,a=e.length,c=0;s<a;++s){o=e[s],l=o.box,l.update(o.width||t.w,o.height||t.h,Xy(o.horizontal,t));const{same:h,other:f}=Uy(t,n,o,i);c|=h&&r.length,u=u||f,l.fullSize||r.push(o)}return c&&yr(r,t,n,i)||u}function Es(e,t,n,i,r){e.top=n,e.left=t,e.right=t+i,e.bottom=n+r,e.width=i,e.height=r}function Zu(e,t,n,i){const r=n.padding;let{x:s,y:a}=t;for(const o of e){const l=o.box,c=i[o.stack]||{placed:0,weight:1},u=o.stackWeight/c.weight||1;if(o.horizontal){const h=t.w*u,f=c.size||l.height;ye(c.start)&&(a=c.start),l.fullSize?Es(l,r.left,a,n.outerWidth-r.right-r.left,f):Es(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*u,f=c.size||l.width;ye(c.start)&&(s=c.start),l.fullSize?Es(l,s,r.top,f,n.outerHeight-r.bottom-r.top):Es(l,s,t.top+c.placed,f,h),c.start=s,c.placed+=h,s=l.right}}t.x=s,t.y=a}var oe={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const r=Ut(e.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(n-r.height,0),o=jy(e.boxes),l=o.vertical,c=o.horizontal;Tt(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=l.reduce((p,x)=>x.box.options&&x.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},r);Ku(f,Ut(i));const m=Object.assign({maxPadding:f,w:s,h:a,x:r.left,y:r.top},r),g=$y(l.concat(c),h);yr(o.fullSize,m,h,g),yr(l,m,h,g),yr(c,m,h,g)&&yr(l,m,h,g),qy(m),Zu(o.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Zu(o.rightAndBottom,m,h,g),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Tt(o.chartArea,p=>{const x=p.box;Object.assign(x,e.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Qu{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class Gy extends Qu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Os="$chartjs",Ky={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ju=e=>e===null||e==="";function Zy(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Os]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ju(r)){const s=ku(e,"width");s!==void 0&&(e.width=s)}if(Ju(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=ku(e,"height");s!==void 0&&(e.height=s)}return e}const td=ty?{passive:!0}:!1;function Qy(e,t,n){e&&e.addEventListener(t,n,td)}function Jy(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,td)}function tb(e,t){const n=Ky[e.type]||e.type,{x:i,y:r}=En(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Ps(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function eb(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const o of s)a=a||Ps(o.addedNodes,i),a=a&&!Ps(o.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function nb(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const o of s)a=a||Ps(o.removedNodes,i),a=a&&!Ps(o.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const br=new Map;let ed=0;function nd(){const e=window.devicePixelRatio;e!==ed&&(ed=e,br.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ib(e,t){br.size||window.addEventListener("resize",nd),br.set(e,t)}function rb(e){br.delete(e),br.size||window.removeEventListener("resize",nd)}function sb(e,t,n){const i=e.canvas,r=i&&ao(i);if(!r)return;const s=ru((o,l)=>{const c=r.clientWidth;n(o,l),c<r.clientWidth&&n()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||s(c,u)});return a.observe(r),ib(e,s),a}function bo(e,t,n){n&&n.disconnect(),t==="resize"&&rb(e)}function ab(e,t,n){const i=e.canvas,r=ru(s=>{e.ctx!==null&&n(tb(s,e))},e);return Qy(i,t,r),r}class ob extends Qu{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Zy(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Os])return!1;const i=n[Os].initial;["height","width"].forEach(s=>{const a=i[s];st(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Os],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:eb,detach:nb,resize:sb}[n]||ab;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:bo,detach:bo,resize:bo}[n]||Jy)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return Jp(t,n,i,r)}isAttached(t){const n=t&&ao(t);return!!(n&&n.isConnected)}}function lb(e){return!so()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Gy:ob}class Jt{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Tn(this.x)&&Tn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}R(Jt,"defaults",{}),R(Jt,"defaultRoutes");function cb(e,t){const n=e.options.ticks,i=ub(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?hb(t):[],a=s.length,o=s[0],l=s[a-1],c=[];if(a>r)return fb(t,c,s,a/r),c;const u=db(s,t,r);if(a>0){let h,f;const m=a>1?Math.round((l-o)/(a-1)):null;for(Rs(t,c,u,st(m)?0:o-m,o),h=0,f=a-1;h<f;h++)Rs(t,c,u,s[h],s[h+1]);return Rs(t,c,u,l,st(m)?t.length:l+m),c}return Rs(t,c,u),c}function ub(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(i,r))}function db(e,t,n){const i=mb(e),r=t.length/n;if(!i)return Math.max(r,1);const s=np(i);for(let a=0,o=s.length-1;a<o;a++){const l=s[a];if(l>r)return l}return Math.max(r,1)}function hb(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function fb(e,t,n,i){let r=0,s=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),r++,s=n[r*i])}function Rs(e,t,n,i,r){const s=at(i,0),a=Math.min(at(r,e.length),e.length);let o=0,l,c,u;for(n=Math.ceil(n),r&&(l=r-i,n=l/Math.floor(l/n)),u=s;u<0;)o++,u=Math.round(s+o*n);for(c=Math.max(s,0);c<a;c++)c===u&&(t.push(e[c]),o++,u=Math.round(s+o*n))}function mb(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const gb=e=>e==="left"?"right":e==="right"?"left":e,id=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,rd=(e,t)=>Math.min(t||e,e);function sd(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;s<r;s+=i)n.push(e[Math.floor(s)]);return n}function pb(e,t,n){const i=e.ticks.length,r=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,o=1e-6;let l=e.getPixelForTick(r),c;if(!(n&&(i===1?c=Math.max(l-s,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(r-1))/2,l+=r<t?c:-c,l<s-o||l>a+o)))return l}function yb(e,t){Tt(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function _r(e){return e.drawTicks?e.tickLength:0}function ad(e,t){if(!e.display)return 0;const n=It(e.font,t),i=Ut(e.padding);return(kt(e.text)?e.text.length:1)*n.lineHeight+i.height}function bb(e,t){return Cn(e,{scale:t,type:"scale"})}function _b(e,t,n){return Cn(e,{tick:n,index:t,type:"tick"})}function xb(e,t,n){let i=Ga(e);return(n&&t!=="right"||!n&&t==="right")&&(i=gb(i)),i}function wb(e,t,n,i){const{top:r,left:s,bottom:a,right:o,chart:l}=e,{chartArea:c,scales:u}=l;let h=0,f,m,g;const p=a-r,x=o-s;if(e.isHorizontal()){if(m=ae(i,s,o),ft(n)){const S=Object.keys(n)[0],v=n[S];g=u[S].getPixelForValue(v)+p-t}else n==="center"?g=(c.bottom+c.top)/2+p-t:g=id(e,n,t);f=o-s}else{if(ft(n)){const S=Object.keys(n)[0],v=n[S];m=u[S].getPixelForValue(v)-x+t}else n==="center"?m=(c.left+c.right)/2-x+t:m=id(e,n,t);g=ae(i,a,r),h=n==="left"?-Pt:Pt}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class Zn 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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:r}=this;return t=De(t,Number.POSITIVE_INFINITY),n=De(n,Number.NEGATIVE_INFINITY),i=De(i,Number.POSITIVE_INFINITY),r=De(r,Number.NEGATIVE_INFINITY),{min:De(t,i),max:De(n,r),minDefined:At(t),maxDefined:At(n)}}getMinMax(t){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:n,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),s||(i=Math.max(i,a.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:De(n,De(i,n)),max:De(i,De(n,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(){Mt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,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=Pp(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?sd(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=cb(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,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Mt(this.options.afterUpdate,[this])}beforeSetDimensions(){Mt(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(){Mt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Mt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Mt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Mt(n.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Mt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Mt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=rd(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let a=r,o,l,c;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Qt(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:m/(i-1),h+6>o&&(o=m/(i-(t.offset?.5:1)),l=this.maxHeight-_r(t.grid)-n.padding-ad(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=ps(Math.min(Math.asin(Qt((u.highest.height+6)/o,-1,1)),Math.asin(Qt(l/c,-1,1))-Math.asin(Qt(f/c,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Mt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Mt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=ad(r,n.options.font);if(o?(t.width=this.maxWidth,t.height=_r(s)+l):(t.height=this.maxHeight,t.width=_r(s)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=jt(this.labelRotation),p=Math.cos(g),x=Math.sin(g);if(o){const S=i.mirror?0:x*h.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+S+m)}else{const S=i.mirror?0:p*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+S+m)}this._calculatePadding(c,u,x,p)}}this._handleMargins(),o?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:a},position:o}=this.options,l=this.labelRotation!==0,c=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;l?c?(f=r*t.width,m=i*n.height):(f=i*t.height,m=r*n.width):s==="start"?m=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let u=n.height/2,h=t.height/2;s==="start"?(u=0,h=t.height):s==="end"&&(u=n.height,h=0),this.paddingTop=u+a,this.paddingBottom=h+a}}_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(){Mt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)st(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=sd(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:r,_longestTextCache:s}=this,a=[],o=[],l=Math.floor(n/rd(n,i));let c=0,u=0,h,f,m,g,p,x,S,v,k,D,M;for(h=0;h<n;h+=l){if(g=t[h].label,p=this._resolveTickFontOptions(h),r.font=x=p.string,S=s[x]=s[x]||{data:{},gc:[]},v=p.lineHeight,k=D=0,!st(g)&&!kt(g))k=xs(r,S.data,S.gc,k,g),D=v;else if(kt(g))for(f=0,m=g.length;f<m;++f)M=g[f],!st(M)&&!kt(M)&&(k=xs(r,S.data,S.gc,k,M),D+=v);a.push(k),o.push(D),c=Math.max(k,c),u=Math.max(D,u)}yb(s,n);const P=a.indexOf(c),E=o.indexOf(u),y=_=>({width:a[_]||0,height:o[_]||0});return{first:y(0),last:y(n-1),widest:y(P),highest:y(E),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return ap(this._alignToPixels?Un(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=_b(this.getContext(),t,i))}return this.$context||(this.$context=bb(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=jt(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,o=s?s.widest.width+a:0,l=s?s.highest.height+a:0;return this.isHorizontal()?l*i>o*r?o/i:l/r:l*r<o*i?l/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:o}=r,l=s.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=_r(s),m=[],g=o.setContext(this.getContext()),p=g.display?g.width:0,x=p/2,S=function(G){return Un(i,G,p)};let v,k,D,M,P,E,y,_,T,O,A,I;if(a==="top")v=S(this.bottom),E=this.bottom-f,_=v-x,O=S(t.top)+x,I=t.bottom;else if(a==="bottom")v=S(this.top),O=t.top,I=S(t.bottom)-x,E=v+x,_=this.top+f;else if(a==="left")v=S(this.right),P=this.right-f,y=v-x,T=S(t.left)+x,A=t.right;else if(a==="right")v=S(this.left),T=t.left,A=S(t.right)-x,P=v+x,y=this.left+f;else if(n==="x"){if(a==="center")v=S((t.top+t.bottom)/2+.5);else if(ft(a)){const G=Object.keys(a)[0],V=a[G];v=S(this.chart.scales[G].getPixelForValue(V))}O=t.top,I=t.bottom,E=v+x,_=E+f}else if(n==="y"){if(a==="center")v=S((t.left+t.right)/2);else if(ft(a)){const G=Object.keys(a)[0],V=a[G];v=S(this.chart.scales[G].getPixelForValue(V))}P=v-x,y=P-f,T=t.left,A=t.right}const B=at(r.ticks.maxTicksLimit,h),q=Math.max(1,Math.ceil(h/B));for(k=0;k<h;k+=q){const G=this.getContext(k),V=s.setContext(G),lt=o.setContext(G),X=V.lineWidth,Q=V.color,H=lt.dash||[],U=lt.dashOffset,Y=V.tickWidth,xt=V.tickColor,yt=V.tickBorderDash||[],vt=V.tickBorderDashOffset;D=pb(this,k,l),D!==void 0&&(M=Un(i,D,X),c?P=y=T=A=M:E=_=O=I=M,m.push({tx1:P,ty1:E,tx2:y,ty2:_,x1:T,y1:O,x2:A,y2:I,width:X,color:Q,borderDash:H,borderDashOffset:U,tickWidth:Y,tickColor:xt,tickBorderDash:yt,tickBorderDashOffset:vt}))}return this._ticksLength=h,this._borderValue=v,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=s,f=_r(i.grid),m=f+u,g=h?-u:m,p=-jt(this.labelRotation),x=[];let S,v,k,D,M,P,E,y,_,T,O,A,I="middle";if(r==="top")P=this.bottom-g,E=this._getXAxisLabelAlignment();else if(r==="bottom")P=this.top+g,E=this._getXAxisLabelAlignment();else if(r==="left"){const q=this._getYAxisLabelAlignment(f);E=q.textAlign,M=q.x}else if(r==="right"){const q=this._getYAxisLabelAlignment(f);E=q.textAlign,M=q.x}else if(n==="x"){if(r==="center")P=(t.top+t.bottom)/2+m;else if(ft(r)){const q=Object.keys(r)[0],G=r[q];P=this.chart.scales[q].getPixelForValue(G)+m}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")M=(t.left+t.right)/2-m;else if(ft(r)){const q=Object.keys(r)[0],G=r[q];M=this.chart.scales[q].getPixelForValue(G)}E=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?I="top":l==="end"&&(I="bottom"));const B=this._getLabelSizes();for(S=0,v=o.length;S<v;++S){k=o[S],D=k.label;const q=s.setContext(this.getContext(S));y=this.getPixelForTick(S)+s.labelOffset,_=this._resolveTickFontOptions(S),T=_.lineHeight,O=kt(D)?D.length:1;const G=O/2,V=q.color,lt=q.textStrokeColor,X=q.textStrokeWidth;let Q=E;a?(M=y,E==="inner"&&(S===v-1?Q=this.options.reverse?"left":"right":S===0?Q=this.options.reverse?"right":"left":Q="center"),r==="top"?c==="near"||p!==0?A=-O*T+T/2:c==="center"?A=-B.highest.height/2-G*T+T:A=-B.highest.height+T/2:c==="near"||p!==0?A=T/2:c==="center"?A=B.highest.height/2-G*T:A=B.highest.height-O*T,h&&(A*=-1),p!==0&&!q.showLabelBackdrop&&(M+=T/2*Math.sin(p))):(P=y,A=(1-O)*T/2);let H;if(q.showLabelBackdrop){const U=Ut(q.backdropPadding),Y=B.heights[S],xt=B.widths[S];let yt=A-U.top,vt=0-U.left;switch(I){case"middle":yt-=Y/2;break;case"bottom":yt-=Y;break}switch(E){case"center":vt-=xt/2;break;case"right":vt-=xt;break;case"inner":S===v-1?vt-=xt:S>0&&(vt-=xt/2);break}H={left:vt,top:yt,width:xt+U.width,height:Y+U.height,color:q.backdropColor}}x.push({label:D,font:_,textOffset:A,options:{rotation:p,color:V,strokeColor:lt,strokeWidth:X,textAlign:Q,textBaseline:I,translation:[M,P],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-jt(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),o=t+s,l=a.widest.width;let c,u;return n==="left"?r?(u=this.right+s,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):n==="right"?r?(u=this.left+s,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const o=(l,c,u)=>{!u.width||!u.color||(i.save(),i.lineWidth=u.width,i.strokeStyle=u.color,i.setLineDash(u.borderDash||[]),i.lineDashOffset=u.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(s=0,a=r.length;s<a;++s){const l=r[s];n.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const o=r.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Un(t,this.left,a)-a/2,u=Un(t,this.right,o)+o/2,h=f=l):(h=Un(t,this.top,a)-a/2,f=Un(t,this.bottom,o)+o/2,c=u=l),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(c,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&or(i,r);const s=this.getLabelItems(t);for(const a of s){const o=a.options,l=a.font,c=a.label,u=a.textOffset;qn(i,c,0,u,l,o)}r&&lr(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=It(i.font),a=Ut(i.padding),o=i.align;let l=s.lineHeight/2;n==="bottom"||n==="center"||ft(n)?(l+=a.bottom,kt(i.text)&&(l+=s.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=wb(this,l,n,o);qn(t,i.text,0,0,s,{color:i.color,maxWidth:h,rotation:f,textAlign:xb(o,n,r),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=at(t.grid&&t.grid.z,-1),r=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Zn.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s<a;++s){const o=n[s];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return It(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class As{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;kb(n)&&(i=this.register(n));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,vb(t,a,i),this.override&&Rt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,r=this.scope;i in n&&delete n[i],r&&i in Rt[r]&&(delete Rt[r][i],this.override&&delete jn[i])}}function vb(e,t,n){const i=tr(Object.create(null),[n?Rt.get(n):{},Rt.get(t),e.defaults]);Rt.set(t,i),e.defaultRoutes&&Sb(t,e.defaultRoutes),e.descriptors&&Rt.describe(t,e.descriptors)}function Sb(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),o=a.pop(),l=a.join(".");Rt.route(s,r,l,o)})}function kb(e){return"id"in e&&"defaults"in e}class Mb{constructor(){this.controllers=new As(Be,"datasets",!0),this.elements=new As(Jt,"elements"),this.plugins=new As(Object,"plugins"),this.scales=new As(Zn,"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,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Tt(r,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,n,i){const r=Ua(t);Mt(i["before"+r],[],i),n[t](i),Mt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var $e=new Mb;class Tb{constructor(){this._init=[]}notify(t,n,i,r){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,n,i);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,i,r){r=r||{};for(const s of t){const a=s.plugin,o=a[i],l=[n,r,s.options];if(Mt(o,l,a)===!1&&r.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,r=at(i.options&&i.options.plugins,{}),s=Db(i);return r===!1&&!n?[]:Eb(t,s,r,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function Db(e){const t={},n=[],i=Object.keys($e.plugins.items);for(let s=0;s<i.length;s++)n.push($e.getPlugin(i[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function Cb(e,t){return!t&&e===!1?null:e===!0?{}:e}function Eb(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const o of t){const l=o.id,c=Cb(i[l],r);c!==null&&s.push({plugin:o,options:Ob(e.config,{plugin:o,local:n[l]},c,a)})}return s}function Ob(e,{plugin:t,local:n},i,r){const s=e.pluginScopeKeys(t),a=e.getOptionScopes(i,s);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function _o(e,t){const n=Rt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Pb(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Rb(e,t){return e===t?"_index_":"_value_"}function od(e){if(e==="x"||e==="y"||e==="r")return e}function Ab(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function xo(e,...t){if(od(e))return e;for(const n of t){const i=n.axis||Ab(n.position)||e.length>1&&od(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ld(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ib(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return ld(e,"x",n[0])||ld(e,"y",n[0])}return{}}function Lb(e,t){const n=jn[e.type]||{scales:{}},i=t.scales||{},r=_o(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!ft(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=xo(a,o,Ib(a,e),Rt.scales[o.type]),c=Rb(l,r),u=n.scales||{};s[a]=er(Object.create(null),[{axis:l},o,u[l],u[c]])}),e.data.datasets.forEach(a=>{const o=a.type||e.type,l=a.indexAxis||_o(o,t),u=(jn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Pb(h,l),m=a[f+"AxisID"]||f;s[m]=s[m]||Object.create(null),er(s[m],[{axis:f},i[m],u[h]])})}),Object.keys(s).forEach(a=>{const o=s[a];er(o,[Rt.scales[o.type],Rt.scale])}),s}function cd(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=Lb(e,t)}function ud(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Nb(e){return e=e||{},e.data=ud(e.data),cd(e),e}const dd=new Map,hd=new Set;function Is(e,t){let n=dd.get(e);return n||(n=t(),dd.set(e,n),hd.add(n)),n}const xr=(e,t,n)=>{const i=kn(t,n);i!==void 0&&e.add(i)};class Fb{constructor(t){this._config=Nb(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=ud(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(),cd(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Is(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Is(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Is(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Is(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),o=a.get(n);if(o)return o;const l=new Set;n.forEach(u=>{t&&(l.add(t),u.forEach(h=>xr(l,t,h))),u.forEach(h=>xr(l,r,h)),u.forEach(h=>xr(l,jn[s]||{},h)),u.forEach(h=>xr(l,Rt,h)),u.forEach(h=>xr(l,Qa,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),hd.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,jn[n]||{},Rt.datasets[n]||{},{type:n},Rt,Qa]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:o}=fd(this._resolverCache,t,r);let l=a;if(zb(a,n)){s.$shared=!1,i=be(i)?i():i;const c=this.createResolver(t,i,o);l=xi(a,i,c)}for(const c of n)s[c]=l[c];return s}createResolver(t,n,i=[""],r){const{resolver:s}=fd(this._resolverCache,t,i);return ft(n)?xi(s,n,void 0,r):s}}function fd(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:no(t,n),subPrefixes:n.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,s)),s}const Bb=e=>ft(e)&&Object.getOwnPropertyNames(e).some(t=>be(e[t]));function zb(e,t){const{isScriptable:n,isIndexable:i}=gu(e);for(const r of t){const s=n(r),a=i(r),o=(a||s)&&e[r];if(s&&(be(o)||Bb(o))||a&&kt(o))return!0}return!1}var Hb="4.5.0";const Vb=["top","bottom","left","right","chartArea"];function md(e,t){return e==="top"||e==="bottom"||Vb.indexOf(e)===-1&&t==="x"}function gd(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function pd(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Mt(n&&n.onComplete,[e],t)}function Wb(e){const t=e.chart,n=t.options.animation;Mt(n&&n.onProgress,[e],t)}function yd(e){return so()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ls={},bd=e=>{const t=yd(e);return Object.values(Ls).filter(n=>n.canvas===t).pop()};function Yb(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function $b(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let _e=(zn=class{static register(...t){$e.add(...t),_d()}static unregister(...t){$e.remove(...t),_d()}constructor(t,n){const i=this.config=new Fb(n),r=yd(t),s=bd(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||lb(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Xg(),this.ctx=o,this.canvas=l,this.width=u,this.height=c,this._options=a,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 Tb,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=up(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Ls[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}sn.listen(this,"complete",pd),sn.listen(this,"progress",Wb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return st(t)?n&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return $e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Su(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return hu(this.canvas,this.ctx),this}stop(){return sn.stop(this),this}resize(t,n){sn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Su(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),Mt(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Tt(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const o=n[a],l=xo(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),Tt(s,a=>{const o=a.options,l=o.id,c=xo(l,o),u=at(o.type,a.dtype);(o.position===void 0||md(o.position,c)!==md(a.dposition))&&(o.position=a.dposition),r[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=$e.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),Tt(r,(a,o)=>{a||delete i[o]}),Tt(i,a=>{oe.configure(this,a,a.options),oe.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(gd("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[i];let a=this.getDatasetMeta(i);const o=s.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=s.indexAxis||_o(o,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=$e.getController(o),{datasetElementType:c,dataElementType:u}=Rt.datasets[o];Object.assign(l,{dataElementType:$e.getElement(u),datasetElementType:c&&$e.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Tt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!r&&s.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Tt(s,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(gd("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Tt(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Kc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;Yb(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,o)=>o+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<n;s++)if(!Kc(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;oe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Tt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,be(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(sn.has(this)?this.attached&&!sn.running(this)&&sn.start(this):(this.draw(),pd({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const a=n[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=Au(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&or(n,r),t.controller.draw(),r&&lr(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return rn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=yo.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Cn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);ye(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(o=>o.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),sn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),hu(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ls[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,n=this.platform,i=(s,a)=>{n.addEventListener(this,s,a),t[s]=a},r=(s,a,o)=>{s.offsetX=a,s.offsetY=o,this._eventHandler(s)};Tt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},r=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},s=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",o)},n.isAttached(this.canvas)?o():a()}unbindEvents(){Tt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Tt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,o,l;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const o=this.getDatasetMeta(s);if(!o)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:o.data[a],index:a}});!hs(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=s(n,t),o=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,o=this._getActiveElements(t,r,i,a),l=tp(t),c=$b(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Mt(s.onHover,[t,o,this],this),l&&Mt(s.onClick,[t,o,this],this));const u=!hs(o,r);return(u||n)&&(this._active=o,this._updateHoverStyles(o,r,n)),this._lastEvent=c,u}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}},R(zn,"defaults",Rt),R(zn,"instances",Ls),R(zn,"overrides",jn),R(zn,"registry",$e),R(zn,"version",Hb),R(zn,"getChart",bd),zn);function _d(){return Tt(_e.instances,e=>e._plugins.invalidate())}function jb(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:o,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,se(i-n));if(e.beginPath(),e.arc(r,s,a-c/2,i+h/2,n-h/2),o>0){const f=Math.min(c/o,se(i-n));e.arc(r,s,o+c/2,n-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*se(i-n));if(u==="round")e.arc(r,s,f,n-dt/2,i+dt/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(n+dt/2)+r,p=-m*Math.sin(n+dt/2)+s,x=m*Math.cos(i+dt/2)+r,S=m*Math.sin(i+dt/2)+s;e.lineTo(g,p),e.lineTo(x,S)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ub(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:o,innerRadius:l}=t;let c=r/o;e.beginPath(),e.arc(s,a,o,i-c,n+c),l>r?(c=r/l,e.arc(s,a,l,n+c,i-c,!0)):e.arc(s,a,r,n+Pt,i-Pt),e.closePath(),e.clip()}function qb(e){return eo(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Xb(e,t,n,i){const r=qb(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),o=l=>{const c=(n-Math.min(s,l))*i/2;return Qt(l,0,Math.min(s,c))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Qt(r.innerStart,0,a),innerEnd:Qt(r.innerEnd,0,a)}}function Si(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Ns(e,t,n,i,r,s){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+n-c,0),f=u>0?u+i+n+c:0;let m=0;const g=r-l;if(i){const q=u>0?u-i:0,G=h>0?h-i:0,V=(q+G)/2,lt=V!==0?g*V/(V+i):g;m=(g-lt)/2}const p=Math.max(.001,g*h-n/dt)/h,x=(g-p)/2,S=l+x+m,v=r-x-m,{outerStart:k,outerEnd:D,innerStart:M,innerEnd:P}=Xb(t,f,h,v-S),E=h-k,y=h-D,_=S+k/E,T=v-D/y,O=f+M,A=f+P,I=S+M/O,B=v-P/A;if(e.beginPath(),s){const q=(_+T)/2;if(e.arc(a,o,h,_,q),e.arc(a,o,h,q,T),D>0){const X=Si(y,T,a,o);e.arc(X.x,X.y,D,T,v+Pt)}const G=Si(A,v,a,o);if(e.lineTo(G.x,G.y),P>0){const X=Si(A,B,a,o);e.arc(X.x,X.y,P,v+Pt,B+Math.PI)}const V=(v-P/f+(S+M/f))/2;if(e.arc(a,o,f,v-P/f,V,!0),e.arc(a,o,f,V,S+M/f,!0),M>0){const X=Si(O,I,a,o);e.arc(X.x,X.y,M,I+Math.PI,S-Pt)}const lt=Si(E,S,a,o);if(e.lineTo(lt.x,lt.y),k>0){const X=Si(E,_,a,o);e.arc(X.x,X.y,k,S-Pt,_)}}else{e.moveTo(a,o);const q=Math.cos(_)*h+a,G=Math.sin(_)*h+o;e.lineTo(q,G);const V=Math.cos(T)*h+a,lt=Math.sin(T)*h+o;e.lineTo(V,lt)}e.closePath()}function Gb(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:o}=t;let l=t.endAngle;if(s){Ns(e,t,n,i,l,r);for(let c=0;c<s;++c)e.fill();isNaN(o)||(l=a+(o%Ot||Ot))}return Ns(e,t,n,i,l,r),e.fill(),l}function Kb(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=f,g?(e.lineWidth=c*2,e.lineJoin=u||"round"):(e.lineWidth=c,e.lineJoin=u||"bevel");let p=t.endAngle;if(s){Ns(e,t,n,i,p,r);for(let x=0;x<s;++x)e.stroke();isNaN(o)||(p=a+(o%Ot||Ot))}g&&Ub(e,t,p),l.selfJoin&&p-a>=dt&&m===0&&u!=="miter"&&jb(e,t,p),s||(Ns(e,t,n,i,p,r),e.stroke())}class wr extends Jt{constructor(n){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(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,n&&Object.assign(this,n)}inRange(n,i,r){const s=this.getProps(["x","y"],r),{angle:a,distance:o}=ys(s,{x:n,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,g=at(f,c-l),p=ir(a,l,c)&&l!==c,x=g>=Ot||p,S=en(o,u+m,h+m);return x&&S}getCenterPoint(n){const{x:i,y:r,startAngle:s,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:u}=this.options,h=(s+a)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(h)*f,y:r+Math.sin(h)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:r}=this,s=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>Ot?Math.floor(r/Ot):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*s,Math.sin(l)*s);const c=1-Math.sin(Math.min(dt,r||0)),u=s*c;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,Gb(n,this,u,a,o),Kb(n,this,u,a,o),n.restore()}}R(wr,"id","arc"),R(wr,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),R(wr,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(wr,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function xd(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function Zb(e,t,n){e.lineTo(n.x,n.y)}function Qb(e){return e.stepped?vp:e.tension||e.cubicInterpolationMode==="monotone"?Sp:Zb}function wd(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:a,end:o}=t,l=Math.max(r,a),c=Math.min(s,o),u=r<a&&s<a||r>o&&s>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Jb(e,t,n,i){const{points:r,options:s}=t,{count:a,start:o,loop:l,ilen:c}=wd(r,n,i),u=Qb(s);let{move:h=!0,reverse:f}=i||{},m,g,p;for(m=0;m<=c;++m)g=r[(o+(f?c-m:m))%a],!g.skip&&(h?(e.moveTo(g.x,g.y),h=!1):u(e,p,g,f,s.stepped),p=g);return l&&(g=r[(o+(f?c:0))%a],u(e,p,g,f,s.stepped)),!!l}function t0(e,t,n,i){const r=t.points,{count:s,start:a,ilen:o}=wd(r,n,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,g,p,x,S;const v=D=>(a+(c?o-D:D))%s,k=()=>{p!==x&&(e.lineTo(u,x),e.lineTo(u,p),e.lineTo(u,S))};for(l&&(m=r[v(0)],e.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=r[v(f)],m.skip)continue;const D=m.x,M=m.y,P=D|0;P===g?(M<p?p=M:M>x&&(x=M),u=(h*u+D)/++h):(k(),e.lineTo(D,M),g=P,h=0,p=x=M),S=M}k()}function wo(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?t0:Jb}function e0(e){return e.stepped?ey:e.tension||e.cubicInterpolationMode==="monotone"?ny:Gn}function n0(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),xd(e,t.options),e.stroke(r)}function i0(e,t,n,i){const{segments:r,options:s}=t,a=wo(t);for(const o of r)xd(e,s,o.style),e.beginPath(),a(e,t,o,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const r0=typeof Path2D=="function";function s0(e,t,n,i){r0&&!t.options.segment?n0(e,t,n,i):i0(e,t,n,i)}class On 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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;qp(this._points,i,t,r,n),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=ly(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=Ou(this,{property:n,start:r,end:r});if(!a.length)return;const o=[],l=e0(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:h,end:f}=a[c],m=s[h],g=s[f];if(m===g){o.push(m);continue}const p=Math.abs((r-m[n])/(g[n]-m[n])),x=l(m,g,p,i.stepped);x[n]=t[n],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,n,i){return wo(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=wo(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const o of r)a&=s(t,this,o,{start:n,end:n+i-1});return!!a}draw(t,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),s0(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(On,"id","line"),R(On,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(On,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(On,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function vd(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class Fs extends Jt{constructor(n){super();R(this,"parsed");R(this,"skip");R(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,r){const s=this.options,{x:a,y:o}=this.getProps(["x","y"],r);return Math.pow(n-a,2)+Math.pow(i-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,i){return vd(this,n,"x",i)}inYRange(n,i){return vd(this,n,"y",i)}getCenterPoint(n){const{x:i,y:r}=this.getProps(["x","y"],n);return{x:i,y:r}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);const r=i&&n.borderWidth||0;return(i+r)*2}draw(n,i){const r=this.options;this.skip||r.radius<.1||!rn(this,i,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,to(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(Fs,"id","point"),R(Fs,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(Fs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Sd(e,t){const{x:n,y:i,base:r,width:s,height:a}=e.getProps(["x","y","base","width","height"],t);let o,l,c,u,h;return e.horizontal?(h=a/2,o=Math.min(n,r),l=Math.max(n,r),c=i-h,u=i+h):(h=s/2,o=n-h,l=n+h,c=Math.min(i,r),u=Math.max(i,r)),{left:o,top:c,right:l,bottom:u}}function Pn(e,t,n,i){return e?0:Qt(t,n,i)}function a0(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=mu(i);return{t:Pn(r.top,s.top,0,n),r:Pn(r.right,s.right,0,t),b:Pn(r.bottom,s.bottom,0,n),l:Pn(r.left,s.left,0,t)}}function o0(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=Dn(r),a=Math.min(t,n),o=e.borderSkipped,l=i||ft(r);return{topLeft:Pn(!l||o.top||o.left,s.topLeft,0,a),topRight:Pn(!l||o.top||o.right,s.topRight,0,a),bottomLeft:Pn(!l||o.bottom||o.left,s.bottomLeft,0,a),bottomRight:Pn(!l||o.bottom||o.right,s.bottomRight,0,a)}}function l0(e){const t=Sd(e),n=t.right-t.left,i=t.bottom-t.top,r=a0(e,n/2,i/2),s=o0(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function vo(e,t,n,i){const r=t===null,s=n===null,o=e&&!(r&&s)&&Sd(e,i);return o&&(r||en(t,o.left,o.right))&&(s||en(n,o.top,o.bottom))}function c0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function u0(e,t){e.rect(t.x,t.y,t.w,t.h)}function So(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+a,radius:e.radius}}class Bs 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:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=l0(this),o=c0(a.radius)?_i:u0;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),o(t,So(a,n,s)),t.clip(),o(t,So(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,So(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return vo(this,t,n,i)}inXRange(t,n){return vo(this,t,null,n)}inYRange(t,n){return vo(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(Bs,"id","bar"),R(Bs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(Bs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var d0=Object.freeze({__proto__:null,ArcElement:wr,BarElement:Bs,LineElement:On,PointElement:Fs});const ko=["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)"],kd=ko.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Md(e){return ko[e%ko.length]}function Td(e){return kd[e%kd.length]}function h0(e,t){return e.borderColor=Md(t),e.backgroundColor=Td(t),++t}function f0(e,t){return e.backgroundColor=e.data.map(()=>Md(t++)),t}function m0(e,t){return e.backgroundColor=e.data.map(()=>Td(t++)),t}function g0(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof an?t=f0(n,t):r instanceof fr?t=m0(n,t):r&&(t=h0(n,t))}}function Dd(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function p0(e){return e&&(e.borderColor||e.backgroundColor)}function y0(){return Rt.borderColor!=="rgba(0,0,0,0.1)"||Rt.backgroundColor!=="rgba(0,0,0,0.1)"}var b0={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=Dd(i)||p0(r)||s&&Dd(s)||y0();if(!n.forceOverride&&a)return;const o=g0(e);i.forEach(o)}};function _0(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],o=(n-2)/(s-2);let l=0;const c=t+n-1;let u=t,h,f,m,g,p;for(a[l++]=e[u],h=0;h<s-2;h++){let x=0,S=0,v;const k=Math.floor((h+1)*o)+1+t,D=Math.min(Math.floor((h+2)*o)+1,n)+t,M=D-k;for(v=k;v<D;v++)x+=e[v].x,S+=e[v].y;x/=M,S/=M;const P=Math.floor(h*o)+1+t,E=Math.min(Math.floor((h+1)*o)+1,n)+t,{x:y,y:_}=e[u];for(m=g=-1,v=P;v<E;v++)g=.5*Math.abs((y-x)*(e[v].y-_)-(y-e[v].x)*(S-_)),g>m&&(m=g,f=e[v],p=v);a[l++]=f,u=p}return a[l++]=e[c],a}function x0(e,t,n,i){let r=0,s=0,a,o,l,c,u,h,f,m,g,p;const x=[],S=t+n-1,v=e[t].x,D=e[S].x-v;for(a=t;a<t+n;++a){o=e[a],l=(o.x-v)/D*i,c=o.y;const M=l|0;if(M===u)c<g?(g=c,h=a):c>p&&(p=c,f=a),r=(s*r+o.x)/++s;else{const P=a-1;if(!st(h)&&!st(f)){const E=Math.min(h,f),y=Math.max(h,f);E!==m&&E!==P&&x.push({...e[E],x:r}),y!==m&&y!==P&&x.push({...e[y],x:r})}a>0&&P!==m&&x.push(e[P]),x.push(o),u=M,s=0,g=p=c,h=f=m=a}}return x}function Cd(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ed(e){e.data.datasets.forEach(t=>{Cd(t)})}function w0(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:o,minDefined:l,maxDefined:c}=s.getUserBounds();return l&&(i=Qt(nn(t,s.axis,a).lo,0,n-1)),c?r=Qt(nn(t,s.axis,o).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var v0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ed(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:o}=r,l=e.getDatasetMeta(s),c=a||r.data;if(cr([o,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=e.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:h,count:f}=w0(l,c);const m=n.threshold||4*i;if(f<=m){Cd(r);return}st(a)&&(r._data=c,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(n.algorithm){case"lttb":g=_0(c,h,f,i,n);break;case"min-max":g=x0(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=g})},destroy(e){Ed(e)}};function S0(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=zs(l,c,r);const u=Mo(n,r[l],r[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:r[l],end:r[c]});continue}const h=Ou(t,u);for(const f of h){const m=Mo(n,s[f.start],s[f.end],f.loop),g=Eu(o,r,m);for(const p of g)a.push({source:p,target:f,start:{[n]:Od(u,m,"start",Math.max)},end:{[n]:Od(u,m,"end",Math.min)}})}}return a}function Mo(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=se(r),s=se(s)),{property:e,start:r,end:s}}function k0(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:o})=>{o=zs(a,o,r);const l=r[a],c=r[o];i!==null?(s.push({x:l.x,y:i}),s.push({x:c.x,y:i})):n!==null&&(s.push({x:n,y:l.y}),s.push({x:n,y:c.y}))}),s}function zs(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Od(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Pd(e,t){let n=[],i=!1;return kt(e)?(i=!0,n=e):n=k0(e,t),n.length?new On({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Rd(e){return e&&e.fill!==!1}function M0(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!At(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function T0(e,t,n){const i=O0(e);if(ft(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return At(r)&&Math.floor(r)===r?D0(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function D0(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function C0(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ft(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function E0(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:ft(e)?i=e.value:i=t.getBaseValue(),i}function O0(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function P0(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,o=R0(t,n);o.push(Pd({x:null,y:t.bottom},i));for(let l=0;l<s.length;l++){const c=s[l];for(let u=c.start;u<=c.end;u++)A0(r,a[u],o)}return new On({points:r,options:{}})}function R0(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function A0(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:o,point:l}=I0(s,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(e.push(l),!o)break}}e.push(...i)}function I0(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const r=i[n],s=e.segments,a=e.points;let o=!1,l=!1;for(let c=0;c<s.length;c++){const u=s[c],h=a[u.start][n],f=a[u.end][n];if(en(r,h,f)){o=r===h,l=r===f;break}}return{first:o,last:l,point:i}}class Ad{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:r,y:s,radius:a}=this;return n=n||{start:0,end:Ot},t.arc(r,s,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:r}=this,s=t.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function L0(e){const{chart:t,fill:n,line:i}=e;if(At(n))return N0(t,n);if(n==="stack")return P0(e);if(n==="shape")return!0;const r=F0(e);return r instanceof Ad?r:Pd(r,i)}function N0(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function F0(e){return(e.scale||{}).getPointPositionForValue?z0(e):B0(e)}function B0(e){const{scale:t={},fill:n}=e,i=C0(n,t);if(At(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function z0(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=E0(n,t,s),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,s);return new Ad({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<r;++l)o.push(t.getPointPositionForValue(l,a));return o}function To(e,t,n){const i=L0(t),{chart:r,index:s,line:a,scale:o,axis:l}=t,c=a.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},g=r.getDatasetMeta(s),p=Au(r,g);i&&a.points.length&&(or(e,n),H0(e,{line:a,target:i,above:f,below:m,area:n,scale:o,axis:l,clip:p}),lr(e))}function H0(e,t){const{line:n,target:i,above:r,below:s,area:a,scale:o,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let u=s;s!==r&&(c==="x"?(Id(e,i,a.top),Do(e,{line:n,target:i,color:r,scale:o,property:c,clip:l}),e.restore(),e.save(),Id(e,i,a.bottom)):c==="y"&&(Ld(e,i,a.left),Do(e,{line:n,target:i,color:s,scale:o,property:c,clip:l}),e.restore(),e.save(),Ld(e,i,a.right),u=r)),Do(e,{line:n,target:i,color:u,scale:o,property:c,clip:l}),e.restore()}function Id(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],h=r[zs(l,c,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,o,{move:a}),a?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Ld(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const o of i){const{start:l,end:c}=o,u=r[l],h=r[zs(l,c,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,o,{move:a}),a?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Do(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:o}=t,l=S0(n,i,r);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=s}={}}=c,g=i!==!0;e.save(),e.fillStyle=m,V0(e,a,o,g&&Mo(r,h,f)),e.beginPath();const p=!!n.pathSegment(e,c);let x;if(g){p?e.closePath():Nd(e,i,f,r);const S=!!i.pathSegment(e,u,{move:p,reverse:!0});x=p&&S,x||Nd(e,i,h,r)}e.closePath(),e.fill(x?"evenodd":"nonzero"),e.restore()}}function V0(e,t,n,i){const r=t.chart.chartArea,{property:s,start:a,end:o}=i||{};if(s==="x"||s==="y"){let l,c,u,h;s==="x"?(l=a,c=r.top,u=o,h=r.bottom):(l=r.left,c=a,u=r.right,h=o),e.beginPath(),n&&(l=Math.max(l,n.left),u=Math.min(u,n.right),c=Math.max(c,n.top),h=Math.min(h,n.bottom)),e.rect(l,c,u-l,h-c),e.clip()}}function Nd(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var W0={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,r=[];let s,a,o,l;for(a=0;a<i;++a)s=e.getDatasetMeta(a),o=s.dataset,l=null,o&&o.options&&o instanceof On&&(l={visible:e.isDatasetVisible(a),index:a,fill:T0(o,a,i),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:o}),s.$filler=l,r.push(l);for(a=0;a<i;++a)l=r[a],!(!l||l.fill===!1)&&(l.fill=M0(r,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let a=r.length-1;a>=0;--a){const o=r[a].$filler;o&&(o.line.updateControlPoints(s,o.axis),i&&o.fill&&To(e.ctx,o,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Rd(s)&&To(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Rd(i)||n.drawTime!=="beforeDatasetDraw"||To(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Fd=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},Y0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Bd 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,n,i){this.maxWidth=t,this.maxHeight=n,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 n=Mt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=It(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=Fd(i,s);let c,u;n.font=r.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,s,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,r,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=r+o;let h=t;s.textAlign="left",s.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,p)=>{const x=i+n/2+s.measureText(g.text).width;(p===0||c[c.length-1]+x+2*o>a)&&(h+=u,c[c.length-(p>0?0:1)]=0,m+=u,f++),l[p]={left:0,top:m,row:f,width:x,height:r},c[c.length-1]+=x+o}),h}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,g=0,p=0;return this.legendItems.forEach((x,S)=>{const{itemWidth:v,itemHeight:k}=$0(i,n,s,x,r);S>0&&m+k+2*o>u&&(h+=f+o,c.push({width:f,height:m}),g+=f+o,p++,f=m=0),l[S]={left:g,top:m,col:p,width:v,height:k},f=Math.max(f,v),m+=k+o}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=vi(s,this.left,this.width);if(this.isHorizontal()){let o=0,l=ae(i,this.left+r,this.right-this.lineWidths[o]);for(const c of n)o!==c.row&&(o=c.row,l=ae(i,this.left+r,this.right-this.lineWidths[o])),c.top+=this.top+t+r,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+r}else{let o=0,l=ae(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const c of n)c.col!==o&&(o=c.col,l=ae(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+r,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;or(t,this),this._draw(),lr(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,o=Rt.color,l=vi(t.rtl,this.left,this.width),c=It(a.font),{padding:u}=a,h=c.size,f=h/2;let m;this.drawTitle(),r.textAlign=l.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:x}=Fd(a,h),S=function(P,E,y){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;r.save();const _=at(y.lineWidth,1);if(r.fillStyle=at(y.fillStyle,o),r.lineCap=at(y.lineCap,"butt"),r.lineDashOffset=at(y.lineDashOffset,0),r.lineJoin=at(y.lineJoin,"miter"),r.lineWidth=_,r.strokeStyle=at(y.strokeStyle,o),r.setLineDash(at(y.lineDash,[])),a.usePointStyle){const T={radius:p*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:_},O=l.xPlus(P,g/2),A=E+f;fu(r,T,O,A,a.pointStyleWidth&&g)}else{const T=E+Math.max((h-p)/2,0),O=l.leftForLtr(P,g),A=Dn(y.borderRadius);r.beginPath(),Object.values(A).some(I=>I!==0)?_i(r,{x:O,y:T,w:g,h:p,radius:A}):r.rect(O,T,g,p),r.fill(),_!==0&&r.stroke()}r.restore()},v=function(P,E,y){qn(r,y.text,P,E+x/2,c,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},k=this.isHorizontal(),D=this._computeTitleHeight();k?m={x:ae(s,this.left+u,this.right-i[0]),y:this.top+u+D,line:0}:m={x:this.left+u,y:ae(s,this.top+D+u,this.bottom-n[0].height),line:0},Mu(this.ctx,t.textDirection);const M=x+u;this.legendItems.forEach((P,E)=>{r.strokeStyle=P.fontColor,r.fillStyle=P.fontColor;const y=r.measureText(P.text).width,_=l.textAlign(P.textAlign||(P.textAlign=a.textAlign)),T=g+f+y;let O=m.x,A=m.y;l.setWidth(this.width),k?E>0&&O+T+u>this.right&&(A=m.y+=M,m.line++,O=m.x=ae(s,this.left+u,this.right-i[m.line])):E>0&&A+M>this.bottom&&(O=m.x=O+n[m.line].width+u,m.line++,A=m.y=ae(s,this.top+D+u,this.bottom-n[m.line].height));const I=l.x(O);if(S(I,A,P),O=dp(_,O+g+f,k?O+T:this.right,t.rtl),v(l.x(O),A,P),k)m.x+=T+u;else if(typeof P.text!="string"){const B=c.lineHeight;m.y+=zd(P,B)+u}else m.y+=M}),Tu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=It(n.font),r=Ut(n.padding);if(!n.display)return;const s=vi(t.rtl,this.left,this.width),a=this.ctx,o=n.position,l=i.size/2,c=r.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=ae(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((p,x)=>Math.max(p,x.height),0);u=c+ae(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=ae(o,h,h+f);a.textAlign=s.textAlign(Ga(o)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,qn(a,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=It(t.font),i=Ut(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(en(t,this.left,this.right)&&en(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],en(t,r.left,r.left+r.width)&&en(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!q0(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=Y0(r,i);r&&!s&&Mt(n.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Mt(n.onHover,[t,i,this],this)}else i&&Mt(n.onClick,[t,i,this],this)}}function $0(e,t,n,i,r){const s=j0(i,e,t,n),a=U0(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function j0(e,t,n,i){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function U0(e,t,n){let i=e;return typeof t.text!="string"&&(i=zd(t,n)),i}function zd(e,t){const n=e.text?e.text.length:0;return t*n}function q0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var X0={id:"legend",_element:Bd,start(e,t,n){const i=e.legend=new Bd({ctx:e.ctx,options:n,chart:e});oe.configure(e,i,n),oe.addBox(e,i)},stop(e){oe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;oe.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:o}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),u=Ut(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:s,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:r||c.textAlign,borderRadius:a&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Co 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,n){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=n;const r=kt(i.text)?i.text.length:1;this._padding=Ut(i.padding);const s=r*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:a}=this,o=a.align;let l=0,c,u,h;return this.isHorizontal()?(u=ae(o,i,s),h=n+t,c=s-i):(a.position==="left"?(u=i+t,h=ae(o,r,n),l=dt*-.5):(u=s-t,h=ae(o,n,r),l=dt*.5),c=r-n),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=It(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(s);qn(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Ga(n.align),textBaseline:"middle",translation:[a,o]})}}function G0(e,t){const n=new Co({ctx:e.ctx,options:t,chart:e});oe.configure(e,n,t),oe.addBox(e,n),e.titleBlock=n}var K0={id:"title",_element:Co,start(e,t,n){G0(e,n)},stop(e){const t=e.titleBlock;oe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;oe.configure(e,i,n),i.options=n},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 Hs=new WeakMap;var Z0={id:"subtitle",start(e,t,n){const i=new Co({ctx:e.ctx,options:n,chart:e});oe.configure(e,i,n),oe.addBox(e,i),Hs.set(e,i)},stop(e){oe.removeBox(e,Hs.get(e)),Hs.delete(e)},beforeUpdate(e,t,n){const i=Hs.get(e);oe.configure(e,i,n),i.options=n},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 vr={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;t<n;++t){const o=e[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),r+=l.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+l)/i.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,o;for(s=0,a=e.length;s<a;++s){const l=e[s].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=bi(t,c);u<r&&(r=u,o=l)}}if(o){const l=o.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function je(e,t){return t&&(kt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function on(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
16
|
+
*/class hy{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,r){const s=n.listeners[r],a=n.duration;s.forEach(o=>o({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=iu.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,r)=>{if(!i.running||!i.items.length)return;const s=i.items;let a=s.length-1,o=!1,c;for(;a>=0;--a)c=s[a],c._active?(c._total>i.duration&&(i.duration=c._total),c.tick(t),o=!0):(s[a]=s[s.length-1],s.pop());o&&(r.draw(),this._notify(r,i,t,"progress")),s.length||(i.running=!1,this._notify(r,i,t,"complete"),i.initial=!1),n+=s.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,r)=>Math.max(i,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let r=i.length-1;for(;r>=0;--r)i[r].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var sn=new hy;const Iu="transparent",fy={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=cu(e||Iu),r=i.valid&&cu(t||Iu);return r&&r.valid?r.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class my{constructor(t,n,i,r){const s=n[i];r=cr([t.to,r,s,t.from]);const a=cr([t.from,s,r]);this._active=!0,this._fn=t.fn||fy[t.type||typeof a],this._easing=rr[t.easing]||rr.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const r=this._target[this._prop],s=i-this._start,a=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=cr([t.to,n,r,t.from]),this._from=cr([t.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,r=this._prop,s=this._from,a=this._loop,o=this._to;let c;if(this._active=s!==o&&(a||n<i),!this._active){this._target[r]=o,this._notify(!0);return}if(n<0){this._target[r]=s;return}c=n/i%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(s,o,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let r=0;r<i.length;r++)i[r][n]()}}class oo{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!ft(t))return;const n=Object.keys(Rt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!ft(s))return;const a={};for(const o of n)a[o]=s[o];(kt(s.properties)&&s.properties||[r]).forEach(o=>{(o===r||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,n){const i=n.options,r=py(t,i);if(!r)return[];const s=this._createAnimations(r,i);return i.$shared&&gy(t.options.$animations,i).then(()=>{t.options=i},()=>{}),s}_createAnimations(t,n){const i=this._properties,r=[],s=t.$animations||(t.$animations={}),a=Object.keys(n),o=Date.now();let c;for(c=a.length-1;c>=0;--c){const l=a[c];if(l.charAt(0)==="$")continue;if(l==="options"){r.push(...this._animateOptions(t,n));continue}const u=n[l];let h=s[l];const f=i.get(l);if(h)if(f&&h.active()){h.update(f,u,o);continue}else h.cancel();if(!f||!f.duration){t[l]=u;continue}s[l]=h=new my(f,t,l,u),r.push(h)}return r}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return sn.add(this._chart,i),!0}}function gy(e,t){const n=[],i=Object.keys(t);for(let r=0;r<i.length;r++){const s=e[i[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function py(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Lu(e,t){const n=e&&e.options||{},i=n.reverse,r=n.min===void 0?t:0,s=n.max===void 0?t:0;return{start:i?s:r,end:i?r:s}}function yy(e,t,n){if(n===!1)return!1;const i=Lu(e,n),r=Lu(t,n);return{top:r.end,right:i.end,bottom:r.start,left:i.start}}function by(e){let t,n,i,r;return ft(e)?(t=e.top,n=e.right,i=e.bottom,r=e.left):t=n=i=r=e,{top:t,right:n,bottom:i,left:r,disabled:e===!1}}function Nu(e,t){const n=[],i=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=i.length;r<s;++r)n.push(i[r].index);return n}function Fu(e,t,n,i={}){const r=e.keys,s=i.mode==="single";let a,o,c,l;if(t===null)return;let u=!1;for(a=0,o=r.length;a<o;++a){if(c=+r[a],c===n){if(u=!0,i.all)continue;break}l=e.values[c],At(l)&&(s||t===0||Ye(t)===Ye(l))&&(t+=l)}return!u&&!i.all?0:t}function _y(e,t){const{iScale:n,vScale:i}=t,r=n.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",a=Object.keys(e),o=new Array(a.length);let c,l,u;for(c=0,l=a.length;c<l;++c)u=a[c],o[c]={[r]:u,[s]:e[u]};return o}function lo(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function xy(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function wy(e){const{min:t,max:n,minDefined:i,maxDefined:r}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function vy(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Bu(e,t,n,i){for(const r of t.getMatchingVisibleMetas(i).reverse()){const s=e[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function zu(e,t){const{chart:n,_cachedMeta:i}=e,r=n._stacks||(n._stacks={}),{iScale:s,vScale:a,index:o}=i,c=s.axis,l=a.axis,u=xy(s,a,i),h=t.length;let f;for(let m=0;m<h;++m){const g=t[m],{[c]:p,[l]:x}=g,S=g._stacks||(g._stacks={});f=S[l]=vy(r,u,p),f[o]=x,f._top=Bu(f,a,!0,i.type),f._bottom=Bu(f,a,!1,i.type);const v=f._visualValues||(f._visualValues={});v[o]=x}}function co(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Sy(e,t){return Cn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ky(e,t,n){return Cn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function ur(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[i]===void 0||s[i][n]===void 0)return;delete s[i][n],s[i]._visualValues!==void 0&&s[i]._visualValues[n]!==void 0&&delete s[i]._visualValues[n]}}}const uo=e=>e==="reset"||e==="none",Hu=(e,t)=>t?e:Object.assign({},e),My=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Nu(n,!0),values:null};class Be{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,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=lo(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&&ur(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),r=(h,f,m,g)=>h==="x"?f:h==="r"?g:m,s=n.xAxisID=at(i.xAxisID,co(t,"x")),a=n.yAxisID=at(i.yAxisID,co(t,"y")),o=n.rAxisID=at(i.rAxisID,co(t,"r")),c=n.indexAxis,l=n.iAxisID=r(c,s,a,o),u=n.vAxisID=r(c,a,s,o);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(o),n.iScale=this.getScaleForId(l),n.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 n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&eu(this._data,this),t._stacked&&ur(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(ft(n)){const r=this._cachedMeta;this._data=_y(n,r)}else if(i!==n){if(i){eu(i,this);const r=this._cachedMeta;ur(r),r._parsed=[]}n&&Object.isExtensible(n)&&cp(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=lo(n.vScale,n),n.stack!==i.stack&&(r=!0,ur(n),n.stack=i.stack),this._resyncElements(t),(r||s!==n._stacked)&&(zu(this,n._parsed),n._stacked=lo(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:r}=this,{iScale:s,_stacked:a}=i,o=s.axis;let c=t===0&&n===r.length?!0:i._sorted,l=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=r,i._sorted=!0,f=r;else{kt(r[t])?f=this.parseArrayData(i,r,t,n):ft(r[t])?f=this.parseObjectData(i,r,t,n):f=this.parsePrimitiveData(i,r,t,n);const m=()=>h[o]===null||l&&h[o]<l[o];for(u=0;u<n;++u)i._parsed[u+t]=h=f[u],c&&(m()&&(c=!1),l=h);i._sorted=c}a&&zu(this,f)}parsePrimitiveData(t,n,i,r){const{iScale:s,vScale:a}=t,o=s.axis,c=a.axis,l=s.getLabels(),u=s===a,h=new Array(r);let f,m,g;for(f=0,m=r;f<m;++f)g=f+i,h[f]={[o]:u||s.parse(l[g],g),[c]:a.parse(n[g],g)};return h}parseArrayData(t,n,i,r){const{xScale:s,yScale:a}=t,o=new Array(r);let c,l,u,h;for(c=0,l=r;c<l;++c)u=c+i,h=n[u],o[c]={x:s.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,n,i,r){const{xScale:s,yScale:a}=t,{xAxisKey:o="x",yAxisKey:c="y"}=this._parsing,l=new Array(r);let u,h,f,m;for(u=0,h=r;u<h;++u)f=u+i,m=n[f],l[u]={x:s.parse(kn(m,o),f),y:a.parse(kn(m,c),f)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const r=this.chart,s=this._cachedMeta,a=n[t.axis],o={keys:Nu(r,!0),values:n._stacks[t.axis]._visualValues};return Fu(o,a,s.index,{mode:i})}updateRangeFromParsed(t,n,i,r){const s=i[n.axis];let a=s===null?NaN:s;const o=r&&i._stacks[n.axis];r&&o&&(r.values=o,a=Fu(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,r=i._parsed,s=i._sorted&&t===i.iScale,a=r.length,o=this._getOtherScale(t),c=My(n,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=wy(o);let f,m;function g(){m=r[f];const p=m[o.axis];return!At(m[t.axis])||u>p||h<p}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(l,t,m,c),s));++f);if(s){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(l,t,m,c);break}}return l}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let r,s,a;for(r=0,s=n.length;r<s;++r)a=n[r][t.axis],At(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,r=n.vScale,s=this.getParsed(t);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=by(at(this.options.clip,yy(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,r=i.data||[],s=n.chartArea,a=[],o=this._drawStart||0,c=this._drawCount||r.length-o,l=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,s,o,c),u=o;u<o+c;++u){const h=r[u];h.hidden||(h.active&&l?a.push(h):h.draw(t,s))}for(u=0;u<a.length;++u)a[u].draw(t,s)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];s=a.$context||(a.$context=ky(this.getContext(),t,a)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Sy(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=i,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const r=n==="active",s=this._cachedDataOpts,a=t+"-"+n,o=s[a],c=this.enableOptionSharing&&ye(i);if(o)return Hu(o,c);const l=this.chart.config,u=l.datasetElementScopeKeys(this._type,t),h=r?[`${t}Hover`,"hover",t,""]:[t,""],f=l.getOptionScopes(this.getDataset(),u),m=Object.keys(Rt.elements[t]),g=()=>this.getContext(i,r,n),p=l.resolveNamedOptions(f,m,g,h);return p.$shared&&(p.$shared=c,s[a]=Object.freeze(Hu(p,c))),p}_resolveAnimations(t,n,i){const r=this.chart,s=this._cachedDataOpts,a=`animation-${n}`,o=s[a];if(o)return o;let c;if(r.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,n),f=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(f,this.getContext(t,i,n))}const l=new oo(r,c&&c.animations);return c&&c._cacheable&&(s[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||uo(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),r=this._sharedOptions,s=this.getSharedOptions(i),a=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,i),{sharedOptions:s,includeOptions:a}}updateElement(t,n,i,r){uo(r)?Object.assign(t,i):this._resolveAnimations(n,r).update(t,i)}updateSharedOptions(t,n,i){t&&!uo(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,r){t.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,i,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,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 n=this._data,i=this._cachedMeta.data;for(const[o,c,l]of this._syncList)this[o](c,l);this._syncList=[];const r=i.length,s=n.length,a=Math.min(s,r);a&&this.parse(0,a),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,n,i=!0){const r=this._cachedMeta,s=r.data,a=t+n;let o;const c=l=>{for(l.length+=n,o=l.length-1;o>=a;o--)l[o]=l[o-n]};for(c(s),o=t;o<a;++o)s[o]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(t,n),i&&this.updateElements(s,t,n,"reset")}updateElements(t,n,i,r){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const r=i._parsed.splice(t,n);i._stacked&&ur(i,r)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,r]=t;this[n](i,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}R(Be,"defaults",{}),R(Be,"datasetElementType",null),R(Be,"dataElementType",null);function Ty(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let r=0,s=n.length;r<s;r++)i=i.concat(n[r].controller.getAllParsedValues(e));e._cache.$bar=nu(i.sort((r,s)=>r-s))}return e._cache.$bar}function Dy(e){const t=e.iScale,n=Ty(t,e.type);let i=t._length,r,s,a,o;const c=()=>{a===32767||a===-32768||(ye(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(r=0,s=n.length;r<s;++r)a=t.getPixelForValue(n[r]),c();for(o=void 0,r=0,s=t.ticks.length;r<s;++r)a=t.getPixelForTick(r),c();return i}function Cy(e,t,n,i){const r=n.barThickness;let s,a;return st(r)?(s=t.min*n.categoryPercentage,a=n.barPercentage):(s=r*i,a=1),{chunk:s/i,ratio:a,start:t.pixels[e]-s/2}}function Ey(e,t,n,i){const r=t.pixels,s=r[e];let a=e>0?r[e-1]:null,o=e<r.length-1?r[e+1]:null;const c=n.categoryPercentage;a===null&&(a=s-(o===null?t.end-t.start:o-s)),o===null&&(o=s+s-a);const l=s-(s-Math.min(a,o))/2*c;return{chunk:Math.abs(o-a)/2*c/i,ratio:n.barPercentage,start:l}}function Oy(e,t,n,i){const r=n.parse(e[0],i),s=n.parse(e[1],i),a=Math.min(r,s),o=Math.max(r,s);let c=a,l=o;Math.abs(a)>Math.abs(o)&&(c=o,l=a),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:r,end:s,min:a,max:o}}function Vu(e,t,n,i){return kt(e)?Oy(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Wu(e,t,n,i){const r=e.iScale,s=e.vScale,a=r.getLabels(),o=r===s,c=[];let l,u,h,f;for(l=n,u=n+i;l<u;++l)f=t[l],h={},h[r.axis]=o||r.parse(a[l],l),c.push(Vu(f,h,s,l));return c}function ho(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Py(e,t,n){return e!==0?Ye(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function Ry(e){let t,n,i,r,s;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(r="end",s="start"):(r="start",s="end"),{start:n,end:i,reverse:t,top:r,bottom:s}}function Ay(e,t,n,i){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:c,top:l,bottom:u}=Ry(e);r==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?r=l:(n._bottom||0)===i?r=u:(s[Yu(u,a,o,c)]=!0,r=l)),s[Yu(r,a,o,c)]=!0,e.borderSkipped=s}function Yu(e,t,n,i){return i?(e=Iy(e,t,n),e=$u(e,n,t)):e=$u(e,t,n),e}function Iy(e,t,n){return e===t?n:e===n?t:e}function $u(e,t,n){return e==="start"?t:e==="end"?n:e}function Ly(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class dr extends Be{parsePrimitiveData(t,n,i,r){return Wu(t,n,i,r)}parseArrayData(t,n,i,r){return Wu(t,n,i,r)}parseObjectData(t,n,i,r){const{iScale:s,vScale:a}=t,{xAxisKey:o="x",yAxisKey:c="y"}=this._parsing,l=s.axis==="x"?o:c,u=a.axis==="x"?o:c,h=[];let f,m,g,p;for(f=i,m=i+r;f<m;++f)p=n[f],g={},g[s.axis]=s.parse(kn(p,l),f),h.push(Vu(kn(p,u),g,a,f));return h}updateRangeFromParsed(t,n,i,r){super.updateRangeFromParsed(t,n,i,r);const s=i._custom;s&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:r}=n,s=this.getParsed(t),a=s._custom,o=ho(a)?"["+a.start+", "+a.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+i.getLabelForValue(s[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,r){const s=r==="reset",{index:a,_cachedMeta:{vScale:o}}=this,c=o.getBasePixel(),l=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,r);for(let m=n;m<n+i;m++){const g=this.getParsed(m),p=s||st(g[o.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),S=(g._stacks||{})[o.axis],v={horizontal:l,base:p.base,enableBorderRadius:!S||ho(g._custom)||a===S._top||a===S._bottom,x:l?p.head:x.center,y:l?x.center:p.head,height:l?x.size:Math.abs(p.size),width:l?Math.abs(p.size):x.size};f&&(v.options=h||this.resolveDataElementOptions(m,t[m].active?"active":r));const k=v.options||t[m].options;Ay(v,k,S,a),Ly(v,k,u.ratio),this.updateElement(t[m],m,v,r)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,r=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(n),c=o&&o[i.axis],l=u=>{const h=u._parsed.find(m=>m[i.axis]===c),f=h&&h[u.vScale.axis];if(st(f)||isNaN(f))return!0};for(const u of r)if(!(n!==void 0&&l(u))&&((s===!1||a.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&a.push(u.stack),u.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[at(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const r=this._getStacks(t,i),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,r=[];let s,a;for(s=0,a=n.data.length;s<a;++s)r.push(i.getPixelForValue(this.getParsed(s)[i.axis],s));const o=t.barThickness;return{min:o||Dy(n),pixels:r,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:r},options:{base:s,minBarLength:a}}=this,o=s||0,c=this.getParsed(t),l=c._custom,u=ho(l);let h=c[n.axis],f=0,m=i?this.applyStack(n,c,i):h,g,p;m!==h&&(f=m-h,m=h),u&&(h=l.barStart,m=l.barEnd-l.barStart,h!==0&&Ye(h)!==Ye(l.barEnd)&&(f=0),f+=h);const x=!st(s)&&!u?s:f;let S=n.getPixelForValue(x);if(this.chart.getDataVisibility(t)?g=n.getPixelForValue(f+m):g=S,p=g-S,Math.abs(p)<a){p=Py(p,n,o)*a,h===o&&(S-=p/2);const v=n.getPixelForDecimal(0),k=n.getPixelForDecimal(1),D=Math.min(v,k),M=Math.max(v,k);S=Math.max(Math.min(S,M),D),g=S+p,i&&!u&&(c._stacks[n.axis]._visualValues[r]=n.getValueForPixel(g)-n.getValueForPixel(S))}if(S===n.getPixelForValue(o)){const v=Ye(p)*n.getLineWidthForValue(o)/2;S+=v,p-=v}return{size:p,base:S,head:g,center:g+p/2}}_calculateBarIndexPixels(t,n){const i=n.scale,r=this.options,s=r.skipNull,a=at(r.maxBarThickness,1/0);let o,c;const l=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(t):n.stackCount,h=r.barThickness==="flex"?Ey(t,n,r,u*l):Cy(t,n,r,u*l),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(at(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+m;o=h.start+h.chunk*g+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else o=i.getPixelForValue(this.getParsed(t)[i.axis],t),c=Math.min(a,n.min*n.ratio);return{base:o-c/2,head:o+c/2,center:o,size:c}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,r=i.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!i[s].hidden&&i[s].draw(this._ctx)}}R(dr,"id","bar"),R(dr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),R(dr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Ts extends Be{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,r){const s=super.parsePrimitiveData(t,n,i,r);for(let a=0;a<s.length;a++)s[a]._custom=this.resolveDataElementOptions(a+i).radius;return s}parseArrayData(t,n,i,r){const s=super.parseArrayData(t,n,i,r);for(let a=0;a<s.length;a++){const o=n[i+a];s[a]._custom=at(o[2],this.resolveDataElementOptions(a+i).radius)}return s}parseObjectData(t,n,i,r){const s=super.parseObjectData(t,n,i,r);for(let a=0;a<s.length;a++){const o=n[i+a];s[a]._custom=at(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return s}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),o=r.getLabelForValue(a.x),c=s.getLabelForValue(a.y),l=a._custom;return{label:i[t]||"",value:"("+o+", "+c+(l?", "+l:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:c,includeOptions:l}=this._getSharedOptions(n,r),u=a.axis,h=o.axis;for(let f=n;f<n+i;f++){const m=t[f],g=!s&&this.getParsed(f),p={},x=p[u]=s?a.getPixelForDecimal(.5):a.getPixelForValue(g[u]),S=p[h]=s?o.getBasePixel():o.getPixelForValue(g[h]);p.skip=isNaN(x)||isNaN(S),l&&(p.options=c||this.resolveDataElementOptions(f,m.active?"active":r),s&&(p.options.radius=0)),this.updateElement(m,f,p,r)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let r=super.resolveDataElementOptions(t,n);r.$shared&&(r=Object.assign({},r,{$shared:!1}));const s=r.radius;return n!=="active"&&(r.radius=0),r.radius+=at(i&&i._custom,s),r}}R(Ts,"id","bubble"),R(Ts,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),R(Ts,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Ny(e,t,n){let i=1,r=1,s=0,a=0;if(t<Ot){const o=e,c=o+t,l=Math.cos(o),u=Math.sin(o),h=Math.cos(c),f=Math.sin(c),m=(k,D,M)=>ir(k,o,c,!0)?1:Math.max(D,D*n,M,M*n),g=(k,D,M)=>ir(k,o,c,!0)?-1:Math.min(D,D*n,M,M*n),p=m(0,l,h),x=m(Pt,u,f),S=g(dt,l,h),v=g(dt+Pt,u,f);i=(p-S)/2,r=(x-v)/2,s=-(p+S)/2,a=-(x+v)/2}return{ratioX:i,ratioY:r,offsetX:s,offsetY:a}}class an extends Be{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=i;else{let s=c=>+i[c];if(ft(i[t])){const{key:c="value"}=this._parsing;s=l=>+kn(i[l],c)}let a,o;for(a=t,o=t+n;a<o;++a)r._parsed[a]=s(a)}}_getRotation(){return jt(this.options.rotation-90)}_getCircumference(){return jt(this.options.circumference)}_getRotationExtents(){let t=Ot,n=-Ot;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const r=this.chart.getDatasetMeta(i).controller,s=r._getRotation(),a=r._getCircumference();t=Math.min(t,s),n=Math.max(n,s+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,r=this._cachedMeta,s=r.data,a=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),c=Math.min(Gg(this.options.cutout,o),1),l=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:g,offsetY:p}=Ny(h,u,c),x=(i.width-a)/f,S=(i.height-a)/m,v=Math.max(Math.min(x,S)/2,0),k=qc(this.options.radius,v),D=Math.max(k*c,0),M=(k-D)/this._getVisibleDatasetWeightTotal();this.offsetX=g*k,this.offsetY=p*k,r.total=this.calculateTotal(),this.outerRadius=k-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*l,0),this.updateElements(s,0,s.length,t)}_circumference(t,n){const i=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/Ot)}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,o=a.chartArea,l=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=s&&l.animateScale,m=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:p,includeOptions:x}=this._getSharedOptions(n,r);let S=this._getRotation(),v;for(v=0;v<n;++v)S+=this._circumference(v,s);for(v=n;v<n+i;++v){const k=this._circumference(v,s),D=t[v],M={x:u+this.offsetX,y:h+this.offsetY,startAngle:S,endAngle:S+k,circumference:k,outerRadius:g,innerRadius:m};x&&(M.options=p||this.resolveDataElementOptions(v,D.active?"active":r)),S+=k,this.updateElement(D,v,M,r)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,r;for(r=0;r<n.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(i+=Math.abs(s))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?Ot*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=sr(n._parsed[t],i.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let n=0;const i=this.chart;let r,s,a,o,c;if(!t){for(r=0,s=i.data.datasets.length;r<s;++r)if(i.isDatasetVisible(r)){a=i.getDatasetMeta(r),t=a.data,o=a.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)c=o.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,r=t.length;i<r;++i){const s=this.resolveDataElementOptions(i);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(at(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}R(an,"id","doughnut"),R(an,"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"}),R(an,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),R(an,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:r,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}});class hr extends Be{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:r=[],_dataset:s}=n,a=this.chart._animationsDisabled;let{start:o,count:c}=su(n,r,a);this._drawStart=o,this._drawCount=c,au(n)&&(o=0,c=r.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=r;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:l},t),this.updateElements(r,o,c,t)}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o,_stacked:c,_dataset:l}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(n,r),f=a.axis,m=o.axis,{spanGaps:g,segment:p}=this.options,x=Tn(g)?g:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||s||r==="none",v=n+i,k=t.length;let D=n>0&&this.getParsed(n-1);for(let M=0;M<k;++M){const P=t[M],E=S?P:{};if(M<n||M>=v){E.skip=!0;continue}const y=this.getParsed(M),_=st(y[m]),T=E[f]=a.getPixelForValue(y[f],M),O=E[m]=s||_?o.getBasePixel():o.getPixelForValue(c?this.applyStack(o,y,c):y[m],M);E.skip=isNaN(T)||isNaN(O)||_,E.stop=M>0&&Math.abs(y[f]-D[f])>x,p&&(E.parsed=y,E.raw=l.data[M]),h&&(E.options=u||this.resolveDataElementOptions(M,P.active?"active":r)),S||this.updateElement(P,M,E,r),D=y}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,r=t.data||[];if(!r.length)return i;const s=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(i,s,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}R(hr,"id","line"),R(hr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),R(hr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class fr extends Be{constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,r=i.data.labels||[],s=sr(n._parsed[t].r,i.options.locale);return{label:r[t]||"",value:s}}parseObjectData(t,n,i,r){return wu.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,r)=>{const s=this.getParsed(r).r;!isNaN(s)&&this.chart.getDataVisibility(r)&&(s<n.min&&(n.min=s),s>n.max&&(n.max=s))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,r=Math.min(n.right-n.left,n.bottom-n.top),s=Math.max(r/2,0),a=Math.max(i.cutoutPercentage?s/100*i.cutoutPercentage:1,0),o=(s-a)/t.getVisibleDatasetCount();this.outerRadius=s-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,n,i,r){const s=r==="reset",a=this.chart,c=a.options.animation,l=this._cachedMeta.rScale,u=l.xCenter,h=l.yCenter,f=l.getIndexAngle(0)-.5*dt;let m=f,g;const p=360/this.countVisibleElements();for(g=0;g<n;++g)m+=this._computeAngle(g,r,p);for(g=n;g<n+i;g++){const x=t[g];let S=m,v=m+this._computeAngle(g,r,p),k=a.getDataVisibility(g)?l.getDistanceFromCenterForValue(this.getParsed(g).r):0;m=v,s&&(c.animateScale&&(k=0),c.animateRotate&&(S=v=f));const D={x:u,y:h,innerRadius:0,outerRadius:k,startAngle:S,endAngle:v,options:this.resolveDataElementOptions(g,x.active?"active":r)};this.updateElement(x,g,D,r)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,r)=>{!isNaN(this.getParsed(r).r)&&this.chart.getDataVisibility(r)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?jt(this.resolveDataElementOptions(t,n).angle||i):0}}R(fr,"id","polarArea"),R(fr,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),R(fr,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:r}}=t.legend.options;return n.labels.map((s,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:r,lineWidth:c.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class fo extends an{}R(fo,"id","pie"),R(fo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Ds extends Be{getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,r){return wu.bind(this)(t,n,i,r)}update(t){const n=this._cachedMeta,i=n.dataset,r=n.data||[],s=n.iScale.getLabels();if(i.points=r,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:s.length===r.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(r,0,r.length,t)}updateElements(t,n,i,r){const s=this._cachedMeta.rScale,a=r==="reset";for(let o=n;o<n+i;o++){const c=t[o],l=this.resolveDataElementOptions(o,c.active?"active":r),u=s.getPointPositionForValue(o,this.getParsed(o).r),h=a?s.xCenter:u.x,f=a?s.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:l};this.updateElement(c,o,m,r)}}}R(Ds,"id","radar"),R(Ds,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),R(Ds,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cs extends Be{getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:r,yScale:s}=n,a=this.getParsed(t),o=r.getLabelForValue(a.x),c=s.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+c+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,r=this.chart._animationsDisabled;let{start:s,count:a}=su(n,i,r);if(this._drawStart=s,this._drawCount=a,au(n)&&(s=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:c}=n;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!c._decimated,o.points=i;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(o,void 0,{animated:!r,options:l},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,s,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,r){const s=r==="reset",{iScale:a,vScale:o,_stacked:c,_dataset:l}=this._cachedMeta,u=this.resolveDataElementOptions(n,r),h=this.getSharedOptions(u),f=this.includeOptions(r,h),m=a.axis,g=o.axis,{spanGaps:p,segment:x}=this.options,S=Tn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||s||r==="none";let k=n>0&&this.getParsed(n-1);for(let D=n;D<n+i;++D){const M=t[D],P=this.getParsed(D),E=v?M:{},y=st(P[g]),_=E[m]=a.getPixelForValue(P[m],D),T=E[g]=s||y?o.getBasePixel():o.getPixelForValue(c?this.applyStack(o,P,c):P[g],D);E.skip=isNaN(_)||isNaN(T)||y,E.stop=D>0&&Math.abs(P[m]-k[m])>S,x&&(E.parsed=P,E.raw=l.data[D]),f&&(E.options=h||this.resolveDataElementOptions(D,M.active?"active":r)),v||this.updateElement(M,D,E,r),k=P}this.updateSharedOptions(h,r,u)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let o=0;for(let c=n.length-1;c>=0;--c)o=Math.max(o,n[c].size(this.resolveDataElementOptions(c))/2);return o>0&&o}const i=t.dataset,r=i.options&&i.options.borderWidth||0;if(!n.length)return r;const s=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,s,a)/2}}R(Cs,"id","scatter"),R(Cs,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),R(Cs,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Fy=Object.freeze({__proto__:null,BarController:dr,BubbleController:Ts,DoughnutController:an,LineController:hr,PieController:fo,PolarAreaController:fr,RadarController:Ds,ScatterController:Cs});function Kn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class mo{constructor(t){R(this,"options");this.options=t||{}}static override(t){Object.assign(mo.prototype,t)}init(){}formats(){return Kn()}parse(){return Kn()}format(){return Kn()}add(){return Kn()}diff(){return Kn()}startOf(){return Kn()}endOf(){return Kn()}}var ju={_date:mo};function By(e,t,n,i){const{controller:r,data:s,_sorted:a}=e,o=r._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&s.length){const l=o._reversePixels?op:nn;if(i){if(r._sharedOptions){const u=s[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=l(s,t,n-h),m=l(s,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const u=l(s,t,n);if(c){const{vScale:h}=r._cachedMeta,{_parsed:f}=e,m=f.slice(0,u.lo+1).reverse().findIndex(p=>!st(p[h.axis]));u.lo-=Math.max(0,m);const g=f.slice(u.hi).findIndex(p=>!st(p[h.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function mr(e,t,n,i,r){const s=e.getSortedVisibleDatasetMetas(),a=n[t];for(let o=0,c=s.length;o<c;++o){const{index:l,data:u}=s[o],{lo:h,hi:f}=By(s[o],t,a,r);for(let m=h;m<=f;++m){const g=u[m];g.skip||i(g,l,m)}}}function zy(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,r){const s=t?Math.abs(i.x-r.x):0,a=n?Math.abs(i.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(a,2))}}function go(e,t,n,i,r){const s=[];return!r&&!e.isPointInArea(t)||mr(e,n,t,function(o,c,l){!r&&!rn(o,e.chartArea,0)||o.inRange(t.x,t.y,i)&&s.push({element:o,datasetIndex:c,index:l})},!0),s}function Hy(e,t,n,i){let r=[];function s(a,o,c){const{startAngle:l,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=ys(a,{x:t.x,y:t.y});ir(h,l,u)&&r.push({element:a,datasetIndex:o,index:c})}return mr(e,n,t,s),r}function Vy(e,t,n,i,r,s){let a=[];const o=zy(n);let c=Number.POSITIVE_INFINITY;function l(u,h,f){const m=u.inRange(t.x,t.y,r);if(i&&!m)return;const g=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(g))&&!m)return;const x=o(t,g);x<c?(a=[{element:u,datasetIndex:h,index:f}],c=x):x===c&&a.push({element:u,datasetIndex:h,index:f})}return mr(e,n,t,l),a}function po(e,t,n,i,r,s){return!s&&!e.isPointInArea(t)?[]:n==="r"&&!i?Hy(e,t,n,r):Vy(e,t,n,i,r,s)}function Uu(e,t,n,i,r){const s=[],a=n==="x"?"inXRange":"inYRange";let o=!1;return mr(e,n,t,(c,l,u)=>{c[a]&&c[a](t[n],r)&&(s.push({element:c,datasetIndex:l,index:u}),o=o||c.inRange(t.x,t.y,r))}),i&&!o?[]:s}var yo={evaluateInteractionItems:mr,modes:{index(e,t,n,i){const r=En(t,e),s=n.axis||"x",a=n.includeInvisible||!1,o=n.intersect?go(e,r,s,i,a):po(e,r,s,!1,i,a),c=[];return o.length?(e.getSortedVisibleDatasetMetas().forEach(l=>{const u=o[0].index,h=l.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:l.index,index:u})}),c):[]},dataset(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;let o=n.intersect?go(e,r,s,i,a):po(e,r,s,!1,i,a);if(o.length>0){const c=o[0].datasetIndex,l=e.getDatasetMeta(c).data;o=[];for(let u=0;u<l.length;++u)o.push({element:l[u],datasetIndex:c,index:u})}return o},point(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return go(e,r,s,i,a)},nearest(e,t,n,i){const r=En(t,e),s=n.axis||"xy",a=n.includeInvisible||!1;return po(e,r,s,n.intersect,i,a)},x(e,t,n,i){const r=En(t,e);return Uu(e,r,"x",n.intersect,i)},y(e,t,n,i){const r=En(t,e);return Uu(e,r,"y",n.intersect,i)}}};const qu=["left","top","right","bottom"];function gr(e,t){return e.filter(n=>n.pos===t)}function Xu(e,t){return e.filter(n=>qu.indexOf(n.pos)===-1&&n.box.axis===t)}function pr(e,t){return e.sort((n,i)=>{const r=t?i:n,s=t?n:i;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function Wy(e){const t=[];let n,i,r,s,a,o;for(n=0,i=(e||[]).length;n<i;++n)r=e[n],{position:s,options:{stack:a,stackWeight:o=1}}=r,t.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:a&&s+a,stackWeight:o});return t}function Yy(e){const t={};for(const n of e){const{stack:i,pos:r,stackWeight:s}=n;if(!i||!qu.includes(r))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=s}return t}function $y(e,t){const n=Yy(e),{vBoxMaxWidth:i,hBoxMaxHeight:r}=t;let s,a,o;for(s=0,a=e.length;s<a;++s){o=e[s];const{fullSize:c}=o.box,l=n[o.stack],u=l&&o.stackWeight/l.weight;o.horizontal?(o.width=u?u*i:c&&t.availableWidth,o.height=r):(o.width=i,o.height=u?u*r:c&&t.availableHeight)}return n}function jy(e){const t=Wy(e),n=pr(t.filter(l=>l.box.fullSize),!0),i=pr(gr(t,"left"),!0),r=pr(gr(t,"right")),s=pr(gr(t,"top"),!0),a=pr(gr(t,"bottom")),o=Xu(t,"x"),c=Xu(t,"y");return{fullSize:n,leftAndTop:i.concat(s),rightAndBottom:r.concat(c).concat(a).concat(o),chartArea:gr(t,"chartArea"),vertical:i.concat(r).concat(c),horizontal:s.concat(a).concat(o)}}function Gu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function Ku(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Uy(e,t,n,i){const{pos:r,box:s}=n,a=e.maxPadding;if(!ft(r)){n.size&&(e[r]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?s.height:s.width),n.size=h.size/h.count,e[r]+=n.size}s.getPadding&&Ku(a,s.getPadding());const o=Math.max(0,t.outerWidth-Gu(a,e,"left","right")),c=Math.max(0,t.outerHeight-Gu(a,e,"top","bottom")),l=o!==e.w,u=c!==e.h;return e.w=o,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function qy(e){const t=e.maxPadding;function n(i){const r=Math.max(t[i]-e[i],0);return e[i]+=r,r}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Xy(e,t){const n=t.maxPadding;function i(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(a=>{s[a]=Math.max(t[a],n[a])}),s}return i(e?["left","right"]:["top","bottom"])}function yr(e,t,n,i){const r=[];let s,a,o,c,l,u;for(s=0,a=e.length,l=0;s<a;++s){o=e[s],c=o.box,c.update(o.width||t.w,o.height||t.h,Xy(o.horizontal,t));const{same:h,other:f}=Uy(t,n,o,i);l|=h&&r.length,u=u||f,c.fullSize||r.push(o)}return l&&yr(r,t,n,i)||u}function Es(e,t,n,i,r){e.top=n,e.left=t,e.right=t+i,e.bottom=n+r,e.width=i,e.height=r}function Zu(e,t,n,i){const r=n.padding;let{x:s,y:a}=t;for(const o of e){const c=o.box,l=i[o.stack]||{placed:0,weight:1},u=o.stackWeight/l.weight||1;if(o.horizontal){const h=t.w*u,f=l.size||c.height;ye(l.start)&&(a=l.start),c.fullSize?Es(c,r.left,a,n.outerWidth-r.right-r.left,f):Es(c,t.left+l.placed,a,h,f),l.start=a,l.placed+=h,a=c.bottom}else{const h=t.h*u,f=l.size||c.width;ye(l.start)&&(s=l.start),c.fullSize?Es(c,s,r.top,f,n.outerHeight-r.bottom-r.top):Es(c,s,t.top+l.placed,f,h),l.start=s,l.placed+=h,s=c.right}}t.x=s,t.y=a}var oe={addBox(e,t){e.boxes||(e.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(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const r=Ut(e.options.layout.padding),s=Math.max(t-r.width,0),a=Math.max(n-r.height,0),o=jy(e.boxes),c=o.vertical,l=o.horizontal;Tt(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=c.reduce((p,x)=>x.box.options&&x.box.options.display===!1?p:p+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:r,availableWidth:s,availableHeight:a,vBoxMaxWidth:s/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},r);Ku(f,Ut(i));const m=Object.assign({maxPadding:f,w:s,h:a,x:r.left,y:r.top},r),g=$y(c.concat(l),h);yr(o.fullSize,m,h,g),yr(c,m,h,g),yr(l,m,h,g)&&yr(c,m,h,g),qy(m),Zu(o.leftAndTop,m,h,g),m.x+=m.w,m.y+=m.h,Zu(o.rightAndBottom,m,h,g),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Tt(o.chartArea,p=>{const x=p.box;Object.assign(x,e.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Qu{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,r){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,r?Math.floor(n/r):i)}}isAttached(t){return!0}updateConfig(t){}}class Gy extends Qu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Os="$chartjs",Ky={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ju=e=>e===null||e==="";function Zy(e,t){const n=e.style,i=e.getAttribute("height"),r=e.getAttribute("width");if(e[Os]={initial:{height:i,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ju(r)){const s=ku(e,"width");s!==void 0&&(e.width=s)}if(Ju(i))if(e.style.height==="")e.height=e.width/(t||2);else{const s=ku(e,"height");s!==void 0&&(e.height=s)}return e}const td=ty?{passive:!0}:!1;function Qy(e,t,n){e&&e.addEventListener(t,n,td)}function Jy(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,td)}function tb(e,t){const n=Ky[e.type]||e.type,{x:i,y:r}=En(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:r!==void 0?r:null}}function Ps(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function eb(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const o of s)a=a||Ps(o.addedNodes,i),a=a&&!Ps(o.removedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function nb(e,t,n){const i=e.canvas,r=new MutationObserver(s=>{let a=!1;for(const o of s)a=a||Ps(o.removedNodes,i),a=a&&!Ps(o.addedNodes,i);a&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const br=new Map;let ed=0;function nd(){const e=window.devicePixelRatio;e!==ed&&(ed=e,br.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function ib(e,t){br.size||window.addEventListener("resize",nd),br.set(e,t)}function rb(e){br.delete(e),br.size||window.removeEventListener("resize",nd)}function sb(e,t,n){const i=e.canvas,r=i&&ao(i);if(!r)return;const s=ru((o,c)=>{const l=r.clientWidth;n(o,c),l<r.clientWidth&&n()},window),a=new ResizeObserver(o=>{const c=o[0],l=c.contentRect.width,u=c.contentRect.height;l===0&&u===0||s(l,u)});return a.observe(r),ib(e,s),a}function bo(e,t,n){n&&n.disconnect(),t==="resize"&&rb(e)}function ab(e,t,n){const i=e.canvas,r=ru(s=>{e.ctx!==null&&n(tb(s,e))},e);return Qy(i,t,r),r}class ob extends Qu{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Zy(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Os])return!1;const i=n[Os].initial;["height","width"].forEach(s=>{const a=i[s];st(a)?n.removeAttribute(s):n.setAttribute(s,a)});const r=i.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Os],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const r=t.$proxies||(t.$proxies={}),a={attach:eb,detach:nb,resize:sb}[n]||ab;r[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),r=i[n];if(!r)return;({attach:bo,detach:bo,resize:bo}[n]||Jy)(t,n,r),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,r){return Jp(t,n,i,r)}isAttached(t){const n=t&&ao(t);return!!(n&&n.isConnected)}}function lb(e){return!so()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Gy:ob}class Jt{constructor(){R(this,"x");R(this,"y");R(this,"active",!1);R(this,"options");R(this,"$animations")}tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Tn(this.x)&&Tn(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const r={};return t.forEach(s=>{r[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),r}}R(Jt,"defaults",{}),R(Jt,"defaultRoutes");function cb(e,t){const n=e.options.ticks,i=ub(e),r=Math.min(n.maxTicksLimit||i,i),s=n.major.enabled?hb(t):[],a=s.length,o=s[0],c=s[a-1],l=[];if(a>r)return fb(t,l,s,a/r),l;const u=db(s,t,r);if(a>0){let h,f;const m=a>1?Math.round((c-o)/(a-1)):null;for(Rs(t,l,u,st(m)?0:o-m,o),h=0,f=a-1;h<f;h++)Rs(t,l,u,s[h],s[h+1]);return Rs(t,l,u,c,st(m)?t.length:c+m),l}return Rs(t,l,u),l}function ub(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),r=e._maxLength/n;return Math.floor(Math.min(i,r))}function db(e,t,n){const i=mb(e),r=t.length/n;if(!i)return Math.max(r,1);const s=np(i);for(let a=0,o=s.length-1;a<o;a++){const c=s[a];if(c>r)return c}return Math.max(r,1)}function hb(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function fb(e,t,n,i){let r=0,s=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===s&&(t.push(e[a]),r++,s=n[r*i])}function Rs(e,t,n,i,r){const s=at(i,0),a=Math.min(at(r,e.length),e.length);let o=0,c,l,u;for(n=Math.ceil(n),r&&(c=r-i,n=c/Math.floor(c/n)),u=s;u<0;)o++,u=Math.round(s+o*n);for(l=Math.max(s,0);l<a;l++)l===u&&(t.push(e[l]),o++,u=Math.round(s+o*n))}function mb(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const gb=e=>e==="left"?"right":e==="right"?"left":e,id=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,rd=(e,t)=>Math.min(t||e,e);function sd(e,t){const n=[],i=e.length/t,r=e.length;let s=0;for(;s<r;s+=i)n.push(e[Math.floor(s)]);return n}function pb(e,t,n){const i=e.ticks.length,r=Math.min(t,i-1),s=e._startPixel,a=e._endPixel,o=1e-6;let c=e.getPixelForTick(r),l;if(!(n&&(i===1?l=Math.max(c-s,a-c):t===0?l=(e.getPixelForTick(1)-c)/2:l=(c-e.getPixelForTick(r-1))/2,c+=r<t?l:-l,c<s-o||c>a+o)))return c}function yb(e,t){Tt(e,n=>{const i=n.gc,r=i.length/2;let s;if(r>t){for(s=0;s<r;++s)delete n.data[i[s]];i.splice(0,r)}})}function _r(e){return e.drawTicks?e.tickLength:0}function ad(e,t){if(!e.display)return 0;const n=It(e.font,t),i=Ut(e.padding);return(kt(e.text)?e.text.length:1)*n.lineHeight+i.height}function bb(e,t){return Cn(e,{scale:t,type:"scale"})}function _b(e,t,n){return Cn(e,{tick:n,index:t,type:"tick"})}function xb(e,t,n){let i=Ga(e);return(n&&t!=="right"||!n&&t==="right")&&(i=gb(i)),i}function wb(e,t,n,i){const{top:r,left:s,bottom:a,right:o,chart:c}=e,{chartArea:l,scales:u}=c;let h=0,f,m,g;const p=a-r,x=o-s;if(e.isHorizontal()){if(m=ae(i,s,o),ft(n)){const S=Object.keys(n)[0],v=n[S];g=u[S].getPixelForValue(v)+p-t}else n==="center"?g=(l.bottom+l.top)/2+p-t:g=id(e,n,t);f=o-s}else{if(ft(n)){const S=Object.keys(n)[0],v=n[S];m=u[S].getPixelForValue(v)-x+t}else n==="center"?m=(l.left+l.right)/2-x+t:m=id(e,n,t);g=ae(i,a,r),h=n==="left"?-Pt:Pt}return{titleX:m,titleY:g,maxWidth:f,rotation:h}}class Zn 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,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:r}=this;return t=De(t,Number.POSITIVE_INFINITY),n=De(n,Number.NEGATIVE_INFINITY),i=De(i,Number.POSITIVE_INFINITY),r=De(r,Number.NEGATIVE_INFINITY),{min:De(t,i),max:De(n,r),minDefined:At(t),maxDefined:At(n)}}getMinMax(t){let{min:n,max:i,minDefined:r,maxDefined:s}=this.getUserBounds(),a;if(r&&s)return{min:n,max:i};const o=this.getMatchingVisibleMetas();for(let c=0,l=o.length;c<l;++c)a=o[c].controller.getMinMax(this,t),r||(n=Math.min(n,a.min)),s||(i=Math.max(i,a.max));return n=s&&n>i?i:n,i=r&&n>i?n:i,{min:De(n,De(i,n)),max:De(i,De(n,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(){Mt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:r,grace:s,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,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=Pp(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=o<this.ticks.length;this._convertTicksToLabels(c?sd(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=cb(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Mt(this.options.afterUpdate,[this])}beforeSetDimensions(){Mt(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(){Mt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Mt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Mt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,r,s;for(i=0,r=t.length;i<r;i++)s=t[i],s.label=Mt(n.callback,[s.value,i,t],this)}afterTickToLabelConversion(){Mt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Mt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=rd(this.ticks.length,t.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let a=r,o,c,l;if(!this._isVisible()||!n.display||r>=s||i<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Qt(this.chart.width-h,0,this.maxWidth);o=t.offset?this.maxWidth/i:m/(i-1),h+6>o&&(o=m/(i-(t.offset?.5:1)),c=this.maxHeight-_r(t.grid)-n.padding-ad(t.title,this.chart.options.font),l=Math.sqrt(h*h+f*f),a=ps(Math.min(Math.asin(Qt((u.highest.height+6)/o,-1,1)),Math.asin(Qt(c/l,-1,1))-Math.asin(Qt(f/l,-1,1)))),a=Math.max(r,Math.min(s,a))),this.labelRotation=a}afterCalculateLabelRotation(){Mt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Mt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:r,grid:s}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const c=ad(r,n.options.font);if(o?(t.width=this.maxWidth,t.height=_r(s)+c):(t.height=this.maxHeight,t.width=_r(s)+c),i.display&&this.ticks.length){const{first:l,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,g=jt(this.labelRotation),p=Math.cos(g),x=Math.sin(g);if(o){const S=i.mirror?0:x*h.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+S+m)}else{const S=i.mirror?0:p*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+S+m)}this._calculatePadding(l,u,x,p)}}this._handleMargins(),o?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,r){const{ticks:{align:s,padding:a},position:o}=this.options,c=this.labelRotation!==0,l=o!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;c?l?(f=r*t.width,m=i*n.height):(f=i*t.height,m=r*n.width):s==="start"?m=n.width:s==="end"?f=t.width:s!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-u+a)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let u=n.height/2,h=t.height/2;s==="start"?(u=0,h=t.height):s==="end"&&(u=n.height,h=0),this.paddingTop=u+a,this.paddingBottom=h+a}}_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(){Mt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)st(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=sd(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:r,_longestTextCache:s}=this,a=[],o=[],c=Math.floor(n/rd(n,i));let l=0,u=0,h,f,m,g,p,x,S,v,k,D,M;for(h=0;h<n;h+=c){if(g=t[h].label,p=this._resolveTickFontOptions(h),r.font=x=p.string,S=s[x]=s[x]||{data:{},gc:[]},v=p.lineHeight,k=D=0,!st(g)&&!kt(g))k=xs(r,S.data,S.gc,k,g),D=v;else if(kt(g))for(f=0,m=g.length;f<m;++f)M=g[f],!st(M)&&!kt(M)&&(k=xs(r,S.data,S.gc,k,M),D+=v);a.push(k),o.push(D),l=Math.max(k,l),u=Math.max(D,u)}yb(s,n);const P=a.indexOf(l),E=o.indexOf(u),y=_=>({width:a[_]||0,height:o[_]||0});return{first:y(0),last:y(n-1),widest:y(P),highest:y(E),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return ap(this._alignToPixels?Un(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=_b(this.getContext(),t,i))}return this.$context||(this.$context=bb(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=jt(this.labelRotation),i=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),a=t.autoSkipPadding||0,o=s?s.widest.width+a:0,c=s?s.highest.height+a:0;return this.isHorizontal()?c*i>o*r?o/i:c/r:c*r<o*i?c/i:o/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,r=this.options,{grid:s,position:a,border:o}=r,c=s.offset,l=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=_r(s),m=[],g=o.setContext(this.getContext()),p=g.display?g.width:0,x=p/2,S=function(G){return Un(i,G,p)};let v,k,D,M,P,E,y,_,T,O,A,I;if(a==="top")v=S(this.bottom),E=this.bottom-f,_=v-x,O=S(t.top)+x,I=t.bottom;else if(a==="bottom")v=S(this.top),O=t.top,I=S(t.bottom)-x,E=v+x,_=this.top+f;else if(a==="left")v=S(this.right),P=this.right-f,y=v-x,T=S(t.left)+x,A=t.right;else if(a==="right")v=S(this.left),T=t.left,A=S(t.right)-x,P=v+x,y=this.left+f;else if(n==="x"){if(a==="center")v=S((t.top+t.bottom)/2+.5);else if(ft(a)){const G=Object.keys(a)[0],V=a[G];v=S(this.chart.scales[G].getPixelForValue(V))}O=t.top,I=t.bottom,E=v+x,_=E+f}else if(n==="y"){if(a==="center")v=S((t.left+t.right)/2);else if(ft(a)){const G=Object.keys(a)[0],V=a[G];v=S(this.chart.scales[G].getPixelForValue(V))}P=v-x,y=P-f,T=t.left,A=t.right}const B=at(r.ticks.maxTicksLimit,h),q=Math.max(1,Math.ceil(h/B));for(k=0;k<h;k+=q){const G=this.getContext(k),V=s.setContext(G),lt=o.setContext(G),X=V.lineWidth,Q=V.color,H=lt.dash||[],U=lt.dashOffset,Y=V.tickWidth,xt=V.tickColor,yt=V.tickBorderDash||[],vt=V.tickBorderDashOffset;D=pb(this,k,c),D!==void 0&&(M=Un(i,D,X),l?P=y=T=A=M:E=_=O=I=M,m.push({tx1:P,ty1:E,tx2:y,ty2:_,x1:T,y1:O,x2:A,y2:I,width:X,color:Q,borderDash:H,borderDashOffset:U,tickWidth:Y,tickColor:xt,tickBorderDash:yt,tickBorderDashOffset:vt}))}return this._ticksLength=h,this._borderValue=v,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:r,ticks:s}=i,a=this.isHorizontal(),o=this.ticks,{align:c,crossAlign:l,padding:u,mirror:h}=s,f=_r(i.grid),m=f+u,g=h?-u:m,p=-jt(this.labelRotation),x=[];let S,v,k,D,M,P,E,y,_,T,O,A,I="middle";if(r==="top")P=this.bottom-g,E=this._getXAxisLabelAlignment();else if(r==="bottom")P=this.top+g,E=this._getXAxisLabelAlignment();else if(r==="left"){const q=this._getYAxisLabelAlignment(f);E=q.textAlign,M=q.x}else if(r==="right"){const q=this._getYAxisLabelAlignment(f);E=q.textAlign,M=q.x}else if(n==="x"){if(r==="center")P=(t.top+t.bottom)/2+m;else if(ft(r)){const q=Object.keys(r)[0],G=r[q];P=this.chart.scales[q].getPixelForValue(G)+m}E=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")M=(t.left+t.right)/2-m;else if(ft(r)){const q=Object.keys(r)[0],G=r[q];M=this.chart.scales[q].getPixelForValue(G)}E=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(c==="start"?I="top":c==="end"&&(I="bottom"));const B=this._getLabelSizes();for(S=0,v=o.length;S<v;++S){k=o[S],D=k.label;const q=s.setContext(this.getContext(S));y=this.getPixelForTick(S)+s.labelOffset,_=this._resolveTickFontOptions(S),T=_.lineHeight,O=kt(D)?D.length:1;const G=O/2,V=q.color,lt=q.textStrokeColor,X=q.textStrokeWidth;let Q=E;a?(M=y,E==="inner"&&(S===v-1?Q=this.options.reverse?"left":"right":S===0?Q=this.options.reverse?"right":"left":Q="center"),r==="top"?l==="near"||p!==0?A=-O*T+T/2:l==="center"?A=-B.highest.height/2-G*T+T:A=-B.highest.height+T/2:l==="near"||p!==0?A=T/2:l==="center"?A=B.highest.height/2-G*T:A=B.highest.height-O*T,h&&(A*=-1),p!==0&&!q.showLabelBackdrop&&(M+=T/2*Math.sin(p))):(P=y,A=(1-O)*T/2);let H;if(q.showLabelBackdrop){const U=Ut(q.backdropPadding),Y=B.heights[S],xt=B.widths[S];let yt=A-U.top,vt=0-U.left;switch(I){case"middle":yt-=Y/2;break;case"bottom":yt-=Y;break}switch(E){case"center":vt-=xt/2;break;case"right":vt-=xt;break;case"inner":S===v-1?vt-=xt:S>0&&(vt-=xt/2);break}H={left:vt,top:yt,width:xt+U.width,height:Y+U.height,color:q.backdropColor}}x.push({label:D,font:_,textOffset:A,options:{rotation:p,color:V,strokeColor:lt,strokeWidth:X,textAlign:Q,textBaseline:I,translation:[M,P],backdrop:H}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-jt(this.labelRotation))return t==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:r,padding:s}}=this.options,a=this._getLabelSizes(),o=t+s,c=a.widest.width;let l,u;return n==="left"?r?(u=this.right+s,i==="near"?l="left":i==="center"?(l="center",u+=c/2):(l="right",u+=c)):(u=this.right-o,i==="near"?l="right":i==="center"?(l="center",u-=c/2):(l="left",u=this.left)):n==="right"?r?(u=this.left+s,i==="near"?l="right":i==="center"?(l="center",u-=c/2):(l="left",u-=c)):(u=this.left+o,i==="near"?l="left":i==="center"?(l="center",u+=c/2):(l="right",u=this.right)):l="right",{textAlign:l,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:r,width:s,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,r,s,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,a;const o=(c,l,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(c.x,c.y),i.lineTo(l.x,l.y),i.stroke(),i.restore())};if(n.display)for(s=0,a=r.length;s<a;++s){const c=r[s];n.drawOnChartArea&&o({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.drawTicks&&o({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:r}}=this,s=i.setContext(this.getContext()),a=i.display?s.width:0;if(!a)return;const o=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let l,u,h,f;this.isHorizontal()?(l=Un(t,this.left,a)-a/2,u=Un(t,this.right,o)+o/2,h=f=c):(h=Un(t,this.top,a)-a/2,f=Un(t,this.bottom,o)+o/2,l=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(l,h),n.lineTo(u,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,r=this._computeLabelArea();r&&or(i,r);const s=this.getLabelItems(t);for(const a of s){const o=a.options,c=a.font,l=a.label,u=a.textOffset;qn(i,l,0,u,c,o)}r&&lr(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:r}}=this;if(!i.display)return;const s=It(i.font),a=Ut(i.padding),o=i.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||ft(n)?(c+=a.bottom,kt(i.text)&&(c+=s.lineHeight*(i.text.length-1))):c+=a.top;const{titleX:l,titleY:u,maxWidth:h,rotation:f}=wb(this,c,n,o);qn(t,i.text,0,0,s,{color:i.color,maxWidth:h,rotation:f,textAlign:xb(o,n,r),textBaseline:"middle",translation:[l,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=at(t.grid&&t.grid.z,-1),r=at(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Zn.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",r=[];let s,a;for(s=0,a=n.length;s<a;++s){const o=n[s];o[i]===this.id&&(!t||o.type===t)&&r.push(o)}return r}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return It(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class As{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;kb(n)&&(i=this.register(n));const r=this.items,s=t.id,a=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,vb(t,a,i),this.override&&Rt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,r=this.scope;i in n&&delete n[i],r&&i in Rt[r]&&(delete Rt[r][i],this.override&&delete jn[i])}}function vb(e,t,n){const i=tr(Object.create(null),[n?Rt.get(n):{},Rt.get(t),e.defaults]);Rt.set(t,i),e.defaultRoutes&&Sb(t,e.defaultRoutes),e.descriptors&&Rt.describe(t,e.descriptors)}function Sb(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),r=i.pop(),s=[e].concat(i).join("."),a=t[n].split("."),o=a.pop(),c=a.join(".");Rt.route(s,r,c,o)})}function kb(e){return"id"in e&&"defaults"in e}class Mb{constructor(){this.controllers=new As(Be,"datasets",!0),this.elements=new As(Jt,"elements"),this.plugins=new As(Object,"plugins"),this.scales=new As(Zn,"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,n,i){[...n].forEach(r=>{const s=i||this._getRegistryForType(r);i||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Tt(r,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,n,i){const r=Ua(t);Mt(i["before"+r],[],i),n[t](i),Mt(i["after"+r],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const r=n.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return r}}var $e=new Mb;class Tb{constructor(){this._init=[]}notify(t,n,i,r){n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const s=r?this._descriptors(t).filter(r):this._descriptors(t),a=this._notify(s,t,n,i);return n==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,n,i,r){r=r||{};for(const s of t){const a=s.plugin,o=a[i],c=[n,r,s.options];if(Mt(o,c,a)===!1&&r.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,r=at(i.options&&i.options.plugins,{}),s=Db(i);return r===!1&&!n?[]:Eb(t,s,r,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,r=(s,a)=>s.filter(o=>!a.some(c=>o.plugin.id===c.plugin.id));this._notify(r(n,i),t,"stop"),this._notify(r(i,n),t,"start")}}function Db(e){const t={},n=[],i=Object.keys($e.plugins.items);for(let s=0;s<i.length;s++)n.push($e.getPlugin(i[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const a=r[s];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function Cb(e,t){return!t&&e===!1?null:e===!0?{}:e}function Eb(e,{plugins:t,localIds:n},i,r){const s=[],a=e.getContext();for(const o of t){const c=o.id,l=Cb(i[c],r);l!==null&&s.push({plugin:o,options:Ob(e.config,{plugin:o,local:n[c]},l,a)})}return s}function Ob(e,{plugin:t,local:n},i,r){const s=e.pluginScopeKeys(t),a=e.getOptionScopes(i,s);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function _o(e,t){const n=Rt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function Pb(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function Rb(e,t){return e===t?"_index_":"_value_"}function od(e){if(e==="x"||e==="y"||e==="r")return e}function Ab(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function xo(e,...t){if(od(e))return e;for(const n of t){const i=n.axis||Ab(n.position)||e.length>1&&od(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function ld(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function Ib(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return ld(e,"x",n[0])||ld(e,"y",n[0])}return{}}function Lb(e,t){const n=jn[e.type]||{scales:{}},i=t.scales||{},r=_o(e.type,t),s=Object.create(null);return Object.keys(i).forEach(a=>{const o=i[a];if(!ft(o))return console.error(`Invalid scale configuration for scale: ${a}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=xo(a,o,Ib(a,e),Rt.scales[o.type]),l=Rb(c,r),u=n.scales||{};s[a]=er(Object.create(null),[{axis:c},o,u[c],u[l]])}),e.data.datasets.forEach(a=>{const o=a.type||e.type,c=a.indexAxis||_o(o,t),u=(jn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Pb(h,c),m=a[f+"AxisID"]||f;s[m]=s[m]||Object.create(null),er(s[m],[{axis:f},i[m],u[h]])})}),Object.keys(s).forEach(a=>{const o=s[a];er(o,[Rt.scales[o.type],Rt.scale])}),s}function cd(e){const t=e.options||(e.options={});t.plugins=at(t.plugins,{}),t.scales=Lb(e,t)}function ud(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Nb(e){return e=e||{},e.data=ud(e.data),cd(e),e}const dd=new Map,hd=new Set;function Is(e,t){let n=dd.get(e);return n||(n=t(),dd.set(e,n),hd.add(n)),n}const xr=(e,t,n)=>{const i=kn(t,n);i!==void 0&&e.add(i)};class Fb{constructor(t){this._config=Nb(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=ud(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(),cd(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Is(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Is(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Is(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Is(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let r=i.get(t);return(!r||n)&&(r=new Map,i.set(t,r)),r}getOptionScopes(t,n,i){const{options:r,type:s}=this,a=this._cachedScopes(t,i),o=a.get(n);if(o)return o;const c=new Set;n.forEach(u=>{t&&(c.add(t),u.forEach(h=>xr(c,t,h))),u.forEach(h=>xr(c,r,h)),u.forEach(h=>xr(c,jn[s]||{},h)),u.forEach(h=>xr(c,Rt,h)),u.forEach(h=>xr(c,Qa,h))});const l=Array.from(c);return l.length===0&&l.push(Object.create(null)),hd.has(n)&&a.set(n,l),l}chartOptionScopes(){const{options:t,type:n}=this;return[t,jn[n]||{},Rt.datasets[n]||{},{type:n},Rt,Qa]}resolveNamedOptions(t,n,i,r=[""]){const s={$shared:!0},{resolver:a,subPrefixes:o}=fd(this._resolverCache,t,r);let c=a;if(zb(a,n)){s.$shared=!1,i=be(i)?i():i;const l=this.createResolver(t,i,o);c=xi(a,i,l)}for(const l of n)s[l]=c[l];return s}createResolver(t,n,i=[""],r){const{resolver:s}=fd(this._resolverCache,t,i);return ft(n)?xi(s,n,void 0,r):s}}function fd(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const r=n.join();let s=i.get(r);return s||(s={resolver:no(t,n),subPrefixes:n.filter(o=>!o.toLowerCase().includes("hover"))},i.set(r,s)),s}const Bb=e=>ft(e)&&Object.getOwnPropertyNames(e).some(t=>be(e[t]));function zb(e,t){const{isScriptable:n,isIndexable:i}=gu(e);for(const r of t){const s=n(r),a=i(r),o=(a||s)&&e[r];if(s&&(be(o)||Bb(o))||a&&kt(o))return!0}return!1}var Hb="4.5.0";const Vb=["top","bottom","left","right","chartArea"];function md(e,t){return e==="top"||e==="bottom"||Vb.indexOf(e)===-1&&t==="x"}function gd(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function pd(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),Mt(n&&n.onComplete,[e],t)}function Wb(e){const t=e.chart,n=t.options.animation;Mt(n&&n.onProgress,[e],t)}function yd(e){return so()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Ls={},bd=e=>{const t=yd(e);return Object.values(Ls).filter(n=>n.canvas===t).pop()};function Yb(e,t,n){const i=Object.keys(e);for(const r of i){const s=+r;if(s>=t){const a=e[r];delete e[r],(n>0||s>t)&&(e[s+n]=a)}}}function $b(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let _e=(zn=class{static register(...t){$e.add(...t),_d()}static unregister(...t){$e.remove(...t),_d()}constructor(t,n){const i=this.config=new Fb(n),r=yd(t),s=bd(r);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||lb(r)),this.platform.updateConfig(i);const o=this.platform.acquireContext(r,a.aspectRatio),c=o&&o.canvas,l=c&&c.height,u=c&&c.width;if(this.id=Xg(),this.ctx=o,this.canvas=c,this.width=u,this.height=l,this._options=a,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 Tb,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=up(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Ls[this.id]=this,!o||!c){console.error("Failed to create chart: can't acquire context from the given item");return}sn.listen(this,"complete",pd),sn.listen(this,"progress",Wb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:r,_aspectRatio:s}=this;return st(t)?n&&s?s:r?i/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return $e}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Su(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return hu(this.canvas,this.ctx),this}stop(){return sn.stop(this),this}resize(t,n){sn.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,r=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,t,n,s),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Su(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),Mt(i.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Tt(n,(i,r)=>{i.id=r})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,r=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let s=[];n&&(s=s.concat(Object.keys(n).map(a=>{const o=n[a],c=xo(a,o),l=c==="r",u=c==="x";return{options:o,dposition:l?"chartArea":u?"bottom":"left",dtype:l?"radialLinear":u?"category":"linear"}}))),Tt(s,a=>{const o=a.options,c=o.id,l=xo(c,o),u=at(o.type,a.dtype);(o.position===void 0||md(o.position,l)!==md(a.dposition))&&(o.position=a.dposition),r[c]=!0;let h=null;if(c in i&&i[c].type===u)h=i[c];else{const f=$e.getScale(u);h=new f({id:c,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),Tt(r,(a,o)=>{a||delete i[o]}),Tt(i,a=>{oe.configure(this,a,a.options),oe.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((r,s)=>r.index-s.index),i>n){for(let r=n;r<i;++r)this._destroyDatasetMeta(r);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(gd("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,r)=>{n.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,r;for(this._removeUnreferencedMetasets(),i=0,r=n.length;i<r;i++){const s=n[i];let a=this.getDatasetMeta(i);const o=s.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=s.indexAxis||_o(o,this.options),a.order=s.order||0,a.index=i,a.label=""+s.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const c=$e.getController(o),{datasetElementType:l,dataElementType:u}=Rt.datasets[o];Object.assign(c,{dataElementType:$e.getElement(u),datasetElementType:l&&$e.getElement(l)}),a.controller=new c(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Tt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let l=0,u=this.data.datasets.length;l<u;l++){const{controller:h}=this.getDatasetMeta(l),f=!r&&s.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),r||Tt(s,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(gd("z","_idx"));const{_active:o,_lastEvent:c}=this;c?this._eventHandler(c,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){Tt(this.scales,t=>{oe.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Kc(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:r,count:s}of n){const a=i==="_removeElements"?-s:s;Yb(t,r,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=s=>new Set(t.filter(a=>a[0]===s).map((a,o)=>o+","+a.splice(1).join(","))),r=i(0);for(let s=1;s<n;s++)if(!Kc(r,i(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;oe.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],Tt(this.boxes,r=>{i&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,be(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),r={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(i.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(sn.has(this)?this.attached&&!sn.running(this)&&sn.start(this):(this.draw(),pd({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let r,s;for(r=0,s=n.length;r<s;++r){const a=n[r];(!t||a.visible)&&i.push(a)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},r=Au(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(r&&or(n,r),t.controller.draw(),r&&lr(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return rn(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,r){const s=yo.modes[n];return typeof s=="function"?s(this,t,i,r):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let r=i.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(r)),r}getContext(){return this.$context||(this.$context=Cn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const r=i?"show":"hide",s=this.getDatasetMeta(t),a=s.controller._resolveAnimations(void 0,r);ye(n)?(s.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(s,{visible:i}),this.update(o=>o.datasetIndex===t?r:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),sn.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),hu(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Ls[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,n=this.platform,i=(s,a)=>{n.addEventListener(this,s,a),t[s]=a},r=(s,a,o)=>{s.offsetX=a,s.offsetY=o,this._eventHandler(s)};Tt(this.options.events,s=>i(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(c,l)=>{n.addEventListener(this,c,l),t[c]=l},r=(c,l)=>{t[c]&&(n.removeEventListener(this,c,l),delete t[c])},s=(c,l)=>{this.canvas&&this.resize(c,l)};let a;const o=()=>{r("attach",o),this.attached=!0,this.resize(),i("resize",s),i("detach",a)};a=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),i("attach",o)},n.isAttached(this.canvas)?o():a()}unbindEvents(){Tt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Tt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const r=i?"set":"remove";let s,a,o,c;for(n==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),o=0,c=t.length;o<c;++o){a=t[o];const l=a&&this.getDatasetMeta(a.datasetIndex).controller;l&&l[r+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],i=t.map(({datasetIndex:s,index:a})=>{const o=this.getDatasetMeta(s);if(!o)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:o.data[a],index:a}});!hs(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const r=this.options.hover,s=(c,l)=>c.filter(u=>!l.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=s(n,t),o=i?t:s(t,n);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},r=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,r)===!1)return;const s=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,r),(s||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:r=[],options:s}=this,a=n,o=this._getActiveElements(t,r,i,a),c=tp(t),l=$b(t,this._lastEvent,i,c);i&&(this._lastEvent=null,Mt(s.onHover,[t,o,this],this),c&&Mt(s.onClick,[t,o,this],this));const u=!hs(o,r);return(u||n)&&(this._active=o,this._updateHoverStyles(o,r,n)),this._lastEvent=l,u}_getActiveElements(t,n,i,r){if(t.type==="mouseout")return[];if(!i)return n;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}},R(zn,"defaults",Rt),R(zn,"instances",Ls),R(zn,"overrides",jn),R(zn,"registry",$e),R(zn,"version",Hb),R(zn,"getChart",bd),zn);function _d(){return Tt(_e.instances,e=>e._plugins.invalidate())}function jb(e,t,n){const{startAngle:i,x:r,y:s,outerRadius:a,innerRadius:o,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,h=Math.min(l/a,se(i-n));if(e.beginPath(),e.arc(r,s,a-l/2,i+h/2,n-h/2),o>0){const f=Math.min(l/o,se(i-n));e.arc(r,s,o+l/2,n-f/2,i+f/2,!0)}else{const f=Math.min(l/2,a*se(i-n));if(u==="round")e.arc(r,s,f,n-dt/2,i+dt/2,!0);else if(u==="bevel"){const m=2*f*f,g=-m*Math.cos(n+dt/2)+r,p=-m*Math.sin(n+dt/2)+s,x=m*Math.cos(i+dt/2)+r,S=m*Math.sin(i+dt/2)+s;e.lineTo(g,p),e.lineTo(x,S)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Ub(e,t,n){const{startAngle:i,pixelMargin:r,x:s,y:a,outerRadius:o,innerRadius:c}=t;let l=r/o;e.beginPath(),e.arc(s,a,o,i-l,n+l),c>r?(l=r/c,e.arc(s,a,c,n+l,i-l,!0)):e.arc(s,a,r,n+Pt,i-Pt),e.closePath(),e.clip()}function qb(e){return eo(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Xb(e,t,n,i){const r=qb(e.options.borderRadius),s=(n-t)/2,a=Math.min(s,i*t/2),o=c=>{const l=(n-Math.min(s,c))*i/2;return Qt(c,0,Math.min(s,l))};return{outerStart:o(r.outerStart),outerEnd:o(r.outerEnd),innerStart:Qt(r.innerStart,0,a),innerEnd:Qt(r.innerEnd,0,a)}}function Si(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Ns(e,t,n,i,r,s){const{x:a,y:o,startAngle:c,pixelMargin:l,innerRadius:u}=t,h=Math.max(t.outerRadius+i+n-l,0),f=u>0?u+i+n+l:0;let m=0;const g=r-c;if(i){const q=u>0?u-i:0,G=h>0?h-i:0,V=(q+G)/2,lt=V!==0?g*V/(V+i):g;m=(g-lt)/2}const p=Math.max(.001,g*h-n/dt)/h,x=(g-p)/2,S=c+x+m,v=r-x-m,{outerStart:k,outerEnd:D,innerStart:M,innerEnd:P}=Xb(t,f,h,v-S),E=h-k,y=h-D,_=S+k/E,T=v-D/y,O=f+M,A=f+P,I=S+M/O,B=v-P/A;if(e.beginPath(),s){const q=(_+T)/2;if(e.arc(a,o,h,_,q),e.arc(a,o,h,q,T),D>0){const X=Si(y,T,a,o);e.arc(X.x,X.y,D,T,v+Pt)}const G=Si(A,v,a,o);if(e.lineTo(G.x,G.y),P>0){const X=Si(A,B,a,o);e.arc(X.x,X.y,P,v+Pt,B+Math.PI)}const V=(v-P/f+(S+M/f))/2;if(e.arc(a,o,f,v-P/f,V,!0),e.arc(a,o,f,V,S+M/f,!0),M>0){const X=Si(O,I,a,o);e.arc(X.x,X.y,M,I+Math.PI,S-Pt)}const lt=Si(E,S,a,o);if(e.lineTo(lt.x,lt.y),k>0){const X=Si(E,_,a,o);e.arc(X.x,X.y,k,S-Pt,_)}}else{e.moveTo(a,o);const q=Math.cos(_)*h+a,G=Math.sin(_)*h+o;e.lineTo(q,G);const V=Math.cos(T)*h+a,lt=Math.sin(T)*h+o;e.lineTo(V,lt)}e.closePath()}function Gb(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:o}=t;let c=t.endAngle;if(s){Ns(e,t,n,i,c,r);for(let l=0;l<s;++l)e.fill();isNaN(o)||(c=a+(o%Ot||Ot))}return Ns(e,t,n,i,c,r),e.fill(),c}function Kb(e,t,n,i,r){const{fullCircles:s,startAngle:a,circumference:o,options:c}=t,{borderWidth:l,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=c,g=c.borderAlign==="inner";if(!l)return;e.setLineDash(h||[]),e.lineDashOffset=f,g?(e.lineWidth=l*2,e.lineJoin=u||"round"):(e.lineWidth=l,e.lineJoin=u||"bevel");let p=t.endAngle;if(s){Ns(e,t,n,i,p,r);for(let x=0;x<s;++x)e.stroke();isNaN(o)||(p=a+(o%Ot||Ot))}g&&Ub(e,t,p),c.selfJoin&&p-a>=dt&&m===0&&u!=="miter"&&jb(e,t,p),s||(Ns(e,t,n,i,p,r),e.stroke())}class wr extends Jt{constructor(n){super();R(this,"circumference");R(this,"endAngle");R(this,"fullCircles");R(this,"innerRadius");R(this,"outerRadius");R(this,"pixelMargin");R(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,n&&Object.assign(this,n)}inRange(n,i,r){const s=this.getProps(["x","y"],r),{angle:a,distance:o}=ys(s,{x:n,y:i}),{startAngle:c,endAngle:l,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,g=at(f,l-c),p=ir(a,c,l)&&c!==l,x=g>=Ot||p,S=en(o,u+m,h+m);return x&&S}getCenterPoint(n){const{x:i,y:r,startAngle:s,endAngle:a,innerRadius:o,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:l,spacing:u}=this.options,h=(s+a)/2,f=(o+c+u+l)/2;return{x:i+Math.cos(h)*f,y:r+Math.sin(h)*f}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:i,circumference:r}=this,s=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=r>Ot?Math.floor(r/Ot):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const l=1-Math.sin(Math.min(dt,r||0)),u=s*l;n.fillStyle=i.backgroundColor,n.strokeStyle=i.borderColor,Gb(n,this,u,a,o),Kb(n,this,u,a,o),n.restore()}}R(wr,"id","arc"),R(wr,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),R(wr,"defaultRoutes",{backgroundColor:"backgroundColor"}),R(wr,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function xd(e,t,n=t){e.lineCap=at(n.borderCapStyle,t.borderCapStyle),e.setLineDash(at(n.borderDash,t.borderDash)),e.lineDashOffset=at(n.borderDashOffset,t.borderDashOffset),e.lineJoin=at(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=at(n.borderWidth,t.borderWidth),e.strokeStyle=at(n.borderColor,t.borderColor)}function Zb(e,t,n){e.lineTo(n.x,n.y)}function Qb(e){return e.stepped?vp:e.tension||e.cubicInterpolationMode==="monotone"?Sp:Zb}function wd(e,t,n={}){const i=e.length,{start:r=0,end:s=i-1}=n,{start:a,end:o}=t,c=Math.max(r,a),l=Math.min(s,o),u=r<a&&s<a||r>o&&s>o;return{count:i,start:c,loop:t.loop,ilen:l<c&&!u?i+l-c:l-c}}function Jb(e,t,n,i){const{points:r,options:s}=t,{count:a,start:o,loop:c,ilen:l}=wd(r,n,i),u=Qb(s);let{move:h=!0,reverse:f}=i||{},m,g,p;for(m=0;m<=l;++m)g=r[(o+(f?l-m:m))%a],!g.skip&&(h?(e.moveTo(g.x,g.y),h=!1):u(e,p,g,f,s.stepped),p=g);return c&&(g=r[(o+(f?l:0))%a],u(e,p,g,f,s.stepped)),!!c}function t0(e,t,n,i){const r=t.points,{count:s,start:a,ilen:o}=wd(r,n,i),{move:c=!0,reverse:l}=i||{};let u=0,h=0,f,m,g,p,x,S;const v=D=>(a+(l?o-D:D))%s,k=()=>{p!==x&&(e.lineTo(u,x),e.lineTo(u,p),e.lineTo(u,S))};for(c&&(m=r[v(0)],e.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=r[v(f)],m.skip)continue;const D=m.x,M=m.y,P=D|0;P===g?(M<p?p=M:M>x&&(x=M),u=(h*u+D)/++h):(k(),e.lineTo(D,M),g=P,h=0,p=x=M),S=M}k()}function wo(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?t0:Jb}function e0(e){return e.stepped?ey:e.tension||e.cubicInterpolationMode==="monotone"?ny:Gn}function n0(e,t,n,i){let r=t._path;r||(r=t._path=new Path2D,t.path(r,n,i)&&r.closePath()),xd(e,t.options),e.stroke(r)}function i0(e,t,n,i){const{segments:r,options:s}=t,a=wo(t);for(const o of r)xd(e,s,o.style),e.beginPath(),a(e,t,o,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const r0=typeof Path2D=="function";function s0(e,t,n,i){r0&&!t.options.segment?n0(e,t,n,i):i0(e,t,n,i)}class On 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,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const r=i.spanGaps?this._loop:this._fullLoop;qp(this._points,i,t,r,n),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=ly(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,r=t[n],s=this.points,a=Ou(this,{property:n,start:r,end:r});if(!a.length)return;const o=[],c=e0(i);let l,u;for(l=0,u=a.length;l<u;++l){const{start:h,end:f}=a[l],m=s[h],g=s[f];if(m===g){o.push(m);continue}const p=Math.abs((r-m[n])/(g[n]-m[n])),x=c(m,g,p,i.stepped);x[n]=t[n],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,n,i){return wo(this)(t,this,n,i)}path(t,n,i){const r=this.segments,s=wo(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const o of r)a&=s(t,this,o,{start:n,end:n+i-1});return!!a}draw(t,n,i,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),s0(t,this,i,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}R(On,"id","line"),R(On,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),R(On,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),R(On,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function vd(e,t,n,i){const r=e.options,{[n]:s}=e.getProps([n],i);return Math.abs(t-s)<r.radius+r.hitRadius}class Fs extends Jt{constructor(n){super();R(this,"parsed");R(this,"skip");R(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,i,r){const s=this.options,{x:a,y:o}=this.getProps(["x","y"],r);return Math.pow(n-a,2)+Math.pow(i-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,i){return vd(this,n,"x",i)}inYRange(n,i){return vd(this,n,"y",i)}getCenterPoint(n){const{x:i,y:r}=this.getProps(["x","y"],n);return{x:i,y:r}}size(n){n=n||this.options||{};let i=n.radius||0;i=Math.max(i,i&&n.hoverRadius||0);const r=i&&n.borderWidth||0;return(i+r)*2}draw(n,i){const r=this.options;this.skip||r.radius<.1||!rn(this,i,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,to(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}R(Fs,"id","point"),R(Fs,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),R(Fs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Sd(e,t){const{x:n,y:i,base:r,width:s,height:a}=e.getProps(["x","y","base","width","height"],t);let o,c,l,u,h;return e.horizontal?(h=a/2,o=Math.min(n,r),c=Math.max(n,r),l=i-h,u=i+h):(h=s/2,o=n-h,c=n+h,l=Math.min(i,r),u=Math.max(i,r)),{left:o,top:l,right:c,bottom:u}}function Pn(e,t,n,i){return e?0:Qt(t,n,i)}function a0(e,t,n){const i=e.options.borderWidth,r=e.borderSkipped,s=mu(i);return{t:Pn(r.top,s.top,0,n),r:Pn(r.right,s.right,0,t),b:Pn(r.bottom,s.bottom,0,n),l:Pn(r.left,s.left,0,t)}}function o0(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=Dn(r),a=Math.min(t,n),o=e.borderSkipped,c=i||ft(r);return{topLeft:Pn(!c||o.top||o.left,s.topLeft,0,a),topRight:Pn(!c||o.top||o.right,s.topRight,0,a),bottomLeft:Pn(!c||o.bottom||o.left,s.bottomLeft,0,a),bottomRight:Pn(!c||o.bottom||o.right,s.bottomRight,0,a)}}function l0(e){const t=Sd(e),n=t.right-t.left,i=t.bottom-t.top,r=a0(e,n/2,i/2),s=o0(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:n-r.l-r.r,h:i-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function vo(e,t,n,i){const r=t===null,s=n===null,o=e&&!(r&&s)&&Sd(e,i);return o&&(r||en(t,o.left,o.right))&&(s||en(n,o.top,o.bottom))}function c0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function u0(e,t){e.rect(t.x,t.y,t.w,t.h)}function So(e,t,n={}){const i=e.x!==n.x?-t:0,r=e.y!==n.y?-t:0,s=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-r;return{x:e.x+i,y:e.y+r,w:e.w+s,h:e.h+a,radius:e.radius}}class Bs 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:n,options:{borderColor:i,backgroundColor:r}}=this,{inner:s,outer:a}=l0(this),o=c0(a.radius)?_i:u0;t.save(),(a.w!==s.w||a.h!==s.h)&&(t.beginPath(),o(t,So(a,n,s)),t.clip(),o(t,So(s,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,So(s,n)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,n,i){return vo(this,t,n,i)}inXRange(t,n){return vo(this,t,null,n)}inYRange(t,n){return vo(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(n+r)/2:n,y:s?i:(i+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}R(Bs,"id","bar"),R(Bs,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),R(Bs,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var d0=Object.freeze({__proto__:null,ArcElement:wr,BarElement:Bs,LineElement:On,PointElement:Fs});const ko=["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)"],kd=ko.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Md(e){return ko[e%ko.length]}function Td(e){return kd[e%kd.length]}function h0(e,t){return e.borderColor=Md(t),e.backgroundColor=Td(t),++t}function f0(e,t){return e.backgroundColor=e.data.map(()=>Md(t++)),t}function m0(e,t){return e.backgroundColor=e.data.map(()=>Td(t++)),t}function g0(e){let t=0;return(n,i)=>{const r=e.getDatasetMeta(i).controller;r instanceof an?t=f0(n,t):r instanceof fr?t=m0(n,t):r&&(t=h0(n,t))}}function Dd(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function p0(e){return e&&(e.borderColor||e.backgroundColor)}function y0(){return Rt.borderColor!=="rgba(0,0,0,0.1)"||Rt.backgroundColor!=="rgba(0,0,0,0.1)"}var b0={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:r}=e.config,{elements:s}=r,a=Dd(i)||p0(r)||s&&Dd(s)||y0();if(!n.forceOverride&&a)return;const o=g0(e);i.forEach(o)}};function _0(e,t,n,i,r){const s=r.samples||i;if(s>=n)return e.slice(t,t+n);const a=[],o=(n-2)/(s-2);let c=0;const l=t+n-1;let u=t,h,f,m,g,p;for(a[c++]=e[u],h=0;h<s-2;h++){let x=0,S=0,v;const k=Math.floor((h+1)*o)+1+t,D=Math.min(Math.floor((h+2)*o)+1,n)+t,M=D-k;for(v=k;v<D;v++)x+=e[v].x,S+=e[v].y;x/=M,S/=M;const P=Math.floor(h*o)+1+t,E=Math.min(Math.floor((h+1)*o)+1,n)+t,{x:y,y:_}=e[u];for(m=g=-1,v=P;v<E;v++)g=.5*Math.abs((y-x)*(e[v].y-_)-(y-e[v].x)*(S-_)),g>m&&(m=g,f=e[v],p=v);a[c++]=f,u=p}return a[c++]=e[l],a}function x0(e,t,n,i){let r=0,s=0,a,o,c,l,u,h,f,m,g,p;const x=[],S=t+n-1,v=e[t].x,D=e[S].x-v;for(a=t;a<t+n;++a){o=e[a],c=(o.x-v)/D*i,l=o.y;const M=c|0;if(M===u)l<g?(g=l,h=a):l>p&&(p=l,f=a),r=(s*r+o.x)/++s;else{const P=a-1;if(!st(h)&&!st(f)){const E=Math.min(h,f),y=Math.max(h,f);E!==m&&E!==P&&x.push({...e[E],x:r}),y!==m&&y!==P&&x.push({...e[y],x:r})}a>0&&P!==m&&x.push(e[P]),x.push(o),u=M,s=0,g=p=l,h=f=m=a}}return x}function Cd(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ed(e){e.data.datasets.forEach(t=>{Cd(t)})}function w0(e,t){const n=t.length;let i=0,r;const{iScale:s}=e,{min:a,max:o,minDefined:c,maxDefined:l}=s.getUserBounds();return c&&(i=Qt(nn(t,s.axis,a).lo,0,n-1)),l?r=Qt(nn(t,s.axis,o).hi+1,i,n)-i:r=n-i,{start:i,count:r}}var v0={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Ed(e);return}const i=e.width;e.data.datasets.forEach((r,s)=>{const{_data:a,indexAxis:o}=r,c=e.getDatasetMeta(s),l=a||r.data;if(cr([o,e.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=e.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||e.options.parsing)return;let{start:h,count:f}=w0(c,l);const m=n.threshold||4*i;if(f<=m){Cd(r);return}st(a)&&(r._data=l,delete r.data,Object.defineProperty(r,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(n.algorithm){case"lttb":g=_0(l,h,f,i,n);break;case"min-max":g=x0(l,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}r._decimated=g})},destroy(e){Ed(e)}};function S0(e,t,n){const i=e.segments,r=e.points,s=t.points,a=[];for(const o of i){let{start:c,end:l}=o;l=zs(c,l,r);const u=Mo(n,r[c],r[l],o.loop);if(!t.segments){a.push({source:o,target:u,start:r[c],end:r[l]});continue}const h=Ou(t,u);for(const f of h){const m=Mo(n,s[f.start],s[f.end],f.loop),g=Eu(o,r,m);for(const p of g)a.push({source:p,target:f,start:{[n]:Od(u,m,"start",Math.max)},end:{[n]:Od(u,m,"end",Math.min)}})}}return a}function Mo(e,t,n,i){if(i)return;let r=t[e],s=n[e];return e==="angle"&&(r=se(r),s=se(s)),{property:e,start:r,end:s}}function k0(e,t){const{x:n=null,y:i=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:a,end:o})=>{o=zs(a,o,r);const c=r[a],l=r[o];i!==null?(s.push({x:c.x,y:i}),s.push({x:l.x,y:i})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:l.y}))}),s}function zs(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Od(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Pd(e,t){let n=[],i=!1;return kt(e)?(i=!0,n=e):n=k0(e,t),n.length?new On({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Rd(e){return e&&e.fill!==!1}function M0(e,t,n){let r=e[t].fill;const s=[t];let a;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!At(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;s.push(r),r=a.fill}return!1}function T0(e,t,n){const i=O0(e);if(ft(i))return isNaN(i.value)?!1:i;let r=parseFloat(i);return At(r)&&Math.floor(r)===r?D0(i[0],t,r,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function D0(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function C0(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:ft(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function E0(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:ft(e)?i=e.value:i=t.getBaseValue(),i}function O0(e){const t=e.options,n=t.fill;let i=at(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function P0(e){const{scale:t,index:n,line:i}=e,r=[],s=i.segments,a=i.points,o=R0(t,n);o.push(Pd({x:null,y:t.bottom},i));for(let c=0;c<s.length;c++){const l=s[c];for(let u=l.start;u<=l.end;u++)A0(r,a[u],o)}return new On({points:r,options:{}})}function R0(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let r=0;r<i.length;r++){const s=i[r];if(s.index===t)break;s.hidden||n.unshift(s.dataset)}return n}function A0(e,t,n){const i=[];for(let r=0;r<n.length;r++){const s=n[r],{first:a,last:o,point:c}=I0(s,t,"x");if(!(!c||a&&o)){if(a)i.unshift(c);else if(e.push(c),!o)break}}e.push(...i)}function I0(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const r=i[n],s=e.segments,a=e.points;let o=!1,c=!1;for(let l=0;l<s.length;l++){const u=s[l],h=a[u.start][n],f=a[u.end][n];if(en(r,h,f)){o=r===h,c=r===f;break}}return{first:o,last:c,point:i}}class Ad{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:r,y:s,radius:a}=this;return n=n||{start:0,end:Ot},t.arc(r,s,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:r}=this,s=t.angle;return{x:n+Math.cos(s)*r,y:i+Math.sin(s)*r,angle:s}}}function L0(e){const{chart:t,fill:n,line:i}=e;if(At(n))return N0(t,n);if(n==="stack")return P0(e);if(n==="shape")return!0;const r=F0(e);return r instanceof Ad?r:Pd(r,i)}function N0(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function F0(e){return(e.scale||{}).getPointPositionForValue?z0(e):B0(e)}function B0(e){const{scale:t={},fill:n}=e,i=C0(n,t);if(At(i)){const r=t.isHorizontal();return{x:r?i:null,y:r?null:i}}return null}function z0(e){const{scale:t,fill:n}=e,i=t.options,r=t.getLabels().length,s=i.reverse?t.max:t.min,a=E0(n,t,s),o=[];if(i.grid.circular){const c=t.getPointPositionForValue(0,s);return new Ad({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<r;++c)o.push(t.getPointPositionForValue(c,a));return o}function To(e,t,n){const i=L0(t),{chart:r,index:s,line:a,scale:o,axis:c}=t,l=a.options,u=l.fill,h=l.backgroundColor,{above:f=h,below:m=h}=u||{},g=r.getDatasetMeta(s),p=Au(r,g);i&&a.points.length&&(or(e,n),H0(e,{line:a,target:i,above:f,below:m,area:n,scale:o,axis:c,clip:p}),lr(e))}function H0(e,t){const{line:n,target:i,above:r,below:s,area:a,scale:o,clip:c}=t,l=n._loop?"angle":t.axis;e.save();let u=s;s!==r&&(l==="x"?(Id(e,i,a.top),Do(e,{line:n,target:i,color:r,scale:o,property:l,clip:c}),e.restore(),e.save(),Id(e,i,a.bottom)):l==="y"&&(Ld(e,i,a.left),Do(e,{line:n,target:i,color:s,scale:o,property:l,clip:c}),e.restore(),e.save(),Ld(e,i,a.right),u=r)),Do(e,{line:n,target:i,color:u,scale:o,property:l,clip:c}),e.restore()}function Id(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const o of i){const{start:c,end:l}=o,u=r[c],h=r[zs(c,l,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,n),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,o,{move:a}),a?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Ld(e,t,n){const{segments:i,points:r}=t;let s=!0,a=!1;e.beginPath();for(const o of i){const{start:c,end:l}=o,u=r[c],h=r[zs(c,l,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(n,u.y),e.lineTo(u.x,u.y)),a=!!t.pathSegment(e,o,{move:a}),a?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Do(e,t){const{line:n,target:i,property:r,color:s,scale:a,clip:o}=t,c=S0(n,i,r);for(const{source:l,target:u,start:h,end:f}of c){const{style:{backgroundColor:m=s}={}}=l,g=i!==!0;e.save(),e.fillStyle=m,V0(e,a,o,g&&Mo(r,h,f)),e.beginPath();const p=!!n.pathSegment(e,l);let x;if(g){p?e.closePath():Nd(e,i,f,r);const S=!!i.pathSegment(e,u,{move:p,reverse:!0});x=p&&S,x||Nd(e,i,h,r)}e.closePath(),e.fill(x?"evenodd":"nonzero"),e.restore()}}function V0(e,t,n,i){const r=t.chart.chartArea,{property:s,start:a,end:o}=i||{};if(s==="x"||s==="y"){let c,l,u,h;s==="x"?(c=a,l=r.top,u=o,h=r.bottom):(c=r.left,l=a,u=r.right,h=o),e.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),l=Math.max(l,n.top),h=Math.min(h,n.bottom)),e.rect(c,l,u-c,h-l),e.clip()}}function Nd(e,t,n,i){const r=t.interpolate(n,i);r&&e.lineTo(r.x,r.y)}var W0={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,r=[];let s,a,o,c;for(a=0;a<i;++a)s=e.getDatasetMeta(a),o=s.dataset,c=null,o&&o.options&&o instanceof On&&(c={visible:e.isDatasetVisible(a),index:a,fill:T0(o,a,i),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:o}),s.$filler=c,r.push(c);for(a=0;a<i;++a)c=r[a],!(!c||c.fill===!1)&&(c.fill=M0(r,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let a=r.length-1;a>=0;--a){const o=r[a].$filler;o&&(o.line.updateControlPoints(s,o.axis),i&&o.fill&&To(e.ctx,o,s))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let r=i.length-1;r>=0;--r){const s=i[r].$filler;Rd(s)&&To(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Rd(i)||n.drawTime!=="beforeDatasetDraw"||To(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Fd=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},Y0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Bd 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,n,i){this.maxWidth=t,this.maxHeight=n,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 n=Mt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,r)=>t.sort(i,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,r=It(i.font),s=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:c}=Fd(i,s);let l,u;n.font=r.string,this.isHorizontal()?(l=this.maxWidth,u=this._fitRows(a,s,o,c)+10):(u=this.maxHeight,l=this._fitCols(a,r,o,c)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,r){const{ctx:s,maxWidth:a,options:{labels:{padding:o}}}=this,c=this.legendHitBoxes=[],l=this.lineWidths=[0],u=r+o;let h=t;s.textAlign="left",s.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((g,p)=>{const x=i+n/2+s.measureText(g.text).width;(p===0||l[l.length-1]+x+2*o>a)&&(h+=u,l[l.length-(p>0?0:1)]=0,m+=u,f++),c[p]={left:0,top:m,row:f,width:x,height:r},l[l.length-1]+=x+o}),h}_fitCols(t,n,i,r){const{ctx:s,maxHeight:a,options:{labels:{padding:o}}}=this,c=this.legendHitBoxes=[],l=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,g=0,p=0;return this.legendItems.forEach((x,S)=>{const{itemWidth:v,itemHeight:k}=$0(i,n,s,x,r);S>0&&m+k+2*o>u&&(h+=f+o,l.push({width:f,height:m}),g+=f+o,p++,f=m=0),c[S]={left:g,top:m,col:p,width:v,height:k},f=Math.max(f,v),m+=k+o}),h+=f,l.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:r},rtl:s}}=this,a=vi(s,this.left,this.width);if(this.isHorizontal()){let o=0,c=ae(i,this.left+r,this.right-this.lineWidths[o]);for(const l of n)o!==l.row&&(o=l.row,c=ae(i,this.left+r,this.right-this.lineWidths[o])),l.top+=this.top+t+r,l.left=a.leftForLtr(a.x(c),l.width),c+=l.width+r}else{let o=0,c=ae(i,this.top+t+r,this.bottom-this.columnSizes[o].height);for(const l of n)l.col!==o&&(o=l.col,c=ae(i,this.top+t+r,this.bottom-this.columnSizes[o].height)),l.top=c,l.left+=this.left+r,l.left=a.leftForLtr(a.x(l.left),l.width),c+=l.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;or(t,this),this._draw(),lr(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:r}=this,{align:s,labels:a}=t,o=Rt.color,c=vi(t.rtl,this.left,this.width),l=It(a.font),{padding:u}=a,h=l.size,f=h/2;let m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=l.string;const{boxWidth:g,boxHeight:p,itemHeight:x}=Fd(a,h),S=function(P,E,y){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;r.save();const _=at(y.lineWidth,1);if(r.fillStyle=at(y.fillStyle,o),r.lineCap=at(y.lineCap,"butt"),r.lineDashOffset=at(y.lineDashOffset,0),r.lineJoin=at(y.lineJoin,"miter"),r.lineWidth=_,r.strokeStyle=at(y.strokeStyle,o),r.setLineDash(at(y.lineDash,[])),a.usePointStyle){const T={radius:p*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:_},O=c.xPlus(P,g/2),A=E+f;fu(r,T,O,A,a.pointStyleWidth&&g)}else{const T=E+Math.max((h-p)/2,0),O=c.leftForLtr(P,g),A=Dn(y.borderRadius);r.beginPath(),Object.values(A).some(I=>I!==0)?_i(r,{x:O,y:T,w:g,h:p,radius:A}):r.rect(O,T,g,p),r.fill(),_!==0&&r.stroke()}r.restore()},v=function(P,E,y){qn(r,y.text,P,E+x/2,l,{strikethrough:y.hidden,textAlign:c.textAlign(y.textAlign)})},k=this.isHorizontal(),D=this._computeTitleHeight();k?m={x:ae(s,this.left+u,this.right-i[0]),y:this.top+u+D,line:0}:m={x:this.left+u,y:ae(s,this.top+D+u,this.bottom-n[0].height),line:0},Mu(this.ctx,t.textDirection);const M=x+u;this.legendItems.forEach((P,E)=>{r.strokeStyle=P.fontColor,r.fillStyle=P.fontColor;const y=r.measureText(P.text).width,_=c.textAlign(P.textAlign||(P.textAlign=a.textAlign)),T=g+f+y;let O=m.x,A=m.y;c.setWidth(this.width),k?E>0&&O+T+u>this.right&&(A=m.y+=M,m.line++,O=m.x=ae(s,this.left+u,this.right-i[m.line])):E>0&&A+M>this.bottom&&(O=m.x=O+n[m.line].width+u,m.line++,A=m.y=ae(s,this.top+D+u,this.bottom-n[m.line].height));const I=c.x(O);if(S(I,A,P),O=dp(_,O+g+f,k?O+T:this.right,t.rtl),v(c.x(O),A,P),k)m.x+=T+u;else if(typeof P.text!="string"){const B=l.lineHeight;m.y+=zd(P,B)+u}else m.y+=M}),Tu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=It(n.font),r=Ut(n.padding);if(!n.display)return;const s=vi(t.rtl,this.left,this.width),a=this.ctx,o=n.position,c=i.size/2,l=r.top+c;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+l,h=ae(t.align,h,this.right-f);else{const g=this.columnSizes.reduce((p,x)=>Math.max(p,x.height),0);u=l+ae(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=ae(o,h,h+f);a.textAlign=s.textAlign(Ga(o)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,qn(a,n.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,n=It(t.font),i=Ut(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,r,s;if(en(t,this.left,this.right)&&en(n,this.top,this.bottom)){for(s=this.legendHitBoxes,i=0;i<s.length;++i)if(r=s[i],en(t,r.left,r.left+r.width)&&en(n,r.top,r.top+r.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!q0(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=Y0(r,i);r&&!s&&Mt(n.onLeave,[t,r,this],this),this._hoveredItem=i,i&&!s&&Mt(n.onHover,[t,i,this],this)}else i&&Mt(n.onClick,[t,i,this],this)}}function $0(e,t,n,i,r){const s=j0(i,e,t,n),a=U0(r,i,t.lineHeight);return{itemWidth:s,itemHeight:a}}function j0(e,t,n,i){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,a)=>s.length>a.length?s:a)),t+n.size/2+i.measureText(r).width}function U0(e,t,n){let i=e;return typeof t.text!="string"&&(i=zd(t,n)),i}function zd(e,t){const n=e.text?e.text.length:0;return t*n}function q0(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var X0={id:"legend",_element:Bd,start(e,t,n){const i=e.legend=new Bd({ctx:e.ctx,options:n,chart:e});oe.configure(e,i,n),oe.addBox(e,i)},stop(e){oe.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;oe.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,r=n.chart;r.isDatasetVisible(i)?(r.hide(i),t.hidden=!0):(r.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:r,color:s,useBorderRadius:a,borderRadius:o}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const l=c.controller.getStyle(n?0:void 0),u=Ut(l.borderWidth);return{text:t[c.index].label,fillStyle:l.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:l.borderColor,pointStyle:i||l.pointStyle,rotation:l.rotation,textAlign:r||l.textAlign,borderRadius:a&&(o||l.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Co 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,n){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=n;const r=kt(i.text)?i.text.length:1;this._padding=Ut(i.padding);const s=r*It(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:r,right:s,options:a}=this,o=a.align;let c=0,l,u,h;return this.isHorizontal()?(u=ae(o,i,s),h=n+t,l=s-i):(a.position==="left"?(u=i+t,h=ae(o,r,n),c=dt*-.5):(u=s-t,h=ae(o,n,r),c=dt*.5),l=r-n),{titleX:u,titleY:h,maxWidth:l,rotation:c}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=It(n.font),s=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:c,rotation:l}=this._drawArgs(s);qn(t,n.text,0,0,i,{color:n.color,maxWidth:c,rotation:l,textAlign:Ga(n.align),textBaseline:"middle",translation:[a,o]})}}function G0(e,t){const n=new Co({ctx:e.ctx,options:t,chart:e});oe.configure(e,n,t),oe.addBox(e,n),e.titleBlock=n}var K0={id:"title",_element:Co,start(e,t,n){G0(e,n)},stop(e){const t=e.titleBlock;oe.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;oe.configure(e,i,n),i.options=n},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 Hs=new WeakMap;var Z0={id:"subtitle",start(e,t,n){const i=new Co({ctx:e.ctx,options:n,chart:e});oe.configure(e,i,n),oe.addBox(e,i),Hs.set(e,i)},stop(e){oe.removeBox(e,Hs.get(e)),Hs.delete(e)},beforeUpdate(e,t,n){const i=Hs.get(e);oe.configure(e,i,n),i.options=n},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 vr={average(e){if(!e.length)return!1;let t,n,i=new Set,r=0,s=0;for(t=0,n=e.length;t<n;++t){const o=e[t].element;if(o&&o.hasValue()){const c=o.tooltipPosition();i.add(c.x),r+=c.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((o,c)=>o+c)/i.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,r=Number.POSITIVE_INFINITY,s,a,o;for(s=0,a=e.length;s<a;++s){const c=e[s].element;if(c&&c.hasValue()){const l=c.getCenterPoint(),u=bi(t,l);u<r&&(r=u,o=c)}}if(o){const c=o.tooltipPosition();n=c.x,i=c.y}return{x:n,y:i}}};function je(e,t){return t&&(kt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function on(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
17
17
|
`)>-1?e.split(`
|
|
18
|
-
`):e}function Q0(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:o}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:o,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Hd(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:o}=t,l=It(t.bodyFont),c=It(t.titleFont),u=It(t.footerFont),h=s.length,f=r.length,m=i.length,g=Ut(t.padding);let p=g.height,x=0,S=i.reduce((D,M)=>D+M.before.length+M.lines.length+M.after.length,0);if(S+=e.beforeBody.length+e.afterBody.length,h&&(p+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),S){const D=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;p+=m*D+(S-m)*l.lineHeight+(S-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const k=function(D){x=Math.max(x,n.measureText(D).width+v)};return n.save(),n.font=c.string,Tt(e.title,k),n.font=l.string,Tt(e.beforeBody.concat(e.afterBody),k),v=t.displayColors?a+2+t.boxPadding:0,Tt(i,D=>{Tt(D.before,k),Tt(D.lines,k),Tt(D.after,k)}),v=0,n.font=u.string,Tt(e.footer,k),n.restore(),x+=g.width,{width:x,height:p}}function J0(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function t_(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function e_(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:o,right:l}}=e;let c="center";return i==="center"?c=r<=(o+l)/2?"left":"right":r<=s/2?c="left":r>=a-s/2&&(c="right"),t_(c,e,t,n)&&(c="center"),c}function Vd(e,t,n){const i=n.yAlign||t.yAlign||J0(e,n);return{xAlign:n.xAlign||t.xAlign||e_(e,t,n,i),yAlign:i}}function n_(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function i_(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Wd(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:o,yAlign:l}=n,c=r+s,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=Dn(a);let g=n_(t,o);const p=i_(t,l,c);return l==="center"?o==="left"?g+=c:o==="right"&&(g-=c):o==="left"?g-=Math.max(u,f)+r:o==="right"&&(g+=Math.max(h,m)+r),{x:Qt(g,0,i.width-t.width),y:Qt(p,0,i.height-t.height)}}function Vs(e,t,n){const i=Ut(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Yd(e){return je([],on(e))}function r_(e,t,n){return Cn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function $d(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jd={beforeTitle:tn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.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 n[t.dataIndex]}return""},afterTitle:tn,beforeBody:tn,beforeLabel:tn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return st(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:tn,afterBody:tn,beforeFooter:tn,footer:tn,afterFooter:tn};function xe(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?jd[t].call(n,i):r}class Eo 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 n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new oo(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=r_(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=xe(i,"beforeTitle",this,t),s=xe(i,"title",this,t),a=xe(i,"afterTitle",this,t);let o=[];return o=je(o,on(r)),o=je(o,on(s)),o=je(o,on(a)),o}getBeforeBody(t,n){return Yd(xe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return Tt(t,s=>{const a={before:[],lines:[],after:[]},o=$d(i,s);je(a.before,on(xe(o,"beforeLabel",this,s))),je(a.lines,xe(o,"label",this,s)),je(a.after,on(xe(o,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return Yd(xe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=xe(i,"beforeFooter",this,t),s=xe(i,"footer",this,t),a=xe(i,"afterFooter",this,t);let o=[];return o=je(o,on(r)),o=je(o,on(s)),o=je(o,on(a)),o}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let o=[],l,c;for(l=0,c=n.length;l<c;++l)o.push(Q0(this.chart,n[l]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),Tt(o,u=>{const h=$d(t.callbacks,u);r.push(xe(h,"labelColor",this,u)),s.push(xe(h,"labelPointStyle",this,u)),a.push(xe(h,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=o,o}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const o=vr[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=Hd(this,i),c=Object.assign({},o,l),u=Vd(this.chart,i,c),h=Wd(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=Dn(o),{x:f,y:m}=t,{width:g,height:p}=n;let x,S,v,k,D,M;return s==="center"?(D=m+p/2,r==="left"?(x=f,S=x-a,k=D+a,M=D-a):(x=f+g,S=x+a,k=D-a,M=D+a),v=x):(r==="left"?S=f+Math.max(l,u)+a:r==="right"?S=f+g-Math.max(c,h)-a:S=this.caretX,s==="top"?(k=m,D=k-a,x=S-a,v=S+a):(k=m+p,D=k+a,x=S+a,v=S-a),M=k),{x1:x,x2:S,x3:v,y1:k,y2:D,y3:M}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,o,l;if(s){const c=vi(i.rtl,this.x,this.width);for(t.x=Vs(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",a=It(i.titleFont),o=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,l=0;l<s;++l)n.fillText(r[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===s&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,n,i,r,s){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=s,u=It(s.bodyFont),h=Vs(this,"left",s),f=r.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,g=n.y+m;if(s.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=r.leftForLtr(f,c)+c/2,S=g+l/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,to(t,p,x,S),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,to(t,p,x,S)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=r.leftForLtr(f,c),x=r.leftForLtr(r.xPlus(f,1),c-2),S=Dn(a.borderRadius);Object.values(S).some(v=>v!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,_i(t,{x:p,y:g,w:c,h:l,radius:S}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),_i(t,{x,y:g+1,w:c-2,h:l-2,radius:S}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=It(i.bodyFont);let f=h.lineHeight,m=0;const g=vi(i.rtl,this.x,this.width),p=function(y){n.fillText(y,g.x(t.x+m),t.y+f/2),t.y+=f+s},x=g.textAlign(a);let S,v,k,D,M,P,E;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,t.x=Vs(this,x,i),n.fillStyle=i.bodyColor,Tt(this.beforeBody,p),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,D=0,P=r.length;D<P;++D){for(S=r[D],v=this.labelTextColors[D],n.fillStyle=v,Tt(S.before,p),k=S.lines,o&&k.length&&(this._drawColorBox(n,t,D,g,i),f=Math.max(h.lineHeight,l)),M=0,E=k.length;M<E;++M)p(k[M]),f=h.lineHeight;Tt(S.after,p)}m=0,f=h.lineHeight,Tt(this.afterBody,p),t.y-=s}drawFooter(t,n,i){const r=this.footer,s=r.length;let a,o;if(s){const l=vi(i.rtl,this.x,this.width);for(t.x=Vs(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",a=It(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,o=0;o<s;++o)n.fillText(r[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,r){const{xAlign:s,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=Dn(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(o+h,l),a==="top"&&this.drawCaret(t,n,i,r),n.lineTo(o+c-f,l),n.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&s==="right"&&this.drawCaret(t,n,i,r),n.lineTo(o+c,l+u-g),n.quadraticCurveTo(o+c,l+u,o+c-g,l+u),a==="bottom"&&this.drawCaret(t,n,i,r),n.lineTo(o+m,l+u),n.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&s==="left"&&this.drawCaret(t,n,i,r),n.lineTo(o,l+h),n.quadraticCurveTo(o,l,o+h,l),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=vr[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Hd(this,t),l=Object.assign({},a,this._size),c=Vd(n,t,l),u=Wd(t,l,c,n);(r._to!==u.x||s._to!==u.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ut(n.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),Mu(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Tu(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:o,index:l})=>{const c=this.chart.getDatasetMeta(o);if(!c)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:c.data[l],index:l}}),s=!hs(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),o=this._positionChanged(a,t),l=n||!hs(a,s)||o;return l&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,a=vr[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}R(Eo,"positioners",vr);var Ce={id:"tooltip",_element:Eo,positioners:vr,afterInit(e,t,n){n&&(e.tooltip=new Eo({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:jd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},s_=Object.freeze({__proto__:null,Colors:b0,Decimation:v0,Filler:W0,Legend:X0,SubTitle:Z0,Title:K0,Tooltip:Ce});const a_=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function o_(e,t,n,i){const r=e.indexOf(t);if(r===-1)return a_(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const l_=(e,t)=>e===null?null:Qt(Math.round(e),0,t);function Ud(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Oo extends Zn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(st(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:o_(i,t,at(n,t),this._addedLabels),l_(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return Ud.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(Oo,"id","category"),R(Oo,"defaults",{ticks:{callback:Ud}});function c_(e,t){const n=[],{bounds:r,step:s,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=e,m=s||1,g=u-1,{min:p,max:x}=t,S=!st(a),v=!st(o),k=!st(c),D=(x-p)/(h+1);let M=Zc((x-p)/g/m)*m,P,E,y,_;if(M<1e-14&&!S&&!v)return[{value:p},{value:x}];_=Math.ceil(x/M)-Math.floor(p/M),_>g&&(M=Zc(_*M/g/m)*m),st(l)||(P=Math.pow(10,l),M=Math.ceil(M*P)/P),r==="ticks"?(E=Math.floor(p/M)*M,y=Math.ceil(x/M)*M):(E=p,y=x),S&&v&&s&&rp((o-a)/s,M/1e3)?(_=Math.round(Math.min((o-a)/M,u)),M=(o-a)/_,E=a,y=o):k?(E=S?a:E,y=v?o:y,_=c-1,M=(y-E)/_):(_=(y-E)/M,nr(_,Math.round(_),M/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(Jc(M),Jc(E));P=Math.pow(10,st(l)?T:l),E=Math.round(E*P)/P,y=Math.round(y*P)/P;let O=0;for(S&&(f&&E!==a?(n.push({value:a}),E<a&&O++,nr(Math.round((E+O*M)*P)/P,a,qd(a,D,e))&&O++):E<a&&O++);O<_;++O){const A=Math.round((E+O*M)*P)/P;if(v&&A>o)break;n.push({value:A})}return v&&f&&y!==o?n.length&&nr(n[n.length-1].value,o,qd(o,D,e))?n[n.length-1].value=o:n.push({value:o}):(!v||y===o)&&n.push({value:y}),n}function qd(e,t,{horizontal:n,minRotation:i}){const r=jt(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class Ws extends Zn{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,n){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=l=>r=n?r:l,o=l=>s=i?s:l;if(t){const l=Ye(r),c=Ye(s);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(r===s){let l=s===0?1:Math.abs(s*.05);o(s+l),t||a(r-l)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,a=c_(r,s);return t.bounds==="ticks"&&Qc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return sr(t,this.chart.options.locale,this.options.ticks.format)}}class Po extends Ws{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=jt(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R(Po,"id","linear"),R(Po,"defaults",{ticks:{callback:_s.formatters.numeric}});const Sr=e=>Math.floor(Mn(e)),Qn=(e,t)=>Math.pow(10,Sr(e)+t);function Xd(e){return e/Math.pow(10,Sr(e))===1}function Gd(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function u_(e,t){const n=t-e;let i=Sr(n);for(;Gd(e,t,i)>10;)i++;for(;Gd(e,t,i)<10;)i--;return Math.min(i,Sr(e))}function d_(e,{min:t,max:n}){t=De(e.min,t);const i=[],r=Sr(t);let s=u_(t,n),a=s<0?Math.pow(10,Math.abs(s)):1;const o=Math.pow(10,s),l=r>s?Math.pow(10,r):0,c=Math.round((t-l)*a)/a,u=Math.floor((t-l)/o/10)*o*10;let h=Math.floor((c-u)/Math.pow(10,s)),f=De(e.min,Math.round((l+u+h*Math.pow(10,s))*a)/a);for(;f<n;)i.push({value:f,major:Xd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(s++,h=2,a=s>=0?1:a),f=Math.round((l+u+h*Math.pow(10,s))*a)/a;const m=De(e.max,f);return i.push({value:m,major:Xd(m),significand:h}),i}class Ro extends Zn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Ws.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Qn(this.min,0)?Qn(this.min,-1):Qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=o=>i=t?i:o,a=o=>r=n?r:o;i===r&&(i<=0?(s(1),a(10)):(s(Qn(i,-1)),a(Qn(r,1)))),i<=0&&s(Qn(r,-1)),r<=0&&a(Qn(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=d_(n,this);return t.bounds==="ticks"&&Qc(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":sr(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Mn(t),this._valueRange=Mn(this.max)-Mn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Mn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Ro,"id","logarithmic"),R(Ro,"defaults",{ticks:{callback:_s.formatters.logarithmic,major:{enabled:!0}}});function Ao(e){const t=e.ticks;if(t.display&&e.display){const n=Ut(t.backdropPadding);return at(t.font&&t.font.size,Rt.font.size)+n.height}return 0}function h_(e,t,n){return n=kt(n)?n:[n],{w:wp(e,t.string,n),h:n.length*t.lineHeight}}function Kd(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function f_(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,o=a.centerPointLabels?dt/s:0;for(let l=0;l<s;l++){const c=a.setContext(e.getPointLabelContext(l));r[l]=c.padding;const u=e.getPointPosition(l,e.drawingArea+r[l],o),h=It(c.font),f=h_(e.ctx,h,e._pointLabels[l]);i[l]=f;const m=se(e.getIndexAngle(l)+o),g=Math.round(ps(m)),p=Kd(g,u.x,f.w,0,180),x=Kd(g,u.y,f.h,90,270);m_(n,t,m,p,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=y_(e,i,r)}function m_(e,t,n,i,r){const s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/s,e.l=Math.min(e.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+o)),r.start<t.t?(l=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-l)):r.end>t.b&&(l=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function g_(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:o}=n,l=e.getPointPosition(t,i+r+a,s),c=Math.round(ps(se(l.angle+Pt))),u=x_(l.y,o.h,c),h=b_(c),f=__(l.x,o.w,h);return{visible:!0,x:l.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function p_(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(rn({x:n,y:i},t)||rn({x:n,y:s},t)||rn({x:r,y:i},t)||rn({x:r,y:s},t))}function y_(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:o}=s.pointLabels,l={extra:Ao(s)/2,additionalAngle:a?dt/r:0};let c;for(let u=0;u<r;u++){l.padding=n[u],l.size=t[u];const h=g_(e,u,l);i.push(h),o==="auto"&&(h.visible=p_(h,c),h.visible&&(c=h))}return i}function b_(e){return e===0||e===180?"center":e<180?"left":"right"}function __(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function x_(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function w_(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:o}=t;if(!st(o)){const l=Dn(t.borderRadius),c=Ut(t.backdropPadding);e.fillStyle=o;const u=i-c.left,h=r-c.top,f=s-i+c.width,m=a-r+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),_i(e,{x:u,y:h,w:f,h:m,radius:l}),e.fill()):e.fillRect(u,h,f,m)}}function v_(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));w_(n,a,s);const o=It(a.font),{x:l,y:c,textAlign:u}=s;qn(n,e._pointLabels[r],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Zd(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,Ot);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=e.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function S_(e,t,n,i,r){const s=e.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||n<0||(s.save(),s.strokeStyle=o,s.lineWidth=l,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Zd(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function k_(e,t,n){return Cn(e,{label:n,index:t,type:"pointLabel"})}class kr extends Ws{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ut(Ao(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=At(t)&&!isNaN(t)?t:0,this.max=At(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ao(this.options))}generateTickLabels(t){Ws.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const r=Mt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?f_(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*n+jt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(st(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return k_(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-Pt+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Zd(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,a=this._pointLabels.length;let o,l,c;if(n.pointLabels.display&&v_(this,a),r.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=r.setContext(f),g=s.setContext(f);S_(this,m,l,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),u=It(c.font);if(s=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=Ut(c.backdropPadding);t.fillRect(-a/2-h.left,-s-u.size/2-h.top,a+h.width,u.size+h.height)}qn(t,o.label,0,-s,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}R(kr,"id","radialLinear"),R(kr,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_s.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(kr,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(kr,"descriptors",{angleLines:{_fallback:"grid"}});const Ys={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}},we=Object.keys(Ys);function Qd(e,t){return e-t}function Jd(e,t){if(st(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),At(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(Tn(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function th(e,t,n,i){const r=we.length;for(let s=we.indexOf(e);s<r-1;++s){const a=Ys[we[s]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(o*a.size))<=i)return we[s]}return we[r-1]}function M_(e,t,n,i,r){for(let s=we.length-1;s>=we.indexOf(n);s--){const a=we[s];if(Ys[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return we[n?we.indexOf(n):0]}function T_(e){for(let t=we.indexOf(e)+1,n=we.length;t<n;++t)if(Ys[we[t]].common)return we[t]}function eh(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=Xa(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function D_(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=s;o<=a;o=+r.add(o,1,i))l=n[o],l>=0&&(t[l].major=!0);return t}function nh(e,t,n){const i=[],r={},s=t.length;let a,o;for(a=0;a<s;++a)o=t[a],r[o]=a,i.push({value:o,major:!1});return s===0||!n?i:D_(e,i,r,n)}class Mr extends Zn{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,n={}){const i=t.time||(t.time={}),r=this._adapter=new ju._date(t.adapters.date);r.init(n),er(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Jd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(r=Math.min(r,c.min)),!o&&!isNaN(c.max)&&(s=Math.max(s,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),r=At(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=At(s)&&!isNaN(s)?s:+n.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,o=lp(r,s,a);return this._unit=n.unit||(i.autoSkip?th(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):M_(this,o.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:T_(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),nh(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Qt(n,0,a),i=Qt(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||th(s.minUnit,n,i,this._getLabelCapacity(n)),o=at(r.ticks.stepSize,1),l=a==="week"?s.isoWeekday:!1,c=Tn(l)||l===!0,u={};let h=n,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,n,a)>1e5*o)throw new Error(n+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=r.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)eh(u,f,g);return(f===i||r.bounds==="ticks"||m===1)&&eh(u,f,g),Object.keys(u).sort(Qd).map(p=>+p)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return Mt(a,[t,n,i],this);const o=s.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[c],f=i[n],m=c&&h&&f&&f.major;return this._adapter.format(t,r||(m?h:u))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,r=jt(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*s+o*a,h:i*a+o*s}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(t,0,nh(this,[t],this._majorUnit),r),a=this._getLabelSize(s),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n<i;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)t.push(Jd(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return nu(t.sort(Qd))}}R(Mr,"id","time"),R(Mr,"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 $s(e,t,n){let i=0,r=e.length-1,s,a,o,l;n?(t>=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=nn(e,"pos",t)),{pos:s,time:o}=e[i],{pos:a,time:l}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=nn(e,"time",t)),{time:s,pos:o}=e[i],{time:a,pos:l}=e[r]);const c=a-s;return c?o+(l-o)*(t-s)/c:o}class Io extends Mr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=$s(n,this.min),this._tableRange=$s(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=n&&c<=i&&r.push(c);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,o=r.length;a<o;++a)u=r[a+1],l=r[a-1],c=r[a],Math.round((u+l)/2)!==c&&s.push({time:c,pos:a/(o-1)});return s}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return($s(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return $s(this._table,i*this._tableRange+this._minPos,!0)}}R(Io,"id","timeseries"),R(Io,"defaults",Mr.defaults);var C_=Object.freeze({__proto__:null,CategoryScale:Oo,LinearScale:Po,LogarithmicScale:Ro,RadialLinearScale:kr,TimeScale:Mr,TimeSeriesScale:Io});const E_=[Fy,d0,s_,C_],ih=6048e5,O_=864e5,Tr=6e4,ki=36e5,P_=1e3,rh=Symbol.for("constructDateFrom");function Ft(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rh in e?e[rh](t):e instanceof Date?new e.constructor(t):new Date(t)}function ut(e,t){return Ft(t||e,e)}function js(e,t,n){const i=ut(e,n==null?void 0:n.in);return isNaN(t)?Ft((n==null?void 0:n.in)||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Lo(e,t,n){const i=ut(e,n==null?void 0:n.in);if(isNaN(t))return Ft(e,NaN);if(!t)return i;const r=i.getDate(),s=Ft(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function No(e,t,n){return Ft(e,+ut(e)+t)}function R_(e,t,n){return No(e,t*ki)}let A_={};function Jn(){return A_}function Ue(e,t){var o,l,c,u;const n=Jn(),i=(t==null?void 0:t.weekStartsOn)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,r=ut(e,t==null?void 0:t.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Mi(e,t){return Ue(e,{...t,weekStartsOn:1})}function sh(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getFullYear(),r=Ft(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Mi(r),a=Ft(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Mi(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function Us(e){const t=ut(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ti(e,...t){const n=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Fo(e,t){const n=ut(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function ah(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=Fo(i),a=Fo(r),o=+s-Us(s),l=+a-Us(a);return Math.round((o-l)/O_)}function I_(e,t){const n=sh(e,t),i=Ft(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Mi(i)}function L_(e,t,n){const i=ut(e,n==null?void 0:n.in);return i.setTime(i.getTime()+t*Tr),i}function N_(e,t,n){return Lo(e,t*3,n)}function F_(e,t,n){return No(e,t*1e3)}function B_(e,t,n){return js(e,t*7,n)}function z_(e,t,n){return Lo(e,t*12,n)}function Dr(e,t){const n=+ut(e)-+ut(t);return n<0?-1:n>0?1:n}function H_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Bo(e){return!(!H_(e)&&typeof e!="number"||isNaN(+ut(e)))}function V_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function W_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t);return i.getFullYear()-r.getFullYear()}function oh(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=lh(i,r),a=Math.abs(ah(i,r));i.setDate(i.getDate()-s*a);const o=+(lh(i,r)===-s),l=s*(a-o);return l===0?0:l}function lh(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Cr(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function Y_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=(+i-+r)/ki;return Cr(n==null?void 0:n.roundingMethod)(s)}function zo(e,t){return+ut(e)-+ut(t)}function $_(e,t,n){const i=zo(e,t)/Tr;return Cr(n==null?void 0:n.roundingMethod)(i)}function ch(e,t){const n=ut(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function uh(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function j_(e,t){const n=ut(e,t==null?void 0:t.in);return+ch(n,t)==+uh(n,t)}function dh(e,t,n){const[i,r,s]=ti(n==null?void 0:n.in,e,e,t),a=Dr(r,s),o=Math.abs(V_(r,s));if(o<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*o);let l=Dr(r,s)===-a;j_(i)&&o===1&&Dr(i,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function U_(e,t,n){const i=dh(e,t,n)/3;return Cr(n==null?void 0:n.roundingMethod)(i)}function q_(e,t,n){const i=zo(e,t)/1e3;return Cr(n==null?void 0:n.roundingMethod)(i)}function X_(e,t,n){const i=oh(e,t,n)/7;return Cr(n==null?void 0:n.roundingMethod)(i)}function G_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=Dr(i,r),a=Math.abs(W_(i,r));i.setFullYear(1584),r.setFullYear(1584);const o=Dr(i,r)===-s,l=s*(a-+o);return l===0?0:l}function K_(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function Z_(e,t){const n=ut(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Q_(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function hh(e,t){const n=ut(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function J_(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMinutes(59,59,999),n}function tx(e,t){var o,l;const n=Jn(),i=n.weekStartsOn??((l=(o=n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,r=ut(e,t==null?void 0:t.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function ex(e,t){const n=ut(e,t==null?void 0:t.in);return n.setSeconds(59,999),n}function nx(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function ix(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMilliseconds(999),n}const rx={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"}},sx=(e,t,n)=>{let i;const r=rx[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Ho(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ax={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ox={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cx={date:Ho({formats:ax,defaultWidth:"full"}),time:Ho({formats:ox,defaultWidth:"full"}),dateTime:Ho({formats:lx,defaultWidth:"full"})},ux={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dx=(e,t,n,i)=>ux[e];function Er(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const hx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},fx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mx={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"]},gx={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"]},px={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"}},yx={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"}},bx={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Er({values:hx,defaultWidth:"wide"}),quarter:Er({values:fx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Er({values:mx,defaultWidth:"wide"}),day:Er({values:gx,defaultWidth:"wide"}),dayPeriod:Er({values:px,defaultWidth:"wide",formattingValues:yx,defaultFormattingWidth:"wide"})};function Or(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?xx(o,h=>h.test(a)):_x(o,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function _x(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function xx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function wx(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const vx=/^(\d+)(th|st|nd|rd)?/i,Sx=/\d+/i,kx={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},Mx={any:[/^b/i,/^(a|c)/i]},Tx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Dx={any:[/1/i,/2/i,/3/i,/4/i]},Cx={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},Ex={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]},Ox={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},Px={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]},Rx={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},Ax={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}},Ix={ordinalNumber:wx({matchPattern:vx,parsePattern:Sx,valueCallback:e=>parseInt(e,10)}),era:Or({matchPatterns:kx,defaultMatchWidth:"wide",parsePatterns:Mx,defaultParseWidth:"any"}),quarter:Or({matchPatterns:Tx,defaultMatchWidth:"wide",parsePatterns:Dx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Or({matchPatterns:Cx,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any"}),day:Or({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Px,defaultParseWidth:"any"}),dayPeriod:Or({matchPatterns:Rx,defaultMatchWidth:"any",parsePatterns:Ax,defaultParseWidth:"any"})},fh={code:"en-US",formatDistance:sx,formatLong:cx,formatRelative:dx,localize:bx,match:Ix,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lx(e,t){const n=ut(e,t==null?void 0:t.in);return ah(n,hh(n))+1}function mh(e,t){const n=ut(e,t==null?void 0:t.in),i=+Mi(n)-+I_(n);return Math.round(i/ih)+1}function Vo(e,t){var u,h,f,m;const n=ut(e,t==null?void 0:t.in),i=n.getFullYear(),r=Jn(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(f=r.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Ft((t==null?void 0:t.in)||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const o=Ue(a,t),l=Ft((t==null?void 0:t.in)||e,0);l.setFullYear(i,0,s),l.setHours(0,0,0,0);const c=Ue(l,t);return+n>=+o?i+1:+n>=+c?i:i-1}function Nx(e,t){var o,l,c,u;const n=Jn(),i=(t==null?void 0:t.firstWeekContainsDate)??((l=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(c=n.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,r=Vo(e,t),s=Ft((t==null?void 0:t.in)||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Ue(s,t)}function gh(e,t){const n=ut(e,t==null?void 0:t.in),i=+Ue(n,t)-+Nx(n,t);return Math.round(i/ih)+1}function Dt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Rn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Dt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Dt(n+1,2)},d(e,t){return Dt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Dt(e.getHours()%12||12,t.length)},H(e,t){return Dt(e.getHours(),t.length)},m(e,t){return Dt(e.getMinutes(),t.length)},s(e,t){return Dt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Dt(r,t.length)}},Ti={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ph={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Rn.y(e,t)},Y:function(e,t,n,i){const r=Vo(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Dt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Dt(s,t.length)},R:function(e,t){const n=sh(e);return Dt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Dt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Dt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Dt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Rn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Dt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=gh(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Dt(r,t.length)},I:function(e,t,n){const i=mh(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Rn.d(e,t)},D:function(e,t,n){const i=Lx(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Dt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Dt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Dt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Dt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Ti.noon:i===0?r=Ti.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Ti.evening:i>=12?r=Ti.afternoon:i>=4?r=Ti.morning:r=Ti.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Rn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Rn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Rn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Rn.s(e,t)},S:function(e,t){return Rn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return bh(i);case"XXXX":case"XX":return ei(i);case"XXXXX":case"XXX":default:return ei(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return bh(i);case"xxxx":case"xx":return ei(i);case"xxxxx":case"xxx":default:return ei(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+yh(i,":");case"OOOO":default:return"GMT"+ei(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+yh(i,":");case"zzzz":default:return"GMT"+ei(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Dt(i,t.length)},T:function(e,t,n){return Dt(+e,t.length)}};function yh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Dt(s,2)}function bh(e,t){return e%60===0?(e>0?"-":"+")+Dt(Math.abs(e)/60,2):ei(e,t)}function ei(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Dt(Math.trunc(i/60),2),s=Dt(i%60,2);return n+r+t+s}const _h=(e,t)=>{switch(e){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"})}},xh=(e,t)=>{switch(e){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"})}},Wo={p:xh,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return _h(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",_h(i,t)).replace("{{time}}",xh(r,t))}},Fx=/^D+$/,Bx=/^Y+$/,zx=["D","DD","YY","YYYY"];function wh(e){return Fx.test(e)}function vh(e){return Bx.test(e)}function Yo(e,t,n){const i=Hx(e,t,n);if(console.warn(i),zx.includes(e))throw new RangeError(i)}function Hx(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yx=/^'([^]*?)'?$/,$x=/''/g,jx=/[a-zA-Z]/;function qs(e,t,n){var u,h,f,m,g,p,x,S;const i=Jn(),r=(n==null?void 0:n.locale)??i.locale??fh,s=(n==null?void 0:n.firstWeekContainsDate)??((h=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((p=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??i.weekStartsOn??((S=(x=i.locale)==null?void 0:x.options)==null?void 0:S.weekStartsOn)??0,o=ut(e,n==null?void 0:n.in);if(!Bo(o))throw new RangeError("Invalid time value");let l=t.match(Wx).map(v=>{const k=v[0];if(k==="p"||k==="P"){const D=Wo[k];return D(v,r.formatLong)}return v}).join("").match(Vx).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const k=v[0];if(k==="'")return{isToken:!1,value:Ux(v)};if(ph[k])return{isToken:!0,value:v};if(k.match(jx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:v}});r.localize.preprocessor&&(l=r.localize.preprocessor(o,l));const c={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return l.map(v=>{if(!v.isToken)return v.value;const k=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&vh(k)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wh(k))&&Yo(k,t,String(e));const D=ph[k[0]];return D(o,k,r.localize,c)}).join("")}function Ux(e){const t=e.match(Yx);return t?t[1].replace($x,"'"):e}function Sh(){return Object.assign({},Jn())}function qx(e,t){const n=ut(e,t==null?void 0:t.in).getDay();return n===0?7:n}function Xx(e,t){const n=Gx(t)?new t(0):Ft(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Gx(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const Kx=10;class kh{constructor(){R(this,"subPriority",0)}validate(t,n){return!0}}class Zx extends kh{constructor(t,n,i,r,s){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class Qx extends kh{constructor(n,i){super();R(this,"priority",Kx);R(this,"subPriority",-1);this.context=n||(r=>Ft(i,r))}set(n,i){return i.timestampIsSet?n:Ft(n,Xx(n,this.context))}}class wt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new Zx(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class Jx extends wt{constructor(){super(...arguments);R(this,"priority",140);R(this,"incompatibleTokens",["R","u","t","T"])}parse(n,i,r){switch(i){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"})||r.era(n,{width:"narrow"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})||r.era(n,{width:"abbreviated"})||r.era(n,{width:"narrow"})}}set(n,i,r){return i.era=r,n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}}const Wt={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}/},qe={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 Yt(e,t){return e&&{value:t(e.value),rest:e.rest}}function Lt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Xe(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(r*ki+s*Tr+a*P_),rest:t.slice(n[0].length)}}function Mh(e){return Lt(Wt.anyDigitsSigned,e)}function Bt(e,t){switch(e){case 1:return Lt(Wt.singleDigit,t);case 2:return Lt(Wt.twoDigits,t);case 3:return Lt(Wt.threeDigits,t);case 4:return Lt(Wt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+e+"}"),t)}}function Xs(e,t){switch(e){case 1:return Lt(Wt.singleDigitSigned,t);case 2:return Lt(Wt.twoDigitsSigned,t);case 3:return Lt(Wt.threeDigitsSigned,t);case 4:return Lt(Wt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function $o(e){switch(e){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 Th(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const s=i+50,a=Math.trunc(s/100)*100,o=e>=s%100;r=e+a-(o?100:0)}return n?r:1-r}function Dh(e){return e%400===0||e%4===0&&e%100!==0}class tw extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,i,r){const s=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Yt(Bt(4,n),s);case"yo":return Yt(r.ordinalNumber(n,{unit:"year"}),s);default:return Yt(Bt(i.length,n),s)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,r){const s=n.getFullYear();if(r.isTwoDigitYear){const o=Th(r.year,s);return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}const a=!("era"in i)||i.era===1?r.year:1-r.year;return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class ew extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,i,r){const s=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Yt(Bt(4,n),s);case"Yo":return Yt(r.ordinalNumber(n,{unit:"year"}),s);default:return Yt(Bt(i.length,n),s)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,r,s){const a=Vo(n,s);if(r.isTwoDigitYear){const l=Th(r.year,a);return n.setFullYear(l,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),Ue(n,s)}const o=!("era"in i)||i.era===1?r.year:1-r.year;return n.setFullYear(o,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),Ue(n,s)}}class nw extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,i){return Xs(i==="R"?4:i.length,n)}set(n,i,r){const s=Ft(n,0);return s.setFullYear(r,0,4),s.setHours(0,0,0,0),Mi(s)}}class iw extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,i){return Xs(i==="u"?4:i.length,n)}set(n,i,r){return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}}class rw extends wt{constructor(){super(...arguments);R(this,"priority",120);R(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"Q":case"QQ":return Bt(i.length,n);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"})||r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})||r.quarter(n,{width:"abbreviated",context:"formatting"})||r.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=1&&i<=4}set(n,i,r){return n.setMonth((r-1)*3,1),n.setHours(0,0,0,0),n}}class sw extends wt{constructor(){super(...arguments);R(this,"priority",120);R(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"q":case"qq":return Bt(i.length,n);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"})||r.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})||r.quarter(n,{width:"abbreviated",context:"standalone"})||r.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=1&&i<=4}set(n,i,r){return n.setMonth((r-1)*3,1),n.setHours(0,0,0,0),n}}class aw extends wt{constructor(){super(...arguments);R(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);R(this,"priority",110)}parse(n,i,r){const s=a=>a-1;switch(i){case"M":return Yt(Lt(Wt.month,n),s);case"MM":return Yt(Bt(2,n),s);case"Mo":return Yt(r.ordinalNumber(n,{unit:"month"}),s);case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"})||r.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})||r.month(n,{width:"abbreviated",context:"formatting"})||r.month(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.setMonth(r,1),n.setHours(0,0,0,0),n}}class ow extends wt{constructor(){super(...arguments);R(this,"priority",110);R(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,i,r){const s=a=>a-1;switch(i){case"L":return Yt(Lt(Wt.month,n),s);case"LL":return Yt(Bt(2,n),s);case"Lo":return Yt(r.ordinalNumber(n,{unit:"month"}),s);case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"})||r.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})||r.month(n,{width:"abbreviated",context:"standalone"})||r.month(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.setMonth(r,1),n.setHours(0,0,0,0),n}}function lw(e,t,n){const i=ut(e,n==null?void 0:n.in),r=gh(i,n)-t;return i.setDate(i.getDate()-r*7),ut(i,n==null?void 0:n.in)}class cw extends wt{constructor(){super(...arguments);R(this,"priority",100);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,i,r){switch(i){case"w":return Lt(Wt.week,n);case"wo":return r.ordinalNumber(n,{unit:"week"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,r,s){return Ue(lw(n,r,s),s)}}function uw(e,t,n){const i=ut(e,n==null?void 0:n.in),r=mh(i,n)-t;return i.setDate(i.getDate()-r*7),i}class dw extends wt{constructor(){super(...arguments);R(this,"priority",100);R(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,i,r){switch(i){case"I":return Lt(Wt.week,n);case"Io":return r.ordinalNumber(n,{unit:"week"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,r){return Mi(uw(n,r))}}const hw=[31,28,31,30,31,30,31,31,30,31,30,31],fw=[31,29,31,30,31,30,31,31,30,31,30,31];class mw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"subPriority",1);R(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"d":return Lt(Wt.date,n);case"do":return r.ordinalNumber(n,{unit:"date"});default:return Bt(i.length,n)}}validate(n,i){const r=n.getFullYear(),s=Dh(r),a=n.getMonth();return s?i>=1&&i<=fw[a]:i>=1&&i<=hw[a]}set(n,i,r){return n.setDate(r),n.setHours(0,0,0,0),n}}class gw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"subpriority",1);R(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,i,r){switch(i){case"D":case"DD":return Lt(Wt.dayOfYear,n);case"Do":return r.ordinalNumber(n,{unit:"date"});default:return Bt(i.length,n)}}validate(n,i){const r=n.getFullYear();return Dh(r)?i>=1&&i<=366:i>=1&&i<=365}set(n,i,r){return n.setMonth(0,r),n.setHours(0,0,0,0),n}}function jo(e,t,n){var h,f,m,g;const i=Jn(),r=(n==null?void 0:n.weekStartsOn)??((f=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,s=ut(e,n==null?void 0:n.in),a=s.getDay(),l=(t%7+7)%7,c=7-r,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return js(s,u,n)}class pw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=jo(n,r,s),n.setHours(0,0,0,0),n}}class yw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,i,r,s){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Yt(Bt(i.length,n),a);case"eo":return Yt(r.ordinalNumber(n,{unit:"day"}),a);case"eee":return r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=jo(n,r,s),n.setHours(0,0,0,0),n}}class bw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,i,r,s){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Yt(Bt(i.length,n),a);case"co":return Yt(r.ordinalNumber(n,{unit:"day"}),a);case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"})||r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(n,{width:"wide",context:"standalone"})||r.day(n,{width:"abbreviated",context:"standalone"})||r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=jo(n,r,s),n.setHours(0,0,0,0),n}}function _w(e,t,n){const i=ut(e,n==null?void 0:n.in),r=qx(i,n),s=t-r;return js(i,s,n)}class xw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,i,r){const s=a=>a===0?7:a;switch(i){case"i":case"ii":return Bt(i.length,n);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return Yt(r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s);case"iiiii":return Yt(r.day(n,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Yt(r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s);case"iiii":default:return Yt(r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s)}}validate(n,i){return i>=1&&i<=7}set(n,i,r){return n=_w(n,r),n.setHours(0,0,0,0),n}}class ww extends wt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,i,r){switch(i){case"a":case"aa":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours($o(r),0,0,0),n}}class vw extends wt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,i,r){switch(i){case"b":case"bb":case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours($o(r),0,0,0),n}}class Sw extends wt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["a","b","t","T"])}parse(n,i,r){switch(i){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours($o(r),0,0,0),n}}class kw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,i,r){switch(i){case"h":return Lt(Wt.hour12h,n);case"ho":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=12}set(n,i,r){const s=n.getHours()>=12;return s&&r<12?n.setHours(r+12,0,0,0):!s&&r===12?n.setHours(0,0,0,0):n.setHours(r,0,0,0),n}}class Mw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,i,r){switch(i){case"H":return Lt(Wt.hour23h,n);case"Ho":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=23}set(n,i,r){return n.setHours(r,0,0,0),n}}class Tw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,i,r){switch(i){case"K":return Lt(Wt.hour11h,n);case"Ko":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.getHours()>=12&&r<12?n.setHours(r+12,0,0,0):n.setHours(r,0,0,0),n}}class Dw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,i,r){switch(i){case"k":return Lt(Wt.hour24h,n);case"ko":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=24}set(n,i,r){const s=r<=24?r%24:r;return n.setHours(s,0,0,0),n}}class Cw extends wt{constructor(){super(...arguments);R(this,"priority",60);R(this,"incompatibleTokens",["t","T"])}parse(n,i,r){switch(i){case"m":return Lt(Wt.minute,n);case"mo":return r.ordinalNumber(n,{unit:"minute"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,r){return n.setMinutes(r,0,0),n}}class Ew extends wt{constructor(){super(...arguments);R(this,"priority",50);R(this,"incompatibleTokens",["t","T"])}parse(n,i,r){switch(i){case"s":return Lt(Wt.second,n);case"so":return r.ordinalNumber(n,{unit:"second"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,r){return n.setSeconds(r,0),n}}class Ow extends wt{constructor(){super(...arguments);R(this,"priority",30);R(this,"incompatibleTokens",["t","T"])}parse(n,i){const r=s=>Math.trunc(s*Math.pow(10,-i.length+3));return Yt(Bt(i.length,n),r)}set(n,i,r){return n.setMilliseconds(r),n}}class Pw extends wt{constructor(){super(...arguments);R(this,"priority",10);R(this,"incompatibleTokens",["t","T","x"])}parse(n,i){switch(i){case"X":return Xe(qe.basicOptionalMinutes,n);case"XX":return Xe(qe.basic,n);case"XXXX":return Xe(qe.basicOptionalSeconds,n);case"XXXXX":return Xe(qe.extendedOptionalSeconds,n);case"XXX":default:return Xe(qe.extended,n)}}set(n,i,r){return i.timestampIsSet?n:Ft(n,n.getTime()-Us(n)-r)}}class Rw extends wt{constructor(){super(...arguments);R(this,"priority",10);R(this,"incompatibleTokens",["t","T","X"])}parse(n,i){switch(i){case"x":return Xe(qe.basicOptionalMinutes,n);case"xx":return Xe(qe.basic,n);case"xxxx":return Xe(qe.basicOptionalSeconds,n);case"xxxxx":return Xe(qe.extendedOptionalSeconds,n);case"xxx":default:return Xe(qe.extended,n)}}set(n,i,r){return i.timestampIsSet?n:Ft(n,n.getTime()-Us(n)-r)}}class Aw extends wt{constructor(){super(...arguments);R(this,"priority",40);R(this,"incompatibleTokens","*")}parse(n){return Mh(n)}set(n,i,r){return[Ft(n,r*1e3),{timestampIsSet:!0}]}}class Iw extends wt{constructor(){super(...arguments);R(this,"priority",20);R(this,"incompatibleTokens","*")}parse(n){return Mh(n)}set(n,i,r){return[Ft(n,r),{timestampIsSet:!0}]}}const Lw={G:new Jx,y:new tw,Y:new ew,R:new nw,u:new iw,Q:new rw,q:new sw,M:new aw,L:new ow,w:new cw,I:new dw,d:new mw,D:new gw,E:new pw,e:new yw,c:new bw,i:new xw,a:new ww,b:new vw,B:new Sw,h:new kw,H:new Mw,K:new Tw,k:new Dw,m:new Cw,s:new Ew,S:new Ow,X:new Pw,x:new Rw,t:new Aw,T:new Iw},Nw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bw=/^'([^]*?)'?$/,zw=/''/g,Hw=/\S/,Vw=/[a-zA-Z]/;function Ww(e,t,n,i){var x,S,v,k,D,M,P,E;const r=()=>Ft((i==null?void 0:i.in)||n,NaN),s=Sh(),a=(i==null?void 0:i.locale)??s.locale??fh,o=(i==null?void 0:i.firstWeekContainsDate)??((S=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:S.firstWeekContainsDate)??s.firstWeekContainsDate??((k=(v=s.locale)==null?void 0:v.options)==null?void 0:k.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((M=(D=i==null?void 0:i.locale)==null?void 0:D.options)==null?void 0:M.weekStartsOn)??s.weekStartsOn??((E=(P=s.locale)==null?void 0:P.options)==null?void 0:E.weekStartsOn)??0;if(!t)return e?r():ut(n,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new Qx(i==null?void 0:i.in,n)],h=t.match(Fw).map(y=>{const _=y[0];if(_ in Wo){const T=Wo[_];return T(y,a.formatLong)}return y}).join("").match(Nw),f=[];for(let y of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&vh(y)&&Yo(y,t,e),!(i!=null&&i.useAdditionalDayOfYearTokens)&&wh(y)&&Yo(y,t,e);const _=y[0],T=Lw[_];if(T){const{incompatibleTokens:O}=T;if(Array.isArray(O)){const I=f.find(B=>O.includes(B.token)||B.token===_);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${y}\` at the same time`)}else if(T.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);f.push({token:_,fullToken:y});const A=T.run(e,y,a.match,c);if(!A)return r();u.push(A.setter),e=A.rest}else{if(_.match(Vw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(y==="''"?y="'":_==="'"&&(y=Yw(y)),e.indexOf(y)===0)e=e.slice(y.length);else return r()}}if(e.length>0&&Hw.test(e))return r();const m=u.map(y=>y.priority).sort((y,_)=>_-y).filter((y,_,T)=>T.indexOf(y)===_).map(y=>u.filter(_=>_.priority===y).sort((_,T)=>T.subPriority-_.subPriority)).map(y=>y[0]);let g=ut(n,i==null?void 0:i.in);if(isNaN(+g))return r();const p={};for(const y of m){if(!y.validate(g,c))return r();const _=y.set(g,p,c);Array.isArray(_)?(g=_[0],Object.assign(p,_[1])):g=_}return g}function Yw(e){return e.match(Bw)[1].replace(zw,"'")}function $w(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMinutes(0,0,0),n}function jw(e,t){const n=ut(e,t==null?void 0:t.in);return n.setSeconds(0,0),n}function Uw(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMilliseconds(0),n}function qw(e){const t=e/ki;return Math.trunc(t)}function Ch(e,t){const n=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,r=Zw(e);let s;if(r.date){const c=Qw(r.date,i);s=Jw(c.restDateString,c.year)}if(!s||isNaN(+s))return n();const a=+s;let o=0,l;if(r.time&&(o=tv(r.time),isNaN(o)))return n();if(r.timezone){if(l=ev(r.timezone),isNaN(l))return n()}else{const c=new Date(a+o),u=ut(0,t==null?void 0:t.in);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return ut(a+o+l,t==null?void 0:t.in)}const Gs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Gw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Kw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Zw(e){const t={},n=e.split(Gs.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],Gs.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Gs.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const r=Gs.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function Qw(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:e.slice((i[1]||i[2]).length)}}function Jw(e,t){if(t===null)return new Date(NaN);const n=e.match(Xw);if(!n)return new Date(NaN);const i=!!n[4],r=Pr(n[1]),s=Pr(n[2])-1,a=Pr(n[3]),o=Pr(n[4]),l=Pr(n[5])-1;if(i)return av(t,o,l)?nv(t,o,l):new Date(NaN);{const c=new Date(0);return!rv(t,s,a)||!sv(t,r)?new Date(NaN):(c.setUTCFullYear(t,s,Math.max(r,a)),c)}}function Pr(e){return e?parseInt(e):1}function tv(e){const t=e.match(Gw);if(!t)return NaN;const n=Uo(t[1]),i=Uo(t[2]),r=Uo(t[3]);return ov(n,i,r)?n*ki+i*Tr+r*1e3:NaN}function Uo(e){return e&&parseFloat(e.replace(",","."))||0}function ev(e){if(e==="Z")return 0;const t=e.match(Kw);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return lv(i,r)?n*(i*ki+r*Tr):NaN}function nv(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const iv=[31,null,31,30,31,30,31,31,30,31,30,31];function Eh(e){return e%400===0||e%4===0&&e%100!==0}function rv(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(iv[t]||(Eh(e)?29:28))}function sv(e,t){return t>=1&&t<=(Eh(e)?366:365)}function av(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function ov(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function lv(e,t){return t>=0&&t<=59}var cv=Object.defineProperty,uv=(e,t,n)=>t in e?cv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Re=(e,t,n)=>uv(e,typeof t!="symbol"?t+"":t,n);const dv=1e3;var tt=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(tt||{});const hv=["in","not_in","selector"],fv=["empty","not_empty"],mv=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],gv=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Rr=e=>e.filter(t=>t!=="time"),Oh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Ph=Rr(Oh),pv=[...Oh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Rh=Rr(pv),yv=["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","realm","status_code","status_code_grouped","ai_plugin"],Ah=Rr(yv);Rr(["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),Rr(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Ph),new Set(Rh),new Set(Ah);const Ih=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];Ih.map(e=>e.code),(e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:hv},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:fv}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Rh,...Ph,...Ah])]);const bv={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"}},_v=(e,t,n)=>{let i;const r=bv[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function qo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const xv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sv={date:qo({formats:xv,defaultWidth:"full"}),time:qo({formats:wv,defaultWidth:"full"}),dateTime:qo({formats:vv,defaultWidth:"full"})},kv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mv=(e,t,n,i)=>kv[e];function Ar(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const Tv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Dv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Cv={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"]},Ev={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"]},Ov={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"}},Pv={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"}},Rv=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Av={ordinalNumber:Rv,era:Ar({values:Tv,defaultWidth:"wide"}),quarter:Ar({values:Dv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ar({values:Cv,defaultWidth:"wide"}),day:Ar({values:Ev,defaultWidth:"wide"}),dayPeriod:Ar({values:Ov,defaultWidth:"wide",formattingValues:Pv,defaultFormattingWidth:"wide"})};function Ir(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?Lv(o,h=>h.test(a)):Iv(o,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function Iv(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Lv(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Nv(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const Fv=/^(\d+)(th|st|nd|rd)?/i,Bv=/\d+/i,zv={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},Hv={any:[/^b/i,/^(a|c)/i]},Vv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wv={any:[/1/i,/2/i,/3/i,/4/i]},Yv={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},$v={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]},jv={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},Uv={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]},qv={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},Xv={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}},Gv={ordinalNumber:Nv({matchPattern:Fv,parsePattern:Bv,valueCallback:e=>parseInt(e,10)}),era:Ir({matchPatterns:zv,defaultMatchWidth:"wide",parsePatterns:Hv,defaultParseWidth:"any"}),quarter:Ir({matchPatterns:Vv,defaultMatchWidth:"wide",parsePatterns:Wv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ir({matchPatterns:Yv,defaultMatchWidth:"wide",parsePatterns:$v,defaultParseWidth:"any"}),day:Ir({matchPatterns:jv,defaultMatchWidth:"wide",parsePatterns:Uv,defaultParseWidth:"any"}),dayPeriod:Ir({matchPatterns:qv,defaultMatchWidth:"any",parsePatterns:Xv,defaultParseWidth:"any"})},Kv={code:"en-US",formatDistance:_v,formatLong:Sv,formatRelative:Mv,localize:Av,match:Gv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Zv={};function Lr(){return Zv}const Lh=6048e5,Qv=864e5,Jv=60,t1=3600,Nh=Symbol.for("constructDateFrom");function Ae(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Nh in e?e[Nh](t):e instanceof Date?new e.constructor(t):new Date(t)}function he(e,t){return Ae(t||e,e)}function Fh(e){const t=he(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function e1(e,...t){const n=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Nr(e,t){const n=he(e,void 0);return n.setHours(0,0,0,0),n}function n1(e,t,n){const[i,r]=e1(void 0,e,t),s=Nr(i),a=Nr(r),o=+s-Fh(s),l=+a-Fh(a);return Math.round((o-l)/Qv)}function i1(e,t){const n=he(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function r1(e,t){const n=he(e,void 0);return n1(n,i1(n))+1}function ln(e,t){var n,i,r,s;const a=Lr(),o=(t==null?void 0:t.weekStartsOn)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((s=(r=a.locale)==null?void 0:r.options)==null?void 0:s.weekStartsOn)??0,l=he(e,t==null?void 0:t.in),c=l.getDay(),u=(c<o?7:0)+c-o;return l.setDate(l.getDate()-u),l.setHours(0,0,0,0),l}function Ks(e,t){return ln(e,{...t,weekStartsOn:1})}function Bh(e,t){const n=he(e,void 0),i=n.getFullYear(),r=Ae(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Ks(r),a=Ae(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Ks(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function s1(e,t){const n=Bh(e),i=Ae(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ks(i)}function a1(e,t){const n=he(e,void 0),i=+Ks(n)-+s1(n);return Math.round(i/Lh)+1}function zh(e,t){var n,i,r,s;const a=he(e,t==null?void 0:t.in),o=a.getFullYear(),l=Lr(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((s=(r=l.locale)==null?void 0:r.options)==null?void 0:s.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const h=ln(u,t),f=Ae((t==null?void 0:t.in)||e,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=ln(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function o1(e,t){var n,i,r,s;const a=Lr(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(r=a.locale)==null?void 0:r.options)==null?void 0:s.firstWeekContainsDate)??1,l=zh(e,t),c=Ae((t==null?void 0:t.in)||e,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),ln(c,t)}function l1(e,t){const n=he(e,t==null?void 0:t.in),i=+ln(n,t)-+o1(n,t);return Math.round(i/Lh)+1}function Ct(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const An={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Ct(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ct(n+1,2)},d(e,t){return Ct(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ct(e.getHours()%12||12,t.length)},H(e,t){return Ct(e.getHours(),t.length)},m(e,t){return Ct(e.getMinutes(),t.length)},s(e,t){return Ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Ct(r,t.length)}},Di={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Hh={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return An.y(e,t)},Y:function(e,t,n,i){const r=zh(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Ct(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ct(s,t.length)},R:function(e,t){const n=Bh(e);return Ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ct(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return An.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=l1(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Ct(r,t.length)},I:function(e,t,n){const i=a1(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Ct(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):An.d(e,t)},D:function(e,t,n){const i=r1(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ct(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ct(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Ct(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Di.noon:i===0?r=Di.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Di.evening:i>=12?r=Di.afternoon:i>=4?r=Di.morning:r=Di.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return An.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):An.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):An.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):An.s(e,t)},S:function(e,t){return An.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Wh(i);case"XXXX":case"XX":return ni(i);case"XXXXX":case"XXX":default:return ni(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Wh(i);case"xxxx":case"xx":return ni(i);case"xxxxx":case"xxx":default:return ni(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vh(i,":");case"OOOO":default:return"GMT"+ni(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vh(i,":");case"zzzz":default:return"GMT"+ni(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Ct(i,t.length)},T:function(e,t,n){return Ct(+e,t.length)}};function Vh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Ct(s,2)}function Wh(e,t){return e%60===0?(e>0?"-":"+")+Ct(Math.abs(e)/60,2):ni(e,t)}function ni(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Ct(Math.trunc(i/60),2),s=Ct(i%60,2);return n+r+t+s}const Yh=(e,t)=>{switch(e){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"})}},$h=(e,t)=>{switch(e){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"})}},c1=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Yh(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Yh(i,t)).replace("{{time}}",$h(r,t))},u1={p:$h,P:c1},d1=/^D+$/,h1=/^Y+$/,f1=["D","DD","YY","YYYY"];function m1(e){return d1.test(e)}function g1(e){return h1.test(e)}function p1(e,t,n){const i=y1(e,t,n);if(console.warn(i),f1.includes(e))throw new RangeError(i)}function y1(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function b1(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _1(e){return!(!b1(e)&&typeof e!="number"||isNaN(+he(e)))}const x1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,w1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,v1=/^'([^]*?)'?$/,S1=/''/g,k1=/[a-zA-Z]/;function M1(e,t,n){var i,r,s,a,o,l,c,u;const h=Lr(),f=(n==null?void 0:n.locale)??h.locale??Kv,m=(n==null?void 0:n.firstWeekContainsDate)??((r=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(s=h.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,g=(n==null?void 0:n.weekStartsOn)??((l=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??h.weekStartsOn??((u=(c=h.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,p=he(e,n==null?void 0:n.in);if(!_1(p))throw new RangeError("Invalid time value");let x=t.match(w1).map(v=>{const k=v[0];if(k==="p"||k==="P"){const D=u1[k];return D(v,f.formatLong)}return v}).join("").match(x1).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const k=v[0];if(k==="'")return{isToken:!1,value:T1(v)};if(Hh[k])return{isToken:!0,value:v};if(k.match(k1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:v}});f.localize.preprocessor&&(x=f.localize.preprocessor(p,x));const S={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(v=>{if(!v.isToken)return v.value;const k=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&g1(k)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&m1(k))&&p1(k,t,String(e));const D=Hh[k[0]];return D(p,k,f.localize,S)}).join("")}function T1(e){const t=e.match(v1);return t?t[1].replace(S1,"'"):e}function Xo(e,t,n){const i=he(e,void 0);return isNaN(t)?Ae(e,NaN):(i.setDate(i.getDate()+t),i)}function D1(e,t,n){const i=he(e,void 0);if(isNaN(t))return Ae(e,NaN);const r=i.getDate(),s=Ae(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Ci(e,t){const n=he(e,void 0);return n.setDate(1),n.setHours(0,0,0,0),n}function C1(e,t){const n=he(e,void 0),i=n.getFullYear(),r=n.getMonth(),s=Ae(n,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function E1(){return Object.assign({},Lr())}function jh(e){return Math.trunc(e*t1)}function O1(e){const t=e/Jv;return Math.trunc(t)}function Uh(e,t,n){return D1(e,-1)}function qh(e,t,n){const i=E1(),r=A1(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?P1(r,t):R1(r,t)}function P1(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function R1(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function A1(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function I1(e,t){const n=z1(t);return"formatToParts"in n?N1(n,e):F1(n,e)}const L1={year:0,month:1,day:2,hour:3,minute:4,second:5};function N1(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=L1[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function F1(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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={},Xh=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")),B1=Xh==="06/25/2014, 00:00:00"||Xh==="06/25/2014 00:00:00";function z1(e){return Go[e]||(Go[e]=B1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Go[e]}function Ko(e,t,n,i,r,s,a){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(i,r,s,a),o}const Gh=36e5,H1=6e4,Zo={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Fr(e,t,n){if(!e)return 0;let i=Zo.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Zo.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Kh(r)?-(r*Gh):NaN;if(i=Zo.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Kh(r,a)?(s=Math.abs(r)*Gh+a*H1,i[1]==="+"?-s:s):NaN}if(Y1(e)){t=new Date(t||Date.now());const a=n?t:V1(t),o=Qo(a,e);return-(n?o:W1(t,o,e))}return NaN}function V1(e){return Ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Qo(e,t){const n=I1(e,t),i=Ko(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function W1(e,t,n){let i=e.getTime()-t;const r=Qo(new Date(i),n);if(t===r)return t;i-=r-t;const s=Qo(new Date(i),n);return r===s?r:Math.max(r,s)}function Kh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Zh={};function Y1(e){if(Zh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Zh[e]=!0,!0}catch{return!1}}const $1=60*1e3,j1={X:function(e,t,n){const i=Jo(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Qh(i);case"XXXX":case"XX":return Ei(i);case"XXXXX":case"XXX":default:return Ei(i,":")}},x:function(e,t,n){const i=Jo(n.timeZone,e);switch(t){case"x":return Qh(i);case"xxxx":case"xx":return Ei(i);case"xxxxx":case"xxx":default:return Ei(i,":")}},O:function(e,t,n){const i=Jo(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+U1(i,":");case"OOOO":default:return"GMT"+Ei(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return qh("short",e,n);case"zzzz":default:return qh("long",e,n)}}};function Jo(e,t){const n=e?Fr(e,t,!0)/$1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Zs(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Ei(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Zs(Math.floor(i/60),2),s=Zs(Math.floor(i%60),2);return n+r+t+s}function Qh(e,t){return e%60===0?(e>0?"-":"+")+Zs(Math.abs(e)/60,2):Ei(e,t)}function U1(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Zs(s,2)}function Jh(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const tf=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,tl=36e5,ef=6e4,q1=2,fe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:tf};function Qs(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?q1:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=X1(e),{year:r,restDateString:s}=G1(i.date,n),a=K1(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=Z1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Fr(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Jh(new Date(o+l)),c=Jh(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function X1(e){const t={};let n=fe.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=fe.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=fe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function G1(e,t){if(e){const n=fe.YYY[t],i=fe.YYYYY[t];let r=fe.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=fe.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function K1(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=fe.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,sf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=fe.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return tS(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=fe.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return sf(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=fe.Www.exec(e),s)return r=parseInt(s[1],10)-1,af(r)?nf(t,r):new Date(NaN);if(s=fe.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return af(r,a)?nf(t,r,a):new Date(NaN)}return null}function Z1(e){let t,n,i=fe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),el(t)?t%24*tl:NaN;if(i=fe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),el(t,n)?t%24*tl+n*ef:NaN;if(i=fe.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return el(t,n,r)?t%24*tl+n*ef+r*1e3:NaN}return null}function nf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Q1=[31,28,31,30,31,30,31,31,30,31,30,31],J1=[31,29,31,30,31,30,31,31,30,31,30,31];function rf(e){return e%400===0||e%4===0&&e%100!==0}function sf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=rf(e);if(i&&n>J1[t]||!i&&n>Q1[t])return!1}return!0}function tS(e,t){if(t<1)return!1;const n=rf(e);return!(n&&t>366||!n&&t>365)}function af(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function el(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const eS=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function nS(e,t,n={}){t=String(t);const i=t.match(eS);if(i){const r=Qs(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const o=s.indexOf(a),l=s[o-1]==="'",c=s.replace(a,"'"+j1[a[0]](r,a,n)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return M1(e,t,n)}function of(e,t,n){e=Qs(e,n);const i=Fr(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function iS(e,t,n,i){return i={...i,timeZone:t,originalDate:e},nS(of(e,t,{timeZone:i.timeZone}),n,i)}function rS(e,t,n){if(typeof e=="string"&&!e.match(tf))return Qs(e,{...n,timeZone:t});e=Qs(e,n);const i=Ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),r=Fr(t,new Date(i));return new Date(i+r)}function sS(e,t){return-Fr(e,t)}function nl(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(e);return iS(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const aS={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function il(e){return e&&gv.find(t=>e<=aS[t])||null}var Js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ta={exports:{}};ta.exports,function(e,t){var n=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",c="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",p="[object Promise]",x="[object RegExp]",S="[object Set]",v="[object String]",k="[object Symbol]",D="[object WeakMap]",M="[object ArrayBuffer]",P="[object DataView]",E="[object Float32Array]",y="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",q="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,lt=/^\[object .+?Constructor\]$/,X=/^(?:0|[1-9]\d*)$/,Q={};Q[s]=Q[a]=Q[M]=Q[P]=Q[o]=Q[l]=Q[E]=Q[y]=Q[_]=Q[T]=Q[O]=Q[f]=Q[m]=Q[g]=Q[x]=Q[S]=Q[v]=Q[k]=Q[A]=Q[I]=Q[B]=Q[q]=!0,Q[c]=Q[u]=Q[D]=!1;var H=typeof Js=="object"&&Js&&Js.Object===Object&&Js,U=typeof self=="object"&&self&&self.Object===Object&&self,Y=H||U||Function("return this")(),xt=t&&!t.nodeType&&t,yt=xt&&!0&&e&&!e.nodeType&&e,vt=yt&&yt.exports===xt;function mt(w,L){return w.set(L[0],L[1]),w}function gt(w,L){return w.add(L),w}function z(w,L){for(var F=-1,K=w?w.length:0;++F<K&&L(w[F],F,w)!==!1;);return w}function j(w,L){for(var F=-1,K=L.length,$t=w.length;++F<K;)w[$t+F]=L[F];return w}function $(w,L,F,K){for(var $t=-1,Kt=w?w.length:0;++$t<Kt;)F=L(F,w[$t],$t,w);return F}function J(w,L){for(var F=-1,K=Array(w);++F<w;)K[F]=L(F);return K}function et(w,L){return w==null?void 0:w[L]}function nt(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function rt(w){var L=-1,F=Array(w.size);return w.forEach(function(K,$t){F[++L]=[$t,K]}),F}function it(w,L){return function(F){return w(L(F))}}function _t(w){var L=-1,F=Array(w.size);return w.forEach(function(K){F[++L]=K}),F}var ct=Array.prototype,Et=Function.prototype,te=Object.prototype,ce=Y["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Ie=Et.toString,St=te.hasOwnProperty,Xt=te.toString,zt=RegExp("^"+Ie.call(St).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?Y.Buffer:void 0,re=Y.Symbol,Ke=Y.Uint8Array,ci=it(Object.getPrototypeOf,Object),ze=Object.create,Ht=te.propertyIsEnumerable,Se=ct.splice,ui=Object.getOwnPropertySymbols,ka=Gt?Gt.isBuffer:void 0,Ma=it(Object.keys,Object),Qr=Wn(Y,"DataView"),di=Wn(Y,"Map"),Jr=Wn(Y,"Promise"),hi=Wn(Y,"Set"),mn=Wn(Y,"WeakMap"),gn=Wn(Object,"create"),ts=ue(Qr),es=ue(di),fi=ue(Jr),ic=ue(hi),rc=ue(mn),Ta=re?re.prototype:void 0,Da=Ta?Ta.valueOf:void 0;function pn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function Wi(){this.__data__=gn?gn(null):{}}function ns(w){return this.has(w)&&delete this.__data__[w]}function Ca(w){var L=this.__data__;if(gn){var F=L[w];return F===i?void 0:F}return St.call(L,w)?L[w]:void 0}function yn(w){var L=this.__data__;return gn?L[w]!==void 0:St.call(L,w)}function sc(w,L){var F=this.__data__;return F[w]=gn&&L===void 0?i:L,this}pn.prototype.clear=Wi,pn.prototype.delete=ns,pn.prototype.get=Ca,pn.prototype.has=yn,pn.prototype.set=sc;function He(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function ac(){this.__data__=[]}function oc(w){var L=this.__data__,F=$i(L,w);if(F<0)return!1;var K=L.length-1;return F==K?L.pop():Se.call(L,F,1),!0}function lc(w){var L=this.__data__,F=$i(L,w);return F<0?void 0:L[F][1]}function Ve(w){return $i(this.__data__,w)>-1}function cc(w,L){var F=this.__data__,K=$i(F,w);return K<0?F.push([w,L]):F[K][1]=L,this}He.prototype.clear=ac,He.prototype.delete=oc,He.prototype.get=lc,He.prototype.has=Ve,He.prototype.set=cc;function Hn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function uc(){this.__data__={hash:new pn,map:new(di||He),string:new pn}}function dc(w){return qi(this,w).delete(w)}function hc(w){return qi(this,w).get(w)}function We(w){return qi(this,w).has(w)}function fc(w,L){return qi(this,w).set(w,L),this}Hn.prototype.clear=uc,Hn.prototype.delete=dc,Hn.prototype.get=hc,Hn.prototype.has=We,Hn.prototype.set=fc;function Vn(w){this.__data__=new He(w)}function mc(){this.__data__=new He}function gc(w){return this.__data__.delete(w)}function pc(w){return this.__data__.get(w)}function Yi(w){return this.__data__.has(w)}function yc(w,L){var F=this.__data__;if(F instanceof He){var K=F.__data__;if(!di||K.length<n-1)return K.push([w,L]),this;F=this.__data__=new Hn(K)}return F.set(w,L),this}Vn.prototype.clear=mc,Vn.prototype.delete=gc,Vn.prototype.get=pc,Vn.prototype.has=Yi,Vn.prototype.set=yc;function bc(w,L){var F=as(w)||Gi(w)?J(w.length,String):[],K=F.length,$t=!!K;for(var Kt in w)St.call(w,Kt)&&!($t&&(Kt=="length"||Lc(Kt,K)))&&F.push(Kt);return F}function Le(w,L,F){var K=w[L];(!(St.call(w,L)&&ss(K,F))||F===void 0&&!(L in w))&&(w[L]=F)}function $i(w,L){for(var F=w.length;F--;)if(ss(w[F][0],L))return F;return-1}function _c(w,L){return w&&Ea(L,mi(L),w)}function is(w,L,F,K,$t,Kt,ke){var ee;if(K&&(ee=Kt?K(w,$t,Kt,ke):K(w)),ee!==void 0)return ee;if(!_n(w))return w;var Na=as(w);if(Na){if(ee=Ac(w),!L)return Oc(w,ee)}else{var Yn=Ze(w),Fa=Yn==u||Yn==h;if(Aa(w))return kc(w,L);if(Yn==g||Yn==s||Fa&&!Kt){if(nt(w))return Kt?w:{};if(ee=Pa(Fa?{}:w),!L)return Pc(w,_c(ee,w))}else{if(!Q[Yn])return Kt?w:{};ee=Ic(w,Yn,is,L)}}ke||(ke=new Vn);var Ba=ke.get(w);if(Ba)return Ba;if(ke.set(w,ee),!Na)var gi=F?Rc(w):mi(w);return z(gi||w,function(ls,Ki){gi&&(Ki=ls,ls=w[Ki]),Le(ee,Ki,is(ls,L,F,K,Ki,w,ke))}),ee}function xc(w){return _n(w)?ze(w):{}}function wc(w,L,F){var K=L(w);return as(w)?K:j(K,F(w))}function vc(w){return Xt.call(w)}function ji(w){if(!_n(w)||Nc(w))return!1;var L=os(w)||nt(w)?zt:lt;return L.test(ue(w))}function Sc(w){if(!bn(w))return Ma(w);var L=[];for(var F in Object(w))St.call(w,F)&&F!="constructor"&&L.push(F);return L}function kc(w,L){if(L)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function Ui(w){var L=new w.constructor(w.byteLength);return new Ke(L).set(new Ke(w)),L}function Mc(w,L){var F=L?Ui(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function Tc(w,L,F){var K=L?F(rt(w),!0):rt(w);return $(K,mt,new w.constructor)}function rs(w){var L=new w.constructor(w.source,V.exec(w));return L.lastIndex=w.lastIndex,L}function Dc(w,L,F){var K=L?F(_t(w),!0):_t(w);return $(K,gt,new w.constructor)}function Cc(w){return Da?Object(Da.call(w)):{}}function Ec(w,L){var F=L?Ui(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function Oc(w,L){var F=-1,K=w.length;for(L||(L=Array(K));++F<K;)L[F]=w[F];return L}function Ea(w,L,F,K){F||(F={});for(var $t=-1,Kt=L.length;++$t<Kt;){var ke=L[$t],ee=void 0;Le(F,ke,ee===void 0?w[ke]:ee)}return F}function Pc(w,L){return Ea(w,Oa(w),L)}function Rc(w){return wc(w,mi,Oa)}function qi(w,L){var F=w.__data__;return Xi(L)?F[typeof L=="string"?"string":"hash"]:F.map}function Wn(w,L){var F=et(w,L);return ji(F)?F:void 0}var Oa=ui?it(ui,Object):Ia,Ze=vc;(Qr&&Ze(new Qr(new ArrayBuffer(1)))!=P||di&&Ze(new di)!=f||Jr&&Ze(Jr.resolve())!=p||hi&&Ze(new hi)!=S||mn&&Ze(new mn)!=D)&&(Ze=function(w){var L=Xt.call(w),F=L==g?w.constructor:void 0,K=F?ue(F):void 0;if(K)switch(K){case ts:return P;case es:return f;case fi:return p;case ic:return S;case rc:return D}return L});function Ac(w){var L=w.length,F=w.constructor(L);return L&&typeof w[0]=="string"&&St.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function Pa(w){return typeof w.constructor=="function"&&!bn(w)?xc(ci(w)):{}}function Ic(w,L,F,K){var $t=w.constructor;switch(L){case M:return Ui(w);case o:case l:return new $t(+w);case P:return Mc(w,K);case E:case y:case _:case T:case O:case A:case I:case B:case q:return Ec(w,K);case f:return Tc(w,K,F);case m:case v:return new $t(w);case x:return rs(w);case S:return Dc(w,K,F);case k:return Cc(w)}}function Lc(w,L){return L=L??r,!!L&&(typeof w=="number"||X.test(w))&&w>-1&&w%1==0&&w<L}function Xi(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function Nc(w){return!!qt&&qt in w}function bn(w){var L=w&&w.constructor,F=typeof L=="function"&&L.prototype||te;return w===F}function ue(w){if(w!=null){try{return Ie.call(w)}catch{}try{return w+""}catch{}}return""}function Fc(w){return is(w,!0,!0)}function ss(w,L){return w===L||w!==w&&L!==L}function Gi(w){return Bc(w)&&St.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==s)}var as=Array.isArray;function Ra(w){return w!=null&&zc(w.length)&&!os(w)}function Bc(w){return xn(w)&&Ra(w)}var Aa=ka||La;function os(w){var L=_n(w)?Xt.call(w):"";return L==u||L==h}function zc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=r}function _n(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function xn(w){return!!w&&typeof w=="object"}function mi(w){return Ra(w)?bc(w):Sc(w)}function Ia(){return[]}function La(){return!1}e.exports=Fc}(ta,ta.exports),ta.exports;const cn=(e,t)=>new Date(e.getTime()-sS(t,e));class le{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,"fineGrainedDefaultGranularity"),Re(this,"_startCustom"),Re(this,"_endCustom"),Re(this,"_allowedGranularitiesOverride"),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,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}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(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=7*24&&n.add("hourly"),i>=2*24&&n.add("daily"),i>=2*24*14&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(mv.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const n=rS(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return of(n,t)}}class lS extends le{rawStart(t){let n=ln(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*7}}class cS extends le{rawStart(t){let n=Ci(this.tzAdjustedDate(t));return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*31}}class uS extends le{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*366}}class dS extends le{rawEnd(t){let n=ln(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=cn(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=ln(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=cn(i,t)),i}}class hS extends le{rawEnd(t){let n=Ci(this.tzAdjustedDate(t));return t&&(n=cn(n,t)),n}rawStart(t){let n=Ci(Uh(this.tzAdjustedDate(t)));return t&&(n=cn(n,t)),n}}class fS extends le{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=cn(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=cn(n,t)),n}}tt.FIFTEEN_MIN,new le({key:tt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),tt.ONE_HOUR,new le({key:tt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),tt.SIX_HOUR,new le({key:tt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),tt.TWELVE_HOUR,new le({key:tt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),tt.ONE_DAY,new le({key:tt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),tt.SEVEN_DAY,new le({key:tt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.THIRTY_DAY,new le({key:tt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.NINETY_DAY,new le({key:tt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_HUNDRED_EIGHTY_DAY,new le({key:tt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_YEAR,new le({key:tt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.CURRENT_WEEK,new lS({key:tt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=ln(new Date,{weekStartsOn:1});return(Nr(Xo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.CURRENT_MONTH,new cS({key:tt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=Ci(new Date);return(Nr(Xo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_YEAR,new uS({key:tt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(Nr(Xo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_WEEK,new dS({key:tt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.PREVIOUS_MONTH,new hS({key:tt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=Ci(new Date),n=Ci(Uh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=lf(t,n)),60*60*24*C1(new Date().setMonth(new Date().getMonth()-1))+jh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_YEAR,new fS({key:tt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=lf(e,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+jh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function lf(e,t){return O1(e.getTimezoneOffset()-t.getTimezoneOffset())}tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.THIRTY_DAY,tt.NINETY_DAY,tt.ONE_HUNDRED_EIGHTY_DAY,tt.ONE_YEAR,tt.CURRENT_WEEK,tt.CURRENT_MONTH,tt.CURRENT_YEAR,tt.PREVIOUS_WEEK,tt.PREVIOUS_MONTH,tt.PREVIOUS_YEAR;const mS=new Map(Ih.map(e=>[e.code,{code:e.code,name:e.name}])),rl=e=>{var t;return((t=mS.get(e))==null?void 0:t.name)||e};var cf={exports:{}};(function(e){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?r:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(n(c,1,u),u):c<s?h=n(c,i,u)+"k":c<a?h=n(c,s,u)+"m":c<o?h=t(n(c,a,u),u)+"b":h=t(n(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,e.exports=l})()})(cf);var gS=cf.exports;const sl=oS(gS);var uf;const ea=new Intl.NumberFormat(((uf=document==null?void 0:document.documentElement)==null?void 0:uf.lang)||"en-US");function Br({i18n:e}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,o=r?Math.pow(2,30):1e9,l=r?Math.pow(2,20):1e6,c=r?Math.pow(2,10):1e3;let u;return i>=s?u=e.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=e.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=e.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},n=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?e.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(r,i);switch(r){case"bytes":return t(i,s);case"usd":return n(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${sl(i,{capital:!0})} ${c}`:i>=.01?`${ea.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:n,formatRange:(i,r,s,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${n(i,o)} - ${n(r,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(l)return`${sl(i,{capital:!0})} - ${sl(r,{capital:!0})} ${u}`}const h=i>=.01?`${ea.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=r>=.01?`${ea.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const na=e=>["interactive","zoom-interactive"].includes(e),df=(e,t,n,i)=>{var l,c;const{tooltip:r}=t;if(r.opacity===0&&!na(e.interactionMode)){e.showTooltip=!1;return}const{i18n:s}=pt.useI18n(),{formatUnit:a}=Br({i18n:s}),o=e.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(r.body&&!na(e.interactionMode)){const u=r.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y";e.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(r.dataPoints[0].parsed.x,n):Wr({tickValue:new Date(r.dataPoints[0].parsed.x),granularity:n}),e.tooltipSeries=r.dataPoints.map((f,m)=>{const g=f.parsed[h],p=a(g,e.units,{translateUnit:e.translateUnit}),x=f.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:x,value:p,rawValue:g,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(o),e.left=`${r.x}px`,e.top=`${r.y}px`,e.showTooltip=!0}},hf=(e,t)=>{var a,o;const{tooltip:n}=t,{i18n:i}=pt.useI18n(),{formatUnit:r}=Br({i18n:i});if(n.opacity===0&&!na(e.interactionMode)){e.showTooltip=!1;return}const s=e.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(n.body&&!na(e.interactionMode)){const l=n.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(e.chartType);u?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[c],g=r(m,e.units,{translateUnit:e.translateUnit});let p;return u?p=h.dataset.labels[h.dataIndex]:p=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:p,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},pS=e=>e&&e.datasets&&e.datasets.length,yS=e=>pS(e)&&e.datasets.some(t=>t.data.length),bS=e=>e.datasets.some(t=>t.data[0]&&Bo(t.data[0].x)),_S=e=>!!yS(e)&&e.datasets.some(t=>t.data.length==1),xS=e=>bS(e)&&e.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),al=(e,t,n)=>{const r=Math.min(t/1150,1);return e.x<n?e.x+t*.15*(1-r):e.x-t*1.15*(1-r)},wS=(e,t,n)=>e.y<n?e.y+t*.15:e.y-t*.5;function ol(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const ff=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(r=>{var s;return!((s=t==null?void 0:t[r.text])!=null&&s.isThreshold)}).map((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty})).sort(n)},vS=2,mf=10,gf=12,ia=10,pf="#6c7489",SS="#d60027",kS="#ad000e",ll="#6c7489",yf="#52596e",MS="#007d60",TS="#995c00",DS="#ffc400",zr="16px",CS="20px",ES="'Inter', Roboto, Helvetica, sans-serif",bf="24px",OS="40px",PS="48px",_f={"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"}},un=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ra=(e,t)=>(t||un)[e%un.length],xf=(e,t)=>{e[0]==="#"&&(e=e.slice(1));let n=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16);n=n-t,i=i-t,r=r-t,n>255?n=255:n<0&&(n=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const s=n.toString(16).length===1?"0"+n.toString(16):n.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${s}${a}${o}`},wf="#6f7787",vf={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"}},RS=e=>{var n;const t=Math.floor(parseInt(e,10)/100)*100;return((n=vf[t])==null?void 0:n.background)||"#fafafa"},AS={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},IS={"4XX":"#FFBA81","5XX":"#FF8484"},LS={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},NS="#dad4c7",Sf="#afb7c5",FS=e=>{const t=Object.entries(_f).find(([n])=>new RegExp(n).test(e));return t&&t[1]||_f.standard},cl=(e,t,n,i)=>{let r;return n?r=Sf:Array.isArray(i)?r=ra(e,i):r=i[t],r||ra(e)},sa=e=>{switch(e){case"error":return SS;case"warning":return DS;case"neutral":return pf;default:return pf}},BS={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},zS=2,HS=0,ul=new Map,dl=(e,t)=>{const{i18n:n}=pt.useI18n(),{formatBytes:i}=Br({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):ea.format(e)},kf=e=>{const n=document.createElement("canvas").getContext("2d"),i=It({});return n.font=i.string,n.measureText(e).width},VS=()=>{const e="label_height";if(!ul.has(e)){const t=It({});ul.set(e,t.lineHeight)}return ul.get(e)},WS=e=>e.datasets.reduce((t,n)=>t+n.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),Mf=(e,t)=>t.datasets.reduce((n,i,r)=>e.isDatasetVisible(r)?n+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):n,0),Tf=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,hl="#e0e4ea",YS={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"]},Hr=(e,t)=>{let n=1;const i=YS[e],r=new Map;for(const s of t)r.set(s,i[n]),n=n%(i.length-1)+1;return r.set(-1,i[0]),r},Df=new Map([[100,Hr("100",[100,101,102,103])],[200,Hr("200",[200,201,202,203,204,205,206,207,208,226])],[300,Hr("300",[300,301,302,303,304,305,307,308])],[400,Hr("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,Hr("500",[500,501,502,503,504,505,506,507,508,510,511])]]),fl=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100,i=Df.get(n);return i===void 0?hl:i.get(t)??i.get(-1)??hl},$S=e=>{const t=fl(e);return{solid:t,light:t}},aa={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=fl(`${t}`),e),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function Cf(e,t,n){const i=Sh(),r=qS(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?jS(r,t):US(r,t)}function jS(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function US(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function qS(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function XS(e,t){const n=JS(t);return"formatToParts"in n?KS(n,e):ZS(n,e)}const GS={year:0,month:1,day:2,hour:3,minute:4,second:5};function KS(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=GS[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function ZS(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 ml={},Ef=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")),QS=Ef==="06/25/2014, 00:00:00"||Ef==="06/25/2014 00:00:00";function JS(e){return ml[e]||(ml[e]=QS?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ml[e]}function Of(e,t,n,i,r,s,a){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(i,r,s,a),o}const Pf=36e5,tk=6e4,gl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function pl(e,t,n){if(!e)return 0;let i=gl.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=gl.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Rf(r)?-(r*Pf):NaN;if(i=gl.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Rf(r,a)?(s=Math.abs(r)*Pf+a*tk,i[1]==="+"?-s:s):NaN}if(ik(e)){t=new Date(t||Date.now());const a=n?t:ek(t),o=yl(a,e);return-(n?o:nk(t,o,e))}return NaN}function ek(e){return Of(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function yl(e,t){const n=XS(e,t),i=Of(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function nk(e,t,n){let r=e.getTime()-t;const s=yl(new Date(r),n);if(t===s)return t;r-=s-t;const a=yl(new Date(r),n);return s===a?s:Math.max(s,a)}function Rf(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Af={};function ik(e){if(Af[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Af[e]=!0,!0}catch{return!1}}const rk=60*1e3,sk={X:function(e,t,n){const i=bl(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return If(i);case"XXXX":case"XX":return Oi(i);case"XXXXX":case"XXX":default:return Oi(i,":")}},x:function(e,t,n){const i=bl(n.timeZone,e);switch(t){case"x":return If(i);case"xxxx":case"xx":return Oi(i);case"xxxxx":case"xxx":default:return Oi(i,":")}},O:function(e,t,n){const i=bl(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ak(i,":");case"OOOO":default:return"GMT"+Oi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Cf("short",e,n);case"zzzz":default:return Cf("long",e,n)}}};function bl(e,t){const n=e?pl(e,t,!0)/rk:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function oa(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Oi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=oa(Math.floor(i/60),2),s=oa(Math.floor(i%60),2);return n+r+t+s}function If(e,t){return e%60===0?(e>0?"-":"+")+oa(Math.abs(e)/60,2):Oi(e,t)}function ak(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+oa(s,2)}function Lf(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const ok=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,_l=36e5,Nf=6e4,lk=2,me={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:ok};function Ff(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?lk:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=ck(e),{year:r,restDateString:s}=uk(i.date,n),a=dk(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=hk(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=pl(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Lf(new Date(o+l)),c=Lf(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function ck(e){const t={};let n=me.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=me.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=me.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function uk(e,t){if(e){const n=me.YYY[t],i=me.YYYYY[t];let r=me.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=me.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function dk(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=me.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Hf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=me.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return gk(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=me.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Hf(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=me.Www.exec(e),s)return r=parseInt(s[1],10)-1,Vf(r)?Bf(t,r):new Date(NaN);if(s=me.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Vf(r,a)?Bf(t,r,a):new Date(NaN)}return null}function hk(e){let t,n,i=me.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),xl(t)?t%24*_l:NaN;if(i=me.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),xl(t,n)?t%24*_l+n*Nf:NaN;if(i=me.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return xl(t,n,r)?t%24*_l+n*Nf+r*1e3:NaN}return null}function Bf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const fk=[31,28,31,30,31,30,31,31,30,31,30,31],mk=[31,29,31,30,31,30,31,31,30,31,30,31];function zf(e){return e%400===0||e%4===0&&e%100!==0}function Hf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=zf(e);if(i&&n>mk[t]||!i&&n>fk[t])return!1}return!0}function gk(e,t){if(t<1)return!1;const n=zf(e);return!(n&&t>366||!n&&t>365)}function Vf(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function xl(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const pk=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function wl(e,t,n={}){t=String(t);const i=t.match(pk);if(i){const r=Ff(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const o=s.indexOf(a),l=s[o-1]==="'",c=s.replace(a,"'"+sk[a[0]](r,a,n)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return qs(e,t,n)}function yk(e,t,n){e=Ff(e,n);const i=pl(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Vr(e,t,n,i){return i={...i,timeZone:t,originalDate:e},wl(yk(e,t,{timeZone:i.timeZone}),n,i)}const bk=(e,t)=>`${Vr(e,t,"yyyy")} W${Vr(e,t,"II")}`,vl="yyyy-MM-dd h:mm:ss a",Sl="h:mm:ss a",ii="yyyy-MM-dd h:mm a",Pi="h:mm a",_k="yyyy-MM-dd",kl="MMM dd, yyyy h:mm:ss a",In="MMM dd, yyyy h:mm a",xk={secondly:e=>e?vl:Sl,tenSecondly:e=>e?vl:Sl,thirtySecondly:e=>e?vl:Sl,minutely:e=>e?ii:Pi,fiveMinutely:e=>e?ii:Pi,tenMinutely:e=>e?ii:Pi,thirtyMinutely:e=>e?ii:Pi,hourly:e=>e?ii:Pi,twoHourly:e=>e?ii:Pi,twelveHourly:()=>ii,daily:()=>_k},wk={secondly:()=>kl,tenSecondly:()=>kl,thirtySecondly:()=>kl,minutely:()=>In,fiveMinutely:()=>In,tenMinutely:()=>In,thirtyMinutely:()=>In,hourly:()=>In,twoHourly:()=>In,twelveHourly:()=>In,daily:()=>In};function Wf({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const o=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return bk(e,o);if(r&&r[t]){const l=r[t](i);return Vr(e,o,l)}if(s&&s[t]){const l=s[t]();return Vr(e,o,l)}return Vr(e,o,a)}const vk=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>Wf({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:xk,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Wr=({tickValue:e,granularity:t,timezone:n})=>Wf({tickValue:e,granularity:t,timezone:n,tooltipMap:wk,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Sk=e=>{var n,i,r,s,a;const{i18n:t}=pt.useI18n();return(e==null?void 0:e.status)===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(e==null?void 0:e.status)===408?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(n=e==null?void 0:e.response)==null?void 0:n.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(s=(r=e.response)==null?void 0:r.data)==null?void 0:s.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(e==null?void 0:e.message)}};function kk(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Ce.positioners[n]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=u.width/2,m=al(c,h,f),g=c.y,p=c.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:g-e.tooltipState.offsetY,xAlign:p}},yo.modes.customInteractionMode=function(l,c){const u=En(c,l),h=[];return yo.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,g)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),l.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const r=e.numLabels.value>25?mf:gf,s=({chart:l,index:c})=>{var h;const u=l.data;return{size:r,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[c]?"italic":"normal"}},a=(l,c,u)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(u),c&&c.length>ia?c.slice(0,ia)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,g,p;return{indexAxis:e.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:e.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(x,S){return a(this,x,S)}},title:{display:e.indexAxis==="y"?!st((l=e.metricAxesTitle)==null?void 0:l.value):!st((c=e.dimensionAxesTitle)==null?void 0:c.value),text:e.indexAxis==="y"?(u=e.metricAxesTitle)==null?void 0:u.value:(h=e.dimensionAxesTitle)==null?void 0:h.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:e.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:s,callback:function(x,S){return a(this,x,S)}},title:{display:e.indexAxis==="x"?!st((f=e.metricAxesTitle)==null?void 0:f.value):!st((m=e.dimensionAxesTitle)==null?void 0:m.value),text:e.indexAxis==="x"?(g=e.metricAxesTitle)==null?void 0:g.value:(p=e.dimensionAxesTitle)==null?void 0:p.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:x=>{hf(e.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return d.getCurrentInstance()&&d.onUnmounted(()=>{Ce.positioners[n]&&delete Ce.positioners[n]}),o}_e.register(...E_);const Mk=(e,t)=>{const n=t.datasets.map(r=>r.label),i=e.datasets.map(r=>r.label);return e.datasets.length===t.datasets.length&&n.every((r,s)=>r===i[s])};function Tk(e,t,n,i,r){const s=d.shallowRef(null),a=(o,l)=>{if(t.value)return new _e(t.value,{type:e,data:o,plugins:i,options:l})};return d.onMounted(()=>{s.value=a(n.value,r.value)}),d.onBeforeUnmount(()=>{st(s.value)||s.value.destroy()}),d.watch(n,(o,l)=>{if(Mk(l,o)&&!st(s.value)){for(const[c,u]of o.datasets.entries())Object.assign(s.value.data.datasets[c],u);s.value.data.labels=o.labels,s.value.update()}else st(s.value)||s.value.destroy(),s.value=a(o,r.value)}),d.watch(t,()=>{st(s.value)||s.value.destroy(),s.value=a(n.value,r.value)}),d.watch(r,(o,l)=>{(o.indexAxis!==l.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(st(s.value)||s.value.destroy(),s.value=a(n.value,o))}),s}var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ml(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yf={exports:{}};(function(e){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?r:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(n(c,1,u),u):c<s?h=n(c,i,u)+"k":c<a?h=n(c,s,u)+"m":c<o?h=t(n(c,a,u),u)+"b":h=t(n(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,e.exports=l})()})(Yf);var Dk=Yf.exports;const Yr=Ml(Dk);function Ck(e,t,n){const{i18n:i}=pt.useI18n(),{formatBytes:r}=Br({i18n:i}),{translateUnit:s}=pt.useTranslatedUnits();return{legendValues:d.computed(()=>e.value.datasets.reduce((o,l)=>{const c=l.total?l.total:l.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(n.value==="bytes")u=r(c);else{const h=s(n.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Yr(c,{capital:!0}),unit:h})||`${Yr(c,{capital:!0})} ${n.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function Ek(e){return d.computed(()=>{var r;if(!((r=e.value)!=null&&r.meta))return"";const n=e.value.meta.start_ms,i=e.value.meta.end_ms;return n&&i?`${nl(n)} - ${nl(i,{includeTZ:!0})}`:""})}function Ok(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ce.positioners[n]=function(s,a){if(!s.length)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=e.tooltipState.width||this.width,c=o.width/2,u=al(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:u-e.tooltipState.offsetX,y:h,xAlign:f}};const r=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:s=>{hf(e.tooltipState,s)}}}}));return d.onUnmounted(()=>{Ce.positioners[n]&&delete Ce.positioners[n]}),{options:r}}function Pk(e){const t=d.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,callback:u=>{const h=new Date(u);return vk({tickValue:h,granularity:e.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!st((l=e.dimensionAxesTitle)==null?void 0:l.value),text:(c=e.dimensionAxesTitle)==null?void 0:c.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value}}),n=d.computed(()=>{var l,c;return{title:{display:!st((l=e.metricAxesTitle)==null?void 0:l.value),text:(c=e.metricAxesTitle)==null?void 0:c.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),r=`lineChartTooltipPosition-${e.tooltipState.chartID}`,s={enabled:!1,position:r};Ce.positioners[r]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=e.tooltipState.height||this.height,m=u.width/2,g=u.height/2,p=al(c,h,m);let x=wS(c,f,g);const S=c.y<g?"top":"bottom",v=c.x<m?"left":"center";return f>u.height&&(x=0),{x:p,y:x,xAlign:v,yAlign:S}};const a=d.computed(()=>{const l=Number(e.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return qw(l)>24||u.getDate()!==c.getDate()}),o=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=e.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:n.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{df(e.tooltipState,u,e.granularity.value)}},thresholdPlugin:{threshold:(c=e.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1}}});return d.onUnmounted(()=>{Ce.positioners[r]&&delete Ce.positioners[r]}),{options:o}}function Rk(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:o}=e,{i18n:l}=pt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:ra(i.indexOf(u),un),data:a.map((h,f)=>n?s[`${h.id},${u}`]||0:s[`${f},${u}`]||null)})):Array.from(r).flatMap((u,h)=>{if(!u)return[];const f=cl(h,u.name,u.id==="empty",o);return{label:l&&l.te(`chartLabels.${u.name}`)&&l.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>s[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function Ak(e,t){const{i18n:n}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,o=s&&Object.keys(s),l=a&&a.length>1,c=s&&o&&o.length>0,u=c&&o.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(l?r.flatMap(_=>a.map((T,O)=>{const A=_.event[f],I=c?`${A},${T}`:`${O},${T}`,B=_.event[T];return[I,B]})):r.map(_=>{const T=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,O=_.event[a[0]];return[T,O]})),p=Object.keys(g).reduce((_,T)=>{const[O]=T.split(","),A=g[T];return _[O]?_[O]+=A:_[O]=A,_},{}),x=Object.entries(p).sort(([,_],[,T])=>Number(T)-Number(_)).map(([_])=>_),S=s[f],v=s[m];let k=c&&S&&Object.entries(S).map(([_,T])=>({id:_,name:T.name}))||a.map(_=>({id:_,name:_})),D=c&&v&&Object.entries(v).map(([_,T])=>({id:_,name:T.name}))||a.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(k=k.map(_=>({..._,name:rl(_.id)||_.name}))),c&&m==="country_code"&&(D=D.map(_=>({..._,name:rl(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(k.sort((_,T)=>x.indexOf(_.id)-x.indexOf(T.id)),D.sort((_,T)=>x.indexOf(_.id)-x.indexOf(T.id))),!k||!D)return{labels:[],datasets:[]};const M=Rk({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:D,pivotRecords:g,rowLabels:k,colorPalette:e.colorPalette||un}),P=c?k.map(_=>n&&n.te(`chartLabels.${_.name}`)&&n.t(`chartLabels.${_.name}`)||_.name):a.map(_=>n&&n.te(`chartLabels.${_}`)&&n.t(`chartLabels.${_}`)||_),E=k.map(_=>_.id==="empty");return{labels:P,datasets:M,isLabelEmpty:E,isMultiDimension:u}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Ik=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),Lk=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Ch(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},Nk=(e,t,n,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((e-i)/n)*n+i,l=Math.floor((a-i)/n)*n+i+n;return Ik(o,l,n)};function Fk(e,t){const{i18n:n}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start_ms:o,end_ms:l}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const c=s&&Object.keys(s)||a,u=c&&c[0],h=s[u];let f=s&&h&&Object.keys(h).map(D=>({id:D,name:h[D].name}))||a.map(D=>({id:D,name:D}));u==="country_code"&&(f=f.map(D=>({...D,name:rl(D.id)||D.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const g=Lk(o),p=Nk(o,l,m,g,r),x=new Set,S=r!=null&&r.length?r.reduce((D,M)=>{const P=new Date(M.timestamp).valueOf(),E=M.event;for(const y of a)x.add(y),P in D||(D[P]={}),y in D[P]||(D[P][y]={});for(const y of a)f.forEach(_=>{E[u]===_.id||y===_.id?(D[P][y]||(D[P][y]={}),D[P][y][_.name]=Math.round(Number(E[y])*1e3)/1e3):c.length||(D[P][y]||(D[P][y]={}),D[P][y][_.name]=Math.round(Number(E[_.id])*1e3)/1e3)});return D},{}):{},k=[...a.length===1?a.flatMap(D=>f.map(M=>[D,M.name,M.id==="empty"])):f.map(D=>[D.name,D.name,D.id==="empty"])].map(([D,M,P],E)=>{const y=p.map(A=>A in S&&D in S[A]?{x:A,y:S[A][D][M]||0}:{x:A,y:0});let{colorPalette:_,fill:T}=e;st(_)&&(_=un);const O=cl(E,M,P,_);return{rawDimension:M,rawMetric:D,label:n&&n.te(`chartLabels.${M}`)&&n.t(`chartLabels.${M}`)||M,borderColor:O,backgroundColor:O,data:y,total:y.reduce((A,{y:I})=>A+Number(I),0),...BS,fill:T,borderWidth:T?HS:zS,isSegmentEmpty:P}});return u==="status_code"||u==="status_code_grouped"?k.sort((D,M)=>(D.label??"")<(M.label??"")?-1:1):k.sort((D,M)=>Number(D.total)<Number(M.total)?-1:1),{datasets:k}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const Bk=(e,t)=>{d.watch([e,t],(n,i,r)=>{const[s,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function zk(){const{i18n:e}=pt.useI18n();return{translateUnit:(n,i)=>{const r=i===1,s=`chartUnits.${n}`;return n==="usd"?"":e.te(s)?e.t(s,{plural:r?"":"s"}):n}}}const Hk="analytics-query-provider",$f=2;function Vk(){const e=d.inject(Hk);return{evaluateFeatureFlag:(n,i)=>e?e.evaluateFeatureFlagFn(n,i):i}}function Tl(e){return d.getCurrentScope()?(d.onScopeDispose(e),!0):!1}const jf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Wk=e=>e!=null,Yk=Object.prototype.toString,$k=e=>Yk.call(e)==="[object Object]";function la(e){return Array.isArray(e)?e:[e]}function jk(e){return d.getCurrentInstance()}function Uk(e,t={}){if(!d.isRef(e))return d.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=d.customRef(()=>({get(){return e.value[i]},set(r){var s;if((s=d.toValue(t.replaceRef))!=null?s:!0)if(Array.isArray(e.value)){const o=[...e.value];o[i]=r,e.value=o}else{const o={...e.value,[i]:r};Object.setPrototypeOf(o,Object.getPrototypeOf(e.value)),e.value=o}else e.value[i]=r}}));return n}function qk(e,t=!0,n){jk()?d.onMounted(e,n):t?e():d.nextTick(e)}function Xk(e,t,n){return d.watch(e,t,{...n,immediate:!0})}const ca=jf?window:void 0;function Ri(e){var t;const n=d.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function $r(...e){const t=[],n=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),r=d.computed(()=>{const o=la(d.toValue(e[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),s=Xk(()=>{var o,l;return[(l=(o=r.value)==null?void 0:o.map(c=>Ri(c)))!=null?l:[ca].filter(c=>c!=null),la(d.toValue(r.value?e[1]:e[0])),la(d.unref(r.value?e[2]:e[1])),d.toValue(r.value?e[3]:e[2])]},([o,l,c,u])=>{if(n(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=$k(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{s(),n()};return Tl(n),a}function Gk(){const e=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{e.value=!0},t),e}function Uf(e){const t=Gk();return d.computed(()=>(t.value,!!e()))}function Kk(e,t,n={}){const{window:i=ca,...r}=n;let s;const a=Uf(()=>i&&"MutationObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},l=d.computed(()=>{const f=d.toValue(e),m=la(f).map(Ri).filter(Wk);return new Set(m)}),c=d.watch(()=>l.value,f=>{o(),a.value&&f.size&&(s=new MutationObserver(t),f.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),u=()=>s==null?void 0:s.takeRecords(),h=()=>{c(),o()};return Tl(h),{isSupported:a,stop:h,takeRecords:u}}function Zk(e,t={}){var n;const{pointerTypes:i,preventDefault:r,stopPropagation:s,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=ca,containerElement:m,handle:g=e,buttons:p=[0]}=t,x=d.ref((n=d.toValue(u))!=null?n:{x:0,y:0}),S=d.ref(),v=E=>i?i.includes(E.pointerType):!0,k=E=>{d.toValue(r)&&E.preventDefault(),d.toValue(s)&&E.stopPropagation()},D=E=>{var y;if(!d.toValue(p).includes(E.button)||d.toValue(t.disabled)||!v(E)||d.toValue(a)&&E.target!==d.toValue(e))return;const _=d.toValue(m),T=(y=_==null?void 0:_.getBoundingClientRect)==null?void 0:y.call(_),O=d.toValue(e).getBoundingClientRect(),A={x:E.clientX-(_?O.left-T.left+_.scrollLeft:O.left),y:E.clientY-(_?O.top-T.top+_.scrollTop:O.top)};(c==null?void 0:c(A,E))!==!1&&(S.value=A,k(E))},M=E=>{if(d.toValue(t.disabled)||!v(E)||!S.value)return;const y=d.toValue(m),_=d.toValue(e).getBoundingClientRect();let{x:T,y:O}=x.value;(h==="x"||h==="both")&&(T=E.clientX-S.value.x,y&&(T=Math.min(Math.max(0,T),y.scrollWidth-_.width))),(h==="y"||h==="both")&&(O=E.clientY-S.value.y,y&&(O=Math.min(Math.max(0,O),y.scrollHeight-_.height))),x.value={x:T,y:O},o==null||o(x.value,E),k(E)},P=E=>{d.toValue(t.disabled)||!v(E)||S.value&&(S.value=void 0,l==null||l(x.value,E),k(E))};if(jf){const E=()=>{var y;return{capture:(y=t.capture)!=null?y:!0,passive:!d.toValue(r)}};$r(g,"pointerdown",D,E),$r(f,"pointermove",M,E),$r(f,"pointerup",P,E)}return{...Uk(x),position:x,isDragging:d.computed(()=>!!S.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function Qk(e,t,n={}){const{window:i=ca,...r}=n;let s;const a=Uf(()=>i&&"ResizeObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},l=d.computed(()=>{const h=d.toValue(e);return Array.isArray(h)?h.map(f=>Ri(f)):[Ri(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){s=new ResizeObserver(t);for(const f of h)f&&s.observe(f,r)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return Tl(u),{isSupported:a,stop:u}}function Jk(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,o=d.shallowRef(0),l=d.shallowRef(0),c=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function p(){const S=Ri(e);if(!S){n&&(o.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const v=S.getBoundingClientRect();o.value=v.height,l.value=v.bottom,c.value=v.left,u.value=v.right,h.value=v.top,f.value=v.width,m.value=v.x,g.value=v.y}function x(){a==="sync"?p():a==="next-frame"&&requestAnimationFrame(()=>p())}return Qk(e,x),d.watch(()=>Ri(e),S=>!S&&x()),Kk(e,x,{attributeFilter:["style","class"]}),r&&$r("scroll",x,{capture:!0,passive:!0}),i&&$r("resize",x,{passive:!0}),qk(()=>{s&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:g,update:x}}function tM(e,t){const{top:n,left:i}=Jk(e),r=d.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),s=d.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const eM=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const r=[...i].filter(l=>l>=t&&l<=n).sort((l,c)=>l-c),s=[];if(n-t<e-2)return[];const a=(n-t)/e;let o=0;for(let l=0;l<e;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<r.length&&r[o]>=c&&r[o]<=u;)h++,o++;s.push([Math.ceil(c),h])}return s},qf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),jr=d.ref({}),nM=e=>(jr.value[e]||(jr.value[e]=qf()),jr.value[e]),iM=(e,t)=>{const n=jr.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete jr.value[t])};function rM({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=n!==void 0&&e!==void 0?nM(n):qf(),h=e!==void 0?e:"static-chart-key",f=d.computed(()=>t.reduce((T,{timestamps:O})=>[...T,...O],[])),m=d.computed(()=>i||f.value.reduce((T,O)=>T===0?O:Math.min(T,O),0)),g=d.computed(()=>r||f.value.reduce((T,O)=>Math.max(T,O),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const p=d.computed(()=>Object.values(u.minStamps).reduce((T,O)=>T===0?O:Math.min(T,O),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((T,O)=>Math.max(T,O),0)),S=d.computed(()=>{const T=Object.values(u.renderPoints);return T.length===0?24:T.reduce((O,A)=>Math.max(O,A),2)}),v=d.computed(()=>{const T=x.value-p.value;return Math.ceil(T/S.value)}),k=d.computed(()=>t.length>1),D=d.computed(()=>t.map(({timestamps:T,color:O,label:A})=>({data:eM({bucketCount:S.value,minStamp:p.value,maxStamp:x.value,timestamps:T}).map(([q,G])=>({x:q,y:G})),label:A,...(l==="sparkline_bar"||k.value)&&O&&{backgroundColor:O},...l!=="sparkline_bar"&&O&&{borderColor:O},...k.value&&l!=="sparkline_bar"&&{fill:!0}}))),M=d.computed(()=>{var A,I;const T=((I=(A=D.value[0])==null?void 0:A.data)==null?void 0:I.length)??0,O=[];for(let B=0;B<T;B++){let q=0;for(let G=0;G<D.value.length;G++)q+=D.value[G].data[B].y;O.push(q)}return O}),P=d.computed(()=>{const T=M.value.reduce((O,A)=>Math.max(O,A),0);return Math.max(T,a??0)}),E=d.computed(()=>{const T=D.value.reduce((I,{data:B})=>[...I,...B.map(({y:q})=>q)],[]),O=T.length?T[0]:0,A=T.reduce((I,B)=>Math.min(I,B),O);return s===void 0?A:Math.min(A,s)});d.watchEffect(()=>{u.maxCounts[h]=P.value,u.minCounts[h]=E.value});const y=d.computed(()=>{const T=Object.values(u.minCounts),O=T.length?T[0]:0;return T.reduce((A,I)=>Math.min(A,I),O)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((T,O)=>Math.max(T,O),0));return d.onUnmounted(()=>{e!==void 0&&n!==void 0&&iM(e,n)}),{syncedMinStamp:p,syncedMaxStamp:x,syncedRenderPoints:S,syncedChartDatasets:D,syncedGroupSizeMs:v,syncedMinCount:y,syncedMaxCount:_}}const pt={useBarChartOptions:kk,useChartJSCommon:Tk,useChartLegendValues:Ck,useChartSelectedRange:Ek,useExploreResultToDatasets:Ak,useExploreResultToTimeDataset:Fk,useDonutChartOptions:Ok,useLineChartOptions:Pk,useI18n:Mg,useReportChartDataForSynthetics:Bk,useTranslatedUnits:zk,useEvaluateFeatureFlag:Vk,useTooltipAbsolutePosition:tM,useSparklineSync:rM};var Nt=(e=>(e.Hidden="hidden",e.Right="right",e.Bottom="bottom",e))(Nt||{});/*!
|
|
18
|
+
`):e}function Q0(e,t){const{element:n,datasetIndex:i,index:r}=t,s=e.getDatasetMeta(i).controller,{label:a,value:o}=s.getLabelAndValue(r);return{chart:e,label:a,parsed:s.getParsed(r),raw:e.data.datasets[i].data[r],formattedValue:o,dataset:s.getDataset(),dataIndex:r,datasetIndex:i,element:n}}function Hd(e,t){const n=e.chart.ctx,{body:i,footer:r,title:s}=e,{boxWidth:a,boxHeight:o}=t,c=It(t.bodyFont),l=It(t.titleFont),u=It(t.footerFont),h=s.length,f=r.length,m=i.length,g=Ut(t.padding);let p=g.height,x=0,S=i.reduce((D,M)=>D+M.before.length+M.lines.length+M.after.length,0);if(S+=e.beforeBody.length+e.afterBody.length,h&&(p+=h*l.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),S){const D=t.displayColors?Math.max(o,c.lineHeight):c.lineHeight;p+=m*D+(S-m)*c.lineHeight+(S-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0;const k=function(D){x=Math.max(x,n.measureText(D).width+v)};return n.save(),n.font=l.string,Tt(e.title,k),n.font=c.string,Tt(e.beforeBody.concat(e.afterBody),k),v=t.displayColors?a+2+t.boxPadding:0,Tt(i,D=>{Tt(D.before,k),Tt(D.lines,k),Tt(D.after,k)}),v=0,n.font=u.string,Tt(e.footer,k),n.restore(),x+=g.width,{width:x,height:p}}function J0(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function t_(e,t,n,i){const{x:r,width:s}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&r+s+a>t.width||e==="right"&&r-s-a<0)return!0}function e_(e,t,n,i){const{x:r,width:s}=n,{width:a,chartArea:{left:o,right:c}}=e;let l="center";return i==="center"?l=r<=(o+c)/2?"left":"right":r<=s/2?l="left":r>=a-s/2&&(l="right"),t_(l,e,t,n)&&(l="center"),l}function Vd(e,t,n){const i=n.yAlign||t.yAlign||J0(e,n);return{xAlign:n.xAlign||t.xAlign||e_(e,t,n,i),yAlign:i}}function n_(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function i_(e,t,n){let{y:i,height:r}=e;return t==="top"?i+=n:t==="bottom"?i-=r+n:i-=r/2,i}function Wd(e,t,n,i){const{caretSize:r,caretPadding:s,cornerRadius:a}=e,{xAlign:o,yAlign:c}=n,l=r+s,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=Dn(a);let g=n_(t,o);const p=i_(t,c,l);return c==="center"?o==="left"?g+=l:o==="right"&&(g-=l):o==="left"?g-=Math.max(u,f)+r:o==="right"&&(g+=Math.max(h,m)+r),{x:Qt(g,0,i.width-t.width),y:Qt(p,0,i.height-t.height)}}function Vs(e,t,n){const i=Ut(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Yd(e){return je([],on(e))}function r_(e,t,n){return Cn(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function $d(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const jd={beforeTitle:tn,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.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 n[t.dataIndex]}return""},afterTitle:tn,beforeBody:tn,beforeLabel:tn,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return st(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:tn,afterBody:tn,beforeFooter:tn,footer:tn,afterFooter:tn};function xe(e,t,n,i){const r=e[t].call(n,i);return typeof r>"u"?jd[t].call(n,i):r}class Eo 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 n=this.chart,i=this.options.setContext(this.getContext()),r=i.enabled&&n.options.animation&&i.animations,s=new oo(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=r_(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,r=xe(i,"beforeTitle",this,t),s=xe(i,"title",this,t),a=xe(i,"afterTitle",this,t);let o=[];return o=je(o,on(r)),o=je(o,on(s)),o=je(o,on(a)),o}getBeforeBody(t,n){return Yd(xe(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,r=[];return Tt(t,s=>{const a={before:[],lines:[],after:[]},o=$d(i,s);je(a.before,on(xe(o,"beforeLabel",this,s))),je(a.lines,xe(o,"label",this,s)),je(a.after,on(xe(o,"afterLabel",this,s))),r.push(a)}),r}getAfterBody(t,n){return Yd(xe(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,r=xe(i,"beforeFooter",this,t),s=xe(i,"footer",this,t),a=xe(i,"afterFooter",this,t);let o=[];return o=je(o,on(r)),o=je(o,on(s)),o=je(o,on(a)),o}_createItems(t){const n=this._active,i=this.chart.data,r=[],s=[],a=[];let o=[],c,l;for(c=0,l=n.length;c<l;++c)o.push(Q0(this.chart,n[c]));return t.filter&&(o=o.filter((u,h,f)=>t.filter(u,h,f,i))),t.itemSort&&(o=o.sort((u,h)=>t.itemSort(u,h,i))),Tt(o,u=>{const h=$d(t.callbacks,u);r.push(xe(h,"labelColor",this,u)),s.push(xe(h,"labelPointStyle",this,u)),a.push(xe(h,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=a,this.dataPoints=o,o}update(t,n){const i=this.options.setContext(this.getContext()),r=this._active;let s,a=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const o=vr[i.position].call(this,r,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const c=this._size=Hd(this,i),l=Object.assign({},o,c),u=Vd(this.chart,i,l),h=Wd(i,l,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:o.x,caretY:o.y}}this._tooltipItems=a,this.$context=void 0,s&&this._resolveAnimations().update(this,s),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,r){const s=this.getCaretPosition(t,i,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(t,n,i){const{xAlign:r,yAlign:s}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:c,topRight:l,bottomLeft:u,bottomRight:h}=Dn(o),{x:f,y:m}=t,{width:g,height:p}=n;let x,S,v,k,D,M;return s==="center"?(D=m+p/2,r==="left"?(x=f,S=x-a,k=D+a,M=D-a):(x=f+g,S=x+a,k=D-a,M=D+a),v=x):(r==="left"?S=f+Math.max(c,u)+a:r==="right"?S=f+g-Math.max(l,h)-a:S=this.caretX,s==="top"?(k=m,D=k-a,x=S-a,v=S+a):(k=m+p,D=k+a,x=S+a,v=S-a),M=k),{x1:x,x2:S,x3:v,y1:k,y2:D,y3:M}}drawTitle(t,n,i){const r=this.title,s=r.length;let a,o,c;if(s){const l=vi(i.rtl,this.x,this.width);for(t.x=Vs(this,i.titleAlign,i),n.textAlign=l.textAlign(i.titleAlign),n.textBaseline="middle",a=It(i.titleFont),o=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,c=0;c<s;++c)n.fillText(r[c],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,c+1===s&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,n,i,r,s){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:c,boxWidth:l}=s,u=It(s.bodyFont),h=Vs(this,"left",s),f=r.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=n.y+m;if(s.usePointStyle){const p={radius:Math.min(l,c)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=r.leftForLtr(f,l)+l/2,S=g+c/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,to(t,p,x,S),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,to(t,p,x,S)}else{t.lineWidth=ft(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const p=r.leftForLtr(f,l),x=r.leftForLtr(r.xPlus(f,1),l-2),S=Dn(a.borderRadius);Object.values(S).some(v=>v!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,_i(t,{x:p,y:g,w:l,h:c,radius:S}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),_i(t,{x,y:g+1,w:l-2,h:c-2,radius:S}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(p,g,l,c),t.strokeRect(p,g,l,c),t.fillStyle=a.backgroundColor,t.fillRect(x,g+1,l-2,c-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:r}=this,{bodySpacing:s,bodyAlign:a,displayColors:o,boxHeight:c,boxWidth:l,boxPadding:u}=i,h=It(i.bodyFont);let f=h.lineHeight,m=0;const g=vi(i.rtl,this.x,this.width),p=function(y){n.fillText(y,g.x(t.x+m),t.y+f/2),t.y+=f+s},x=g.textAlign(a);let S,v,k,D,M,P,E;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,t.x=Vs(this,x,i),n.fillStyle=i.bodyColor,Tt(this.beforeBody,p),m=o&&x!=="right"?a==="center"?l/2+u:l+2+u:0,D=0,P=r.length;D<P;++D){for(S=r[D],v=this.labelTextColors[D],n.fillStyle=v,Tt(S.before,p),k=S.lines,o&&k.length&&(this._drawColorBox(n,t,D,g,i),f=Math.max(h.lineHeight,c)),M=0,E=k.length;M<E;++M)p(k[M]),f=h.lineHeight;Tt(S.after,p)}m=0,f=h.lineHeight,Tt(this.afterBody,p),t.y-=s}drawFooter(t,n,i){const r=this.footer,s=r.length;let a,o;if(s){const c=vi(i.rtl,this.x,this.width);for(t.x=Vs(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=c.textAlign(i.footerAlign),n.textBaseline="middle",a=It(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,o=0;o<s;++o)n.fillText(r[o],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,r){const{xAlign:s,yAlign:a}=this,{x:o,y:c}=t,{width:l,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:g}=Dn(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(o+h,c),a==="top"&&this.drawCaret(t,n,i,r),n.lineTo(o+l-f,c),n.quadraticCurveTo(o+l,c,o+l,c+f),a==="center"&&s==="right"&&this.drawCaret(t,n,i,r),n.lineTo(o+l,c+u-g),n.quadraticCurveTo(o+l,c+u,o+l-g,c+u),a==="bottom"&&this.drawCaret(t,n,i,r),n.lineTo(o+m,c+u),n.quadraticCurveTo(o,c+u,o,c+u-m),a==="center"&&s==="left"&&this.drawCaret(t,n,i,r),n.lineTo(o,c+h),n.quadraticCurveTo(o,c,o+h,c),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,r=i&&i.x,s=i&&i.y;if(r||s){const a=vr[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Hd(this,t),c=Object.assign({},a,this._size),l=Vd(n,t,c),u=Wd(t,c,l,n);(r._to!==u.x||s._to!==u.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=o.width,this.height=o.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=Ut(n.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(s,t,r,n),Mu(t,n.textDirection),s.y+=a.top,this.drawTitle(s,t,n),this.drawBody(s,t,n),this.drawFooter(s,t,n),Tu(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,r=t.map(({datasetIndex:o,index:c})=>{const l=this.chart.getDatasetMeta(o);if(!l)throw new Error("Cannot find a dataset at index "+o);return{datasetIndex:o,element:l.data[c],index:c}}),s=!hs(i,r),a=this._positionChanged(r,n);(s||a)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],a=this._getActiveElements(t,s,n,i),o=this._positionChanged(a,t),c=n||!hs(a,s)||o;return c&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),c}_getActiveElements(t,n,i,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)return n.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,s.mode,s,i);return s.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:r,options:s}=this,a=vr[s.position].call(this,t,n);return a!==!1&&(i!==a.x||r!==a.y)}}R(Eo,"positioners",vr);var Ce={id:"tooltip",_element:Eo,positioners:vr,afterInit(e,t,n){n&&(e.tooltip=new Eo({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:jd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},s_=Object.freeze({__proto__:null,Colors:b0,Decimation:v0,Filler:W0,Legend:X0,SubTitle:Z0,Title:K0,Tooltip:Ce});const a_=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function o_(e,t,n,i){const r=e.indexOf(t);if(r===-1)return a_(e,t,n,i);const s=e.lastIndexOf(t);return r!==s?n:r}const l_=(e,t)=>e===null?null:Qt(Math.round(e),0,t);function Ud(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Oo extends Zn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:r,label:s}of n)i[r]===s&&i.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(st(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:o_(i,t,at(n,t),this._addedLabels),l_(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(r=this.getLabels().length-1)),this.min=i,this.max=r}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,r=[];let s=this.getLabels();s=t===0&&n===s.length-1?s:s.slice(t,n+1),this._valueRange=Math.max(s.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)r.push({value:a});return r}getLabelForValue(t){return Ud.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 n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}R(Oo,"id","category"),R(Oo,"defaults",{ticks:{callback:Ud}});function c_(e,t){const n=[],{bounds:r,step:s,min:a,max:o,precision:c,count:l,maxTicks:u,maxDigits:h,includeBounds:f}=e,m=s||1,g=u-1,{min:p,max:x}=t,S=!st(a),v=!st(o),k=!st(l),D=(x-p)/(h+1);let M=Zc((x-p)/g/m)*m,P,E,y,_;if(M<1e-14&&!S&&!v)return[{value:p},{value:x}];_=Math.ceil(x/M)-Math.floor(p/M),_>g&&(M=Zc(_*M/g/m)*m),st(c)||(P=Math.pow(10,c),M=Math.ceil(M*P)/P),r==="ticks"?(E=Math.floor(p/M)*M,y=Math.ceil(x/M)*M):(E=p,y=x),S&&v&&s&&rp((o-a)/s,M/1e3)?(_=Math.round(Math.min((o-a)/M,u)),M=(o-a)/_,E=a,y=o):k?(E=S?a:E,y=v?o:y,_=l-1,M=(y-E)/_):(_=(y-E)/M,nr(_,Math.round(_),M/1e3)?_=Math.round(_):_=Math.ceil(_));const T=Math.max(Jc(M),Jc(E));P=Math.pow(10,st(c)?T:c),E=Math.round(E*P)/P,y=Math.round(y*P)/P;let O=0;for(S&&(f&&E!==a?(n.push({value:a}),E<a&&O++,nr(Math.round((E+O*M)*P)/P,a,qd(a,D,e))&&O++):E<a&&O++);O<_;++O){const A=Math.round((E+O*M)*P)/P;if(v&&A>o)break;n.push({value:A})}return v&&f&&y!==o?n.length&&nr(n[n.length-1].value,o,qd(o,D,e))?n[n.length-1].value=o:n.push({value:o}):(!v||y===o)&&n.push({value:y}),n}function qd(e,t,{horizontal:n,minRotation:i}){const r=jt(i),s=(n?Math.sin(r):Math.cos(r))||.001,a=.75*t*(""+e).length;return Math.min(t/s,a)}class Ws extends Zn{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,n){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:r,max:s}=this;const a=c=>r=n?r:c,o=c=>s=i?s:c;if(t){const c=Ye(r),l=Ye(s);c<0&&l<0?o(0):c>0&&l>0&&a(0)}if(r===s){let c=s===0?1:Math.abs(s*.05);o(s+c),t||a(r-c)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:i}=t,r;return i?(r=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const r={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,a=c_(r,s);return t.bounds==="ticks"&&Qc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const r=(i-n)/Math.max(t.length-1,1)/2;n-=r,i+=r}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return sr(t,this.chart.options.locale,this.options.ticks.format)}}class Po extends Ws{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=jt(this.options.ticks.minRotation),r=(t?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}R(Po,"id","linear"),R(Po,"defaults",{ticks:{callback:_s.formatters.numeric}});const Sr=e=>Math.floor(Mn(e)),Qn=(e,t)=>Math.pow(10,Sr(e)+t);function Xd(e){return e/Math.pow(10,Sr(e))===1}function Gd(e,t,n){const i=Math.pow(10,n),r=Math.floor(e/i);return Math.ceil(t/i)-r}function u_(e,t){const n=t-e;let i=Sr(n);for(;Gd(e,t,i)>10;)i++;for(;Gd(e,t,i)<10;)i--;return Math.min(i,Sr(e))}function d_(e,{min:t,max:n}){t=De(e.min,t);const i=[],r=Sr(t);let s=u_(t,n),a=s<0?Math.pow(10,Math.abs(s)):1;const o=Math.pow(10,s),c=r>s?Math.pow(10,r):0,l=Math.round((t-c)*a)/a,u=Math.floor((t-c)/o/10)*o*10;let h=Math.floor((l-u)/Math.pow(10,s)),f=De(e.min,Math.round((c+u+h*Math.pow(10,s))*a)/a);for(;f<n;)i.push({value:f,major:Xd(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(s++,h=2,a=s>=0?1:a),f=Math.round((c+u+h*Math.pow(10,s))*a)/a;const m=De(e.max,f);return i.push({value:m,major:Xd(m),significand:h}),i}class Ro extends Zn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=Ws.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Qn(this.min,0)?Qn(this.min,-1):Qn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,r=this.max;const s=o=>i=t?i:o,a=o=>r=n?r:o;i===r&&(i<=0?(s(1),a(10)):(s(Qn(i,-1)),a(Qn(r,1)))),i<=0&&s(Qn(r,-1)),r<=0&&a(Qn(i,1)),this.min=i,this.max=r}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=d_(n,this);return t.bounds==="ticks"&&Qc(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":sr(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Mn(t),this._valueRange=Mn(this.max)-Mn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Mn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}R(Ro,"id","logarithmic"),R(Ro,"defaults",{ticks:{callback:_s.formatters.logarithmic,major:{enabled:!0}}});function Ao(e){const t=e.ticks;if(t.display&&e.display){const n=Ut(t.backdropPadding);return at(t.font&&t.font.size,Rt.font.size)+n.height}return 0}function h_(e,t,n){return n=kt(n)?n:[n],{w:wp(e,t.string,n),h:n.length*t.lineHeight}}function Kd(e,t,n,i,r){return e===i||e===r?{start:t-n/2,end:t+n/2}:e<i||e>r?{start:t-n,end:t}:{start:t,end:t+n}}function f_(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],r=[],s=e._pointLabels.length,a=e.options.pointLabels,o=a.centerPointLabels?dt/s:0;for(let c=0;c<s;c++){const l=a.setContext(e.getPointLabelContext(c));r[c]=l.padding;const u=e.getPointPosition(c,e.drawingArea+r[c],o),h=It(l.font),f=h_(e.ctx,h,e._pointLabels[c]);i[c]=f;const m=se(e.getIndexAngle(c)+o),g=Math.round(ps(m)),p=Kd(g,u.x,f.w,0,180),x=Kd(g,u.y,f.h,90,270);m_(n,t,m,p,x)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=y_(e,i,r)}function m_(e,t,n,i,r){const s=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let o=0,c=0;i.start<t.l?(o=(t.l-i.start)/s,e.l=Math.min(e.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/s,e.r=Math.max(e.r,t.r+o)),r.start<t.t?(c=(t.t-r.start)/a,e.t=Math.min(e.t,t.t-c)):r.end>t.b&&(c=(r.end-t.b)/a,e.b=Math.max(e.b,t.b+c))}function g_(e,t,n){const i=e.drawingArea,{extra:r,additionalAngle:s,padding:a,size:o}=n,c=e.getPointPosition(t,i+r+a,s),l=Math.round(ps(se(c.angle+Pt))),u=x_(c.y,o.h,l),h=b_(l),f=__(c.x,o.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+o.w,bottom:u+o.h}}function p_(e,t){if(!t)return!0;const{left:n,top:i,right:r,bottom:s}=e;return!(rn({x:n,y:i},t)||rn({x:n,y:s},t)||rn({x:r,y:i},t)||rn({x:r,y:s},t))}function y_(e,t,n){const i=[],r=e._pointLabels.length,s=e.options,{centerPointLabels:a,display:o}=s.pointLabels,c={extra:Ao(s)/2,additionalAngle:a?dt/r:0};let l;for(let u=0;u<r;u++){c.padding=n[u],c.size=t[u];const h=g_(e,u,c);i.push(h),o==="auto"&&(h.visible=p_(h,l),h.visible&&(l=h))}return i}function b_(e){return e===0||e===180?"center":e<180?"left":"right"}function __(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function x_(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function w_(e,t,n){const{left:i,top:r,right:s,bottom:a}=n,{backdropColor:o}=t;if(!st(o)){const c=Dn(t.borderRadius),l=Ut(t.backdropPadding);e.fillStyle=o;const u=i-l.left,h=r-l.top,f=s-i+l.width,m=a-r+l.height;Object.values(c).some(g=>g!==0)?(e.beginPath(),_i(e,{x:u,y:h,w:f,h:m,radius:c}),e.fill()):e.fillRect(u,h,f,m)}}function v_(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let r=t-1;r>=0;r--){const s=e._pointLabelItems[r];if(!s.visible)continue;const a=i.setContext(e.getPointLabelContext(r));w_(n,a,s);const o=It(a.font),{x:c,y:l,textAlign:u}=s;qn(n,e._pointLabels[r],c,l+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Zd(e,t,n,i){const{ctx:r}=e;if(n)r.arc(e.xCenter,e.yCenter,t,0,Ot);else{let s=e.getPointPosition(0,t);r.moveTo(s.x,s.y);for(let a=1;a<i;a++)s=e.getPointPosition(a,t),r.lineTo(s.x,s.y)}}function S_(e,t,n,i,r){const s=e.ctx,a=t.circular,{color:o,lineWidth:c}=t;!a&&!i||!o||!c||n<0||(s.save(),s.strokeStyle=o,s.lineWidth=c,s.setLineDash(r.dash||[]),s.lineDashOffset=r.dashOffset,s.beginPath(),Zd(e,n,a,i),s.closePath(),s.stroke(),s.restore())}function k_(e,t,n){return Cn(e,{label:n,index:t,type:"pointLabel"})}class kr extends Ws{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=Ut(Ao(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=At(t)&&!isNaN(t)?t:0,this.max=At(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ao(this.options))}generateTickLabels(t){Ws.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const r=Mt(this.options.pointLabels.callback,[n,i],this);return r||r===0?r:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?f_(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,r){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,r))}getIndexAngle(t){const n=Ot/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*n+jt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(st(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return k_(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const r=this.getIndexAngle(t)-Pt+i;return{x:Math.cos(r)*n+this.xCenter,y:Math.sin(r)*n+this.yCenter,angle:r}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:r,bottom:s}=this._pointLabelItems[t];return{left:n,top:i,right:r,bottom:s}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Zd(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:r,border:s}=n,a=this._pointLabels.length;let o,c,l;if(n.pointLabels.display&&v_(this,a),r.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=r.setContext(f),g=s.setContext(f);S_(this,m,c,a,g)}}),i.display){for(t.save(),o=a-1;o>=0;o--){const u=i.setContext(this.getPointLabelContext(o)),{color:h,lineWidth:f}=u;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(u.borderDash),t.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),l=this.getPointPosition(o,c),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const r=this.getIndexAngle(0);let s,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(r),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,c)=>{if(c===0&&this.min>=0&&!n.reverse)return;const l=i.setContext(this.getContext(c)),u=It(l.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),l.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=l.backdropColor;const h=Ut(l.backdropPadding);t.fillRect(-a/2-h.left,-s-u.size/2-h.top,a+h.width,u.size+h.height)}qn(t,o.label,0,-s,u,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}R(kr,"id","radialLinear"),R(kr,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_s.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),R(kr,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),R(kr,"descriptors",{angleLines:{_fallback:"grid"}});const Ys={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}},we=Object.keys(Ys);function Qd(e,t){return e-t}function Jd(e,t){if(st(t))return null;const n=e._adapter,{parser:i,round:r,isoWeekday:s}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),At(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(r&&(a=r==="week"&&(Tn(s)||s===!0)?n.startOf(a,"isoWeek",s):n.startOf(a,r)),+a)}function th(e,t,n,i){const r=we.length;for(let s=we.indexOf(e);s<r-1;++s){const a=Ys[we[s]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(o*a.size))<=i)return we[s]}return we[r-1]}function M_(e,t,n,i,r){for(let s=we.length-1;s>=we.indexOf(n);s--){const a=we[s];if(Ys[a].common&&e._adapter.diff(r,i,a)>=t-1)return a}return we[n?we.indexOf(n):0]}function T_(e){for(let t=we.indexOf(e)+1,n=we.length;t<n;++t)if(Ys[we[t]].common)return we[t]}function eh(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:r}=Xa(n,t),s=n[i]>=t?n[i]:n[r];e[s]=!0}}function D_(e,t,n,i){const r=e._adapter,s=+r.startOf(t[0].value,i),a=t[t.length-1].value;let o,c;for(o=s;o<=a;o=+r.add(o,1,i))c=n[o],c>=0&&(t[c].major=!0);return t}function nh(e,t,n){const i=[],r={},s=t.length;let a,o;for(a=0;a<s;++a)o=t[a],r[o]=a,i.push({value:o,major:!1});return s===0||!n?i:D_(e,i,r,n)}class Mr extends Zn{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,n={}){const i=t.time||(t.time={}),r=this._adapter=new ju._date(t.adapters.date);r.init(n),er(i.displayFormats,r.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:Jd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:r,max:s,minDefined:a,maxDefined:o}=this.getUserBounds();function c(l){!a&&!isNaN(l.min)&&(r=Math.min(r,l.min)),!o&&!isNaN(l.max)&&(s=Math.max(s,l.max))}(!a||!o)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=At(r)&&!isNaN(r)?r:+n.startOf(Date.now(),i),s=At(s)&&!isNaN(s)?s:+n.endOf(Date.now(),i)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,r=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,a=this.max,o=lp(r,s,a);return this._unit=n.unit||(i.autoSkip?th(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):M_(this,o.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:T_(this._unit),this.initOffsets(r),t.reverse&&o.reverse(),nh(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?n=1-r:n=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?i=s:i=(s-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Qt(n,0,a),i=Qt(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,r=this.options,s=r.time,a=s.unit||th(s.minUnit,n,i,this._getLabelCapacity(n)),o=at(r.ticks.stepSize,1),c=a==="week"?s.isoWeekday:!1,l=Tn(c)||c===!0,u={};let h=n,f,m;if(l&&(h=+t.startOf(h,"isoWeek",c)),h=+t.startOf(h,l?"day":a),t.diff(i,n,a)>1e5*o)throw new Error(n+" and "+i+" are too far apart with stepSize of "+o+" "+a);const g=r.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)eh(u,f,g);return(f===i||r.bounds==="ticks"||m===1)&&eh(u,f,g),Object.keys(u).sort(Qd).map(p=>+p)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const r=this.options.time.displayFormats,s=this._unit,a=n||r[s];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,r){const s=this.options,a=s.ticks.callback;if(a)return Mt(a,[t,n,i],this);const o=s.time.displayFormats,c=this._unit,l=this._majorUnit,u=c&&o[c],h=l&&o[l],f=i[n],m=l&&h&&f&&f.major;return this._adapter.format(t,r||(m?h:u))}generateTickLabels(t){let n,i,r;for(n=0,i=t.length;n<i;++n)r=t[n],r.label=this._tickFormatFunction(r.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,r=jt(this.isHorizontal()?n.maxRotation:n.minRotation),s=Math.cos(r),a=Math.sin(r),o=this._resolveTickFontOptions(0).size;return{w:i*s+o*a,h:i*a+o*s}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,r=i[n.unit]||i.millisecond,s=this._tickFormatFunction(t,0,nh(this,[t],this._majorUnit),r),a=this._getLabelSize(s),o=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return o>0?o:1}getDataTimestamps(){let t=this._cache.data||[],n,i;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,i=r.length;n<i;++n)t=t.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const r=this.getLabels();for(n=0,i=r.length;n<i;++n)t.push(Jd(this,r[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return nu(t.sort(Qd))}}R(Mr,"id","time"),R(Mr,"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 $s(e,t,n){let i=0,r=e.length-1,s,a,o,c;n?(t>=e[i].pos&&t<=e[r].pos&&({lo:i,hi:r}=nn(e,"pos",t)),{pos:s,time:o}=e[i],{pos:a,time:c}=e[r]):(t>=e[i].time&&t<=e[r].time&&({lo:i,hi:r}=nn(e,"time",t)),{time:s,pos:o}=e[i],{time:a,pos:c}=e[r]);const l=a-s;return l?o+(c-o)*(t-s)/l:o}class Io extends Mr{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=$s(n,this.min),this._tableRange=$s(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,r=[],s=[];let a,o,c,l,u;for(a=0,o=t.length;a<o;++a)l=t[a],l>=n&&l<=i&&r.push(l);if(r.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,o=r.length;a<o;++a)u=r[a+1],c=r[a-1],l=r[a],Math.round((u+c)/2)!==l&&s.push({time:l,pos:a/(o-1)});return s}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return($s(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return $s(this._table,i*this._tableRange+this._minPos,!0)}}R(Io,"id","timeseries"),R(Io,"defaults",Mr.defaults);var C_=Object.freeze({__proto__:null,CategoryScale:Oo,LinearScale:Po,LogarithmicScale:Ro,RadialLinearScale:kr,TimeScale:Mr,TimeSeriesScale:Io});const E_=[Fy,d0,s_,C_],ih=6048e5,O_=864e5,Tr=6e4,ki=36e5,P_=1e3,rh=Symbol.for("constructDateFrom");function Ft(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&rh in e?e[rh](t):e instanceof Date?new e.constructor(t):new Date(t)}function ut(e,t){return Ft(t||e,e)}function js(e,t,n){const i=ut(e,n==null?void 0:n.in);return isNaN(t)?Ft((n==null?void 0:n.in)||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Lo(e,t,n){const i=ut(e,n==null?void 0:n.in);if(isNaN(t))return Ft(e,NaN);if(!t)return i;const r=i.getDate(),s=Ft(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function No(e,t,n){return Ft(e,+ut(e)+t)}function R_(e,t,n){return No(e,t*ki)}let A_={};function Jn(){return A_}function Ue(e,t){var o,c,l,u;const n=Jn(),i=(t==null?void 0:t.weekStartsOn)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,r=ut(e,t==null?void 0:t.in),s=r.getDay(),a=(s<i?7:0)+s-i;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function Mi(e,t){return Ue(e,{...t,weekStartsOn:1})}function sh(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getFullYear(),r=Ft(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Mi(r),a=Ft(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Mi(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function Us(e){const t=ut(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function ti(e,...t){const n=Ft.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Fo(e,t){const n=ut(e,t==null?void 0:t.in);return n.setHours(0,0,0,0),n}function ah(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=Fo(i),a=Fo(r),o=+s-Us(s),c=+a-Us(a);return Math.round((o-c)/O_)}function I_(e,t){const n=sh(e,t),i=Ft(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Mi(i)}function L_(e,t,n){const i=ut(e,n==null?void 0:n.in);return i.setTime(i.getTime()+t*Tr),i}function N_(e,t,n){return Lo(e,t*3,n)}function F_(e,t,n){return No(e,t*1e3)}function B_(e,t,n){return js(e,t*7,n)}function z_(e,t,n){return Lo(e,t*12,n)}function Dr(e,t){const n=+ut(e)-+ut(t);return n<0?-1:n>0?1:n}function H_(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Bo(e){return!(!H_(e)&&typeof e!="number"||isNaN(+ut(e)))}function V_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=i.getFullYear()-r.getFullYear(),a=i.getMonth()-r.getMonth();return s*12+a}function W_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t);return i.getFullYear()-r.getFullYear()}function oh(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=lh(i,r),a=Math.abs(ah(i,r));i.setDate(i.getDate()-s*a);const o=+(lh(i,r)===-s),c=s*(a-o);return c===0?0:c}function lh(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function Cr(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function Y_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=(+i-+r)/ki;return Cr(n==null?void 0:n.roundingMethod)(s)}function zo(e,t){return+ut(e)-+ut(t)}function $_(e,t,n){const i=zo(e,t)/Tr;return Cr(n==null?void 0:n.roundingMethod)(i)}function ch(e,t){const n=ut(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function uh(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function j_(e,t){const n=ut(e,t==null?void 0:t.in);return+ch(n,t)==+uh(n,t)}function dh(e,t,n){const[i,r,s]=ti(n==null?void 0:n.in,e,e,t),a=Dr(r,s),o=Math.abs(V_(r,s));if(o<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*o);let c=Dr(r,s)===-a;j_(i)&&o===1&&Dr(i,s)===1&&(c=!1);const l=a*(o-+c);return l===0?0:l}function U_(e,t,n){const i=dh(e,t,n)/3;return Cr(n==null?void 0:n.roundingMethod)(i)}function q_(e,t,n){const i=zo(e,t)/1e3;return Cr(n==null?void 0:n.roundingMethod)(i)}function X_(e,t,n){const i=oh(e,t,n)/7;return Cr(n==null?void 0:n.roundingMethod)(i)}function G_(e,t,n){const[i,r]=ti(n==null?void 0:n.in,e,t),s=Dr(i,r),a=Math.abs(W_(i,r));i.setFullYear(1584),r.setFullYear(1584);const o=Dr(i,r)===-s,c=s*(a-+o);return c===0?0:c}function K_(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getMonth(),r=i-i%3;return n.setMonth(r,1),n.setHours(0,0,0,0),n}function Z_(e,t){const n=ut(e,t==null?void 0:t.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Q_(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function hh(e,t){const n=ut(e,t==null?void 0:t.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function J_(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMinutes(59,59,999),n}function tx(e,t){var o,c;const n=Jn(),i=n.weekStartsOn??((c=(o=n.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??0,r=ut(e,t==null?void 0:t.in),s=r.getDay(),a=(s<i?-7:0)+6-(s-i);return r.setDate(r.getDate()+a),r.setHours(23,59,59,999),r}function ex(e,t){const n=ut(e,t==null?void 0:t.in);return n.setSeconds(59,999),n}function nx(e,t){const n=ut(e,t==null?void 0:t.in),i=n.getMonth(),r=i-i%3+3;return n.setMonth(r,0),n.setHours(23,59,59,999),n}function ix(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMilliseconds(999),n}const rx={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"}},sx=(e,t,n)=>{let i;const r=rx[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Ho(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const ax={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ox={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},lx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},cx={date:Ho({formats:ax,defaultWidth:"full"}),time:Ho({formats:ox,defaultWidth:"full"}),dateTime:Ho({formats:lx,defaultWidth:"full"})},ux={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},dx=(e,t,n,i)=>ux[e];function Er(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const hx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},fx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},mx={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"]},gx={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"]},px={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"}},yx={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"}},bx={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Er({values:hx,defaultWidth:"wide"}),quarter:Er({values:fx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Er({values:mx,defaultWidth:"wide"}),day:Er({values:gx,defaultWidth:"wide"}),dayPeriod:Er({values:px,defaultWidth:"wide",formattingValues:yx,defaultFormattingWidth:"wide"})};function Or(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?xx(o,h=>h.test(a)):_x(o,h=>h.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}function _x(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function xx(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function wx(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const vx=/^(\d+)(th|st|nd|rd)?/i,Sx=/\d+/i,kx={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},Mx={any:[/^b/i,/^(a|c)/i]},Tx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Dx={any:[/1/i,/2/i,/3/i,/4/i]},Cx={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},Ex={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]},Ox={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},Px={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]},Rx={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},Ax={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}},Ix={ordinalNumber:wx({matchPattern:vx,parsePattern:Sx,valueCallback:e=>parseInt(e,10)}),era:Or({matchPatterns:kx,defaultMatchWidth:"wide",parsePatterns:Mx,defaultParseWidth:"any"}),quarter:Or({matchPatterns:Tx,defaultMatchWidth:"wide",parsePatterns:Dx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Or({matchPatterns:Cx,defaultMatchWidth:"wide",parsePatterns:Ex,defaultParseWidth:"any"}),day:Or({matchPatterns:Ox,defaultMatchWidth:"wide",parsePatterns:Px,defaultParseWidth:"any"}),dayPeriod:Or({matchPatterns:Rx,defaultMatchWidth:"any",parsePatterns:Ax,defaultParseWidth:"any"})},fh={code:"en-US",formatDistance:sx,formatLong:cx,formatRelative:dx,localize:bx,match:Ix,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Lx(e,t){const n=ut(e,t==null?void 0:t.in);return ah(n,hh(n))+1}function mh(e,t){const n=ut(e,t==null?void 0:t.in),i=+Mi(n)-+I_(n);return Math.round(i/ih)+1}function Vo(e,t){var u,h,f,m;const n=ut(e,t==null?void 0:t.in),i=n.getFullYear(),r=Jn(),s=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(f=r.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Ft((t==null?void 0:t.in)||e,0);a.setFullYear(i+1,0,s),a.setHours(0,0,0,0);const o=Ue(a,t),c=Ft((t==null?void 0:t.in)||e,0);c.setFullYear(i,0,s),c.setHours(0,0,0,0);const l=Ue(c,t);return+n>=+o?i+1:+n>=+l?i:i-1}function Nx(e,t){var o,c,l,u;const n=Jn(),i=(t==null?void 0:t.firstWeekContainsDate)??((c=(o=t==null?void 0:t.locale)==null?void 0:o.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(l=n.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??1,r=Vo(e,t),s=Ft((t==null?void 0:t.in)||e,0);return s.setFullYear(r,0,i),s.setHours(0,0,0,0),Ue(s,t)}function gh(e,t){const n=ut(e,t==null?void 0:t.in),i=+Ue(n,t)-+Nx(n,t);return Math.round(i/ih)+1}function Dt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Rn={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Dt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Dt(n+1,2)},d(e,t){return Dt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Dt(e.getHours()%12||12,t.length)},H(e,t){return Dt(e.getHours(),t.length)},m(e,t){return Dt(e.getMinutes(),t.length)},s(e,t){return Dt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Dt(r,t.length)}},Ti={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ph={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return Rn.y(e,t)},Y:function(e,t,n,i){const r=Vo(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Dt(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Dt(s,t.length)},R:function(e,t){const n=sh(e);return Dt(n,t.length)},u:function(e,t){const n=e.getFullYear();return Dt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Dt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Dt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Rn.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Dt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=gh(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Dt(r,t.length)},I:function(e,t,n){const i=mh(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Rn.d(e,t)},D:function(e,t,n){const i=Lx(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Dt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Dt(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Dt(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Dt(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Ti.noon:i===0?r=Ti.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Ti.evening:i>=12?r=Ti.afternoon:i>=4?r=Ti.morning:r=Ti.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Rn.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Rn.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Rn.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Rn.s(e,t)},S:function(e,t){return Rn.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return bh(i);case"XXXX":case"XX":return ei(i);case"XXXXX":case"XXX":default:return ei(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return bh(i);case"xxxx":case"xx":return ei(i);case"xxxxx":case"xxx":default:return ei(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+yh(i,":");case"OOOO":default:return"GMT"+ei(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+yh(i,":");case"zzzz":default:return"GMT"+ei(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Dt(i,t.length)},T:function(e,t,n){return Dt(+e,t.length)}};function yh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Dt(s,2)}function bh(e,t){return e%60===0?(e>0?"-":"+")+Dt(Math.abs(e)/60,2):ei(e,t)}function ei(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Dt(Math.trunc(i/60),2),s=Dt(i%60,2);return n+r+t+s}const _h=(e,t)=>{switch(e){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"})}},xh=(e,t)=>{switch(e){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"})}},Wo={p:xh,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return _h(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",_h(i,t)).replace("{{time}}",xh(r,t))}},Fx=/^D+$/,Bx=/^Y+$/,zx=["D","DD","YY","YYYY"];function wh(e){return Fx.test(e)}function vh(e){return Bx.test(e)}function Yo(e,t,n){const i=Hx(e,t,n);if(console.warn(i),zx.includes(e))throw new RangeError(i)}function Hx(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Yx=/^'([^]*?)'?$/,$x=/''/g,jx=/[a-zA-Z]/;function qs(e,t,n){var u,h,f,m,g,p,x,S;const i=Jn(),r=(n==null?void 0:n.locale)??i.locale??fh,s=(n==null?void 0:n.firstWeekContainsDate)??((h=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(f=i.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=(n==null?void 0:n.weekStartsOn)??((p=(g=n==null?void 0:n.locale)==null?void 0:g.options)==null?void 0:p.weekStartsOn)??i.weekStartsOn??((S=(x=i.locale)==null?void 0:x.options)==null?void 0:S.weekStartsOn)??0,o=ut(e,n==null?void 0:n.in);if(!Bo(o))throw new RangeError("Invalid time value");let c=t.match(Wx).map(v=>{const k=v[0];if(k==="p"||k==="P"){const D=Wo[k];return D(v,r.formatLong)}return v}).join("").match(Vx).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const k=v[0];if(k==="'")return{isToken:!1,value:Ux(v)};if(ph[k])return{isToken:!0,value:v};if(k.match(jx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:v}});r.localize.preprocessor&&(c=r.localize.preprocessor(o,c));const l={firstWeekContainsDate:s,weekStartsOn:a,locale:r};return c.map(v=>{if(!v.isToken)return v.value;const k=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&vh(k)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&wh(k))&&Yo(k,t,String(e));const D=ph[k[0]];return D(o,k,r.localize,l)}).join("")}function Ux(e){const t=e.match(Yx);return t?t[1].replace($x,"'"):e}function Sh(){return Object.assign({},Jn())}function qx(e,t){const n=ut(e,t==null?void 0:t.in).getDay();return n===0?7:n}function Xx(e,t){const n=Gx(t)?new t(0):Ft(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function Gx(e){var t;return typeof e=="function"&&((t=e.prototype)==null?void 0:t.constructor)===e}const Kx=10;class kh{constructor(){R(this,"subPriority",0)}validate(t,n){return!0}}class Zx extends kh{constructor(t,n,i,r,s){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=r,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class Qx extends kh{constructor(n,i){super();R(this,"priority",Kx);R(this,"subPriority",-1);this.context=n||(r=>Ft(i,r))}set(n,i){return i.timestampIsSet?n:Ft(n,Xx(n,this.context))}}class wt{run(t,n,i,r){const s=this.parse(t,n,i,r);return s?{setter:new Zx(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,i){return!0}}class Jx extends wt{constructor(){super(...arguments);R(this,"priority",140);R(this,"incompatibleTokens",["R","u","t","T"])}parse(n,i,r){switch(i){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"})||r.era(n,{width:"narrow"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})||r.era(n,{width:"abbreviated"})||r.era(n,{width:"narrow"})}}set(n,i,r){return i.era=r,n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}}const Wt={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}/},qe={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 Yt(e,t){return e&&{value:t(e.value),rest:e.rest}}function Lt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Xe(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(r*ki+s*Tr+a*P_),rest:t.slice(n[0].length)}}function Mh(e){return Lt(Wt.anyDigitsSigned,e)}function Bt(e,t){switch(e){case 1:return Lt(Wt.singleDigit,t);case 2:return Lt(Wt.twoDigits,t);case 3:return Lt(Wt.threeDigits,t);case 4:return Lt(Wt.fourDigits,t);default:return Lt(new RegExp("^\\d{1,"+e+"}"),t)}}function Xs(e,t){switch(e){case 1:return Lt(Wt.singleDigitSigned,t);case 2:return Lt(Wt.twoDigitsSigned,t);case 3:return Lt(Wt.threeDigitsSigned,t);case 4:return Lt(Wt.fourDigitsSigned,t);default:return Lt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function $o(e){switch(e){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 Th(e,t){const n=t>0,i=n?t:1-t;let r;if(i<=50)r=e||100;else{const s=i+50,a=Math.trunc(s/100)*100,o=e>=s%100;r=e+a-(o?100:0)}return n?r:1-r}function Dh(e){return e%400===0||e%4===0&&e%100!==0}class tw extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,i,r){const s=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Yt(Bt(4,n),s);case"yo":return Yt(r.ordinalNumber(n,{unit:"year"}),s);default:return Yt(Bt(i.length,n),s)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,r){const s=n.getFullYear();if(r.isTwoDigitYear){const o=Th(r.year,s);return n.setFullYear(o,0,1),n.setHours(0,0,0,0),n}const a=!("era"in i)||i.era===1?r.year:1-r.year;return n.setFullYear(a,0,1),n.setHours(0,0,0,0),n}}class ew extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,i,r){const s=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Yt(Bt(4,n),s);case"Yo":return Yt(r.ordinalNumber(n,{unit:"year"}),s);default:return Yt(Bt(i.length,n),s)}}validate(n,i){return i.isTwoDigitYear||i.year>0}set(n,i,r,s){const a=Vo(n,s);if(r.isTwoDigitYear){const c=Th(r.year,a);return n.setFullYear(c,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),Ue(n,s)}const o=!("era"in i)||i.era===1?r.year:1-r.year;return n.setFullYear(o,0,s.firstWeekContainsDate),n.setHours(0,0,0,0),Ue(n,s)}}class nw extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,i){return Xs(i==="R"?4:i.length,n)}set(n,i,r){const s=Ft(n,0);return s.setFullYear(r,0,4),s.setHours(0,0,0,0),Mi(s)}}class iw extends wt{constructor(){super(...arguments);R(this,"priority",130);R(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,i){return Xs(i==="u"?4:i.length,n)}set(n,i,r){return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}}class rw extends wt{constructor(){super(...arguments);R(this,"priority",120);R(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"Q":case"QQ":return Bt(i.length,n);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"})||r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})||r.quarter(n,{width:"abbreviated",context:"formatting"})||r.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=1&&i<=4}set(n,i,r){return n.setMonth((r-1)*3,1),n.setHours(0,0,0,0),n}}class sw extends wt{constructor(){super(...arguments);R(this,"priority",120);R(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"q":case"qq":return Bt(i.length,n);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"})||r.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})||r.quarter(n,{width:"abbreviated",context:"standalone"})||r.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=1&&i<=4}set(n,i,r){return n.setMonth((r-1)*3,1),n.setHours(0,0,0,0),n}}class aw extends wt{constructor(){super(...arguments);R(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);R(this,"priority",110)}parse(n,i,r){const s=a=>a-1;switch(i){case"M":return Yt(Lt(Wt.month,n),s);case"MM":return Yt(Bt(2,n),s);case"Mo":return Yt(r.ordinalNumber(n,{unit:"month"}),s);case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"})||r.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})||r.month(n,{width:"abbreviated",context:"formatting"})||r.month(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.setMonth(r,1),n.setHours(0,0,0,0),n}}class ow extends wt{constructor(){super(...arguments);R(this,"priority",110);R(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,i,r){const s=a=>a-1;switch(i){case"L":return Yt(Lt(Wt.month,n),s);case"LL":return Yt(Bt(2,n),s);case"Lo":return Yt(r.ordinalNumber(n,{unit:"month"}),s);case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"})||r.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})||r.month(n,{width:"abbreviated",context:"standalone"})||r.month(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.setMonth(r,1),n.setHours(0,0,0,0),n}}function lw(e,t,n){const i=ut(e,n==null?void 0:n.in),r=gh(i,n)-t;return i.setDate(i.getDate()-r*7),ut(i,n==null?void 0:n.in)}class cw extends wt{constructor(){super(...arguments);R(this,"priority",100);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,i,r){switch(i){case"w":return Lt(Wt.week,n);case"wo":return r.ordinalNumber(n,{unit:"week"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,r,s){return Ue(lw(n,r,s),s)}}function uw(e,t,n){const i=ut(e,n==null?void 0:n.in),r=mh(i,n)-t;return i.setDate(i.getDate()-r*7),i}class dw extends wt{constructor(){super(...arguments);R(this,"priority",100);R(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,i,r){switch(i){case"I":return Lt(Wt.week,n);case"Io":return r.ordinalNumber(n,{unit:"week"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=53}set(n,i,r){return Mi(uw(n,r))}}const hw=[31,28,31,30,31,30,31,31,30,31,30,31],fw=[31,29,31,30,31,30,31,31,30,31,30,31];class mw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"subPriority",1);R(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"d":return Lt(Wt.date,n);case"do":return r.ordinalNumber(n,{unit:"date"});default:return Bt(i.length,n)}}validate(n,i){const r=n.getFullYear(),s=Dh(r),a=n.getMonth();return s?i>=1&&i<=fw[a]:i>=1&&i<=hw[a]}set(n,i,r){return n.setDate(r),n.setHours(0,0,0,0),n}}class gw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"subpriority",1);R(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,i,r){switch(i){case"D":case"DD":return Lt(Wt.dayOfYear,n);case"Do":return r.ordinalNumber(n,{unit:"date"});default:return Bt(i.length,n)}}validate(n,i){const r=n.getFullYear();return Dh(r)?i>=1&&i<=366:i>=1&&i<=365}set(n,i,r){return n.setMonth(0,r),n.setHours(0,0,0,0),n}}function jo(e,t,n){var h,f,m,g;const i=Jn(),r=(n==null?void 0:n.weekStartsOn)??((f=(h=n==null?void 0:n.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((g=(m=i.locale)==null?void 0:m.options)==null?void 0:g.weekStartsOn)??0,s=ut(e,n==null?void 0:n.in),a=s.getDay(),c=(t%7+7)%7,l=7-r,u=t<0||t>6?t-(a+l)%7:(c+l)%7-(a+l)%7;return js(s,u,n)}class pw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,i,r){switch(i){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=jo(n,r,s),n.setHours(0,0,0,0),n}}class yw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,i,r,s){const a=o=>{const c=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+c};switch(i){case"e":case"ee":return Yt(Bt(i.length,n),a);case"eo":return Yt(r.ordinalNumber(n,{unit:"day"}),a);case"eee":return r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"eeeee":return r.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=jo(n,r,s),n.setHours(0,0,0,0),n}}class bw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,i,r,s){const a=o=>{const c=Math.floor((o-1)/7)*7;return(o+s.weekStartsOn+6)%7+c};switch(i){case"c":case"cc":return Yt(Bt(i.length,n),a);case"co":return Yt(r.ordinalNumber(n,{unit:"day"}),a);case"ccc":return r.day(n,{width:"abbreviated",context:"standalone"})||r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"});case"ccccc":return r.day(n,{width:"narrow",context:"standalone"});case"cccccc":return r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(n,{width:"wide",context:"standalone"})||r.day(n,{width:"abbreviated",context:"standalone"})||r.day(n,{width:"short",context:"standalone"})||r.day(n,{width:"narrow",context:"standalone"})}}validate(n,i){return i>=0&&i<=6}set(n,i,r,s){return n=jo(n,r,s),n.setHours(0,0,0,0),n}}function _w(e,t,n){const i=ut(e,n==null?void 0:n.in),r=qx(i,n),s=t-r;return js(i,s,n)}class xw extends wt{constructor(){super(...arguments);R(this,"priority",90);R(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,i,r){const s=a=>a===0?7:a;switch(i){case"i":case"ii":return Bt(i.length,n);case"io":return r.ordinalNumber(n,{unit:"day"});case"iii":return Yt(r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s);case"iiiii":return Yt(r.day(n,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Yt(r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s);case"iiii":default:return Yt(r.day(n,{width:"wide",context:"formatting"})||r.day(n,{width:"abbreviated",context:"formatting"})||r.day(n,{width:"short",context:"formatting"})||r.day(n,{width:"narrow",context:"formatting"}),s)}}validate(n,i){return i>=1&&i<=7}set(n,i,r){return n=_w(n,r),n.setHours(0,0,0,0),n}}class ww extends wt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,i,r){switch(i){case"a":case"aa":case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours($o(r),0,0,0),n}}class vw extends wt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,i,r){switch(i){case"b":case"bb":case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours($o(r),0,0,0),n}}class Sw extends wt{constructor(){super(...arguments);R(this,"priority",80);R(this,"incompatibleTokens",["a","b","t","T"])}parse(n,i,r){switch(i){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(n,{width:"wide",context:"formatting"})||r.dayPeriod(n,{width:"abbreviated",context:"formatting"})||r.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,i,r){return n.setHours($o(r),0,0,0),n}}class kw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,i,r){switch(i){case"h":return Lt(Wt.hour12h,n);case"ho":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=12}set(n,i,r){const s=n.getHours()>=12;return s&&r<12?n.setHours(r+12,0,0,0):!s&&r===12?n.setHours(0,0,0,0):n.setHours(r,0,0,0),n}}class Mw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,i,r){switch(i){case"H":return Lt(Wt.hour23h,n);case"Ho":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=23}set(n,i,r){return n.setHours(r,0,0,0),n}}class Tw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,i,r){switch(i){case"K":return Lt(Wt.hour11h,n);case"Ko":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=11}set(n,i,r){return n.getHours()>=12&&r<12?n.setHours(r+12,0,0,0):n.setHours(r,0,0,0),n}}class Dw extends wt{constructor(){super(...arguments);R(this,"priority",70);R(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,i,r){switch(i){case"k":return Lt(Wt.hour24h,n);case"ko":return r.ordinalNumber(n,{unit:"hour"});default:return Bt(i.length,n)}}validate(n,i){return i>=1&&i<=24}set(n,i,r){const s=r<=24?r%24:r;return n.setHours(s,0,0,0),n}}class Cw extends wt{constructor(){super(...arguments);R(this,"priority",60);R(this,"incompatibleTokens",["t","T"])}parse(n,i,r){switch(i){case"m":return Lt(Wt.minute,n);case"mo":return r.ordinalNumber(n,{unit:"minute"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,r){return n.setMinutes(r,0,0),n}}class Ew extends wt{constructor(){super(...arguments);R(this,"priority",50);R(this,"incompatibleTokens",["t","T"])}parse(n,i,r){switch(i){case"s":return Lt(Wt.second,n);case"so":return r.ordinalNumber(n,{unit:"second"});default:return Bt(i.length,n)}}validate(n,i){return i>=0&&i<=59}set(n,i,r){return n.setSeconds(r,0),n}}class Ow extends wt{constructor(){super(...arguments);R(this,"priority",30);R(this,"incompatibleTokens",["t","T"])}parse(n,i){const r=s=>Math.trunc(s*Math.pow(10,-i.length+3));return Yt(Bt(i.length,n),r)}set(n,i,r){return n.setMilliseconds(r),n}}class Pw extends wt{constructor(){super(...arguments);R(this,"priority",10);R(this,"incompatibleTokens",["t","T","x"])}parse(n,i){switch(i){case"X":return Xe(qe.basicOptionalMinutes,n);case"XX":return Xe(qe.basic,n);case"XXXX":return Xe(qe.basicOptionalSeconds,n);case"XXXXX":return Xe(qe.extendedOptionalSeconds,n);case"XXX":default:return Xe(qe.extended,n)}}set(n,i,r){return i.timestampIsSet?n:Ft(n,n.getTime()-Us(n)-r)}}class Rw extends wt{constructor(){super(...arguments);R(this,"priority",10);R(this,"incompatibleTokens",["t","T","X"])}parse(n,i){switch(i){case"x":return Xe(qe.basicOptionalMinutes,n);case"xx":return Xe(qe.basic,n);case"xxxx":return Xe(qe.basicOptionalSeconds,n);case"xxxxx":return Xe(qe.extendedOptionalSeconds,n);case"xxx":default:return Xe(qe.extended,n)}}set(n,i,r){return i.timestampIsSet?n:Ft(n,n.getTime()-Us(n)-r)}}class Aw extends wt{constructor(){super(...arguments);R(this,"priority",40);R(this,"incompatibleTokens","*")}parse(n){return Mh(n)}set(n,i,r){return[Ft(n,r*1e3),{timestampIsSet:!0}]}}class Iw extends wt{constructor(){super(...arguments);R(this,"priority",20);R(this,"incompatibleTokens","*")}parse(n){return Mh(n)}set(n,i,r){return[Ft(n,r),{timestampIsSet:!0}]}}const Lw={G:new Jx,y:new tw,Y:new ew,R:new nw,u:new iw,Q:new rw,q:new sw,M:new aw,L:new ow,w:new cw,I:new dw,d:new mw,D:new gw,E:new pw,e:new yw,c:new bw,i:new xw,a:new ww,b:new vw,B:new Sw,h:new kw,H:new Mw,K:new Tw,k:new Dw,m:new Cw,s:new Ew,S:new Ow,X:new Pw,x:new Rw,t:new Aw,T:new Iw},Nw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bw=/^'([^]*?)'?$/,zw=/''/g,Hw=/\S/,Vw=/[a-zA-Z]/;function Ww(e,t,n,i){var x,S,v,k,D,M,P,E;const r=()=>Ft((i==null?void 0:i.in)||n,NaN),s=Sh(),a=(i==null?void 0:i.locale)??s.locale??fh,o=(i==null?void 0:i.firstWeekContainsDate)??((S=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:S.firstWeekContainsDate)??s.firstWeekContainsDate??((k=(v=s.locale)==null?void 0:v.options)==null?void 0:k.firstWeekContainsDate)??1,c=(i==null?void 0:i.weekStartsOn)??((M=(D=i==null?void 0:i.locale)==null?void 0:D.options)==null?void 0:M.weekStartsOn)??s.weekStartsOn??((E=(P=s.locale)==null?void 0:P.options)==null?void 0:E.weekStartsOn)??0;if(!t)return e?r():ut(n,i==null?void 0:i.in);const l={firstWeekContainsDate:o,weekStartsOn:c,locale:a},u=[new Qx(i==null?void 0:i.in,n)],h=t.match(Fw).map(y=>{const _=y[0];if(_ in Wo){const T=Wo[_];return T(y,a.formatLong)}return y}).join("").match(Nw),f=[];for(let y of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&vh(y)&&Yo(y,t,e),!(i!=null&&i.useAdditionalDayOfYearTokens)&&wh(y)&&Yo(y,t,e);const _=y[0],T=Lw[_];if(T){const{incompatibleTokens:O}=T;if(Array.isArray(O)){const I=f.find(B=>O.includes(B.token)||B.token===_);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${y}\` at the same time`)}else if(T.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);f.push({token:_,fullToken:y});const A=T.run(e,y,a.match,l);if(!A)return r();u.push(A.setter),e=A.rest}else{if(_.match(Vw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(y==="''"?y="'":_==="'"&&(y=Yw(y)),e.indexOf(y)===0)e=e.slice(y.length);else return r()}}if(e.length>0&&Hw.test(e))return r();const m=u.map(y=>y.priority).sort((y,_)=>_-y).filter((y,_,T)=>T.indexOf(y)===_).map(y=>u.filter(_=>_.priority===y).sort((_,T)=>T.subPriority-_.subPriority)).map(y=>y[0]);let g=ut(n,i==null?void 0:i.in);if(isNaN(+g))return r();const p={};for(const y of m){if(!y.validate(g,l))return r();const _=y.set(g,p,l);Array.isArray(_)?(g=_[0],Object.assign(p,_[1])):g=_}return g}function Yw(e){return e.match(Bw)[1].replace(zw,"'")}function $w(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMinutes(0,0,0),n}function jw(e,t){const n=ut(e,t==null?void 0:t.in);return n.setSeconds(0,0),n}function Uw(e,t){const n=ut(e,t==null?void 0:t.in);return n.setMilliseconds(0),n}function qw(e){const t=e/ki;return Math.trunc(t)}function Ch(e,t){const n=()=>Ft(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,r=Zw(e);let s;if(r.date){const l=Qw(r.date,i);s=Jw(l.restDateString,l.year)}if(!s||isNaN(+s))return n();const a=+s;let o=0,c;if(r.time&&(o=tv(r.time),isNaN(o)))return n();if(r.timezone){if(c=ev(r.timezone),isNaN(c))return n()}else{const l=new Date(a+o),u=ut(0,t==null?void 0:t.in);return u.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),u.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),u}return ut(a+o+c,t==null?void 0:t.in)}const Gs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Xw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Gw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Kw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Zw(e){const t={},n=e.split(Gs.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],Gs.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Gs.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const r=Gs.timezone.exec(i);r?(t.time=i.replace(r[1],""),t.timezone=r[1]):t.time=i}return t}function Qw(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const r=i[1]?parseInt(i[1]):null,s=i[2]?parseInt(i[2]):null;return{year:s===null?r:s*100,restDateString:e.slice((i[1]||i[2]).length)}}function Jw(e,t){if(t===null)return new Date(NaN);const n=e.match(Xw);if(!n)return new Date(NaN);const i=!!n[4],r=Pr(n[1]),s=Pr(n[2])-1,a=Pr(n[3]),o=Pr(n[4]),c=Pr(n[5])-1;if(i)return av(t,o,c)?nv(t,o,c):new Date(NaN);{const l=new Date(0);return!rv(t,s,a)||!sv(t,r)?new Date(NaN):(l.setUTCFullYear(t,s,Math.max(r,a)),l)}}function Pr(e){return e?parseInt(e):1}function tv(e){const t=e.match(Gw);if(!t)return NaN;const n=Uo(t[1]),i=Uo(t[2]),r=Uo(t[3]);return ov(n,i,r)?n*ki+i*Tr+r*1e3:NaN}function Uo(e){return e&&parseFloat(e.replace(",","."))||0}function ev(e){if(e==="Z")return 0;const t=e.match(Kw);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return lv(i,r)?n*(i*ki+r*Tr):NaN}function nv(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=(t-1)*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const iv=[31,null,31,30,31,30,31,31,30,31,30,31];function Eh(e){return e%400===0||e%4===0&&e%100!==0}function rv(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(iv[t]||(Eh(e)?29:28))}function sv(e,t){return t>=1&&t<=(Eh(e)?366:365)}function av(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function ov(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function lv(e,t){return t>=0&&t<=59}var cv=Object.defineProperty,uv=(e,t,n)=>t in e?cv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Re=(e,t,n)=>uv(e,typeof t!="symbol"?t+"":t,n);const dv=1e3;var tt=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(tt||{});const hv=["in","not_in","selector"],fv=["empty","not_empty"],mv=["15m","1h","6h","12h","24h","7d","current_week","previous_week","30d","current_month","previous_month"],gv=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Rr=e=>e.filter(t=>t!=="time"),Oh=["api","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],Ph=Rr(Oh),pv=[...Oh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm"],Rh=Rr(pv),yv=["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","realm","status_code","status_code_grouped","ai_plugin"],Ah=Rr(yv);Rr(["api","api_product","api_product_version","application","auth_type","client_ip","consumer","consumer_group","control_plane","control_plane_group","country_code","data_plane_node","data_plane_node_version","gateway_service","header_host","header_user_agent","http_method","portal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_uri","upstream_status_code_grouped","websocket"]),Rr(["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"]),new Set(Ph),new Set(Rh),new Set(Ah);const Ih=[{code:"AF",name:"Afghanistan"},{code:"AX",name:"Aland Islands"},{code:"AL",name:"Albania"},{code:"DZ",name:"Algeria"},{code:"AS",name:"American Samoa"},{code:"AD",name:"Andorra"},{code:"AO",name:"Angola"},{code:"AI",name:"Anguilla"},{code:"AQ",name:"Antarctica"},{code:"AG",name:"Antigua and Barbuda"},{code:"AR",name:"Argentina"},{code:"AM",name:"Armenia"},{code:"AW",name:"Aruba"},{code:"AU",name:"Australia"},{code:"AT",name:"Austria"},{code:"AZ",name:"Azerbaijan"},{code:"BS",name:"Bahamas"},{code:"BH",name:"Bahrain"},{code:"BD",name:"Bangladesh"},{code:"BB",name:"Barbados"},{code:"BY",name:"Belarus"},{code:"BE",name:"Belgium"},{code:"BZ",name:"Belize"},{code:"BJ",name:"Benin"},{code:"BM",name:"Bermuda"},{code:"BT",name:"Bhutan"},{code:"BO",name:"Bolivia"},{code:"BA",name:"Bosnia and Herzegovina"},{code:"BW",name:"Botswana"},{code:"BV",name:"Bouvet Island"},{code:"BR",name:"Brazil"},{code:"IO",name:"British Indian Ocean Territory"},{code:"BN",name:"Brunei Darussalam"},{code:"BG",name:"Bulgaria"},{code:"BF",name:"Burkina Faso"},{code:"BI",name:"Burundi"},{code:"KH",name:"Cambodia"},{code:"CM",name:"Cameroon"},{code:"CA",name:"Canada"},{code:"CV",name:"Cape Verde"},{code:"KY",name:"Cayman Islands"},{code:"CF",name:"Central African Republic"},{code:"TD",name:"Chad"},{code:"CL",name:"Chile"},{code:"CN",name:"China"},{code:"CX",name:"Christmas Island"},{code:"CC",name:"Cocos (Keeling) Islands"},{code:"CO",name:"Colombia"},{code:"KM",name:"Comoros"},{code:"CG",name:"Congo"},{code:"CD",name:"Democratic Republic of the Congo"},{code:"CK",name:"Cook Islands"},{code:"CR",name:"Costa Rica"},{code:"CI",name:"Cote d'Ivoire"},{code:"HR",name:"Croatia"},{code:"CU",name:"Cuba"},{code:"CY",name:"Cyprus"},{code:"CZ",name:"Czech Republic"},{code:"DK",name:"Denmark"},{code:"DJ",name:"Djibouti"},{code:"DM",name:"Dominica"},{code:"DO",name:"Dominican Republic"},{code:"EC",name:"Ecuador"},{code:"EG",name:"Egypt"},{code:"SV",name:"El Salvador"},{code:"GQ",name:"Equatorial Guinea"},{code:"ER",name:"Eritrea"},{code:"EE",name:"Estonia"},{code:"ET",name:"Ethiopia"},{code:"FK",name:"Falkland Islands (Malvinas)"},{code:"FO",name:"Faroe Islands"},{code:"FJ",name:"Fiji"},{code:"FI",name:"Finland"},{code:"FR",name:"France"},{code:"GF",name:"French Guiana"},{code:"PF",name:"French Polynesia"},{code:"TF",name:"French Southern Territories"},{code:"GA",name:"Gabon"},{code:"GM",name:"Gambia"},{code:"GE",name:"Georgia"},{code:"DE",name:"Germany"},{code:"GH",name:"Ghana"},{code:"GI",name:"Gibraltar"},{code:"GR",name:"Greece"},{code:"GL",name:"Greenland"},{code:"GD",name:"Grenada"},{code:"GP",name:"Guadeloupe"},{code:"GU",name:"Guam"},{code:"GT",name:"Guatemala"},{code:"GG",name:"Guernsey"},{code:"GN",name:"Guinea"},{code:"GW",name:"Guinea-Bissau"},{code:"GY",name:"Guyana"},{code:"HT",name:"Haiti"},{code:"HM",name:"Heard Island and McDonald Islands"},{code:"VA",name:"The Vatican"},{code:"HN",name:"Honduras"},{code:"HK",name:"Hong Kong"},{code:"HU",name:"Hungary"},{code:"IS",name:"Iceland"},{code:"IN",name:"India"},{code:"ID",name:"Indonesia"},{code:"IR",name:"Iran"},{code:"IQ",name:"Iraq"},{code:"IE",name:"Ireland"},{code:"IM",name:"Isle of Man"},{code:"IL",name:"Israel"},{code:"IT",name:"Italy"},{code:"JM",name:"Jamaica"},{code:"JP",name:"Japan"},{code:"JE",name:"Jersey"},{code:"JO",name:"Jordan"},{code:"KZ",name:"Kazakhstan"},{code:"KE",name:"Kenya"},{code:"KI",name:"Kiribati"},{code:"KP",name:"North Korea"},{code:"KR",name:"South Korea"},{code:"KW",name:"Kuwait"},{code:"KG",name:"Kyrgyzstan"},{code:"LA",name:"Laos"},{code:"LV",name:"Latvia"},{code:"LB",name:"Lebanon"},{code:"LS",name:"Lesotho"},{code:"LR",name:"Liberia"},{code:"LY",name:"Libya"},{code:"LI",name:"Liechtenstein"},{code:"LT",name:"Lithuania"},{code:"LU",name:"Luxembourg"},{code:"MO",name:"Macao"},{code:"MK",name:"Macedonia"},{code:"MG",name:"Madagascar"},{code:"MW",name:"Malawi"},{code:"MY",name:"Malaysia"},{code:"MV",name:"Maldives"},{code:"ML",name:"Mali"},{code:"MT",name:"Malta"},{code:"MH",name:"Marshall Islands"},{code:"MQ",name:"Martinique"},{code:"MR",name:"Mauritania"},{code:"MU",name:"Mauritius"},{code:"YT",name:"Mayotte"},{code:"MX",name:"Mexico"},{code:"FM",name:"Micronesia, "},{code:"MD",name:"Moldova,"},{code:"MC",name:"Monaco"},{code:"MN",name:"Mongolia"},{code:"ME",name:"Montenegro"},{code:"MS",name:"Montserrat"},{code:"MA",name:"Morocco"},{code:"MZ",name:"Mozambique"},{code:"MM",name:"Myanmar"},{code:"NA",name:"Namibia"},{code:"NR",name:"Nauru"},{code:"NP",name:"Nepal"},{code:"NL",name:"Netherlands"},{code:"NC",name:"New Caledonia"},{code:"NZ",name:"New Zealand"},{code:"NI",name:"Nicaragua"},{code:"NE",name:"Niger"},{code:"NG",name:"Nigeria"},{code:"NU",name:"Niue"},{code:"NF",name:"Norfolk Island"},{code:"MP",name:"Northern Mariana Islands"},{code:"NO",name:"Norway"},{code:"OM",name:"Oman"},{code:"PK",name:"Pakistan"},{code:"PW",name:"Palau"},{code:"PA",name:"Panama"},{code:"PG",name:"Papua New Guinea"},{code:"PY",name:"Paraguay"},{code:"PE",name:"Peru"},{code:"PH",name:"Philippines"},{code:"PN",name:"Pitcairn"},{code:"PL",name:"Poland"},{code:"PT",name:"Portugal"},{code:"PR",name:"Puerto Rico"},{code:"QA",name:"Qatar"},{code:"RE",name:"Reunion"},{code:"RO",name:"Romania"},{code:"RU",name:"Russia"},{code:"RW",name:"Rwanda"},{code:"BL",name:"Saint Barthelemy"},{code:"SH",name:"Saint Helena"},{code:"KN",name:"Saint Kitts and Nevis"},{code:"LC",name:"Saint Lucia"},{code:"MF",name:"Saint Martin"},{code:"PM",name:"Saint Pierre and Miquelon"},{code:"VC",name:"Saint Vincent and the Grenadines"},{code:"WS",name:"Samoa"},{code:"SM",name:"San Marino"},{code:"ST",name:"Sao Tome and Principe"},{code:"SA",name:"Saudi Arabia"},{code:"SN",name:"Senegal"},{code:"RS",name:"Serbia"},{code:"SC",name:"Seychelles"},{code:"SL",name:"Sierra Leone"},{code:"SG",name:"Singapore"},{code:"SX",name:"Sint Maarten"},{code:"SK",name:"Slovakia"},{code:"SI",name:"Slovenia"},{code:"SB",name:"Solomon Islands"},{code:"SO",name:"Somalia"},{code:"ZA",name:"South Africa"},{code:"GS",name:"South Georgia and the South Sandwich Islands"},{code:"SS",name:"South Sudan"},{code:"ES",name:"Spain"},{code:"LK",name:"Sri Lanka"},{code:"SD",name:"Sudan"},{code:"SR",name:"Suriname"},{code:"SJ",name:"Svalbard and Jan Mayen"},{code:"SZ",name:"Swaziland"},{code:"SE",name:"Sweden"},{code:"CH",name:"Switzerland"},{code:"SY",name:"Syria"},{code:"TW",name:"Taiwan"},{code:"TJ",name:"Tajikistan"},{code:"TZ",name:"Tanzania"},{code:"TH",name:"Thailand"},{code:"TL",name:"Timor-Leste"},{code:"TG",name:"Togo"},{code:"TK",name:"Tokelau"},{code:"TO",name:"Tonga"},{code:"TT",name:"Trinidad and Tobago"},{code:"TN",name:"Tunisia"},{code:"TR",name:"Turkey"},{code:"TM",name:"Turkmenistan"},{code:"TC",name:"Turks and Caicos Islands"},{code:"TV",name:"Tuvalu"},{code:"UG",name:"Uganda"},{code:"UA",name:"Ukraine"},{code:"AE",name:"United Arab Emirates"},{code:"GB",name:"United Kingdom"},{code:"US",name:"United States"},{code:"UM",name:"United States Minor Outlying Islands"},{code:"UY",name:"Uruguay"},{code:"UZ",name:"Uzbekistan"},{code:"VU",name:"Vanuatu"},{code:"VE",name:"Venezuela"},{code:"VN",name:"Vietnam"},{code:"VG",name:"British Virgin Islands"},{code:"VI",name:"U.S. Virgin Islands"},{code:"WF",name:"Wallis and Futuna"},{code:"EH",name:"Western Sahara"},{code:"YE",name:"Yemen"},{code:"ZM",name:"Zambia"},{code:"ZW",name:"Zimbabwe"}];Ih.map(e=>e.code),(e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:hv},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",enum:e},operator:{type:"string",enum:fv}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...Rh,...Ph,...Ah])]);const bv={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"}},_v=(e,t,n)=>{let i;const r=bv[e];return typeof r=="string"?i=r:t===1?i=r.one:i=r.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function qo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const xv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},wv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},vv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sv={date:qo({formats:xv,defaultWidth:"full"}),time:qo({formats:wv,defaultWidth:"full"}),dateTime:qo({formats:vv,defaultWidth:"full"})},kv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Mv=(e,t,n,i)=>kv[e];function Ar(e){return(t,n)=>{const i=n!=null&&n.context?String(n.context):"standalone";let r;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,o=n!=null&&n.width?String(n.width):a;r=e.formattingValues[o]||e.formattingValues[a]}else{const a=e.defaultWidth,o=n!=null&&n.width?String(n.width):e.defaultWidth;r=e.values[o]||e.values[a]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const Tv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Dv={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Cv={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"]},Ev={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"]},Ov={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"}},Pv={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"}},Rv=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Av={ordinalNumber:Rv,era:Ar({values:Tv,defaultWidth:"wide"}),quarter:Ar({values:Dv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Ar({values:Cv,defaultWidth:"wide"}),day:Ar({values:Ev,defaultWidth:"wide"}),dayPeriod:Ar({values:Ov,defaultWidth:"wide",formattingValues:Pv,defaultFormattingWidth:"wide"})};function Ir(e){return(t,n={})=>{const i=n.width,r=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const a=s[0],o=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(o)?Lv(o,h=>h.test(a)):Iv(o,h=>h.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}function Iv(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Lv(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Nv(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const r=i[0],s=t.match(e.parsePattern);if(!s)return null;let a=e.valueCallback?e.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const o=t.slice(r.length);return{value:a,rest:o}}}const Fv=/^(\d+)(th|st|nd|rd)?/i,Bv=/\d+/i,zv={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},Hv={any:[/^b/i,/^(a|c)/i]},Vv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Wv={any:[/1/i,/2/i,/3/i,/4/i]},Yv={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},$v={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]},jv={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},Uv={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]},qv={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},Xv={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}},Gv={ordinalNumber:Nv({matchPattern:Fv,parsePattern:Bv,valueCallback:e=>parseInt(e,10)}),era:Ir({matchPatterns:zv,defaultMatchWidth:"wide",parsePatterns:Hv,defaultParseWidth:"any"}),quarter:Ir({matchPatterns:Vv,defaultMatchWidth:"wide",parsePatterns:Wv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ir({matchPatterns:Yv,defaultMatchWidth:"wide",parsePatterns:$v,defaultParseWidth:"any"}),day:Ir({matchPatterns:jv,defaultMatchWidth:"wide",parsePatterns:Uv,defaultParseWidth:"any"}),dayPeriod:Ir({matchPatterns:qv,defaultMatchWidth:"any",parsePatterns:Xv,defaultParseWidth:"any"})},Kv={code:"en-US",formatDistance:_v,formatLong:Sv,formatRelative:Mv,localize:Av,match:Gv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Zv={};function Lr(){return Zv}const Lh=6048e5,Qv=864e5,Jv=60,t1=3600,Nh=Symbol.for("constructDateFrom");function Ae(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Nh in e?e[Nh](t):e instanceof Date?new e.constructor(t):new Date(t)}function he(e,t){return Ae(t||e,e)}function Fh(e){const t=he(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function e1(e,...t){const n=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Nr(e,t){const n=he(e,void 0);return n.setHours(0,0,0,0),n}function n1(e,t,n){const[i,r]=e1(void 0,e,t),s=Nr(i),a=Nr(r),o=+s-Fh(s),c=+a-Fh(a);return Math.round((o-c)/Qv)}function i1(e,t){const n=he(e,void 0);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function r1(e,t){const n=he(e,void 0);return n1(n,i1(n))+1}function ln(e,t){var n,i,r,s;const a=Lr(),o=(t==null?void 0:t.weekStartsOn)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((s=(r=a.locale)==null?void 0:r.options)==null?void 0:s.weekStartsOn)??0,c=he(e,t==null?void 0:t.in),l=c.getDay(),u=(l<o?7:0)+l-o;return c.setDate(c.getDate()-u),c.setHours(0,0,0,0),c}function Ks(e,t){return ln(e,{...t,weekStartsOn:1})}function Bh(e,t){const n=he(e,void 0),i=n.getFullYear(),r=Ae(n,0);r.setFullYear(i+1,0,4),r.setHours(0,0,0,0);const s=Ks(r),a=Ae(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Ks(a);return n.getTime()>=s.getTime()?i+1:n.getTime()>=o.getTime()?i:i-1}function s1(e,t){const n=Bh(e),i=Ae(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Ks(i)}function a1(e,t){const n=he(e,void 0),i=+Ks(n)-+s1(n);return Math.round(i/Lh)+1}function zh(e,t){var n,i,r,s;const a=he(e,t==null?void 0:t.in),o=a.getFullYear(),c=Lr(),l=(t==null?void 0:t.firstWeekContainsDate)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??c.firstWeekContainsDate??((s=(r=c.locale)==null?void 0:r.options)==null?void 0:s.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||e,0);u.setFullYear(o+1,0,l),u.setHours(0,0,0,0);const h=ln(u,t),f=Ae((t==null?void 0:t.in)||e,0);f.setFullYear(o,0,l),f.setHours(0,0,0,0);const m=ln(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function o1(e,t){var n,i,r,s;const a=Lr(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(n=t==null?void 0:t.locale)==null?void 0:n.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((s=(r=a.locale)==null?void 0:r.options)==null?void 0:s.firstWeekContainsDate)??1,c=zh(e,t),l=Ae((t==null?void 0:t.in)||e,0);return l.setFullYear(c,0,o),l.setHours(0,0,0,0),ln(l,t)}function l1(e,t){const n=he(e,t==null?void 0:t.in),i=+ln(n,t)-+o1(n,t);return Math.round(i/Lh)+1}function Ct(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const An={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return Ct(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ct(n+1,2)},d(e,t){return Ct(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ct(e.getHours()%12||12,t.length)},H(e,t){return Ct(e.getHours(),t.length)},m(e,t){return Ct(e.getMinutes(),t.length)},s(e,t){return Ct(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),r=Math.trunc(i*Math.pow(10,n-3));return Ct(r,t.length)}},Di={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Hh={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),r=i>0?i:1-i;return n.ordinalNumber(r,{unit:"year"})}return An.y(e,t)},Y:function(e,t,n,i){const r=zh(e,i),s=r>0?r:1-r;if(t==="YY"){const a=s%100;return Ct(a,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):Ct(s,t.length)},R:function(e,t){const n=Bh(e);return Ct(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ct(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Ct(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Ct(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return An.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return Ct(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const r=l1(e,i);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Ct(r,t.length)},I:function(e,t,n){const i=a1(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):Ct(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):An.d(e,t)},D:function(e,t,n){const i=r1(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):Ct(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Ct(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const r=e.getDay(),s=(r-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Ct(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),r=i===0?7:i;switch(t){case"i":return String(r);case"ii":return Ct(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let r;switch(i===12?r=Di.noon:i===0?r=Di.midnight:r=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let r;switch(i>=17?r=Di.evening:i>=12?r=Di.afternoon:i>=4?r=Di.morning:r=Di.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return An.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):An.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):Ct(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):An.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):An.s(e,t)},S:function(e,t){return An.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Wh(i);case"XXXX":case"XX":return ni(i);case"XXXXX":case"XXX":default:return ni(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Wh(i);case"xxxx":case"xx":return ni(i);case"xxxxx":case"xxx":default:return ni(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vh(i,":");case"OOOO":default:return"GMT"+ni(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vh(i,":");case"zzzz":default:return"GMT"+ni(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return Ct(i,t.length)},T:function(e,t,n){return Ct(+e,t.length)}};function Vh(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.trunc(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Ct(s,2)}function Wh(e,t){return e%60===0?(e>0?"-":"+")+Ct(Math.abs(e)/60,2):ni(e,t)}function ni(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Ct(Math.trunc(i/60),2),s=Ct(i%60,2);return n+r+t+s}const Yh=(e,t)=>{switch(e){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"})}},$h=(e,t)=>{switch(e){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"})}},c1=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],r=n[2];if(!r)return Yh(e,t);let s;switch(i){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Yh(i,t)).replace("{{time}}",$h(r,t))},u1={p:$h,P:c1},d1=/^D+$/,h1=/^Y+$/,f1=["D","DD","YY","YYYY"];function m1(e){return d1.test(e)}function g1(e){return h1.test(e)}function p1(e,t,n){const i=y1(e,t,n);if(console.warn(i),f1.includes(e))throw new RangeError(i)}function y1(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function b1(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function _1(e){return!(!b1(e)&&typeof e!="number"||isNaN(+he(e)))}const x1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,w1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,v1=/^'([^]*?)'?$/,S1=/''/g,k1=/[a-zA-Z]/;function M1(e,t,n){var i,r,s,a,o,c,l,u;const h=Lr(),f=(n==null?void 0:n.locale)??h.locale??Kv,m=(n==null?void 0:n.firstWeekContainsDate)??((r=(i=n==null?void 0:n.locale)==null?void 0:i.options)==null?void 0:r.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(s=h.locale)==null?void 0:s.options)==null?void 0:a.firstWeekContainsDate)??1,g=(n==null?void 0:n.weekStartsOn)??((c=(o=n==null?void 0:n.locale)==null?void 0:o.options)==null?void 0:c.weekStartsOn)??h.weekStartsOn??((u=(l=h.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??0,p=he(e,n==null?void 0:n.in);if(!_1(p))throw new RangeError("Invalid time value");let x=t.match(w1).map(v=>{const k=v[0];if(k==="p"||k==="P"){const D=u1[k];return D(v,f.formatLong)}return v}).join("").match(x1).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const k=v[0];if(k==="'")return{isToken:!1,value:T1(v)};if(Hh[k])return{isToken:!0,value:v};if(k.match(k1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:v}});f.localize.preprocessor&&(x=f.localize.preprocessor(p,x));const S={firstWeekContainsDate:m,weekStartsOn:g,locale:f};return x.map(v=>{if(!v.isToken)return v.value;const k=v.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&g1(k)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&m1(k))&&p1(k,t,String(e));const D=Hh[k[0]];return D(p,k,f.localize,S)}).join("")}function T1(e){const t=e.match(v1);return t?t[1].replace(S1,"'"):e}function Xo(e,t,n){const i=he(e,void 0);return isNaN(t)?Ae(e,NaN):(i.setDate(i.getDate()+t),i)}function D1(e,t,n){const i=he(e,void 0);if(isNaN(t))return Ae(e,NaN);const r=i.getDate(),s=Ae(e,i.getTime());s.setMonth(i.getMonth()+t+1,0);const a=s.getDate();return r>=a?s:(i.setFullYear(s.getFullYear(),s.getMonth(),r),i)}function Ci(e,t){const n=he(e,void 0);return n.setDate(1),n.setHours(0,0,0,0),n}function C1(e,t){const n=he(e,void 0),i=n.getFullYear(),r=n.getMonth(),s=Ae(n,0);return s.setFullYear(i,r+1,0),s.setHours(0,0,0,0),s.getDate()}function E1(){return Object.assign({},Lr())}function jh(e){return Math.trunc(e*t1)}function O1(e){const t=e/Jv;return Math.trunc(t)}function Uh(e,t,n){return D1(e,-1)}function qh(e,t,n){const i=E1(),r=A1(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?P1(r,t):R1(r,t)}function P1(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function R1(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function A1(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function I1(e,t){const n=z1(t);return"formatToParts"in n?N1(n,e):F1(n,e)}const L1={year:0,month:1,day:2,hour:3,minute:4,second:5};function N1(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=L1[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function F1(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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={},Xh=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")),B1=Xh==="06/25/2014, 00:00:00"||Xh==="06/25/2014 00:00:00";function z1(e){return Go[e]||(Go[e]=B1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Go[e]}function Ko(e,t,n,i,r,s,a){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(i,r,s,a),o}const Gh=36e5,H1=6e4,Zo={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Fr(e,t,n){if(!e)return 0;let i=Zo.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=Zo.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Kh(r)?-(r*Gh):NaN;if(i=Zo.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Kh(r,a)?(s=Math.abs(r)*Gh+a*H1,i[1]==="+"?-s:s):NaN}if(Y1(e)){t=new Date(t||Date.now());const a=n?t:V1(t),o=Qo(a,e);return-(n?o:W1(t,o,e))}return NaN}function V1(e){return Ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Qo(e,t){const n=I1(e,t),i=Ko(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function W1(e,t,n){let i=e.getTime()-t;const r=Qo(new Date(i),n);if(t===r)return t;i-=r-t;const s=Qo(new Date(i),n);return r===s?r:Math.max(r,s)}function Kh(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Zh={};function Y1(e){if(Zh[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Zh[e]=!0,!0}catch{return!1}}const $1=60*1e3,j1={X:function(e,t,n){const i=Jo(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Qh(i);case"XXXX":case"XX":return Ei(i);case"XXXXX":case"XXX":default:return Ei(i,":")}},x:function(e,t,n){const i=Jo(n.timeZone,e);switch(t){case"x":return Qh(i);case"xxxx":case"xx":return Ei(i);case"xxxxx":case"xxx":default:return Ei(i,":")}},O:function(e,t,n){const i=Jo(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+U1(i,":");case"OOOO":default:return"GMT"+Ei(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return qh("short",e,n);case"zzzz":default:return qh("long",e,n)}}};function Jo(e,t){const n=e?Fr(e,t,!0)/$1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Zs(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Ei(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Zs(Math.floor(i/60),2),s=Zs(Math.floor(i%60),2);return n+r+t+s}function Qh(e,t){return e%60===0?(e>0?"-":"+")+Zs(Math.abs(e)/60,2):Ei(e,t)}function U1(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+Zs(s,2)}function Jh(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const tf=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,tl=36e5,ef=6e4,q1=2,fe={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:tf};function Qs(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?q1:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=X1(e),{year:r,restDateString:s}=G1(i.date,n),a=K1(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let c=0,l;if(i.time&&(c=Z1(i.time),c===null||isNaN(c)))return new Date(NaN);if(i.timeZone||t.timeZone){if(l=Fr(i.timeZone||t.timeZone,new Date(o+c)),isNaN(l))return new Date(NaN)}else l=Jh(new Date(o+c)),l=Jh(new Date(o+c+l));return new Date(o+c+l)}else return new Date(NaN)}function X1(e){const t={};let n=fe.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=fe.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=fe.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function G1(e,t){if(e){const n=fe.YYY[t],i=fe.YYYYY[t];let r=fe.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=fe.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function K1(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=fe.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,sf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=fe.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return tS(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=fe.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return sf(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=fe.Www.exec(e),s)return r=parseInt(s[1],10)-1,af(r)?nf(t,r):new Date(NaN);if(s=fe.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return af(r,a)?nf(t,r,a):new Date(NaN)}return null}function Z1(e){let t,n,i=fe.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),el(t)?t%24*tl:NaN;if(i=fe.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),el(t,n)?t%24*tl+n*ef:NaN;if(i=fe.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return el(t,n,r)?t%24*tl+n*ef+r*1e3:NaN}return null}function nf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const Q1=[31,28,31,30,31,30,31,31,30,31,30,31],J1=[31,29,31,30,31,30,31,31,30,31,30,31];function rf(e){return e%400===0||e%4===0&&e%100!==0}function sf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=rf(e);if(i&&n>J1[t]||!i&&n>Q1[t])return!1}return!0}function tS(e,t){if(t<1)return!1;const n=rf(e);return!(n&&t>366||!n&&t>365)}function af(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function el(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const eS=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function nS(e,t,n={}){t=String(t);const i=t.match(eS);if(i){const r=Qs(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const o=s.indexOf(a),c=s[o-1]==="'",l=s.replace(a,"'"+j1[a[0]](r,a,n)+"'");return c?l.substring(0,o-1)+l.substring(o+1):l},t)}return M1(e,t,n)}function of(e,t,n){e=Qs(e,n);const i=Fr(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function iS(e,t,n,i){return i={...i,timeZone:t,originalDate:e},nS(of(e,t,{timeZone:i.timeZone}),n,i)}function rS(e,t,n){if(typeof e=="string"&&!e.match(tf))return Qs(e,{...n,timeZone:t});e=Qs(e,n);const i=Ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),r=Fr(t,new Date(i));return new Date(i+r)}function sS(e,t){return-Fr(e,t)}function nl(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const r=new Date(e);return iS(r,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const aS={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:5*60*1e3,tenMinutely:10*60*1e3,thirtyMinutely:30*60*1e3,hourly:60*60*1e3,twoHourly:2*60*60*1e3,twelveHourly:12*60*60*1e3,daily:60*60*24*1e3,weekly:60*60*24*7*1e3,trend:0};function il(e){return e&&gv.find(t=>e<=aS[t])||null}var Js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function oS(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ta={exports:{}};ta.exports,function(e,t){var n=200,i="__lodash_hash_undefined__",r=9007199254740991,s="[object Arguments]",a="[object Array]",o="[object Boolean]",c="[object Date]",l="[object Error]",u="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",g="[object Object]",p="[object Promise]",x="[object RegExp]",S="[object Set]",v="[object String]",k="[object Symbol]",D="[object WeakMap]",M="[object ArrayBuffer]",P="[object DataView]",E="[object Float32Array]",y="[object Float64Array]",_="[object Int8Array]",T="[object Int16Array]",O="[object Int32Array]",A="[object Uint8Array]",I="[object Uint8ClampedArray]",B="[object Uint16Array]",q="[object Uint32Array]",G=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,lt=/^\[object .+?Constructor\]$/,X=/^(?:0|[1-9]\d*)$/,Q={};Q[s]=Q[a]=Q[M]=Q[P]=Q[o]=Q[c]=Q[E]=Q[y]=Q[_]=Q[T]=Q[O]=Q[f]=Q[m]=Q[g]=Q[x]=Q[S]=Q[v]=Q[k]=Q[A]=Q[I]=Q[B]=Q[q]=!0,Q[l]=Q[u]=Q[D]=!1;var H=typeof Js=="object"&&Js&&Js.Object===Object&&Js,U=typeof self=="object"&&self&&self.Object===Object&&self,Y=H||U||Function("return this")(),xt=t&&!t.nodeType&&t,yt=xt&&!0&&e&&!e.nodeType&&e,vt=yt&&yt.exports===xt;function mt(w,L){return w.set(L[0],L[1]),w}function gt(w,L){return w.add(L),w}function z(w,L){for(var F=-1,K=w?w.length:0;++F<K&&L(w[F],F,w)!==!1;);return w}function j(w,L){for(var F=-1,K=L.length,$t=w.length;++F<K;)w[$t+F]=L[F];return w}function $(w,L,F,K){for(var $t=-1,Kt=w?w.length:0;++$t<Kt;)F=L(F,w[$t],$t,w);return F}function J(w,L){for(var F=-1,K=Array(w);++F<w;)K[F]=L(F);return K}function et(w,L){return w==null?void 0:w[L]}function nt(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function rt(w){var L=-1,F=Array(w.size);return w.forEach(function(K,$t){F[++L]=[$t,K]}),F}function it(w,L){return function(F){return w(L(F))}}function _t(w){var L=-1,F=Array(w.size);return w.forEach(function(K){F[++L]=K}),F}var ct=Array.prototype,Et=Function.prototype,te=Object.prototype,ce=Y["__core-js_shared__"],qt=function(){var w=/[^.]+$/.exec(ce&&ce.keys&&ce.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Ie=Et.toString,St=te.hasOwnProperty,Xt=te.toString,zt=RegExp("^"+Ie.call(St).replace(G,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Gt=vt?Y.Buffer:void 0,re=Y.Symbol,Ke=Y.Uint8Array,ci=it(Object.getPrototypeOf,Object),ze=Object.create,Ht=te.propertyIsEnumerable,Se=ct.splice,ui=Object.getOwnPropertySymbols,ka=Gt?Gt.isBuffer:void 0,Ma=it(Object.keys,Object),Qr=Wn(Y,"DataView"),di=Wn(Y,"Map"),Jr=Wn(Y,"Promise"),hi=Wn(Y,"Set"),mn=Wn(Y,"WeakMap"),gn=Wn(Object,"create"),ts=ue(Qr),es=ue(di),fi=ue(Jr),ic=ue(hi),rc=ue(mn),Ta=re?re.prototype:void 0,Da=Ta?Ta.valueOf:void 0;function pn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function Wi(){this.__data__=gn?gn(null):{}}function ns(w){return this.has(w)&&delete this.__data__[w]}function Ca(w){var L=this.__data__;if(gn){var F=L[w];return F===i?void 0:F}return St.call(L,w)?L[w]:void 0}function yn(w){var L=this.__data__;return gn?L[w]!==void 0:St.call(L,w)}function sc(w,L){var F=this.__data__;return F[w]=gn&&L===void 0?i:L,this}pn.prototype.clear=Wi,pn.prototype.delete=ns,pn.prototype.get=Ca,pn.prototype.has=yn,pn.prototype.set=sc;function He(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function ac(){this.__data__=[]}function oc(w){var L=this.__data__,F=$i(L,w);if(F<0)return!1;var K=L.length-1;return F==K?L.pop():Se.call(L,F,1),!0}function lc(w){var L=this.__data__,F=$i(L,w);return F<0?void 0:L[F][1]}function Ve(w){return $i(this.__data__,w)>-1}function cc(w,L){var F=this.__data__,K=$i(F,w);return K<0?F.push([w,L]):F[K][1]=L,this}He.prototype.clear=ac,He.prototype.delete=oc,He.prototype.get=lc,He.prototype.has=Ve,He.prototype.set=cc;function Hn(w){var L=-1,F=w?w.length:0;for(this.clear();++L<F;){var K=w[L];this.set(K[0],K[1])}}function uc(){this.__data__={hash:new pn,map:new(di||He),string:new pn}}function dc(w){return qi(this,w).delete(w)}function hc(w){return qi(this,w).get(w)}function We(w){return qi(this,w).has(w)}function fc(w,L){return qi(this,w).set(w,L),this}Hn.prototype.clear=uc,Hn.prototype.delete=dc,Hn.prototype.get=hc,Hn.prototype.has=We,Hn.prototype.set=fc;function Vn(w){this.__data__=new He(w)}function mc(){this.__data__=new He}function gc(w){return this.__data__.delete(w)}function pc(w){return this.__data__.get(w)}function Yi(w){return this.__data__.has(w)}function yc(w,L){var F=this.__data__;if(F instanceof He){var K=F.__data__;if(!di||K.length<n-1)return K.push([w,L]),this;F=this.__data__=new Hn(K)}return F.set(w,L),this}Vn.prototype.clear=mc,Vn.prototype.delete=gc,Vn.prototype.get=pc,Vn.prototype.has=Yi,Vn.prototype.set=yc;function bc(w,L){var F=as(w)||Gi(w)?J(w.length,String):[],K=F.length,$t=!!K;for(var Kt in w)St.call(w,Kt)&&!($t&&(Kt=="length"||Lc(Kt,K)))&&F.push(Kt);return F}function Le(w,L,F){var K=w[L];(!(St.call(w,L)&&ss(K,F))||F===void 0&&!(L in w))&&(w[L]=F)}function $i(w,L){for(var F=w.length;F--;)if(ss(w[F][0],L))return F;return-1}function _c(w,L){return w&&Ea(L,mi(L),w)}function is(w,L,F,K,$t,Kt,ke){var ee;if(K&&(ee=Kt?K(w,$t,Kt,ke):K(w)),ee!==void 0)return ee;if(!_n(w))return w;var Na=as(w);if(Na){if(ee=Ac(w),!L)return Oc(w,ee)}else{var Yn=Ze(w),Fa=Yn==u||Yn==h;if(Aa(w))return kc(w,L);if(Yn==g||Yn==s||Fa&&!Kt){if(nt(w))return Kt?w:{};if(ee=Pa(Fa?{}:w),!L)return Pc(w,_c(ee,w))}else{if(!Q[Yn])return Kt?w:{};ee=Ic(w,Yn,is,L)}}ke||(ke=new Vn);var Ba=ke.get(w);if(Ba)return Ba;if(ke.set(w,ee),!Na)var gi=F?Rc(w):mi(w);return z(gi||w,function(ls,Ki){gi&&(Ki=ls,ls=w[Ki]),Le(ee,Ki,is(ls,L,F,K,Ki,w,ke))}),ee}function xc(w){return _n(w)?ze(w):{}}function wc(w,L,F){var K=L(w);return as(w)?K:j(K,F(w))}function vc(w){return Xt.call(w)}function ji(w){if(!_n(w)||Nc(w))return!1;var L=os(w)||nt(w)?zt:lt;return L.test(ue(w))}function Sc(w){if(!bn(w))return Ma(w);var L=[];for(var F in Object(w))St.call(w,F)&&F!="constructor"&&L.push(F);return L}function kc(w,L){if(L)return w.slice();var F=new w.constructor(w.length);return w.copy(F),F}function Ui(w){var L=new w.constructor(w.byteLength);return new Ke(L).set(new Ke(w)),L}function Mc(w,L){var F=L?Ui(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.byteLength)}function Tc(w,L,F){var K=L?F(rt(w),!0):rt(w);return $(K,mt,new w.constructor)}function rs(w){var L=new w.constructor(w.source,V.exec(w));return L.lastIndex=w.lastIndex,L}function Dc(w,L,F){var K=L?F(_t(w),!0):_t(w);return $(K,gt,new w.constructor)}function Cc(w){return Da?Object(Da.call(w)):{}}function Ec(w,L){var F=L?Ui(w.buffer):w.buffer;return new w.constructor(F,w.byteOffset,w.length)}function Oc(w,L){var F=-1,K=w.length;for(L||(L=Array(K));++F<K;)L[F]=w[F];return L}function Ea(w,L,F,K){F||(F={});for(var $t=-1,Kt=L.length;++$t<Kt;){var ke=L[$t],ee=void 0;Le(F,ke,ee===void 0?w[ke]:ee)}return F}function Pc(w,L){return Ea(w,Oa(w),L)}function Rc(w){return wc(w,mi,Oa)}function qi(w,L){var F=w.__data__;return Xi(L)?F[typeof L=="string"?"string":"hash"]:F.map}function Wn(w,L){var F=et(w,L);return ji(F)?F:void 0}var Oa=ui?it(ui,Object):Ia,Ze=vc;(Qr&&Ze(new Qr(new ArrayBuffer(1)))!=P||di&&Ze(new di)!=f||Jr&&Ze(Jr.resolve())!=p||hi&&Ze(new hi)!=S||mn&&Ze(new mn)!=D)&&(Ze=function(w){var L=Xt.call(w),F=L==g?w.constructor:void 0,K=F?ue(F):void 0;if(K)switch(K){case ts:return P;case es:return f;case fi:return p;case ic:return S;case rc:return D}return L});function Ac(w){var L=w.length,F=w.constructor(L);return L&&typeof w[0]=="string"&&St.call(w,"index")&&(F.index=w.index,F.input=w.input),F}function Pa(w){return typeof w.constructor=="function"&&!bn(w)?xc(ci(w)):{}}function Ic(w,L,F,K){var $t=w.constructor;switch(L){case M:return Ui(w);case o:case c:return new $t(+w);case P:return Mc(w,K);case E:case y:case _:case T:case O:case A:case I:case B:case q:return Ec(w,K);case f:return Tc(w,K,F);case m:case v:return new $t(w);case x:return rs(w);case S:return Dc(w,K,F);case k:return Cc(w)}}function Lc(w,L){return L=L??r,!!L&&(typeof w=="number"||X.test(w))&&w>-1&&w%1==0&&w<L}function Xi(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function Nc(w){return!!qt&&qt in w}function bn(w){var L=w&&w.constructor,F=typeof L=="function"&&L.prototype||te;return w===F}function ue(w){if(w!=null){try{return Ie.call(w)}catch{}try{return w+""}catch{}}return""}function Fc(w){return is(w,!0,!0)}function ss(w,L){return w===L||w!==w&&L!==L}function Gi(w){return Bc(w)&&St.call(w,"callee")&&(!Ht.call(w,"callee")||Xt.call(w)==s)}var as=Array.isArray;function Ra(w){return w!=null&&zc(w.length)&&!os(w)}function Bc(w){return xn(w)&&Ra(w)}var Aa=ka||La;function os(w){var L=_n(w)?Xt.call(w):"";return L==u||L==h}function zc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=r}function _n(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function xn(w){return!!w&&typeof w=="object"}function mi(w){return Ra(w)?bc(w):Sc(w)}function Ia(){return[]}function La(){return!1}e.exports=Fc}(ta,ta.exports),ta.exports;const cn=(e,t)=>new Date(e.getTime()-sS(t,e));class le{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,"fineGrainedDefaultGranularity"),Re(this,"_startCustom"),Re(this,"_endCustom"),Re(this,"_allowedGranularitiesOverride"),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,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}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(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=7*24&&n.add("hourly"),i>=2*24&&n.add("daily"),i>=2*24*14&&n.add("weekly"),n}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){if(this.key==="custom")return{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t};if(mv.includes(this.key))return{type:"relative",time_range:this.key,tz:t};throw new Error("Unsupported relative time value for Explore")}tzAdjustedDate(t){if(!t)return new Date;const n=rS(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return of(n,t)}}class lS extends le{rawStart(t){let n=ln(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*7}}class cS extends le{rawStart(t){let n=Ci(this.tzAdjustedDate(t));return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*31}}class uS extends le{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=cn(n,t)),n}maximumTimeframeLength(){return 60*60*24*366}}class dS extends le{rawEnd(t){let n=ln(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=cn(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=ln(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=cn(i,t)),i}}class hS extends le{rawEnd(t){let n=Ci(this.tzAdjustedDate(t));return t&&(n=cn(n,t)),n}rawStart(t){let n=Ci(Uh(this.tzAdjustedDate(t)));return t&&(n=cn(n,t)),n}}class fS extends le{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=cn(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=cn(n,t)),n}}tt.FIFTEEN_MIN,new le({key:tt.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>60*15,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),tt.ONE_HOUR,new le({key:tt.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>60*60*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),tt.SIX_HOUR,new le({key:tt.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>60*60*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),tt.TWELVE_HOUR,new le({key:tt.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>60*60*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),tt.ONE_DAY,new le({key:tt.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>60*60*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),tt.SEVEN_DAY,new le({key:tt.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.THIRTY_DAY,new le({key:tt.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>60*60*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.NINETY_DAY,new le({key:tt.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>60*60*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_HUNDRED_EIGHTY_DAY,new le({key:tt.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>60*60*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.ONE_YEAR,new le({key:tt.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>60*60*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),tt.CURRENT_WEEK,new lS({key:tt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=ln(new Date,{weekStartsOn:1});return(Nr(Xo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.CURRENT_MONTH,new cS({key:tt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=Ci(new Date);return(Nr(Xo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_YEAR,new uS({key:tt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(Nr(Xo(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_WEEK,new dS({key:tt.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>60*60*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.PREVIOUS_MONTH,new hS({key:tt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=Ci(new Date),n=Ci(Uh(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=lf(t,n)),60*60*24*C1(new Date().setMonth(new Date().getMonth()-1))+jh(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_YEAR,new fS({key:tt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=lf(e,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+jh(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function lf(e,t){return O1(e.getTimezoneOffset()-t.getTimezoneOffset())}tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.FIFTEEN_MIN,tt.ONE_HOUR,tt.SIX_HOUR,tt.TWELVE_HOUR,tt.ONE_DAY,tt.SEVEN_DAY,tt.THIRTY_DAY,tt.NINETY_DAY,tt.ONE_HUNDRED_EIGHTY_DAY,tt.ONE_YEAR,tt.CURRENT_WEEK,tt.CURRENT_MONTH,tt.CURRENT_YEAR,tt.PREVIOUS_WEEK,tt.PREVIOUS_MONTH,tt.PREVIOUS_YEAR;const mS=new Map(Ih.map(e=>[e.code,{code:e.code,name:e.name}])),rl=e=>{var t;return((t=mS.get(e))==null?void 0:t.name)||e};var cf={exports:{}};(function(e){(function(){function t(l,u){if(u.separator===!1||l<1e3)return l.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(l).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(l,u,h){var f=l/u,m=h.round?"round":"floor";return h.decimal===!1?(l=Math[m](f),l.toString()):(h.precision?l=f:l=f<10?Math[m](f*10)/10:Math[m](f),l=l.toString(),typeof h.decimal=="string"&&(l=l.replace(".",h.decimal)),l)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function c(l,u){var h;u=u||{};var f=l<0;f&&(l=Math.abs(l)),u.precision&&(l=parseFloat(l.toPrecision(u.precision)));var m=u.min10k?r:i;return l<m||u.precision&&u.precision>Math.log10(l)?h=t(n(l,1,u),u):l<s?h=n(l,i,u)+"k":l<a?h=n(l,s,u)+"m":l<o?h=t(n(l,a,u),u)+"b":h=t(n(l,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}c.addCommas=t,e.exports=c})()})(cf);var gS=cf.exports;const sl=oS(gS);var uf;const ea=new Intl.NumberFormat(((uf=document==null?void 0:document.documentElement)==null?void 0:uf.lang)||"en-US");function Br({i18n:e}){const t=(i,r)=>{if(isNaN(i))return"0 B";const s=r?Math.pow(2,50):1e15,a=r?Math.pow(2,40):1e12,o=r?Math.pow(2,30):1e9,c=r?Math.pow(2,20):1e6,l=r?Math.pow(2,10):1e3;let u;return i>=s?u=e.formatNumber(Number.parseFloat((i/s).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=e.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=e.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=c?u=e.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=l?u=e.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=e.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},n=(i,r="USD")=>isNaN(i)?r==="USD"?"$0.00":`${i}`:i>=.01||r!=="USD"?e.formatNumber(i,{style:"currency",currency:r}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,r,{isBytes1024:s=!1,currency:a="USD",approximate:o=!1,translateUnit:c=l=>l}={})=>{const l=c(r,i);switch(r){case"bytes":return t(i,s);case"usd":return n(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${sl(i,{capital:!0})} ${l}`:i>=.01?`${ea.format(Number.parseFloat(i.toFixed(2)))} ${l}`:`${Number.parseFloat(i.toPrecision(4))} ${l}`}},formatBytes:t,formatCost:n,formatRange:(i,r,s,{isBytes1024:a=!1,currency:o="USD",approximate:c=!1,translateUnit:l=u=>u}={})=>{const u=l(s,r);switch(s){case"bytes":return`${t(i,a)} - ${t(r,a)}`;case"usd":return`${n(i,o)} - ${n(r,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(r))return`${i} - ${r}`;if(c)return`${sl(i,{capital:!0})} - ${sl(r,{capital:!0})} ${u}`}const h=i>=.01?`${ea.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=r>=.01?`${ea.format(Number.parseFloat(r.toFixed(2)))}`:`${Number.parseFloat(r.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const na=e=>["interactive","zoom-interactive"].includes(e),df=(e,t,n,i)=>{var c,l;const{tooltip:r}=t;if(r.opacity===0&&!na(e.interactionMode)){e.showTooltip=!1;return}const{i18n:s}=pt.useI18n(),{formatUnit:a}=Br({i18n:s}),o=e.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(r.body&&!na(e.interactionMode)){const u=r.labelColors,h=((l=(c=t.chart.config)==null?void 0:c.options)==null?void 0:l.indexAxis)==="y"?"x":"y";e.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(r.dataPoints[0].parsed.x,n):Wr({tickValue:new Date(r.dataPoints[0].parsed.x),granularity:n}),e.tooltipSeries=r.dataPoints.map((f,m)=>{const g=f.parsed[h],p=a(g,e.units,{translateUnit:e.translateUnit}),x=f.dataset.label;return{backgroundColor:u[m].backgroundColor,borderColor:u[m].borderColor,label:x,value:p,rawValue:g,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(o),e.left=`${r.x}px`,e.top=`${r.y}px`,e.showTooltip=!0}},hf=(e,t)=>{var a,o;const{tooltip:n}=t,{i18n:i}=pt.useI18n(),{formatUnit:r}=Br({i18n:i});if(n.opacity===0&&!na(e.interactionMode)){e.showTooltip=!1;return}const s=e.chartTooltipSortFn||((c,l)=>l.rawValue-c.rawValue);if(n.body&&!na(e.interactionMode)){const c=n.labelColors,l=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(e.chartType);u?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[l],g=r(m,e.units,{translateUnit:e.translateUnit});let p;return u?p=h.dataset.labels[h.dataIndex]:p=h.dataset.label,{backgroundColor:c[f].backgroundColor,borderColor:c[f].borderColor,label:p,value:g,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(s),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},pS=e=>e&&e.datasets&&e.datasets.length,yS=e=>pS(e)&&e.datasets.some(t=>t.data.length),bS=e=>e.datasets.some(t=>t.data[0]&&Bo(t.data[0].x)),_S=e=>!!yS(e)&&e.datasets.some(t=>t.data.length==1),xS=e=>bS(e)&&e.datasets.some(t=>t.data[0]&&t.data[0].x.toString().length>=13),al=(e,t,n)=>{const r=Math.min(t/1150,1);return e.x<n?e.x+t*.15*(1-r):e.x-t*1.15*(1-r)},wS=(e,t,n)=>e.y<n?e.y+t*.15:e.y-t*.5;function ol(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const ff=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(r=>{var s;return!((s=t==null?void 0:t[r.text])!=null&&s.isThreshold)}).map((r,s)=>({...r,value:t&&t[r.text],isSegmentEmpty:i.datasets[s].isSegmentEmpty})).sort(n)},vS=2,mf=10,gf=12,ia=10,pf="#6c7489",SS="#d60027",kS="#ad000e",ll="#6c7489",yf="#52596e",MS="#007d60",TS="#995c00",DS="#ffc400",zr="16px",CS="20px",ES="'Inter', Roboto, Helvetica, sans-serif",bf="24px",OS="40px",PS="48px",_f={"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"}},un=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ra=(e,t)=>(t||un)[e%un.length],xf=(e,t)=>{e[0]==="#"&&(e=e.slice(1));let n=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16);n=n-t,i=i-t,r=r-t,n>255?n=255:n<0&&(n=0),i>255?i=255:i<0&&(i=0),r>255?r=255:r<0&&(r=0);const s=n.toString(16).length===1?"0"+n.toString(16):n.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=r.toString(16).length===1?"0"+r.toString(16):r.toString(16);return`#${s}${a}${o}`},wf="#6f7787",vf={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"}},RS=e=>{var n;const t=Math.floor(parseInt(e,10)/100)*100;return((n=vf[t])==null?void 0:n.background)||"#fafafa"},AS={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},IS={"4XX":"#FFBA81","5XX":"#FF8484"},LS={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},NS="#dad4c7",Sf="#afb7c5",FS=e=>{const t=Object.entries(_f).find(([n])=>new RegExp(n).test(e));return t&&t[1]||_f.standard},cl=(e,t,n,i)=>{let r;return n?r=Sf:Array.isArray(i)?r=ra(e,i):r=i[t],r||ra(e)},sa=e=>{switch(e){case"error":return SS;case"warning":return DS;case"neutral":return pf;default:return pf}},BS={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},zS=2,HS=0,ul=new Map,dl=(e,t)=>{const{i18n:n}=pt.useI18n(),{formatBytes:i}=Br({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):ea.format(e)},kf=e=>{const n=document.createElement("canvas").getContext("2d"),i=It({});return n.font=i.string,n.measureText(e).width},VS=()=>{const e="label_height";if(!ul.has(e)){const t=It({});ul.set(e,t.lineHeight)}return ul.get(e)},WS=e=>e.datasets.reduce((t,n)=>t+n.data.reduce((i,r)=>isNaN(r)?i:i+r,0),0),Mf=(e,t)=>t.datasets.reduce((n,i,r)=>e.isDatasetVisible(r)?n+i.data.reduce((s,a)=>isNaN(a)?s:s+a,0):n,0),Tf=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,hl="#e0e4ea",YS={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"]},Hr=(e,t)=>{let n=1;const i=YS[e],r=new Map;for(const s of t)r.set(s,i[n]),n=n%(i.length-1)+1;return r.set(-1,i[0]),r},Df=new Map([[100,Hr("100",[100,101,102,103])],[200,Hr("200",[200,201,202,203,204,205,206,207,208,226])],[300,Hr("300",[300,301,302,303,304,305,307,308])],[400,Hr("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,Hr("500",[500,501,502,503,504,505,506,507,508,510,511])]]),fl=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100,i=Df.get(n);return i===void 0?hl:i.get(t)??i.get(-1)??hl},$S=e=>{const t=fl(e);return{solid:t,light:t}},aa={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=fl(`${t}`),e),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function Cf(e,t,n){const i=Sh(),r=qS(e,n.timeZone,n.locale??i.locale);return"formatToParts"in r?jS(r,t):US(r,t)}function jS(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function US(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function qS(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function XS(e,t){const n=JS(t);return"formatToParts"in n?KS(n,e):ZS(n,e)}const GS={year:0,month:1,day:2,hour:3,minute:4,second:5};function KS(e,t){try{const n=e.formatToParts(t),i=[];for(let r=0;r<n.length;r++){const s=GS[n[r].type];s!==void 0&&(i[s]=parseInt(n[r].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function ZS(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);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 ml={},Ef=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")),QS=Ef==="06/25/2014, 00:00:00"||Ef==="06/25/2014 00:00:00";function JS(e){return ml[e]||(ml[e]=QS?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ml[e]}function Of(e,t,n,i,r,s,a){const o=new Date(0);return o.setUTCFullYear(e,t,n),o.setUTCHours(i,r,s,a),o}const Pf=36e5,tk=6e4,gl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function pl(e,t,n){if(!e)return 0;let i=gl.timezoneZ.exec(e);if(i)return 0;let r,s;if(i=gl.timezoneHH.exec(e),i)return r=parseInt(i[1],10),Rf(r)?-(r*Pf):NaN;if(i=gl.timezoneHHMM.exec(e),i){r=parseInt(i[2],10);const a=parseInt(i[3],10);return Rf(r,a)?(s=Math.abs(r)*Pf+a*tk,i[1]==="+"?-s:s):NaN}if(ik(e)){t=new Date(t||Date.now());const a=n?t:ek(t),o=yl(a,e);return-(n?o:nk(t,o,e))}return NaN}function ek(e){return Of(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function yl(e,t){const n=XS(e,t),i=Of(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let r=e.getTime();const s=r%1e3;return r-=s>=0?s:1e3+s,i-r}function nk(e,t,n){let r=e.getTime()-t;const s=yl(new Date(r),n);if(t===s)return t;r-=s-t;const a=yl(new Date(r),n);return s===a?s:Math.max(s,a)}function Rf(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Af={};function ik(e){if(Af[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Af[e]=!0,!0}catch{return!1}}const rk=60*1e3,sk={X:function(e,t,n){const i=bl(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return If(i);case"XXXX":case"XX":return Oi(i);case"XXXXX":case"XXX":default:return Oi(i,":")}},x:function(e,t,n){const i=bl(n.timeZone,e);switch(t){case"x":return If(i);case"xxxx":case"xx":return Oi(i);case"xxxxx":case"xxx":default:return Oi(i,":")}},O:function(e,t,n){const i=bl(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+ak(i,":");case"OOOO":default:return"GMT"+Oi(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Cf("short",e,n);case"zzzz":default:return Cf("long",e,n)}}};function bl(e,t){const n=e?pl(e,t,!0)/rk:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function oa(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Oi(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=oa(Math.floor(i/60),2),s=oa(Math.floor(i%60),2);return n+r+t+s}function If(e,t){return e%60===0?(e>0?"-":"+")+oa(Math.abs(e)/60,2):Oi(e,t)}function ak(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),r=Math.floor(i/60),s=i%60;return s===0?n+String(r):n+String(r)+t+oa(s,2)}function Lf(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const ok=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,_l=36e5,Nf=6e4,lk=2,me={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,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:ok};function Ff(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?lk:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=ck(e),{year:r,restDateString:s}=uk(i.date,n),a=dk(s,r);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let c=0,l;if(i.time&&(c=hk(i.time),c===null||isNaN(c)))return new Date(NaN);if(i.timeZone||t.timeZone){if(l=pl(i.timeZone||t.timeZone,new Date(o+c)),isNaN(l))return new Date(NaN)}else l=Lf(new Date(o+c)),l=Lf(new Date(o+c+l));return new Date(o+c+l)}else return new Date(NaN)}function ck(e){const t={};let n=me.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=me.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const r=me.timeZone.exec(i);r?(t.time=i.replace(r[1],""),t.timeZone=r[1].trim()):t.time=i}return t}function uk(e,t){if(e){const n=me.YYY[t],i=me.YYYYY[t];let r=me.YYYY.exec(e)||i.exec(e);if(r){const s=r[1];return{year:parseInt(s,10),restDateString:e.slice(s.length)}}if(r=me.YY.exec(e)||n.exec(e),r){const s=r[1];return{year:parseInt(s,10)*100,restDateString:e.slice(s.length)}}}return{year:null}}function dk(e,t){if(t===null)return null;let n,i,r;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let s=me.MM.exec(e);if(s)return n=new Date(0),i=parseInt(s[1],10)-1,Hf(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(s=me.DDD.exec(e),s){n=new Date(0);const a=parseInt(s[1],10);return gk(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(s=me.MMDD.exec(e),s){n=new Date(0),i=parseInt(s[1],10)-1;const a=parseInt(s[2],10);return Hf(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(s=me.Www.exec(e),s)return r=parseInt(s[1],10)-1,Vf(r)?Bf(t,r):new Date(NaN);if(s=me.WwwD.exec(e),s){r=parseInt(s[1],10)-1;const a=parseInt(s[2],10)-1;return Vf(r,a)?Bf(t,r,a):new Date(NaN)}return null}function hk(e){let t,n,i=me.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),xl(t)?t%24*_l:NaN;if(i=me.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),xl(t,n)?t%24*_l+n*Nf:NaN;if(i=me.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const r=parseFloat(i[3].replace(",","."));return xl(t,n,r)?t%24*_l+n*Nf+r*1e3:NaN}return null}function Bf(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const r=i.getUTCDay()||7,s=t*7+n+1-r;return i.setUTCDate(i.getUTCDate()+s),i}const fk=[31,28,31,30,31,30,31,31,30,31,30,31],mk=[31,29,31,30,31,30,31,31,30,31,30,31];function zf(e){return e%400===0||e%4===0&&e%100!==0}function Hf(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=zf(e);if(i&&n>mk[t]||!i&&n>fk[t])return!1}return!0}function gk(e,t){if(t<1)return!1;const n=zf(e);return!(n&&t>366||!n&&t>365)}function Vf(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function xl(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const pk=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function wl(e,t,n={}){t=String(t);const i=t.match(pk);if(i){const r=Ff(n.originalDate||e,n);t=i.reduce(function(s,a){if(a[0]==="'")return s;const o=s.indexOf(a),c=s[o-1]==="'",l=s.replace(a,"'"+sk[a[0]](r,a,n)+"'");return c?l.substring(0,o-1)+l.substring(o+1):l},t)}return qs(e,t,n)}function yk(e,t,n){e=Ff(e,n);const i=pl(t,e,!0),r=new Date(e.getTime()-i),s=new Date(0);return s.setFullYear(r.getUTCFullYear(),r.getUTCMonth(),r.getUTCDate()),s.setHours(r.getUTCHours(),r.getUTCMinutes(),r.getUTCSeconds(),r.getUTCMilliseconds()),s}function Vr(e,t,n,i){return i={...i,timeZone:t,originalDate:e},wl(yk(e,t,{timeZone:i.timeZone}),n,i)}const bk=(e,t)=>`${Vr(e,t,"yyyy")} W${Vr(e,t,"II")}`,vl="yyyy-MM-dd h:mm:ss a",Sl="h:mm:ss a",ii="yyyy-MM-dd h:mm a",Pi="h:mm a",_k="yyyy-MM-dd",kl="MMM dd, yyyy h:mm:ss a",In="MMM dd, yyyy h:mm a",xk={secondly:e=>e?vl:Sl,tenSecondly:e=>e?vl:Sl,thirtySecondly:e=>e?vl:Sl,minutely:e=>e?ii:Pi,fiveMinutely:e=>e?ii:Pi,tenMinutely:e=>e?ii:Pi,thirtyMinutely:e=>e?ii:Pi,hourly:e=>e?ii:Pi,twoHourly:e=>e?ii:Pi,twelveHourly:()=>ii,daily:()=>_k},wk={secondly:()=>kl,tenSecondly:()=>kl,thirtySecondly:()=>kl,minutely:()=>In,fiveMinutely:()=>In,tenMinutely:()=>In,thirtyMinutely:()=>In,hourly:()=>In,twoHourly:()=>In,twelveHourly:()=>In,daily:()=>In};function Wf({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:r,tooltipMap:s,defaultFormat:a}){const o=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return bk(e,o);if(r&&r[t]){const c=r[t](i);return Vr(e,o,c)}if(s&&s[t]){const c=s[t]();return Vr(e,o,c)}return Vr(e,o,a)}const vk=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>Wf({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:xk,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Wr=({tickValue:e,granularity:t,timezone:n})=>Wf({tickValue:e,granularity:t,timezone:n,tooltipMap:wk,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Sk=e=>{var n,i,r,s,a;const{i18n:t}=pt.useI18n();return(e==null?void 0:e.status)===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(e==null?void 0:e.status)===408?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(n=e==null?void 0:e.response)==null?void 0:n.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(s=(r=e.response)==null?void 0:r.data)==null?void 0:s.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(e==null?void 0:e.message)}};function kk(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:c=>({label:c.dataset.label,value:c.label})}};Ce.positioners[n]=function(c,l){if(!c.length||e.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=u.width/2,m=al(l,h,f),g=l.y,p=l.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:g-e.tooltipState.offsetY,xAlign:p}},yo.modes.customInteractionMode=function(c,l){const u=En(l,c),h=[];return yo.evaluateInteractionItems(c,c.options.indexAxis||"x",u,(f,m,g)=>{c.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&c.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g}),c.options.indexAxis==="x"&&f.inXRange(u.x,!0)&&c.data.datasets[m].data[g]&&h.push({element:f,datasetIndex:m,index:g})}),h};const r=e.numLabels.value>25?mf:gf,s=({chart:c,index:l})=>{var h;const u=c.data;return{size:r,style:(h=u==null?void 0:u.isLabelEmpty)!=null&&h[l]?"italic":"normal"}},a=(c,l,u)=>c.chart.options.indexAxis===c.axis?(l=c.getLabelForValue(u),l&&l.length>ia?l.slice(0,ia)+"...":l):c.getLabelForValue(Number(l)),o=d.computed(()=>{var c,l,u,h,f,m,g,p;return{indexAxis:e.indexAxis,skipNull:!0,scales:{x:{border:{display:!1},stacked:e.stacked.value,grid:{display:!1,drawBorder:!1},ticks:{maxRotation:90,autoSkip:!1,font:s,callback:function(x,S){return a(this,x,S)}},title:{display:e.indexAxis==="y"?!st((c=e.metricAxesTitle)==null?void 0:c.value):!st((l=e.dimensionAxesTitle)==null?void 0:l.value),text:e.indexAxis==="y"?(u=e.metricAxesTitle)==null?void 0:u.value:(h=e.dimensionAxesTitle)==null?void 0:h.value,padding:{top:10},font:{weight:"bold"}}},y:{border:{display:!1},stacked:e.stacked.value,beginAtZero:!0,grid:{display:!1,drawBorder:!1},ticks:{font:s,callback:function(x,S){return a(this,x,S)}},title:{display:e.indexAxis==="x"?!st((f=e.metricAxesTitle)==null?void 0:f.value):!st((m=e.dimensionAxesTitle)==null?void 0:m.value),text:e.indexAxis==="x"?(g=e.metricAxesTitle)==null?void 0:g.value:(p=e.dimensionAxesTitle)==null?void 0:p.value,padding:{bottom:20},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:x=>{hf(e.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1}});return d.getCurrentInstance()&&d.onUnmounted(()=>{Ce.positioners[n]&&delete Ce.positioners[n]}),o}_e.register(...E_);const Mk=(e,t)=>{const n=t.datasets.map(r=>r.label),i=e.datasets.map(r=>r.label);return e.datasets.length===t.datasets.length&&n.every((r,s)=>r===i[s])};function Tk(e,t,n,i,r){const s=d.shallowRef(null),a=(o,c)=>{if(t.value)return new _e(t.value,{type:e,data:o,plugins:i,options:c})};return d.onMounted(()=>{s.value=a(n.value,r.value)}),d.onBeforeUnmount(()=>{st(s.value)||s.value.destroy()}),d.watch(n,(o,c)=>{if(Mk(c,o)&&!st(s.value)){for(const[l,u]of o.datasets.entries())Object.assign(s.value.data.datasets[l],u);s.value.data.labels=o.labels,s.value.update()}else st(s.value)||s.value.destroy(),s.value=a(o,r.value)}),d.watch(t,()=>{st(s.value)||s.value.destroy(),s.value=a(n.value,r.value)}),d.watch(r,(o,c)=>{(o.indexAxis!==c.indexAxis||JSON.stringify(o.scales.x.title)!==JSON.stringify(c.scales.x.title)||JSON.stringify(o.scales.y.title)!==JSON.stringify(c.scales.y.title))&&(st(s.value)||s.value.destroy(),s.value=a(n.value,o))}),s}var ve=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ml(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yf={exports:{}};(function(e){(function(){function t(l,u){if(u.separator===!1||l<1e3)return l.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(l).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(l,u,h){var f=l/u,m=h.round?"round":"floor";return h.decimal===!1?(l=Math[m](f),l.toString()):(h.precision?l=f:l=f<10?Math[m](f*10)/10:Math[m](f),l=l.toString(),typeof h.decimal=="string"&&(l=l.replace(".",h.decimal)),l)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function c(l,u){var h;u=u||{};var f=l<0;f&&(l=Math.abs(l)),u.precision&&(l=parseFloat(l.toPrecision(u.precision)));var m=u.min10k?r:i;return l<m||u.precision&&u.precision>Math.log10(l)?h=t(n(l,1,u),u):l<s?h=n(l,i,u)+"k":l<a?h=n(l,s,u)+"m":l<o?h=t(n(l,a,u),u)+"b":h=t(n(l,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}c.addCommas=t,e.exports=c})()})(Yf);var Dk=Yf.exports;const Yr=Ml(Dk);function Ck(e,t,n){const{i18n:i}=pt.useI18n(),{formatBytes:r}=Br({i18n:i}),{translateUnit:s}=pt.useTranslatedUnits();return{legendValues:d.computed(()=>e.value.datasets.reduce((o,c)=>{const l=c.total?c.total:c.data.reduce((h,f)=>h+(typeof f=="number"?Number(f)||0:Number(f&&f.y)||0),0);let u;if(n.value==="bytes")u=r(l);else{const h=s(n.value,l);u=i&&i.t("legend.datapointValueDisplay",{value:Yr(l,{capital:!0}),unit:h})||`${Yr(l,{capital:!0})} ${n.value}`}return{...o,[c.label]:{raw:l,formatted:u,isThreshold:c.isThreshold}}},{}))}}function Ek(e){return d.computed(()=>{var r;if(!((r=e.value)!=null&&r.meta))return"";const n=e.value.meta.start_ms,i=e.value.meta.end_ms;return n&&i?`${nl(n)} - ${nl(i,{includeTZ:!0})}`:""})}function Ok(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:s=>({label:s.dataset.label,value:s.label})}};Ce.positioners[n]=function(s,a){if(!s.length)return!1;const o=this.chart.canvas.getBoundingClientRect(),c=e.tooltipState.width||this.width,l=o.width/2,u=al(a,c,l),h=a.y,f=a.x<l?"left":"center";return{x:u-e.tooltipState.offsetX,y:h,xAlign:f}};const r=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:s=>{hf(e.tooltipState,s)}}}}));return d.onUnmounted(()=>{Ce.positioners[n]&&delete Ce.positioners[n]}),{options:r}}function Pk(e){const t=d.computed(()=>{var c,l;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:10,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return vk({tickValue:h,granularity:e.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!st((c=e.dimensionAxesTitle)==null?void 0:c.value),text:(l=e.dimensionAxesTitle)==null?void 0:l.value,padding:{top:2},font:{weight:"bold"}},border:{display:!1},stacked:e.stacked.value}}),n=d.computed(()=>{var c,l;return{title:{display:!st((c=e.metricAxesTitle)==null?void 0:c.value),text:(l=e.metricAxesTitle)==null?void 0:l.value,padding:{bottom:10},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),r=`lineChartTooltipPosition-${e.tooltipState.chartID}`,s={enabled:!1,position:r};Ce.positioners[r]=function(c,l){if(!c.length||e.tooltipState.interactionMode==="interactive")return!1;const u=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=e.tooltipState.height||this.height,m=u.width/2,g=u.height/2,p=al(l,h,m);let x=wS(l,f,g);const S=l.y<g?"top":"bottom",v=l.x<m?"left":"center";return f>u.height&&(x=0),{x:p,y:x,xAlign:v,yAlign:S}};const a=d.computed(()=>{const c=Number(e.timeRangeMs.value),l=new Date,u=new Date(l.getTime()-c);return qw(c)>24||u.getDate()!==l.getDate()}),o=d.computed(()=>{var c,l;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(c=e.pointsWithoutHover)!=null&&c.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:n.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...s,external:u=>{df(e.tooltipState,u,e.granularity.value)}},thresholdPlugin:{threshold:(l=e.threshold)==null?void 0:l.value}},interaction:{mode:"index",intersect:!1}}});return d.onUnmounted(()=>{Ce.positioners[r]&&delete Ce.positioners[r]}),{options:o}}function Rk(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:r,pivotRecords:s,rowLabels:a,colorPalette:o}=e,{i18n:c}=pt.useI18n();return t?i.map(u=>({label:c&&c.te(`chartLabels.${u}`)&&c.t(`chartLabels.${u}`)||u,backgroundColor:ra(i.indexOf(u),un),data:a.map((h,f)=>n?s[`${h.id},${u}`]||0:s[`${f},${u}`]||null)})):Array.from(r).flatMap((u,h)=>{if(!u)return[];const f=cl(h,u.name,u.id==="empty",o);return{label:c&&c.te(`chartLabels.${u.name}`)&&c.t(`chartLabels.${u.name}`)||u.name,backgroundColor:f,data:a.map(m=>s[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function Ak(e,t){const{i18n:n}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a}=t.value.meta,o=s&&Object.keys(s),c=a&&a.length>1,l=s&&o&&o.length>0,u=l&&o.length>1;if(!r.length||!a)return{datasets:[],labels:[]};const h=l&&o||a,f=h[0],m=h.length>1?h[1]:h[0],g=Object.fromEntries(c?r.flatMap(_=>a.map((T,O)=>{const A=_.event[f],I=l?`${A},${T}`:`${O},${T}`,B=_.event[T];return[I,B]})):r.map(_=>{const T=l?`${_.event[f]},${_.event[m]}`:`${f},${m}`,O=_.event[a[0]];return[T,O]})),p=Object.keys(g).reduce((_,T)=>{const[O]=T.split(","),A=g[T];return _[O]?_[O]+=A:_[O]=A,_},{}),x=Object.entries(p).sort(([,_],[,T])=>Number(T)-Number(_)).map(([_])=>_),S=s[f],v=s[m];let k=l&&S&&Object.entries(S).map(([_,T])=>({id:_,name:T.name}))||a.map(_=>({id:_,name:_})),D=l&&v&&Object.entries(v).map(([_,T])=>({id:_,name:T.name}))||a.map(_=>({id:_,name:_}));if(l&&f==="country_code"&&(k=k.map(_=>({..._,name:rl(_.id)||_.name}))),l&&m==="country_code"&&(D=D.map(_=>({..._,name:rl(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(k.sort((_,T)=>x.indexOf(_.id)-x.indexOf(T.id)),D.sort((_,T)=>x.indexOf(_.id)-x.indexOf(T.id))),!k||!D)return{labels:[],datasets:[]};const M=Rk({isMultiMetric:c,hasDimensions:l,metricNames:a,dimensionFieldNames:h,barSegmentLabels:D,pivotRecords:g,rowLabels:k,colorPalette:e.colorPalette||un}),P=l?k.map(_=>n&&n.te(`chartLabels.${_.name}`)&&n.t(`chartLabels.${_.name}`)||_.name):a.map(_=>n&&n.te(`chartLabels.${_}`)&&n.t(`chartLabels.${_}`)||_),E=k.map(_=>_.id==="empty");return{labels:P,datasets:M,isLabelEmpty:E,isMultiDimension:u}}}catch(r){return console.error(r),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const Ik=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,r)=>i+r*n),Lk=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Ch(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},Nk=(e,t,n,i,r)=>{const a=Math.max(t-6e4,Math.max(...(r||[]).map(l=>new Date(l.timestamp).valueOf()))),o=Math.floor((e-i)/n)*n+i,c=Math.floor((a-i)/n)*n+i+n;return Ik(o,c,n)};function Fk(e,t){const{i18n:n}=pt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const r=t.value.data,{display:s,metric_names:a,start_ms:o,end_ms:c}=t.value.meta;if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const l=s&&Object.keys(s)||a,u=l&&l[0],h=s[u];let f=s&&h&&Object.keys(h).map(D=>({id:D,name:h[D].name}))||a.map(D=>({id:D,name:D}));u==="country_code"&&(f=f.map(D=>({...D,name:rl(D.id)||D.name})));const m=t.value.meta.granularity_ms;if(typeof m!="number"||isNaN(m)||!isFinite(m)||m===0)return console.error("Invalid step value:",m),{datasets:[],labels:[]};if(!r.length)return{datasets:[],labels:[]};const g=Lk(o),p=Nk(o,c,m,g,r),x=new Set,S=r!=null&&r.length?r.reduce((D,M)=>{const P=new Date(M.timestamp).valueOf(),E=M.event;for(const y of a)x.add(y),P in D||(D[P]={}),y in D[P]||(D[P][y]={});for(const y of a)f.forEach(_=>{E[u]===_.id||y===_.id?(D[P][y]||(D[P][y]={}),D[P][y][_.name]=Math.round(Number(E[y])*1e3)/1e3):l.length||(D[P][y]||(D[P][y]={}),D[P][y][_.name]=Math.round(Number(E[_.id])*1e3)/1e3)});return D},{}):{},k=[...a.length===1?a.flatMap(D=>f.map(M=>[D,M.name,M.id==="empty"])):f.map(D=>[D.name,D.name,D.id==="empty"])].map(([D,M,P],E)=>{const y=p.map(A=>A in S&&D in S[A]?{x:A,y:S[A][D][M]||0}:{x:A,y:0});let{colorPalette:_,fill:T}=e;st(_)&&(_=un);const O=cl(E,M,P,_);return{rawDimension:M,rawMetric:D,label:n&&n.te(`chartLabels.${M}`)&&n.t(`chartLabels.${M}`)||M,borderColor:O,backgroundColor:O,data:y,total:y.reduce((A,{y:I})=>A+Number(I),0),...BS,fill:T,borderWidth:T?HS:zS,isSegmentEmpty:P}});return u==="status_code"||u==="status_code_grouped"?k.sort((D,M)=>(D.label??"")<(M.label??"")?-1:1):k.sort((D,M)=>Number(D.total)<Number(M.total)?-1:1),{datasets:k}}}catch(r){return console.error(r),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const Bk=(e,t)=>{d.watch([e,t],(n,i,r)=>{const[s,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,s),r(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function zk(){const{i18n:e}=pt.useI18n();return{translateUnit:(n,i)=>{const r=i===1,s=`chartUnits.${n}`;return n==="usd"?"":e.te(s)?e.t(s,{plural:r?"":"s"}):n}}}const Hk="analytics-query-provider",$f=2;function Vk(){const e=d.inject(Hk);return{evaluateFeatureFlag:(n,i)=>e?e.evaluateFeatureFlagFn(n,i):i}}function Tl(e){return d.getCurrentScope()?(d.onScopeDispose(e),!0):!1}const jf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Wk=e=>e!=null,Yk=Object.prototype.toString,$k=e=>Yk.call(e)==="[object Object]";function la(e){return Array.isArray(e)?e:[e]}function jk(e){return d.getCurrentInstance()}function Uk(e,t={}){if(!d.isRef(e))return d.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=d.customRef(()=>({get(){return e.value[i]},set(r){var s;if((s=d.toValue(t.replaceRef))!=null?s:!0)if(Array.isArray(e.value)){const o=[...e.value];o[i]=r,e.value=o}else{const o={...e.value,[i]:r};Object.setPrototypeOf(o,Object.getPrototypeOf(e.value)),e.value=o}else e.value[i]=r}}));return n}function qk(e,t=!0,n){jk()?d.onMounted(e,n):t?e():d.nextTick(e)}function Xk(e,t,n){return d.watch(e,t,{...n,immediate:!0})}const ca=jf?window:void 0;function Ri(e){var t;const n=d.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function $r(...e){const t=[],n=()=>{t.forEach(o=>o()),t.length=0},i=(o,c,l,u)=>(o.addEventListener(c,l,u),()=>o.removeEventListener(c,l,u)),r=d.computed(()=>{const o=la(d.toValue(e[0])).filter(c=>c!=null);return o.every(c=>typeof c!="string")?o:void 0}),s=Xk(()=>{var o,c;return[(c=(o=r.value)==null?void 0:o.map(l=>Ri(l)))!=null?c:[ca].filter(l=>l!=null),la(d.toValue(r.value?e[1]:e[0])),la(d.unref(r.value?e[2]:e[1])),d.toValue(r.value?e[3]:e[2])]},([o,c,l,u])=>{if(n(),!(o!=null&&o.length)||!(c!=null&&c.length)||!(l!=null&&l.length))return;const h=$k(u)?{...u}:u;t.push(...o.flatMap(f=>c.flatMap(m=>l.map(g=>i(f,m,g,h)))))},{flush:"post"}),a=()=>{s(),n()};return Tl(n),a}function Gk(){const e=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{e.value=!0},t),e}function Uf(e){const t=Gk();return d.computed(()=>(t.value,!!e()))}function Kk(e,t,n={}){const{window:i=ca,...r}=n;let s;const a=Uf(()=>i&&"MutationObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},c=d.computed(()=>{const f=d.toValue(e),m=la(f).map(Ri).filter(Wk);return new Set(m)}),l=d.watch(()=>c.value,f=>{o(),a.value&&f.size&&(s=new MutationObserver(t),f.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),u=()=>s==null?void 0:s.takeRecords(),h=()=>{l(),o()};return Tl(h),{isSupported:a,stop:h,takeRecords:u}}function Zk(e,t={}){var n;const{pointerTypes:i,preventDefault:r,stopPropagation:s,exact:a,onMove:o,onEnd:c,onStart:l,initialValue:u,axis:h="both",draggingElement:f=ca,containerElement:m,handle:g=e,buttons:p=[0]}=t,x=d.ref((n=d.toValue(u))!=null?n:{x:0,y:0}),S=d.ref(),v=E=>i?i.includes(E.pointerType):!0,k=E=>{d.toValue(r)&&E.preventDefault(),d.toValue(s)&&E.stopPropagation()},D=E=>{var y;if(!d.toValue(p).includes(E.button)||d.toValue(t.disabled)||!v(E)||d.toValue(a)&&E.target!==d.toValue(e))return;const _=d.toValue(m),T=(y=_==null?void 0:_.getBoundingClientRect)==null?void 0:y.call(_),O=d.toValue(e).getBoundingClientRect(),A={x:E.clientX-(_?O.left-T.left+_.scrollLeft:O.left),y:E.clientY-(_?O.top-T.top+_.scrollTop:O.top)};(l==null?void 0:l(A,E))!==!1&&(S.value=A,k(E))},M=E=>{if(d.toValue(t.disabled)||!v(E)||!S.value)return;const y=d.toValue(m),_=d.toValue(e).getBoundingClientRect();let{x:T,y:O}=x.value;(h==="x"||h==="both")&&(T=E.clientX-S.value.x,y&&(T=Math.min(Math.max(0,T),y.scrollWidth-_.width))),(h==="y"||h==="both")&&(O=E.clientY-S.value.y,y&&(O=Math.min(Math.max(0,O),y.scrollHeight-_.height))),x.value={x:T,y:O},o==null||o(x.value,E),k(E)},P=E=>{d.toValue(t.disabled)||!v(E)||S.value&&(S.value=void 0,c==null||c(x.value,E),k(E))};if(jf){const E=()=>{var y;return{capture:(y=t.capture)!=null?y:!0,passive:!d.toValue(r)}};$r(g,"pointerdown",D,E),$r(f,"pointermove",M,E),$r(f,"pointerup",P,E)}return{...Uk(x),position:x,isDragging:d.computed(()=>!!S.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function Qk(e,t,n={}){const{window:i=ca,...r}=n;let s;const a=Uf(()=>i&&"ResizeObserver"in i),o=()=>{s&&(s.disconnect(),s=void 0)},c=d.computed(()=>{const h=d.toValue(e);return Array.isArray(h)?h.map(f=>Ri(f)):[Ri(h)]}),l=d.watch(c,h=>{if(o(),a.value&&i){s=new ResizeObserver(t);for(const f of h)f&&s.observe(f,r)}},{immediate:!0,flush:"post"}),u=()=>{o(),l()};return Tl(u),{isSupported:a,stop:u}}function Jk(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:a="sync"}=t,o=d.shallowRef(0),c=d.shallowRef(0),l=d.shallowRef(0),u=d.shallowRef(0),h=d.shallowRef(0),f=d.shallowRef(0),m=d.shallowRef(0),g=d.shallowRef(0);function p(){const S=Ri(e);if(!S){n&&(o.value=0,c.value=0,l.value=0,u.value=0,h.value=0,f.value=0,m.value=0,g.value=0);return}const v=S.getBoundingClientRect();o.value=v.height,c.value=v.bottom,l.value=v.left,u.value=v.right,h.value=v.top,f.value=v.width,m.value=v.x,g.value=v.y}function x(){a==="sync"?p():a==="next-frame"&&requestAnimationFrame(()=>p())}return Qk(e,x),d.watch(()=>Ri(e),S=>!S&&x()),Kk(e,x,{attributeFilter:["style","class"]}),r&&$r("scroll",x,{capture:!0,passive:!0}),i&&$r("resize",x,{passive:!0}),qk(()=>{s&&x()}),{height:o,bottom:c,left:l,right:u,top:h,width:f,x:m,y:g,update:x}}function tM(e,t){const{top:n,left:i}=Jk(e),r=d.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),s=d.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:r,tooltipAbsoluteTop:s}}const eM=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const r=[...i].filter(c=>c>=t&&c<=n).sort((c,l)=>c-l),s=[];if(n-t<e-2)return[];const a=(n-t)/e;let o=0;for(let c=0;c<e;c++){const l=t+c*a,u=t+(c+1)*a;let h=0;for(;o<r.length&&r[o]>=l&&r[o]<=u;)h++,o++;s.push([Math.ceil(l),h])}return s},qf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),jr=d.ref({}),nM=e=>(jr.value[e]||(jr.value[e]=qf()),jr.value[e]),iM=(e,t)=>{const n=jr.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete jr.value[t])};function rM({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:r=void 0,minCount:s=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:c}){const u=n!==void 0&&e!==void 0?nM(n):qf(),h=e!==void 0?e:"static-chart-key",f=d.computed(()=>t.reduce((T,{timestamps:O})=>[...T,...O],[])),m=d.computed(()=>i||f.value.reduce((T,O)=>T===0?O:Math.min(T,O),0)),g=d.computed(()=>r||f.value.reduce((T,O)=>Math.max(T,O),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=g.value,o!==void 0&&(u.renderPoints[h]=o)});const p=d.computed(()=>Object.values(u.minStamps).reduce((T,O)=>T===0?O:Math.min(T,O),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((T,O)=>Math.max(T,O),0)),S=d.computed(()=>{const T=Object.values(u.renderPoints);return T.length===0?24:T.reduce((O,A)=>Math.max(O,A),2)}),v=d.computed(()=>{const T=x.value-p.value;return Math.ceil(T/S.value)}),k=d.computed(()=>t.length>1),D=d.computed(()=>t.map(({timestamps:T,color:O,label:A})=>({data:eM({bucketCount:S.value,minStamp:p.value,maxStamp:x.value,timestamps:T}).map(([q,G])=>({x:q,y:G})),label:A,...(c==="sparkline_bar"||k.value)&&O&&{backgroundColor:O},...c!=="sparkline_bar"&&O&&{borderColor:O},...k.value&&c!=="sparkline_bar"&&{fill:!0}}))),M=d.computed(()=>{var A,I;const T=((I=(A=D.value[0])==null?void 0:A.data)==null?void 0:I.length)??0,O=[];for(let B=0;B<T;B++){let q=0;for(let G=0;G<D.value.length;G++)q+=D.value[G].data[B].y;O.push(q)}return O}),P=d.computed(()=>{const T=M.value.reduce((O,A)=>Math.max(O,A),0);return Math.max(T,a??0)}),E=d.computed(()=>{const T=D.value.reduce((I,{data:B})=>[...I,...B.map(({y:q})=>q)],[]),O=T.length?T[0]:0,A=T.reduce((I,B)=>Math.min(I,B),O);return s===void 0?A:Math.min(A,s)});d.watchEffect(()=>{u.maxCounts[h]=P.value,u.minCounts[h]=E.value});const y=d.computed(()=>{const T=Object.values(u.minCounts),O=T.length?T[0]:0;return T.reduce((A,I)=>Math.min(A,I),O)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((T,O)=>Math.max(T,O),0));return d.onUnmounted(()=>{e!==void 0&&n!==void 0&&iM(e,n)}),{syncedMinStamp:p,syncedMaxStamp:x,syncedRenderPoints:S,syncedChartDatasets:D,syncedGroupSizeMs:v,syncedMinCount:y,syncedMaxCount:_}}const pt={useBarChartOptions:kk,useChartJSCommon:Tk,useChartLegendValues:Ck,useChartSelectedRange:Ek,useExploreResultToDatasets:Ak,useExploreResultToTimeDataset:Fk,useDonutChartOptions:Ok,useLineChartOptions:Pk,useI18n:Mg,useReportChartDataForSynthetics:Bk,useTranslatedUnits:zk,useEvaluateFeatureFlag:Vk,useTooltipAbsolutePosition:tM,useSparklineSync:rM};var Nt=(e=>(e.Hidden="hidden",e.Right="right",e.Bottom="bottom",e))(Nt||{});/*!
|
|
19
19
|
* chartjs-plugin-annotation v3.1.0
|
|
20
20
|
* https://www.chartjs.org/chartjs-plugin-annotation/index
|
|
21
21
|
* (c) 2024 chartjs-plugin-annotation Contributors
|
|
22
22
|
* Released under the MIT License
|
|
23
|
-
*/const Xf={modes:{point(e,t){return ua(e,t,{intersect:!0})},nearest(e,t,n){return oM(e,t,n)},x(e,t,n){return ua(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return ua(e,t,{intersect:n.intersect,axis:"y"})}}};function Dl(e,t,n){return(Xf.modes[n.mode]||Xf.modes.nearest)(e,t,n)}function sM(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function aM(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function ua(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):sM(i,t,n.axis))}function oM(e,t,n){let i=Number.POSITIVE_INFINITY;return ua(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),o=aM(t,a,n.axis),l=bi(t,o);return l<i?(r=[s],i=l):l===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function ri(e,t,n){const i=Math.cos(n),r=Math.sin(n),s=t.x,a=t.y;return{x:s+i*(e.x-s)-r*(e.y-a),y:a+r*(e.x-s)+i*(e.y-a)}}const lM=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,si=.001,da=(e,t,n)=>Math.min(n,Math.max(t,e)),Gf=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function cM(e,t,n){for(const i of Object.keys(e))e[i]=da(e[i],t,n);return e}function uM(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function Kf(e,{x:t,y:n,x2:i,y2:r},s,{borderWidth:a,hitTolerance:o}){const l=(a+o)/2,c=e.x>=t-l-si&&e.x<=i+l+si,u=e.y>=n-l-si&&e.y<=r+l+si;return s==="x"?c:(s==="y"||c)&&u}function Zf(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const o=ri(e,n,jt(-r));return Kf(o,t,i,{borderWidth:s,hitTolerance:a})}function ai(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function dM(e,t,n,i=!0){const r=n.split(".");let s=0;for(const a of t.split(".")){const o=r[s++];if(parseInt(a,10)<parseInt(o,10))break;if(lM(o,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Qf=e=>typeof e=="string"&&e.endsWith("%"),Jf=e=>parseFloat(e)/100,tm=e=>da(Jf(e),0,1),Ur=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),hM={box:e=>Ur(e.centerX,e.centerY),doughnutLabel:e=>Ur(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Ur(e.centerX,e.centerY),line:e=>Ur(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Ur(e.centerX,e.centerY)};function Cl(e,t){return t==="start"?0:t==="end"?e:Qf(t)?tm(t)*e:e/2}function Ln(e,t,n=!0){return typeof t=="number"?t:Qf(t)?(n?tm(t):Jf(t))*e:e}function fM(e,t){const{x:n,width:i}=e,r=t.textAlign;return r==="center"?n+i/2:r==="end"||r==="right"?n+i:n}function em(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const o=ft(a),l=t.width+(o?a.width:0)+n,c=t.height+(o?a.height:0)+n,u=El(i),h=sm(e.x,l,r,u.x),f=sm(e.y,c,s,u.y);return{x:h,y:f,x2:h+l,y2:f+c,width:l,height:c,centerX:h+l/2,centerY:f+c/2}}function El(e,t="center"){return ft(e)?{x:at(e.x,t),y:at(e.y,t)}:(e=at(e,t),{x:e,y:e})}const nm=(e,t)=>e&&e.autoFit&&t<1;function im(e,t){const n=e.font,i=kt(n)?n:[n];return nm(e,t)?i.map(function(r){const s=It(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,It(s)}):i.map(r=>It(r))}function rm(e){return e&&(ye(e.xValue)||ye(e.yValue))}function sm(e,t,n=0,i){return e-Cl(t,i)+n}function Ai(e,t,n){const i=n.init;if(i){if(i===!0)return om(t,n)}else return;return mM(e,t,n)}function am(e,t,n){let i=!1;return t.forEach(r=>{be(e[r])?(i=!0,n[r]=e[r]):ye(n[r])&&delete n[r]}),i}function om(e,t){const n=t.type||"line";return hM[n](e)}function mM(e,t,n){const i=Mt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return om(t,n);if(ft(i))return i}const Ol=new Map,gM=e=>isNaN(e)||e<=0,pM=e=>e.reduce(function(t,n){return t+=n.string,t},"");function ha(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function fa(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(jt(i)),e.translate(-t,-n))}function dn(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function Ii(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function ma(e,t){const n=t.content;if(ha(n))return{width:Ln(n.width,t.width),height:Ln(n.height,t.height)};const i=im(t),r=t.textStrokeWidth,s=kt(n)?n:[n],a=s.join()+pM(i)+r+(e._measureText?"-spriting":"");return Ol.has(a)||Ol.set(a,xM(e,s,i,r)),Ol.get(a)}function lm(e,t,n){const{x:i,y:r,width:s,height:a}=t;e.save(),Ii(e,n);const o=dn(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),_i(e,{x:i,y:r,w:s,h:a,radius:cM(Dn(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),o&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function cm(e,t,n,i){const r=n.content;if(ha(r)){e.save(),e.globalAlpha=SM(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=kt(r)?r:[r],a=im(n,i),o=n.color,l=kt(o)?o:[o],c=fM(t,n),u=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,yM(e,n)&&wM(e,{x:c,y:u},s,a),vM(e,{x:c,y:u},s,{fonts:a,colors:l}),e.restore()}function yM(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function bM(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,o=s.rotation;let l=(o||0)*qa;if(ha(a)){e.save(),e.translate(n,i),e.rotate(l),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}gM(r)||_M(e,{x:n,y:i,radius:r,rotation:o,style:a,rad:l})}function _M(e,{x:t,y:n,radius:i,rotation:r,style:s,rad:a}){let o,l,c,u;switch(e.beginPath(),s){default:e.arc(t,n,i,0,Ot),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(a+Pe)*c,l=Math.sin(a+Pe)*c,e.arc(t-o,n-l,u,a-dt,a-Pt),e.arc(t+l,n-o,u,a-Pt,a),e.arc(t+o,n+l,u,a,a+Pt),e.arc(t-l,n+o,u,a+Pt,a+dt),e.closePath();break;case"rect":if(!r){c=Math.SQRT1_2*i,e.rect(t-c,n-c,2*c,2*c);break}a+=Pe;case"rectRot":o=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-o,n-l),e.lineTo(t+l,n-o),e.lineTo(t+o,n+l),e.lineTo(t-l,n+o),e.closePath();break;case"crossRot":a+=Pe;case"cross":o=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-o,n-l),e.lineTo(t+o,n+l),e.moveTo(t+l,n-o),e.lineTo(t-l,n+o);break;case"star":o=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-o,n-l),e.lineTo(t+o,n+l),e.moveTo(t+l,n-o),e.lineTo(t-l,n+o),a+=Pe,o=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-o,n-l),e.lineTo(t+o,n+l),e.moveTo(t+l,n-o),e.lineTo(t-l,n+o);break;case"line":o=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-o,n-l),e.lineTo(t+o,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function xM(e,t,n,i){e.save();const r=t.length;let s=0,a=i;for(let o=0;o<r;o++){const l=n[Math.min(o,n.length-1)];e.font=l.string;const c=t[o];s=Math.max(s,e.measureText(c).width+i),a+=l.lineHeight}return e.restore(),{width:s,height:a}}function wM(e,{x:t,y:n},i,r){e.beginPath();let s=0;i.forEach(function(a,o){const l=r[Math.min(o,r.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(a,t,n+c/2+s),s+=c}),e.stroke()}function vM(e,{x:t,y:n},i,{fonts:r,colors:s}){let a=0;i.forEach(function(o,l){const c=s[Math.min(l,s.length-1)],u=r[Math.min(l,r.length-1)],h=u.lineHeight;e.beginPath(),e.font=u.string,e.fillStyle=c,e.fillText(o,t,n+h/2+a),a+=h,e.fill()})}function SM(e,t){const n=Tn(e)?e:t;return Tn(n)?da(n,0,1):1}const um=["left","bottom","top","right"];function kM(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&EM(t,s);if(!a||PM(t,s,a))return;if(e.save(),e.beginPath(),!dn(e,s))return e.restore();const{separatorStart:l,separatorEnd:c}=MM(t,a),{sideStart:u,sideEnd:h}=DM(t,a,l);(s.margin>0||r.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y);const f=ri({x:n,y:i},t.getCenterPoint(),jt(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function MM(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=TM(e,t);let o,l;return t==="left"||t==="right"?(o={x:n+a,y:i},l={x:o.x,y:s}):(o={x:n,y:i+a},l={x:r,y:o.y}),{separatorStart:o,separatorEnd:l}}function TM(e,t){const{width:n,height:i,options:r}=e,s=r.callout.margin+r.borderWidth/2;return t==="right"?n+s:t==="bottom"?i+s:-s}function DM(e,t,n){const{y:i,width:r,height:s,options:a}=e,o=a.callout.start,l=CM(t,a.callout);let c,u;return t==="left"||t==="right"?(c={x:n.x,y:i+Ln(s,o)},u={x:c.x+l,y:c.y}):(c={x:n.x+Ln(r,o),y:n.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function CM(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function EM(e,t){const n=t.position;return um.includes(n)?n:OM(e,t)}function OM(e,t){const{x:n,y:i,x2:r,y2:s,width:a,height:o,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=e,m={x:u,y:h},g=t.start,p=Ln(a,g),x=Ln(o,g),S=[n,n+p,n+p,r],v=[i+x,s,i,s],k=[];for(let D=0;D<4;D++){const M=ri({x:S[D],y:v[D]},m,jt(f));k.push({position:um[D],distance:bi(M,{x:l,y:c})})}return k.sort((D,M)=>D.distance-M.distance)[0].position}function PM(e,t,n){const{pointX:i,pointY:r}=e,s=t.margin;let a=i,o=r;return n==="left"?a+=s:n==="right"?a-=s:n==="top"?o+=s:n==="bottom"&&(o-=s),e.inRange(a,o)}const dm={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 Li(e,t,n){return t=typeof t=="number"?t:e.parse(t),At(t)?e.getPixelForValue(t):n}function oi(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const r=n.charAt(0),s=Object.values(e).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function hm(e,t){if(e){const n=e.options.reverse,i=Li(e,t.min,n?t.end:t.start),r=Li(e,t.max,n?t.start:t.end);return{start:i,end:r}}}function fm(e,t){const{chartArea:n,scales:i}=e,r=i[oi(i,t,"xScaleID")],s=i[oi(i,t,"yScaleID")];let a=n.width/2,o=n.height/2;return r&&(a=Li(r,t.xValue,r.left+r.width/2)),s&&(o=Li(s,t.yValue,s.top+s.height/2)),{x:a,y:o}}function Pl(e,t){const n=e.scales,i=n[oi(n,t,"xScaleID")],r=n[oi(n,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||e.chartArea,{top:o,bottom:l}=r||e.chartArea;const c=pm(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=c.start,a=c.end;const u=pm(r,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:s,y:o,x2:a,y2:l,width:a-s,height:l-o,centerX:s+(a-s)/2,centerY:o+(l-o)/2}}function mm(e,t){if(!rm(t)){const n=Pl(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const r=i*2,s=n.centerX+t.xAdjust,a=n.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return AM(e,t)}function RM(e,t){const{scales:n,chartArea:i}=e,r=n[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?IM(r,s,t):LM(n,s,t),s}function gm(e,t){const n=Pl(e,t);return n.initProperties=Ai(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:BM(e,n,t),initProperties:n.initProperties}],n}function AM(e,t){const n=fm(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function pm(e,t){const n=hm(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function IM(e,t,n){const i=Li(e,n.value,NaN),r=Li(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function LM(e,t,n){for(const i of Object.keys(dm)){const r=e[oi(e,n,i)];if(r){const{min:s,max:a,start:o,end:l,startProp:c,endProp:u}=dm[i],h=hm(r,{min:n[s],max:n[a],start:r[o],end:r[l]});t[c]=h.start,t[u]=h.end}}}function NM({properties:e,options:t},n,i,r){const{x:s,x2:a,width:o}=e;return ym({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:n.width})}function FM({properties:e,options:t},n,i,r){const{y:s,y2:a,height:o}=e;return ym({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:n.height})}function ym(e,t){const{start:n,end:i,borderWidth:r}=e,{position:s,padding:{start:a,end:o},adjust:l}=t,c=i-r-n-a-o-t.size;return n+r/2+l+Cl(c,s)}function BM(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=El(i.position),s=Ut(i.padding),a=ma(e.ctx,i),o=NM({properties:t,options:n},a,r,s),l=FM({properties:t,options:n},a,r,s),c=a.width+s.width,u=a.height+s.height;return{x:o,y:l,x2:o+c,y2:l+u,width:c,height:u,centerX:o+c/2,centerY:l+u/2,rotation:i.rotation}}const Rl=["enter","leave"],Al=Rl.concat("click");function zM(e,t,n){t.listened=am(n,Al,t.listeners),t.moveListened=!1,Rl.forEach(i=>{be(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&be(i.click)&&(t.listened=!0),t.moveListened||Rl.forEach(r=>{be(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function HM(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return VM(e,t,n);case"click":return WM(e,t,n)}}function VM(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=Dl(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=bm(s,"leave",r,i);return bm(s,"enter",i,r)||a}function bm({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=_m(a.options[n]||e.listeners[n],a,t)||s);return s}function WM(e,t,n){const i=e.listeners,r=Dl(e.visibleElements,t,n.interaction);let s;for(const a of r)s=_m(a.options.click||i.click,a,t)||s;return s}function _m(e,t,n){return Mt(e,[t.$context,n])===!0}const ga=["afterDraw","beforeDraw"];function YM(e,t,n){const i=t.visibleElements;t.hooked=am(n,ga,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ga.forEach(s=>{be(r.options[s])&&(t.hooked=!0)})})}function xm(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Mt(i,[t.$context])}}function $M(e,t,n){const i=GM(e.scales,t,n);let r=wm(t,i,"min","suggestedMin");r=wm(t,i,"max","suggestedMax")||r,r&&be(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function jM(e,t){for(const n of e)qM(n,t)}function wm(e,t,n,i){if(At(t[n])&&!UM(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function UM(e,t,n){return ye(e[t])||ye(e[n])}function qM(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=oi(t,e,n);i&&!t[i]&&XM(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function XM(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(ye(e[n+i]))return!0;return!1}function GM(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:at(t.min,Number.NEGATIVE_INFINITY),max:at(t.max,Number.POSITIVE_INFINITY)};for(const o of n)o.scaleID===r?vm(o,t,["value","endValue"],a):oi(e,o,s)===r&&vm(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function vm(e,t,n,i){for(const r of n){const s=e[r];if(ye(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Ni extends Jt{inRange(t,n,i,r){const{x:s,y:a}=ri({x:t,y:n},this.getCenterPoint(r),jt(-this.options.rotation));return Kf({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return ai(this,t)}draw(t){t.save(),fa(t,this.getCenterPoint(),this.options.rotation),lm(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return gm(t,n)}}Ni.id="boxAnnotation",Ni.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ni.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ni.descriptors={label:{_fallback:!0}};class pa extends Jt{inRange(t,n,i,r){return Zf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options;!n.display||!n.content||(eT(t,this),t.save(),fa(t,this.getCenterPoint(),this.rotation),cm(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=KM(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=QM(t,n,i);let o=ma(t.ctx,n);const l=JM(o,a);nm(n,l)&&(o={width:o.width*l,height:o.height*l});const{position:c,xAdjust:u,yAdjust:h}=n,f=em(s,o,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ai(t,f,n),...f,...r,rotation:n.rotation,_fitRatio:l}}}pa.id="doughnutLabelAnnotation",pa.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},pa.defaultRoutes={};function KM(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof an&&ZM(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function ZM(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function QM({chartArea:e},t,n){const{left:i,top:r,right:s,bottom:a}=e,{innerRadius:o,offsetX:l,offsetY:c}=n.controller,u=(i+s)/2+l,h=(r+a)/2+c,f={left:Math.max(u-o,i),right:Math.min(u+o,s),top:Math.max(h-o,r),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,p=o-g,x=m.y>h,S=x?r+g:a-g,v=tT(S,u,h,p);return{controllerMeta:{_centerX:u,_centerY:h,_radius:p,_counterclockwise:x,...v},point:m,radius:Math.min(o,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function JM({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function tT(e,t,n,i){const r=Math.pow(n-e,2),s=Math.pow(i,2),a=t*-2,o=Math.pow(t,2)+r-s,l=Math.pow(a,2)-4*o;if(l<=0)return{_startAngle:0,_endAngle:Ot};const c=(-a-Math.sqrt(l))/2,u=(-a+Math.sqrt(l))/2;return{_startAngle:ys({x:t,y:n},{x:c,y:e}).angle,_endAngle:ys({x:t,y:n},{x:u,y:e}).angle}}function eT(e,t){const{_centerX:n,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:o,options:l}=t;e.save();const c=dn(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,i,r,s,a,o),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class qr extends Jt{inRange(t,n,i,r){return Zf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options,i=!ye(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),fa(t,this.getCenterPoint(),this.rotation),kM(t,this),lm(t,this,n),cm(t,nT(this),n),t.restore())}resolveElementProperties(t,n){let i;if(rm(n))i=fm(t,n);else{const{centerX:o,centerY:l}=Pl(t,n);i={x:o,y:l}}const r=Ut(n.padding),s=ma(t.ctx,n),a=em(i,s,n,r);return{initProperties:Ai(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}qr.id="labelAnnotation",qr.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},qr.defaultRoutes={borderColor:"color"};function nT({x:e,y:t,width:n,height:i,options:r}){const s=r.borderWidth/2,a=Ut(r.padding);return{x:e+a.left+s,y:t+a.top+s,width:n-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const Il=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),Ll=(e,t,n)=>Il(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Sm=(e,t,n)=>Il(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Xr=e=>e*e,iT=(e,t,{x:n,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(n,r),end:Math.max(n,r),value:e},km=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,Nl=(e,t,n,i)=>({x:km(e.x,t.x,n.x,i),y:km(e.y,t.y,n.y,i)}),Mm=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),Tm=(e,t,n,i)=>-Math.atan2(Mm(e.x,t.x,n.x,i),Mm(e.y,t.y,n.y,i))+.5*dt;class Gr extends Jt{inRange(t,n,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:o,ctx:l}=this;if(o){dn(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=n*u.currentDevicePixelRatio,m=l.isPointInStroke(o,h,f)||Fl(this,a,r);return l.restore(),m}const c=Xr(s);return oT(this,a,c,r)||Fl(this,a,r)}return rT(this,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return ai(this,t)}draw(t){const{x:n,y:i,x2:r,y2:s,cp:a,options:o}=this;if(t.save(),!dn(t,o))return t.restore();Ii(t,o);const l=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-i,2));if(o.curve&&a)return gT(t,this,a,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=Pm(this),m=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Bl(t,0,h,c),Bl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=RM(t,n),{x:r,y:s,x2:a,y2:o}=i,l=sT(i,t.chartArea),c=l?aT({x:r,y:s},{x:a,y:o},t.chartArea):{x:r,y:s,x2:a,y2:o,width:Math.abs(a-r),height:Math.abs(o-s)};if(c.centerX=(a+r)/2,c.centerY=(o+s)/2,c.initProperties=Ai(t,c,n),n.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=mT(c,n,bi(h,f))}const u=lT(t,c,n.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Gr.id="lineAnnotation";const Dm={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};Gr.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Dm),fill:!1,length:12,start:Object.assign({},Dm),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},qr.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Gr.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Gr.defaultRoutes={borderColor:"color"};function rT(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=iT(t,n,e.getProps(["x","y","x2","y2"],s),i);return Gf(a,r)||Fl(e,{mouseX:t,mouseY:n},s,i)}function sT({x:e,y:t,x2:n,y2:i},{top:r,right:s,bottom:a,left:o}){return!(e<o&&n<o||e>s&&n>s||t<r&&i<r||t>a&&i>a)}function Cm({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=Sm(a,{x:e,y:t},n),e=a),e>r&&(t=Sm(r,{x:e,y:t},n),e=r),t<i&&(e=Ll(i,{x:e,y:t},n),t=i),t>s&&(e=Ll(s,{x:e,y:t},n),t=s),{x:e,y:t}}function aT(e,t,n){const{x:i,y:r}=Cm(e,t,n),{x:s,y:a}=Cm(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function oT(e,{mouseX:t,mouseY:n},i=si,r){const{x:s,y:a,x2:o,y2:l}=e.getProps(["x","y","x2","y2"],r),c=o-s,u=l-a,h=Xr(c)+Xr(u),f=h===0?-1:((t-s)*c+(n-a)*u)/h;let m,g;return f<0?(m=s,g=a):f>1?(m=o,g=l):(m=s+f*c,g=a+f*u),Xr(t-m)+Xr(n-g)<=i}function Fl(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function lT(e,t,n){const i=n.borderWidth,r=Ut(n.padding),s=ma(e.ctx,n),a=s.width+r.width+i,o=s.height+r.height+i;return uT(t,n,{width:a,height:o,padding:r},e.chartArea)}function cT(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>dt/2?s-dt:s<dt/-2?s+dt:s}function uT(e,t,n,i){const{width:r,height:s,padding:a}=n,{xAdjust:o,yAdjust:l}=t,c={x:e.x,y:e.y},u={x:e.x2,y:e.y2},h=t.rotation==="auto"?cT(e):jt(t.rotation),f=dT(r,s,h),m=hT(e,t,{labelSize:f,padding:a},i),g=e.cp?Nl(c,e.cp,u,m):Il(c,u,m),p={size:f.w,min:i.left,max:i.right,padding:a.left},x={size:f.h,min:i.top,max:i.bottom,padding:a.top},S=Om(g.x,p)+o,v=Om(g.y,x)+l;return{x:S-r/2,y:v-s/2,x2:S+r/2,y2:v+s/2,centerX:S,centerY:v,pointX:g.x,pointY:g.y,width:r,height:s,rotation:ps(h)}}function dT(e,t,n){const i=Math.cos(n),r=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*r),h:Math.abs(e*r)+Math.abs(t*i)}}function hT(e,t,n,i){let r;const s=fT(e,i);return t.position==="start"?r=Em({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-Em({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=Cl(1,t.position),r}function Em(e,t,n,i){const{labelSize:r,padding:s}=t,a=e.w*i.dx,o=e.h*i.dy,l=a>0&&(r.w/2+s.left-i.x)/a,c=o>0&&(r.h/2+s.top-i.y)/o;return da(Math.max(l,c),0,.25)}function fT(e,t){const{x:n,x2:i,y:r,y2:s}=e,a=Math.min(r,s)-t.top,o=Math.min(n,i)-t.left,l=t.bottom-Math.max(r,s),c=t.right-Math.max(n,i);return{x:Math.min(o,c),y:Math.min(a,l),dx:o<=c?1:-1,dy:a<=l?1:-1}}function Om(e,t){const{size:n,min:i,max:r,padding:s}=t,a=n/2;return n>r-i?(r+i)/2:(i>=e-s-a&&(e=i+s+a),r<=e+s+a&&(e=r-s-a),e)}function Pm(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Rm(e,n),endAdjust:Rm(e,i)}}function Rm(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,r=e.options.borderWidth/2,s={x:n,y:i+r};return Math.abs(Ll(0,s,{x:0,y:r}))}function Bl(e,t,n,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-r)+n;e.beginPath(),Ii(e,i),dn(e,i),e.moveTo(c,-s),e.lineTo(t+n,0),e.lineTo(c,s),a===!0?(e.fillStyle=o||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function mT(e,t,n){const{x:i,y:r,x2:s,y2:a,centerX:o,centerY:l}=e,c=Math.atan2(a-r,s-i),u=El(t.controlPoint,0),h={x:o+Ln(n,u.x,!1),y:l+Ln(n,u.y,!1)};return ri(h,{x:o,y:l},c)}function Am(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),Bl(e,0,-r,s),e.restore())}function gT(e,t,n,i){const{x:r,y:s,x2:a,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=Pm(t),m={x:r,y:s},g={x:a,y:o},p=Tm(m,n,g,0),x=Tm(m,n,g,1)-dt,S=Nl(m,n,g,h/i),v=Nl(m,n,g,1-f/i),k=new Path2D;e.beginPath(),k.moveTo(S.x,S.y),k.quadraticCurveTo(n.x,n.y,v.x,v.y),e.shadowColor=l.borderShadowColor,e.stroke(k),t.path=k,t.ctx=e,Am(e,S,{angle:p,adjust:h},c),Am(e,v,{angle:x,adjust:f},u)}class Kr extends Jt{inRange(t,n,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return pT({x:t,y:n},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],r),h=i==="y"?{start:l,end:u}:{start:o,end:c},f=ri({x:t,y:n},this.getCenterPoint(r),jt(-s));return f[i]>=h.start-a-si&&f[i]<=h.end+a+si}getCenterPoint(t){return ai(this,t)}draw(t){const{width:n,height:i,centerX:r,centerY:s,options:a}=this;t.save(),fa(t,this.getCenterPoint(),a.rotation),Ii(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=dn(t,a);t.ellipse(r,s,i/2,n/2,dt/2,0,2*dt),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return gm(t,n)}}Kr.id="ellipseAnnotation",Kr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Ni.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},Kr.defaultRoutes={borderColor:"color",backgroundColor:"color"},Kr.descriptors={label:{_fallback:!0}};function pT(e,t,n,i){const{width:r,height:s,centerX:a,centerY:o}=t,l=r/2,c=s/2;if(l<=0||c<=0)return!1;const u=jt(n||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(e.x-a)+f*(e.y-o),2),g=Math.pow(f*(e.x-a)-h*(e.y-o),2);return m/Math.pow(l+i,2)+g/Math.pow(c+i,2)<=1.0001}class ya extends Jt{inRange(t,n,i,r){const{x:s,y:a,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],r),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?uM({x:t,y:n},this.getCenterPoint(r),c/2,u):Gf(i==="y"?{start:a,end:l,value:n}:{start:s,end:o,value:t},u)}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Ii(t,n);const r=dn(t,n);bM(t,this,this.centerX,this.centerY),r&&!ha(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=mm(t,n);return i.initProperties=Ai(t,i,n),i}}ya.id="pointAnnotation",ya.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ya.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ba extends Jt{inRange(t,n,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&bT(this.elements,t,n,r);const s=ri({x:t,y:n},this.getCenterPoint(r),jt(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...a),l=Math.max(...a);return s[i]>=o&&s[i]<=l}getCenterPoint(t){return ai(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ii(t,i);const r=dn(t,i);let s=!0;for(const a of n)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=mm(t,n),{sides:r,rotation:s}=n,a=[],o=2*dt/r;let l=s*qa;for(let c=0;c<r;c++,l+=o){const u=yT(i,n,l);u.initProperties=Ai(t,i,n),a.push(u)}return i.elements=a,i}}ba.id="polygonAnnotation",ba.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ba.defaultRoutes={borderColor:"color",backgroundColor:"color"};function yT({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,o=Math.sin(s),l=Math.cos(s),c={x:e+o*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+o*(n+a),bY:t-l*(n+a)}}}function bT(e,t,n,i){let r=!1,s=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const o=a.getProps(["bX","bY"],i);o.bY>n!=s.bY>n&&t<(s.bX-o.bX)*(n-o.bY)/(s.bY-o.bY)+o.bX&&(r=!r),s=o}return r}const Nn={box:Ni,doughnutLabel:pa,ellipse:Kr,label:qr,line:Gr,point:ya,polygon:ba};Object.keys(Nn).forEach(e=>{Rt.describe(`elements.${Nn[e].id}`,{_fallback:"plugins.annotation.common"})});const _T={update:Object.assign},xT=Al.concat(ga),Im=(e,t)=>ft(t)?Vl(e,t):e,zl=e=>e==="color"||e==="font";function Hl(e="line"){return Nn[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function wT(e,t,n,i){const r=ST(e,n.animations,i),s=t.annotations,a=TT(t.elements,s);for(let o=0;o<s.length;o++){const l=s[o],c=Lm(a,o,l.type),u=l.setContext(MT(e,c,a,l)),h=c.resolveElementProperties(e,u);h.skip=vT(h),"elements"in h&&(kT(c,h.elements,u,r),delete h.elements),ye(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=Nm(u),r.update(c,h)}}function vT(e){return isNaN(e.x)||isNaN(e.y)}function ST(e,t,n){return n==="reset"||n==="none"||n==="resize"?_T:new oo(e,t)}function kT(e,t,n,i){const r=e.elements||(e.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],o=a.properties,l=Lm(r,s,a.type,a.initProperties),c=n[a.optionScope].override(a);o.options=Nm(c),i.update(l,o)}}function Lm(e,t,n,i){const r=Nn[Hl(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Nm(e){const t=Nn[Hl(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Vl(e,t.defaults),Vl(e,t.defaultRoutes));for(const i of xT)n[i]=e[i];return n}function Vl(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];zl(i)&&kt(s)?n[i]=s.map(a=>Im(a,r)):n[i]=Im(s,r)}return n}function MT(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function TT(e,t){const n=t.length,i=e.length;if(i<n){const r=n-i;e.splice(i,0,...new Array(r))}else i>n&&e.splice(n,i-n);return e}var DT="3.1.0";const Fn=new Map,Fm=e=>e.type!=="doughnutLabel",CT=Al.concat(ga);var Bm={id:"annotation",version:DT,beforeRegister(){dM("chart.js","4.0",_e.version)},afterRegister(){_e.register(Nn)},afterUnregister(){_e.unregister(Nn)},beforeInit(e){Fn.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=Fn.get(e),r=i.annotations=[];let s=n.annotations;ft(s)?Object.keys(s).forEach(a=>{const o=s[a];ft(o)&&(o.id=a,r.push(o))}):kt(s)&&r.push(...s),jM(r.filter(Fm),e.scales)},afterDataLimits(e,t){const n=Fn.get(e);$M(e,t.scale,n.annotations.filter(Fm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Fn.get(e);zM(e,i,n),wT(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),YM(e,i,n)},beforeDatasetsDraw(e,t,n){Zr(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Zr(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Zr(e,t.index,n.clip)},beforeDraw(e,t,n){Zr(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Zr(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=Fn.get(e);HM(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){Fn.delete(e)},getAnnotations(e){const t=Fn.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return Dl(e,t,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:e=>!CT.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Nn[Hl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:zl,_fallback:!0},_indexable:zl}},additionalOptionScopes:[""]};function Zr(e,t,n){const{ctx:i,chartArea:r}=e,s=Fn.get(e);n&&or(i,r);const a=ET(s.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of a)OT(i,r,s,o);n&&lr(i)}function ET(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&n.push({element:r});return n}function OT(e,t,n,i){const r=i.element;i.main?(xm(n,r,"beforeDraw"),r.draw(e,t),xm(n,r,"afterDraw")):r.draw(e,t)}const PT={class:"zoom-timerange-container"},RT={class:"zoom-timerange-details"},AT={class:"label","data-testid":"zoom-timerange-from"},IT={class:"label","data-testid":"zoom-timerange-to"},LT=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.ref(Wr({tickValue:t.start,granularity:t.granularity})),r=d.ref(Wr({tickValue:t.end,granularity:t.granularity})),s=(a,o)=>{ol(()=>{i.value=Wr({tickValue:a,granularity:t.granularity}),r.value=Wr({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{s(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",PT,[d.createElementVNode("div",RT,[d.createElementVNode("div",AT,d.toDisplayString(d.unref(n).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",IT,d.toDisplayString(d.unref(n).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(r.value),1)])]))}}),Ee=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},zm=Ee(LT,[["__scopeId","data-v-0e972e3c"]]),NT={class:"zoom-actions-container"},FT={class:"zoom-actions-heading"},BT={class:"zoom-action-select"},zT=["data-testid"],HT=["aria-disabled","href"],VT=["onClick"],WT=Ee(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,r=s=>{s.action&&(s.action(n.newTimeRange),i("onAction"))};return(s,a)=>(d.openBlock(),d.createElementBlock("div",NT,[d.createElementVNode("div",FT,[d.createVNode(zm,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(ne.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(ll),size:d.unref(zr),onClick:a[0]||(a[0]=o=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",BT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.zoomActionItems,o=>(d.openBlock(),d.createElementBlock("div",{key:o.key,class:d.normalizeClass(["zoom-action-item",{disabled:o.disabled}]),"data-testid":`zoom-action-item-${o.key}`},[o.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":o.disabled,class:"zoom-action-link",href:o.href,onClick:a[1]||(a[1]=l=>s.$emit("onAction"))},d.toDisplayString(o.label),9,HT)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>r(o)},d.toDisplayString(o.label),9,VT))],10,zT))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),YT={key:2},$T={class:"tooltip-title"},jT={class:"title"},UT={key:0,class:"subtitle"},qT={class:"context"},XT={class:"metric"},GT={class:"tooltip"},KT={key:0},ZT={class:"display-value"},_a=Ee(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(e,{emit:t}){const n=t,i=e,r=d.ref(null),{x:s,y:a,isDragging:o}=Zk(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${a.value}px`),c=d.computed(()=>`${s.value}px`),u=d.computed(()=>i.state.tooltipContext),h=d.computed(()=>i.state.metricDisplay),f=d.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return d.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,g])=>{o.value||(s.value=parseFloat(m),a.value=parseFloat(g))}),d.watch(o,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(r,m=>{if(m){const{width:g,height:p}=m.getBoundingClientRect();n("dimensions",{width:g,height:p})}}),(m,g)=>{var p,x;return e.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:d.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity?(d.openBlock(),d.createBlock(zm,{key:0,end:(p=e.zoomTimeRange)==null?void 0:p.end,granularity:e.granularity,start:(x=e.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(d.openBlock(),d.createBlock(WT,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:g[0]||(g[0]=S=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",YT,[d.createElementVNode("div",$T,[d.createElementVNode("div",jT,[d.createElementVNode("div",null,d.toDisplayString(e.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(ne.DragIcon),{key:0,class:"drag-icon",color:d.unref(ll),size:d.unref(zr)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",UT,[d.createElementVNode("div",qT,d.toDisplayString(u.value),1),d.createElementVNode("div",XT,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",GT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.state.tooltipSeries,({backgroundColor:S,borderColor:v,label:k,value:D,isSegmentEmpty:M},P)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:k+P},[e.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",KT,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:S,"border-color":v})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:M}])},d.toDisplayString(k),3),d.createElementVNode("span",ZT,d.toDisplayString(D),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),QT=["onClick"],JT={key:0,class:"sub-label"},tD={class:"tooltip-content"},Wl=Ee(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){d.useCssVars(D=>({v6d3f1170:l.value}));const t=e,{i18n:n}=pt.useI18n(),i=d.ref(),r=d.ref([]),s=d.inject("showLegendValues",!0),a=d.inject("legendPosition",d.ref(Nt.Right)),o=d.ref([]),l=d.ref(bf),c=()=>{const D=i.value;if(!D||!r.value||D.children.length===0)return 0;const M=D.children[0].getBoundingClientRect().top;for(const P of r.value)if(P.getBoundingClientRect().top>M)return!0;return!1},u=d.computed(()=>t.items.length>2||a.value===Nt.Right),h=()=>{i.value&&a.value===Nt.Bottom&&(c()?l.value=PS:l.value=bf)},f=()=>{if(i.value&&a.value===Nt.Bottom){let D=0;r.value.forEach(P=>{const E=Array.from(P.children).reduce((y,_)=>y+_.offsetWidth,0);E>D&&(D=E)});const M=parseInt(OS,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${D+M}px)`}h()},m=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let D=0;D<t.items.length;D++)if(t.items[D].text!==o.value[D].text)return o.value=t.items,!0;return!1};d.watch(()=>t.items,()=>{m()&&f()},{immediate:!0,flush:"post"});const g=d.ref(0),p=d.ref(0),x=new ResizeObserver(ol(D=>{const M=D[0],P=M.contentRect.width,E=M.contentRect.height;P!==g.value&&E===p.value&&f(),g.value=P,p.value=E},100));d.watch(()=>a.value,()=>{f()}),d.onMounted(()=>{o.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),d.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const S=(D=0,M)=>{if(t.chartInstance===null)return;const P=t.chartInstance instanceof _e?t.chartInstance:t.chartInstance.chart;v(D,M)?P.hide(D,M):P.show(D,M),P.update()},v=(D=0,M)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const P=t.chartInstance instanceof _e?t.chartInstance:t.chartInstance.chart,E=P.getDatasetMeta(D);return E.dataset||M===void 0?P.isDatasetVisible(D):!(E.data.length&&E.data[M].hidden)},k=D=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[D];return(D,M)=>{const P=d.resolveComponent("KTooltip");return d.unref(a)!==d.unref(Nt).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:d.normalizeClass(["legend-container",k(d.unref(a))]),"data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.items,({fillStyle:E,strokeStyle:y,text:_,datasetIndex:T,index:O,value:A,isSegmentEmpty:I})=>(d.openBlock(),d.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:r,onClick:B=>S(T,O)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:E,"border-color":y})},null,4),d.createVNode(P,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!v(T,O)}])},[d.createElementVNode("div",{class:d.normalizeClass(["label",{"truncate-label":u.value,empty:I}])},d.toDisplayString(_),3),A&&d.unref(s)?(d.openBlock(),d.createElementBlock("div",JT,d.toDisplayString(A.formatted),1)):d.createCommentVNode("",!0)],2)]),_:2},[I?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",tD,d.toDisplayString(d.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,QT))),128))],2)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function eD(e,t=0){return(ie[e[t+0]]+ie[e[t+1]]+ie[e[t+2]]+ie[e[t+3]]+"-"+ie[e[t+4]]+ie[e[t+5]]+"-"+ie[e[t+6]]+ie[e[t+7]]+"-"+ie[e[t+8]]+ie[e[t+9]]+"-"+ie[e[t+10]]+ie[e[t+11]]+ie[e[t+12]]+ie[e[t+13]]+ie[e[t+14]]+ie[e[t+15]]).toLowerCase()}let Yl;const nD=new Uint8Array(16);function iD(){if(!Yl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yl=crypto.getRandomValues.bind(crypto)}return Yl(nD)}const Hm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function xa(e,t,n){var r;if(Hm.randomUUID&&!e)return Hm.randomUUID();e=e||{};const i=e.random??((r=e.rng)==null?void 0:r.call(e))??iD();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,eD(i)}const Vm=(e,t)=>{const n=e.ctx,i=e.scales.y,r=e.scales.x,s=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):n.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),n.restore()};class Wm{constructor(){R(this,"id","highlightPlugin");R(this,"_clickedElements");R(this,"_previousHoverOption");R(this,"_clicked",!1);R(this,"_pause",!1);R(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Vm(t,this._clickedElements)}afterEvent(t,{event:n}){var s;if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=((s=t.options.interaction)==null?void 0:s.mode)||"index",r=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,Vm(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const rD=["id"],sD=["id"],aD={class:"axis-tooltip-content"},Ym=6,oD="100%",lD="100%",cD=20,uD=20,$m=6,dD=0,hD=10,fD=10,mD=1,gD=Ee(d.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=pt.useI18n(),{translateUnit:i}=pt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new Wm,o=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:z},j)=>{var et;const $=z.data,J=(et=$.labels)==null?void 0:et.indexOf(j);return $.datasets.reduce((nt,rt,it)=>{if(z.isDatasetVisible(it)){const _t=rt.data[J];return isNaN(_t)?nt:nt+_t}else return nt},0)},u=(z,j,$,J)=>{const et=J==="horizontal";j===null&&(j=n.t("entityNoName"));const nt={type:"label",yValue:_t=>et?j:c(_t,j),xValue:_t=>et?c(_t,j):j},rt={...nt,position:et?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>et?0:-Math.abs(VS()),content:_t=>dl(c(_t,j),$)},it={...nt,content:_t=>Tf(c(_t,j),Mf(_t.chart,z)),position:et?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:_t=>et?kf(dl(c(_t,j),$)):0,color:wf};return{[`${j}-value`]:rt,[`${j}-percent`]:it}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=xa(),g=xa(),p=xa(),x=d.ref([]),S=d.inject("legendPosition",Nt.Right),v=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),k=d.toRef(t,"metricUnit"),D=d.computed(()=>t.orientation==="horizontal"),M=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:D.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:P,tooltipAbsoluteTop:E}=pt.useTooltipAbsolutePosition(l,M),y=d.ref(0),_=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce((j,$)=>Object.assign(j,u(t.chartData,$,k.value,t.orientation)),{}))},T={id:m,afterUpdate(z){y.value+=1,x.value=ff(z,t.legendValues,t.chartLegendSortFn)}},O={id:g,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?_():{}}},B=[T,{id:"axisHover",afterEvent(z,j){var $;if(v.show=!1,j.event.type==="mousemove"){const J=j.event,et=z.options.indexAxis,nt=z.scales,rt=z.scales[et].getLabelForValue(Number(z.scales[et].getValueForPixel(J[et]))),_t=z.scales[et].getLabels().indexOf(rt),ct=($=t.chartData.isLabelEmpty)==null?void 0:$[_t];if((te=>te==="x"?J.y>nt.x.top:J.x<nt.y.right)(et)){M.interactionMode!=="interactive"&&(M.showTooltip=!1);const ce=z.canvas.getContext("2d").measureText(rt).width,qt=Math.abs(Math.round(J.x-ce*.5)),Ie=Math.round(J.x+ce*.5),St=z.canvas.getBoundingClientRect(),Xt=40;v.left=et==="x"?`${(qt>0?qt:Ie)-v.offset+St.left}px`:`${J.x-ce*.5-v.offset+St.left}px`,v.top=`${J.y-Xt+St.top}px`,rt.length>ia?(v.show=!0,v.text=rt):ct?(v.text=n.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},{id:p,afterUpdate(z){z.options.layout.padding.right=D.value?Y.value:0}},a,...t.annotations?[O]:[]],q=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),G=d.ref(0),V=d.ref(0),lt=new ResizeObserver(ol(z=>{G.value=z[0].contentRect.width,V.value=z[0].contentRect.height},100)),X=d.computed(()=>{var j,$;const z=($=(j=t.chartData)==null?void 0:j.labels)==null?void 0:$.length;return h.value&&z&&!D.value?`${Math.max(z*(cD+$m),G.value)}px`:oD}),Q=d.computed(()=>{var j,$;const z=($=(j=t.chartData)==null?void 0:j.labels)==null?void 0:$.length;return h.value&&z&&D.value?`${Math.max(z*(uD+$m),V.value)}px`:lD});pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&_e.register(Bm),o.value&&(G.value=o.value.offsetWidth,V.value=o.value.offsetHeight,lt.observe(o.value))}),d.onUnmounted(()=>{o.value&<.unobserve(o.value)});const H=d.computed(()=>{const z=pt.useBarChartOptions({tooltipState:M,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:D.value?"y":"x",numLabels:q});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Ym}}}}),U=pt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),B,H),Y=d.computed(()=>{y.value;const z=t.chartData.labels,j=t.chartData.datasets,$=z.map((nt,rt)=>j.reduce((it,_t)=>isNaN(Number(_t.data[rt]))?it:it+Number(_t.data[rt]),0)),J=U.value?Mf(U.value,t.chartData):WS(t.chartData);return $.map(nt=>kf(dl(nt,k.value)+Tf(nt,J))).reduce((nt,rt)=>Math.max(nt,rt),0)+Ym});d.onBeforeUnmount(()=>{_e.unregister(Bm)});const xt={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},yt=d.computed(()=>{if(f.value&&U.value){const z=window.devicePixelRatio,j=U.value,$=j.scales.y.width*z+mD,J=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*z,et=f.value.getContext("2d");return et.scale(z,z),et.canvas.width=$,et.canvas.height=J,et.canvas.style.width=`${$/z}px`,et.canvas.style.height=`${J/z}px`,{scale:z,width:$*z,height:J*z,targetCtx:et}}return null}),vt=z=>{const j=z.target;if(yt.value&&U.value&&!D.value){const $=yt.value.scale,J=yt.value.targetCtx,et=yt.value.width,nt=yt.value.height,rt=U.value,it=rt.canvas;J.fillStyle="white",j.scrollLeft>=dD&&j.scrollLeft<=hD?(J.globalCompositeOperation="source-over",J.clearRect(0,0,et,nt),J.drawImage(it,0,0,et,nt,0,0,et,nt),J.globalCompositeOperation="destination-over",J.fillRect(0,0,et,nt)):(J.globalCompositeOperation="source-over",J.fillRect(0,(rt.scales.y.height+rt.scales.y.top+fD)*$,et,rt.scales.x.height*$))}M.offsetY=j.scrollTop,M.offsetX=j.scrollLeft,v.offset=j.scrollLeft},mt=({width:z,height:j})=>{M.width=z,M.height=j};d.watch(()=>t.orientation,()=>{var z;if(f.value&&yt.value){const j=yt.value.width,$=yt.value.height;((z=f.value)==null?void 0:z.getContext("2d")).clearRect(0,0,j,$)}M.showTooltip=!1,M.interactionMode="idle"}),d.watch(()=>t.annotations,z=>{U.value&&(z?U.value.options.plugins.annotation.annotations=_(t.chartData):delete U.value.options.plugins.annotation.annotations)});const gt=()=>{M.showTooltip&&(M.interactionMode!=="idle"?M.interactionMode="idle":M.interactionMode="interactive")};return(z,j)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",xt[d.unref(S)]])},[d.createElementVNode("canvas",{id:d.unref(r),ref:"axis",class:"axis"},null,8,rD),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:j[0]||(j[0]=$=>gt()),onScroll:vt},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:X.value,height:Q.value})},[d.createElementVNode("canvas",{id:d.unref(s),ref:"canvas",class:"chart-canvas"},null,8,sD)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[v.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:v.top,left:v.left}),width:"auto"},[d.createElementVNode("div",aD,d.toDisplayString(v.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(_a,{"absolute-left":d.unref(P),"absolute-top":d.unref(E),"chart-parent-ref":l.value,state:M,"tooltip-title":e.tooltipTitle,onDimensions:mt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Wl,{id:d.unref(m),"chart-instance":d.unref(U),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
23
|
+
*/const Xf={modes:{point(e,t){return ua(e,t,{intersect:!0})},nearest(e,t,n){return oM(e,t,n)},x(e,t,n){return ua(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return ua(e,t,{intersect:n.intersect,axis:"y"})}}};function Dl(e,t,n){return(Xf.modes[n.mode]||Xf.modes.nearest)(e,t,n)}function sM(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function aM(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function ua(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):sM(i,t,n.axis))}function oM(e,t,n){let i=Number.POSITIVE_INFINITY;return ua(e,t,n).reduce((r,s)=>{const a=s.getCenterPoint(),o=aM(t,a,n.axis),c=bi(t,o);return c<i?(r=[s],i=c):c===i&&r.push(s),r},[]).sort((r,s)=>r._index-s._index).slice(0,1)}function ri(e,t,n){const i=Math.cos(n),r=Math.sin(n),s=t.x,a=t.y;return{x:s+i*(e.x-s)-r*(e.y-a),y:a+r*(e.x-s)+i*(e.y-a)}}const lM=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,si=.001,da=(e,t,n)=>Math.min(n,Math.max(t,e)),Gf=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function cM(e,t,n){for(const i of Object.keys(e))e[i]=da(e[i],t,n);return e}function uM(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function Kf(e,{x:t,y:n,x2:i,y2:r},s,{borderWidth:a,hitTolerance:o}){const c=(a+o)/2,l=e.x>=t-c-si&&e.x<=i+c+si,u=e.y>=n-c-si&&e.y<=r+c+si;return s==="x"?l:(s==="y"||l)&&u}function Zf(e,{rect:t,center:n},i,{rotation:r,borderWidth:s,hitTolerance:a}){const o=ri(e,n,jt(-r));return Kf(o,t,i,{borderWidth:s,hitTolerance:a})}function ai(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function dM(e,t,n,i=!0){const r=n.split(".");let s=0;for(const a of t.split(".")){const o=r[s++];if(parseInt(a,10)<parseInt(o,10))break;if(lM(o,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const Qf=e=>typeof e=="string"&&e.endsWith("%"),Jf=e=>parseFloat(e)/100,tm=e=>da(Jf(e),0,1),Ur=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),hM={box:e=>Ur(e.centerX,e.centerY),doughnutLabel:e=>Ur(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Ur(e.centerX,e.centerY),line:e=>Ur(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Ur(e.centerX,e.centerY)};function Cl(e,t){return t==="start"?0:t==="end"?e:Qf(t)?tm(t)*e:e/2}function Ln(e,t,n=!0){return typeof t=="number"?t:Qf(t)?(n?tm(t):Jf(t))*e:e}function fM(e,t){const{x:n,width:i}=e,r=t.textAlign;return r==="center"?n+i/2:r==="end"||r==="right"?n+i:n}function em(e,t,{borderWidth:n,position:i,xAdjust:r,yAdjust:s},a){const o=ft(a),c=t.width+(o?a.width:0)+n,l=t.height+(o?a.height:0)+n,u=El(i),h=sm(e.x,c,r,u.x),f=sm(e.y,l,s,u.y);return{x:h,y:f,x2:h+c,y2:f+l,width:c,height:l,centerX:h+c/2,centerY:f+l/2}}function El(e,t="center"){return ft(e)?{x:at(e.x,t),y:at(e.y,t)}:(e=at(e,t),{x:e,y:e})}const nm=(e,t)=>e&&e.autoFit&&t<1;function im(e,t){const n=e.font,i=kt(n)?n:[n];return nm(e,t)?i.map(function(r){const s=It(r);return s.size=Math.floor(r.size*t),s.lineHeight=r.lineHeight,It(s)}):i.map(r=>It(r))}function rm(e){return e&&(ye(e.xValue)||ye(e.yValue))}function sm(e,t,n=0,i){return e-Cl(t,i)+n}function Ai(e,t,n){const i=n.init;if(i){if(i===!0)return om(t,n)}else return;return mM(e,t,n)}function am(e,t,n){let i=!1;return t.forEach(r=>{be(e[r])?(i=!0,n[r]=e[r]):ye(n[r])&&delete n[r]}),i}function om(e,t){const n=t.type||"line";return hM[n](e)}function mM(e,t,n){const i=Mt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return om(t,n);if(ft(i))return i}const Ol=new Map,gM=e=>isNaN(e)||e<=0,pM=e=>e.reduce(function(t,n){return t+=n.string,t},"");function ha(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function fa(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(jt(i)),e.translate(-t,-n))}function dn(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function Ii(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function ma(e,t){const n=t.content;if(ha(n))return{width:Ln(n.width,t.width),height:Ln(n.height,t.height)};const i=im(t),r=t.textStrokeWidth,s=kt(n)?n:[n],a=s.join()+pM(i)+r+(e._measureText?"-spriting":"");return Ol.has(a)||Ol.set(a,xM(e,s,i,r)),Ol.get(a)}function lm(e,t,n){const{x:i,y:r,width:s,height:a}=t;e.save(),Ii(e,n);const o=dn(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),_i(e,{x:i,y:r,w:s,h:a,radius:cM(Dn(n.borderRadius),0,Math.min(s,a)/2)}),e.closePath(),e.fill(),o&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function cm(e,t,n,i){const r=n.content;if(ha(r)){e.save(),e.globalAlpha=SM(n.opacity,r.style.opacity),e.drawImage(r,t.x,t.y,t.width,t.height),e.restore();return}const s=kt(r)?r:[r],a=im(n,i),o=n.color,c=kt(o)?o:[o],l=fM(t,n),u=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,yM(e,n)&&wM(e,{x:l,y:u},s,a),vM(e,{x:l,y:u},s,{fonts:a,colors:c}),e.restore()}function yM(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function bM(e,t,n,i){const{radius:r,options:s}=t,a=s.pointStyle,o=s.rotation;let c=(o||0)*qa;if(ha(a)){e.save(),e.translate(n,i),e.rotate(c),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}gM(r)||_M(e,{x:n,y:i,radius:r,rotation:o,style:a,rad:c})}function _M(e,{x:t,y:n,radius:i,rotation:r,style:s,rad:a}){let o,c,l,u;switch(e.beginPath(),s){default:e.arc(t,n,i,0,Ot),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":u=i*.516,l=i-u,o=Math.cos(a+Pe)*l,c=Math.sin(a+Pe)*l,e.arc(t-o,n-c,u,a-dt,a-Pt),e.arc(t+c,n-o,u,a-Pt,a),e.arc(t+o,n+c,u,a,a+Pt),e.arc(t-c,n+o,u,a+Pt,a+dt),e.closePath();break;case"rect":if(!r){l=Math.SQRT1_2*i,e.rect(t-l,n-l,2*l,2*l);break}a+=Pe;case"rectRot":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+c,n-o),e.lineTo(t+o,n+c),e.lineTo(t-c,n+o),e.closePath();break;case"crossRot":a+=Pe;case"cross":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c),e.moveTo(t+c,n-o),e.lineTo(t-c,n+o);break;case"star":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c),e.moveTo(t+c,n-o),e.lineTo(t-c,n+o),a+=Pe,o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c),e.moveTo(t+c,n-o),e.lineTo(t-c,n+o);break;case"line":o=Math.cos(a)*i,c=Math.sin(a)*i,e.moveTo(t-o,n-c),e.lineTo(t+o,n+c);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function xM(e,t,n,i){e.save();const r=t.length;let s=0,a=i;for(let o=0;o<r;o++){const c=n[Math.min(o,n.length-1)];e.font=c.string;const l=t[o];s=Math.max(s,e.measureText(l).width+i),a+=c.lineHeight}return e.restore(),{width:s,height:a}}function wM(e,{x:t,y:n},i,r){e.beginPath();let s=0;i.forEach(function(a,o){const c=r[Math.min(o,r.length-1)],l=c.lineHeight;e.font=c.string,e.strokeText(a,t,n+l/2+s),s+=l}),e.stroke()}function vM(e,{x:t,y:n},i,{fonts:r,colors:s}){let a=0;i.forEach(function(o,c){const l=s[Math.min(c,s.length-1)],u=r[Math.min(c,r.length-1)],h=u.lineHeight;e.beginPath(),e.font=u.string,e.fillStyle=l,e.fillText(o,t,n+h/2+a),a+=h,e.fill()})}function SM(e,t){const n=Tn(e)?e:t;return Tn(n)?da(n,0,1):1}const um=["left","bottom","top","right"];function kM(e,t){const{pointX:n,pointY:i,options:r}=t,s=r.callout,a=s&&s.display&&EM(t,s);if(!a||PM(t,s,a))return;if(e.save(),e.beginPath(),!dn(e,s))return e.restore();const{separatorStart:c,separatorEnd:l}=MM(t,a),{sideStart:u,sideEnd:h}=DM(t,a,c);(s.margin>0||r.borderWidth===0)&&(e.moveTo(c.x,c.y),e.lineTo(l.x,l.y)),e.moveTo(u.x,u.y),e.lineTo(h.x,h.y);const f=ri({x:n,y:i},t.getCenterPoint(),jt(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function MM(e,t){const{x:n,y:i,x2:r,y2:s}=e,a=TM(e,t);let o,c;return t==="left"||t==="right"?(o={x:n+a,y:i},c={x:o.x,y:s}):(o={x:n,y:i+a},c={x:r,y:o.y}),{separatorStart:o,separatorEnd:c}}function TM(e,t){const{width:n,height:i,options:r}=e,s=r.callout.margin+r.borderWidth/2;return t==="right"?n+s:t==="bottom"?i+s:-s}function DM(e,t,n){const{y:i,width:r,height:s,options:a}=e,o=a.callout.start,c=CM(t,a.callout);let l,u;return t==="left"||t==="right"?(l={x:n.x,y:i+Ln(s,o)},u={x:l.x+c,y:l.y}):(l={x:n.x+Ln(r,o),y:n.y},u={x:l.x,y:l.y+c}),{sideStart:l,sideEnd:u}}function CM(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function EM(e,t){const n=t.position;return um.includes(n)?n:OM(e,t)}function OM(e,t){const{x:n,y:i,x2:r,y2:s,width:a,height:o,pointX:c,pointY:l,centerX:u,centerY:h,rotation:f}=e,m={x:u,y:h},g=t.start,p=Ln(a,g),x=Ln(o,g),S=[n,n+p,n+p,r],v=[i+x,s,i,s],k=[];for(let D=0;D<4;D++){const M=ri({x:S[D],y:v[D]},m,jt(f));k.push({position:um[D],distance:bi(M,{x:c,y:l})})}return k.sort((D,M)=>D.distance-M.distance)[0].position}function PM(e,t,n){const{pointX:i,pointY:r}=e,s=t.margin;let a=i,o=r;return n==="left"?a+=s:n==="right"?a-=s:n==="top"?o+=s:n==="bottom"&&(o-=s),e.inRange(a,o)}const dm={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 Li(e,t,n){return t=typeof t=="number"?t:e.parse(t),At(t)?e.getPixelForValue(t):n}function oi(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const r=n.charAt(0),s=Object.values(e).filter(a=>a.axis&&a.axis===r);return s.length?s[0].id:r}function hm(e,t){if(e){const n=e.options.reverse,i=Li(e,t.min,n?t.end:t.start),r=Li(e,t.max,n?t.start:t.end);return{start:i,end:r}}}function fm(e,t){const{chartArea:n,scales:i}=e,r=i[oi(i,t,"xScaleID")],s=i[oi(i,t,"yScaleID")];let a=n.width/2,o=n.height/2;return r&&(a=Li(r,t.xValue,r.left+r.width/2)),s&&(o=Li(s,t.yValue,s.top+s.height/2)),{x:a,y:o}}function Pl(e,t){const n=e.scales,i=n[oi(n,t,"xScaleID")],r=n[oi(n,t,"yScaleID")];if(!i&&!r)return{};let{left:s,right:a}=i||e.chartArea,{top:o,bottom:c}=r||e.chartArea;const l=pm(i,{min:t.xMin,max:t.xMax,start:s,end:a});s=l.start,a=l.end;const u=pm(r,{min:t.yMin,max:t.yMax,start:c,end:o});return o=u.start,c=u.end,{x:s,y:o,x2:a,y2:c,width:a-s,height:c-o,centerX:s+(a-s)/2,centerY:o+(c-o)/2}}function mm(e,t){if(!rm(t)){const n=Pl(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const r=i*2,s=n.centerX+t.xAdjust,a=n.centerY+t.yAdjust;return{x:s-i,y:a-i,x2:s+i,y2:a+i,centerX:s,centerY:a,width:r,height:r,radius:i}}return AM(e,t)}function RM(e,t){const{scales:n,chartArea:i}=e,r=n[t.scaleID],s={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return r?IM(r,s,t):LM(n,s,t),s}function gm(e,t){const n=Pl(e,t);return n.initProperties=Ai(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:BM(e,n,t),initProperties:n.initProperties}],n}function AM(e,t){const n=fm(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function pm(e,t){const n=hm(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function IM(e,t,n){const i=Li(e,n.value,NaN),r=Li(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=r):(t.y=i,t.y2=r)}function LM(e,t,n){for(const i of Object.keys(dm)){const r=e[oi(e,n,i)];if(r){const{min:s,max:a,start:o,end:c,startProp:l,endProp:u}=dm[i],h=hm(r,{min:n[s],max:n[a],start:r[o],end:r[c]});t[l]=h.start,t[u]=h.end}}}function NM({properties:e,options:t},n,i,r){const{x:s,x2:a,width:o}=e;return ym({start:s,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:r.left,end:r.right},adjust:t.label.xAdjust,size:n.width})}function FM({properties:e,options:t},n,i,r){const{y:s,y2:a,height:o}=e;return ym({start:s,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:r.top,end:r.bottom},adjust:t.label.yAdjust,size:n.height})}function ym(e,t){const{start:n,end:i,borderWidth:r}=e,{position:s,padding:{start:a,end:o},adjust:c}=t,l=i-r-n-a-o-t.size;return n+r/2+c+Cl(l,s)}function BM(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const r=El(i.position),s=Ut(i.padding),a=ma(e.ctx,i),o=NM({properties:t,options:n},a,r,s),c=FM({properties:t,options:n},a,r,s),l=a.width+s.width,u=a.height+s.height;return{x:o,y:c,x2:o+l,y2:c+u,width:l,height:u,centerX:o+l/2,centerY:c+u/2,rotation:i.rotation}}const Rl=["enter","leave"],Al=Rl.concat("click");function zM(e,t,n){t.listened=am(n,Al,t.listeners),t.moveListened=!1,Rl.forEach(i=>{be(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&be(i.click)&&(t.listened=!0),t.moveListened||Rl.forEach(r=>{be(i[r])&&(t.listened=!0,t.moveListened=!0)})})}function HM(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return VM(e,t,n);case"click":return WM(e,t,n)}}function VM(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=Dl(e.visibleElements,t,n.interaction):i=[];const r=e.hovered;e.hovered=i;const s={state:e,event:t};let a=bm(s,"leave",r,i);return bm(s,"enter",i,r)||a}function bm({state:e,event:t},n,i,r){let s;for(const a of i)r.indexOf(a)<0&&(s=_m(a.options[n]||e.listeners[n],a,t)||s);return s}function WM(e,t,n){const i=e.listeners,r=Dl(e.visibleElements,t,n.interaction);let s;for(const a of r)s=_m(a.options.click||i.click,a,t)||s;return s}function _m(e,t,n){return Mt(e,[t.$context,n])===!0}const ga=["afterDraw","beforeDraw"];function YM(e,t,n){const i=t.visibleElements;t.hooked=am(n,ga,t.hooks),t.hooked||i.forEach(r=>{t.hooked||ga.forEach(s=>{be(r.options[s])&&(t.hooked=!0)})})}function xm(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return Mt(i,[t.$context])}}function $M(e,t,n){const i=GM(e.scales,t,n);let r=wm(t,i,"min","suggestedMin");r=wm(t,i,"max","suggestedMax")||r,r&&be(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function jM(e,t){for(const n of e)qM(n,t)}function wm(e,t,n,i){if(At(t[n])&&!UM(e.options,n,i)){const r=e[n]!==t[n];return e[n]=t[n],r}}function UM(e,t,n){return ye(e[t])||ye(e[n])}function qM(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=oi(t,e,n);i&&!t[i]&&XM(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function XM(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(ye(e[n+i]))return!0;return!1}function GM(e,t,n){const i=t.axis,r=t.id,s=i+"ScaleID",a={min:at(t.min,Number.NEGATIVE_INFINITY),max:at(t.max,Number.POSITIVE_INFINITY)};for(const o of n)o.scaleID===r?vm(o,t,["value","endValue"],a):oi(e,o,s)===r&&vm(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function vm(e,t,n,i){for(const r of n){const s=e[r];if(ye(s)){const a=t.parse(s);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Ni extends Jt{inRange(t,n,i,r){const{x:s,y:a}=ri({x:t,y:n},this.getCenterPoint(r),jt(-this.options.rotation));return Kf({x:s,y:a},this.getProps(["x","y","x2","y2"],r),i,this.options)}getCenterPoint(t){return ai(this,t)}draw(t){t.save(),fa(t,this.getCenterPoint(),this.options.rotation),lm(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return gm(t,n)}}Ni.id="boxAnnotation",Ni.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:1,display:!0,init:void 0,hitTolerance:0,label:{backgroundColor:"transparent",borderWidth:0,callout:{display:!1},color:"black",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:void 0,textAlign:"start",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Ni.defaultRoutes={borderColor:"color",backgroundColor:"color"},Ni.descriptors={label:{_fallback:!0}};class pa extends Jt{inRange(t,n,i,r){return Zf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options;!n.display||!n.content||(eT(t,this),t.save(),fa(t,this.getCenterPoint(),this.rotation),cm(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=KM(t,n);if(!i)return{};const{controllerMeta:r,point:s,radius:a}=QM(t,n,i);let o=ma(t.ctx,n);const c=JM(o,a);nm(n,c)&&(o={width:o.width*c,height:o.height*c});const{position:l,xAdjust:u,yAdjust:h}=n,f=em(s,o,{borderWidth:0,position:l,xAdjust:u,yAdjust:h});return{initProperties:Ai(t,f,n),...f,...r,rotation:n.rotation,_fitRatio:c}}}pa.id="doughnutLabelAnnotation",pa.defaults={autoFit:!0,autoHide:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderColor:"transparent",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:0,color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,spacing:1,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0},pa.defaultRoutes={};function KM(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const r=i.controller;return r instanceof an&&ZM(e,t,i.data)&&(!n||r.innerRadius<n.controller.innerRadius)&&r.options.circumference>=90?i:n},void 0)}function ZM(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function QM({chartArea:e},t,n){const{left:i,top:r,right:s,bottom:a}=e,{innerRadius:o,offsetX:c,offsetY:l}=n.controller,u=(i+s)/2+c,h=(r+a)/2+l,f={left:Math.max(u-o,i),right:Math.min(u+o,s),top:Math.max(h-o,r),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},g=t.spacing+t.borderWidth/2,p=o-g,x=m.y>h,S=x?r+g:a-g,v=tT(S,u,h,p);return{controllerMeta:{_centerX:u,_centerY:h,_radius:p,_counterclockwise:x,...v},point:m,radius:Math.min(o,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function JM({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function tT(e,t,n,i){const r=Math.pow(n-e,2),s=Math.pow(i,2),a=t*-2,o=Math.pow(t,2)+r-s,c=Math.pow(a,2)-4*o;if(c<=0)return{_startAngle:0,_endAngle:Ot};const l=(-a-Math.sqrt(c))/2,u=(-a+Math.sqrt(c))/2;return{_startAngle:ys({x:t,y:n},{x:l,y:e}).angle,_endAngle:ys({x:t,y:n},{x:u,y:e}).angle}}function eT(e,t){const{_centerX:n,_centerY:i,_radius:r,_startAngle:s,_endAngle:a,_counterclockwise:o,options:c}=t;e.save();const l=dn(e,c);e.fillStyle=c.backgroundColor,e.beginPath(),e.arc(n,i,r,s,a,o),e.closePath(),e.fill(),l&&e.stroke(),e.restore()}class qr extends Jt{inRange(t,n,i,r){return Zf({x:t,y:n},{rect:this.getProps(["x","y","x2","y2"],r),center:this.getCenterPoint(r)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options,i=!ye(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),fa(t,this.getCenterPoint(),this.rotation),kM(t,this),lm(t,this,n),cm(t,nT(this),n),t.restore())}resolveElementProperties(t,n){let i;if(rm(n))i=fm(t,n);else{const{centerX:o,centerY:c}=Pl(t,n);i={x:o,y:c}}const r=Ut(n.padding),s=ma(t.ctx,n),a=em(i,s,n,r);return{initProperties:Ai(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}qr.id="labelAnnotation",qr.defaults={adjustScaleRange:!0,backgroundColor:"transparent",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:0,borderShadowColor:"transparent",borderWidth:0,callout:{borderCapStyle:"butt",borderColor:void 0,borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:1,display:!1,margin:5,position:"auto",side:5,start:"50%"},color:"black",content:null,display:!0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:void 0},height:void 0,hitTolerance:0,init:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},qr.defaultRoutes={borderColor:"color"};function nT({x:e,y:t,width:n,height:i,options:r}){const s=r.borderWidth/2,a=Ut(r.padding);return{x:e+a.left+s,y:t+a.top+s,width:n-a.left-a.right-r.borderWidth,height:i-a.top-a.bottom-r.borderWidth}}const Il=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),Ll=(e,t,n)=>Il(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Sm=(e,t,n)=>Il(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Xr=e=>e*e,iT=(e,t,{x:n,y:i,x2:r,y2:s},a)=>a==="y"?{start:Math.min(i,s),end:Math.max(i,s),value:t}:{start:Math.min(n,r),end:Math.max(n,r),value:e},km=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,Nl=(e,t,n,i)=>({x:km(e.x,t.x,n.x,i),y:km(e.y,t.y,n.y,i)}),Mm=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),Tm=(e,t,n,i)=>-Math.atan2(Mm(e.x,t.x,n.x,i),Mm(e.y,t.y,n.y,i))+.5*dt;class Gr extends Jt{inRange(t,n,i,r){const s=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:o,ctx:c}=this;if(o){dn(c,this.options),c.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=n*u.currentDevicePixelRatio,m=c.isPointInStroke(o,h,f)||Fl(this,a,r);return c.restore(),m}const l=Xr(s);return oT(this,a,l,r)||Fl(this,a,r)}return rT(this,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:r})}getCenterPoint(t){return ai(this,t)}draw(t){const{x:n,y:i,x2:r,y2:s,cp:a,options:o}=this;if(t.save(),!dn(t,o))return t.restore();Ii(t,o);const c=Math.sqrt(Math.pow(r-n,2)+Math.pow(s-i,2));if(o.curve&&a)return gT(t,this,a,c),t.restore();const{startOpts:l,endOpts:u,startAdjust:h,endAdjust:f}=Pm(this),m=Math.atan2(s-i,r-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(c-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Bl(t,0,h,l),Bl(t,c,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=RM(t,n),{x:r,y:s,x2:a,y2:o}=i,c=sT(i,t.chartArea),l=c?aT({x:r,y:s},{x:a,y:o},t.chartArea):{x:r,y:s,x2:a,y2:o,width:Math.abs(a-r),height:Math.abs(o-s)};if(l.centerX=(a+r)/2,l.centerY=(o+s)/2,l.initProperties=Ai(t,l,n),n.curve){const h={x:l.x,y:l.y},f={x:l.x2,y:l.y2};l.cp=mT(l,n,bi(h,f))}const u=lT(t,l,n.label);return u._visible=c,l.elements=[{type:"label",optionScope:"label",properties:u,initProperties:l.initProperties}],l}}Gr.id="lineAnnotation";const Dm={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};Gr.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Dm),fill:!1,length:12,start:Object.assign({},Dm),width:6},borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:2,curve:!1,controlPoint:{y:"-50%"},display:!0,endValue:void 0,init:void 0,hitTolerance:0,label:{backgroundColor:"rgba(0,0,0,0.8)",backgroundShadowColor:"transparent",borderCapStyle:"butt",borderColor:"black",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderRadius:6,borderShadowColor:"transparent",borderWidth:0,callout:Object.assign({},qr.defaults.callout),color:"#fff",content:null,display:!1,drawTime:void 0,font:{family:void 0,lineHeight:void 0,size:void 0,style:void 0,weight:"bold"},height:void 0,hitTolerance:void 0,opacity:void 0,padding:6,position:"center",rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,textAlign:"center",textStrokeColor:void 0,textStrokeWidth:0,width:void 0,xAdjust:0,yAdjust:0,z:void 0},scaleID:void 0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,value:void 0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Gr.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Gr.defaultRoutes={borderColor:"color"};function rT(e,{mouseX:t,mouseY:n},i,{hitSize:r,useFinalPosition:s}){const a=iT(t,n,e.getProps(["x","y","x2","y2"],s),i);return Gf(a,r)||Fl(e,{mouseX:t,mouseY:n},s,i)}function sT({x:e,y:t,x2:n,y2:i},{top:r,right:s,bottom:a,left:o}){return!(e<o&&n<o||e>s&&n>s||t<r&&i<r||t>a&&i>a)}function Cm({x:e,y:t},n,{top:i,right:r,bottom:s,left:a}){return e<a&&(t=Sm(a,{x:e,y:t},n),e=a),e>r&&(t=Sm(r,{x:e,y:t},n),e=r),t<i&&(e=Ll(i,{x:e,y:t},n),t=i),t>s&&(e=Ll(s,{x:e,y:t},n),t=s),{x:e,y:t}}function aT(e,t,n){const{x:i,y:r}=Cm(e,t,n),{x:s,y:a}=Cm(t,e,n);return{x:i,y:r,x2:s,y2:a,width:Math.abs(s-i),height:Math.abs(a-r)}}function oT(e,{mouseX:t,mouseY:n},i=si,r){const{x:s,y:a,x2:o,y2:c}=e.getProps(["x","y","x2","y2"],r),l=o-s,u=c-a,h=Xr(l)+Xr(u),f=h===0?-1:((t-s)*l+(n-a)*u)/h;let m,g;return f<0?(m=s,g=a):f>1?(m=o,g=c):(m=s+f*l,g=a+f*u),Xr(t-m)+Xr(n-g)<=i}function Fl(e,{mouseX:t,mouseY:n},i,r){const s=e.label;return s.options.display&&s.inRange(t,n,r,i)}function lT(e,t,n){const i=n.borderWidth,r=Ut(n.padding),s=ma(e.ctx,n),a=s.width+r.width+i,o=s.height+r.height+i;return uT(t,n,{width:a,height:o,padding:r},e.chartArea)}function cT(e){const{x:t,y:n,x2:i,y2:r}=e,s=Math.atan2(r-n,i-t);return s>dt/2?s-dt:s<dt/-2?s+dt:s}function uT(e,t,n,i){const{width:r,height:s,padding:a}=n,{xAdjust:o,yAdjust:c}=t,l={x:e.x,y:e.y},u={x:e.x2,y:e.y2},h=t.rotation==="auto"?cT(e):jt(t.rotation),f=dT(r,s,h),m=hT(e,t,{labelSize:f,padding:a},i),g=e.cp?Nl(l,e.cp,u,m):Il(l,u,m),p={size:f.w,min:i.left,max:i.right,padding:a.left},x={size:f.h,min:i.top,max:i.bottom,padding:a.top},S=Om(g.x,p)+o,v=Om(g.y,x)+c;return{x:S-r/2,y:v-s/2,x2:S+r/2,y2:v+s/2,centerX:S,centerY:v,pointX:g.x,pointY:g.y,width:r,height:s,rotation:ps(h)}}function dT(e,t,n){const i=Math.cos(n),r=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*r),h:Math.abs(e*r)+Math.abs(t*i)}}function hT(e,t,n,i){let r;const s=fT(e,i);return t.position==="start"?r=Em({w:e.x2-e.x,h:e.y2-e.y},n,t,s):t.position==="end"?r=1-Em({w:e.x-e.x2,h:e.y-e.y2},n,t,s):r=Cl(1,t.position),r}function Em(e,t,n,i){const{labelSize:r,padding:s}=t,a=e.w*i.dx,o=e.h*i.dy,c=a>0&&(r.w/2+s.left-i.x)/a,l=o>0&&(r.h/2+s.top-i.y)/o;return da(Math.max(c,l),0,.25)}function fT(e,t){const{x:n,x2:i,y:r,y2:s}=e,a=Math.min(r,s)-t.top,o=Math.min(n,i)-t.left,c=t.bottom-Math.max(r,s),l=t.right-Math.max(n,i);return{x:Math.min(o,l),y:Math.min(a,c),dx:o<=l?1:-1,dy:a<=c?1:-1}}function Om(e,t){const{size:n,min:i,max:r,padding:s}=t,a=n/2;return n>r-i?(r+i)/2:(i>=e-s-a&&(e=i+s+a),r<=e+s+a&&(e=r-s-a),e)}function Pm(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Rm(e,n),endAdjust:Rm(e,i)}}function Rm(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,r=e.options.borderWidth/2,s={x:n,y:i+r};return Math.abs(Ll(0,s,{x:0,y:r}))}function Bl(e,t,n,i){if(!i||!i.display)return;const{length:r,width:s,fill:a,backgroundColor:o,borderColor:c}=i,l=Math.abs(t-r)+n;e.beginPath(),Ii(e,i),dn(e,i),e.moveTo(l,-s),e.lineTo(t+n,0),e.lineTo(l,s),a===!0?(e.fillStyle=o||c,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function mT(e,t,n){const{x:i,y:r,x2:s,y2:a,centerX:o,centerY:c}=e,l=Math.atan2(a-r,s-i),u=El(t.controlPoint,0),h={x:o+Ln(n,u.x,!1),y:c+Ln(n,u.y,!1)};return ri(h,{x:o,y:c},l)}function Am(e,{x:t,y:n},{angle:i,adjust:r},s){!s||!s.display||(e.save(),e.translate(t,n),e.rotate(i),Bl(e,0,-r,s),e.restore())}function gT(e,t,n,i){const{x:r,y:s,x2:a,y2:o,options:c}=t,{startOpts:l,endOpts:u,startAdjust:h,endAdjust:f}=Pm(t),m={x:r,y:s},g={x:a,y:o},p=Tm(m,n,g,0),x=Tm(m,n,g,1)-dt,S=Nl(m,n,g,h/i),v=Nl(m,n,g,1-f/i),k=new Path2D;e.beginPath(),k.moveTo(S.x,S.y),k.quadraticCurveTo(n.x,n.y,v.x,v.y),e.shadowColor=c.borderShadowColor,e.stroke(k),t.path=k,t.ctx=e,Am(e,S,{angle:p,adjust:h},l),Am(e,v,{angle:x,adjust:f},u)}class Kr extends Jt{inRange(t,n,i,r){const s=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return pT({x:t,y:n},this.getProps(["width","height","centerX","centerY"],r),s,a);const{x:o,y:c,x2:l,y2:u}=this.getProps(["x","y","x2","y2"],r),h=i==="y"?{start:c,end:u}:{start:o,end:l},f=ri({x:t,y:n},this.getCenterPoint(r),jt(-s));return f[i]>=h.start-a-si&&f[i]<=h.end+a+si}getCenterPoint(t){return ai(this,t)}draw(t){const{width:n,height:i,centerX:r,centerY:s,options:a}=this;t.save(),fa(t,this.getCenterPoint(),a.rotation),Ii(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=dn(t,a);t.ellipse(r,s,i/2,n/2,dt/2,0,2*dt),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return gm(t,n)}}Kr.id="ellipseAnnotation",Kr.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Ni.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},Kr.defaultRoutes={borderColor:"color",backgroundColor:"color"},Kr.descriptors={label:{_fallback:!0}};function pT(e,t,n,i){const{width:r,height:s,centerX:a,centerY:o}=t,c=r/2,l=s/2;if(c<=0||l<=0)return!1;const u=jt(n||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(e.x-a)+f*(e.y-o),2),g=Math.pow(f*(e.x-a)-h*(e.y-o),2);return m/Math.pow(c+i,2)+g/Math.pow(l+i,2)<=1.0001}class ya extends Jt{inRange(t,n,i,r){const{x:s,y:a,x2:o,y2:c,width:l}=this.getProps(["x","y","x2","y2","width"],r),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?uM({x:t,y:n},this.getCenterPoint(r),l/2,u):Gf(i==="y"?{start:a,end:c,value:n}:{start:s,end:o,value:t},u)}getCenterPoint(t){return ai(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Ii(t,n);const r=dn(t,n);bM(t,this,this.centerX,this.centerY),r&&!ha(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=mm(t,n);return i.initProperties=Ai(t,i,n),i}}ya.id="pointAnnotation",ya.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,pointStyle:"circle",radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ya.defaultRoutes={borderColor:"color",backgroundColor:"color"};class ba extends Jt{inRange(t,n,i,r){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&bT(this.elements,t,n,r);const s=ri({x:t,y:n},this.getCenterPoint(r),jt(-this.options.rotation)),a=this.elements.map(l=>i==="y"?l.bY:l.bX),o=Math.min(...a),c=Math.max(...a);return s[i]>=o&&s[i]<=c}getCenterPoint(t){return ai(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Ii(t,i);const r=dn(t,i);let s=!0;for(const a of n)s?(t.moveTo(a.x,a.y),s=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),r&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=mm(t,n),{sides:r,rotation:s}=n,a=[],o=2*dt/r;let c=s*qa;for(let l=0;l<r;l++,c+=o){const u=yT(i,n,c);u.initProperties=Ai(t,i,n),a.push(u)}return i.elements=a,i}}ba.id="polygonAnnotation",ba.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,point:{radius:0},radius:10,rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,sides:3,xAdjust:0,xMax:void 0,xMin:void 0,xScaleID:void 0,xValue:void 0,yAdjust:0,yMax:void 0,yMin:void 0,yScaleID:void 0,yValue:void 0,z:0},ba.defaultRoutes={borderColor:"color",backgroundColor:"color"};function yT({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:r},s){const a=(i+r)/2,o=Math.sin(s),c=Math.cos(s),l={x:e+o*n,y:t-c*n};return{type:"point",optionScope:"point",properties:{x:l.x,y:l.y,centerX:l.x,centerY:l.y,bX:e+o*(n+a),bY:t-c*(n+a)}}}function bT(e,t,n,i){let r=!1,s=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const o=a.getProps(["bX","bY"],i);o.bY>n!=s.bY>n&&t<(s.bX-o.bX)*(n-o.bY)/(s.bY-o.bY)+o.bX&&(r=!r),s=o}return r}const Nn={box:Ni,doughnutLabel:pa,ellipse:Kr,label:qr,line:Gr,point:ya,polygon:ba};Object.keys(Nn).forEach(e=>{Rt.describe(`elements.${Nn[e].id}`,{_fallback:"plugins.annotation.common"})});const _T={update:Object.assign},xT=Al.concat(ga),Im=(e,t)=>ft(t)?Vl(e,t):e,zl=e=>e==="color"||e==="font";function Hl(e="line"){return Nn[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function wT(e,t,n,i){const r=ST(e,n.animations,i),s=t.annotations,a=TT(t.elements,s);for(let o=0;o<s.length;o++){const c=s[o],l=Lm(a,o,c.type),u=c.setContext(MT(e,l,a,c)),h=l.resolveElementProperties(e,u);h.skip=vT(h),"elements"in h&&(kT(l,h.elements,u,r),delete h.elements),ye(l.x)||Object.assign(l,h),Object.assign(l,h.initProperties),h.options=Nm(u),r.update(l,h)}}function vT(e){return isNaN(e.x)||isNaN(e.y)}function ST(e,t,n){return n==="reset"||n==="none"||n==="resize"?_T:new oo(e,t)}function kT(e,t,n,i){const r=e.elements||(e.elements=[]);r.length=t.length;for(let s=0;s<t.length;s++){const a=t[s],o=a.properties,c=Lm(r,s,a.type,a.initProperties),l=n[a.optionScope].override(a);o.options=Nm(l),i.update(c,o)}}function Lm(e,t,n,i){const r=Nn[Hl(n)];let s=e[t];return(!s||!(s instanceof r))&&(s=e[t]=new r,Object.assign(s,i)),s}function Nm(e){const t=Nn[Hl(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,Vl(e,t.defaults),Vl(e,t.defaultRoutes));for(const i of xT)n[i]=e[i];return n}function Vl(e,t){const n={};for(const i of Object.keys(t)){const r=t[i],s=e[i];zl(i)&&kt(s)?n[i]=s.map(a=>Im(a,r)):n[i]=Im(s,r)}return n}function MT(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(r=>r&&r.options)},id:i.id,type:"annotation"}))}function TT(e,t){const n=t.length,i=e.length;if(i<n){const r=n-i;e.splice(i,0,...new Array(r))}else i>n&&e.splice(n,i-n);return e}var DT="3.1.0";const Fn=new Map,Fm=e=>e.type!=="doughnutLabel",CT=Al.concat(ga);var Bm={id:"annotation",version:DT,beforeRegister(){dM("chart.js","4.0",_e.version)},afterRegister(){_e.register(Nn)},afterUnregister(){_e.unregister(Nn)},beforeInit(e){Fn.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=Fn.get(e),r=i.annotations=[];let s=n.annotations;ft(s)?Object.keys(s).forEach(a=>{const o=s[a];ft(o)&&(o.id=a,r.push(o))}):kt(s)&&r.push(...s),jM(r.filter(Fm),e.scales)},afterDataLimits(e,t){const n=Fn.get(e);$M(e,t.scale,n.annotations.filter(Fm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=Fn.get(e);zM(e,i,n),wT(e,i,n,t.mode),i.visibleElements=i.elements.filter(r=>!r.skip&&r.options.display),YM(e,i,n)},beforeDatasetsDraw(e,t,n){Zr(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Zr(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Zr(e,t.index,n.clip)},beforeDraw(e,t,n){Zr(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Zr(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=Fn.get(e);HM(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){Fn.delete(e)},getAnnotations(e){const t=Fn.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return Dl(e,t,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:e=>!CT.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Nn[Hl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:zl,_fallback:!0},_indexable:zl}},additionalOptionScopes:[""]};function Zr(e,t,n){const{ctx:i,chartArea:r}=e,s=Fn.get(e);n&&or(i,r);const a=ET(s.visibleElements,t).sort((o,c)=>o.element.options.z-c.element.options.z);for(const o of a)OT(i,r,s,o);n&&lr(i)}function ET(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const r of i.elements)r.options.display&&r.options.drawTime===t&&n.push({element:r});return n}function OT(e,t,n,i){const r=i.element;i.main?(xm(n,r,"beforeDraw"),r.draw(e,t),xm(n,r,"afterDraw")):r.draw(e,t)}const PT={class:"zoom-timerange-container"},RT={class:"zoom-timerange-details"},AT={class:"label","data-testid":"zoom-timerange-from"},IT={class:"label","data-testid":"zoom-timerange-to"},LT=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.ref(Wr({tickValue:t.start,granularity:t.granularity})),r=d.ref(Wr({tickValue:t.end,granularity:t.granularity})),s=(a,o)=>{ol(()=>{i.value=Wr({tickValue:a,granularity:t.granularity}),r.value=Wr({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{s(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",PT,[d.createElementVNode("div",RT,[d.createElementVNode("div",AT,d.toDisplayString(d.unref(n).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",IT,d.toDisplayString(d.unref(n).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(r.value),1)])]))}}),Ee=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},zm=Ee(LT,[["__scopeId","data-v-0e972e3c"]]),NT={class:"zoom-actions-container"},FT={class:"zoom-actions-heading"},BT={class:"zoom-action-select"},zT=["data-testid"],HT=["aria-disabled","href"],VT=["onClick"],WT=Ee(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,r=s=>{s.action&&(s.action(n.newTimeRange),i("onAction"))};return(s,a)=>(d.openBlock(),d.createElementBlock("div",NT,[d.createElementVNode("div",FT,[d.createVNode(zm,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(ne.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(ll),size:d.unref(zr),onClick:a[0]||(a[0]=o=>s.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",BT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.zoomActionItems,o=>(d.openBlock(),d.createElementBlock("div",{key:o.key,class:d.normalizeClass(["zoom-action-item",{disabled:o.disabled}]),"data-testid":`zoom-action-item-${o.key}`},[o.href?(d.openBlock(),d.createElementBlock("a",{key:0,"aria-disabled":o.disabled,class:"zoom-action-link",href:o.href,onClick:a[1]||(a[1]=c=>s.$emit("onAction"))},d.toDisplayString(o.label),9,HT)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:c=>r(o)},d.toDisplayString(o.label),9,VT))],10,zT))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),YT={key:2},$T={class:"tooltip-title"},jT={class:"title"},UT={key:0,class:"subtitle"},qT={class:"context"},XT={class:"metric"},GT={class:"tooltip"},KT={key:0},ZT={class:"display-value"},_a=Ee(d.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(e,{emit:t}){const n=t,i=e,r=d.ref(null),{x:s,y:a,isDragging:o}=Zk(r,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),c=d.computed(()=>`${a.value}px`),l=d.computed(()=>`${s.value}px`),u=d.computed(()=>i.state.tooltipContext),h=d.computed(()=>i.state.metricDisplay),f=d.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return d.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,g])=>{o.value||(s.value=parseFloat(m),a.value=parseFloat(g))}),d.watch(o,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(r,m=>{if(m){const{width:g,height:p}=m.getBoundingClientRect();n("dimensions",{width:g,height:p})}}),(m,g)=>{var p,x;return e.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:r,class:d.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${l.value}, ${c.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity?(d.openBlock(),d.createBlock(zm,{key:0,end:(p=e.zoomTimeRange)==null?void 0:p.end,granularity:e.granularity,start:(x=e.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(d.openBlock(),d.createBlock(WT,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:g[0]||(g[0]=S=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",YT,[d.createElementVNode("div",$T,[d.createElementVNode("div",jT,[d.createElementVNode("div",null,d.toDisplayString(e.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(ne.DragIcon),{key:0,class:"drag-icon",color:d.unref(ll),size:d.unref(zr)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",UT,[d.createElementVNode("div",qT,d.toDisplayString(u.value),1),d.createElementVNode("div",XT,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",GT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.state.tooltipSeries,({backgroundColor:S,borderColor:v,label:k,value:D,isSegmentEmpty:M},P)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:k+P},[e.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",KT,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:S,"border-color":v})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:M}])},d.toDisplayString(k),3),d.createElementVNode("span",ZT,d.toDisplayString(D),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-078294a6"]]),QT=["onClick"],JT={key:0,class:"sub-label"},tD={class:"tooltip-content"},Wl=Ee(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){d.useCssVars(D=>({v6d3f1170:c.value}));const t=e,{i18n:n}=pt.useI18n(),i=d.ref(),r=d.ref([]),s=d.inject("showLegendValues",!0),a=d.inject("legendPosition",d.ref(Nt.Right)),o=d.ref([]),c=d.ref(bf),l=()=>{const D=i.value;if(!D||!r.value||D.children.length===0)return 0;const M=D.children[0].getBoundingClientRect().top;for(const P of r.value)if(P.getBoundingClientRect().top>M)return!0;return!1},u=d.computed(()=>t.items.length>2||a.value===Nt.Right),h=()=>{i.value&&a.value===Nt.Bottom&&(l()?c.value=PS:c.value=bf)},f=()=>{if(i.value&&a.value===Nt.Bottom){let D=0;r.value.forEach(P=>{const E=Array.from(P.children).reduce((y,_)=>y+_.offsetWidth,0);E>D&&(D=E)});const M=parseInt(OS,10);i.value.style.gridTemplateColumns=`repeat(auto-fit, ${D+M}px)`}h()},m=()=>{if(t.items.length!==o.value.length)return o.value=t.items,!0;for(let D=0;D<t.items.length;D++)if(t.items[D].text!==o.value[D].text)return o.value=t.items,!0;return!1};d.watch(()=>t.items,()=>{m()&&f()},{immediate:!0,flush:"post"});const g=d.ref(0),p=d.ref(0),x=new ResizeObserver(ol(D=>{const M=D[0],P=M.contentRect.width,E=M.contentRect.height;P!==g.value&&E===p.value&&f(),g.value=P,p.value=E},100));d.watch(()=>a.value,()=>{f()}),d.onMounted(()=>{o.value=t.items,i.value&&x.observe(i.value),window.requestAnimationFrame(()=>{f()})}),d.onBeforeUnmount(()=>{i.value&&x.unobserve(i.value)});const S=(D=0,M)=>{if(t.chartInstance===null)return;const P=t.chartInstance instanceof _e?t.chartInstance:t.chartInstance.chart;v(D,M)?P.hide(D,M):P.show(D,M),P.update()},v=(D=0,M)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const P=t.chartInstance instanceof _e?t.chartInstance:t.chartInstance.chart,E=P.getDatasetMeta(D);return E.dataset||M===void 0?P.isDatasetVisible(D):!(E.data.length&&E.data[M].hidden)},k=D=>({[Nt.Right]:"vertical",[Nt.Bottom]:"horizontal",[Nt.Hidden]:"hidden"})[D];return(D,M)=>{const P=d.resolveComponent("KTooltip");return d.unref(a)!==d.unref(Nt).Hidden?(d.openBlock(),d.createElementBlock("ul",{key:0,ref_key:"legendContainerRef",ref:i,class:d.normalizeClass(["legend-container",k(d.unref(a))]),"data-testid":"legend"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.items,({fillStyle:E,strokeStyle:y,text:_,datasetIndex:T,index:O,value:A,isSegmentEmpty:I})=>(d.openBlock(),d.createElementBlock("li",{key:_,ref_for:!0,ref_key:"legendItemsRef",ref:r,onClick:B=>S(T,O)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:E,"border-color":y})},null,4),d.createVNode(P,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!v(T,O)}])},[d.createElementVNode("div",{class:d.normalizeClass(["label",{"truncate-label":u.value,empty:I}])},d.toDisplayString(_),3),A&&d.unref(s)?(d.openBlock(),d.createElementBlock("div",JT,d.toDisplayString(A.formatted),1)):d.createCommentVNode("",!0)],2)]),_:2},[I?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",tD,d.toDisplayString(d.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,QT))),128))],2)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-2e13ddb3"]]),ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function eD(e,t=0){return(ie[e[t+0]]+ie[e[t+1]]+ie[e[t+2]]+ie[e[t+3]]+"-"+ie[e[t+4]]+ie[e[t+5]]+"-"+ie[e[t+6]]+ie[e[t+7]]+"-"+ie[e[t+8]]+ie[e[t+9]]+"-"+ie[e[t+10]]+ie[e[t+11]]+ie[e[t+12]]+ie[e[t+13]]+ie[e[t+14]]+ie[e[t+15]]).toLowerCase()}let Yl;const nD=new Uint8Array(16);function iD(){if(!Yl){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Yl=crypto.getRandomValues.bind(crypto)}return Yl(nD)}const Hm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function xa(e,t,n){var r;if(Hm.randomUUID&&!e)return Hm.randomUUID();e=e||{};const i=e.random??((r=e.rng)==null?void 0:r.call(e))??iD();if(i.length<16)throw new Error("Random bytes length must be >= 16");return i[6]=i[6]&15|64,i[8]=i[8]&63|128,eD(i)}const Vm=(e,t)=>{const n=e.ctx,i=e.scales.y,r=e.scales.x,s=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(s.x-s.width/2,s.y,s.width,i.bottom-s.y):n.strokeRect(r.left,s.y-s.height/2,s.x-r.left,s.height),n.restore()};class Wm{constructor(){R(this,"id","highlightPlugin");R(this,"_clickedElements");R(this,"_previousHoverOption");R(this,"_clicked",!1);R(this,"_pause",!1);R(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Vm(t,this._clickedElements)}afterEvent(t,{event:n}){var s;if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=((s=t.options.interaction)==null?void 0:s.mode)||"index",r=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);r.length&&this._clicked?(this._clickedElements=r,Vm(t,this._clickedElements),this._previousHoverOption=t.options.hover,t.options.hover={mode:null}):(delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1)}beforeDestroy(t){delete this._clickedElements,t.options.hover=this._previousHoverOption||t.options.hover,this._clicked=!1}pause(){this._pause=!0}get isPaused(){return this._pause}resume(t=!1){this._pause=!1,t&&(this._suppressNextClick=!0)}}const rD=["id"],sD=["id"],aD={class:"axis-tooltip-content"},Ym=6,oD="100%",lD="100%",cD=20,uD=20,$m=6,dD=0,hD=10,fD=10,mD=1,gD=Ee(d.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=pt.useI18n(),{translateUnit:i}=pt.useTranslatedUnits(),r=crypto.randomUUID(),s=crypto.randomUUID(),a=new Wm,o=d.useTemplateRef("chartContainer"),c=d.useTemplateRef("chartParent"),l=({chart:z},j)=>{var et;const $=z.data,J=(et=$.labels)==null?void 0:et.indexOf(j);return $.datasets.reduce((nt,rt,it)=>{if(z.isDatasetVisible(it)){const _t=rt.data[J];return isNaN(_t)?nt:nt+_t}else return nt},0)},u=(z,j,$,J)=>{const et=J==="horizontal";j===null&&(j=n.t("entityNoName"));const nt={type:"label",yValue:_t=>et?j:l(_t,j),xValue:_t=>et?l(_t,j):j},rt={...nt,position:et?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>et?0:-Math.abs(VS()),content:_t=>dl(l(_t,j),$)},it={...nt,content:_t=>Tf(l(_t,j),Mf(_t.chart,z)),position:et?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:_t=>et?kf(dl(l(_t,j),$)):0,color:wf};return{[`${j}-value`]:rt,[`${j}-percent`]:it}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=xa(),g=xa(),p=xa(),x=d.ref([]),S=d.inject("legendPosition",Nt.Right),v=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),k=d.toRef(t,"metricUnit"),D=d.computed(()=>t.orientation==="horizontal"),M=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.dimensionAxesTitle,tooltipSeries:[],left:"",top:"",units:t.metricUnit,translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:D.value?"horizontal_bar":"vertical_bar",chartID:s,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:P,tooltipAbsoluteTop:E}=pt.useTooltipAbsolutePosition(c,M),y=d.ref(0),_=()=>{var z;return t.annotations&&((z=t.chartData.labels)==null?void 0:z.reduce((j,$)=>Object.assign(j,u(t.chartData,$,k.value,t.orientation)),{}))},T={id:m,afterUpdate(z){y.value+=1,x.value=ff(z,t.legendValues,t.chartLegendSortFn)}},O={id:g,afterUpdate(z){z.options.plugins.annotation.annotations=t.annotations?_():{}}},B=[T,{id:"axisHover",afterEvent(z,j){var $;if(v.show=!1,j.event.type==="mousemove"){const J=j.event,et=z.options.indexAxis,nt=z.scales,rt=z.scales[et].getLabelForValue(Number(z.scales[et].getValueForPixel(J[et]))),_t=z.scales[et].getLabels().indexOf(rt),ct=($=t.chartData.isLabelEmpty)==null?void 0:$[_t];if((te=>te==="x"?J.y>nt.x.top:J.x<nt.y.right)(et)){M.interactionMode!=="interactive"&&(M.showTooltip=!1);const ce=z.canvas.getContext("2d").measureText(rt).width,qt=Math.abs(Math.round(J.x-ce*.5)),Ie=Math.round(J.x+ce*.5),St=z.canvas.getBoundingClientRect(),Xt=40;v.left=et==="x"?`${(qt>0?qt:Ie)-v.offset+St.left}px`:`${J.x-ce*.5-v.offset+St.left}px`,v.top=`${J.y-Xt+St.top}px`,rt.length>ia?(v.show=!0,v.text=rt):ct?(v.text=n.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},{id:p,afterUpdate(z){z.options.layout.padding.right=D.value?Y.value:0}},a,...t.annotations?[O]:[]],q=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),G=d.ref(0),V=d.ref(0),lt=new ResizeObserver(ol(z=>{G.value=z[0].contentRect.width,V.value=z[0].contentRect.height},100)),X=d.computed(()=>{var j,$;const z=($=(j=t.chartData)==null?void 0:j.labels)==null?void 0:$.length;return h.value&&z&&!D.value?`${Math.max(z*(cD+$m),G.value)}px`:oD}),Q=d.computed(()=>{var j,$;const z=($=(j=t.chartData)==null?void 0:j.labels)==null?void 0:$.length;return h.value&&z&&D.value?`${Math.max(z*(uD+$m),V.value)}px`:lD});pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&_e.register(Bm),o.value&&(G.value=o.value.offsetWidth,V.value=o.value.offsetHeight,lt.observe(o.value))}),d.onUnmounted(()=>{o.value&<.unobserve(o.value)});const H=d.computed(()=>{const z=pt.useBarChartOptions({tooltipState:M,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:D.value?"y":"x",numLabels:q});return{...z.value,plugins:{...z.value.plugins,annotation:{annotations:_(),clip:!1}},layout:{autoPadding:!1,padding:{right:0,top:6*Ym}}}}),U=pt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),B,H),Y=d.computed(()=>{y.value;const z=t.chartData.labels,j=t.chartData.datasets,$=z.map((nt,rt)=>j.reduce((it,_t)=>isNaN(Number(_t.data[rt]))?it:it+Number(_t.data[rt]),0)),J=U.value?Mf(U.value,t.chartData):WS(t.chartData);return $.map(nt=>kf(dl(nt,k.value)+Tf(nt,J))).reduce((nt,rt)=>Math.max(nt,rt),0)+Ym});d.onBeforeUnmount(()=>{_e.unregister(Bm)});const xt={[Nt.Right]:"legend-row",[Nt.Bottom]:"column"},yt=d.computed(()=>{if(f.value&&U.value){const z=window.devicePixelRatio,j=U.value,$=j.scales.y.width*z+mD,J=(j.scales.y.height+j.scales.y.top+j.scales.x.height)*z,et=f.value.getContext("2d");return et.scale(z,z),et.canvas.width=$,et.canvas.height=J,et.canvas.style.width=`${$/z}px`,et.canvas.style.height=`${J/z}px`,{scale:z,width:$*z,height:J*z,targetCtx:et}}return null}),vt=z=>{const j=z.target;if(yt.value&&U.value&&!D.value){const $=yt.value.scale,J=yt.value.targetCtx,et=yt.value.width,nt=yt.value.height,rt=U.value,it=rt.canvas;J.fillStyle="white",j.scrollLeft>=dD&&j.scrollLeft<=hD?(J.globalCompositeOperation="source-over",J.clearRect(0,0,et,nt),J.drawImage(it,0,0,et,nt,0,0,et,nt),J.globalCompositeOperation="destination-over",J.fillRect(0,0,et,nt)):(J.globalCompositeOperation="source-over",J.fillRect(0,(rt.scales.y.height+rt.scales.y.top+fD)*$,et,rt.scales.x.height*$))}M.offsetY=j.scrollTop,M.offsetX=j.scrollLeft,v.offset=j.scrollLeft},mt=({width:z,height:j})=>{M.width=z,M.height=j};d.watch(()=>t.orientation,()=>{var z;if(f.value&&yt.value){const j=yt.value.width,$=yt.value.height;((z=f.value)==null?void 0:z.getContext("2d")).clearRect(0,0,j,$)}M.showTooltip=!1,M.interactionMode="idle"}),d.watch(()=>t.annotations,z=>{U.value&&(z?U.value.options.plugins.annotation.annotations=_(t.chartData):delete U.value.options.plugins.annotation.annotations)});const gt=()=>{M.showTooltip&&(M.interactionMode!=="idle"?M.interactionMode="idle":M.interactionMode="interactive")};return(z,j)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",xt[d.unref(S)]])},[d.createElementVNode("canvas",{id:d.unref(r),ref:"axis",class:"axis"},null,8,rD),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:j[0]||(j[0]=$=>gt()),onScroll:vt},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:X.value,height:Q.value})},[d.createElementVNode("canvas",{id:d.unref(s),ref:"canvas",class:"chart-canvas"},null,8,sD)],4)],544),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[v.show?(d.openBlock(),d.createElementBlock("div",{key:0,class:"axis-tooltip",style:d.normalizeStyle({top:v.top,left:v.left}),width:"auto"},[d.createElementVNode("div",aD,d.toDisplayString(v.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(_a,{"absolute-left":d.unref(P),"absolute-top":d.unref(E),"chart-parent-ref":c.value,state:M,"tooltip-title":e.tooltipTitle,onDimensions:mt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Wl,{id:d.unref(m),"chart-instance":d.unref(U),items:x.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-acf2a980"]]);/*!
|
|
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 pD={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"};ju._date.override({_id:"date-fns",formats:function(){return pD},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=ut(e):n==="string"&&(typeof t=="string"?e=Ww(e,t,new Date,this.options):e=Ch(e,this.options)),Bo(e)?e.getTime():null},format:function(e,t){return qs(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return No(e,t);case"second":return F_(e,t);case"minute":return L_(e,t);case"hour":return R_(e,t);case"day":return js(e,t);case"week":return B_(e,t);case"month":return Lo(e,t);case"quarter":return N_(e,t);case"year":return z_(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return zo(e,t);case"second":return q_(e,t);case"minute":return $_(e,t);case"hour":return Y_(e,t);case"day":return oh(e,t);case"week":return X_(e,t);case"month":return dh(e,t);case"quarter":return U_(e,t);case"year":return G_(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return Uw(e);case"minute":return jw(e);case"hour":return $w(e);case"day":return Fo(e);case"week":return Ue(e);case"isoWeek":return Ue(e,{weekStartsOn:+n});case"month":return Z_(e);case"quarter":return K_(e);case"year":return hh(e);default:return e}},endOf:function(e,t){switch(t){case"second":return ix(e);case"minute":return ex(e);case"hour":return J_(e);case"day":return ch(e);case"week":return tx(e);case"month":return uh(e);case"quarter":return nx(e);case"year":return Q_(e);default:return e}}});const jm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},yD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...jm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},bD=d.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Fi(e){return d.isProxy(e)?d.toRaw(e):e}function _D(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return d.isProxy(t)?new Proxy(e,{}):e}function xD(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Um(e,t){e.labels=t}function qm(e,t,n){const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(a=>a[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function wD(e,t){const n={labels:[],datasets:[]};return Um(n,e.labels),qm(n,e.datasets,t),n}const vD=d.defineComponent({props:yD,setup(e,t){let{expose:n,slots:i}=t;const r=d.ref(null),s=d.shallowRef(null);n({chart:s});const a=()=>{if(!r.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=e,g=wD(u,m),p=_D(g,u);s.value=new _e(r.value,{type:c,data:p,options:{...h},plugins:f})},o=()=>{const c=d.toRaw(s.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),s.value=null},e.destroyDelay):(c.destroy(),s.value=null))},l=c=>{c.update(e.updateMode)};return d.onMounted(a),d.onUnmounted(o),d.watch([()=>e.options,()=>e.data],(c,u)=>{let[h,f]=c,[m,g]=u;const p=d.toRaw(s.value);if(!p)return;let x=!1;if(h){const S=Fi(h),v=Fi(m);S&&S!==v&&(xD(p,S),x=!0)}if(f){const S=Fi(f.labels),v=Fi(g.labels),k=Fi(f.datasets),D=Fi(g.datasets);S!==v&&(Um(p.config.data,S),x=!0),k&&k!==D&&(qm(p.config.data,k,e.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(p)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:e.ariaLabel,ariaDescribedby:e.ariaDescribedby,ref:r},[d.h("p",{},[i.default?i.default():""])])}});function $l(e,t){return _e.register(t),d.defineComponent({props:jm,setup(n,i){let{expose:r}=i;const s=d.shallowRef(null),a=o=>{s.value=o==null?void 0:o.chart};return r({chart:s}),()=>d.h(vD,bD({ref:a},{type:e,...n}))}})}const Xm=$l("bar",dr),Gm=$l("doughnut",an),Km=$l("line",hr),SD={class:"chart-container"},kD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>un},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{translateUnit:n}=pt.useTranslatedUnits(),i=crypto.randomUUID(),r=crypto.randomUUID(),s=d.ref([]),a=d.useTemplateRef("chartParent"),o=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:r,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=pt.useTooltipAbsolutePosition(a,o),u={id:i,afterUpdate(v){s.value=v.options.plugins.legend.labels.generateLabels(v).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((k,D)=>(k.labels.push(D.label),k.backgroundColor.push(D.backgroundColor),k.borderColor.push(xf(D.backgroundColor,50)),k.data.push(D.data.reduce((M,P)=>M+P,0)),k),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=pt.useDonutChartOptions({tooltipState:o,legendID:i}),p=d.ref(),x=v=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[v],S=({width:v,height:k})=>{o.width=v,o.height=k};return(v,k)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(e.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",SD,[d.createVNode(d.unref(Gm),{ref_key:"chartInstance",ref:p,"chart-id":d.unref(r),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(_a,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:o,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:S},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Wl,{id:d.unref(i),"chart-instance":p.value,items:s.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),MD=Ee(kD,[["__scopeId","data-v-f3942f91"]]),jl=(e,t,n,i,r="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore()},ge={},TD=()=>{ge.x=void 0,ge.chart=void 0,ge.strategy=void 0,ge.group=void 0},DD=10;class Zm{constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){R(this,"id","verticalLinePlugin");R(this,"_clickedSegment");R(this,"_pause",!1);R(this,"_useBrushingState",!1);R(this,"_brushStrategy");R(this,"_brushGroup");R(this,"_lastMouseBrushEvent",0);let r=!1;n==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<DD)return;const r=()=>{ge.chart=n,ge.strategy=this._brushStrategy,ge.group=this._brushGroup;for(const s of Object.values(_e.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(ge.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(ge.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;jl(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:r}=t.tooltip.dataPoints[0].element;jl(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(ge.x===void 0)return;const n=ge.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&ge.group===this._brushGroup&&jl(t.ctx,ge.x,t.scales.y.top,t.scales.y.bottom,n)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&ge.chart===t){const n=ge.x!==void 0;if(TD(),n)for(const i of Object.values(_e.instances))i!==t&&i.update("none")}}}const CD=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},ED=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},Qm=(e,t,n)=>{const i=t.scales.x.getValueForPixel(n.startX),r=t.scales.x.getValueForPixel(n.endX);i&&r&&t.canvas.dispatchEvent(new CustomEvent(e,{detail:{xStart:Math.min(i,r),xEnd:Math.max(i,r)}}))};class OD{constructor(){R(this,"id","dragSelectPlugin");R(this,"_isDragging",!1);R(this,"_startX",0);R(this,"_endX",0);R(this,"_dragTimeout");R(this,"_clearSelectionArea",!0);R(this,"_chart",null);R(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const r=o=>{this._dragTimeout=window.setTimeout(()=>{const l=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-l.left},150)},s=o=>{const l=n.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-l.left,Qm("dragSelectMove",t,this))},a=o=>{const l=n.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-l.left,Qm("dragSelect",t,this),i=!1,this._isDragging=!1)};n.addEventListener("mousedown",r),n.addEventListener("mousemove",s),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",r),n.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(ED(t,this._startX,this._endX),CD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const PD=["hidden","single","full"];var li=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(li||{});const RD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],AD=["gauge","top_n","single_value"],ID=20,LD="rgba(255, 171, 171, 0.4)",ND="rgba(255, 196, 0, 0.2)",Jm=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const r=(n-e.y)/i;return e.x+r*(t.x-e.x)},FD=(e,t)=>{const n=[];return e.data.datasets.forEach(i=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(i)).visible)return;const s=i.data;s!=null&&s.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const o=s.map(c=>({ts:c.x,aboveThreshold:c.y>=a.value}));let l=o[0].aboveThreshold?s[0].x:void 0;for(let c=1;c<o.length;c++)!o[c-1].aboveThreshold&&o[c].aboveThreshold?l=Jm(s[c-1],s[c],a.value):o[c-1].aboveThreshold&&!o[c].aboveThreshold&&l!==void 0&&(n.push({start:l,end:Jm(s[c-1],s[c],a.value),type:a.type}),l=void 0);l!==void 0&&n.push({start:l,end:o[o.length-1].ts,type:a.type})})}),n},BD=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:r})=>r===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class zD{constructor(t){R(this,"id","thresholdPlugin");R(this,"_thresholds");R(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var n,i;for(const r of Object.keys(t.threshold||{})){const s=(n=t.threshold)==null?void 0:n[r];s&&(this._thresholds={...this._thresholds,[r]:s.map(a=>({...a,hovered:!1}))})}if(this._thresholds)for(const r of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[r]||delete this._thresholds[r]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{var o;if(t){const l=a.clientY,c=t.scales.y,u=r.getBoundingClientRect(),h=c.getValueForPixel(l-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(o=this._thresholds)==null?void 0:o[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<ID})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,n){var r;const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const a=(r=this._thresholds)==null?void 0:r[s];if(a){a.forEach(c=>{const h=t.scales.y.getPixelForValue(c.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=sa(c.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";c.label?f=`${c.label}: ${c.value}`:c.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:c.value}):c.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:c.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:c.value}),c.hovered&&(i.save(),i.fillStyle=sa(c.type),i.font=ES,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=FD(t,a);BD(o).forEach(c=>{const u=t.scales.x.getPixelForValue(c.start),h=t.scales.x.getPixelForValue(c.end);i.save(),i.fillStyle=c.type==="error"?LD:ND,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=sa(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const HD=Ee(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:r}=pt.useI18n(),s=new Zm,a=new Wm,o=new OD,l=new zD(r),{translateUnit:c}=pt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),p=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),S=d.ref(void 0),v=d.ref(!1),k=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:n.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:n.metricUnit,translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:D,tooltipAbsoluteTop:M}=pt.useTooltipAbsolutePosition(x,k),P={id:h,afterUpdate(H){m.value=ff(H,n.legendValues,n.chartLegendSortFn)}},E=d.computed(()=>[P,a,...n.brush?[o]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[l]:[]]),y=d.computed(()=>`line-${E.value.map(H=>H.id).join("-")}`),_=d.computed(()=>`bar-${E.value.map(H=>H.id).join("-")}`),T=d.computed(()=>n.chartData&&_S(n.chartData)),{options:O}=pt.useLineChartOptions({tooltipState:k,timeRangeMs:d.toRef(n,"timeRangeMs"),granularity:d.toRef(n,"granularity"),legendID:h,stacked:d.toRef(n,"stacked"),metricAxesTitle:d.toRef(n,"metricAxesTitle"),dimensionAxesTitle:d.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:T,threshold:d.toRef(n,"threshold")});pt.useReportChartDataForSynthetics(d.toRef(n,"chartData"),d.toRef(n,"syntheticsDataKey"));const A=H=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[H],I=({width:H,height:U})=>{k.width=H,k.height=U},B=(H=!0)=>{k.interactionMode="idle",k.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},q=()=>{k.interactionMode="interactive"},G=()=>{var H,U;!u.value||!((U=(H=u.value.chart.tooltip)==null?void 0:H.dataPoints)!=null&&U.length)||(k.interactionMode==="interactive"?s.clickedSegment=u.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},V=()=>{if(v.value){v.value=!1;return}k.interactionMode!=="idle"?B():q(),G()};d.watch(()=>n.type,()=>{k.interactionMode="idle",k.showTooltip=!1,s.destroyClickedSegment()});const lt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(S.value={start:new Date(U),end:new Date(Y),type:"absolute"},k.interactionMode="zoom-interactive",i("select-chart-range",S.value))},X=H=>{k.interactionMode="selecting-chart-area",v.value=!0,s.pause(),a.pause();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(S.value={start:new Date(U),end:new Date(Y),type:"absolute"})},Q=H=>{if(!x.value||k.interactionMode==="idle")return;const U=H.target;U&&x.value.contains(U)||v.value||B(!1)};return d.watch(()=>{var H;return(H=u.value)==null?void 0:H.chart},()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",X),u.value.chart.canvas.addEventListener("dragSelect",lt),u.value.chart.canvas.addEventListener("dragSelectMove",X))}),d.onMounted(()=>{document.addEventListener("click",Q,!0)}),d.onUnmounted(()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",X)),document.removeEventListener("click",Q,!0)}),(H,U)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",A(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:U[0]||(U[0]=Y=>V())},[e.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Km),{key:y.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:d.unref(O),plugins:E.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Xm),{key:_.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:d.unref(O),plugins:E.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(_a,{ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(D),"absolute-top":d.unref(M),"data-testid":"tooltip",granularity:e.granularity,state:k,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:I,onOnAction:U[1]||(U[1]=()=>B(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(Wl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-45406bb2"]]),VD={class:"analytics-chart-shell"},WD={key:0,class:"chart-header","data-testid":"truncation-warning"},YD={class:"tooltip-content"},$D={key:2,class:"analytics-chart-parent"},jD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=t,i=e,{i18n:r}=pt.useI18n(),s=d.computed(()=>p.value?pt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||aa},d.toRef(i,"chartData")).value:pt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||aa},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=d.computed(()=>{var I;return(I=i.chartData)!=null&&I.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),l=d.computed(()=>{var I;return(I=i.chartData.meta)!=null&&I.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),c=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=pt.useChartLegendValues(s,i.chartOptions.type,l),h=d.computed(()=>{var I,B,q;return((q=(B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.limit)==null?void 0:q.toString())||null}),f=d.computed(()=>{var I,B;return i.chartOptions.hideTruncationWarning?!1:((B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.truncated)||!1}),m=r.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),S=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),v=d.computed(()=>{var q,G;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})})}if(I)return r.te(`chartLabels.${I}`)?r.t(`chartLabels.${I}`):I}),k=d.computed(()=>{var q,G,V,lt;if((q=i.chartOptions)!=null&&q.metricAxesTitle)return(G=i.chartOptions)==null?void 0:G.metricAxesTitle;if(!((V=i.chartData)!=null&&V.meta.metric_names)||!((lt=i.chartData)!=null&<.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})})}return r.te(`metricAxisTitles.${I}`)&&r.te(`chartUnits.${B}`)?r.t(`metricAxisTitles.${I}`,{unit:r.t(`chartUnits.${B}`,{plural:"s"})})||void 0:I||void 0}),D=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return r.te(`chartLabels.${I}`)?r.t(`chartLabels.${I}`):I}),M=d.computed(()=>{const I=il(Number(i.chartData.meta.granularity_ms));if(I)return r.te(`granularityAxisTitles.${I}`)?r.t(`granularityAxisTitles.${I}`):I}),P=d.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),E=d.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),y=d.computed(()=>p.value?xS(s.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?il(i.chartData.meta.granularity_ms)||"hourly":il(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),T=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,B)=>I.text===r.t("chartLabels.____OTHER____")?1:B.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.text,10))&&!isNaN(parseInt(B.text,10))?I.text<B.text?-1:1:I.value&&B.value?B.value.raw-I.value.raw:0),O=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,B)=>I.label===r.t("chartLabels.____OTHER____")?1:B.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.label,10))&&!isNaN(parseInt(B.label,10))?I.label<B.label?-1:1:I.value&&B.value?B.rawValue-I.rawValue:0),A=d.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>n("zoom-time-range",I)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",c),d.provide("legendPosition",d.toRef(i,"legendPosition")),(I,B)=>{const q=d.resolveComponent("KTooltip"),G=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",VD,[y.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",WD,[d.createVNode(q,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",YD,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(ne.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(TS)})`,size:d.unref(CS)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),y.value?(d.openBlock(),d.createElementBlock("div",$D,[p.value?(d.openBlock(),d.createBlock(HD,{key:0,brush:a.value,"chart-data":s.value,"chart-legend-sort-fn":T.value,"chart-tooltip-sort-fn":O.value,"dimension-axes-title":M.value,fill:e.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":l.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:e.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":v.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":A.value,onSelectChartRange:B[0]||(B[0]=V=>n("select-chart-range",V)),onZoomTimeRange:B[1]||(B[1]=V=>n("zoom-time-range",V))},null,8,["brush","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","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(gD,{key:1,annotations:e.showAnnotations,"chart-data":s.value,"chart-legend-sort-fn":T.value,"chart-tooltip-sort-fn":O.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":l.value,orientation:S.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":v.value,"tooltip-title":e.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-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(MD,{key:2,"chart-data":s.value,"dataset-colors":e.chartOptions.chartDatasetColors||d.unref(aa),"legend-position":e.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":D.value,"tooltip-metric-display":v.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(G,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(E.value),1)]),_:1}))])}}}),UD=Ee(jD,[["__scopeId","data-v-8b37cc76"]]),qD={class:"chart-parent","data-testid":"gauge-chart-parent"},XD={class:"chart-totals-flex"},GD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},KD=Ee(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:un},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.ref(xa()),r=d.computed(()=>[t.chartData.datasets.reduce((g,p)=>(g.labels.push(p.label),g.borderColor.push(p.backgroundColor),g.backgroundColor.push(p.backgroundColor),g.data.push(p.data.reduce((x,S)=>x+S,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=d.computed(()=>({...t.chartData,datasets:r.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=d.ref(),l=d.computed(()=>{var m;return Yr((m=r==null?void 0:r.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),c=d.computed(()=>{var m,g;return Yr(((m=r==null?void 0:r.value[0])==null?void 0:m.data[0])+((g=r==null?void 0:r.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=r==null?void 0:r.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",qD,[d.createElementVNode("div",XD,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(l.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",GD,d.toDisplayString(d.unref(n).t("total"))+": "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:e.height,width:e.width})},[d.createVNode(d.unref(Gm),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]);/*!
|
|
28
|
+
*/const pD={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"};ju._date.override({_id:"date-fns",formats:function(){return pD},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=ut(e):n==="string"&&(typeof t=="string"?e=Ww(e,t,new Date,this.options):e=Ch(e,this.options)),Bo(e)?e.getTime():null},format:function(e,t){return qs(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return No(e,t);case"second":return F_(e,t);case"minute":return L_(e,t);case"hour":return R_(e,t);case"day":return js(e,t);case"week":return B_(e,t);case"month":return Lo(e,t);case"quarter":return N_(e,t);case"year":return z_(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return zo(e,t);case"second":return q_(e,t);case"minute":return $_(e,t);case"hour":return Y_(e,t);case"day":return oh(e,t);case"week":return X_(e,t);case"month":return dh(e,t);case"quarter":return U_(e,t);case"year":return G_(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return Uw(e);case"minute":return jw(e);case"hour":return $w(e);case"day":return Fo(e);case"week":return Ue(e);case"isoWeek":return Ue(e,{weekStartsOn:+n});case"month":return Z_(e);case"quarter":return K_(e);case"year":return hh(e);default:return e}},endOf:function(e,t){switch(t){case"second":return ix(e);case"minute":return ex(e);case"hour":return J_(e);case"day":return ch(e);case"week":return tx(e);case"month":return uh(e);case"quarter":return nx(e);case"year":return Q_(e);default:return e}}});const jm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},yD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...jm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},bD=d.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Fi(e){return d.isProxy(e)?d.toRaw(e):e}function _D(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return d.isProxy(t)?new Proxy(e,{}):e}function xD(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Um(e,t){e.labels=t}function qm(e,t,n){const i=[];e.datasets=t.map(r=>{const s=e.datasets.find(a=>a[n]===r[n]);return!s||!r.data||i.includes(s)?{...r}:(i.push(s),Object.assign(s,r),s)})}function wD(e,t){const n={labels:[],datasets:[]};return Um(n,e.labels),qm(n,e.datasets,t),n}const vD=d.defineComponent({props:yD,setup(e,t){let{expose:n,slots:i}=t;const r=d.ref(null),s=d.shallowRef(null);n({chart:s});const a=()=>{if(!r.value)return;const{type:l,data:u,options:h,plugins:f,datasetIdKey:m}=e,g=wD(u,m),p=_D(g,u);s.value=new _e(r.value,{type:l,data:p,options:{...h},plugins:f})},o=()=>{const l=d.toRaw(s.value);l&&(e.destroyDelay>0?setTimeout(()=>{l.destroy(),s.value=null},e.destroyDelay):(l.destroy(),s.value=null))},c=l=>{l.update(e.updateMode)};return d.onMounted(a),d.onUnmounted(o),d.watch([()=>e.options,()=>e.data],(l,u)=>{let[h,f]=l,[m,g]=u;const p=d.toRaw(s.value);if(!p)return;let x=!1;if(h){const S=Fi(h),v=Fi(m);S&&S!==v&&(xD(p,S),x=!0)}if(f){const S=Fi(f.labels),v=Fi(g.labels),k=Fi(f.datasets),D=Fi(g.datasets);S!==v&&(Um(p.config.data,S),x=!0),k&&k!==D&&(qm(p.config.data,k,e.datasetIdKey),x=!0)}x&&d.nextTick(()=>{c(p)})},{deep:!0}),()=>d.h("canvas",{role:"img",ariaLabel:e.ariaLabel,ariaDescribedby:e.ariaDescribedby,ref:r},[d.h("p",{},[i.default?i.default():""])])}});function $l(e,t){return _e.register(t),d.defineComponent({props:jm,setup(n,i){let{expose:r}=i;const s=d.shallowRef(null),a=o=>{s.value=o==null?void 0:o.chart};return r({chart:s}),()=>d.h(vD,bD({ref:a},{type:e,...n}))}})}const Xm=$l("bar",dr),Gm=$l("doughnut",an),Km=$l("line",hr),SD={class:"chart-container"},kD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:Nt.Right},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>un},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{translateUnit:n}=pt.useTranslatedUnits(),i=crypto.randomUUID(),r=crypto.randomUUID(),s=d.ref([]),a=d.useTemplateRef("chartParent"),o=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:t.tooltipMetricDisplay,dimensionDisplay:t.tooltipDimensionDisplay,tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:r,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:c,tooltipAbsoluteTop:l}=pt.useTooltipAbsolutePosition(a,o),u={id:i,afterUpdate(v){s.value=v.options.plugins.legend.labels.generateLabels(v).map(k=>({...k,value:t.legendValues&&t.legendValues[k.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((k,D)=>(k.labels.push(D.label),k.backgroundColor.push(D.backgroundColor),k.borderColor.push(xf(D.backgroundColor,50)),k.data.push(D.data.reduce((M,P)=>M+P,0)),k),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:g}=pt.useDonutChartOptions({tooltipState:o,legendID:i}),p=d.ref(),x=v=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[v],S=({width:v,height:k})=>{o.width=v,o.height=k};return(v,k)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(e.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",SD,[d.createVNode(d.unref(Gm),{ref_key:"chartInstance",ref:p,"chart-id":d.unref(r),data:m.value,options:d.unref(g),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(_a,{"absolute-left":d.unref(c),"absolute-top":d.unref(l),state:o,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:S},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Wl,{id:d.unref(i),"chart-instance":p.value,items:s.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),MD=Ee(kD,[["__scopeId","data-v-f3942f91"]]),jl=(e,t,n,i,r="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=r,e.stroke(),e.restore()},ge={},TD=()=>{ge.x=void 0,ge.chart=void 0,ge.strategy=void 0,ge.group=void 0},DD=10;class Zm{constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){R(this,"id","verticalLinePlugin");R(this,"_clickedSegment");R(this,"_pause",!1);R(this,"_useBrushingState",!1);R(this,"_brushStrategy");R(this,"_brushGroup");R(this,"_lastMouseBrushEvent",0);let r=!1;n==="group"&&(r=t!==void 0),this._useBrushingState=i&&r,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(r=>this.onMouseBrush(i.type,t,r))}onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<DD)return;const r=()=>{ge.chart=n,ge.strategy=this._brushStrategy,ge.group=this._brushGroup;for(const s of Object.values(_e.instances))s!==n&&s.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(ge.x=n.tooltip.dataPoints[0].element.x,r()):t==="mouseout"&&(ge.x=void 0,r()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:r}=this._clickedSegment.element;jl(i,r,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:r}=t.tooltip.dataPoints[0].element;jl(i,r,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(ge.x===void 0)return;const n=ge.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&ge.group===this._brushGroup&&jl(t.ctx,ge.x,t.scales.y.top,t.scales.y.bottom,n)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&ge.chart===t){const n=ge.x!==void 0;if(TD(),n)for(const i of Object.values(_e.instances))i!==t&&i.update("none")}}}const CD=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},ED=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},Qm=(e,t,n)=>{const i=t.scales.x.getValueForPixel(n.startX),r=t.scales.x.getValueForPixel(n.endX);i&&r&&t.canvas.dispatchEvent(new CustomEvent(e,{detail:{xStart:Math.min(i,r),xEnd:Math.max(i,r)}}))};class OD{constructor(){R(this,"id","dragSelectPlugin");R(this,"_isDragging",!1);R(this,"_startX",0);R(this,"_endX",0);R(this,"_dragTimeout");R(this,"_clearSelectionArea",!0);R(this,"_chart",null);R(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const r=o=>{this._dragTimeout=window.setTimeout(()=>{const c=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-c.left},150)},s=o=>{const c=n.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-c.left,Qm("dragSelectMove",t,this))},a=o=>{const c=n.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-c.left,Qm("dragSelect",t,this),i=!1,this._isDragging=!1)};n.addEventListener("mousedown",r),n.addEventListener("mousemove",s),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:r,onMouseMove:s,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:r,onMouseUp:s}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",r),n.removeEventListener("mouseup",s)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(ED(t,this._startX,this._endX),CD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const PD=["hidden","single","full"];var li=(e=>(e.String="string",e.Number="number",e.Boolean="boolean",e.Object="object",e.Undefined="undefined",e))(li||{});const RD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],AD=["gauge","top_n","single_value"],ID=20,LD="rgba(255, 171, 171, 0.4)",ND="rgba(255, 196, 0, 0.2)",Jm=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const r=(n-e.y)/i;return e.x+r*(t.x-e.x)},FD=(e,t)=>{const n=[];return e.data.datasets.forEach(i=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(i)).visible)return;const s=i.data;s!=null&&s.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const o=s.map(l=>({ts:l.x,aboveThreshold:l.y>=a.value}));let c=o[0].aboveThreshold?s[0].x:void 0;for(let l=1;l<o.length;l++)!o[l-1].aboveThreshold&&o[l].aboveThreshold?c=Jm(s[l-1],s[l],a.value):o[l-1].aboveThreshold&&!o[l].aboveThreshold&&c!==void 0&&(n.push({start:c,end:Jm(s[l-1],s[l],a.value),type:a.type}),c=void 0);c!==void 0&&n.push({start:c,end:o[o.length-1].ts,type:a.type})})}),n},BD=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:r})=>r===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class zD{constructor(t){R(this,"id","thresholdPlugin");R(this,"_thresholds");R(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var n,i;for(const r of Object.keys(t.threshold||{})){const s=(n=t.threshold)==null?void 0:n[r];s&&(this._thresholds={...this._thresholds,[r]:s.map(a=>({...a,hovered:!1}))})}if(this._thresholds)for(const r of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[r]||delete this._thresholds[r]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const r=t.canvas;this._syncThresholds(i);const s=a=>{var o;if(t){const c=a.clientY,l=t.scales.y,u=r.getBoundingClientRect(),h=l.getValueForPixel(c-u.top);if(h)for(const f of Object.keys(this._thresholds||{})){const m=(o=this._thresholds)==null?void 0:o[f];m&&m.forEach(g=>{g.hovered=Math.abs(g.value-h)<ID})}}};r.addEventListener("mousemove",s),this._mouseMoveHandler=s}afterDatasetsDraw(t,n){var r;const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const a=(r=this._thresholds)==null?void 0:r[s];if(a){a.forEach(l=>{const h=t.scales.y.getPixelForValue(l.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=sa(l.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";l.label?f=`${l.label}: ${l.value}`:l.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:l.value}):l.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:l.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:l.value}),l.hovered&&(i.save(),i.fillStyle=sa(l.type),i.font=ES,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=FD(t,a);BD(o).forEach(l=>{const u=t.scales.x.getPixelForValue(l.start),h=t.scales.x.getPixelForValue(l.end);i.save(),i.fillStyle=l.type==="error"?LD:ND,i.fillRect(u,t.chartArea.top,h-u,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(u,t.chartArea.bottom),i.lineTo(h,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=sa(l.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const HD=Ee(d.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:r}=pt.useI18n(),s=new Zm,a=new Wm,o=new OD,c=new zD(r),{translateUnit:l}=pt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),g=d.ref(),p=d.inject("legendPosition",Nt.Right),x=d.useTemplateRef("chartParent"),S=d.ref(void 0),v=d.ref(!1),k=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:n.tooltipMetricDisplay,tooltipSeries:[],left:"",top:"",units:n.metricUnit,translateUnit:l,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:D,tooltipAbsoluteTop:M}=pt.useTooltipAbsolutePosition(x,k),P={id:h,afterUpdate(H){m.value=ff(H,n.legendValues,n.chartLegendSortFn)}},E=d.computed(()=>[P,a,...n.brush?[o]:[],...n.type==="timeseries_line"?[s]:[],...n.threshold?[c]:[]]),y=d.computed(()=>`line-${E.value.map(H=>H.id).join("-")}`),_=d.computed(()=>`bar-${E.value.map(H=>H.id).join("-")}`),T=d.computed(()=>n.chartData&&_S(n.chartData)),{options:O}=pt.useLineChartOptions({tooltipState:k,timeRangeMs:d.toRef(n,"timeRangeMs"),granularity:d.toRef(n,"granularity"),legendID:h,stacked:d.toRef(n,"stacked"),metricAxesTitle:d.toRef(n,"metricAxesTitle"),dimensionAxesTitle:d.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:T,threshold:d.toRef(n,"threshold")});pt.useReportChartDataForSynthetics(d.toRef(n,"chartData"),d.toRef(n,"syntheticsDataKey"));const A=H=>({[Nt.Right]:"legend-row",[Nt.Bottom]:"column",[Nt.Hidden]:"hidden"})[H],I=({width:H,height:U})=>{k.width=H,k.height=U},B=(H=!0)=>{k.interactionMode="idle",k.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(H),s.isPaused&&s.resume()},q=()=>{k.interactionMode="interactive"},G=()=>{var H,U;!u.value||!((U=(H=u.value.chart.tooltip)==null?void 0:H.dataPoints)!=null&&U.length)||(k.interactionMode==="interactive"?s.clickedSegment=u.value.chart.tooltip.dataPoints[0]:s.destroyClickedSegment())},V=()=>{if(v.value){v.value=!1;return}k.interactionMode!=="idle"?B():q(),G()};d.watch(()=>n.type,()=>{k.interactionMode="idle",k.showTooltip=!1,s.destroyClickedSegment()});const lt=H=>{H.preventDefault(),H.stopPropagation();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(S.value={start:new Date(U),end:new Date(Y),type:"absolute"},k.interactionMode="zoom-interactive",i("select-chart-range",S.value))},X=H=>{k.interactionMode="selecting-chart-area",v.value=!0,s.pause(),a.pause();const{xStart:U,xEnd:Y}=H.detail;U&&Y&&(S.value={start:new Date(U),end:new Date(Y),type:"absolute"})},Q=H=>{if(!x.value||k.interactionMode==="idle")return;const U=H.target;U&&x.value.contains(U)||v.value||B(!1)};return d.watch(()=>{var H;return(H=u.value)==null?void 0:H.chart},()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",X),u.value.chart.canvas.addEventListener("dragSelect",lt),u.value.chart.canvas.addEventListener("dragSelectMove",X))}),d.onMounted(()=>{document.addEventListener("click",Q,!0)}),d.onUnmounted(()=>{var H;(H=u.value)!=null&&H.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",lt),u.value.chart.canvas.removeEventListener("dragSelectMove",X)),document.removeEventListener("click",Q,!0)}),(H,U)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",A(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:U[0]||(U[0]=Y=>V())},[e.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Km),{key:y.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:d.unref(O),plugins:E.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Xm),{key:_.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:d.unref(O),plugins:E.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(_a,{ref_key:"tooltipElement",ref:g,"absolute-left":d.unref(D),"absolute-top":d.unref(M),"data-testid":"tooltip",granularity:e.granularity,state:k,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":S.value,onDimensions:I,onOnAction:U[1]||(U[1]=()=>B(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(Wl,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-45406bb2"]]),VD={class:"analytics-chart-shell"},WD={key:0,class:"chart-header","data-testid":"truncation-warning"},YD={class:"tooltip-content"},$D={key:2,class:"analytics-chart-parent"},jD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Nt.Right},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!0},showAnnotations:{type:Boolean,default:!0},timeseriesZoom:{type:Boolean,default:!1},requestsLink:{default:void 0},exploreLink:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=t,i=e,{i18n:r}=pt.useI18n(),s=d.computed(()=>p.value?pt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||aa},d.toRef(i,"chartData")).value:pt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||aa},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=d.computed(()=>{var I;return(I=i.chartData)!=null&&I.meta?"start_ms"in i.chartData.meta?i.chartData.meta.end_ms-i.chartData.meta.start_ms:void 0:0}),c=d.computed(()=>{var I;return(I=i.chartData.meta)!=null&&I.metric_units?Object.values(i.chartData.meta.metric_units)[0]:""}),l=d.computed(()=>i.showLegendValues&&i.legendPosition!==Nt.Bottom),{legendValues:u}=pt.useChartLegendValues(s,i.chartOptions.type,c),h=d.computed(()=>{var I,B,q;return((q=(B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.limit)==null?void 0:q.toString())||null}),f=d.computed(()=>{var I,B;return i.chartOptions.hideTruncationWarning?!1:((B=(I=i.chartData)==null?void 0:I.meta)==null?void 0:B.truncated)||!1}),m=r.t("limitedResultsShown",{maxReturned:h.value}),g=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),p=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),S=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),v=d.computed(()=>{var q,G;if(!((q=i.chartData)!=null&&q.meta.metric_names)||!((G=i.chartData)!=null&&G.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})})}if(I)return r.te(`chartLabels.${I}`)?r.t(`chartLabels.${I}`):I}),k=d.computed(()=>{var q,G,V,lt;if((q=i.chartOptions)!=null&&q.metricAxesTitle)return(G=i.chartOptions)==null?void 0:G.metricAxesTitle;if(!((V=i.chartData)!=null&&V.meta.metric_names)||!((lt=i.chartData)!=null&<.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],B=i.chartData.meta.metric_units[I];if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return r.t("metricAxisTitles.latency_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})});if(I.includes("size"))return r.t("metricAxisTitles.size_in",{unit:r.t(`chartUnits.${B}`,{plural:"s"})})}return r.te(`metricAxisTitles.${I}`)&&r.te(`chartUnits.${B}`)?r.t(`metricAxisTitles.${I}`,{unit:r.t(`chartUnits.${B}`,{plural:"s"})})||void 0:I||void 0}),D=d.computed(()=>{var B;if((B=i.chartOptions)!=null&&B.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=p.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return r.te(`chartLabels.${I}`)?r.t(`chartLabels.${I}`):I}),M=d.computed(()=>{const I=il(Number(i.chartData.meta.granularity_ms));if(I)return r.te(`granularityAxisTitles.${I}`)?r.t(`granularityAxisTitles.${I}`):I}),P=d.computed(()=>i.emptyStateTitle||r.t("noDataAvailableTitle")),E=d.computed(()=>i.emptyStateDescription||r.t("noDataAvailableDescription")),y=d.computed(()=>p.value?xS(s.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?il(i.chartData.meta.granularity_ms)||"hourly":il(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),T=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,B)=>I.text===r.t("chartLabels.____OTHER____")?1:B.text===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.text,10))&&!isNaN(parseInt(B.text,10))?I.text<B.text?-1:1:I.value&&B.value?B.value.raw-I.value.raw:0),O=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,B)=>I.label===r.t("chartLabels.____OTHER____")?1:B.label===r.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.label,10))&&!isNaN(parseInt(B.label,10))?I.label<B.label?-1:1:I.value&&B.value?B.rawValue-I.rawValue:0),A=d.computed(()=>[...i.timeseriesZoom?[{label:r.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>n("zoom-time-range",I)}]:[],...i.exploreLink?[{label:r.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:r.t("zoom_action_items.view_requests"),key:"view-requests",href:i.requestsLink.href}]:[]]);return d.provide("showLegendValues",l),d.provide("legendPosition",d.toRef(i,"legendPosition")),(I,B)=>{const q=d.resolveComponent("KTooltip"),G=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",VD,[y.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",WD,[d.createVNode(q,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",YD,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(ne.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(TS)})`,size:d.unref(CS)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),y.value?(d.openBlock(),d.createElementBlock("div",$D,[p.value?(d.openBlock(),d.createBlock(HD,{key:0,brush:a.value,"chart-data":s.value,"chart-legend-sort-fn":T.value,"chart-tooltip-sort-fn":O.value,"dimension-axes-title":M.value,fill:e.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":c.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:e.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":v.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":A.value,onSelectChartRange:B[0]||(B[0]=V=>n("select-chart-range",V)),onZoomTimeRange:B[1]||(B[1]=V=>n("zoom-time-range",V))},null,8,["brush","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","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):g.value?(d.openBlock(),d.createBlock(gD,{key:1,annotations:e.showAnnotations,"chart-data":s.value,"chart-legend-sort-fn":T.value,"chart-tooltip-sort-fn":O.value,"data-testid":"bar-chart-container","dimension-axes-title":D.value,"legend-values":d.unref(u),"metric-axes-title":k.value,"metric-unit":c.value,orientation:S.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":v.value,"tooltip-title":e.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-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(MD,{key:2,"chart-data":s.value,"dataset-colors":e.chartOptions.chartDatasetColors||d.unref(aa),"legend-position":e.legendPosition,"legend-values":d.unref(u),"metric-unit":c.value,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":D.value,"tooltip-metric-display":v.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(G,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(P.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(E.value),1)]),_:1}))])}}}),UD=Ee(jD,[["__scopeId","data-v-8b37cc76"]]),qD={class:"chart-parent","data-testid":"gauge-chart-parent"},XD={class:"chart-totals-flex"},GD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},KD=Ee(d.defineComponent({__name:"GaugeChart",props:{chartData:{type:Object,required:!1,default:null},metricDisplay:{type:String,required:!1,default:"hidden"},numerator:{type:Number,required:!1,default:0},syntheticsDataKey:{type:String,required:!1,default:""},datasetColors:{type:Object,required:!1,default:un},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.ref(xa()),r=d.computed(()=>[t.chartData.datasets.reduce((g,p)=>(g.labels.push(p.label),g.borderColor.push(p.backgroundColor),g.backgroundColor.push(p.backgroundColor),g.data.push(p.data.reduce((x,S)=>x+S,0)),g),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),s=d.computed(()=>({...t.chartData,datasets:r.value}));pt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},o=d.ref(),c=d.computed(()=>{var m;return Yr((m=r==null?void 0:r.value[0])==null?void 0:m.data[t.numerator],{capital:!0})}),l=d.computed(()=>{var m,g;return Yr(((m=r==null?void 0:r.value[0])==null?void 0:m.data[0])+((g=r==null?void 0:r.value[0])==null?void 0:g.data[1]),{capital:!0})}),u=d.computed(()=>{var m;return`color: ${(m=r==null?void 0:r.value[0])==null?void 0:m.backgroundColor[t.numerator]}`}),h=d.computed(()=>["full","single"].includes(t.metricDisplay)),f=d.computed(()=>t.metricDisplay==="full");return(m,g)=>(d.openBlock(),d.createElementBlock("div",qD,[d.createElementVNode("div",XD,[h.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(u.value)},d.toDisplayString(c.value),5)):d.createCommentVNode("",!0),f.value?(d.openBlock(),d.createElementBlock("div",GD,d.toDisplayString(d.unref(n).t("total"))+": "+d.toDisplayString(l.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:e.height,width:e.width})},[d.createVNode(d.unref(Gm),{ref_key:"chartInstance",ref:o,"chart-id":i.value,data:s.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-32e7f9e0"]]);/*!
|
|
29
29
|
* pinia v2.1.7
|
|
30
30
|
* (c) 2023 Eduardo San Martin Morote
|
|
31
31
|
* @license MIT
|
|
32
|
-
*/process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();var tg;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(tg||(tg={}));const ZD=typeof window<"u";process.env.NODE_ENV!=="production"&&process.env.NODE_ENV,process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();const QD={notAvailable:"N/A"},JD={small:{traffic:"Requests",errorRate:"Error rate",averageLatency:"Avg. latency",p99Latency:"P99 latency"},short:{traffic:"Requests",errorRate:"Error rate",averageLatency:"Average latency",p99Latency:"P99 latency"},long:{traffic:"Number of requests",errorRate:"Average error rate",averageLatency:"Average latency",p99Latency:"P99 latency"}},tC={custom_days:"vs previous {numDays, plural, =1 {day} other {# days}}",custom_hours:"vs previous {numHours, plural, =1 {hour} other {# hours}}",custom_minutes:"vs previous {numMinutes, plural, =1 {minute} other {# minutes}}","15m":"vs previous 15 minutes","1h":"vs previous hour","6h":"vs previous 6 hours","12h":"vs previous 12 hours","24h":"vs previous 24 hours","7d":"vs previous 7 days","30d":"vs previous 30 days",current_week:"vs previous week",current_month:"vs previous month",current_quarter:"vs previous quarter",previous_week:"vs previous time period",previous_month:"vs previous time period",previous_quarter:"vs previous quarter"},eC={general:QD,metricCard:JD,trendRange:tC};function nC(){const e=Qe.createI18n("en-us",eC);return{i18n:e,i18nT:Qe.i18nTComponent(e)}}const iC=2,Ul=["1XX","2XX","3XX","4XX","5XX"],eg=["4XX","5XX"];var ng=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(ng||{});const rC=e=>{var t,n,i,r,s;return e?!!((t=Object.keys(e))!=null&&t.length||(n=e.data)!=null&&n.length||(r=(i=e.data)==null?void 0:i.data)!=null&&r.length||!((s=e.data)!=null&&s.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function sC(e=d.ref({}),t,n,i=rC){const r=d.ref("PENDING");return d.watchEffect(()=>{const s=i(e.value);if(e.value&&s&&n.value){r.value="VALIDATING_HAS_DATA";return}if(e.value&&n.value){r.value="VALIDATING";return}if(e.value&&t.value){r.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){r.value="PENDING";return}if(e.value&&!t.value&&s){r.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){r.value="SUCCESS";return}e.value===void 0&&t&&(r.value="ERROR")}),{state:r,swrvState:ng}}const Bn=Symbol("default"),ql="status_code_grouped",ig=(e,t,n,i,r)=>{e[t][n]||(e[t][n]={}),e[t][n][i]=r};function aC(e,t){var n;const i=((n=e.meta.metric_names)==null?void 0:n[0])||"",r=e.meta.start_ms,s=Object.keys(e.meta.display||{}),a=!!s.find(l=>l===ql),o=s.find(l=>l!==ql);return s.length>2||s.length>1&&!a?(console.error("Don't know how to work with provided dimensions:",s),{previous:{[Bn]:{[Bn]:0}},current:{[Bn]:{[Bn]:0}}}):e.data.reduce((l,c)=>{const u=c.event[i],h=o?c.event[o]:Bn,f=a?c.event[ql]:Bn;return new Date(c.timestamp).getTime()===r&&t?ig(l,"previous",h,f,u):ig(l,"current",h,f,u),l},{previous:{},current:{}})}function oC(e){e.queryReady===void 0&&(e.queryReady=d.computed(()=>!0));const t=d.computed(()=>{var u,h;return{metrics:e.metrics.value,dimensions:[...(u=e.dimensions)!=null&&u.length?[...e.dimensions]:[],...e.withTrend.value?["time"]:[]],granularity:e.withTrend.value?"trend":void 0,...(h=e.filter.value)!=null&&h.length?{filters:e.filter.value}:{},time_range:e.timeRange.value}}),n=d.computed(()=>{var u,h,f,m;if(!((u=e.queryReady)!=null&&u.value))return null;const g=(h=e.filter)!=null&&h.value?JSON.stringify(e.filter.value):"";return`metric-fetcher-${JSON.stringify(e.timeRange.value)}-${(f=e.dimensions)==null?void 0:f.join("-")}-${(m=e.metrics.value)==null?void 0:m.join("-")}-${g}-${e.refreshCounter.value}`}),{response:i,error:r,isValidating:s}=Vi.useRequest(()=>n.value,()=>e.queryFn({datasource:e.datasource.value,query:t.value},e.abortController??new AbortController),{refreshInterval:e.refreshInterval,revalidateOnFocus:!1,errorRetryCount:iC}),{state:a,swrvState:o}=sC(i,r,s),l=d.computed(()=>{var u,h,f,m,g,p,x;return!((h=(u=i.value)==null?void 0:u.data)!=null&&h.length)||!((m=(f=i.value)==null?void 0:f.meta)!=null&&m.display)||!((x=(p=(g=i.value)==null?void 0:g.meta)==null?void 0:p.metric_names)!=null&&x.length)?{current:{},previous:{}}:aC(i.value,e.withTrend.value)}),c=Vi.useTrendRange(e.withTrend,e.timeRange,d.computed(()=>{var u;return(u=i.value)==null?void 0:u.meta}));return{isLoading:d.computed(()=>o.PENDING===a.value),hasError:d.computed(()=>o.ERROR===a.value),raw:i,mapped:l,trendRange:c}}const Bi=(e,t,n=Bn,i)=>(i??[Bn]).reduce((r,s)=>{const a=e[t][n];return a?r+(a[s]||0):r},0);function lC(e){const{cardType:t,title:n,description:i,record:r,hasError:s,increaseIsBad:a,formatValueFn:o,trendRange:l}=e;return d.computed(()=>{let c=0,u=0;if(r!=null&&r.value)try{c=Bi(r.value,"current",e.lookupKey,e.sumGroupedValues),u=Bi(r.value,"previous",e.lookupKey,e.sumGroupedValues)}catch(h){console.error("Metric card data doesn't have the expected structure:",h)}return{cardType:t,hasError:s.value,currentValue:c,previousValue:u,title:n.value,description:i,increaseIsBad:!!a,formatValueFn:o,trendRange:l==null?void 0:l.value}})}function rg(e,t,n){const{i18n:i}=Vi.useI18n();return d.computed(()=>{var r,s,a;if(!e.value)return"";if(((r=t==null?void 0:t.value)==null?void 0:r.type)==="relative")return i.t(`trendRange.${t.value.time_range}`);let o,l;if((s=n==null?void 0:n.value)!=null&&s.start_ms&&n.value.end_ms)o=n.value.start_ms,l=n.value.end_ms;else if(((a=t==null?void 0:t.value)==null?void 0:a.type)==="absolute"&&t.value.start&&t.value.end)o=new Date(t.value.start).getTime(),l=new Date(t.value.end).getTime();else return"";let c=(l-o)/(1e3*60*60*24),u=(l-o)/(1e3*60*60),h=(l-o)/(1e3*60);return e.value&&(c/=2,u/=2,h/=2),c>=1?i.t("trendRange.custom_days",{numDays:Math.round(c)}):u>=1?i.t("trendRange.custom_hours",{numHours:Math.round(u)}):h>=1?i.t("trendRange.custom_minutes",{numMinutes:Math.round(h)}):i.t("trendRange.custom_days",{numDays:Math.round(c)})})}var Xl=new WeakMap,sg=0;function cC(e){if(!e.length)return"";for(var t="arg",n=0;n<e.length;++n){var i=void 0;e[n]===null||typeof e[n]!="object"&&typeof e[n]!="function"?typeof e[n]=="string"?i='"'+e[n]+'"':i=String(e[n]):Xl.has(e[n])?i=Xl.get(e[n]):(i=sg,Xl.set(e[n],sg++)),t+="@"+i}return t}function uC(e){if(typeof e=="function")try{e=e()}catch{e=""}return Array.isArray(e)?e=cC(e):e=String(e||""),e}var Gl=function(){function e(t){t===void 0&&(t=0),this.items=new Map,this.ttl=t}return e.prototype.serializeKey=function(t){return uC(t)},e.prototype.get=function(t){var n=this.serializeKey(t);return this.items.get(n)},e.prototype.set=function(t,n,i){var r=this.serializeKey(t),s=i||this.ttl,a=Date.now(),o={data:n,createdAt:a,expiresAt:s?a+s:1/0};this.dispatchExpire(s,o,r),this.items.set(r,o)},e.prototype.dispatchExpire=function(t,n,i){var r=this;t&&setTimeout(function(){var s=Date.now(),a=s>=n.expiresAt;a&&r.delete(i)},t)},e.prototype.delete=function(t){this.items.delete(t)},e}();function dC(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function hC(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var fC=function(e){return fetch(e).then(function(t){return t.json()})};const Kl={isOnline:dC,isDocumentVisible:hC,fetcher:fC};var hn=function(){return hn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},hn.apply(this,arguments)},zi=function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(u){try{c(i.next(u))}catch(h){a(h)}}function l(u){try{c(i.throw(u))}catch(h){a(h)}}function c(u){u.done?s(u.value):r(u.value).then(o,l)}c((i=i.apply(e,[])).next())})},Hi=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(u){return l([c,u])}}function l(c){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(s=c[0]&2?r.return:c[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;switch(r=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,r=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],r=0}finally{i=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},mC=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},gC=function(e,t,n){if(arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},ag=new Gl,wa=new Gl,Zl=new Gl,og={cache:ag,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:Kl.fetcher,isOnline:Kl.isOnline,isDocumentVisible:Kl.isDocumentVisible};function pC(e,t,n){var i=wa.get(e);if(i)i.data.push(t);else{var r=5e3;wa.set(e,[t],n>0?n+r:n)}}function yC(e,t,n){if(n.isDocumentVisible()&&!(n.errorRetryCount!==void 0&&t>n.errorRetryCount)){var i=Math.min(t||0,n.errorRetryCount),r=i*n.errorRetryInterval;setTimeout(function(){e(null,{errorRetryCount:i+1,shouldRetryOnError:!0})},r)}}var lg=function(e,t,n,i){return n===void 0&&(n=ag),i===void 0&&(i=og.ttl),zi(void 0,void 0,void 0,function(){var r,s,a,o,l,c,u;return Hi(this,function(h){switch(h.label){case 0:if(!_C(t))return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,t];case 2:return r=h.sent(),[3,4];case 3:return o=h.sent(),s=o,[3,4];case 4:return[3,6];case 5:r=t,h.label=6;case 6:if(a=!1,l={data:r,error:s,isValidating:a},typeof r<"u")try{n.set(e,l,i)}catch(f){console.error("swrv(mutate): failed to set cache",f)}return c=wa.get(e),c&&c.data.length&&(u=c.data.filter(function(f){return f.key===e}),u.forEach(function(f,m){typeof l.data<"u"&&(f.data=l.data),f.error=l.error,f.isValidating=l.isValidating,f.isLoading=l.isValidating;var g=m===u.length-1;g||delete u[m]}),u=u.filter(Boolean)),[2,l]}})})};function bC(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i,r,s=hn({},og),a=!1,o=!1,l=d.getCurrentInstance(),c=(l==null?void 0:l.proxy)||l;if(!c)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var u=(c==null?void 0:c.$isServer)||!1;t.length>=1&&(i=t[0]),t.length>=2&&(r=t[1]),t.length>2&&(s=hn(hn({},s),t[2]));var h=u?s.serverTTL:s.ttl,f=typeof i=="function"?i:d.ref(i);typeof r>"u"&&(r=s.fetcher);var m=null;m||(m=d.reactive({data:void 0,error:void 0,isValidating:!0,isLoading:!0,key:null}));var g=function(v,k){return zi(e,void 0,void 0,function(){var D,M,P,E,y,_,T,O=this;return Hi(this,function(A){switch(A.label){case 0:return D=m.data===void 0,M=f.value,M?(P=s.cache.get(M),E=P&&P.data,m.isValidating=!0,m.isLoading=!E,E&&(m.data=E.data,m.error=E.error),y=v||r,!y||!s.isDocumentVisible()&&!D||(k==null?void 0:k.forceRevalidate)!==void 0&&!(k!=null&&k.forceRevalidate)?(m.isValidating=!1,m.isLoading=!1,[2]):P&&(_=!!(Date.now()-P.createdAt>=s.dedupingInterval||k!=null&&k.forceRevalidate),!_)?(m.isValidating=!1,m.isLoading=!1,[2]):(T=function(){return zi(O,void 0,void 0,function(){var I,B,q,G;return Hi(this,function(V){switch(V.label){case 0:return I=Zl.get(M),I?[3,2]:(B=Array.isArray(M)?M:[M],q=y.apply(void 0,gC([],mC(B),!1)),Zl.set(M,q,s.dedupingInterval),[4,lg(M,q,s.cache,h)]);case 1:return V.sent(),[3,4];case 2:return[4,lg(M,I.data,s.cache,h)];case 3:V.sent(),V.label=4;case 4:return m.isValidating=!1,m.isLoading=!1,Zl.delete(M),m.error!==void 0&&(G=!a&&s.shouldRetryOnError&&(k?k.shouldRetryOnError:!0),G&&yC(g,k?k.errorRetryCount:1,s)),[2]}})})},E&&s.revalidateDebounce?(setTimeout(function(){return zi(O,void 0,void 0,function(){return Hi(this,function(I){switch(I.label){case 0:return a?[3,2]:[4,T()];case 1:I.sent(),I.label=2;case 2:return[2]}})})},s.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,T()];case 2:A.sent(),A.label=3;case 3:return[2]}})})},p=function(){return zi(e,void 0,void 0,function(){return Hi(this,function(v){return[2,g(null,{shouldRetryOnError:!1})]})})},x=null;d.onMounted(function(){var v=function(){return zi(e,void 0,void 0,function(){return Hi(this,function(k){switch(k.label){case 0:return!m.error&&s.isOnline()?[4,g()]:[3,2];case 1:return k.sent(),[3,3];case 2:x&&clearTimeout(x),k.label=3;case 3:return s.refreshInterval&&!a&&(x=setTimeout(v,s.refreshInterval)),[2]}})})};s.refreshInterval&&(x=setTimeout(v,s.refreshInterval)),s.revalidateOnFocus&&(document.addEventListener("visibilitychange",p,!1),window.addEventListener("focus",p,!1))}),d.onUnmounted(function(){a=!0,x&&clearTimeout(x),s.revalidateOnFocus&&(document.removeEventListener("visibilitychange",p,!1),window.removeEventListener("focus",p,!1));var v=wa.get(f.value);v&&(v.data=v.data.filter(function(k){return k!==m}))});try{d.watch(f,function(v){d.isReadonly(f)||(f.value=v),m.key=v,m.isValidating=!!v,pC(f.value,m,h),!u&&!o&&f.value&&g(),o=!1},{immediate:!0})}catch{}var S=hn(hn({},d.toRefs(m)),{mutate:function(v,k){return g(v,hn(hn({},k),{forceRevalidate:!0}))}});return S}function _C(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function xC(e,t,n){const{data:i,error:r,isValidating:s,mutate:a}=bC(e,t,{revalidateDebounce:500,revalidateOnFocus:!1,dedupingInterval:100,...n});return{data:d.computed(()=>i.value),response:i,error:r,isValidating:s,revalidate:a}}const Vi={useI18n:nC,useMetricCardBuilder:lC,useMetricFetcher:oC,useTrendRange:rg,useRequest:xC},wC=Symbol("METRICS_PROVIDER_KEY");function vC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cg={exports:{}};(function(e){(function(){function t(c,u){if(u.separator===!1||c<1e3)return c.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(c).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(c,u,h){var f=c/u,m=h.round?"round":"floor";return h.decimal===!1?(c=Math[m](f),c.toString()):(h.precision?c=f:c=f<10?Math[m](f*10)/10:Math[m](f),c=c.toString(),typeof h.decimal=="string"&&(c=c.replace(".",h.decimal)),c)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function l(c,u){var h;u=u||{};var f=c<0;f&&(c=Math.abs(c)),u.precision&&(c=parseFloat(c.toPrecision(u.precision)));var m=u.min10k?r:i;return c<m||u.precision&&u.precision>Math.log10(c)?h=t(n(c,1,u),u):c<s?h=n(c,i,u)+"k":c<a?h=n(c,s,u)+"m":c<o?h=t(n(c,a,u),u)+"b":h=t(n(c,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}l.addCommas=t,e.exports=l})()})(cg);var SC=cg.exports;const kC=vC(SC);var fn=(e=>(e.GENERIC_COUNT="GenericCount",e.TRAFFIC="Traffic",e.ERROR_RATE="ErrorRate",e.LATENCY="Latency",e))(fn||{}),Ge=(e=>(e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xl",e))(Ge||{});const Ql=2,ug=Ql+2,dg=(e,t,n=!1)=>{let i=!t||Number(e.toFixed(ug))===0?0:Number(e.toFixed(ug))>0?1:-1;return n&&(i*=-1),i},hg=(e,t,n)=>t?`${Math.abs(e*100).toFixed(Ql)}%`:n,fg=(e,t)=>t===0?0:e/t-1,mg=(e,t=!1)=>(t&&(e*=-1),e>0?ne.TrendUpIcon:e<0?ne.TrendDownIcon:ne.IndeterminateSmallIcon),MC="#ad000e",Jl="#6c7489",gg="#52596e",TC="#007d60",va="16px",DC="20px",CC={key:0,class:"metricscard-description"},EC={class:"metricscard-valuetrend"},OC={key:0,class:"metricscard-error"},PC={key:2,class:"metricscard-trend"},RC={"data-testid":"metric-trend-change"},AC={key:0,class:"metricscard-trend-range"},IC=d.defineComponent({__name:"MetricsCard",props:{cardType:{type:String,required:!0,default:fn.GENERIC_COUNT},title:{type:String,default:"0%",required:!0},description:{type:String,default:"",required:!1},tooltip:{type:String,required:!1,default:""},timeframe:{type:String,required:!1,default:""},metricValue:{type:String,default:""},metricChange:{type:String,required:!0},changePolarity:{type:Number,required:!0},trendIcon:{type:Object,default:ne.IndeterminateSmallIcon},trendRange:{type:String,default:""},hasError:{type:Boolean,default:!1},errorMessage:{type:String,default:"Vitals data error"},cardSize:{type:String,required:!1,default:()=>Ge.Large},hasContainerTitle:{type:Boolean,required:!1,default:!1},titleTag:{type:String,default:"span"}},setup(e){const t=new Map([[fn.GENERIC_COUNT,ne.VitalsIcon],[fn.TRAFFIC,ne.CloudUploadIcon],[fn.ERROR_RATE,ne.WarningOutlineIcon],[fn.LATENCY,ne.ResponseIcon]]),n=e,i=o=>{const l={red:`var(--kui-color-text-danger-strong, ${MC})`,green:`var(--kui-color-text-success, ${TC})`,grey:`var(--kui-color-text-neutral-strong, ${gg})`};return o>0?l.green:o<0?l.red:l.grey},r=o=>o>0?"positive":o<0?"negative":"neutral",s=[Ge.Medium,Ge.Large].includes(n.cardSize),a=[Ge.Small].includes(n.cardSize);return(o,l)=>{const c=d.resolveComponent("KTooltip");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["metricscard",e.cardSize])},[d.createElementVNode("div",{class:d.normalizeClass(["metricscard-title",e.cardSize])},[d.unref(a)?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(t).get(e.cardType)),{key:0,class:"metricscard-icon",color:`var(--kui-color-text-neutral, ${d.unref(Jl)})`,size:d.unref(va)},null,8,["color","size"])),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.titleTag),null,{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(e.title),1)]),_:1})),e.tooltip?(d.openBlock(),d.createBlock(c,{key:1,class:"metricscard-tooltip",placement:"right",text:e.tooltip},{default:d.withCtx(()=>[d.createVNode(d.unref(ne.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Jl)})`,size:d.unref(va)},null,8,["color","size"])]),_:1},8,["text"])):d.createCommentVNode("",!0)],2),e.description&&d.unref(s)?(d.openBlock(),d.createElementBlock("div",CC,[d.createElementVNode("span",null,d.toDisplayString(e.description),1)])):d.createCommentVNode("",!0),d.createElementVNode("div",EC,[e.hasError?(d.openBlock(),d.createElementBlock("div",OC,[d.createVNode(d.unref(ne.WarningIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Jl)})`,size:d.unref(DC)},null,8,["color","size"]),d.createElementVNode("div",null," "+d.toDisplayString(e.errorMessage),1)])):(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["metricscard-value",e.cardSize]),"data-testid":"metric-value"},d.toDisplayString(e.metricValue),3)),d.unref(s)?(d.openBlock(),d.createElementBlock("div",PC,[d.createElementVNode("div",{class:d.normalizeClass(["metricscard-trend-change",r(e.changePolarity)]),"data-testid":"metric-trend-parent"},[e.changePolarity!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.trendIcon),{key:0,color:i(e.changePolarity),size:d.unref(va)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(ne.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(gg)})`,size:d.unref(va)},null,8,["color","size"])),d.createElementVNode("div",RC,d.toDisplayString(e.metricChange),1)],2),e.trendRange?(d.openBlock(),d.createElementBlock("div",AC,d.toDisplayString(e.trendRange),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])],2)}}}),tc=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},LC=tc(IC,[["__scopeId","data-v-b1513f6f"]]),NC={},FC={class:"loading-tabs"};function BC(e,t){const n=d.resolveComponent("KSkeletonBox");return d.openBlock(),d.createElementBlock("div",FC,[d.createVNode(n,{width:"100"}),d.createVNode(n,{width:"75"})])}const zC=tc(NC,[["render",BC],["__scopeId","data-v-9c7113d7"]]),HC={key:0,class:"container-title"},VC={key:0,class:"container-description"},WC={key:1,class:"error-display"},YC={key:0,class:"error-display-message"},$C={key:2,class:"cards-wrapper"},jC=d.defineComponent({__name:"MetricCardContainer",props:{fallbackDisplayText:{type:String,required:!0},cards:{type:Array,required:!0},errorMessage:{type:String,required:!1,default:""},loading:{type:Boolean,required:!1,default:!1},hasTrendAccess:{type:Boolean,required:!1,default:!0},cardSize:{type:String,required:!1,default:()=>Ge.Large},containerTitle:{type:String,required:!1,default:""},containerDescription:{type:String,required:!1,default:""}},setup(e){const t=e,n=d.computed(()=>t.cards.every(r=>(r==null?void 0:r.hasError)===!0)),i=r=>{const s=fg(r.currentValue,r.previousValue)||0,a=dg(s,t.hasTrendAccess,r.increaseIsBad);return{metricValue:r.formatValueFn?r.formatValueFn(r.currentValue):kC(r.currentValue,{capital:!0,round:!0})||"0",metricChange:r.formatChangeFn?r.formatChangeFn(s):hg(s,t.hasTrendAccess,t.fallbackDisplayText),changePolarity:a,trendIcon:mg(a,r.increaseIsBad),cardSize:t.cardSize,hasContainerTitle:!!t.containerTitle}};return(r,s)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["kong-ui-public-metric-card-container",e.cardSize])},[t.containerTitle||t.containerDescription?(d.openBlock(),d.createElementBlock("div",HC,[d.createTextVNode(d.toDisplayString(t.containerTitle)+" ",1),t.containerDescription?(d.openBlock(),d.createElementBlock("div",VC,d.toDisplayString(t.containerDescription),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),n.value?(d.openBlock(),d.createElementBlock("div",WC,[d.createVNode(d.unref(ne.WarningIcon),{class:"error-display-icon"}),e.errorMessage?(d.openBlock(),d.createElementBlock("div",YC,d.toDisplayString(e.errorMessage),1)):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("div",$C,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.cards,(a,o)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[e.loading?(d.openBlock(),d.createElementBlock("div",{key:`skeleton-${o}`,class:"loading-tab"},[d.createVNode(zC,{class:d.normalizeClass(e.cardSize===d.unref(Ge).Small?"loading-tabs-small":"loading-tabs-large")},null,8,["class"])])):(d.openBlock(),d.createBlock(LC,d.mergeProps({key:o},{ref_for:!0},i(a),{"card-size":e.cardSize,"card-type":a.cardType,description:a.description,"error-message":e.errorMessage,"has-error":a.hasError,title:a.title,"title-tag":a.titleTag,tooltip:a.tooltip,"trend-range":a.trendRange}),null,16,["card-size","card-type","description","error-message","has-error","title","title-tag","tooltip","trend-range"]))],64))),256))]))],2))}}),UC=tc(jC,[["__scopeId","data-v-7080ba56"]]);Ge.Large;const qC={key:1,class:"single-value-wrapper"},XC={class:"single-value","data-testid":"single-value-chart"},GC={key:0,class:"single-value-unit"},KC={key:1,class:"single-value-trend"},ZC={key:0,class:"single-value-trend-range"},QC=Ee(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:$f},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(e){const{i18n:t}=pt.useI18n(),{formatBytes:n}=Br({i18n:t}),i=e,r={left:"flex-start",center:"center",right:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},s=d.ref(i.leftAlign?"left":i.alignX),a=d.computed(()=>i.data.data),o=d.computed(()=>{var M,P;return(P=(M=i.data.meta)==null?void 0:M.metric_names)==null?void 0:P[0]}),l=d.computed(()=>{var P,E;const M=o.value?(E=(P=i.data.meta)==null?void 0:P.metric_units)==null?void 0:E[o.value]:void 0;if(M)return t.t(`chartUnits.${M}`,{plural:""})}),c=d.computed(()=>{var M;return o.value==="request_per_minute"||!!((M=o.value)!=null&&M.includes("_latency_"))}),u=d.computed(()=>!i.showTrend||a.value.length<2||!o.value?null:a.value[0].event[o.value]??null),h=d.computed(()=>{if(!o.value)return null;const M=i.showTrend?1:0;return a.value.length<=M?null:a.value[M].event[o.value]??null}),f=d.computed(()=>{var E;const M=h.value;if(M===null)return"";if((E=o.value)!=null&&E.includes("_size_"))return n(M);if(M>=1e9){const y=(M/1e9).toFixed(1);return y.endsWith(".0")?`${Math.floor(M/1e9)}B`:`${y}B`}if(M>=1e7){const y=(M/1e6).toFixed(1);return y.endsWith(".0")?`${Math.floor(M/1e6)}M`:`${y}M`}const P=i.decimalPoints&&typeof i.decimalPoints=="number"?i.decimalPoints:$f;return M.toLocaleString("en-US",{maximumFractionDigits:P})}),m=d.computed(()=>fg(h.value??0,u.value??0)||0),g=d.computed(()=>dg(m.value,!0,i.increaseIsBad)),p=d.computed(()=>mg(g.value)),x=d.computed(()=>hg(m.value,!0,"not available")),S=d.computed(()=>({justifyContent:r[s.value]??"space-evenly"})),v=rg(d.computed(()=>i.showTrend),void 0,d.computed(()=>i.data.meta)),k=M=>M>0?"positive":M<0?"negative":"neutral",D=M=>M>0?MS:M<0?kS:yf;return d.onMounted(()=>{var M,P,E,y;!i.showTrend&&((P=(M=i.data)==null?void 0:M.data)==null?void 0:P.length)>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",i.data.data.length):i.showTrend&&((y=(E=i.data)==null?void 0:E.data)==null?void 0:y.length)!==2&&console.warn("SingleValue with trend expects exactly 2 data points. Data length:",i.data.data.length)}),d.watch(d.toRef(i,"alignX"),M=>{M&&(s.value=M)}),(M,P)=>{const E=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:"chart-parent","data-testid":"single-value-parent",style:d.normalizeStyle(S.value)},[h.value===null?(d.openBlock(),d.createBlock(E,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t).t("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",qC,[d.createElementVNode("span",XC,d.toDisplayString(f.value),1),c.value?(d.openBlock(),d.createElementBlock("span",GC," "+d.toDisplayString(l.value),1)):d.createCommentVNode("",!0),e.showTrend?(d.openBlock(),d.createElementBlock("div",KC,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",k(g.value)]),"data-testid":"single-value-trend"},[g.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(p.value),{key:0,color:D(g.value),size:d.unref(zr)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(ne.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(yf)})`,size:d.unref(zr)},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(x.value),1)],2),d.unref(v)?(d.openBlock(),d.createElementBlock("div",ZC,d.toDisplayString(d.unref(v)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],4)}}}),[["__scopeId","data-v-caf2e305"]]),JC={class:"simple-chart-shell"},tE={key:1,class:"analytics-chart-parent"},eE=Ee(d.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:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.computed(()=>{var u;const c=pt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||un},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),r=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),s=d.computed(()=>t.chartOptions.type==="gauge"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=d.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),l=d.computed(()=>{var u,h;const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return t.chartOptions.showTrend?c&&t.chartData.data.length>=2&&t.chartData.data[1].event[f]!==null:c&&t.chartData.data[0].event[f]!==null}return c});return(c,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",JC,[l.value?(d.openBlock(),d.createElementBlock("div",tE,[s.value?(d.openBlock(),d.createBlock(KD,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":r.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),a.value?(d.openBlock(),d.createBlock(QC,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-56837d34"]]),nE={class:"top-n-card-title","data-testid":"top-n-card-title"},iE={class:"top-n-card-description","data-testid":"top-n-card-description"},rE={key:3,class:"top-n-table","data-testid":"top-n-table"},sE={class:"table-headings"},aE={class:"table-row"},oE={class:"column-1"},lE={class:"column-2"},cE={class:"table-body","data-testid":"top-n-data"},uE=["data-testid"],dE={class:"column-1"},hE={class:"column-2"},fE=Ee(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.computed(()=>t.data.data),r=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),s=d.computed(()=>{var g,p;return(g=t.data.meta)!=null&&g.display&&((p=Object.keys(t.data.meta.display))==null?void 0:p[0])||""}),a=d.computed(()=>s.value?t.data.meta.display[s.value]:{}),o=d.computed(()=>{var g,p;return(p=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&p.length?t.data.meta.metric_names[0]:""}),l=d.computed(()=>o.value?n.t(`chartLabels.${o.value}`)||o.value:""),c=d.computed(()=>{if(!r.value)return"";if(t.data.meta){if(a.value&&!Object.keys(a.value).length)return n.t("topNTable.errors.display");if(!o.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),u=g=>{const p=g.event;return String(p[s.value])},h=g=>{const p=u(g),x=a.value&&a.value[p];return x?x.name:"-"},f=g=>{const p=u(g),x=a.value&&a.value[p];return x?!!x.deleted:!1},m=g=>{if(!o.value)return"–";const x=g.event[o.value];return x?Yr(x,{capital:!0,round:!0}):"–"};return(g,p)=>{const x=d.resolveComponent("KEmptyState"),S=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(v,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},d.createSlots({default:d.withCtx(()=>[c.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c.value),1)]),_:1})):e.isLoading?(d.openBlock(),d.createBlock(S,{key:1,"table-columns":2,type:"table"})):r.value?(d.openBlock(),d.createElementBlock("div",rE,[d.createElementVNode("div",sE,[d.createElementVNode("div",aE,[d.createElementVNode("div",oE,d.toDisplayString(d.unref(n).t("topNTable.nameLabel")),1),d.createElementVNode("div",lE,d.toDisplayString(l.value),1)])]),d.createElementVNode("div",cE,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(k,D)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${D}`,class:"table-row","data-testid":`row-${u(k)}`},[d.createElementVNode("div",dE,[d.renderSlot(g.$slots,"name",{record:{id:u(k),name:h(k),deleted:f(k),dimension:s.value}},()=>[d.createTextVNode(d.toDisplayString(h(k)),1)],!0)]),d.createElementVNode("div",hE," "+d.toDisplayString(m(k)),1)],8,uE))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(e.emptyStateTitle||d.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",nE,d.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",iE,d.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var Sa={exports:{}};Sa.exports,function(e,t){var n=200,i="Expected a function",r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",p="[object Map]",x="[object Number]",S="[object Object]",v="[object Promise]",k="[object RegExp]",D="[object Set]",M="[object String]",P="[object Symbol]",E="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",T="[object Float32Array]",O="[object Float64Array]",A="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",q="[object Uint8Array]",G="[object Uint8ClampedArray]",V="[object Uint16Array]",lt="[object Uint32Array]",X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,H=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,xt=/\\(\\)?/g,yt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,mt={};mt[T]=mt[O]=mt[A]=mt[I]=mt[B]=mt[q]=mt[G]=mt[V]=mt[lt]=!0,mt[l]=mt[c]=mt[y]=mt[u]=mt[_]=mt[h]=mt[f]=mt[m]=mt[p]=mt[x]=mt[S]=mt[k]=mt[D]=mt[M]=mt[E]=!1;var gt=typeof ve=="object"&&ve&&ve.Object===Object&&ve,z=typeof self=="object"&&self&&self.Object===Object&&self,j=gt||z||Function("return this")(),$=t&&!t.nodeType&&t,J=$&&!0&&e&&!e.nodeType&&e,et=J&&J.exports===$,nt=et&>.process,rt=function(){try{return nt&&nt.binding("util")}catch{}}(),it=rt&&rt.isTypedArray;function _t(b,C){for(var N=-1,W=b?b.length:0;++N<W;)if(C(b[N],N,b))return!0;return!1}function ct(b){return function(C){return C==null?void 0:C[b]}}function Et(b,C){for(var N=-1,W=Array(b);++N<b;)W[N]=C(N);return W}function te(b){return function(C){return b(C)}}function ce(b,C){return b==null?void 0:b[C]}function qt(b){var C=!1;if(b!=null&&typeof b.toString!="function")try{C=!!(b+"")}catch{}return C}function Ie(b){var C=-1,N=Array(b.size);return b.forEach(function(W,ht){N[++C]=[ht,W]}),N}function St(b,C){return function(N){return b(C(N))}}function Xt(b){var C=-1,N=Array(b.size);return b.forEach(function(W){N[++C]=W}),N}var zt=Array.prototype,Gt=Function.prototype,re=Object.prototype,Ke=j["__core-js_shared__"],ci=function(){var b=/[^.]+$/.exec(Ke&&Ke.keys&&Ke.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),ze=Gt.toString,Ht=re.hasOwnProperty,Se=re.toString,ui=RegExp("^"+ze.call(Ht).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ka=j.Symbol,Ma=j.Uint8Array,Qr=re.propertyIsEnumerable,di=zt.splice,Jr=St(Object.keys,Object),hi=bn(j,"DataView"),mn=bn(j,"Map"),gn=bn(j,"Promise"),ts=bn(j,"Set"),es=bn(j,"WeakMap"),fi=bn(Object,"create"),ic=xn(hi),rc=xn(mn),Ta=xn(gn),Da=xn(ts),pn=xn(es),Wi=ka?ka.prototype:void 0,ns=Wi?Wi.valueOf:void 0,Ca=Wi?Wi.toString:void 0;function yn(b){var C=-1,N=b?b.length:0;for(this.clear();++C<N;){var W=b[C];this.set(W[0],W[1])}}function sc(){this.__data__=fi?fi(null):{}}function He(b){return this.has(b)&&delete this.__data__[b]}function ac(b){var C=this.__data__;if(fi){var N=C[b];return N===r?void 0:N}return Ht.call(C,b)?C[b]:void 0}function oc(b){var C=this.__data__;return fi?C[b]!==void 0:Ht.call(C,b)}function lc(b,C){var N=this.__data__;return N[b]=fi&&C===void 0?r:C,this}yn.prototype.clear=sc,yn.prototype.delete=He,yn.prototype.get=ac,yn.prototype.has=oc,yn.prototype.set=lc;function Ve(b){var C=-1,N=b?b.length:0;for(this.clear();++C<N;){var W=b[C];this.set(W[0],W[1])}}function cc(){this.__data__=[]}function Hn(b){var C=this.__data__,N=ji(C,b);if(N<0)return!1;var W=C.length-1;return N==W?C.pop():di.call(C,N,1),!0}function uc(b){var C=this.__data__,N=ji(C,b);return N<0?void 0:C[N][1]}function dc(b){return ji(this.__data__,b)>-1}function hc(b,C){var N=this.__data__,W=ji(N,b);return W<0?N.push([b,C]):N[W][1]=C,this}Ve.prototype.clear=cc,Ve.prototype.delete=Hn,Ve.prototype.get=uc,Ve.prototype.has=dc,Ve.prototype.set=hc;function We(b){var C=-1,N=b?b.length:0;for(this.clear();++C<N;){var W=b[C];this.set(W[0],W[1])}}function fc(){this.__data__={hash:new yn,map:new(mn||Ve),string:new yn}}function Vn(b){return Xi(this,b).delete(b)}function mc(b){return Xi(this,b).get(b)}function gc(b){return Xi(this,b).has(b)}function pc(b,C){return Xi(this,b).set(b,C),this}We.prototype.clear=fc,We.prototype.delete=Vn,We.prototype.get=mc,We.prototype.has=gc,We.prototype.set=pc;function Yi(b){var C=-1,N=b?b.length:0;for(this.__data__=new We;++C<N;)this.add(b[C])}function yc(b){return this.__data__.set(b,r),this}function bc(b){return this.__data__.has(b)}Yi.prototype.add=Yi.prototype.push=yc,Yi.prototype.has=bc;function Le(b){this.__data__=new Ve(b)}function $i(){this.__data__=new Ve}function _c(b){return this.__data__.delete(b)}function is(b){return this.__data__.get(b)}function xc(b){return this.__data__.has(b)}function wc(b,C){var N=this.__data__;if(N instanceof Ve){var W=N.__data__;if(!mn||W.length<n-1)return W.push([b,C]),this;N=this.__data__=new We(W)}return N.set(b,C),this}Le.prototype.clear=$i,Le.prototype.delete=_c,Le.prototype.get=is,Le.prototype.has=xc,Le.prototype.set=wc;function vc(b,C){var N=w(b)||La(b)?Et(b.length,String):[],W=N.length,ht=!!W;for(var Z in b)Ht.call(b,Z)&&!(ht&&(Z=="length"||ss(Z,W)))&&N.push(Z);return N}function ji(b,C){for(var N=b.length;N--;)if(Ia(b[N][0],C))return N;return-1}var Sc=Ac();function kc(b,C){return b&&Sc(b,C,gi)}function Ui(b,C){C=Gi(C,b)?[C]:Ze(C);for(var N=0,W=C.length;b!=null&&N<W;)b=b[_n(C[N++])];return N&&N==W?b:void 0}function Mc(b){return Se.call(b)}function Tc(b,C){return b!=null&&C in Object(b)}function rs(b,C,N,W,ht){return b===C?!0:b==null||C==null||!Kt(b)&&!ke(C)?b!==b&&C!==C:Dc(b,C,rs,N,W,ht)}function Dc(b,C,N,W,ht,Z){var bt=w(b),Zt=w(C),Vt=c,de=c;bt||(Vt=ue(b),Vt=Vt==l?S:Vt),Zt||(de=ue(C),de=de==l?S:de);var Me=Vt==S&&!qt(b),Te=de==S&&!qt(C),pe=Vt==de;if(pe&&!Me)return Z||(Z=new Le),bt||Na(b)?Pa(b,C,N,W,ht,Z):Ic(b,C,Vt,N,W,ht,Z);if(!(ht&a)){var Ne=Me&&Ht.call(b,"__wrapped__"),Fe=Te&&Ht.call(C,"__wrapped__");if(Ne||Fe){var $n=Ne?b.value():b,wn=Fe?C.value():C;return Z||(Z=new Le),N($n,wn,W,ht,Z)}}return pe?(Z||(Z=new Le),Lc(b,C,N,W,ht,Z)):!1}function Cc(b,C,N,W){var ht=N.length,Z=ht;if(b==null)return!Z;for(b=Object(b);ht--;){var bt=N[ht];if(bt[2]?bt[1]!==b[bt[0]]:!(bt[0]in b))return!1}for(;++ht<Z;){bt=N[ht];var Zt=bt[0],Vt=b[Zt],de=bt[1];if(bt[2]){if(Vt===void 0&&!(Zt in b))return!1}else{var Me=new Le,Te;if(!(Te===void 0?rs(de,Vt,W,s|a,Me):Te))return!1}}return!0}function Ec(b){if(!Kt(b)||Ra(b))return!1;var C=K(b)||qt(b)?ui:yt;return C.test(xn(b))}function Oc(b){return ke(b)&&$t(b.length)&&!!mt[Se.call(b)]}function Ea(b){return typeof b=="function"?b:b==null?Ki:typeof b=="object"?w(b)?qi(b[0],b[1]):Rc(b):sO(b)}function Pc(b){if(!Bc(b))return Jr(b);var C=[];for(var N in Object(b))Ht.call(b,N)&&N!="constructor"&&C.push(N);return C}function Rc(b){var C=Nc(b);return C.length==1&&C[0][2]?os(C[0][0],C[0][1]):function(N){return N===b||Cc(N,b,C)}}function qi(b,C){return Gi(b)&&Aa(C)?os(_n(b),C):function(N){var W=Fa(N,b);return W===void 0&&W===C?Ba(N,b):rs(C,W,void 0,s|a)}}function Wn(b){return function(C){return Ui(C,b)}}function Oa(b){if(typeof b=="string")return b;if(ee(b))return Ca?Ca.call(b):"";var C=b+"";return C=="0"&&1/b==-1/0?"-0":C}function Ze(b){return w(b)?b:zc(b)}function Ac(b){return function(C,N,W){for(var ht=-1,Z=Object(C),bt=W(C),Zt=bt.length;Zt--;){var Vt=bt[++ht];if(N(Z[Vt],Vt,Z)===!1)break}return C}}function Pa(b,C,N,W,ht,Z){var bt=ht&a,Zt=b.length,Vt=C.length;if(Zt!=Vt&&!(bt&&Vt>Zt))return!1;var de=Z.get(b);if(de&&Z.get(C))return de==C;var Me=-1,Te=!0,pe=ht&s?new Yi:void 0;for(Z.set(b,C),Z.set(C,b);++Me<Zt;){var Ne=b[Me],Fe=C[Me];if(W)var $n=bt?W(Fe,Ne,Me,C,b,Z):W(Ne,Fe,Me,b,C,Z);if($n!==void 0){if($n)continue;Te=!1;break}if(pe){if(!_t(C,function(wn,pi){if(!pe.has(pi)&&(Ne===wn||N(Ne,wn,W,ht,Z)))return pe.add(pi)})){Te=!1;break}}else if(!(Ne===Fe||N(Ne,Fe,W,ht,Z))){Te=!1;break}}return Z.delete(b),Z.delete(C),Te}function Ic(b,C,N,W,ht,Z,bt){switch(N){case _:if(b.byteLength!=C.byteLength||b.byteOffset!=C.byteOffset)return!1;b=b.buffer,C=C.buffer;case y:return!(b.byteLength!=C.byteLength||!W(new Ma(b),new Ma(C)));case u:case h:case x:return Ia(+b,+C);case f:return b.name==C.name&&b.message==C.message;case k:case M:return b==C+"";case p:var Zt=Ie;case D:var Vt=Z&a;if(Zt||(Zt=Xt),b.size!=C.size&&!Vt)return!1;var de=bt.get(b);if(de)return de==C;Z|=s,bt.set(b,C);var Me=Pa(Zt(b),Zt(C),W,ht,Z,bt);return bt.delete(b),Me;case P:if(ns)return ns.call(b)==ns.call(C)}return!1}function Lc(b,C,N,W,ht,Z){var bt=ht&a,Zt=gi(b),Vt=Zt.length,de=gi(C),Me=de.length;if(Vt!=Me&&!bt)return!1;for(var Te=Vt;Te--;){var pe=Zt[Te];if(!(bt?pe in C:Ht.call(C,pe)))return!1}var Ne=Z.get(b);if(Ne&&Z.get(C))return Ne==C;var Fe=!0;Z.set(b,C),Z.set(C,b);for(var $n=bt;++Te<Vt;){pe=Zt[Te];var wn=b[pe],pi=C[pe];if(W)var Sg=bt?W(pi,wn,pe,C,b,Z):W(wn,pi,pe,b,C,Z);if(!(Sg===void 0?wn===pi||N(wn,pi,W,ht,Z):Sg)){Fe=!1;break}$n||($n=pe=="constructor")}if(Fe&&!$n){var za=b.constructor,Ha=C.constructor;za!=Ha&&"constructor"in b&&"constructor"in C&&!(typeof za=="function"&&za instanceof za&&typeof Ha=="function"&&Ha instanceof Ha)&&(Fe=!1)}return Z.delete(b),Z.delete(C),Fe}function Xi(b,C){var N=b.__data__;return as(C)?N[typeof C=="string"?"string":"hash"]:N.map}function Nc(b){for(var C=gi(b),N=C.length;N--;){var W=C[N],ht=b[W];C[N]=[W,ht,Aa(ht)]}return C}function bn(b,C){var N=ce(b,C);return Ec(N)?N:void 0}var ue=Mc;(hi&&ue(new hi(new ArrayBuffer(1)))!=_||mn&&ue(new mn)!=p||gn&&ue(gn.resolve())!=v||ts&&ue(new ts)!=D||es&&ue(new es)!=E)&&(ue=function(b){var C=Se.call(b),N=C==S?b.constructor:void 0,W=N?xn(N):void 0;if(W)switch(W){case ic:return _;case rc:return p;case Ta:return v;case Da:return D;case pn:return E}return C});function Fc(b,C,N){C=Gi(C,b)?[C]:Ze(C);for(var W,ht=-1,bt=C.length;++ht<bt;){var Z=_n(C[ht]);if(!(W=b!=null&&N(b,Z)))break;b=b[Z]}if(W)return W;var bt=b?b.length:0;return!!bt&&$t(bt)&&ss(Z,bt)&&(w(b)||La(b))}function ss(b,C){return C=C??o,!!C&&(typeof b=="number"||vt.test(b))&&b>-1&&b%1==0&&b<C}function Gi(b,C){if(w(b))return!1;var N=typeof b;return N=="number"||N=="symbol"||N=="boolean"||b==null||ee(b)?!0:Q.test(b)||!X.test(b)||C!=null&&b in Object(C)}function as(b){var C=typeof b;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?b!=="__proto__":b===null}function Ra(b){return!!ci&&ci in b}function Bc(b){var C=b&&b.constructor,N=typeof C=="function"&&C.prototype||re;return b===N}function Aa(b){return b===b&&!Kt(b)}function os(b,C){return function(N){return N==null?!1:N[b]===C&&(C!==void 0||b in Object(N))}}var zc=mi(function(b){b=Yn(b);var C=[];return H.test(b)&&C.push(""),b.replace(U,function(N,W,ht,Z){C.push(ht?Z.replace(xt,"$1"):W||N)}),C});function _n(b){if(typeof b=="string"||ee(b))return b;var C=b+"";return C=="0"&&1/b==-1/0?"-0":C}function xn(b){if(b!=null){try{return ze.call(b)}catch{}try{return b+""}catch{}}return""}function mi(b,C){if(typeof b!="function"||C&&typeof C!="function")throw new TypeError(i);var N=function(){var W=arguments,ht=C?C.apply(this,W):W[0],Z=N.cache;if(Z.has(ht))return Z.get(ht);var bt=b.apply(this,W);return N.cache=Z.set(ht,bt),bt};return N.cache=new(mi.Cache||We),N}mi.Cache=We;function Ia(b,C){return b===C||b!==b&&C!==C}function La(b){return F(b)&&Ht.call(b,"callee")&&(!Qr.call(b,"callee")||Se.call(b)==l)}var w=Array.isArray;function L(b){return b!=null&&$t(b.length)&&!K(b)}function F(b){return ke(b)&&L(b)}function K(b){var C=Kt(b)?Se.call(b):"";return C==m||C==g}function $t(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=o}function Kt(b){var C=typeof b;return!!b&&(C=="object"||C=="function")}function ke(b){return!!b&&typeof b=="object"}function ee(b){return typeof b=="symbol"||ke(b)&&Se.call(b)==P}var Na=it?te(it):Oc;function Yn(b){return b==null?"":Oa(b)}function Fa(b,C,N){var W=b==null?void 0:Ui(b,C);return W===void 0?N:W}function Ba(b,C){return b!=null&&Fc(b,C,Tc)}function gi(b){return L(b)?vc(b):Pc(b)}function ls(b,C){var N={};return C=Ea(C),kc(b,function(W,ht,Z){N[C(W,ht,Z)]=W}),N}function Ki(b){return b}function sO(b){return Gi(b)?ct(_n(b)):Wn(b)}e.exports=ls}(Sa,Sa.exports);var mE=Sa.exports;const gE=Ml(mE);var pE=9007199254740991,yE="[object Arguments]",bE="[object Function]",_E="[object GeneratorFunction]",xE="[object Symbol]",wE=typeof ve=="object"&&ve&&ve.Object===Object&&ve,vE=typeof self=="object"&&self&&self.Object===Object&&self,SE=wE||vE||Function("return this")();function kE(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ME(e,t){for(var n=-1,i=e?e.length:0,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function TE(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var ec=Object.prototype,DE=ec.hasOwnProperty,nc=ec.toString,pg=SE.Symbol,CE=ec.propertyIsEnumerable,yg=pg?pg.isConcatSpreadable:void 0,bg=Math.max;function EE(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=AE),r||(r=[]);++s<a;){var o=e[s];n(o)?TE(r,o):r[r.length]=o}return r}function OE(e,t){return e=Object(e),PE(e,t,function(n,i){return i in e})}function PE(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var a=t[i],o=e[a];n(o,a)&&(s[a]=o)}return s}function RE(e,t){return t=bg(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,r=bg(n.length-t,0),s=Array(r);++i<r;)s[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=s,kE(e,this,a)}}function AE(e){return NE(e)||LE(e)||!!(yg&&e&&e[yg])}function IE(e){if(typeof e=="string"||WE(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function LE(e){return BE(e)&&DE.call(e,"callee")&&(!CE.call(e,"callee")||nc.call(e)==yE)}var NE=Array.isArray;function FE(e){return e!=null&&HE(e.length)&&!zE(e)}function BE(e){return _g(e)&&FE(e)}function zE(e){var t=VE(e)?nc.call(e):"";return t==bE||t==_E}function HE(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pE}function VE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function _g(e){return!!e&&typeof e=="object"}function WE(e){return typeof e=="symbol"||_g(e)&&nc.call(e)==xE}var YE=RE(function(e,t){return e==null?{}:OE(e,ME(EE(t),IE))}),$E=YE;const jE=Ml($E);var xg={exports:{}};(function(e,t){(function(n,i){i()})(ve,function(){function n(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,h){var f=new XMLHttpRequest;f.open("GET",c),f.responseType="blob",f.onload=function(){l(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function r(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function s(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 a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ve=="object"&&ve.global===ve?ve:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(c,u,h){var f=a.URL||a.webkitURL,m=document.createElement("a");u=u||c.name||"download",m.download=u,m.rel="noopener",typeof c=="string"?(m.href=c,m.origin===location.origin?s(m):r(m.href)?i(c,u,h):s(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){s(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(n(c,h),u);else if(r(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){s(f)})}}:function(c,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof c=="string")return i(c,u,h);var m=c.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||m&&g||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var k=x.result;k=p?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=k:location=k,f=null},x.readAsDataURL(c)}else{var S=a.URL||a.webkitURL,v=S.createObjectURL(c);f?f.location=v:location.href=v,f=null,setTimeout(function(){S.revokeObjectURL(v)},4e4)}});a.saveAs=l.saveAs=l,e.exports=l})})(xg);var UE=xg.exports,wg={exports:{}};/* @license
|
|
32
|
+
*/process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();var tg;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(tg||(tg={}));const ZD=typeof window<"u";process.env.NODE_ENV!=="production"&&process.env.NODE_ENV,process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();const QD={notAvailable:"N/A"},JD={small:{traffic:"Requests",errorRate:"Error rate",averageLatency:"Avg. latency",p99Latency:"P99 latency"},short:{traffic:"Requests",errorRate:"Error rate",averageLatency:"Average latency",p99Latency:"P99 latency"},long:{traffic:"Number of requests",errorRate:"Average error rate",averageLatency:"Average latency",p99Latency:"P99 latency"}},tC={custom_days:"vs previous {numDays, plural, =1 {day} other {# days}}",custom_hours:"vs previous {numHours, plural, =1 {hour} other {# hours}}",custom_minutes:"vs previous {numMinutes, plural, =1 {minute} other {# minutes}}","15m":"vs previous 15 minutes","1h":"vs previous hour","6h":"vs previous 6 hours","12h":"vs previous 12 hours","24h":"vs previous 24 hours","7d":"vs previous 7 days","30d":"vs previous 30 days",current_week:"vs previous week",current_month:"vs previous month",current_quarter:"vs previous quarter",previous_week:"vs previous time period",previous_month:"vs previous time period",previous_quarter:"vs previous quarter"},eC={general:QD,metricCard:JD,trendRange:tC};function nC(){const e=Qe.createI18n("en-us",eC);return{i18n:e,i18nT:Qe.i18nTComponent(e)}}const iC=2,Ul=["1XX","2XX","3XX","4XX","5XX"],eg=["4XX","5XX"];var ng=(e=>(e.VALIDATING="VALIDATING",e.VALIDATING_HAS_DATA="VALIDATING_HAS_DATA",e.PENDING="PENDING",e.SUCCESS="SUCCESS",e.SUCCESS_HAS_DATA="SUCCESS_HAS_DATA",e.ERROR="ERROR",e.STALE_IF_ERROR="STALE_IF_ERROR",e))(ng||{});const rC=e=>{var t,n,i,r,s;return e?!!((t=Object.keys(e))!=null&&t.length||(n=e.data)!=null&&n.length||(r=(i=e.data)==null?void 0:i.data)!=null&&r.length||!((s=e.data)!=null&&s.data)&&typeof e.data=="object"&&Object.keys(e==null?void 0:e.data).length):!1};function sC(e=d.ref({}),t,n,i=rC){const r=d.ref("PENDING");return d.watchEffect(()=>{const s=i(e.value);if(e.value&&s&&n.value){r.value="VALIDATING_HAS_DATA";return}if(e.value&&n.value){r.value="VALIDATING";return}if(e.value&&t.value){r.value="STALE_IF_ERROR";return}if(e.value===void 0&&!t.value){r.value="PENDING";return}if(e.value&&!t.value&&s){r.value="SUCCESS_HAS_DATA";return}if(e.value&&!t.value){r.value="SUCCESS";return}e.value===void 0&&t&&(r.value="ERROR")}),{state:r,swrvState:ng}}const Bn=Symbol("default"),ql="status_code_grouped",ig=(e,t,n,i,r)=>{e[t][n]||(e[t][n]={}),e[t][n][i]=r};function aC(e,t){var n;const i=((n=e.meta.metric_names)==null?void 0:n[0])||"",r=e.meta.start_ms,s=Object.keys(e.meta.display||{}),a=!!s.find(c=>c===ql),o=s.find(c=>c!==ql);return s.length>2||s.length>1&&!a?(console.error("Don't know how to work with provided dimensions:",s),{previous:{[Bn]:{[Bn]:0}},current:{[Bn]:{[Bn]:0}}}):e.data.reduce((c,l)=>{const u=l.event[i],h=o?l.event[o]:Bn,f=a?l.event[ql]:Bn;return new Date(l.timestamp).getTime()===r&&t?ig(c,"previous",h,f,u):ig(c,"current",h,f,u),c},{previous:{},current:{}})}function oC(e){e.queryReady===void 0&&(e.queryReady=d.computed(()=>!0));const t=d.computed(()=>{var u,h;return{metrics:e.metrics.value,dimensions:[...(u=e.dimensions)!=null&&u.length?[...e.dimensions]:[],...e.withTrend.value?["time"]:[]],granularity:e.withTrend.value?"trend":void 0,...(h=e.filter.value)!=null&&h.length?{filters:e.filter.value}:{},time_range:e.timeRange.value}}),n=d.computed(()=>{var u,h,f,m;if(!((u=e.queryReady)!=null&&u.value))return null;const g=(h=e.filter)!=null&&h.value?JSON.stringify(e.filter.value):"";return`metric-fetcher-${JSON.stringify(e.timeRange.value)}-${(f=e.dimensions)==null?void 0:f.join("-")}-${(m=e.metrics.value)==null?void 0:m.join("-")}-${g}-${e.refreshCounter.value}`}),{response:i,error:r,isValidating:s}=Vi.useRequest(()=>n.value,()=>e.queryFn({datasource:e.datasource.value,query:t.value},e.abortController??new AbortController),{refreshInterval:e.refreshInterval,revalidateOnFocus:!1,errorRetryCount:iC}),{state:a,swrvState:o}=sC(i,r,s),c=d.computed(()=>{var u,h,f,m,g,p,x;return!((h=(u=i.value)==null?void 0:u.data)!=null&&h.length)||!((m=(f=i.value)==null?void 0:f.meta)!=null&&m.display)||!((x=(p=(g=i.value)==null?void 0:g.meta)==null?void 0:p.metric_names)!=null&&x.length)?{current:{},previous:{}}:aC(i.value,e.withTrend.value)}),l=Vi.useTrendRange(e.withTrend,e.timeRange,d.computed(()=>{var u;return(u=i.value)==null?void 0:u.meta}));return{isLoading:d.computed(()=>o.PENDING===a.value),hasError:d.computed(()=>o.ERROR===a.value),raw:i,mapped:c,trendRange:l}}const Bi=(e,t,n=Bn,i)=>(i??[Bn]).reduce((r,s)=>{const a=e[t][n];return a?r+(a[s]||0):r},0);function lC(e){const{cardType:t,title:n,description:i,record:r,hasError:s,increaseIsBad:a,formatValueFn:o,trendRange:c}=e;return d.computed(()=>{let l=0,u=0;if(r!=null&&r.value)try{l=Bi(r.value,"current",e.lookupKey,e.sumGroupedValues),u=Bi(r.value,"previous",e.lookupKey,e.sumGroupedValues)}catch(h){console.error("Metric card data doesn't have the expected structure:",h)}return{cardType:t,hasError:s.value,currentValue:l,previousValue:u,title:n.value,description:i,increaseIsBad:!!a,formatValueFn:o,trendRange:c==null?void 0:c.value}})}function rg(e,t,n){const{i18n:i}=Vi.useI18n(),r=1e3*60,s=r*60,a=s*24,o=(l,u)=>{let h=u-l;e.value&&(h/=2);const f=h/a,m=h/s,g=h/r;return f>=1?i.t("trendRange.custom_days",{numDays:Math.round(f)}):m>=1?i.t("trendRange.custom_hours",{numHours:Math.round(m)}):g>=1?i.t("trendRange.custom_minutes",{numMinutes:Math.round(g)}):i.t("trendRange.custom_days",{numDays:Math.round(f)})},c=()=>{var l,u;if((l=n==null?void 0:n.value)!=null&&l.start_ms&&n.value.end_ms)return{startMs:n.value.start_ms,endMs:n.value.end_ms};if(((u=t==null?void 0:t.value)==null?void 0:u.type)==="absolute"&&t.value.start&&t.value.end)return{startMs:new Date(t.value.start).getTime(),endMs:new Date(t.value.end).getTime()}};return d.computed(()=>{var l,u;if(((l=t==null?void 0:t.value)==null?void 0:l.type)==="relative"&&e.value)return i.t(`trendRange.${t.value.time_range}`);if(e.value||((u=t==null?void 0:t.value)==null?void 0:u.type)==="absolute"){const h=c();if(h)return o(h.startMs,h.endMs)}return""})}var Xl=new WeakMap,sg=0;function cC(e){if(!e.length)return"";for(var t="arg",n=0;n<e.length;++n){var i=void 0;e[n]===null||typeof e[n]!="object"&&typeof e[n]!="function"?typeof e[n]=="string"?i='"'+e[n]+'"':i=String(e[n]):Xl.has(e[n])?i=Xl.get(e[n]):(i=sg,Xl.set(e[n],sg++)),t+="@"+i}return t}function uC(e){if(typeof e=="function")try{e=e()}catch{e=""}return Array.isArray(e)?e=cC(e):e=String(e||""),e}var Gl=function(){function e(t){t===void 0&&(t=0),this.items=new Map,this.ttl=t}return e.prototype.serializeKey=function(t){return uC(t)},e.prototype.get=function(t){var n=this.serializeKey(t);return this.items.get(n)},e.prototype.set=function(t,n,i){var r=this.serializeKey(t),s=i||this.ttl,a=Date.now(),o={data:n,createdAt:a,expiresAt:s?a+s:1/0};this.dispatchExpire(s,o,r),this.items.set(r,o)},e.prototype.dispatchExpire=function(t,n,i){var r=this;t&&setTimeout(function(){var s=Date.now(),a=s>=n.expiresAt;a&&r.delete(i)},t)},e.prototype.delete=function(t){this.items.delete(t)},e}();function dC(){return typeof navigator.onLine<"u"?navigator.onLine:!0}function hC(){return typeof document<"u"&&typeof document.visibilityState<"u"?document.visibilityState!=="hidden":!0}var fC=function(e){return fetch(e).then(function(t){return t.json()})};const Kl={isOnline:dC,isDocumentVisible:hC,fetcher:fC};var hn=function(){return hn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},hn.apply(this,arguments)},zi=function(e,t,n,i){function r(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(u){try{l(i.next(u))}catch(h){a(h)}}function c(u){try{l(i.throw(u))}catch(h){a(h)}}function l(u){u.done?s(u.value):r(u.value).then(o,c)}l((i=i.apply(e,[])).next())})},Hi=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,r,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(l){return function(u){return c([l,u])}}function c(l){if(i)throw new TypeError("Generator is already executing.");for(;n;)try{if(i=1,r&&(s=l[0]&2?r.return:l[0]?r.throw||((s=r.return)&&s.call(r),0):r.next)&&!(s=s.call(r,l[1])).done)return s;switch(r=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,r=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(u){l=[6,u],r=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},mC=function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,s=[],a;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(o){a={error:o}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return s},gC=function(e,t,n){if(arguments.length===2)for(var i=0,r=t.length,s;i<r;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},ag=new Gl,wa=new Gl,Zl=new Gl,og={cache:ag,refreshInterval:0,ttl:0,serverTTL:1e3,dedupingInterval:2e3,revalidateOnFocus:!0,revalidateDebounce:0,shouldRetryOnError:!0,errorRetryInterval:5e3,errorRetryCount:5,fetcher:Kl.fetcher,isOnline:Kl.isOnline,isDocumentVisible:Kl.isDocumentVisible};function pC(e,t,n){var i=wa.get(e);if(i)i.data.push(t);else{var r=5e3;wa.set(e,[t],n>0?n+r:n)}}function yC(e,t,n){if(n.isDocumentVisible()&&!(n.errorRetryCount!==void 0&&t>n.errorRetryCount)){var i=Math.min(t||0,n.errorRetryCount),r=i*n.errorRetryInterval;setTimeout(function(){e(null,{errorRetryCount:i+1,shouldRetryOnError:!0})},r)}}var lg=function(e,t,n,i){return n===void 0&&(n=ag),i===void 0&&(i=og.ttl),zi(void 0,void 0,void 0,function(){var r,s,a,o,c,l,u;return Hi(this,function(h){switch(h.label){case 0:if(!_C(t))return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,t];case 2:return r=h.sent(),[3,4];case 3:return o=h.sent(),s=o,[3,4];case 4:return[3,6];case 5:r=t,h.label=6;case 6:if(a=!1,c={data:r,error:s,isValidating:a},typeof r<"u")try{n.set(e,c,i)}catch(f){console.error("swrv(mutate): failed to set cache",f)}return l=wa.get(e),l&&l.data.length&&(u=l.data.filter(function(f){return f.key===e}),u.forEach(function(f,m){typeof c.data<"u"&&(f.data=c.data),f.error=c.error,f.isValidating=c.isValidating,f.isLoading=c.isValidating;var g=m===u.length-1;g||delete u[m]}),u=u.filter(Boolean)),[2,c]}})})};function bC(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i,r,s=hn({},og),a=!1,o=!1,c=d.getCurrentInstance(),l=(c==null?void 0:c.proxy)||c;if(!l)return console.error("Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function."),null;var u=(l==null?void 0:l.$isServer)||!1;t.length>=1&&(i=t[0]),t.length>=2&&(r=t[1]),t.length>2&&(s=hn(hn({},s),t[2]));var h=u?s.serverTTL:s.ttl,f=typeof i=="function"?i:d.ref(i);typeof r>"u"&&(r=s.fetcher);var m=null;m||(m=d.reactive({data:void 0,error:void 0,isValidating:!0,isLoading:!0,key:null}));var g=function(v,k){return zi(e,void 0,void 0,function(){var D,M,P,E,y,_,T,O=this;return Hi(this,function(A){switch(A.label){case 0:return D=m.data===void 0,M=f.value,M?(P=s.cache.get(M),E=P&&P.data,m.isValidating=!0,m.isLoading=!E,E&&(m.data=E.data,m.error=E.error),y=v||r,!y||!s.isDocumentVisible()&&!D||(k==null?void 0:k.forceRevalidate)!==void 0&&!(k!=null&&k.forceRevalidate)?(m.isValidating=!1,m.isLoading=!1,[2]):P&&(_=!!(Date.now()-P.createdAt>=s.dedupingInterval||k!=null&&k.forceRevalidate),!_)?(m.isValidating=!1,m.isLoading=!1,[2]):(T=function(){return zi(O,void 0,void 0,function(){var I,B,q,G;return Hi(this,function(V){switch(V.label){case 0:return I=Zl.get(M),I?[3,2]:(B=Array.isArray(M)?M:[M],q=y.apply(void 0,gC([],mC(B),!1)),Zl.set(M,q,s.dedupingInterval),[4,lg(M,q,s.cache,h)]);case 1:return V.sent(),[3,4];case 2:return[4,lg(M,I.data,s.cache,h)];case 3:V.sent(),V.label=4;case 4:return m.isValidating=!1,m.isLoading=!1,Zl.delete(M),m.error!==void 0&&(G=!a&&s.shouldRetryOnError&&(k?k.shouldRetryOnError:!0),G&&yC(g,k?k.errorRetryCount:1,s)),[2]}})})},E&&s.revalidateDebounce?(setTimeout(function(){return zi(O,void 0,void 0,function(){return Hi(this,function(I){switch(I.label){case 0:return a?[3,2]:[4,T()];case 1:I.sent(),I.label=2;case 2:return[2]}})})},s.revalidateDebounce),[3,3]):[3,1])):[2];case 1:return[4,T()];case 2:A.sent(),A.label=3;case 3:return[2]}})})},p=function(){return zi(e,void 0,void 0,function(){return Hi(this,function(v){return[2,g(null,{shouldRetryOnError:!1})]})})},x=null;d.onMounted(function(){var v=function(){return zi(e,void 0,void 0,function(){return Hi(this,function(k){switch(k.label){case 0:return!m.error&&s.isOnline()?[4,g()]:[3,2];case 1:return k.sent(),[3,3];case 2:x&&clearTimeout(x),k.label=3;case 3:return s.refreshInterval&&!a&&(x=setTimeout(v,s.refreshInterval)),[2]}})})};s.refreshInterval&&(x=setTimeout(v,s.refreshInterval)),s.revalidateOnFocus&&(document.addEventListener("visibilitychange",p,!1),window.addEventListener("focus",p,!1))}),d.onUnmounted(function(){a=!0,x&&clearTimeout(x),s.revalidateOnFocus&&(document.removeEventListener("visibilitychange",p,!1),window.removeEventListener("focus",p,!1));var v=wa.get(f.value);v&&(v.data=v.data.filter(function(k){return k!==m}))});try{d.watch(f,function(v){d.isReadonly(f)||(f.value=v),m.key=v,m.isValidating=!!v,pC(f.value,m,h),!u&&!o&&f.value&&g(),o=!1},{immediate:!0})}catch{}var S=hn(hn({},d.toRefs(m)),{mutate:function(v,k){return g(v,hn(hn({},k),{forceRevalidate:!0}))}});return S}function _C(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function xC(e,t,n){const{data:i,error:r,isValidating:s,mutate:a}=bC(e,t,{revalidateDebounce:500,revalidateOnFocus:!1,dedupingInterval:100,...n});return{data:d.computed(()=>i.value),response:i,error:r,isValidating:s,revalidate:a}}const Vi={useI18n:nC,useMetricCardBuilder:lC,useMetricFetcher:oC,useTrendRange:rg,useRequest:xC},wC=Symbol("METRICS_PROVIDER_KEY");function vC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cg={exports:{}};(function(e){(function(){function t(l,u){if(u.separator===!1||l<1e3)return l.toString();var h=typeof u.separator=="string"?u.separator:",",f=[],m=Math.round(l).toString().split("");return m.reverse().forEach(function(g,p){p&&p%3===0&&f.push(h),f.push(g)}),f.reverse().join("")}function n(l,u,h){var f=l/u,m=h.round?"round":"floor";return h.decimal===!1?(l=Math[m](f),l.toString()):(h.precision?l=f:l=f<10?Math[m](f*10)/10:Math[m](f),l=l.toString(),typeof h.decimal=="string"&&(l=l.replace(".",h.decimal)),l)}var i=1e3,r=1e4,s=1e6,a=1e9,o=1e12;function c(l,u){var h;u=u||{};var f=l<0;f&&(l=Math.abs(l)),u.precision&&(l=parseFloat(l.toPrecision(u.precision)));var m=u.min10k?r:i;return l<m||u.precision&&u.precision>Math.log10(l)?h=t(n(l,1,u),u):l<s?h=n(l,i,u)+"k":l<a?h=n(l,s,u)+"m":l<o?h=t(n(l,a,u),u)+"b":h=t(n(l,o,u),u)+"t",f&&(h="-"+h),u.capital&&(h=h.toUpperCase()),u.prefix&&(h=u.prefix+h),u.suffix&&(h=h+u.suffix),h}c.addCommas=t,e.exports=c})()})(cg);var SC=cg.exports;const kC=vC(SC);var fn=(e=>(e.GENERIC_COUNT="GenericCount",e.TRAFFIC="Traffic",e.ERROR_RATE="ErrorRate",e.LATENCY="Latency",e))(fn||{}),Ge=(e=>(e.Small="sm",e.Medium="md",e.Large="lg",e.ExtraLarge="xl",e))(Ge||{});const Ql=2,ug=Ql+2,dg=(e,t,n=!1)=>{let i=!t||Number(e.toFixed(ug))===0?0:Number(e.toFixed(ug))>0?1:-1;return n&&(i*=-1),i},hg=(e,t,n)=>t?`${Math.abs(e*100).toFixed(Ql)}%`:n,fg=(e,t)=>t===0?0:e/t-1,mg=(e,t=!1)=>(t&&(e*=-1),e>0?ne.TrendUpIcon:e<0?ne.TrendDownIcon:ne.IndeterminateSmallIcon),MC="#ad000e",Jl="#6c7489",gg="#52596e",TC="#007d60",va="16px",DC="20px",CC={key:0,class:"metricscard-description"},EC={class:"metricscard-valuetrend"},OC={key:0,class:"metricscard-error"},PC={key:2,class:"metricscard-trend"},RC={"data-testid":"metric-trend-change"},AC={key:0,class:"metricscard-trend-range"},IC=d.defineComponent({__name:"MetricsCard",props:{cardType:{type:String,required:!0,default:fn.GENERIC_COUNT},title:{type:String,default:"0%",required:!0},description:{type:String,default:"",required:!1},tooltip:{type:String,required:!1,default:""},timeframe:{type:String,required:!1,default:""},metricValue:{type:String,default:""},metricChange:{type:String,required:!0},changePolarity:{type:Number,required:!0},trendIcon:{type:Object,default:ne.IndeterminateSmallIcon},trendRange:{type:String,default:""},hasError:{type:Boolean,default:!1},errorMessage:{type:String,default:"Vitals data error"},cardSize:{type:String,required:!1,default:()=>Ge.Large},hasContainerTitle:{type:Boolean,required:!1,default:!1},titleTag:{type:String,default:"span"}},setup(e){const t=new Map([[fn.GENERIC_COUNT,ne.VitalsIcon],[fn.TRAFFIC,ne.CloudUploadIcon],[fn.ERROR_RATE,ne.WarningOutlineIcon],[fn.LATENCY,ne.ResponseIcon]]),n=e,i=o=>{const c={red:`var(--kui-color-text-danger-strong, ${MC})`,green:`var(--kui-color-text-success, ${TC})`,grey:`var(--kui-color-text-neutral-strong, ${gg})`};return o>0?c.green:o<0?c.red:c.grey},r=o=>o>0?"positive":o<0?"negative":"neutral",s=[Ge.Medium,Ge.Large].includes(n.cardSize),a=[Ge.Small].includes(n.cardSize);return(o,c)=>{const l=d.resolveComponent("KTooltip");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["metricscard",e.cardSize])},[d.createElementVNode("div",{class:d.normalizeClass(["metricscard-title",e.cardSize])},[d.unref(a)?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(t).get(e.cardType)),{key:0,class:"metricscard-icon",color:`var(--kui-color-text-neutral, ${d.unref(Jl)})`,size:d.unref(va)},null,8,["color","size"])),(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.titleTag),null,{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(e.title),1)]),_:1})),e.tooltip?(d.openBlock(),d.createBlock(l,{key:1,class:"metricscard-tooltip",placement:"right",text:e.tooltip},{default:d.withCtx(()=>[d.createVNode(d.unref(ne.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Jl)})`,size:d.unref(va)},null,8,["color","size"])]),_:1},8,["text"])):d.createCommentVNode("",!0)],2),e.description&&d.unref(s)?(d.openBlock(),d.createElementBlock("div",CC,[d.createElementVNode("span",null,d.toDisplayString(e.description),1)])):d.createCommentVNode("",!0),d.createElementVNode("div",EC,[e.hasError?(d.openBlock(),d.createElementBlock("div",OC,[d.createVNode(d.unref(ne.WarningIcon),{color:`var(--kui-color-text-neutral, ${d.unref(Jl)})`,size:d.unref(DC)},null,8,["color","size"]),d.createElementVNode("div",null," "+d.toDisplayString(e.errorMessage),1)])):(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(["metricscard-value",e.cardSize]),"data-testid":"metric-value"},d.toDisplayString(e.metricValue),3)),d.unref(s)?(d.openBlock(),d.createElementBlock("div",PC,[d.createElementVNode("div",{class:d.normalizeClass(["metricscard-trend-change",r(e.changePolarity)]),"data-testid":"metric-trend-parent"},[e.changePolarity!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.trendIcon),{key:0,color:i(e.changePolarity),size:d.unref(va)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(ne.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(gg)})`,size:d.unref(va)},null,8,["color","size"])),d.createElementVNode("div",RC,d.toDisplayString(e.metricChange),1)],2),e.trendRange?(d.openBlock(),d.createElementBlock("div",AC,d.toDisplayString(e.trendRange),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])],2)}}}),tc=(e,t)=>{const n=e.__vccOpts||e;for(const[i,r]of t)n[i]=r;return n},LC=tc(IC,[["__scopeId","data-v-b1513f6f"]]),NC={},FC={class:"loading-tabs"};function BC(e,t){const n=d.resolveComponent("KSkeletonBox");return d.openBlock(),d.createElementBlock("div",FC,[d.createVNode(n,{width:"100"}),d.createVNode(n,{width:"75"})])}const zC=tc(NC,[["render",BC],["__scopeId","data-v-9c7113d7"]]),HC={key:0,class:"container-title"},VC={key:0,class:"container-description"},WC={key:1,class:"error-display"},YC={key:0,class:"error-display-message"},$C={key:2,class:"cards-wrapper"},jC=d.defineComponent({__name:"MetricCardContainer",props:{fallbackDisplayText:{type:String,required:!0},cards:{type:Array,required:!0},errorMessage:{type:String,required:!1,default:""},loading:{type:Boolean,required:!1,default:!1},hasTrendAccess:{type:Boolean,required:!1,default:!0},cardSize:{type:String,required:!1,default:()=>Ge.Large},containerTitle:{type:String,required:!1,default:""},containerDescription:{type:String,required:!1,default:""}},setup(e){const t=e,n=d.computed(()=>t.cards.every(r=>(r==null?void 0:r.hasError)===!0)),i=r=>{const s=fg(r.currentValue,r.previousValue)||0,a=dg(s,t.hasTrendAccess,r.increaseIsBad);return{metricValue:r.formatValueFn?r.formatValueFn(r.currentValue):kC(r.currentValue,{capital:!0,round:!0})||"0",metricChange:r.formatChangeFn?r.formatChangeFn(s):hg(s,t.hasTrendAccess,t.fallbackDisplayText),changePolarity:a,trendIcon:mg(a,r.increaseIsBad),cardSize:t.cardSize,hasContainerTitle:!!t.containerTitle}};return(r,s)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["kong-ui-public-metric-card-container",e.cardSize])},[t.containerTitle||t.containerDescription?(d.openBlock(),d.createElementBlock("div",HC,[d.createTextVNode(d.toDisplayString(t.containerTitle)+" ",1),t.containerDescription?(d.openBlock(),d.createElementBlock("div",VC,d.toDisplayString(t.containerDescription),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),n.value?(d.openBlock(),d.createElementBlock("div",WC,[d.createVNode(d.unref(ne.WarningIcon),{class:"error-display-icon"}),e.errorMessage?(d.openBlock(),d.createElementBlock("div",YC,d.toDisplayString(e.errorMessage),1)):d.createCommentVNode("",!0)])):(d.openBlock(),d.createElementBlock("div",$C,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.cards,(a,o)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[e.loading?(d.openBlock(),d.createElementBlock("div",{key:`skeleton-${o}`,class:"loading-tab"},[d.createVNode(zC,{class:d.normalizeClass(e.cardSize===d.unref(Ge).Small?"loading-tabs-small":"loading-tabs-large")},null,8,["class"])])):(d.openBlock(),d.createBlock(LC,d.mergeProps({key:o},{ref_for:!0},i(a),{"card-size":e.cardSize,"card-type":a.cardType,description:a.description,"error-message":e.errorMessage,"has-error":a.hasError,title:a.title,"title-tag":a.titleTag,tooltip:a.tooltip,"trend-range":a.trendRange}),null,16,["card-size","card-type","description","error-message","has-error","title","title-tag","tooltip","trend-range"]))],64))),256))]))],2))}}),UC=tc(jC,[["__scopeId","data-v-7080ba56"]]);Ge.Large;const qC={key:1,class:"single-value-wrapper"},XC={class:"single-value","data-testid":"single-value-chart"},GC={key:0,class:"single-value-unit"},KC={key:1,class:"single-value-trend"},ZC={key:0,class:"single-value-trend-range"},QC=Ee(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:$f},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(e){const{i18n:t}=pt.useI18n(),{formatBytes:n}=Br({i18n:t}),i=e,r={left:"flex-start",center:"center",right:"flex-end",between:"space-between",around:"space-around",evenly:"space-evenly"},s=d.ref(i.leftAlign?"left":i.alignX),a=d.computed(()=>i.data.data),o=d.computed(()=>{var M,P;return(P=(M=i.data.meta)==null?void 0:M.metric_names)==null?void 0:P[0]}),c=d.computed(()=>{var P,E;const M=o.value?(E=(P=i.data.meta)==null?void 0:P.metric_units)==null?void 0:E[o.value]:void 0;if(M)return t.t(`chartUnits.${M}`,{plural:""})}),l=d.computed(()=>{var M;return o.value==="request_per_minute"||!!((M=o.value)!=null&&M.includes("_latency_"))}),u=d.computed(()=>!i.showTrend||a.value.length<2||!o.value?null:a.value[0].event[o.value]??null),h=d.computed(()=>{if(!o.value)return null;const M=i.showTrend?1:0;return a.value.length<=M?null:a.value[M].event[o.value]??null}),f=d.computed(()=>{var E;const M=h.value;if(M===null)return"";if((E=o.value)!=null&&E.includes("_size_"))return n(M);if(M>=1e9){const y=(M/1e9).toFixed(1);return y.endsWith(".0")?`${Math.floor(M/1e9)}B`:`${y}B`}if(M>=1e7){const y=(M/1e6).toFixed(1);return y.endsWith(".0")?`${Math.floor(M/1e6)}M`:`${y}M`}const P=i.decimalPoints&&typeof i.decimalPoints=="number"?i.decimalPoints:$f;return M.toLocaleString("en-US",{maximumFractionDigits:P})}),m=d.computed(()=>fg(h.value??0,u.value??0)||0),g=d.computed(()=>dg(m.value,!0,i.increaseIsBad)),p=d.computed(()=>mg(g.value)),x=d.computed(()=>hg(m.value,!0,t.t("singleValue.trend.not_available"))),S=d.computed(()=>({justifyContent:r[s.value]??"space-evenly"})),v=rg(d.computed(()=>i.showTrend),void 0,d.computed(()=>i.data.meta)),k=M=>M>0?"positive":M<0?"negative":"neutral",D=M=>M>0?MS:M<0?kS:yf;return d.onMounted(()=>{var M,P,E,y;!i.showTrend&&((P=(M=i.data)==null?void 0:M.data)==null?void 0:P.length)>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",i.data.data.length):i.showTrend&&((y=(E=i.data)==null?void 0:E.data)==null?void 0:y.length)!==2&&console.warn("SingleValue with trend expects exactly 2 data points. Data length:",i.data.data.length)}),d.watch(d.toRef(i,"alignX"),M=>{M&&(s.value=M)}),(M,P)=>{const E=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:"chart-parent","data-testid":"single-value-parent",style:d.normalizeStyle(S.value)},[h.value===null?(d.openBlock(),d.createBlock(E,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:d.unref(t).t("singleValue.valueError")},null,8,["title"])):(d.openBlock(),d.createElementBlock("div",qC,[d.createElementVNode("span",XC,d.toDisplayString(f.value),1),l.value?(d.openBlock(),d.createElementBlock("span",GC," "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0),e.showTrend?(d.openBlock(),d.createElementBlock("div",KC,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",k(g.value)]),"data-testid":"single-value-trend"},[g.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(p.value),{key:0,color:D(g.value),size:d.unref(zr)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(ne.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(yf)})`,size:d.unref(zr)},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(x.value),1)],2),d.unref(v)?(d.openBlock(),d.createElementBlock("div",ZC,d.toDisplayString(d.unref(v)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],4)}}}),[["__scopeId","data-v-4b062a7d"]]),JC={class:"simple-chart-shell"},tE={key:1,class:"analytics-chart-parent"},eE=Ee(d.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:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.computed(()=>{var u;const l=pt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||un},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(l==null||l.datasets.reverse()),l}),r=d.computed(()=>{var l;return(l=t.chartData.meta)!=null&&l.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),s=d.computed(()=>t.chartOptions.type==="gauge"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=d.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),c=d.computed(()=>{var u,h;const l=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const f=(h=(u=t.chartData.meta)==null?void 0:u.metric_names)==null?void 0:h[0];return t.chartOptions.showTrend?l&&t.chartData.data.length>=2&&t.chartData.data[1].event[f]!==null:l&&t.chartData.data[0].event[f]!==null}return l});return(l,u)=>{const h=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",JC,[c.value?(d.openBlock(),d.createElementBlock("div",tE,[s.value?(d.openBlock(),d.createBlock(KD,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":r.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),a.value?(d.openBlock(),d.createBlock(QC,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(o.value),1)]),_:1}))])}}}),[["__scopeId","data-v-56837d34"]]),nE={class:"top-n-card-title","data-testid":"top-n-card-title"},iE={class:"top-n-card-description","data-testid":"top-n-card-description"},rE={key:3,class:"top-n-table","data-testid":"top-n-table"},sE={class:"table-headings"},aE={class:"table-row"},oE={class:"column-1"},lE={class:"column-2"},cE={class:"table-body","data-testid":"top-n-data"},uE=["data-testid"],dE={class:"column-1"},hE={class:"column-2"},fE=Ee(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=pt.useI18n(),i=d.computed(()=>t.data.data),r=d.computed(()=>{var g;return!!((g=i.value)!=null&&g.length)}),s=d.computed(()=>{var g,p;return(g=t.data.meta)!=null&&g.display&&((p=Object.keys(t.data.meta.display))==null?void 0:p[0])||""}),a=d.computed(()=>s.value?t.data.meta.display[s.value]:{}),o=d.computed(()=>{var g,p;return(p=(g=t.data.meta)==null?void 0:g.metric_names)!=null&&p.length?t.data.meta.metric_names[0]:""}),c=d.computed(()=>o.value?n.t(`chartLabels.${o.value}`)||o.value:""),l=d.computed(()=>{if(!r.value)return"";if(t.data.meta){if(a.value&&!Object.keys(a.value).length)return n.t("topNTable.errors.display");if(!o.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),u=g=>{const p=g.event;return String(p[s.value])},h=g=>{const p=u(g),x=a.value&&a.value[p];return x?x.name:"-"},f=g=>{const p=u(g),x=a.value&&a.value[p];return x?!!x.deleted:!1},m=g=>{if(!o.value)return"–";const x=g.event[o.value];return x?Yr(x,{capital:!0,round:!0}):"–"};return(g,p)=>{const x=d.resolveComponent("KEmptyState"),S=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(v,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},d.createSlots({default:d.withCtx(()=>[l.value?(d.openBlock(),d.createBlock(x,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(l.value),1)]),_:1})):e.isLoading?(d.openBlock(),d.createBlock(S,{key:1,"table-columns":2,type:"table"})):r.value?(d.openBlock(),d.createElementBlock("div",rE,[d.createElementVNode("div",sE,[d.createElementVNode("div",aE,[d.createElementVNode("div",oE,d.toDisplayString(d.unref(n).t("topNTable.nameLabel")),1),d.createElementVNode("div",lE,d.toDisplayString(c.value),1)])]),d.createElementVNode("div",cE,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(k,D)=>(d.openBlock(),d.createElementBlock("div",{key:`entry-${D}`,class:"table-row","data-testid":`row-${u(k)}`},[d.createElementVNode("div",dE,[d.renderSlot(g.$slots,"name",{record:{id:u(k),name:h(k),deleted:f(k),dimension:s.value}},()=>[d.createTextVNode(d.toDisplayString(h(k)),1)],!0)]),d.createElementVNode("div",hE," "+d.toDisplayString(m(k)),1)],8,uE))),128))])])):(d.openBlock(),d.createBlock(x,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(e.emptyStateTitle||d.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",nE,d.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",iE,d.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-665e7735"]]);var Sa={exports:{}};Sa.exports,function(e,t){var n=200,i="Expected a function",r="__lodash_hash_undefined__",s=1,a=2,o=9007199254740991,c="[object Arguments]",l="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",g="[object GeneratorFunction]",p="[object Map]",x="[object Number]",S="[object Object]",v="[object Promise]",k="[object RegExp]",D="[object Set]",M="[object String]",P="[object Symbol]",E="[object WeakMap]",y="[object ArrayBuffer]",_="[object DataView]",T="[object Float32Array]",O="[object Float64Array]",A="[object Int8Array]",I="[object Int16Array]",B="[object Int32Array]",q="[object Uint8Array]",G="[object Uint8ClampedArray]",V="[object Uint16Array]",lt="[object Uint32Array]",X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,H=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,xt=/\\(\\)?/g,yt=/^\[object .+?Constructor\]$/,vt=/^(?:0|[1-9]\d*)$/,mt={};mt[T]=mt[O]=mt[A]=mt[I]=mt[B]=mt[q]=mt[G]=mt[V]=mt[lt]=!0,mt[c]=mt[l]=mt[y]=mt[u]=mt[_]=mt[h]=mt[f]=mt[m]=mt[p]=mt[x]=mt[S]=mt[k]=mt[D]=mt[M]=mt[E]=!1;var gt=typeof ve=="object"&&ve&&ve.Object===Object&&ve,z=typeof self=="object"&&self&&self.Object===Object&&self,j=gt||z||Function("return this")(),$=t&&!t.nodeType&&t,J=$&&!0&&e&&!e.nodeType&&e,et=J&&J.exports===$,nt=et&>.process,rt=function(){try{return nt&&nt.binding("util")}catch{}}(),it=rt&&rt.isTypedArray;function _t(b,C){for(var N=-1,W=b?b.length:0;++N<W;)if(C(b[N],N,b))return!0;return!1}function ct(b){return function(C){return C==null?void 0:C[b]}}function Et(b,C){for(var N=-1,W=Array(b);++N<b;)W[N]=C(N);return W}function te(b){return function(C){return b(C)}}function ce(b,C){return b==null?void 0:b[C]}function qt(b){var C=!1;if(b!=null&&typeof b.toString!="function")try{C=!!(b+"")}catch{}return C}function Ie(b){var C=-1,N=Array(b.size);return b.forEach(function(W,ht){N[++C]=[ht,W]}),N}function St(b,C){return function(N){return b(C(N))}}function Xt(b){var C=-1,N=Array(b.size);return b.forEach(function(W){N[++C]=W}),N}var zt=Array.prototype,Gt=Function.prototype,re=Object.prototype,Ke=j["__core-js_shared__"],ci=function(){var b=/[^.]+$/.exec(Ke&&Ke.keys&&Ke.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),ze=Gt.toString,Ht=re.hasOwnProperty,Se=re.toString,ui=RegExp("^"+ze.call(Ht).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ka=j.Symbol,Ma=j.Uint8Array,Qr=re.propertyIsEnumerable,di=zt.splice,Jr=St(Object.keys,Object),hi=bn(j,"DataView"),mn=bn(j,"Map"),gn=bn(j,"Promise"),ts=bn(j,"Set"),es=bn(j,"WeakMap"),fi=bn(Object,"create"),ic=xn(hi),rc=xn(mn),Ta=xn(gn),Da=xn(ts),pn=xn(es),Wi=ka?ka.prototype:void 0,ns=Wi?Wi.valueOf:void 0,Ca=Wi?Wi.toString:void 0;function yn(b){var C=-1,N=b?b.length:0;for(this.clear();++C<N;){var W=b[C];this.set(W[0],W[1])}}function sc(){this.__data__=fi?fi(null):{}}function He(b){return this.has(b)&&delete this.__data__[b]}function ac(b){var C=this.__data__;if(fi){var N=C[b];return N===r?void 0:N}return Ht.call(C,b)?C[b]:void 0}function oc(b){var C=this.__data__;return fi?C[b]!==void 0:Ht.call(C,b)}function lc(b,C){var N=this.__data__;return N[b]=fi&&C===void 0?r:C,this}yn.prototype.clear=sc,yn.prototype.delete=He,yn.prototype.get=ac,yn.prototype.has=oc,yn.prototype.set=lc;function Ve(b){var C=-1,N=b?b.length:0;for(this.clear();++C<N;){var W=b[C];this.set(W[0],W[1])}}function cc(){this.__data__=[]}function Hn(b){var C=this.__data__,N=ji(C,b);if(N<0)return!1;var W=C.length-1;return N==W?C.pop():di.call(C,N,1),!0}function uc(b){var C=this.__data__,N=ji(C,b);return N<0?void 0:C[N][1]}function dc(b){return ji(this.__data__,b)>-1}function hc(b,C){var N=this.__data__,W=ji(N,b);return W<0?N.push([b,C]):N[W][1]=C,this}Ve.prototype.clear=cc,Ve.prototype.delete=Hn,Ve.prototype.get=uc,Ve.prototype.has=dc,Ve.prototype.set=hc;function We(b){var C=-1,N=b?b.length:0;for(this.clear();++C<N;){var W=b[C];this.set(W[0],W[1])}}function fc(){this.__data__={hash:new yn,map:new(mn||Ve),string:new yn}}function Vn(b){return Xi(this,b).delete(b)}function mc(b){return Xi(this,b).get(b)}function gc(b){return Xi(this,b).has(b)}function pc(b,C){return Xi(this,b).set(b,C),this}We.prototype.clear=fc,We.prototype.delete=Vn,We.prototype.get=mc,We.prototype.has=gc,We.prototype.set=pc;function Yi(b){var C=-1,N=b?b.length:0;for(this.__data__=new We;++C<N;)this.add(b[C])}function yc(b){return this.__data__.set(b,r),this}function bc(b){return this.__data__.has(b)}Yi.prototype.add=Yi.prototype.push=yc,Yi.prototype.has=bc;function Le(b){this.__data__=new Ve(b)}function $i(){this.__data__=new Ve}function _c(b){return this.__data__.delete(b)}function is(b){return this.__data__.get(b)}function xc(b){return this.__data__.has(b)}function wc(b,C){var N=this.__data__;if(N instanceof Ve){var W=N.__data__;if(!mn||W.length<n-1)return W.push([b,C]),this;N=this.__data__=new We(W)}return N.set(b,C),this}Le.prototype.clear=$i,Le.prototype.delete=_c,Le.prototype.get=is,Le.prototype.has=xc,Le.prototype.set=wc;function vc(b,C){var N=w(b)||La(b)?Et(b.length,String):[],W=N.length,ht=!!W;for(var Z in b)Ht.call(b,Z)&&!(ht&&(Z=="length"||ss(Z,W)))&&N.push(Z);return N}function ji(b,C){for(var N=b.length;N--;)if(Ia(b[N][0],C))return N;return-1}var Sc=Ac();function kc(b,C){return b&&Sc(b,C,gi)}function Ui(b,C){C=Gi(C,b)?[C]:Ze(C);for(var N=0,W=C.length;b!=null&&N<W;)b=b[_n(C[N++])];return N&&N==W?b:void 0}function Mc(b){return Se.call(b)}function Tc(b,C){return b!=null&&C in Object(b)}function rs(b,C,N,W,ht){return b===C?!0:b==null||C==null||!Kt(b)&&!ke(C)?b!==b&&C!==C:Dc(b,C,rs,N,W,ht)}function Dc(b,C,N,W,ht,Z){var bt=w(b),Zt=w(C),Vt=l,de=l;bt||(Vt=ue(b),Vt=Vt==c?S:Vt),Zt||(de=ue(C),de=de==c?S:de);var Me=Vt==S&&!qt(b),Te=de==S&&!qt(C),pe=Vt==de;if(pe&&!Me)return Z||(Z=new Le),bt||Na(b)?Pa(b,C,N,W,ht,Z):Ic(b,C,Vt,N,W,ht,Z);if(!(ht&a)){var Ne=Me&&Ht.call(b,"__wrapped__"),Fe=Te&&Ht.call(C,"__wrapped__");if(Ne||Fe){var $n=Ne?b.value():b,wn=Fe?C.value():C;return Z||(Z=new Le),N($n,wn,W,ht,Z)}}return pe?(Z||(Z=new Le),Lc(b,C,N,W,ht,Z)):!1}function Cc(b,C,N,W){var ht=N.length,Z=ht;if(b==null)return!Z;for(b=Object(b);ht--;){var bt=N[ht];if(bt[2]?bt[1]!==b[bt[0]]:!(bt[0]in b))return!1}for(;++ht<Z;){bt=N[ht];var Zt=bt[0],Vt=b[Zt],de=bt[1];if(bt[2]){if(Vt===void 0&&!(Zt in b))return!1}else{var Me=new Le,Te;if(!(Te===void 0?rs(de,Vt,W,s|a,Me):Te))return!1}}return!0}function Ec(b){if(!Kt(b)||Ra(b))return!1;var C=K(b)||qt(b)?ui:yt;return C.test(xn(b))}function Oc(b){return ke(b)&&$t(b.length)&&!!mt[Se.call(b)]}function Ea(b){return typeof b=="function"?b:b==null?Ki:typeof b=="object"?w(b)?qi(b[0],b[1]):Rc(b):sO(b)}function Pc(b){if(!Bc(b))return Jr(b);var C=[];for(var N in Object(b))Ht.call(b,N)&&N!="constructor"&&C.push(N);return C}function Rc(b){var C=Nc(b);return C.length==1&&C[0][2]?os(C[0][0],C[0][1]):function(N){return N===b||Cc(N,b,C)}}function qi(b,C){return Gi(b)&&Aa(C)?os(_n(b),C):function(N){var W=Fa(N,b);return W===void 0&&W===C?Ba(N,b):rs(C,W,void 0,s|a)}}function Wn(b){return function(C){return Ui(C,b)}}function Oa(b){if(typeof b=="string")return b;if(ee(b))return Ca?Ca.call(b):"";var C=b+"";return C=="0"&&1/b==-1/0?"-0":C}function Ze(b){return w(b)?b:zc(b)}function Ac(b){return function(C,N,W){for(var ht=-1,Z=Object(C),bt=W(C),Zt=bt.length;Zt--;){var Vt=bt[++ht];if(N(Z[Vt],Vt,Z)===!1)break}return C}}function Pa(b,C,N,W,ht,Z){var bt=ht&a,Zt=b.length,Vt=C.length;if(Zt!=Vt&&!(bt&&Vt>Zt))return!1;var de=Z.get(b);if(de&&Z.get(C))return de==C;var Me=-1,Te=!0,pe=ht&s?new Yi:void 0;for(Z.set(b,C),Z.set(C,b);++Me<Zt;){var Ne=b[Me],Fe=C[Me];if(W)var $n=bt?W(Fe,Ne,Me,C,b,Z):W(Ne,Fe,Me,b,C,Z);if($n!==void 0){if($n)continue;Te=!1;break}if(pe){if(!_t(C,function(wn,pi){if(!pe.has(pi)&&(Ne===wn||N(Ne,wn,W,ht,Z)))return pe.add(pi)})){Te=!1;break}}else if(!(Ne===Fe||N(Ne,Fe,W,ht,Z))){Te=!1;break}}return Z.delete(b),Z.delete(C),Te}function Ic(b,C,N,W,ht,Z,bt){switch(N){case _:if(b.byteLength!=C.byteLength||b.byteOffset!=C.byteOffset)return!1;b=b.buffer,C=C.buffer;case y:return!(b.byteLength!=C.byteLength||!W(new Ma(b),new Ma(C)));case u:case h:case x:return Ia(+b,+C);case f:return b.name==C.name&&b.message==C.message;case k:case M:return b==C+"";case p:var Zt=Ie;case D:var Vt=Z&a;if(Zt||(Zt=Xt),b.size!=C.size&&!Vt)return!1;var de=bt.get(b);if(de)return de==C;Z|=s,bt.set(b,C);var Me=Pa(Zt(b),Zt(C),W,ht,Z,bt);return bt.delete(b),Me;case P:if(ns)return ns.call(b)==ns.call(C)}return!1}function Lc(b,C,N,W,ht,Z){var bt=ht&a,Zt=gi(b),Vt=Zt.length,de=gi(C),Me=de.length;if(Vt!=Me&&!bt)return!1;for(var Te=Vt;Te--;){var pe=Zt[Te];if(!(bt?pe in C:Ht.call(C,pe)))return!1}var Ne=Z.get(b);if(Ne&&Z.get(C))return Ne==C;var Fe=!0;Z.set(b,C),Z.set(C,b);for(var $n=bt;++Te<Vt;){pe=Zt[Te];var wn=b[pe],pi=C[pe];if(W)var Sg=bt?W(pi,wn,pe,C,b,Z):W(wn,pi,pe,b,C,Z);if(!(Sg===void 0?wn===pi||N(wn,pi,W,ht,Z):Sg)){Fe=!1;break}$n||($n=pe=="constructor")}if(Fe&&!$n){var za=b.constructor,Ha=C.constructor;za!=Ha&&"constructor"in b&&"constructor"in C&&!(typeof za=="function"&&za instanceof za&&typeof Ha=="function"&&Ha instanceof Ha)&&(Fe=!1)}return Z.delete(b),Z.delete(C),Fe}function Xi(b,C){var N=b.__data__;return as(C)?N[typeof C=="string"?"string":"hash"]:N.map}function Nc(b){for(var C=gi(b),N=C.length;N--;){var W=C[N],ht=b[W];C[N]=[W,ht,Aa(ht)]}return C}function bn(b,C){var N=ce(b,C);return Ec(N)?N:void 0}var ue=Mc;(hi&&ue(new hi(new ArrayBuffer(1)))!=_||mn&&ue(new mn)!=p||gn&&ue(gn.resolve())!=v||ts&&ue(new ts)!=D||es&&ue(new es)!=E)&&(ue=function(b){var C=Se.call(b),N=C==S?b.constructor:void 0,W=N?xn(N):void 0;if(W)switch(W){case ic:return _;case rc:return p;case Ta:return v;case Da:return D;case pn:return E}return C});function Fc(b,C,N){C=Gi(C,b)?[C]:Ze(C);for(var W,ht=-1,bt=C.length;++ht<bt;){var Z=_n(C[ht]);if(!(W=b!=null&&N(b,Z)))break;b=b[Z]}if(W)return W;var bt=b?b.length:0;return!!bt&&$t(bt)&&ss(Z,bt)&&(w(b)||La(b))}function ss(b,C){return C=C??o,!!C&&(typeof b=="number"||vt.test(b))&&b>-1&&b%1==0&&b<C}function Gi(b,C){if(w(b))return!1;var N=typeof b;return N=="number"||N=="symbol"||N=="boolean"||b==null||ee(b)?!0:Q.test(b)||!X.test(b)||C!=null&&b in Object(C)}function as(b){var C=typeof b;return C=="string"||C=="number"||C=="symbol"||C=="boolean"?b!=="__proto__":b===null}function Ra(b){return!!ci&&ci in b}function Bc(b){var C=b&&b.constructor,N=typeof C=="function"&&C.prototype||re;return b===N}function Aa(b){return b===b&&!Kt(b)}function os(b,C){return function(N){return N==null?!1:N[b]===C&&(C!==void 0||b in Object(N))}}var zc=mi(function(b){b=Yn(b);var C=[];return H.test(b)&&C.push(""),b.replace(U,function(N,W,ht,Z){C.push(ht?Z.replace(xt,"$1"):W||N)}),C});function _n(b){if(typeof b=="string"||ee(b))return b;var C=b+"";return C=="0"&&1/b==-1/0?"-0":C}function xn(b){if(b!=null){try{return ze.call(b)}catch{}try{return b+""}catch{}}return""}function mi(b,C){if(typeof b!="function"||C&&typeof C!="function")throw new TypeError(i);var N=function(){var W=arguments,ht=C?C.apply(this,W):W[0],Z=N.cache;if(Z.has(ht))return Z.get(ht);var bt=b.apply(this,W);return N.cache=Z.set(ht,bt),bt};return N.cache=new(mi.Cache||We),N}mi.Cache=We;function Ia(b,C){return b===C||b!==b&&C!==C}function La(b){return F(b)&&Ht.call(b,"callee")&&(!Qr.call(b,"callee")||Se.call(b)==c)}var w=Array.isArray;function L(b){return b!=null&&$t(b.length)&&!K(b)}function F(b){return ke(b)&&L(b)}function K(b){var C=Kt(b)?Se.call(b):"";return C==m||C==g}function $t(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=o}function Kt(b){var C=typeof b;return!!b&&(C=="object"||C=="function")}function ke(b){return!!b&&typeof b=="object"}function ee(b){return typeof b=="symbol"||ke(b)&&Se.call(b)==P}var Na=it?te(it):Oc;function Yn(b){return b==null?"":Oa(b)}function Fa(b,C,N){var W=b==null?void 0:Ui(b,C);return W===void 0?N:W}function Ba(b,C){return b!=null&&Fc(b,C,Tc)}function gi(b){return L(b)?vc(b):Pc(b)}function ls(b,C){var N={};return C=Ea(C),kc(b,function(W,ht,Z){N[C(W,ht,Z)]=W}),N}function Ki(b){return b}function sO(b){return Gi(b)?ct(_n(b)):Wn(b)}e.exports=ls}(Sa,Sa.exports);var mE=Sa.exports;const gE=Ml(mE);var pE=9007199254740991,yE="[object Arguments]",bE="[object Function]",_E="[object GeneratorFunction]",xE="[object Symbol]",wE=typeof ve=="object"&&ve&&ve.Object===Object&&ve,vE=typeof self=="object"&&self&&self.Object===Object&&self,SE=wE||vE||Function("return this")();function kE(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function ME(e,t){for(var n=-1,i=e?e.length:0,r=Array(i);++n<i;)r[n]=t(e[n],n,e);return r}function TE(e,t){for(var n=-1,i=t.length,r=e.length;++n<i;)e[r+n]=t[n];return e}var ec=Object.prototype,DE=ec.hasOwnProperty,nc=ec.toString,pg=SE.Symbol,CE=ec.propertyIsEnumerable,yg=pg?pg.isConcatSpreadable:void 0,bg=Math.max;function EE(e,t,n,i,r){var s=-1,a=e.length;for(n||(n=AE),r||(r=[]);++s<a;){var o=e[s];n(o)?TE(r,o):r[r.length]=o}return r}function OE(e,t){return e=Object(e),PE(e,t,function(n,i){return i in e})}function PE(e,t,n){for(var i=-1,r=t.length,s={};++i<r;){var a=t[i],o=e[a];n(o,a)&&(s[a]=o)}return s}function RE(e,t){return t=bg(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,r=bg(n.length-t,0),s=Array(r);++i<r;)s[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=s,kE(e,this,a)}}function AE(e){return NE(e)||LE(e)||!!(yg&&e&&e[yg])}function IE(e){if(typeof e=="string"||WE(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function LE(e){return BE(e)&&DE.call(e,"callee")&&(!CE.call(e,"callee")||nc.call(e)==yE)}var NE=Array.isArray;function FE(e){return e!=null&&HE(e.length)&&!zE(e)}function BE(e){return _g(e)&&FE(e)}function zE(e){var t=VE(e)?nc.call(e):"";return t==bE||t==_E}function HE(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=pE}function VE(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function _g(e){return!!e&&typeof e=="object"}function WE(e){return typeof e=="symbol"||_g(e)&&nc.call(e)==xE}var YE=RE(function(e,t){return e==null?{}:OE(e,ME(EE(t),IE))}),$E=YE;const jE=Ml($E);var xg={exports:{}};(function(e,t){(function(n,i){i()})(ve,function(){function n(l,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(l.type)?new Blob(["\uFEFF",l],{type:l.type}):l}function i(l,u,h){var f=new XMLHttpRequest;f.open("GET",l),f.responseType="blob",f.onload=function(){c(f.response,u,h)},f.onerror=function(){console.error("could not download file")},f.send()}function r(l){var u=new XMLHttpRequest;u.open("HEAD",l,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function s(l){try{l.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),l.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ve=="object"&&ve.global===ve?ve:void 0,o=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!o?function(l,u,h){var f=a.URL||a.webkitURL,m=document.createElement("a");u=u||l.name||"download",m.download=u,m.rel="noopener",typeof l=="string"?(m.href=l,m.origin===location.origin?s(m):r(m.href)?i(l,u,h):s(m,m.target="_blank")):(m.href=f.createObjectURL(l),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){s(m)},0))}:"msSaveOrOpenBlob"in navigator?function(l,u,h){if(u=u||l.name||"download",typeof l!="string")navigator.msSaveOrOpenBlob(n(l,h),u);else if(r(l))i(l,u,h);else{var f=document.createElement("a");f.href=l,f.target="_blank",setTimeout(function(){s(f)})}}:function(l,u,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof l=="string")return i(l,u,h);var m=l.type==="application/octet-stream",g=/constructor/i.test(a.HTMLElement)||a.safari,p=/CriOS\/[\d]+/.test(navigator.userAgent);if((p||m&&g||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var k=x.result;k=p?k:k.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=k:location=k,f=null},x.readAsDataURL(l)}else{var S=a.URL||a.webkitURL,v=S.createObjectURL(l);f?f.location=v:location.href=v,f=null,setTimeout(function(){S.revokeObjectURL(v)},4e4)}});a.saveAs=c.saveAs=c,e.exports=c})})(xg);var UE=xg.exports,wg={exports:{}};/* @license
|
|
33
33
|
Papa Parse
|
|
34
34
|
v5.5.3
|
|
35
35
|
https://github.com/mholt/PapaParse
|
|
36
36
|
License: MIT
|
|
37
|
-
*/(function(e,t){((n,i)=>{e.exports=i()})(ve,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r,s=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,o={},
|
|
37
|
+
*/(function(e,t){((n,i)=>{e.exports=i()})(ve,function n(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},r,s=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,o={},c=0,l={};function u(y){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 T=M(_);T.chunkSize=parseInt(T.chunkSize),_.step||_.chunk||(T.chunkSize=null),this._handle=new p(T),(this._handle.streamer=this)._config=T}).call(this,y),this.parseChunk=function(_,T){var O=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<O){let I=this._config.newline;I||(A=this._config.quoteChar||'"',I=this._handle.guessLineEndings(_,A)),_=[..._.split(I).slice(O)].join(I)}this.isFirstChunk&&E(this._config.beforeFirstChunk)&&(A=this._config.beforeFirstChunk(_))!==void 0&&(_=A),this.isFirstChunk=!1,this._halted=!1;var O=this._partialLine+_,A=(this._partialLine="",this._handle.parse(O,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(_=A.meta.cursor,O=(this._finished||(this._partialLine=O.substring(_-this._baseIndex),this._baseIndex=_),A&&A.data&&(this._rowCount+=A.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),a)i.postMessage({results:A,workerId:l.WORKER_ID,finished:O});else if(E(this._config.chunk)&&!T){if(this._config.chunk(A,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=A=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(A.data),this._completeResults.errors=this._completeResults.errors.concat(A.errors),this._completeResults.meta=A.meta),this._completed||!O||!E(this._config.complete)||A&&A.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),O||A&&A.meta.paused||this._nextChunk(),A}this._halted=!0},this._sendError=function(_){E(this._config.error)?this._config.error(_):a&&this._config.error&&i.postMessage({workerId:l.WORKER_ID,error:_,finished:!1})}}function h(y){var _;(y=y||{}).chunkSize||(y.chunkSize=l.RemoteChunkSize),u.call(this,y),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(T){this._input=T,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),s||(_.onload=P(this._chunkLoaded,this),_.onerror=P(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var T,O=this._config.downloadRequestHeaders;for(T in O)_.setRequestHeader(T,O[T])}var A;this._config.chunkSize&&(A=this._start+this._config.chunkSize-1,_.setRequestHeader("Range","bytes="+this._start+"-"+A));try{_.send(this._config.downloadRequestBody)}catch(I){this._chunkError(I.message)}s&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize||_.responseText.length,this._finished=!this._config.chunkSize||this._start>=(T=>(T=T.getResponseHeader("Content-Range"))!==null?parseInt(T.substring(T.lastIndexOf("/")+1)):-1)(_),this.parseChunk(_.responseText)))},this._chunkError=function(T){T=_.statusText||T,this._sendError(new Error(T))}}function f(y){(y=y||{}).chunkSize||(y.chunkSize=l.LocalChunkSize),u.call(this,y);var _,T,O=typeof FileReader<"u";this.stream=function(A){this._input=A,T=A.slice||A.webkitSlice||A.mozSlice,O?((_=new FileReader).onload=P(this._chunkLoaded,this),_.onerror=P(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,I=(this._config.chunkSize&&(I=Math.min(this._start+this._config.chunkSize,this._input.size),A=T.call(A,this._start,I)),_.readAsText(A,this._config.encoding));O||this._chunkLoaded({target:{result:I}})},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 m(y){var _;u.call(this,y=y||{}),this.stream=function(T){return _=T,this._nextChunk()},this._nextChunk=function(){var T,O;if(!this._finished)return T=this._config.chunkSize,_=T?(O=_.substring(0,T),_.substring(T)):(O=_,""),this._finished=!_,this.parseChunk(O)}}function g(y){u.call(this,y=y||{});var _=[],T=!0,O=!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(){O&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):T=!0},this._streamData=P(function(A){try{_.push(typeof A=="string"?A:A.toString(this._config.encoding)),T&&(T=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(I){this._streamError(I)}},this),this._streamError=P(function(A){this._streamCleanUp(),this._sendError(A)},this),this._streamEnd=P(function(){this._streamCleanUp(),O=!0,this._streamData("")},this),this._streamCleanUp=P(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function p(y){var _,T,O,A,I=Math.pow(2,53),B=-I,q=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,G=/^((\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)))$/,V=this,lt=0,X=0,Q=!1,H=!1,U=[],Y={data:[],errors:[],meta:{}};function xt(gt){return y.skipEmptyLines==="greedy"?gt.join("").trim()==="":gt.length===1&>[0].length===0}function yt(){if(Y&&O&&(mt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),O=!1),y.skipEmptyLines&&(Y.data=Y.data.filter(function($){return!xt($)})),vt()){let $=function(J,et){E(y.transformHeader)&&(J=y.transformHeader(J,et)),U.push(J)};if(Y)if(Array.isArray(Y.data[0])){for(var gt=0;vt()&><Y.data.length;gt++)Y.data[gt].forEach($);Y.data.splice(0,1)}else Y.data.forEach($)}function z($,J){for(var et=y.header?{}:[],nt=0;nt<$.length;nt++){var rt=nt,it=$[nt],it=((_t,ct)=>(Et=>(y.dynamicTypingFunction&&y.dynamicTyping[Et]===void 0&&(y.dynamicTyping[Et]=y.dynamicTypingFunction(Et)),(y.dynamicTyping[Et]||y.dynamicTyping)===!0))(_t)?ct==="true"||ct==="TRUE"||ct!=="false"&&ct!=="FALSE"&&((Et=>{if(q.test(Et)&&(Et=parseFloat(Et),B<Et&&Et<I))return 1})(ct)?parseFloat(ct):G.test(ct)?new Date(ct):ct===""?null:ct):ct)(rt=y.header?nt>=U.length?"__parsed_extra":U[nt]:rt,it=y.transform?y.transform(it,rt):it);rt==="__parsed_extra"?(et[rt]=et[rt]||[],et[rt].push(it)):et[rt]=it}return y.header&&(nt>U.length?mt("FieldMismatch","TooManyFields","Too many fields: expected "+U.length+" fields but parsed "+nt,X+J):nt<U.length&&mt("FieldMismatch","TooFewFields","Too few fields: expected "+U.length+" fields but parsed "+nt,X+J)),et}var j;Y&&(y.header||y.dynamicTyping||y.transform)&&(j=1,!Y.data.length||Array.isArray(Y.data[0])?(Y.data=Y.data.map(z),j=Y.data.length):Y.data=z(Y.data,0),y.header&&Y.meta&&(Y.meta.fields=U),X+=j)}function vt(){return y.header&&U.length===0}function mt(gt,z,j,$){gt={type:gt,code:z,message:j},$!==void 0&&(gt.row=$),Y.errors.push(gt)}E(y.step)&&(A=y.step,y.step=function(gt){Y=gt,vt()?yt():(yt(),Y.data.length!==0&&(lt+=gt.data.length,y.preview&<>y.preview?T.abort():(Y.data=Y.data[0],A(Y,V))))}),this.parse=function(gt,z,j){var $=y.quoteChar||'"',$=(y.newline||(y.newline=this.guessLineEndings(gt,$)),O=!1,y.delimiter?E(y.delimiter)&&(y.delimiter=y.delimiter(gt),Y.meta.delimiter=y.delimiter):(($=((J,et,nt,rt,it)=>{var _t,ct,Et,te;it=it||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ce=0;ce<it.length;ce++){for(var qt,Ie=it[ce],St=0,Xt=0,zt=0,Gt=(Et=void 0,new S({comments:rt,delimiter:Ie,newline:et,preview:10}).parse(J)),re=0;re<Gt.data.length;re++)nt&&xt(Gt.data[re])?zt++:(qt=Gt.data[re].length,Xt+=qt,Et===void 0?Et=qt:0<qt&&(St+=Math.abs(qt-Et),Et=qt));0<Gt.data.length&&(Xt/=Gt.data.length-zt),(ct===void 0||St<=ct)&&(te===void 0||te<Xt)&&1.99<Xt&&(ct=St,_t=Ie,te=Xt)}return{successful:!!(y.delimiter=_t),bestDelimiter:_t}})(gt,y.newline,y.skipEmptyLines,y.comments,y.delimitersToGuess)).successful?y.delimiter=$.bestDelimiter:(O=!0,y.delimiter=l.DefaultDelimiter),Y.meta.delimiter=y.delimiter),M(y));return y.preview&&y.header&&$.preview++,_=gt,T=new S($),Y=T.parse(_,z,j),yt(),Q?{meta:{paused:!0}}:Y||{meta:{paused:!1}}},this.paused=function(){return Q},this.pause=function(){Q=!0,T.abort(),_=E(y.chunk)?"":_.substring(T.getCharIndex())},this.resume=function(){V.streamer._halted?(Q=!1,V.streamer.parseChunk(_,!0)):setTimeout(V.resume,3)},this.aborted=function(){return H},this.abort=function(){H=!0,T.abort(),Y.meta.aborted=!0,E(y.complete)&&y.complete(Y),_=""},this.guessLineEndings=function(J,$){J=J.substring(0,1048576);var $=new RegExp(x($)+"([^]*?)"+x($),"gm"),j=(J=J.replace($,"")).split("\r"),$=J.split(`
|
|
38
38
|
`),J=1<$.length&&$[0].length<j[0].length;if(j.length===1||J)return`
|
|
39
39
|
`;for(var et=0,nt=0;nt<j.length;nt++)j[nt][0]===`
|
|
40
40
|
`&&et++;return et>=j.length/2?`\r
|
|
41
|
-
`:"\r"}}function x(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S(y){var _=(y=y||{}).delimiter,T=y.newline,O=y.comments,A=y.step,I=y.preview,B=y.fastMode,q=null,G=!1,V=y.quoteChar==null?'"':y.quoteChar,lt=V;if(y.escapeChar!==void 0&&(lt=y.escapeChar),(typeof _!="string"||-1<
|
|
41
|
+
`:"\r"}}function x(y){return y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function S(y){var _=(y=y||{}).delimiter,T=y.newline,O=y.comments,A=y.step,I=y.preview,B=y.fastMode,q=null,G=!1,V=y.quoteChar==null?'"':y.quoteChar,lt=V;if(y.escapeChar!==void 0&&(lt=y.escapeChar),(typeof _!="string"||-1<l.BAD_DELIMITERS.indexOf(_))&&(_=","),O===_)throw new Error("Comment character same as delimiter");O===!0?O="#":(typeof O!="string"||-1<l.BAD_DELIMITERS.indexOf(O))&&(O=!1),T!==`
|
|
42
42
|
`&&T!=="\r"&&T!==`\r
|
|
43
43
|
`&&(T=`
|
|
44
|
-
`);var X=0,Q=!1;this.parse=function(H,U,Y){if(typeof H!="string")throw new Error("Input must be a string");var xt=H.length,yt=_.length,vt=T.length,mt=O.length,gt=E(A),z=[],j=[],$=[],J=X=0;if(!H)return St();if(B||B!==!1&&H.indexOf(V)===-1){for(var et=H.split(T),nt=0;nt<et.length;nt++){if($=et[nt],X+=$.length,nt!==et.length-1)X+=T.length;else if(Y)return St();if(!O||$.substring(0,mt)!==O){if(gt){if(z=[],te($.split(_)),Xt(),Q)return St()}else te($.split(_));if(I&&I<=nt)return z=z.slice(0,I),St(!0)}}return St()}for(var rt=H.indexOf(_,X),it=H.indexOf(T,X),_t=new RegExp(x(lt)+x(V),"g"),ct=H.indexOf(V,X);;)if(H[X]===V)for(ct=X,X++;;){if((ct=H.indexOf(V,ct+1))===-1)return Y||j.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:X}),qt();if(ct===xt-1)return qt(H.substring(X,ct).replace(_t,V));if(V===lt&&H[ct+1]===lt)ct++;else if(V===lt||ct===0||H[ct-1]!==lt){rt!==-1&&rt<ct+1&&(rt=H.indexOf(_,ct+1));var Et=ce((it=it!==-1&&it<ct+1?H.indexOf(T,ct+1):it)===-1?rt:Math.min(rt,it));if(H.substr(ct+1+Et,yt)===_){$.push(H.substring(X,ct).replace(_t,V)),H[X=ct+1+Et+yt]!==V&&(ct=H.indexOf(V,X)),rt=H.indexOf(_,X),it=H.indexOf(T,X);break}if(Et=ce(it),H.substring(ct+1+Et,ct+1+Et+vt)===T){if($.push(H.substring(X,ct).replace(_t,V)),Ie(ct+1+Et+vt),rt=H.indexOf(_,X),ct=H.indexOf(V,X),gt&&(Xt(),Q))return St();if(I&&z.length>=I)return St(!0);break}j.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:X}),ct++}}else if(O&&$.length===0&&H.substring(X,X+mt)===O){if(it===-1)return St();X=it+vt,it=H.indexOf(T,X),rt=H.indexOf(_,X)}else if(rt!==-1&&(rt<it||it===-1))$.push(H.substring(X,rt)),X=rt+yt,rt=H.indexOf(_,X);else{if(it===-1)break;if($.push(H.substring(X,it)),Ie(it+vt),gt&&(Xt(),Q))return St();if(I&&z.length>=I)return St(!0)}return qt();function te(zt){z.push(zt),J=X}function ce(zt){var Gt=0;return Gt=zt!==-1&&(zt=H.substring(ct+1,zt))&&zt.trim()===""?zt.length:Gt}function qt(zt){return Y||(zt===void 0&&(zt=H.substring(X)),$.push(zt),X=xt,te($),gt&&Xt()),St()}function Ie(zt){X=zt,te($),$=[],it=H.indexOf(T,X)}function St(zt){if(y.header&&!U&&z.length&&!G){var Gt=z[0],re=Object.create(null),Ke=new Set(Gt);let ci=!1;for(let ze=0;ze<Gt.length;ze++){let Ht=Gt[ze];if(re[Ht=E(y.transformHeader)?y.transformHeader(Ht,ze):Ht]){let Se,ui=re[Ht];for(;Se=Ht+"_"+ui,ui++,Ke.has(Se););Ke.add(Se),Gt[ze]=Se,re[Ht]++,ci=!0,(q=q===null?{}:q)[Se]=Ht}else re[Ht]=1,Gt[ze]=Ht;Ke.add(Ht)}ci&&console.warn("Duplicate headers found and renamed."),G=!0}return{data:z,errors:j,meta:{delimiter:_,linebreak:T,aborted:Q,truncated:!!zt,cursor:J+(U||0),renamedHeaders:q}}}function Xt(){A(St()),z=[],j=[]}},this.abort=function(){Q=!0},this.getCharIndex=function(){return X}}function v(y){var _=y.data,T=o[_.workerId],O=!1;if(_.error)T.userError(_.error,_.file);else if(_.results&&_.results.data){var A={abort:function(){O=!0,k(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:D,resume:D};if(E(T.userStep)){for(var I=0;I<_.results.data.length&&(T.userStep({data:_.results.data[I],errors:_.results.errors,meta:_.results.meta},A),!O);I++);delete _.results}else E(T.userChunk)&&(T.userChunk(_.results,A,_.file),delete _.results)}_.finished&&!O&&k(_.workerId,_.results)}function k(y,_){var T=o[y];E(T.userComplete)&&T.userComplete(_),T.terminate(),delete o[y]}function D(){throw new Error("Not implemented.")}function M(y){if(typeof y!="object"||y===null)return y;var _,T=Array.isArray(y)?[]:{};for(_ in y)T[_]=M(y[_]);return T}function P(y,_){return function(){y.apply(_,arguments)}}function E(y){return typeof y=="function"}return
|
|
45
|
-
`,B='"',q=B+B,G=!1,V=null,lt=!1,X=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||
|
|
46
|
-
`,'"',
|
|
47
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),n("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});UE.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(e.filename),1)])],8,XE))}}),KE=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=d.computed(()=>Object.keys(t.headers));return(i,r)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(GE,{data:e.rows,fields:n.value,filename:e.filename,labels:e.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),ZE={class:"kong-ui-public-csv-export-modal"},QE={key:0,class:"selected-range"},JE={key:4,class:"text-muted",tag:"span"},vg=3,tO=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=pt.useI18n(),i=e,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=d.ref(1),o=d.computed(()=>f.value.rows.length),l=d.computed(()=>{var g,p;return i.exportState.status==="success"&&!!((p=(g=i.exportState.chartData)==null?void 0:g.data)!=null&&p.length)}),c=d.computed(()=>i.exportState.status!=="success"?"":pt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":n.t("csvExport.previewRows",{rowsMax:Math.min(vg,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{r("closeModal")},f=d.computed(()=>{var M,P,E;if(i.exportState.status!=="success"||!l.value||!((M=i.exportState.chartData)!=null&&M.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,p=g.data.some(y=>y.timestamp!==g.data[0].timestamp),x=g.data.map(y=>{const _=new Date(y.timestamp);return{...Object.keys(y.event).reduce((O,A)=>{if(A in g.meta.display){const I=y.event[A],B=g.meta.display[A];O[A]=I&&B&&B[I].name||y.event[A]}else O[A]=y.event[A];return O},{}),...p?{timestamp:wl(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:wl(_,"XXX")}:{}}});let S=[];p&&(S=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const v="display"in i.exportState.chartData.meta&&((P=i.exportState.chartData.meta)!=null&&P.display)?(E=i.exportState.chartData.meta)==null?void 0:E.display:{},k=[...S,...Object.keys(v).map(y=>({label:n.t(`chartLabels.${y}`),key:y})),...i.exportState.chartData.meta.metric_names.map(y=>({label:n.t(`chartLabels.${y}`),key:y}))],D=k.reduce((y,_)=>(y[_.key]=_.label,y),{});return{headers:k,csvHeaders:D,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:g}=f.value;return{total:Number(g.length)||0,data:g.slice(0,vg)}};return d.watch(f,()=>{a.value++}),(g,p)=>{const x=d.resolveComponent("KSkeleton"),S=d.resolveComponent("KEmptyState"),v=d.resolveComponent("KTableData"),k=d.resolveComponent("KTooltip"),D=d.resolveComponent("KButton"),M=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",ZE,[d.createVNode(M,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(n).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var P;return[d.createElementVNode("div",null,[e.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",QE,[d.createElementVNode("p",null,d.toDisplayString(e.modalDescription?e.modalDescription:d.unref(n).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),e.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(d.openBlock(),d.createBlock(v,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((P=f.value)==null?void 0:P.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(S,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):e.exportState.status==="error"?(d.openBlock(),d.createBlock(S,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),e.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",JE,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(k,{class:"preview-tooltip",placement:"right",text:d.unref(n).t("csvExport.maximumRecordAmount",{value:d.unref(dv)})},{default:d.withCtx(()=>[d.createVNode(d.unref(ne.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(ll)})`,size:d.unref(zr)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(KE,{class:"vitals-report-export-button",filename:s,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),eO={class:"container"},nO={key:0,class:"no-data","data-testId":"sparkline-empty"},iO=["title"],rO=Ee(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(e){const t=crypto.randomUUID(),{i18n:n}=pt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:l,syncedChartDatasets:c}=pt.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:E,height:y})=>{u.width=E,u.height=y},f=d.computed(()=>e.disableTooltip?[]:[new Zm({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=d.computed(()=>c.value.reduce((E,{data:y,label:_})=>({...E,[_]:y.reduce((T,{y:O})=>T+O,0)}),{})),g=d.computed(()=>c.value.map(({label:E})=>[m.value[E],`${E}: ${m.value[E]}`]).sort(([E],[y])=>y-E).map(([,E])=>E).join(", ")),p=d.computed(()=>Object.keys(m.value).map(E=>m.value[E]).reduce((E,y)=>E+y,0)),x=d.computed(()=>p.value>0),S=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),v=d.computed(()=>e.datasets.length>1),k=`SparklineTooltipPosition-${t}`,D=d.computed(()=>{const E=e.type==="sparkline_bar",y=E?r.value-1:r.value,_=E?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:E?0:2,right:E?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:k,external:T=>{df(u,T,"minutely",{contextFormatter:O=>{const A=O+i.value;let I="";return i.value>24*60*60*1e3?I=qs(new Date(A),"MMM dd, yyy hh:mm a"):I=qs(new Date(A),"hh:mm a"),`${nl(O)} - ${I}`}})}}},scales:{x:{min:y,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:v.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:v.value}}}}),M=d.ref("0"),P=d.ref("0");return d.onMounted(()=>{Ce.positioners[k]=function(E,y){if(!E.length||u.interactionMode==="interactive")return!1;const _=10,T=this.chart.canvas.getBoundingClientRect(),O=u.width||this.width,A=u.height||this.height,I=T.top-A>0,B=I?T.top-A-_:T.top+T.height+_,q=T.left>O/2-y.x,G=Math.max(_,window.innerWidth-_-O),V=Math.min(G,q?Math.floor(T.left-O/2)+y.x:0+_);return M.value=`${B}px`,P.value=`${V}px`,{x:V,y:B,xAlign:"center",yAlign:I?"top":"bottom"}}}),d.onUnmounted(()=>{Ce.positioners[k]&&delete Ce.positioners[k]}),(E,y)=>(d.openBlock(),d.createElementBlock("div",eO,[x.value?e.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Xm),{key:1,"chart-id":d.unref(t),data:S.value,"data-testId":"sparkline-bar",options:D.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Km),{key:2,"chart-id":d.unref(t),data:S.value,"data-testId":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:D.value,plugins:f.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",nO,[d.renderSlot(E.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(_a,{key:3,"absolute-left":P.value,"absolute-top":M.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&e.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:E.$slots.label?"":g.value},[d.renderSlot(E.$slots,"label",{total:p.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(g.value),1)],!0)],8,iO)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e18e899f"]]);ot.AnalyticsChart=UD,ot.ChartLegendPosition=Nt,ot.CsvExportModal=tO,ot.DECIMAL_DISPLAY=vS,ot.EMPTY_COLOR=Sf,ot.FONT_SIZE_REGULAR=gf,ot.FONT_SIZE_SMALL=mf,ot.MAX_LABEL_LENGTH=ia,ot.OTHERS_COLOR=NS,ot.SimpleChart=eE,ot.SparklineChart=rO,ot.TopNTable=fE,ot.ValidType=li,ot.accessibleGrey=wf,ot.apiRequestStatusCodeColors=vf,ot.chartTypes=RD,ot.codesInSpec=Df,ot.darkenColor=xf,ot.datavisPalette=un,ot.defaultStatusCodeColors=aa,ot.determineBaseColor=cl,ot.errorRateColors=IS,ot.handleQueryError=Sk,ot.latencyColors=LS,ot.lightGrey=hl,ot.lookupColor=FS,ot.lookupDatavisColor=ra,ot.lookupStatusCodeCategoryColor=$S,ot.lookupStatusCodeColor=fl,ot.simpleChartMetricDisplay=PD,ot.simpleChartTypes=AD,ot.statusCodeBadgeBackgroundColor=RS,ot.thresholdColor=sa,ot.trafficColors=AS,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
|
|
44
|
+
`);var X=0,Q=!1;this.parse=function(H,U,Y){if(typeof H!="string")throw new Error("Input must be a string");var xt=H.length,yt=_.length,vt=T.length,mt=O.length,gt=E(A),z=[],j=[],$=[],J=X=0;if(!H)return St();if(B||B!==!1&&H.indexOf(V)===-1){for(var et=H.split(T),nt=0;nt<et.length;nt++){if($=et[nt],X+=$.length,nt!==et.length-1)X+=T.length;else if(Y)return St();if(!O||$.substring(0,mt)!==O){if(gt){if(z=[],te($.split(_)),Xt(),Q)return St()}else te($.split(_));if(I&&I<=nt)return z=z.slice(0,I),St(!0)}}return St()}for(var rt=H.indexOf(_,X),it=H.indexOf(T,X),_t=new RegExp(x(lt)+x(V),"g"),ct=H.indexOf(V,X);;)if(H[X]===V)for(ct=X,X++;;){if((ct=H.indexOf(V,ct+1))===-1)return Y||j.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:z.length,index:X}),qt();if(ct===xt-1)return qt(H.substring(X,ct).replace(_t,V));if(V===lt&&H[ct+1]===lt)ct++;else if(V===lt||ct===0||H[ct-1]!==lt){rt!==-1&&rt<ct+1&&(rt=H.indexOf(_,ct+1));var Et=ce((it=it!==-1&&it<ct+1?H.indexOf(T,ct+1):it)===-1?rt:Math.min(rt,it));if(H.substr(ct+1+Et,yt)===_){$.push(H.substring(X,ct).replace(_t,V)),H[X=ct+1+Et+yt]!==V&&(ct=H.indexOf(V,X)),rt=H.indexOf(_,X),it=H.indexOf(T,X);break}if(Et=ce(it),H.substring(ct+1+Et,ct+1+Et+vt)===T){if($.push(H.substring(X,ct).replace(_t,V)),Ie(ct+1+Et+vt),rt=H.indexOf(_,X),ct=H.indexOf(V,X),gt&&(Xt(),Q))return St();if(I&&z.length>=I)return St(!0);break}j.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:z.length,index:X}),ct++}}else if(O&&$.length===0&&H.substring(X,X+mt)===O){if(it===-1)return St();X=it+vt,it=H.indexOf(T,X),rt=H.indexOf(_,X)}else if(rt!==-1&&(rt<it||it===-1))$.push(H.substring(X,rt)),X=rt+yt,rt=H.indexOf(_,X);else{if(it===-1)break;if($.push(H.substring(X,it)),Ie(it+vt),gt&&(Xt(),Q))return St();if(I&&z.length>=I)return St(!0)}return qt();function te(zt){z.push(zt),J=X}function ce(zt){var Gt=0;return Gt=zt!==-1&&(zt=H.substring(ct+1,zt))&&zt.trim()===""?zt.length:Gt}function qt(zt){return Y||(zt===void 0&&(zt=H.substring(X)),$.push(zt),X=xt,te($),gt&&Xt()),St()}function Ie(zt){X=zt,te($),$=[],it=H.indexOf(T,X)}function St(zt){if(y.header&&!U&&z.length&&!G){var Gt=z[0],re=Object.create(null),Ke=new Set(Gt);let ci=!1;for(let ze=0;ze<Gt.length;ze++){let Ht=Gt[ze];if(re[Ht=E(y.transformHeader)?y.transformHeader(Ht,ze):Ht]){let Se,ui=re[Ht];for(;Se=Ht+"_"+ui,ui++,Ke.has(Se););Ke.add(Se),Gt[ze]=Se,re[Ht]++,ci=!0,(q=q===null?{}:q)[Se]=Ht}else re[Ht]=1,Gt[ze]=Ht;Ke.add(Ht)}ci&&console.warn("Duplicate headers found and renamed."),G=!0}return{data:z,errors:j,meta:{delimiter:_,linebreak:T,aborted:Q,truncated:!!zt,cursor:J+(U||0),renamedHeaders:q}}}function Xt(){A(St()),z=[],j=[]}},this.abort=function(){Q=!0},this.getCharIndex=function(){return X}}function v(y){var _=y.data,T=o[_.workerId],O=!1;if(_.error)T.userError(_.error,_.file);else if(_.results&&_.results.data){var A={abort:function(){O=!0,k(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:D,resume:D};if(E(T.userStep)){for(var I=0;I<_.results.data.length&&(T.userStep({data:_.results.data[I],errors:_.results.errors,meta:_.results.meta},A),!O);I++);delete _.results}else E(T.userChunk)&&(T.userChunk(_.results,A,_.file),delete _.results)}_.finished&&!O&&k(_.workerId,_.results)}function k(y,_){var T=o[y];E(T.userComplete)&&T.userComplete(_),T.terminate(),delete o[y]}function D(){throw new Error("Not implemented.")}function M(y){if(typeof y!="object"||y===null)return y;var _,T=Array.isArray(y)?[]:{};for(_ in y)T[_]=M(y[_]);return T}function P(y,_){return function(){y.apply(_,arguments)}}function E(y){return typeof y=="function"}return l.parse=function(y,_){var T=(_=_||{}).dynamicTyping||!1;if(E(T)&&(_.dynamicTypingFunction=T,T={}),_.dynamicTyping=T,_.transform=!!E(_.transform)&&_.transform,!_.worker||!l.WORKERS_SUPPORTED)return T=null,l.NODE_STREAM_INPUT,typeof y=="string"?(y=(O=>O.charCodeAt(0)!==65279?O:O.slice(1))(y),T=new(_.download?h:m)(_)):y.readable===!0&&E(y.read)&&E(y.on)?T=new g(_):(i.File&&y instanceof File||y instanceof Object)&&(T=new f(_)),T.stream(y);(T=(()=>{var O;return!!l.WORKERS_SUPPORTED&&(O=(()=>{var A=i.URL||i.webkitURL||null,I=n.toString();return l.BLOB_URL||(l.BLOB_URL=A.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; ","(",I,")();"],{type:"text/javascript"})))})(),(O=new i.Worker(O)).onmessage=v,O.id=c++,o[O.id]=O)})()).userStep=_.step,T.userChunk=_.chunk,T.userComplete=_.complete,T.userError=_.error,_.step=E(_.step),_.chunk=E(_.chunk),_.complete=E(_.complete),_.error=E(_.error),delete _.worker,T.postMessage({input:y,config:_,workerId:T.id})},l.unparse=function(y,_){var T=!1,O=!0,A=",",I=`\r
|
|
45
|
+
`,B='"',q=B+B,G=!1,V=null,lt=!1,X=((()=>{if(typeof _=="object"){if(typeof _.delimiter!="string"||l.BAD_DELIMITERS.filter(function(U){return _.delimiter.indexOf(U)!==-1}).length||(A=_.delimiter),typeof _.quotes!="boolean"&&typeof _.quotes!="function"&&!Array.isArray(_.quotes)||(T=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(G=_.skipEmptyLines),typeof _.newline=="string"&&(I=_.newline),typeof _.quoteChar=="string"&&(B=_.quoteChar),typeof _.header=="boolean"&&(O=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");V=_.columns}_.escapeChar!==void 0&&(q=_.escapeChar+B),_.escapeFormulae instanceof RegExp?lt=_.escapeFormulae:typeof _.escapeFormulae=="boolean"&&_.escapeFormulae&&(lt=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(B),"g"));if(typeof y=="string"&&(y=JSON.parse(y)),Array.isArray(y)){if(!y.length||Array.isArray(y[0]))return Q(null,y,G);if(typeof y[0]=="object")return Q(V||Object.keys(y[0]),y,G)}else if(typeof y=="object")return typeof y.data=="string"&&(y.data=JSON.parse(y.data)),Array.isArray(y.data)&&(y.fields||(y.fields=y.meta&&y.meta.fields||V),y.fields||(y.fields=Array.isArray(y.data[0])?y.fields:typeof y.data[0]=="object"?Object.keys(y.data[0]):[]),Array.isArray(y.data[0])||typeof y.data[0]=="object"||(y.data=[y.data])),Q(y.fields||[],y.data||[],G);throw new Error("Unable to serialize unrecognized input");function Q(U,Y,xt){var yt="",vt=(typeof U=="string"&&(U=JSON.parse(U)),typeof Y=="string"&&(Y=JSON.parse(Y)),Array.isArray(U)&&0<U.length),mt=!Array.isArray(Y[0]);if(vt&&O){for(var gt=0;gt<U.length;gt++)0<gt&&(yt+=A),yt+=H(U[gt],gt);0<Y.length&&(yt+=I)}for(var z=0;z<Y.length;z++){var j=(vt?U:Y[z]).length,$=!1,J=vt?Object.keys(Y[z]).length===0:Y[z].length===0;if(xt&&!vt&&($=xt==="greedy"?Y[z].join("").trim()==="":Y[z].length===1&&Y[z][0].length===0),xt==="greedy"&&vt){for(var et=[],nt=0;nt<j;nt++){var rt=mt?U[nt]:nt;et.push(Y[z][rt])}$=et.join("").trim()===""}if(!$){for(var it=0;it<j;it++){0<it&&!J&&(yt+=A);var _t=vt&&mt?U[it]:it;yt+=H(Y[z][_t],it)}z<Y.length-1&&(!xt||0<j&&!J)&&(yt+=I)}}return yt}function H(U,Y){var xt,yt;return U==null?"":U.constructor===Date?JSON.stringify(U).slice(1,25):(yt=!1,lt&&typeof U=="string"&<.test(U)&&(U="'"+U,yt=!0),xt=U.toString().replace(X,q),(yt=yt||T===!0||typeof T=="function"&&T(U,Y)||Array.isArray(T)&&T[Y]||((vt,mt)=>{for(var gt=0;gt<mt.length;gt++)if(-1<vt.indexOf(mt[gt]))return!0;return!1})(xt,l.BAD_DELIMITERS)||-1<xt.indexOf(A)||xt.charAt(0)===" "||xt.charAt(xt.length-1)===" ")?B+xt+B:xt)}},l.RECORD_SEP="",l.UNIT_SEP="",l.BYTE_ORDER_MARK="\uFEFF",l.BAD_DELIMITERS=["\r",`
|
|
46
|
+
`,'"',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=S,l.ParserHandle=p,l.NetworkStreamer=h,l.FileStreamer=f,l.StringStreamer=m,l.ReadableStreamStreamer=g,i.jQuery&&((r=i.jQuery).fn.parse=function(y){var _=y.config||{},T=[];return this.each(function(I){if(!(r(this).prop("tagName").toUpperCase()==="INPUT"&&r(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var B=0;B<this.files.length;B++)T.push({file:this.files[B],inputElem:this,instanceConfig:r.extend({},_)})}),O(),this;function O(){if(T.length===0)E(y.complete)&&y.complete();else{var I,B,q,G,V=T[0];if(E(y.before)){var lt=y.before(V.file,V.inputElem);if(typeof lt=="object"){if(lt.action==="abort")return I="AbortError",B=V.file,q=V.inputElem,G=lt.reason,void(E(y.error)&&y.error({name:I},B,q,G));if(lt.action==="skip")return void A();typeof lt.config=="object"&&(V.instanceConfig=r.extend(V.instanceConfig,lt.config))}else if(lt==="skip")return void A()}var X=V.instanceConfig.complete;V.instanceConfig.complete=function(Q){E(X)&&X(Q,V.file,V.inputElem),A()},l.parse(V.file,V.instanceConfig)}}function A(){T.splice(0,1),O()}}),a&&(i.onmessage=function(y){y=y.data,l.WORKER_ID===void 0&&y&&(l.WORKER_ID=y.workerId),typeof y.input=="string"?i.postMessage({workerId:l.WORKER_ID,results:l.parse(y.input,y.config),finished:!0}):(i.File&&y.input instanceof File||y.input instanceof Object)&&(y=l.parse(y.input,y.config))&&i.postMessage({workerId:l.WORKER_ID,results:y,finished:!0})}),(h.prototype=Object.create(u.prototype)).constructor=h,(f.prototype=Object.create(u.prototype)).constructor=f,(m.prototype=Object.create(m.prototype)).constructor=m,(g.prototype=Object.create(u.prototype)).constructor=g,l})})(wg);var qE=wg.exports;const XE=["id"],GE=d.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(e,{emit:t}){const n=t,i=e,r=d.computed(()=>`export_${new Date().getTime()}`),s=d.computed(()=>{const u=c();return u.length?u:null}),a=()=>{const u=i.labels;if(typeof i.fields!==li.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===li.Object?h=>gE(h,(f,m)=>u[m]||m):h=>h},o=()=>{const u=i.fields;if(typeof i.fields!==li.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>jE(h,u):h=>h},c=()=>{if(typeof i.fields===li.Undefined&&typeof i.labels===li.Undefined)return i.data;const u=a(),h=o();return i.data.map(f=>u(h(f)))},l=()=>{if(!(s!=null&&s.value)){console.warn("No data to export");return}n("export-started",s.value);let u=qE.unparse(s.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
|
|
47
|
+
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),n("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});UE.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:r.value,"data-testid":"export-csv",onClick:l},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(e.filename),1)])],8,XE))}}),KE=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(e){const t=e,n=d.computed(()=>Object.keys(t.headers));return(i,r)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(GE,{data:e.rows,fields:n.value,filename:e.filename,labels:e.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),ZE={class:"kong-ui-public-csv-export-modal"},QE={key:0,class:"selected-range"},JE={key:4,class:"text-muted",tag:"span"},vg=3,tO=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(e,{emit:t}){const{i18n:n}=pt.useI18n(),i=e,r=t,s=`${i.filename.replace(/\s+/g,"-").toLowerCase()}-${new Date().toISOString().slice(0,10)}.csv`,a=d.ref(1),o=d.computed(()=>f.value.rows.length),c=d.computed(()=>{var g,p;return i.exportState.status==="success"&&!!((p=(g=i.exportState.chartData)==null?void 0:g.data)!=null&&p.length)}),l=d.computed(()=>i.exportState.status!=="success"?"":pt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":n.t("csvExport.previewRows",{rowsMax:Math.min(vg,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{r("closeModal")},f=d.computed(()=>{var M,P,E;if(i.exportState.status!=="success"||!c.value||!((M=i.exportState.chartData)!=null&&M.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const g=i.exportState.chartData,p=g.data.some(y=>y.timestamp!==g.data[0].timestamp),x=g.data.map(y=>{const _=new Date(y.timestamp);return{...Object.keys(y.event).reduce((O,A)=>{if(A in g.meta.display){const I=y.event[A],B=g.meta.display[A];O[A]=I&&B&&B[I].name||y.event[A]}else O[A]=y.event[A];return O},{}),...p?{timestamp:wl(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:wl(_,"XXX")}:{}}});let S=[];p&&(S=[{label:n.t("csvExport.Timestamp"),key:"timestamp"},{label:n.t("csvExport.UtcOffset"),key:"tzOffset"}]);const v="display"in i.exportState.chartData.meta&&((P=i.exportState.chartData.meta)!=null&&P.display)?(E=i.exportState.chartData.meta)==null?void 0:E.display:{},k=[...S,...Object.keys(v).map(y=>({label:n.t(`chartLabels.${y}`),key:y})),...i.exportState.chartData.meta.metric_names.map(y=>({label:n.t(`chartLabels.${y}`),key:y}))],D=k.reduce((y,_)=>(y[_.key]=_.label,y),{});return{headers:k,csvHeaders:D,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:g}=f.value;return{total:Number(g.length)||0,data:g.slice(0,vg)}};return d.watch(f,()=>{a.value++}),(g,p)=>{const x=d.resolveComponent("KSkeleton"),S=d.resolveComponent("KEmptyState"),v=d.resolveComponent("KTableData"),k=d.resolveComponent("KTooltip"),D=d.resolveComponent("KButton"),M=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",ZE,[d.createVNode(M,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(n).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var P;return[d.createElementVNode("div",null,[e.exportState.status==="success"&&c.value?(d.openBlock(),d.createElementBlock("div",QE,[d.createElementVNode("p",null,d.toDisplayString(e.modalDescription?e.modalDescription:d.unref(n).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(l.value),1)])):d.createCommentVNode("",!0),e.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):e.exportState.status==="success"?(d.openBlock(),d.createBlock(v,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((P=f.value)==null?void 0:P.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(S,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(n).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):e.exportState.status==="error"?(d.openBlock(),d.createBlock(S,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(n).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),e.exportState.status==="success"&&c.value?(d.openBlock(),d.createElementBlock("div",JE,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(k,{class:"preview-tooltip",placement:"right",text:d.unref(n).t("csvExport.maximumRecordAmount",{value:d.unref(dv)})},{default:d.withCtx(()=>[d.createVNode(d.unref(ne.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(ll)})`,size:d.unref(zr)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(D,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(KE,{class:"vitals-report-export-button",filename:s,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(D,{appearance:"primary","data-testid":"csv-download-button",disabled:e.exportState.status!=="success"||!c.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),eO={class:"container"},nO={key:0,class:"no-data","data-testId":"sparkline-empty"},iO=["title"],rO=Ee(d.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(e){const t=crypto.randomUUID(),{i18n:n}=pt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:r,syncedMaxStamp:s,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:c,syncedChartDatasets:l}=pt.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:E,height:y})=>{u.width=E,u.height=y},f=d.computed(()=>e.disableTooltip?[]:[new Zm({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=d.computed(()=>l.value.reduce((E,{data:y,label:_})=>({...E,[_]:y.reduce((T,{y:O})=>T+O,0)}),{})),g=d.computed(()=>l.value.map(({label:E})=>[m.value[E],`${E}: ${m.value[E]}`]).sort(([E],[y])=>y-E).map(([,E])=>E).join(", ")),p=d.computed(()=>Object.keys(m.value).map(E=>m.value[E]).reduce((E,y)=>E+y,0)),x=d.computed(()=>p.value>0),S=d.computed(()=>({labels:new Array(c.value).fill(""),datasets:l.value})),v=d.computed(()=>e.datasets.length>1),k=`SparklineTooltipPosition-${t}`,D=d.computed(()=>{const E=e.type==="sparkline_bar",y=E?r.value-1:r.value,_=E?s.value:s.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:E?0:2,right:E?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:k,external:T=>{df(u,T,"minutely",{contextFormatter:O=>{const A=O+i.value;let I="";return i.value>24*60*60*1e3?I=qs(new Date(A),"MMM dd, yyy hh:mm a"):I=qs(new Date(A),"hh:mm a"),`${nl(O)} - ${I}`}})}}},scales:{x:{min:y,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:v.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:v.value}}}}),M=d.ref("0"),P=d.ref("0");return d.onMounted(()=>{Ce.positioners[k]=function(E,y){if(!E.length||u.interactionMode==="interactive")return!1;const _=10,T=this.chart.canvas.getBoundingClientRect(),O=u.width||this.width,A=u.height||this.height,I=T.top-A>0,B=I?T.top-A-_:T.top+T.height+_,q=T.left>O/2-y.x,G=Math.max(_,window.innerWidth-_-O),V=Math.min(G,q?Math.floor(T.left-O/2)+y.x:0+_);return M.value=`${B}px`,P.value=`${V}px`,{x:V,y:B,xAlign:"center",yAlign:I?"top":"bottom"}}}),d.onUnmounted(()=>{Ce.positioners[k]&&delete Ce.positioners[k]}),(E,y)=>(d.openBlock(),d.createElementBlock("div",eO,[x.value?e.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Xm),{key:1,"chart-id":d.unref(t),data:S.value,"data-testId":"sparkline-bar",options:D.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Km),{key:2,"chart-id":d.unref(t),data:S.value,"data-testId":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:D.value,plugins:f.value},null,8,["chart-id","data","data-testId","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",nO,[d.renderSlot(E.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(_a,{key:3,"absolute-left":P.value,"absolute-top":M.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&e.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:E.$slots.label?"":g.value},[d.renderSlot(E.$slots,"label",{total:p.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(g.value),1)],!0)],8,iO)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-e18e899f"]]);ot.AnalyticsChart=UD,ot.ChartLegendPosition=Nt,ot.CsvExportModal=tO,ot.DECIMAL_DISPLAY=vS,ot.EMPTY_COLOR=Sf,ot.FONT_SIZE_REGULAR=gf,ot.FONT_SIZE_SMALL=mf,ot.MAX_LABEL_LENGTH=ia,ot.OTHERS_COLOR=NS,ot.SimpleChart=eE,ot.SparklineChart=rO,ot.TopNTable=fE,ot.ValidType=li,ot.accessibleGrey=wf,ot.apiRequestStatusCodeColors=vf,ot.chartTypes=RD,ot.codesInSpec=Df,ot.darkenColor=xf,ot.datavisPalette=un,ot.defaultStatusCodeColors=aa,ot.determineBaseColor=cl,ot.errorRateColors=IS,ot.handleQueryError=Sk,ot.latencyColors=LS,ot.lightGrey=hl,ot.lookupColor=FS,ot.lookupDatavisColor=ra,ot.lookupStatusCodeCategoryColor=$S,ot.lookupStatusCodeColor=fl,ot.simpleChartMetricDisplay=PD,ot.simpleChartTypes=AD,ot.statusCodeBadgeBackgroundColor=RS,ot.thresholdColor=sa,ot.trafficColors=AS,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})});
|