@kong-ui-public/analytics-chart 10.15.13 → 10.16.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/README.md +8 -0
- package/dist/style.css +1 -1
- package/dist/types/components/AnalyticsChart.vue.d.ts.map +1 -1
- package/dist/types/components/chart-types/DonutChart.vue.d.ts +2 -0
- package/dist/types/components/chart-types/DonutChart.vue.d.ts.map +1 -1
- package/dist/types/composables/useDonutChartOptions.d.ts +1 -0
- package/dist/types/composables/useDonutChartOptions.d.ts.map +1 -1
- package/dist/types/types/chart-data.d.ts +10 -1
- package/dist/types/types/chart-data.d.ts.map +1 -1
- package/dist/types/utils/metric-units.d.ts +2 -0
- package/dist/types/utils/metric-units.d.ts.map +1 -1
- package/dist/vitals-chart.es.js +3594 -3560
- package/dist/vitals-chart.umd.js +13 -13
- package/package.json +1 -1
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
(function(it,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/analytics-metric-provider"],d):(it=typeof globalThis<"u"?globalThis:it||self,d(it["kong-ui-publicvitals-chart"]={},it.Vue,it["kong-ui-public-i18n"],it.KongIcons,it["kong-ui-public-analytics-metric-provider"]))})(this,function(it,d,Hn,Xi,Gi){"use strict";var QC=Object.defineProperty;var JC=(it,d,Hn)=>d in it?QC(it,d,{enumerable:!0,configurable:!0,writable:!0,value:Hn}):it[d]=Hn;var A=(it,d,Hn)=>JC(it,typeof d!="symbol"?d+"":d,Hn);var In;const tg={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",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",error_rate:"Error rate",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_package:"API package",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",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A Response Size (sum)",a2a_context_id:"A2A Context ID",a2a_error:"A2A Error",a2a_method:"A2A Method",a2a_task_id:"A2A Task ID",mcp_error:"MCP Error",mcp_method:"MCP Method",mcp_response_size_sum:"MCP Response Size (sum)",mcp_session_id:"MCP Session ID",mcp_tool_name:"MCP Tool Name",mcp_response_body_size_sum:"MCP Response Size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count"},metricAxisTitles:{error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) 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_size_sum:"Request size (sum) 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",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A Response Size (sum) in {unit}",a2a_context_id:"A2A Context ID",a2a_error:"A2A Error",a2a_method:"A2A Method",a2a_task_id:"A2A Task ID",mcp_response_size_sum:"MCP Response Size (sum) in {unit}",mcp_response_body_size_sum:"MCP Response Body Size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count"},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 eg(){const n=Hn.createI18n("en-us",tg);return{i18n:n,i18nT:Hn.i18nTComponent(n)}}/*!
|
|
1
|
+
(function(it,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@kong-ui-public/i18n"),require("@kong/icons"),require("@kong-ui-public/analytics-metric-provider")):typeof define=="function"&&define.amd?define(["exports","vue","@kong-ui-public/i18n","@kong/icons","@kong-ui-public/analytics-metric-provider"],d):(it=typeof globalThis<"u"?globalThis:it||self,d(it["kong-ui-publicvitals-chart"]={},it.Vue,it["kong-ui-public-i18n"],it.KongIcons,it["kong-ui-public-analytics-metric-provider"]))})(this,function(it,d,Hn,Xi,Gi){"use strict";var iE=Object.defineProperty;var sE=(it,d,Hn)=>d in it?iE(it,d,{enumerable:!0,configurable:!0,writable:!0,value:Hn}):it[d]=Hn;var A=(it,d,Hn)=>sE(it,typeof d!="symbol"?d+"":d,Hn);var In;const eg={noDataAvailableTitle:"No data in the current time frame",noDataAvailableDescription:"Once there is traffic, it will display here",limitedResultsShown:"Grouped value limit exceeded, showing the top {maxReturned}",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",error_rate:"Error rate",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_package:"API package",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",a2a_latency_average:"A2A latency (avg)",a2a_response_size_sum:"A2A Response Size (sum)",a2a_context_id:"A2A Context ID",a2a_error:"A2A Error",a2a_method:"A2A Method",a2a_task_id:"A2A Task ID",mcp_error:"MCP Error",mcp_method:"MCP Method",mcp_response_size_sum:"MCP Response Size (sum)",mcp_session_id:"MCP Session ID",mcp_tool_name:"MCP Tool Name",mcp_response_body_size_sum:"MCP Response Size (sum)",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count"},metricAxisTitles:{error_rate:"Error rate in {unit}",request_count:"Request count",request_per_minute:"Requests per minute",requests_per_minute:"Requests per minute",latency_in:"Latency in {unit}",size_in:"Size in {unit}",response_latency_average:"Response latency (avg) 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_size_sum:"Request size (sum) 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",a2a_latency_average:"A2A latency (avg) in {unit}",a2a_response_size_sum:"A2A Response Size (sum) in {unit}",a2a_context_id:"A2A Context ID",a2a_error:"A2A Error",a2a_method:"A2A Method",a2a_task_id:"A2A Task ID",mcp_response_size_sum:"MCP Response Size (sum) in {unit}",mcp_response_body_size_sum:"MCP Response Body Size (sum) in {unit}",control_plane_count:"Control plane count",service_count:"Gateway service count",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count"},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 ng(){const n=Hn.createI18n("en-us",eg);return{i18n:n,i18nT:Hn.i18nTComponent(n)}}/*!
|
|
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 Ki(n){return n+.5|0}const yn=(n,t,e)=>Math.max(Math.min(n,e),t);function Zi(n){return yn(Ki(n*2.55),0,255)}function bn(n){return yn(Ki(n*255),0,255)}function Ze(n){return yn(Ki(n/2.55)/100,0,1)}function Sc(n){return yn(Ki(n*100),0,100)}const Ee={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},
|
|
6
|
+
*/function Ki(n){return n+.5|0}const yn=(n,t,e)=>Math.max(Math.min(n,e),t);function Zi(n){return yn(Ki(n*2.55),0,255)}function bn(n){return yn(Ki(n*255),0,255)}function Ze(n){return yn(Ki(n/2.55)/100,0,1)}function Sc(n){return yn(Ki(n*100),0,100)}const Ee={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},za=[..."0123456789ABCDEF"],ig=n=>za[n&15],sg=n=>za[(n&240)>>4]+za[n&15],lr=n=>(n&240)>>4===(n&15),rg=n=>lr(n.r)&&lr(n.g)&&lr(n.b)&&lr(n.a);function ag(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&Ee[n[1]]*17,g:255&Ee[n[2]]*17,b:255&Ee[n[3]]*17,a:t===5?Ee[n[4]]*17:255}:(t===7||t===9)&&(e={r:Ee[n[1]]<<4|Ee[n[2]],g:Ee[n[3]]<<4|Ee[n[4]],b:Ee[n[5]]<<4|Ee[n[6]],a:t===9?Ee[n[7]]<<4|Ee[n[8]]:255})),e}const og=(n,t)=>n<255?t(n):"";function lg(n){var t=rg(n)?ig:sg;return n?"#"+t(n.r)+t(n.g)+t(n.b)+og(n.a,t):void 0}const cg=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function kc(n,t,e){const i=t*Math.min(e,1-e),s=(r,a=(r+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function ug(n,t,e){const i=(s,r=(s+n/60)%6)=>e-e*t*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function dg(n,t,e){const i=kc(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function hg(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function Ha(n){const e=n.r/255,i=n.g/255,s=n.b/255,r=Math.max(e,i,s),a=Math.min(e,i,s),o=(r+a)/2;let l,c,u;return r!==a&&(u=r-a,c=o>.5?u/(2-r-a):u/(r+a),l=hg(e,i,s,u,r),l=l*60+.5),[l|0,c||0,o]}function Wa(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(bn)}function Va(n,t,e){return Wa(kc,n,t,e)}function fg(n,t,e){return Wa(dg,n,t,e)}function mg(n,t,e){return Wa(ug,n,t,e)}function Tc(n){return(n%360+360)%360}function gg(n){const t=cg.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Zi(+t[5]):bn(+t[5]));const s=Tc(+t[2]),r=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=fg(s,r,a):t[1]==="hsv"?i=mg(s,r,a):i=Va(s,r,a),{r:i[0],g:i[1],b:i[2],a:e}}function pg(n,t){var e=Ha(n);e[0]=Tc(e[0]+t),e=Va(e),n.r=e[0],n.g=e[1],n.b=e[2]}function yg(n){if(!n)return;const t=Ha(n),e=t[0],i=Sc(t[1]),s=Sc(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Ze(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Dc={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Cc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function bg(){const n={},t=Object.keys(Cc),e=Object.keys(Dc);let i,s,r,a,o;for(i=0;i<t.length;i++){for(a=o=t[i],s=0;s<e.length;s++)r=e[s],o=o.replace(r,Dc[r]);r=parseInt(Cc[a],16),n[o]=[r>>16&255,r>>8&255,r&255]}return n}let cr;function _g(n){cr||(cr=bg(),cr.transparent=[0,0,0,0]);const t=cr[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const xg=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function wg(n){const t=xg.exec(n);let e=255,i,s,r;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Zi(a):yn(a*255,0,255)}return i=+t[1],s=+t[3],r=+t[5],i=255&(t[2]?Zi(i):yn(i,0,255)),s=255&(t[4]?Zi(s):yn(s,0,255)),r=255&(t[6]?Zi(r):yn(r,0,255)),{r:i,g:s,b:r,a:e}}}function vg(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Ze(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Ya=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,gi=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Mg(n,t,e){const i=gi(Ze(n.r)),s=gi(Ze(n.g)),r=gi(Ze(n.b));return{r:bn(Ya(i+e*(gi(Ze(t.r))-i))),g:bn(Ya(s+e*(gi(Ze(t.g))-s))),b:bn(Ya(r+e*(gi(Ze(t.b))-r))),a:n.a+e*(t.a-n.a)}}function ur(n,t,e){if(n){let i=Ha(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Va(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ec(n,t){return n&&Object.assign(t||{},n)}function Oc(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=bn(n[3]))):(t=Ec(n,{r:0,g:0,b:0,a:1}),t.a=bn(t.a)),t}function Sg(n){return n.charAt(0)==="r"?wg(n):gg(n)}class Qi{constructor(t){if(t instanceof Qi)return t;const e=typeof t;let i;e==="object"?i=Oc(t):e==="string"&&(i=ag(t)||_g(t)||Sg(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ec(this._rgb);return t&&(t.a=Ze(t.a)),t}set rgb(t){this._rgb=Oc(t)}rgbString(){return this._valid?vg(this._rgb):void 0}hexString(){return this._valid?lg(this._rgb):void 0}hslString(){return this._valid?yg(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let r;const a=e===r?.5:e,o=2*a-1,l=i.a-s.a,c=((o*l===-1?o:(o+l)/(1+o*l))+1)/2;r=1-c,i.r=255&c*i.r+r*s.r+.5,i.g=255&c*i.g+r*s.g+.5,i.b=255&c*i.b+r*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Mg(this._rgb,t._rgb,e)),this}clone(){return new Qi(this.rgb)}alpha(t){return this._rgb.a=bn(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ki(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ur(this._rgb,2,t),this}darken(t){return ur(this._rgb,2,-t),this}saturate(t){return ur(this._rgb,1,t),this}desaturate(t){return ur(this._rgb,1,-t),this}rotate(t){return pg(this._rgb,t),this}}/*!
|
|
7
7
|
* Chart.js v4.5.1
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function Qe(){}const Sg=(()=>{let n=0;return()=>n++})();function st(n){return n==null}function wt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ft(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function At(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Te(n,t){return At(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const kg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Pc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function St(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function kt(n,t,e,i){let s,r,a;if(wt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ft(n))for(a=Object.keys(n),r=a.length,s=0;s<r;s++)t.call(e,n[a[s]],a[s])}function dr(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function hr(n){if(wt(n))return n.map(hr);if(ft(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=hr(n[e[s]]);return t}return n}function Ac(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Tg(n,t,e,i){if(!Ac(n))return;const s=t[n],r=e[n];ft(s)&&ft(r)?Ji(s,r,i):t[n]=hr(r)}function Ji(n,t,e){const i=wt(t)?t:[t],s=i.length;if(!ft(n))return n;e=e||{};const r=e.merger||Tg;let a;for(let o=0;o<s;++o){if(a=i[o],!ft(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)r(l[c],n,a,e)}return n}function ts(n,t){return Ji(n,t,{merger:Dg})}function Dg(n,t,e){if(!Ac(n))return;const i=t[n],s=e[n];ft(i)&&ft(s)?ts(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=hr(s))}const Rc={"":n=>n,x:n=>n.x,y:n=>n.y};function Cg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Eg(n){const t=Cg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function _n(n,t){return(Rc[t]||(Rc[t]=Eg(t)))(n)}function $a(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=n=>typeof n=="function",Ic=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Og(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ut=Math.PI,Ct=2*ut,Pg=Ct+ut,fr=Number.POSITIVE_INFINITY,ja=ut/180,Ot=ut/2,Oe=ut/4,mr=ut*2/3,xn=Math.log10,Ye=Math.sign;function es(n,t,e){return Math.abs(n-t)<e}function Lc(n){const t=Math.round(n);n=es(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Ag(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function Rg(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function wn(n){return!Rg(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function Ig(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Nc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Vt(n){return n*(ut/180)}function gr(n){return n*(180/ut)}function Fc(n){if(!At(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function pr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*ut&&(r+=Ct),{angle:r,distance:s}}function gi(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Lg(n,t){return(n-t+Pg)%Ct-ut}function se(n){return(n%Ct+Ct)%Ct}function ns(n,t,e,i){const s=se(n),r=se(t),a=se(e),o=se(r-s),l=se(a-s),c=se(s-r),u=se(s-a);return s===r||s===a||i&&r===a||o>l&&c<u}function Kt(n,t,e){return Math.max(t,Math.min(e,n))}function Ng(n){return Kt(n,-32768,32767)}function Je(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Ua(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const tn=(n,t,e,i)=>Ua(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Fg=(n,t,e)=>Ua(n,e,i=>n[i][t]>=e);function zg(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const zc=["push","pop","shift","splice","unshift"];function Bg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),zc.forEach(e=>{const i="_onData"+$a(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const a=s.apply(this,r);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...r)}),a}})})}function Bc(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(zc.forEach(r=>{delete n[r]}),delete n._chartjs)}function Hc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Wc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Yc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Wc.call(window,()=>{i=!1,n.apply(t,e)}))}}function Hg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const qa=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Wg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Vc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:a,vScale:o,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:p}=a.getUserBounds();if(m){if(s=Math.min(tn(l,u,h).lo,e?i:tn(t,u,a.getPixelForValue(h)).lo),c){const b=l.slice(0,s+1).reverse().findIndex(x=>!st(x[o.axis]));s-=Math.max(0,b)}s=Kt(s,0,i-1)}if(p){let b=Math.max(tn(l,a.axis,f,!0).hi+1,e?0:tn(t,u,a.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(b-1).findIndex(v=>!st(v[o.axis]));b+=Math.max(0,x)}r=Kt(b,s,i)-s}else r=i-s}return{start:s,count:r}}function $c(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const yr=n=>n===0||n===1,jc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ct/e)),Uc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ct/e)+1,is={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ot)+1,easeOutSine:n=>Math.sin(n*Ot),easeInOutSine:n=>-.5*(Math.cos(ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>yr(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>yr(n)?n:jc(n,.075,.3),easeOutElastic:n=>yr(n)?n:Uc(n,.075,.3),easeInOutElastic(n){return yr(n)?n:n<.5?.5*jc(n*2,.1125,.45):.5+.5*Uc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-is.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?is.easeInBounce(n*2)*.5:is.easeOutBounce(n*2-1)*.5+.5};function Xa(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function qc(n){return Xa(n)?n:new Qi(n)}function Ga(n){return Xa(n)?n:new Qi(n).saturate(.5).darken(.1).hexString()}const Yg=["x","y","borderWidth","radius","tension"],Vg=["color","borderColor","backgroundColor"];function $g(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:Vg},numbers:{type:"number",properties:Yg}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function jg(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Xc=new Map;function Ug(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Xc.get(e);return i||(i=new Intl.NumberFormat(n,t),Xc.set(e,i)),i}function ss(n,t,e){return Ug(t,e).format(n)}const Gc={values(n){return wt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=qg(n,e)}const a=xn(Math.abs(r)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ss(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Gc.numeric.call(this,n,t,e):""}};function qg(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var br={formatters:Gc};function Xg(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:br.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Wn=Object.create(null),Ka=Object.create(null);function rs(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Za(n,t,e){return typeof t=="string"?Ji(rs(n,t),e):Ji(rs(n,""),t)}class Gg{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Ga(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ga(s.borderColor),this.hoverColor=(i,s)=>Ga(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Za(this,t,e)}get(t){return rs(this,t)}describe(t,e){return Za(Ka,t,e)}override(t,e){return Za(Wn,t,e)}route(t,e,i,s){const r=rs(this,t),a=rs(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=a[s];return ft(l)?Object.assign({},c,l):rt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Pt=new Gg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[$g,jg,Xg]);function Kg(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function _r(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function Zg(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const o=e.length;let l,c,u,h,f;for(l=0;l<o;l++)if(h=e[l],h!=null&&!wt(h))a=_r(n,s,r,a,h);else if(wt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!wt(f)&&(a=_r(n,s,r,a,f));n.restore();const m=r.length/2;if(m>e.length){for(l=0;l<m;l++)delete s[r[l]];r.splice(0,m)}return a}function Yn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Kc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Qa(n,t,e,i){Zc(n,t,e,i,null)}function Zc(n,t,e,i,s){let r,a,o,l,c,u,h,f;const m=t.pointStyle,p=t.rotation,b=t.radius;let x=(p||0)*ja;if(m&&typeof m=="object"&&(r=m.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(b)||b<=0)){switch(n.beginPath(),m){default:s?n.ellipse(e,i,s/2,b,0,0,Ct):n.arc(e,i,b,0,Ct),n.closePath();break;case"triangle":u=s?s/2:b,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*b),x+=mr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*b),x+=mr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*b),n.closePath();break;case"rectRounded":c=b*.516,l=b-c,a=Math.cos(x+Oe)*l,h=Math.cos(x+Oe)*(s?s/2-c:l),o=Math.sin(x+Oe)*l,f=Math.sin(x+Oe)*(s?s/2-c:l),n.arc(e-h,i-o,c,x-ut,x-Ot),n.arc(e+f,i-a,c,x-Ot,x),n.arc(e+h,i+o,c,x,x+Ot),n.arc(e-f,i+a,c,x+Ot,x+ut),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*b,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Oe;case"rectRot":h=Math.cos(x)*(s?s/2:b),a=Math.cos(x)*b,o=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-o),n.lineTo(e+f,i-a),n.lineTo(e+h,i+o),n.lineTo(e-f,i+a),n.closePath();break;case"crossRot":x+=Oe;case"cross":h=Math.cos(x)*(s?s/2:b),a=Math.cos(x)*b,o=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"star":h=Math.cos(x)*(s?s/2:b),a=Math.cos(x)*b,o=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a),x+=Oe,h=Math.cos(x)*(s?s/2:b),a=Math.cos(x)*b,o=Math.sin(x)*b,f=Math.sin(x)*(s?s/2:b),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"line":a=s?s/2:Math.cos(x)*b,o=Math.sin(x)*b,n.moveTo(e-a,i-o),n.lineTo(e+a,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:b),i+Math.sin(x)*b);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function en(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function as(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function os(n){n.restore()}function Qg(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function Jg(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function tp(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),st(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function ep(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),a=t-r.actualBoundingBoxLeft,o=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,u),n.lineTo(o,u),n.stroke()}}function np(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Vn(n,t,e,i,s,r={}){const a=wt(t)?t:[t],o=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,tp(n,r),l=0;l<a.length;++l)c=a[l],r.backdrop&&np(n,r.backdrop),o&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),st(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),ep(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function pi(n,t){const{x:e,y:i,w:s,h:r,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*ut,ut,!0),n.lineTo(e,i+r-a.bottomLeft),n.arc(e+a.bottomLeft,i+r-a.bottomLeft,a.bottomLeft,ut,Ot,!0),n.lineTo(e+s-a.bottomRight,i+r),n.arc(e+s-a.bottomRight,i+r-a.bottomRight,a.bottomRight,Ot,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-Ot,!0),n.lineTo(e+a.topLeft,i)}const ip=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,sp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function rp(n,t){const e=(""+n).match(ip);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const ap=n=>+n||0;function Ja(n,t){const e={},i=ft(t),s=i?Object.keys(t):t,r=ft(n)?i?a=>rt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=ap(r(a));return e}function Qc(n){return Ja(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(n){return Ja(n,["topLeft","topRight","bottomLeft","bottomRight"])}function $t(n){const t=Qc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Rt(n,t){n=n||{},t=t||Pt.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=rt(n.style,t.style);i&&!(""+i).match(sp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:rt(n.family,t.family),lineHeight:rp(rt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:rt(n.weight,t.weight),string:""};return s.string=Kg(s),s}function ls(n,t,e,i){let s,r,a;for(s=0,r=n.length;s<r;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function op(n,t,e){const{min:i,max:s}=n,r=Pc(t,(s-i)/2),a=(o,l)=>e&&o===0?0:o+l;return{min:a(i,-Math.abs(r)),max:a(s,r)}}function Mn(n,t){return Object.assign(Object.create(n),t)}function to(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=iu("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:o=>to([o,...n],t,r,i)};return new Proxy(a,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return tu(o,l,()=>gp(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return su(o).includes(l)},ownKeys(o){return su(o)},set(o,l,c){const u=o._storage||(o._storage=s());return o[l]=u[l]=c,delete o._keys,!0}})}function yi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Jc(n,i),setContext:r=>yi(n,r,e,i),override:r=>yi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,a){return delete r[a],delete n[a],!0},get(r,a,o){return tu(r,a,()=>cp(r,a,o))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(r,a,o){return n[a]=o,delete r[a],!0}})}function Jc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const lp=(n,t)=>n?n+$a(t):t,eo=(n,t)=>ft(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function tu(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function cp(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:a}=n;let o=i[t];return pe(o)&&a.isScriptable(t)&&(o=up(t,o,n,e)),wt(o)&&o.length&&(o=dp(t,o,n,a.isIndexable)),eo(t,o)&&(o=yi(o,s,r&&r[t],a)),o}function up(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(r,a||i);return o.delete(n),eo(n,l)&&(l=no(s._scopes,s,n,l)),l}function dp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_descriptors:o}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ft(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=no(c,s,n,u);t.push(yi(h,r,a&&a[n],o))}}return t}function eu(n,t,e){return pe(n)?n(t,e):n}const hp=(n,t)=>n===!0?t:typeof n=="string"?_n(t,n):void 0;function fp(n,t,e,i,s){for(const r of t){const a=hp(e,r);if(a){n.add(a);const o=eu(a._fallback,e,s);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function no(n,t,e,i){const s=t._rootScopes,r=eu(t._fallback,e,i),a=[...n,...s],o=new Set;o.add(i);let l=nu(o,a,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=nu(o,a,r,l,i),l===null)?!1:to(Array.from(o),[""],s,r,()=>mp(t,e,i))}function nu(n,t,e,i,s){for(;e;)e=fp(n,t,e,i,s);return e}function mp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return wt(s)&&ft(e)?e:s||{}}function gp(n,t,e,i){let s;for(const r of t)if(s=iu(lp(r,n),e),typeof s<"u")return eo(n,s)?no(e,i,n,s):s}function iu(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function su(n){let t=n._keys;return t||(t=n._keys=pp(n._scopes)),t}function pp(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function ru(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,a=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],a[o]={r:s.parse(_n(u,r),c)};return a}const yp=Number.EPSILON||1e-14,bi=(n,t)=>t<n.length&&!n[t].skip&&n[t],au=n=>n==="x"?"y":"x";function bp(n,t,e,i){const s=n.skip?t:n,r=t,a=e.skip?t:e,o=gi(r,s),l=gi(a,r);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:r.x-h*(a.x-s.x),y:r.y-h*(a.y-s.y)},next:{x:r.x+f*(a.x-s.x),y:r.y+f*(a.y-s.y)}}}function _p(n,t,e){const i=n.length;let s,r,a,o,l,c=bi(n,0);for(let u=0;u<i-1;++u)if(l=c,c=bi(n,u+1),!(!l||!c)){if(es(t[u],0,yp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],o=Math.pow(s,2)+Math.pow(r,2),!(o<=9)&&(a=3/Math.sqrt(o),e[u]=s*a*t[u],e[u+1]=r*a*t[u])}}function xp(n,t,e="x"){const i=au(e),s=n.length;let r,a,o,l=bi(n,0);for(let c=0;c<s;++c){if(a=o,o=l,l=bi(n,c+1),!o)continue;const u=o[e],h=o[i];a&&(r=(u-a[e])/3,o[`cp1${e}`]=u-r,o[`cp1${i}`]=h-r*t[c]),l&&(r=(l[e]-u)/3,o[`cp2${e}`]=u+r,o[`cp2${i}`]=h+r*t[c])}}function wp(n,t="x"){const e=au(t),i=n.length,s=Array(i).fill(0),r=Array(i);let a,o,l,c=bi(n,0);for(a=0;a<i;++a)if(o=l,l=c,c=bi(n,a+1),!!l){if(c){const u=c[t]-l[t];s[a]=u!==0?(c[e]-l[e])/u:0}r[a]=o?c?Ye(s[a-1])!==Ye(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}_p(n,s,r),xp(n,r,t)}function xr(n,t,e){return Math.max(Math.min(n,e),t)}function vp(n,t){let e,i,s,r,a,o=en(n[0],t);for(e=0,i=n.length;e<i;++e)a=r,r=o,o=e<i-1&&en(n[e+1],t),r&&(s=n[e],a&&(s.cp1x=xr(s.cp1x,t.left,t.right),s.cp1y=xr(s.cp1y,t.top,t.bottom)),o&&(s.cp2x=xr(s.cp2x,t.left,t.right),s.cp2y=xr(s.cp2y,t.top,t.bottom)))}function Mp(n,t,e,i,s){let r,a,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")wp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,a=n.length;r<a;++r)o=n[r],l=bp(c,o,n[Math.min(r+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&&vp(n,e)}function io(){return typeof window<"u"&&typeof document<"u"}function so(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const vr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Sp(n,t){return vr(n).getPropertyValue(t)}const kp=["top","right","bottom","left"];function $n(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=kp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Tp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Dp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let a=!1,o,l;if(Tp(s,r,n.target))o=s,l=r;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 Sn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=vr(e),r=s.boxSizing==="border-box",a=$n(s,"padding"),o=$n(s,"border","width"),{x:l,y:c,box:u}=Dp(n,e),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:p}=t;return r&&(m-=a.width+o.width,p-=a.height+o.height),{x:Math.round((l-h)/m*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Cp(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&so(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const a=r.getBoundingClientRect(),o=vr(r),l=$n(o,"border","width"),c=$n(o,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=wr(o.maxWidth,r,"clientWidth"),s=wr(o.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||fr,maxHeight:s||fr}}const kn=n=>Math.round(n*10)/10;function Ep(n,t,e,i){const s=vr(n),r=$n(s,"margin"),a=wr(s.maxWidth,n,"clientWidth")||fr,o=wr(s.maxHeight,n,"clientHeight")||fr,l=Cp(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=$n(s,"border","width"),m=$n(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=kn(Math.min(c,a,l.maxWidth)),u=kn(Math.min(u,o,l.maxHeight)),c&&!u&&(u=kn(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=kn(Math.floor(u*i))),{width:c,height:u}}function ou(n,t,e){const i=t||1,s=kn(n.height*i),r=kn(n.width*i);n.height=kn(n.height),n.width=kn(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==r?(n.currentDevicePixelRatio=i,a.height=s,a.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Op=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};io()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function lu(n,t){const e=Sp(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function jn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Pp(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Ap(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},a=jn(n,s,e),o=jn(s,r,e),l=jn(r,t,e),c=jn(a,o,e),u=jn(o,l,e);return jn(c,u,e)}const Rp=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Ip=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function _i(n,t,e){return n?Rp(t,e):Ip()}function cu(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function uu(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function du(n){return n==="angle"?{between:ns,compare:Lg,normalize:se}:{between:Je,compare:(t,e)=>t-e,normalize:t=>t}}function hu({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Lp(n,t,e){const{property:i,start:s,end:r}=e,{between:a,normalize:o}=du(i),l=t.length;let{start:c,end:u,loop:h}=n,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&a(o(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:n.style}}function fu(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,a=t.length,{compare:o,between:l,normalize:c}=du(i),{start:u,end:h,loop:f,style:m}=Lp(n,t,e),p=[];let b=!1,x=null,v,S,D;const P=()=>l(s,D,v)&&o(s,D)!==0,O=()=>o(r,v)===0||l(r,D,v),C=()=>b||P(),k=()=>!b||O();for(let g=u,_=u;g<=h;++g)S=t[g%a],!S.skip&&(v=c(S[i]),v!==D&&(b=l(v,s,r),x===null&&C()&&(x=o(v,s)===0?g:_),x!==null&&k()&&(p.push(hu({start:x,end:g,loop:f,count:a,style:m})),x=null),_=g,D=v));return x!==null&&p.push(hu({start:x,end:h,loop:f,count:a,style:m})),p}function mu(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=fu(i[s],n.points,t);r.length&&e.push(...r)}return e}function Np(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Fp(n,t,e,i){const s=n.length,r=[];let a=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?o.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,o.skip&&(t=l)),o=c}return a!==null&&r.push({start:t%s,end:a%s,loop:i}),r}function zp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:a,end:o}=Np(e,s,r,i);if(i===!0)return gu(n,[{start:a,end:o,loop:r}],e,t);const l=o<a?o+s:o,c=!!n._fullLoop&&a===0&&o===s-1;return gu(n,Fp(e,a,l,c),e,t)}function gu(n,t,e,i){return!i||!i.setContext||!e?t:Bp(n,t,e,i)}function Bp(n,t,e,i){const s=n._chart.getContext(),r=pu(n.options),{_datasetIndex:a,options:{spanGaps:o}}=n,l=e.length,c=[];let u=r,h=t[0].start,f=h;function m(p,b,x,v){const S=o?-1:1;if(p!==b){for(p+=l;e[p%l].skip;)p-=S;for(;e[b%l].skip;)b+=S;p%l!==b%l&&(c.push({start:p%l,end:b%l,loop:x,style:v}),u=v,h=b%l)}}for(const p of t){h=o?h:p.start;let b=e[h%l],x;for(f=h+1;f<=p.end;f++){const v=e[f%l];x=pu(i.setContext(Mn(s,{type:"segment",p0:b,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),Hp(x,u)&&m(h,f-1,p.loop,u),b=v,u=x}h<f-1&&m(h,f-1,p.loop,u)}return c}function pu(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Hp(n,t){if(!t)return!1;const e=[],i=function(s,r){return Xa(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Mr(n,t,e){return n.options.clip?n[e]:t[e]}function Wp(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Mr(e,t,"left"),right:Mr(e,t,"right"),top:Mr(i,t,"top"),bottom:Mr(i,t,"bottom")}:t}function yu(n,t){const e=t._clip;if(e.disabled)return!1;const i=Wp(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
|
11
|
+
*/function Qe(){}const kg=(()=>{let n=0;return()=>n++})();function st(n){return n==null}function wt(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function ft(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function At(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Te(n,t){return At(n)?n:t}function rt(n,t){return typeof n>"u"?t:n}const Tg=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Pc=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function St(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function kt(n,t,e,i){let s,r,a;if(wt(n))for(r=n.length,s=0;s<r;s++)t.call(e,n[s],s);else if(ft(n))for(a=Object.keys(n),r=a.length,s=0;s<r;s++)t.call(e,n[a[s]],a[s])}function dr(n,t){let e,i,s,r;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],r=t[e],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function hr(n){if(wt(n))return n.map(hr);if(ft(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=hr(n[e[s]]);return t}return n}function Ac(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Dg(n,t,e,i){if(!Ac(n))return;const s=t[n],r=e[n];ft(s)&&ft(r)?Ji(s,r,i):t[n]=hr(r)}function Ji(n,t,e){const i=wt(t)?t:[t],s=i.length;if(!ft(n))return n;e=e||{};const r=e.merger||Dg;let a;for(let o=0;o<s;++o){if(a=i[o],!ft(a))continue;const l=Object.keys(a);for(let c=0,u=l.length;c<u;++c)r(l[c],n,a,e)}return n}function ts(n,t){return Ji(n,t,{merger:Cg})}function Cg(n,t,e){if(!Ac(n))return;const i=t[n],s=e[n];ft(i)&&ft(s)?ts(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=hr(s))}const Rc={"":n=>n,x:n=>n.x,y:n=>n.y};function Eg(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Og(n){const t=Eg(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function _n(n,t){return(Rc[t]||(Rc[t]=Og(t)))(n)}function $a(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ge=n=>typeof n<"u",pe=n=>typeof n=="function",Ic=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Pg(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const ut=Math.PI,Ct=2*ut,Ag=Ct+ut,fr=Number.POSITIVE_INFINITY,ja=ut/180,Ot=ut/2,Oe=ut/4,mr=ut*2/3,xn=Math.log10,Ve=Math.sign;function es(n,t,e){return Math.abs(n-t)<e}function Lc(n){const t=Math.round(n);n=es(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(xn(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Rg(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,r)=>s-r).pop(),t}function Ig(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function wn(n){return!Ig(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function Lg(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Nc(n,t,e){let i,s,r;for(i=0,s=n.length;i<s;i++)r=n[i][e],isNaN(r)||(t.min=Math.min(t.min,r),t.max=Math.max(t.max,r))}function Yt(n){return n*(ut/180)}function gr(n){return n*(180/ut)}function Fc(n){if(!At(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function pr(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let r=Math.atan2(i,e);return r<-.5*ut&&(r+=Ct),{angle:r,distance:s}}function pi(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Ng(n,t){return(n-t+Ag)%Ct-ut}function se(n){return(n%Ct+Ct)%Ct}function ns(n,t,e,i){const s=se(n),r=se(t),a=se(e),o=se(r-s),l=se(a-s),c=se(s-r),u=se(s-a);return s===r||s===a||i&&r===a||o>l&&c<u}function Kt(n,t,e){return Math.max(t,Math.min(e,n))}function Fg(n){return Kt(n,-32768,32767)}function Je(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Ua(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,e(r)?s=r:i=r;return{lo:s,hi:i}}const tn=(n,t,e,i)=>Ua(n,e,i?s=>{const r=n[s][t];return r<e||r===e&&n[s+1][t]===e}:s=>n[s][t]<e),Bg=(n,t,e)=>Ua(n,e,i=>n[i][t]>=e);function zg(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Bc=["push","pop","shift","splice","unshift"];function Hg(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Bc.forEach(e=>{const i="_onData"+$a(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...r){const a=s.apply(this,r);return n._chartjs.listeners.forEach(o=>{typeof o[i]=="function"&&o[i](...r)}),a}})})}function zc(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Bc.forEach(r=>{delete n[r]}),delete n._chartjs)}function Hc(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Wc=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Vc(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,Wc.call(window,()=>{i=!1,n.apply(t,e)}))}}function Wg(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const qa=n=>n==="start"?"left":n==="end"?"right":"center",re=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Vg=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Yc(n,t,e){const i=t.length;let s=0,r=i;if(n._sorted){const{iScale:a,vScale:o,_parsed:l}=n,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=a.axis,{min:h,max:f,minDefined:m,maxDefined:p}=a.getUserBounds();if(m){if(s=Math.min(tn(l,u,h).lo,e?i:tn(t,u,a.getPixelForValue(h)).lo),c){const _=l.slice(0,s+1).reverse().findIndex(x=>!st(x[o.axis]));s-=Math.max(0,_)}s=Kt(s,0,i-1)}if(p){let _=Math.max(tn(l,a.axis,f,!0).hi+1,e?0:tn(t,u,a.getPixelForValue(f),!0).hi+1);if(c){const x=l.slice(_-1).findIndex(v=>!st(v[o.axis]));_+=Math.max(0,x)}r=Kt(_,s,i)-s}else r=i-s}return{start:s,count:r}}function $c(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const r=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),r}const yr=n=>n===0||n===1,jc=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*Ct/e)),Uc=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*Ct/e)+1,is={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ot)+1,easeOutSine:n=>Math.sin(n*Ot),easeInOutSine:n=>-.5*(Math.cos(ut*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>yr(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>yr(n)?n:jc(n,.075,.3),easeOutElastic:n=>yr(n)?n:Uc(n,.075,.3),easeInOutElastic(n){return yr(n)?n:n<.5?.5*jc(n*2,.1125,.45):.5+.5*Uc(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-is.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?is.easeInBounce(n*2)*.5:is.easeOutBounce(n*2-1)*.5+.5};function Xa(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function qc(n){return Xa(n)?n:new Qi(n)}function Ga(n){return Xa(n)?n:new Qi(n).saturate(.5).darken(.1).hexString()}const Yg=["x","y","borderWidth","radius","tension"],$g=["color","borderColor","backgroundColor"];function jg(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:$g},numbers:{type:"number",properties:Yg}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ug(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Xc=new Map;function qg(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Xc.get(e);return i||(i=new Intl.NumberFormat(n,t),Xc.set(e,i)),i}function ss(n,t,e){return qg(t,e).format(n)}const Gc={values(n){return wt(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,r=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),r=Xg(n,e)}const a=xn(Math.abs(r)),o=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:o,maximumFractionDigits:o};return Object.assign(l,this.options.ticks.format),ss(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(xn(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Gc.numeric.call(this,n,t,e):""}};function Xg(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var br={formatters:Gc};function Gg(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:br.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Wn=Object.create(null),Ka=Object.create(null);function rs(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const r=e[i];n=n[r]||(n[r]=Object.create(null))}return n}function Za(n,t,e){return typeof t=="string"?Ji(rs(n,t),e):Ji(rs(n,""),t)}class Kg{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Ga(s.backgroundColor),this.hoverBorderColor=(i,s)=>Ga(s.borderColor),this.hoverColor=(i,s)=>Ga(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Za(this,t,e)}get(t){return rs(this,t)}describe(t,e){return Za(Ka,t,e)}override(t,e){return Za(Wn,t,e)}route(t,e,i,s){const r=rs(this,t),a=rs(this,i),o="_"+e;Object.defineProperties(r,{[o]:{value:r[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[o],c=a[s];return ft(l)?Object.assign({},c,l):rt(l,c)},set(l){this[o]=l}}})}apply(t){t.forEach(e=>e(this))}}var Pt=new Kg({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[jg,Ug,Gg]);function Zg(n){return!n||st(n.size)||st(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function _r(n,t,e,i,s){let r=t[s];return r||(r=t[s]=n.measureText(s).width,e.push(s)),r>i&&(i=r),i}function Qg(n,t,e,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},r=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const o=e.length;let l,c,u,h,f;for(l=0;l<o;l++)if(h=e[l],h!=null&&!wt(h))a=_r(n,s,r,a,h);else if(wt(h))for(c=0,u=h.length;c<u;c++)f=h[c],f!=null&&!wt(f)&&(a=_r(n,s,r,a,f));n.restore();const m=r.length/2;if(m>e.length){for(l=0;l<m;l++)delete s[r[l]];r.splice(0,m)}return a}function Vn(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Kc(n,t){!t&&!n||(t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore())}function Qa(n,t,e,i){Zc(n,t,e,i,null)}function Zc(n,t,e,i,s){let r,a,o,l,c,u,h,f;const m=t.pointStyle,p=t.rotation,_=t.radius;let x=(p||0)*ja;if(m&&typeof m=="object"&&(r=m.toString(),r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(x),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:s?n.ellipse(e,i,s/2,_,0,0,Ct):n.arc(e,i,_,0,Ct),n.closePath();break;case"triangle":u=s?s/2:_,n.moveTo(e+Math.sin(x)*u,i-Math.cos(x)*_),x+=mr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*_),x+=mr,n.lineTo(e+Math.sin(x)*u,i-Math.cos(x)*_),n.closePath();break;case"rectRounded":c=_*.516,l=_-c,a=Math.cos(x+Oe)*l,h=Math.cos(x+Oe)*(s?s/2-c:l),o=Math.sin(x+Oe)*l,f=Math.sin(x+Oe)*(s?s/2-c:l),n.arc(e-h,i-o,c,x-ut,x-Ot),n.arc(e+f,i-a,c,x-Ot,x),n.arc(e+h,i+o,c,x,x+Ot),n.arc(e-f,i+a,c,x+Ot,x+ut),n.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*_,u=s?s/2:l,n.rect(e-u,i-l,2*u,2*l);break}x+=Oe;case"rectRot":h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+f,i-a),n.lineTo(e+h,i+o),n.lineTo(e-f,i+a),n.closePath();break;case"crossRot":x+=Oe;case"cross":h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"star":h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a),x+=Oe,h=Math.cos(x)*(s?s/2:_),a=Math.cos(x)*_,o=Math.sin(x)*_,f=Math.sin(x)*(s?s/2:_),n.moveTo(e-h,i-o),n.lineTo(e+h,i+o),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"line":a=s?s/2:Math.cos(x)*_,o=Math.sin(x)*_,n.moveTo(e-a,i-o),n.lineTo(e+a,i+o);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(x)*(s?s/2:_),i+Math.sin(x)*_);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function en(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function as(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function os(n){n.restore()}function Jg(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const r=(t.x+e.x)/2;n.lineTo(r,t.y),n.lineTo(r,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function tp(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function ep(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),st(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function np(n,t,e,i,s){if(s.strikethrough||s.underline){const r=n.measureText(i),a=t-r.actualBoundingBoxLeft,o=t+r.actualBoundingBoxRight,l=e-r.actualBoundingBoxAscent,c=e+r.actualBoundingBoxDescent,u=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,u),n.lineTo(o,u),n.stroke()}}function ip(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Yn(n,t,e,i,s,r={}){const a=wt(t)?t:[t],o=r.strokeWidth>0&&r.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,ep(n,r),l=0;l<a.length;++l)c=a[l],r.backdrop&&ip(n,r.backdrop),o&&(r.strokeColor&&(n.strokeStyle=r.strokeColor),st(r.strokeWidth)||(n.lineWidth=r.strokeWidth),n.strokeText(c,e,i,r.maxWidth)),n.fillText(c,e,i,r.maxWidth),np(n,e,i,c,r),i+=Number(s.lineHeight);n.restore()}function yi(n,t){const{x:e,y:i,w:s,h:r,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*ut,ut,!0),n.lineTo(e,i+r-a.bottomLeft),n.arc(e+a.bottomLeft,i+r-a.bottomLeft,a.bottomLeft,ut,Ot,!0),n.lineTo(e+s-a.bottomRight,i+r),n.arc(e+s-a.bottomRight,i+r-a.bottomRight,a.bottomRight,Ot,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-Ot,!0),n.lineTo(e+a.topLeft,i)}const sp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,rp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ap(n,t){const e=(""+n).match(sp);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const op=n=>+n||0;function Ja(n,t){const e={},i=ft(t),s=i?Object.keys(t):t,r=ft(n)?i?a=>rt(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=op(r(a));return e}function Qc(n){return Ja(n,{top:"y",right:"x",bottom:"y",left:"x"})}function vn(n){return Ja(n,["topLeft","topRight","bottomLeft","bottomRight"])}function $t(n){const t=Qc(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Rt(n,t){n=n||{},t=t||Pt.font;let e=rt(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=rt(n.style,t.style);i&&!(""+i).match(rp)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:rt(n.family,t.family),lineHeight:ap(rt(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:rt(n.weight,t.weight),string:""};return s.string=Zg(s),s}function ls(n,t,e,i){let s,r,a;for(s=0,r=n.length;s<r;++s)if(a=n[s],a!==void 0&&a!==void 0)return a}function lp(n,t,e){const{min:i,max:s}=n,r=Pc(t,(s-i)/2),a=(o,l)=>e&&o===0?0:o+l;return{min:a(i,-Math.abs(r)),max:a(s,r)}}function Mn(n,t){return Object.assign(Object.create(n),t)}function to(n,t=[""],e,i,s=()=>n[0]){const r=e||n;typeof i>"u"&&(i=iu("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:r,_fallback:i,_getTarget:s,override:o=>to([o,...n],t,r,i)};return new Proxy(a,{deleteProperty(o,l){return delete o[l],delete o._keys,delete n[0][l],!0},get(o,l){return tu(o,l,()=>pp(l,t,n,o))},getOwnPropertyDescriptor(o,l){return Reflect.getOwnPropertyDescriptor(o._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,l){return su(o).includes(l)},ownKeys(o){return su(o)},set(o,l,c){const u=o._storage||(o._storage=s());return o[l]=u[l]=c,delete o._keys,!0}})}function bi(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Jc(n,i),setContext:r=>bi(n,r,e,i),override:r=>bi(n.override(r),t,e,i)};return new Proxy(s,{deleteProperty(r,a){return delete r[a],delete n[a],!0},get(r,a,o){return tu(r,a,()=>up(r,a,o))},getOwnPropertyDescriptor(r,a){return r._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(r,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(r,a,o){return n[a]=o,delete r[a],!0}})}function Jc(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:pe(e)?e:()=>e,isIndexable:pe(i)?i:()=>i}}const cp=(n,t)=>n?n+$a(t):t,eo=(n,t)=>ft(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function tu(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t)||t==="constructor")return n[t];const i=e();return n[t]=i,i}function up(n,t,e){const{_proxy:i,_context:s,_subProxy:r,_descriptors:a}=n;let o=i[t];return pe(o)&&a.isScriptable(t)&&(o=dp(t,o,n,e)),wt(o)&&o.length&&(o=hp(t,o,n,a.isIndexable)),eo(t,o)&&(o=bi(o,s,r&&r[t],a)),o}function dp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_stack:o}=e;if(o.has(n))throw new Error("Recursion detected: "+Array.from(o).join("->")+"->"+n);o.add(n);let l=t(r,a||i);return o.delete(n),eo(n,l)&&(l=no(s._scopes,s,n,l)),l}function hp(n,t,e,i){const{_proxy:s,_context:r,_subProxy:a,_descriptors:o}=e;if(typeof r.index<"u"&&i(n))return t[r.index%t.length];if(ft(t[0])){const l=t,c=s._scopes.filter(u=>u!==l);t=[];for(const u of l){const h=no(c,s,n,u);t.push(bi(h,r,a&&a[n],o))}}return t}function eu(n,t,e){return pe(n)?n(t,e):n}const fp=(n,t)=>n===!0?t:typeof n=="string"?_n(t,n):void 0;function mp(n,t,e,i,s){for(const r of t){const a=fp(e,r);if(a){n.add(a);const o=eu(a._fallback,e,s);if(typeof o<"u"&&o!==e&&o!==i)return o}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function no(n,t,e,i){const s=t._rootScopes,r=eu(t._fallback,e,i),a=[...n,...s],o=new Set;o.add(i);let l=nu(o,a,e,r||e,i);return l===null||typeof r<"u"&&r!==e&&(l=nu(o,a,r,l,i),l===null)?!1:to(Array.from(o),[""],s,r,()=>gp(t,e,i))}function nu(n,t,e,i,s){for(;e;)e=mp(n,t,e,i,s);return e}function gp(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return wt(s)&&ft(e)?e:s||{}}function pp(n,t,e,i){let s;for(const r of t)if(s=iu(cp(r,n),e),typeof s<"u")return eo(n,s)?no(e,i,n,s):s}function iu(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function su(n){let t=n._keys;return t||(t=n._keys=yp(n._scopes)),t}function yp(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function ru(n,t,e,i){const{iScale:s}=n,{key:r="r"}=this._parsing,a=new Array(i);let o,l,c,u;for(o=0,l=i;o<l;++o)c=o+e,u=t[c],a[o]={r:s.parse(_n(u,r),c)};return a}const bp=Number.EPSILON||1e-14,_i=(n,t)=>t<n.length&&!n[t].skip&&n[t],au=n=>n==="x"?"y":"x";function _p(n,t,e,i){const s=n.skip?t:n,r=t,a=e.skip?t:e,o=pi(r,s),l=pi(a,r);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:r.x-h*(a.x-s.x),y:r.y-h*(a.y-s.y)},next:{x:r.x+f*(a.x-s.x),y:r.y+f*(a.y-s.y)}}}function xp(n,t,e){const i=n.length;let s,r,a,o,l,c=_i(n,0);for(let u=0;u<i-1;++u)if(l=c,c=_i(n,u+1),!(!l||!c)){if(es(t[u],0,bp)){e[u]=e[u+1]=0;continue}s=e[u]/t[u],r=e[u+1]/t[u],o=Math.pow(s,2)+Math.pow(r,2),!(o<=9)&&(a=3/Math.sqrt(o),e[u]=s*a*t[u],e[u+1]=r*a*t[u])}}function wp(n,t,e="x"){const i=au(e),s=n.length;let r,a,o,l=_i(n,0);for(let c=0;c<s;++c){if(a=o,o=l,l=_i(n,c+1),!o)continue;const u=o[e],h=o[i];a&&(r=(u-a[e])/3,o[`cp1${e}`]=u-r,o[`cp1${i}`]=h-r*t[c]),l&&(r=(l[e]-u)/3,o[`cp2${e}`]=u+r,o[`cp2${i}`]=h+r*t[c])}}function vp(n,t="x"){const e=au(t),i=n.length,s=Array(i).fill(0),r=Array(i);let a,o,l,c=_i(n,0);for(a=0;a<i;++a)if(o=l,l=c,c=_i(n,a+1),!!l){if(c){const u=c[t]-l[t];s[a]=u!==0?(c[e]-l[e])/u:0}r[a]=o?c?Ve(s[a-1])!==Ve(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}xp(n,s,r),wp(n,r,t)}function xr(n,t,e){return Math.max(Math.min(n,e),t)}function Mp(n,t){let e,i,s,r,a,o=en(n[0],t);for(e=0,i=n.length;e<i;++e)a=r,r=o,o=e<i-1&&en(n[e+1],t),r&&(s=n[e],a&&(s.cp1x=xr(s.cp1x,t.left,t.right),s.cp1y=xr(s.cp1y,t.top,t.bottom)),o&&(s.cp2x=xr(s.cp2x,t.left,t.right),s.cp2y=xr(s.cp2y,t.top,t.bottom)))}function Sp(n,t,e,i,s){let r,a,o,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")vp(n,s);else{let c=i?n[n.length-1]:n[0];for(r=0,a=n.length;r<a;++r)o=n[r],l=_p(c,o,n[Math.min(r+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&&Mp(n,e)}function io(){return typeof window<"u"&&typeof document<"u"}function so(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wr(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const vr=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function kp(n,t){return vr(n).getPropertyValue(t)}const Tp=["top","right","bottom","left"];function $n(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const r=Tp[s];i[r]=parseFloat(n[t+"-"+r+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Dp=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Cp(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:r}=i;let a=!1,o,l;if(Dp(s,r,n.target))o=s,l=r;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 Sn(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=vr(e),r=s.boxSizing==="border-box",a=$n(s,"padding"),o=$n(s,"border","width"),{x:l,y:c,box:u}=Cp(n,e),h=a.left+(u&&o.left),f=a.top+(u&&o.top);let{width:m,height:p}=t;return r&&(m-=a.width+o.width,p-=a.height+o.height),{x:Math.round((l-h)/m*e.width/i),y:Math.round((c-f)/p*e.height/i)}}function Ep(n,t,e){let i,s;if(t===void 0||e===void 0){const r=n&&so(n);if(!r)t=n.clientWidth,e=n.clientHeight;else{const a=r.getBoundingClientRect(),o=vr(r),l=$n(o,"border","width"),c=$n(o,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=wr(o.maxWidth,r,"clientWidth"),s=wr(o.maxHeight,r,"clientHeight")}}return{width:t,height:e,maxWidth:i||fr,maxHeight:s||fr}}const kn=n=>Math.round(n*10)/10;function Op(n,t,e,i){const s=vr(n),r=$n(s,"margin"),a=wr(s.maxWidth,n,"clientWidth")||fr,o=wr(s.maxHeight,n,"clientHeight")||fr,l=Ep(n,t,e);let{width:c,height:u}=l;if(s.boxSizing==="content-box"){const f=$n(s,"border","width"),m=$n(s,"padding");c-=m.width+f.width,u-=m.height+f.height}return c=Math.max(0,c-r.width),u=Math.max(0,i?c/i:u-r.height),c=kn(Math.min(c,a,l.maxWidth)),u=kn(Math.min(u,o,l.maxHeight)),c&&!u&&(u=kn(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&u>l.height&&(u=l.height,c=kn(Math.floor(u*i))),{width:c,height:u}}function ou(n,t,e){const i=t||1,s=kn(n.height*i),r=kn(n.width*i);n.height=kn(n.height),n.width=kn(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==r?(n.currentDevicePixelRatio=i,a.height=s,a.width=r,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Pp=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};io()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return n}();function lu(n,t){const e=kp(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function jn(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Ap(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Rp(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},r={x:t.cp1x,y:t.cp1y},a=jn(n,s,e),o=jn(s,r,e),l=jn(r,t,e),c=jn(a,o,e),u=jn(o,l,e);return jn(c,u,e)}const Ip=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},Lp=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function xi(n,t,e){return n?Ip(t,e):Lp()}function cu(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function uu(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function du(n){return n==="angle"?{between:ns,compare:Ng,normalize:se}:{between:Je,compare:(t,e)=>t-e,normalize:t=>t}}function hu({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function Np(n,t,e){const{property:i,start:s,end:r}=e,{between:a,normalize:o}=du(i),l=t.length;let{start:c,end:u,loop:h}=n,f,m;if(h){for(c+=l,u+=l,f=0,m=l;f<m&&a(o(t[c%l][i]),s,r);++f)c--,u--;c%=l,u%=l}return u<c&&(u+=l),{start:c,end:u,loop:h,style:n.style}}function fu(n,t,e){if(!e)return[n];const{property:i,start:s,end:r}=e,a=t.length,{compare:o,between:l,normalize:c}=du(i),{start:u,end:h,loop:f,style:m}=Np(n,t,e),p=[];let _=!1,x=null,v,k,E;const P=()=>l(s,E,v)&&o(s,E)!==0,O=()=>o(r,v)===0||l(r,E,v),D=()=>_||P(),S=()=>!_||O();for(let g=u,y=u;g<=h;++g)k=t[g%a],!k.skip&&(v=c(k[i]),v!==E&&(_=l(v,s,r),x===null&&D()&&(x=o(v,s)===0?g:y),x!==null&&S()&&(p.push(hu({start:x,end:g,loop:f,count:a,style:m})),x=null),y=g,E=v));return x!==null&&p.push(hu({start:x,end:h,loop:f,count:a,style:m})),p}function mu(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const r=fu(i[s],n.points,t);r.length&&e.push(...r)}return e}function Fp(n,t,e,i){let s=0,r=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(r+=s);r>s&&n[r%t].skip;)r--;return r%=t,{start:s,end:r}}function Bp(n,t,e,i){const s=n.length,r=[];let a=t,o=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?o.skip||(i=!1,r.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,o.skip&&(t=l)),o=c}return a!==null&&r.push({start:t%s,end:a%s,loop:i}),r}function zp(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const r=!!n._loop,{start:a,end:o}=Fp(e,s,r,i);if(i===!0)return gu(n,[{start:a,end:o,loop:r}],e,t);const l=o<a?o+s:o,c=!!n._fullLoop&&a===0&&o===s-1;return gu(n,Bp(e,a,l,c),e,t)}function gu(n,t,e,i){return!i||!i.setContext||!e?t:Hp(n,t,e,i)}function Hp(n,t,e,i){const s=n._chart.getContext(),r=pu(n.options),{_datasetIndex:a,options:{spanGaps:o}}=n,l=e.length,c=[];let u=r,h=t[0].start,f=h;function m(p,_,x,v){const k=o?-1:1;if(p!==_){for(p+=l;e[p%l].skip;)p-=k;for(;e[_%l].skip;)_+=k;p%l!==_%l&&(c.push({start:p%l,end:_%l,loop:x,style:v}),u=v,h=_%l)}}for(const p of t){h=o?h:p.start;let _=e[h%l],x;for(f=h+1;f<=p.end;f++){const v=e[f%l];x=pu(i.setContext(Mn(s,{type:"segment",p0:_,p1:v,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),Wp(x,u)&&m(h,f-1,p.loop,u),_=v,u=x}h<f-1&&m(h,f-1,p.loop,u)}return c}function pu(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Wp(n,t){if(!t)return!1;const e=[],i=function(s,r){return Xa(r)?(e.includes(r)||e.push(r),e.indexOf(r)):r};return JSON.stringify(n,i)!==JSON.stringify(t,i)}function Mr(n,t,e){return n.options.clip?n[e]:t[e]}function Vp(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Mr(e,t,"left"),right:Mr(e,t,"right"),top:Mr(i,t,"top"),bottom:Mr(i,t,"bottom")}:t}function yu(n,t){const e=t._clip;if(e.disabled)return!1;const i=Vp(t,n.chartArea);return{left:e.left===!1?0:i.left-(e.left===!0?0:e.left),right:e.right===!1?n.width:i.right+(e.right===!0?0:e.right),top:e.top===!1?0:i.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?n.height:i.bottom+(e.bottom===!0?0:e.bottom)}}/*!
|
|
12
12
|
* Chart.js v4.5.1
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class Yp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nn=new Yp;const bu="transparent",Vp={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=qc(n||bu),s=i.valid&&qc(t||bu);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class $p{constructor(t,e,i,s){const r=e[i];s=ls([t.to,s,r,t.from]);const a=ls([t.from,r,s]);this._active=!0,this._fn=t.fn||Vp[t.type||typeof a],this._easing=is[t.easing]||is.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ls([t.to,e,s,t.from]),this._from=ls([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class ro{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ft(t))return;const e=Object.keys(Pt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ft(r))return;const a={};for(const o of e)a[o]=r[o];(wt(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=Up(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&jp(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),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"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=r[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}r[c]=h=new $p(f,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return nn.add(this._chart,i),!0}}function jp(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function Up(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function _u(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function qp(n,t,e){if(e===!1)return!1;const i=_u(n,e),s=_u(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Xp(n){let t,e,i,s;return ft(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function xu(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function wu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t===null)return;let u=!1;for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(u=!0,i.all)continue;break}c=n.values[l],At(c)&&(r||t===0||Ye(t)===Ye(c))&&(t+=c)}return!u&&!i.all?0:t}function Gp(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function ao(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Kp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Zp(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Qp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function vu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function Mu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Kp(r,a,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:b,[c]:x}=p,v=p._stacks||(p._stacks={});f=v[c]=Qp(s,u,b),f[o]=x,f._top=vu(f,a,!0,i.type),f._bottom=vu(f,a,!1,i.type);const S=f._visualValues||(f._visualValues={});S[o]=x}}function oo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function Jp(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ty(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function cs(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const lo=n=>n==="reset"||n==="none",Su=(n,t)=>t?n:Object.assign({},n),ey=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:xu(e,!0),values:null};class Fe{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ao(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&&cs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,r=e.xAxisID=rt(i.xAxisID,oo(t,"x")),a=e.yAxisID=rt(i.yAxisID,oo(t,"y")),o=e.rAxisID=rt(i.rAxisID,oo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Bc(this._data,this),t._stacked&&cs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ft(e)){const s=this._cachedMeta;this._data=Gp(e,s)}else if(i!==e){if(i){Bc(i,this);const s=this._cachedMeta;cs(s),s._parsed=[]}e&&Object.isExtensible(e)&&Bg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=ao(e.vScale,e),e.stack!==i.stack&&(s=!0,cs(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Mu(this,e._parsed),e._stacked=ao(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:a}=i,o=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{wt(s[t])?f=this.parseArrayData(i,s,t,e):ft(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[o]===null||c&&h[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&Mu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[o]:u||r.parse(c[p],p),[l]:a.parse(e[p],p)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],o[l]={x:r.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],c[u]={x:r.parse(_n(m,o),f),y:a.parse(_n(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,a=e[t.axis],o={keys:xu(s,!0),values:e._stacks[t.axis]._visualValues};return wu(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=wu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=ey(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Zp(o);let f,m;function p(){m=s[f];const b=m[o.axis];return!At(m[t.axis])||u>b||h<b}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],At(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Xp(rt(this.options.clip,qp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const h=s[u];h.hidden||(h.active&&c?a.push(h):h.draw(t,r))}for(u=0;u<a.length;++u)a[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];r=a.$context||(a.$context=ty(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=Jp(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&ge(i);if(o)return Su(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Pt.elements[t]),p=()=>this.getContext(i,s,e),b=c.resolveNamedOptions(f,m,p,h);return b.$shared&&(b.$shared=l,r[a]=Object.freeze(Su(b,l))),b}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,e))}const c=new ro(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||lo(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){lo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!lo(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&cs(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}A(Fe,"defaults",{}),A(Fe,"datasetElementType",null),A(Fe,"dataElementType",null);function ny(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Hc(i.sort((s,r)=>s-r))}return n._cache.$bar}function iy(n){const t=n.iScale,e=ny(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(ge(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function sy(n,t,e,i){const s=e.barThickness;let r,a;return st(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function ry(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function ay(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function ku(n,t,e,i){return wt(n)?ay(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Tu(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=o||s.parse(a[c],c),l.push(ku(f,h,r,c));return l}function co(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function oy(n,t,e){return n!==0?Ye(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function ly(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function cy(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:l,top:c,bottom:u}=ly(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[Du(u,a,o,l)]=!0,s=c)),r[Du(s,a,o,l)]=!0,n.borderSkipped=r}function Du(n,t,e,i){return i?(n=uy(n,t,e),n=Cu(n,e,t)):n=Cu(n,t,e),n}function uy(n,t,e){return n===t?e:n===e?t:n}function Cu(n,t,e){return n==="start"?t:n==="end"?e:n}function dy(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class us extends Fe{parsePrimitiveData(t,e,i,s){return Tu(t,e,i,s)}parseArrayData(t,e,i,s){return Tu(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,h=[];let f,m,p,b;for(f=i,m=i+s;f<m;++f)b=e[f],p={},p[r.axis]=r.parse(_n(b,c),f),h.push(ku(_n(b,u),p,a,f));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),a=r._custom,o=co(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const p=this.getParsed(m),b=r||st(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),v=(p._stacks||{})[o.axis],S={horizontal:c,base:b.base,enableBorderRadius:!v||co(p._custom)||a===v._top||a===v._bottom,x:c?b.head:x.center,y:c?x.center:b.head,height:c?x.size:Math.abs(b.size),width:c?Math.abs(b.size):x.size};f&&(S.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const D=S.options||t[m].options;cy(S,D,v,a),dy(S,D,u.ratio),this.updateElement(t[m],m,S,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),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 s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===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,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||iy(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=co(c);let h=l[e.axis],f=0,m=i?this.applyStack(e,l,i):h,p,b;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(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+m):p=v,b=p-v,Math.abs(b)<a){b=oy(b,e,o)*a,h===o&&(v-=b/2);const S=e.getPixelForDecimal(0),D=e.getPixelForDecimal(1),P=Math.min(S,D),O=Math.max(S,D);v=Math.max(Math.min(v,O),P),p=v+b,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const S=Ye(b)*e.getLineWidthForValue(o)/2;v+=S,b-=S}return{size:b,base:v,head:p,center:p+b/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=rt(s.maxBarThickness,1/0);let o,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?ry(t,e,s,u*c):sy(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;o=h.start+h.chunk*p+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,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}A(us,"id","bar"),A(us,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),A(us,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Sr extends Fe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=rt(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=rt(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,h=o.axis;for(let f=e;f<e+i;f++){const m=t[f],p=!r&&this.getParsed(f),b={},x=b[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(p[u]),v=b[h]=r?o.getBasePixel():o.getPixelForValue(p[h]);b.skip=isNaN(x)||isNaN(v),c&&(b.options=l||this.resolveDataElementOptions(f,m.active?"active":s),r&&(b.options.radius=0)),this.updateElement(m,f,b,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=rt(i&&i._custom,r),s}}A(Sr,"id","bubble"),A(Sr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),A(Sr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function hy(n,t,e){let i=1,s=1,r=0,a=0;if(t<Ct){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),h=Math.cos(l),f=Math.sin(l),m=(D,P,O)=>ns(D,o,l,!0)?1:Math.max(P,P*e,O,O*e),p=(D,P,O)=>ns(D,o,l,!0)?-1:Math.min(P,P*e,O,O*e),b=m(0,c,h),x=m(Ot,u,f),v=p(ut,c,h),S=p(ut+Ot,u,f);i=(b-v)/2,s=(x-S)/2,r=-(b+v)/2,a=-(x+S)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class sn extends Fe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return Vt(this.options.rotation-90)}_getCircumference(){return Vt(this.options.circumference)}_getRotationExtents(){let t=Ct,e=-Ct;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(kg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:b}=hy(h,u,l),x=(i.width-a)/f,v=(i.height-a)/m,S=Math.max(Math.min(x,v)/2,0),D=Pc(this.options.radius,S),P=Math.max(D*l,0),O=(D-P)/this._getVisibleDatasetWeightTotal();this.offsetX=p*D,this.offsetY=b*D,s.total=this.calculateTotal(),this.outerRadius=D-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ct)}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),S;for(S=0;S<e;++S)v+=this._circumference(S,r);for(S=e;S<e+i;++S){const D=this._circumference(S,r),P=t[S],O={x:u+this.offsetX,y:h+this.offsetY,startAngle:v,endAngle:v+D,circumference:D,outerRadius:p,innerRadius:m};x&&(O.options=b||this.resolveDataElementOptions(S,P.active?"active":s)),v+=D,this.updateElement(P,S,O,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ss(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}A(sn,"id","doughnut"),A(sn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),A(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),A(sn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:r,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:a&&(o||h.borderRadius),index:c}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ds extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=Vc(e,s,a);this._drawStart=o,this._drawCount=l,$c(e)&&(o=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=a.axis,m=o.axis,{spanGaps:p,segment:b}=this.options,x=wn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",S=e+i,D=t.length;let P=e>0&&this.getParsed(e-1);for(let O=0;O<D;++O){const C=t[O],k=v?C:{};if(O<e||O>=S){k.skip=!0;continue}const g=this.getParsed(O),_=st(g[m]),M=k[f]=a.getPixelForValue(g[f],O),E=k[m]=r||_?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,g,l):g[m],O);k.skip=isNaN(M)||isNaN(E)||_,k.stop=O>0&&Math.abs(g[f]-P[f])>x,b&&(k.parsed=g,k.raw=c.data[O]),h&&(k.options=u||this.resolveDataElementOptions(O,C.active?"active":s)),v||this.updateElement(C,O,k,s),P=g}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}A(ds,"id","line"),A(ds,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),A(ds,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class hs extends Fe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ss(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return ru.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*ut;let m=f,p;const b=360/this.countVisibleElements();for(p=0;p<e;++p)m+=this._computeAngle(p,s,b);for(p=e;p<e+i;p++){const x=t[p];let v=m,S=m+this._computeAngle(p,s,b),D=a.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=S,r&&(l.animateScale&&(D=0),l.animateRotate&&(v=S=f));const P={x:u,y:h,innerRadius:0,outerRadius:D,startAngle:v,endAngle:S,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,P,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Vt(this.resolveDataElementOptions(t,e).angle||i):0}}A(hs,"id","polarArea"),A(hs,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),A(hs,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class uo extends sn{}A(uo,"id","pie"),A(uo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class kr extends Fe{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return ru.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),h=a?r.xCenter:u.x,f=a?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,o,m,s)}}}A(kr,"id","radar"),A(kr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),A(kr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Tr extends Fe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=Vc(e,i,s);if(this._drawStart=r,this._drawCount=a,$c(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=a.axis,p=o.axis,{spanGaps:b,segment:x}=this.options,v=wn(b)?b:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||r||s==="none";let D=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const O=t[P],C=this.getParsed(P),k=S?O:{},g=st(C[p]),_=k[m]=a.getPixelForValue(C[m],P),M=k[p]=r||g?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,C,l):C[p],P);k.skip=isNaN(_)||isNaN(M)||g,k.stop=P>0&&Math.abs(C[m]-D[m])>v,x&&(k.parsed=C,k.raw=c.data[P]),f&&(k.options=h||this.resolveDataElementOptions(P,O.active?"active":s)),S||this.updateElement(O,P,k,s),D=C}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}A(Tr,"id","scatter"),A(Tr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),A(Tr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var fy=Object.freeze({__proto__:null,BarController:us,BubbleController:Sr,DoughnutController:sn,LineController:ds,PieController:uo,PolarAreaController:hs,RadarController:kr,ScatterController:Tr});function Un(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ho{constructor(t){A(this,"options");this.options=t||{}}static override(t){Object.assign(ho.prototype,t)}init(){}formats(){return Un()}parse(){return Un()}format(){return Un()}add(){return Un()}diff(){return Un()}startOf(){return Un()}endOf(){return Un()}}var Eu={_date:ho};function my(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const c=o._reversePixels?Fg:tn;if(i){if(s._sharedOptions){const u=r[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(r,t,e-h),m=c(r,t,e+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(b=>!st(b[h.axis]));u.lo-=Math.max(0,m);const p=f.slice(u.hi).findIndex(b=>!st(b[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:r.length-1}}function fs(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:h,hi:f}=my(r[o],t,a,s);for(let m=h;m<=f;++m){const p=u[m];p.skip||i(p,c,m)}}}function gy(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function fo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||fs(n,e,t,function(o,l,c){!s&&!en(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function py(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=pr(a,{x:t.x,y:t.y});ns(h,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return fs(n,e,t,r),s}function yy(n,t,e,i,s,r){let a=[];const o=gy(e);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!m)return;const x=o(t,p);x<l?(a=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&a.push({element:u,datasetIndex:h,index:f})}return fs(n,e,t,c),a}function mo(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?py(n,t,e,s):yy(n,t,e,i,s,r)}function Ou(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return fs(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var go={evaluateInteractionItems:fs,modes:{index(n,t,e,i){const s=Sn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?fo(n,s,r,i,a):mo(n,s,r,!1,i,a),l=[];return o.length?(n.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(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?fo(n,s,r,i,a):mo(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return fo(n,s,r,i,a)},nearest(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return mo(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=Sn(t,n);return Ou(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Sn(t,n);return Ou(n,s,"y",e.intersect,i)}}};const Pu=["left","top","right","bottom"];function ms(n,t){return n.filter(e=>e.pos===t)}function Au(n,t){return n.filter(e=>Pu.indexOf(e.pos)===-1&&e.box.axis===t)}function gs(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function by(n){const t=[];let e,i,s,r,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function _y(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Pu.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function xy(n,t){const e=_y(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function wy(n){const t=by(n),e=gs(t.filter(c=>c.box.fullSize),!0),i=gs(ms(t,"left"),!0),s=gs(ms(t,"right")),r=gs(ms(t,"top"),!0),a=gs(ms(t,"bottom")),o=Au(t,"x"),l=Au(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:ms(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function Ru(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Iu(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function vy(n,t,e,i){const{pos:s,box:r}=e,a=n.maxPadding;if(!ft(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?r.height:r.width),e.size=h.size/h.count,n[s]+=e.size}r.getPadding&&Iu(a,r.getPadding());const o=Math.max(0,t.outerWidth-Ru(a,n,"left","right")),l=Math.max(0,t.outerHeight-Ru(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function My(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Sy(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function ps(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,Sy(o.horizontal,t));const{same:h,other:f}=vy(t,e,o,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(o)}return c&&ps(s,t,e,i)||u}function Dr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Lu(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){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;ge(c.start)&&(a=c.start),l.fullSize?Dr(l,s.left,a,e.outerWidth-s.right-s.left,f):Dr(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;ge(c.start)&&(r=c.start),l.fullSize?Dr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):Dr(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=a}var ae={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=$t(n.options.layout.padding),r=Math.max(t-s.width,0),a=Math.max(e-s.height,0),o=wy(n.boxes),l=o.vertical,c=o.horizontal;kt(n.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=l.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},s);Iu(f,$t(i));const m=Object.assign({maxPadding:f,w:r,h:a,x:s.left,y:s.top},s),p=xy(l.concat(c),h);ps(o.fullSize,m,h,p),ps(l,m,h,p),ps(c,m,h,p)&&ps(l,m,h,p),My(m),Lu(o.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,Lu(o.rightAndBottom,m,h,p),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},kt(o.chartArea,b=>{const x=b.box;Object.assign(x,n.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Nu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class ky extends Nu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Cr="$chartjs",Ty={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fu=n=>n===null||n==="";function Dy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Cr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Fu(s)){const r=lu(n,"width");r!==void 0&&(n.width=r)}if(Fu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=lu(n,"height");r!==void 0&&(n.height=r)}return n}const zu=Op?{passive:!0}:!1;function Cy(n,t,e){n&&n.addEventListener(t,e,zu)}function Ey(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,zu)}function Oy(n,t){const e=Ty[n.type]||n.type,{x:i,y:s}=Sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Er(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Py(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Er(o.addedNodes,i),a=a&&!Er(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ay(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Er(o.removedNodes,i),a=a&&!Er(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ys=new Map;let Bu=0;function Hu(){const n=window.devicePixelRatio;n!==Bu&&(Bu=n,ys.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Ry(n,t){ys.size||window.addEventListener("resize",Hu),ys.set(n,t)}function Iy(n){ys.delete(n),ys.size||window.removeEventListener("resize",Hu)}function Ly(n,t,e){const i=n.canvas,s=i&&so(i);if(!s)return;const r=Yc((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),Ry(n,r),a}function po(n,t,e){e&&e.disconnect(),t==="resize"&&Iy(n)}function Ny(n,t,e){const i=n.canvas,s=Yc(r=>{n.ctx!==null&&e(Oy(r,n))},n);return Cy(i,t,s),s}class Fy extends Nu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Dy(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Cr])return!1;const i=e[Cr].initial;["height","width"].forEach(r=>{const a=i[r];st(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Cr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Py,detach:Ay,resize:Ly}[e]||Ny;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:po,detach:po,resize:po}[e]||Ey)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Ep(t,e,i,s)}isAttached(t){const e=t&&so(t);return!!(e&&e.isConnected)}}function zy(n){return!io()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?ky:Fy}class Zt{constructor(){A(this,"x");A(this,"y");A(this,"active",!1);A(this,"options");A(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}A(Zt,"defaults",{}),A(Zt,"defaultRoutes");function By(n,t){const e=n.options.ticks,i=Hy(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Yy(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return Vy(t,c,r,a/s),c;const u=Wy(r,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-o)/(a-1)):null;for(Or(t,c,u,st(m)?0:o-m,o),h=0,f=a-1;h<f;h++)Or(t,c,u,r[h],r[h+1]);return Or(t,c,u,l,st(m)?t.length:l+m),c}return Or(t,c,u),c}function Hy(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Wy(n,t,e){const i=$y(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Ag(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function Yy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function Vy(n,t,e,i){let s=0,r=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function Or(n,t,e,i,s){const r=rt(i,0),a=Math.min(rt(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*e))}function $y(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const jy=n=>n==="left"?"right":n==="right"?"left":n,Wu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Yu=(n,t)=>Math.min(t||n,n);function Vu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function Uy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function qy(n,t){kt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function bs(n){return n.drawTicks?n.tickLength:0}function $u(n,t){if(!n.display)return 0;const e=Rt(n.font,t),i=$t(n.padding);return(wt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Xy(n,t){return Mn(n,{scale:t,type:"scale"})}function Gy(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function Ky(n,t,e){let i=qa(n);return(e&&t!=="right"||!e&&t==="right")&&(i=jy(i)),i}function Zy(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,p;const b=a-s,x=o-r;if(n.isHorizontal()){if(m=re(i,r,o),ft(e)){const v=Object.keys(e)[0],S=e[v];p=u[v].getPixelForValue(S)+b-t}else e==="center"?p=(c.bottom+c.top)/2+b-t:p=Wu(n,e,t);f=o-r}else{if(ft(e)){const v=Object.keys(e)[0],S=e[v];m=u[v].getPixelForValue(S)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Wu(n,e,t);p=re(i,a,s),h=e==="left"?-Ot:Ot}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class qn extends Zt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Te(t,Number.POSITIVE_INFINITY),e=Te(e,Number.NEGATIVE_INFINITY),i=Te(i,Number.POSITIVE_INFINITY),s=Te(s,Number.NEGATIVE_INFINITY),{min:Te(t,i),max:Te(e,s),minDefined:At(t),maxDefined:At(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Te(e,Te(i,e)),max:Te(i,Te(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){St(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=op(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Vu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=By(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){St(this.options.afterUpdate,[this])}beforeSetDimensions(){St(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(){St(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),St(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){St(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=St(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){St(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){St(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Yu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Kt(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-bs(t.grid)-e.padding-$u(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=gr(Math.min(Math.asin(Kt((u.highest.height+6)/o,-1,1)),Math.asin(Kt(l/c,-1,1))-Math.asin(Kt(f/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){St(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){St(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=$u(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=bs(r)+l):(t.height=this.maxHeight,t.width=bs(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Vt(this.labelRotation),b=Math.cos(p),x=Math.sin(p);if(o){const v=i.mirror?0:x*h.width+b*f.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=i.mirror?0:b*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(c,u,x,b)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,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=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):r==="start"?m=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,m=e.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=e.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=e.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(){St(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)st(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Vu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,a=[],o=[],l=Math.floor(e/Yu(e,i));let c=0,u=0,h,f,m,p,b,x,v,S,D,P,O;for(h=0;h<e;h+=l){if(p=t[h].label,b=this._resolveTickFontOptions(h),s.font=x=b.string,v=r[x]=r[x]||{data:{},gc:[]},S=b.lineHeight,D=P=0,!st(p)&&!wt(p))D=_r(s,v.data,v.gc,D,p),P=S;else if(wt(p))for(f=0,m=p.length;f<m;++f)O=p[f],!st(O)&&!wt(O)&&(D=_r(s,v.data,v.gc,D,O),P+=S);a.push(D),o.push(P),c=Math.max(D,c),u=Math.max(P,u)}qy(r,e);const C=a.indexOf(c),k=o.indexOf(u),g=_=>({width:a[_]||0,height:o[_]||0});return{first:g(0),last:g(e-1),widest:g(C),highest:g(k),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Ng(this._alignToPixels?Yn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Gy(this.getContext(),t,i))}return this.$context||(this.$context=Xy(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Vt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:a,border:o}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=bs(r),m=[],p=o.setContext(this.getContext()),b=p.display?p.width:0,x=b/2,v=function(Q){return Yn(i,Q,b)};let S,D,P,O,C,k,g,_,M,E,R,I;if(a==="top")S=v(this.bottom),k=this.bottom-f,_=S-x,E=v(t.top)+x,I=t.bottom;else if(a==="bottom")S=v(this.top),E=t.top,I=v(t.bottom)-x,k=S+x,_=this.top+f;else if(a==="left")S=v(this.right),C=this.right-f,g=S-x,M=v(t.left)+x,R=t.right;else if(a==="right")S=v(this.left),M=t.left,R=v(t.right)-x,C=S+x,g=this.left+f;else if(e==="x"){if(a==="center")S=v((t.top+t.bottom)/2+.5);else if(ft(a)){const Q=Object.keys(a)[0],V=a[Q];S=v(this.chart.scales[Q].getPixelForValue(V))}E=t.top,I=t.bottom,k=S+x,_=k+f}else if(e==="y"){if(a==="center")S=v((t.left+t.right)/2);else if(ft(a)){const Q=Object.keys(a)[0],V=a[Q];S=v(this.chart.scales[Q].getPixelForValue(V))}C=S-x,g=C-f,M=t.left,R=t.right}const F=rt(s.ticks.maxTicksLimit,h),$=Math.max(1,Math.ceil(h/F));for(D=0;D<h;D+=$){const Q=this.getContext(D),V=r.setContext(Q),lt=o.setContext(Q),U=V.lineWidth,B=V.color,q=lt.dash||[],J=lt.dashOffset,j=V.tickWidth,yt=V.tickColor,_t=V.tickBorderDash||[],Y=V.tickBorderDashOffset;P=Uy(this,D,l),P!==void 0&&(O=Yn(i,P,U),c?C=g=M=R=O:k=_=E=I=O,m.push({tx1:C,ty1:k,tx2:g,ty2:_,x1:M,y1:E,x2:R,y2:I,width:U,color:B,borderDash:q,borderDashOffset:J,tickWidth:j,tickColor:yt,tickBorderDash:_t,tickBorderDashOffset:Y}))}return this._ticksLength=h,this._borderValue=S,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=bs(i.grid),m=f+u,p=h?-u:m,b=-Vt(this.labelRotation),x=[];let v,S,D,P,O,C,k,g,_,M,E,R,I="middle";if(s==="top")C=this.bottom-p,k=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+p,k=this._getXAxisLabelAlignment();else if(s==="left"){const $=this._getYAxisLabelAlignment(f);k=$.textAlign,O=$.x}else if(s==="right"){const $=this._getYAxisLabelAlignment(f);k=$.textAlign,O=$.x}else if(e==="x"){if(s==="center")C=(t.top+t.bottom)/2+m;else if(ft(s)){const $=Object.keys(s)[0],Q=s[$];C=this.chart.scales[$].getPixelForValue(Q)+m}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")O=(t.left+t.right)/2-m;else if(ft(s)){const $=Object.keys(s)[0],Q=s[$];O=this.chart.scales[$].getPixelForValue(Q)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?I="top":l==="end"&&(I="bottom"));const F=this._getLabelSizes();for(v=0,S=o.length;v<S;++v){D=o[v],P=D.label;const $=r.setContext(this.getContext(v));g=this.getPixelForTick(v)+r.labelOffset,_=this._resolveTickFontOptions(v),M=_.lineHeight,E=wt(P)?P.length:1;const Q=E/2,V=$.color,lt=$.textStrokeColor,U=$.textStrokeWidth;let B=k;a?(O=g,k==="inner"&&(v===S-1?B=this.options.reverse?"left":"right":v===0?B=this.options.reverse?"right":"left":B="center"),s==="top"?c==="near"||b!==0?R=-E*M+M/2:c==="center"?R=-F.highest.height/2-Q*M+M:R=-F.highest.height+M/2:c==="near"||b!==0?R=M/2:c==="center"?R=F.highest.height/2-Q*M:R=F.highest.height-E*M,h&&(R*=-1),b!==0&&!$.showLabelBackdrop&&(O+=M/2*Math.sin(b))):(C=g,R=(1-E)*M/2);let q;if($.showLabelBackdrop){const J=$t($.backdropPadding),j=F.heights[v],yt=F.widths[v];let _t=R-J.top,Y=0-J.left;switch(I){case"middle":_t-=j/2;break;case"bottom":_t-=j;break}switch(k){case"center":Y-=yt/2;break;case"right":Y-=yt;break;case"inner":v===S-1?Y-=yt:v>0&&(Y-=yt/2);break}q={left:Y,top:_t,width:yt+J.width,height:j+J.height,color:$.backdropColor}}x.push({label:P,font:_,textOffset:R,options:{rotation:b,color:V,strokeColor:lt,strokeWidth:U,textAlign:B,textBaseline:I,translation:[O,C],backdrop:q}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Vt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,a=this._getLabelSizes(),o=t+r,l=a.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,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(e.display)for(r=0,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Yn(t,this.left,a)-a/2,u=Yn(t,this.right,o)+o/2,h=f=l):(h=Yn(t,this.top,a)-a/2,f=Yn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&as(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;Vn(i,c,0,u,l,o)}s&&os(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=Rt(i.font),a=$t(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ft(e)?(l+=a.bottom,wt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Zy(this,l,e,o);Vn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:Ky(o,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=rt(t.grid&&t.grid.z,-1),s=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==qn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Rt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Pr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;tb(e)&&(i=this.register(e));const s=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Qy(t,a,i),this.override&&Pt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Pt[s]&&(delete Pt[s][i],this.override&&delete Wn[i])}}function Qy(n,t,e){const i=Ji(Object.create(null),[e?Pt.get(e):{},Pt.get(t),n.defaults]);Pt.set(t,i),n.defaultRoutes&&Jy(t,n.defaultRoutes),n.descriptors&&Pt.describe(t,n.descriptors)}function Jy(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),a=t[e].split("."),o=a.pop(),l=a.join(".");Pt.route(r,s,l,o)})}function tb(n){return"id"in n&&"defaults"in n}class eb{constructor(){this.controllers=new Pr(Fe,"datasets",!0),this.elements=new Pr(Zt,"elements"),this.plugins=new Pr(Object,"plugins"),this.scales=new Pr(qn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):kt(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=$a(t);St(i["before"+s],[],i),e[t](i),St(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ve=new eb;class nb{constructor(){this._init=void 0}notify(t,e,i,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const r=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(St(o,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=rt(i.options&&i.options.plugins,{}),r=ib(i);return s===!1&&!e?[]:rb(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function ib(n){const t={},e=[],i=Object.keys(Ve.plugins.items);for(let r=0;r<i.length;r++)e.push(Ve.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function sb(n,t){return!t&&n===!1?null:n===!0?{}:n}function rb(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=sb(i[l],s);c!==null&&r.push({plugin:o,options:ab(n.config,{plugin:o,local:e[l]},c,a)})}return r}function ab(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yo(n,t){const e=Pt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function ob(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function lb(n,t){return n===t?"_index_":"_value_"}function ju(n){if(n==="x"||n==="y"||n==="r")return n}function cb(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function bo(n,...t){if(ju(n))return n;for(const e of t){const i=e.axis||cb(e.position)||n.length>1&&ju(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Uu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function ub(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Uu(n,"x",e[0])||Uu(n,"y",e[0])}return{}}function db(n,t){const e=Wn[n.type]||{scales:{}},i=t.scales||{},s=yo(n.type,t),r=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=bo(a,o,ub(a,n),Pt.scales[o.type]),c=lb(l,s),u=e.scales||{};r[a]=ts(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||yo(o,t),u=(Wn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=ob(h,l),m=a[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),ts(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(a=>{const o=r[a];ts(o,[Pt.scales[o.type],Pt.scale])}),r}function qu(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=db(n,t)}function Xu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function hb(n){return n=n||{},n.data=Xu(n.data),qu(n),n}const Gu=new Map,Ku=new Set;function Ar(n,t){let e=Gu.get(n);return e||(e=t(),Gu.set(n,e),Ku.add(e)),e}const _s=(n,t,e)=>{const i=_n(t,e);i!==void 0&&n.add(i)};class fb{constructor(t){this._config=hb(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=Xu(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(),qu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ar(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ar(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ar(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ar(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>_s(l,t,h))),u.forEach(h=>_s(l,s,h)),u.forEach(h=>_s(l,Wn[r]||{},h)),u.forEach(h=>_s(l,Pt,h)),u.forEach(h=>_s(l,Ka,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ku.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Wn[e]||{},Pt.datasets[e]||{},{type:e},Pt,Ka]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=Zu(this._resolverCache,t,s);let l=a;if(gb(a,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,o);l=yi(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Zu(this._resolverCache,t,i);return ft(e)?yi(r,e,void 0,s):r}}function Zu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:to(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const mb=n=>ft(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function gb(n,t){const{isScriptable:e,isIndexable:i}=Jc(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(pe(o)||mb(o))||a&&wt(o))return!0}return!1}var pb="4.5.1";const yb=["top","bottom","left","right","chartArea"];function Qu(n,t){return n==="top"||n==="bottom"||yb.indexOf(n)===-1&&t==="x"}function Ju(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function td(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),St(e&&e.onComplete,[n],t)}function bb(n){const t=n.chart,e=t.options.animation;St(e&&e.onProgress,[n],t)}function ed(n){return io()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Rr={},nd=n=>{const t=ed(n);return Object.values(Rr).filter(e=>e.canvas===t).pop()};function _b(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function xb(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let ye=(In=class{static register(...t){Ve.add(...t),id()}static unregister(...t){Ve.remove(...t),id()}constructor(t,e){const i=this.config=new fb(e),s=ed(t),r=nd(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||zy(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=Sg(),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 nb,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Hg(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Rr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nn.listen(this,"complete",td),nn.listen(this,"progress",bb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return st(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ve}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ou(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kc(this.canvas,this.ctx),this}stop(){return nn.stop(this),this}resize(t,e){nn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ou(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),St(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};kt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=bo(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),kt(r,a=>{const o=a.options,l=o.id,c=bo(l,o),u=rt(o.type,a.dtype);(o.position===void 0||Qu(o.position,c)!==Qu(a.dposition))&&(o.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ve.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),kt(s,(a,o)=>{a||delete i[o]}),kt(i,a=>{ae.configure(this,a,a.options),ae.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ju("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||yo(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Ve.getController(o),{datasetElementType:c,dataElementType:u}=Pt.datasets[o];Object.assign(l,{dataElementType:Ve.getElement(u),datasetElementType:c&&Ve.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){kt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&r.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||kt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ju("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){kt(this.scales,t=>{ae.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ic(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const a=i==="_removeElements"?-r:r;_b(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Ic(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ae.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],kt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nn.has(this)?this.attached&&!nn.running(this)&&nn.start(this):(this.draw(),td({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const a=e[s];(!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 e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=yu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&as(e,s),t.controller.draw(),s&&os(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=go.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Mn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Kc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Rr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};kt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){kt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},kt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!dr(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,a=e,o=this._getActiveElements(t,s,i,a),l=Og(t),c=xb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,St(r.onHover,[t,o,this],this),l&&St(r.onClick,[t,o,this],this));const u=!dr(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},A(In,"defaults",Pt),A(In,"instances",Rr),A(In,"overrides",Wn),A(In,"registry",Ve),A(In,"version",pb),A(In,"getChart",nd),In);function id(){return kt(ye.instances,n=>n._plugins.invalidate())}function wb(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:a,innerRadius:o,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,se(i-e));if(n.beginPath(),n.arc(s,r,a-c/2,i+h/2,e-h/2),o>0){const f=Math.min(c/o,se(i-e));n.arc(s,r,o+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*se(i-e));if(u==="round")n.arc(s,r,f,e-ut/2,i+ut/2,!0);else if(u==="bevel"){const m=2*f*f,p=-m*Math.cos(e+ut/2)+s,b=-m*Math.sin(e+ut/2)+r,x=m*Math.cos(i+ut/2)+s,v=m*Math.sin(i+ut/2)+r;n.lineTo(p,b),n.lineTo(x,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function vb(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+Ot,i-Ot),n.closePath(),n.clip()}function Mb(n){return Ja(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Sb(n,t,e,i){const s=Mb(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Kt(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Kt(s.innerStart,0,a),innerEnd:Kt(s.innerEnd,0,a)}}function xi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Ir(n,t,e,i,s,r){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let m=0;const p=s-l;if(i){const $=u>0?u-i:0,Q=h>0?h-i:0,V=($+Q)/2,lt=V!==0?p*V/(V+i):p;m=(p-lt)/2}const b=Math.max(.001,p*h-e/ut)/h,x=(p-b)/2,v=l+x+m,S=s-x-m,{outerStart:D,outerEnd:P,innerStart:O,innerEnd:C}=Sb(t,f,h,S-v),k=h-D,g=h-P,_=v+D/k,M=S-P/g,E=f+O,R=f+C,I=v+O/E,F=S-C/R;if(n.beginPath(),r){const $=(_+M)/2;if(n.arc(a,o,h,_,$),n.arc(a,o,h,$,M),P>0){const U=xi(g,M,a,o);n.arc(U.x,U.y,P,M,S+Ot)}const Q=xi(R,S,a,o);if(n.lineTo(Q.x,Q.y),C>0){const U=xi(R,F,a,o);n.arc(U.x,U.y,C,S+Ot,F+Math.PI)}const V=(S-C/f+(v+O/f))/2;if(n.arc(a,o,f,S-C/f,V,!0),n.arc(a,o,f,V,v+O/f,!0),O>0){const U=xi(E,I,a,o);n.arc(U.x,U.y,O,I+Math.PI,v-Ot)}const lt=xi(k,v,a,o);if(n.lineTo(lt.x,lt.y),D>0){const U=xi(k,_,a,o);n.arc(U.x,U.y,D,v-Ot,_)}}else{n.moveTo(a,o);const $=Math.cos(_)*h+a,Q=Math.sin(_)*h+o;n.lineTo($,Q);const V=Math.cos(M)*h+a,lt=Math.sin(M)*h+o;n.lineTo(V,lt)}n.closePath()}function kb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Ir(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%Ct||Ct))}return Ir(n,t,e,i,l,s),n.fill(),l}function Tb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let b=t.endAngle;if(r){Ir(n,t,e,i,b,s);for(let x=0;x<r;++x)n.stroke();isNaN(o)||(b=a+(o%Ct||Ct))}p&&vb(n,t,b),l.selfJoin&&b-a>=ut&&m===0&&u!=="miter"&&wb(n,t,b),r||(Ir(n,t,e,i,b,s),n.stroke())}class xs extends Zt{constructor(e){super();A(this,"circumference");A(this,"endAngle");A(this,"fullCircles");A(this,"innerRadius");A(this,"outerRadius");A(this,"pixelMargin");A(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:a,distance:o}=pr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=rt(f,c-l),b=ns(a,l,c)&&l!==c,x=p>=Ct||b,v=Je(o,u+m,h+m);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+a)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(ut,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,kb(e,this,u,a,o),Tb(e,this,u,a,o),e.restore()}}A(xs,"id","arc"),A(xs,"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}),A(xs,"defaultRoutes",{backgroundColor:"backgroundColor"}),A(xs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function sd(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function Db(n,t,e){n.lineTo(e.x,e.y)}function Cb(n){return n.stepped?Qg:n.tension||n.cubicInterpolationMode==="monotone"?Jg:Db}function rd(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Eb(n,t,e,i){const{points:s,options:r}=t,{count:a,start:o,loop:l,ilen:c}=rd(s,e,i),u=Cb(r);let{move:h=!0,reverse:f}=i||{},m,p,b;for(m=0;m<=c;++m)p=s[(o+(f?c-m:m))%a],!p.skip&&(h?(n.moveTo(p.x,p.y),h=!1):u(n,b,p,f,r.stepped),b=p);return l&&(p=s[(o+(f?c:0))%a],u(n,b,p,f,r.stepped)),!!l}function Ob(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=rd(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,p,b,x,v;const S=P=>(a+(c?o-P:P))%r,D=()=>{b!==x&&(n.lineTo(u,x),n.lineTo(u,b),n.lineTo(u,v))};for(l&&(m=s[S(0)],n.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=s[S(f)],m.skip)continue;const P=m.x,O=m.y,C=P|0;C===p?(O<b?b=O:O>x&&(x=O),u=(h*u+P)/++h):(D(),n.lineTo(P,O),p=C,h=0,b=x=O),v=O}D()}function _o(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Ob:Eb}function Pb(n){return n.stepped?Pp:n.tension||n.cubicInterpolationMode==="monotone"?Ap:jn}function Ab(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),sd(n,t.options),n.stroke(s)}function Rb(n,t,e,i){const{segments:s,options:r}=t,a=_o(t);for(const o of s)sd(n,r,o.style),n.beginPath(),a(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Ib=typeof Path2D=="function";function Lb(n,t,e,i){Ib&&!t.options.segment?Ab(n,t,e,i):Rb(n,t,e,i)}class Tn extends Zt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Mp(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=zp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,a=mu(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=Pb(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:h,end:f}=a[c],m=r[h],p=r[f];if(m===p){o.push(m);continue}const b=Math.abs((s-m[e])/(p[e]-m[e])),x=l(m,p,b,i.stepped);x[e]=t[e],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,e,i){return _o(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=_o(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Lb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}A(Tn,"id","line"),A(Tn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),A(Tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),A(Tn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ad(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Lr extends Zt{constructor(e){super();A(this,"parsed");A(this,"skip");A(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return ad(this,e,"x",i)}inYRange(e,i){return ad(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!en(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Qa(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}A(Lr,"id","point"),A(Lr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),A(Lr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function od(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,h;return n.horizontal?(h=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,o=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function Dn(n,t,e,i){return n?0:Kt(t,e,i)}function Nb(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Qc(i);return{t:Dn(s.top,r.top,0,e),r:Dn(s.right,r.right,0,t),b:Dn(s.bottom,r.bottom,0,e),l:Dn(s.left,r.left,0,t)}}function Fb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),a=Math.min(t,e),o=n.borderSkipped,l=i||ft(s);return{topLeft:Dn(!l||o.top||o.left,r.topLeft,0,a),topRight:Dn(!l||o.top||o.right,r.topRight,0,a),bottomLeft:Dn(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:Dn(!l||o.bottom||o.right,r.bottomRight,0,a)}}function zb(n){const t=od(n),e=t.right-t.left,i=t.bottom-t.top,s=Nb(n,e/2,i/2),r=Fb(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function xo(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&od(n,i);return o&&(s||Je(t,o.left,o.right))&&(r||Je(e,o.top,o.bottom))}function Bb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Hb(n,t){n.rect(t.x,t.y,t.w,t.h)}function wo(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+a,radius:n.radius}}class Nr extends Zt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:a}=zb(this),o=Bb(a.radius)?pi:Hb;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,wo(a,e,r)),t.clip(),o(t,wo(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,wo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return xo(this,t,e,i)}inXRange(t,e){return xo(this,t,null,e)}inYRange(t,e){return xo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}A(Nr,"id","bar"),A(Nr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),A(Nr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Wb=Object.freeze({__proto__:null,ArcElement:xs,BarElement:Nr,LineElement:Tn,PointElement:Lr});const vo=["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)"],ld=vo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function cd(n){return vo[n%vo.length]}function ud(n){return ld[n%ld.length]}function Yb(n,t){return n.borderColor=cd(t),n.backgroundColor=ud(t),++t}function Vb(n,t){return n.backgroundColor=n.data.map(()=>cd(t++)),t}function $b(n,t){return n.backgroundColor=n.data.map(()=>ud(t++)),t}function jb(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=Vb(e,t):s instanceof hs?t=$b(e,t):s&&(t=Yb(e,t))}}function dd(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Ub(n){return n&&(n.borderColor||n.backgroundColor)}function qb(){return Pt.borderColor!=="rgba(0,0,0,0.1)"||Pt.backgroundColor!=="rgba(0,0,0,0.1)"}var Xb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,a=dd(i)||Ub(s)||r&&dd(r)||qb();if(!e.forceOverride&&a)return;const o=jb(n);i.forEach(o)}};function Gb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,p,b;for(a[l++]=n[u],h=0;h<r-2;h++){let x=0,v=0,S;const D=Math.floor((h+1)*o)+1+t,P=Math.min(Math.floor((h+2)*o)+1,e)+t,O=P-D;for(S=D;S<P;S++)x+=n[S].x,v+=n[S].y;x/=O,v/=O;const C=Math.floor(h*o)+1+t,k=Math.min(Math.floor((h+1)*o)+1,e)+t,{x:g,y:_}=n[u];for(m=p=-1,S=C;S<k;S++)p=.5*Math.abs((g-x)*(n[S].y-_)-(g-n[S].x)*(v-_)),p>m&&(m=p,f=n[S],b=S);a[l++]=f,u=b}return a[l++]=n[c],a}function Kb(n,t,e,i){let s=0,r=0,a,o,l,c,u,h,f,m,p,b;const x=[],v=t+e-1,S=n[t].x,P=n[v].x-S;for(a=t;a<t+e;++a){o=n[a],l=(o.x-S)/P*i,c=o.y;const O=l|0;if(O===u)c<p?(p=c,h=a):c>b&&(b=c,f=a),s=(r*s+o.x)/++r;else{const C=a-1;if(!st(h)&&!st(f)){const k=Math.min(h,f),g=Math.max(h,f);k!==m&&k!==C&&x.push({...n[k],x:s}),g!==m&&g!==C&&x.push({...n[g],x:s})}a>0&&C!==m&&x.push(n[C]),x.push(o),u=O,r=0,p=b=c,h=f=m=a}}return x}function hd(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function fd(n){n.data.datasets.forEach(t=>{hd(t)})}function Zb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Kt(tn(t,r.axis,a).lo,0,e-1)),c?s=Kt(tn(t,r.axis,o).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Qb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){fd(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(ls([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=Zb(l,c);const m=e.threshold||4*i;if(f<=m){hd(s);return}st(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let p;switch(e.algorithm){case"lttb":p=Gb(c,h,f,i,e);break;case"min-max":p=Kb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){fd(n)}};function Jb(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=Fr(l,c,s);const u=Mo(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const h=mu(t,u);for(const f of h){const m=Mo(e,r[f.start],r[f.end],f.loop),p=fu(o,s,m);for(const b of p)a.push({source:b,target:f,start:{[e]:md(u,m,"start",Math.max)},end:{[e]:md(u,m,"end",Math.min)}})}}return a}function Mo(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function t0(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:o})=>{o=Fr(a,o,s);const l=s[a],c=s[o];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Fr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function md(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function gd(n,t){let e=[],i=!1;return wt(n)?(i=!0,e=n):e=t0(n,t),e.length?new Tn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function pd(n){return n&&n.fill!==!1}function e0(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!At(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function n0(n,t,e){const i=a0(n);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return At(s)&&Math.floor(s)===s?i0(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function i0(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function s0(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ft(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function r0(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ft(n)?i=n.value:i=t.getBaseValue(),i}function a0(n){const t=n.options,e=t.fill;let i=rt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function o0(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=l0(t,e);o.push(gd({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)c0(s,a[u],o)}return new Tn({points:s,options:{}})}function l0(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function c0(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:a,last:o,point:l}=u0(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function u0(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=a[u.start][e],f=a[u.end][e];if(Je(s,h,f)){o=s===h,l=s===f;break}}return{first:o,last:l,point:i}}class yd{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:Ct},t.arc(s,r,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function d0(n){const{chart:t,fill:e,line:i}=n;if(At(e))return h0(t,e);if(e==="stack")return o0(n);if(e==="shape")return!0;const s=f0(n);return s instanceof yd?s:gd(s,i)}function h0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function f0(n){return(n.scale||{}).getPointPositionForValue?g0(n):m0(n)}function m0(n){const{scale:t={},fill:e}=n,i=s0(e,t);if(At(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function g0(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=r0(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new yd({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function So(n,t,e){const i=d0(t),{chart:s,index:r,line:a,scale:o,axis:l}=t,c=a.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},p=s.getDatasetMeta(r),b=yu(s,p);i&&a.points.length&&(as(n,e),p0(n,{line:a,target:i,above:f,below:m,area:e,scale:o,axis:l,clip:b}),os(n))}function p0(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(bd(n,i,a.top),ko(n,{line:e,target:i,color:s,scale:o,property:c,clip:l}),n.restore(),n.save(),bd(n,i,a.bottom)):c==="y"&&(_d(n,i,a.left),ko(n,{line:e,target:i,color:r,scale:o,property:c,clip:l}),n.restore(),n.save(),_d(n,i,a.right),u=s)),ko(n,{line:e,target:i,color:u,scale:o,property:c,clip:l}),n.restore()}function bd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Fr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function _d(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Fr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function ko(n,t){const{line:e,target:i,property:s,color:r,scale:a,clip:o}=t,l=Jb(e,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=r}={}}=c,p=i!==!0;n.save(),n.fillStyle=m,y0(n,a,o,p&&Mo(s,h,f)),n.beginPath();const b=!!e.pathSegment(n,c);let x;if(p){b?n.closePath():xd(n,i,f,s);const v=!!i.pathSegment(n,u,{move:b,reverse:!0});x=b&&v,x||xd(n,i,h,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function y0(n,t,e,i){const s=t.chart.chartArea,{property:r,start:a,end:o}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=a,c=s.top,u=o,h=s.bottom):(l=s.left,c=a,u=s.right,h=o),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function xd(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var b0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof Tn&&(l={visible:n.isDatasetVisible(a),index:a,fill:n0(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=e0(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&So(n.ctx,o,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;pd(r)&&So(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!pd(i)||e.drawTime!=="beforeDatasetDraw"||So(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const wd=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},_0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class vd extends Zt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=St(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=Rt(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=wd(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,b)=>{const x=i+e/2+r.measureText(p.text).width;(b===0||c[c.length-1]+x+2*o>a)&&(h+=u,c[c.length-(b>0?0:1)]=0,m+=u,f++),l[b]={left:0,top:m,row:f,width:x,height:s},c[c.length-1]+=x+o}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,p=0,b=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:S,itemHeight:D}=x0(i,e,r,x,s);v>0&&m+D+2*o>u&&(h+=f+o,c.push({width:f,height:m}),p+=f+o,b++,f=m=0),l[v]={left:p,top:m,col:b,width:S,height:D},f=Math.max(f,S),m+=D+o}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,a=_i(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=re(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=re(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;as(t,this),this._draw(),os(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=Pt.color,l=_i(t.rtl,this.left,this.width),c=Rt(a.font),{padding:u}=a,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:b,itemHeight:x}=wd(a,h),v=function(C,k,g){if(isNaN(p)||p<=0||isNaN(b)||b<0)return;s.save();const _=rt(g.lineWidth,1);if(s.fillStyle=rt(g.fillStyle,o),s.lineCap=rt(g.lineCap,"butt"),s.lineDashOffset=rt(g.lineDashOffset,0),s.lineJoin=rt(g.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=rt(g.strokeStyle,o),s.setLineDash(rt(g.lineDash,[])),a.usePointStyle){const M={radius:b*Math.SQRT2/2,pointStyle:g.pointStyle,rotation:g.rotation,borderWidth:_},E=l.xPlus(C,p/2),R=k+f;Zc(s,M,E,R,a.pointStyleWidth&&p)}else{const M=k+Math.max((h-b)/2,0),E=l.leftForLtr(C,p),R=vn(g.borderRadius);s.beginPath(),Object.values(R).some(I=>I!==0)?pi(s,{x:E,y:M,w:p,h:b,radius:R}):s.rect(E,M,p,b),s.fill(),_!==0&&s.stroke()}s.restore()},S=function(C,k,g){Vn(s,g.text,C,k+x/2,c,{strikethrough:g.hidden,textAlign:l.textAlign(g.textAlign)})},D=this.isHorizontal(),P=this._computeTitleHeight();D?m={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+P,line:0}:m={x:this.left+u,y:re(r,this.top+P+u,this.bottom-e[0].height),line:0},cu(this.ctx,t.textDirection);const O=x+u;this.legendItems.forEach((C,k)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const g=s.measureText(C.text).width,_=l.textAlign(C.textAlign||(C.textAlign=a.textAlign)),M=p+f+g;let E=m.x,R=m.y;l.setWidth(this.width),D?k>0&&E+M+u>this.right&&(R=m.y+=O,m.line++,E=m.x=re(r,this.left+u,this.right-i[m.line])):k>0&&R+O>this.bottom&&(E=m.x=E+e[m.line].width+u,m.line++,R=m.y=re(r,this.top+P+u,this.bottom-e[m.line].height));const I=l.x(E);if(v(I,R,C),E=Wg(_,E+p+f,D?E+M:this.right,t.rtl),S(l.x(E),R,C),D)m.x+=M+u;else if(typeof C.text!="string"){const F=c.lineHeight;m.y+=Md(C,F)+u}else m.y+=O}),uu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Rt(e.font),s=$t(e.padding);if(!e.display)return;const r=_i(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=re(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=c+re(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=re(o,h,h+f);a.textAlign=r.textAlign(qa(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Vn(a,e.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,e=Rt(t.font),i=$t(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Je(t,this.left,this.right)&&Je(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Je(t,s.left,s.left+s.width)&&Je(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!M0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=_0(s,i);s&&!r&&St(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&St(e.onHover,[t,i,this],this)}else i&&St(e.onClick,[t,i,this],this)}}function x0(n,t,e,i,s){const r=w0(i,n,t,e),a=v0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function w0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function v0(n,t,e){let i=n;return typeof t.text!="string"&&(i=Md(t,e)),i}function Md(n,t){const e=n.text?n.text.length:0;return t*e}function M0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var S0={id:"legend",_element:vd,start(n,t,e){const i=n.legend=new vd({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i)},stop(n){ae.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ae.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=$t(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class To extends Zt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=wt(i.text)?i.text.length:1;this._padding=$t(i.padding);const r=s*Rt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:a}=this,o=a.align;let l=0,c,u,h;return this.isHorizontal()?(u=re(o,i,r),h=e+t,c=r-i):(a.position==="left"?(u=i+t,h=re(o,s,e),l=ut*-.5):(u=r-t,h=re(o,e,s),l=ut*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Rt(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);Vn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:qa(e.align),textBaseline:"middle",translation:[a,o]})}}function k0(n,t){const e=new To({ctx:n.ctx,options:t,chart:n});ae.configure(n,e,t),ae.addBox(n,e),n.titleBlock=e}var T0={id:"title",_element:To,start(n,t,e){k0(n,e)},stop(n){const t=n.titleBlock;ae.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ae.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const zr=new WeakMap;var D0={id:"subtitle",start(n,t,e){const i=new To({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i),zr.set(n,i)},stop(n){ae.removeBox(n,zr.get(n)),zr.delete(n)},beforeUpdate(n,t,e){const i=zr.get(n);ae.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ws={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=gi(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function $e(n,t){return t&&(wt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function rn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
16
|
+
*/class Yp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const r=e.listeners[s],a=e.duration;r.forEach(o=>o({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Wc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const r=i.items;let a=r.length-1,o=!1,l;for(;a>=0;--a)l=r[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),o=!0):(r[a]=r[r.length-1],r.pop());o&&(s.draw(),this._notify(s,i,t,"progress")),r.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=r.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var nn=new Yp;const bu="transparent",$p={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=qc(n||bu),s=i.valid&&qc(t||bu);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class jp{constructor(t,e,i,s){const r=e[i];s=ls([t.to,s,r,t.from]);const a=ls([t.from,r,s]);this._active=!0,this._fn=t.fn||$p[t.type||typeof a],this._easing=is[t.easing]||is.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],r=i-this._start,a=this._duration-r;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=r,this._loop=!!t.loop,this._to=ls([t.to,e,s,t.from]),this._from=ls([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,r=this._from,a=this._loop,o=this._to;let l;if(this._active=r!==o&&(a||e<i),!this._active){this._target[s]=o,this._notify(!0);return}if(e<0){this._target[s]=r;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(r,o,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class ro{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!ft(t))return;const e=Object.keys(Pt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const r=t[s];if(!ft(r))return;const a={};for(const o of e)a[o]=r[o];(wt(r.properties)&&r.properties||[s]).forEach(o=>{(o===s||!i.has(o))&&i.set(o,a)})})}_animateOptions(t,e){const i=e.options,s=qp(t,i);if(!s)return[];const r=this._createAnimations(s,i);return i.$shared&&Up(t.options.$animations,i).then(()=>{t.options=i},()=>{}),r}_createAnimations(t,e){const i=this._properties,s=[],r=t.$animations||(t.$animations={}),a=Object.keys(e),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"){s.push(...this._animateOptions(t,e));continue}const u=e[c];let h=r[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}r[c]=h=new jp(f,t,c,u),s.push(h)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return nn.add(this._chart,i),!0}}function Up(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const r=n[i[s]];r&&r.active()&&e.push(r.wait())}return Promise.all(e)}function qp(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function _u(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,r=e.max===void 0?t:0;return{start:i?r:s,end:i?s:r}}function Xp(n,t,e){if(e===!1)return!1;const i=_u(n,e),s=_u(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function Gp(n){let t,e,i,s;return ft(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function xu(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,r;for(s=0,r=i.length;s<r;++s)e.push(i[s].index);return e}function wu(n,t,e,i={}){const s=n.keys,r=i.mode==="single";let a,o,l,c;if(t===null)return;let u=!1;for(a=0,o=s.length;a<o;++a){if(l=+s[a],l===e){if(u=!0,i.all)continue;break}c=n.values[l],At(c)&&(r||t===0||Ve(t)===Ve(c))&&(t+=c)}return!u&&!i.all?0:t}function Kp(n,t){const{iScale:e,vScale:i}=t,s=e.axis==="x"?"x":"y",r=i.axis==="x"?"x":"y",a=Object.keys(n),o=new Array(a.length);let l,c,u;for(l=0,c=a.length;l<c;++l)u=a[l],o[l]={[s]:u,[r]:n[u]};return o}function ao(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function Zp(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Qp(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function Jp(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function vu(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const r=n[s.index];if(e&&r>0||!e&&r<0)return s.index}return null}function Mu(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:r,vScale:a,index:o}=i,l=r.axis,c=a.axis,u=Zp(r,a,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:_,[c]:x}=p,v=p._stacks||(p._stacks={});f=v[c]=Jp(s,u,_),f[o]=x,f._top=vu(f,a,!0,i.type),f._bottom=vu(f,a,!1,i.type);const k=f._visualValues||(f._visualValues={});k[o]=x}}function oo(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function ty(n,t){return Mn(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ey(n,t,e){return Mn(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function cs(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const r=s._stacks;if(!r||r[i]===void 0||r[i][e]===void 0)return;delete r[i][e],r[i]._visualValues!==void 0&&r[i]._visualValues[e]!==void 0&&delete r[i]._visualValues[e]}}}const lo=n=>n==="reset"||n==="none",Su=(n,t)=>t?n:Object.assign({},n),ny=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:xu(e,!0),values:null};class Fe{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ao(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&&cs(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,r=e.xAxisID=rt(i.xAxisID,oo(t,"x")),a=e.yAxisID=rt(i.yAxisID,oo(t,"y")),o=e.rAxisID=rt(i.rAxisID,oo(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,r,a,o),u=e.vAxisID=s(l,a,r,o);e.xScale=this.getScaleForId(r),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(o),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&zc(this._data,this),t._stacked&&cs(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(ft(e)){const s=this._cachedMeta;this._data=Kp(e,s)}else if(i!==e){if(i){zc(i,this);const s=this._cachedMeta;cs(s),s._parsed=[]}e&&Object.isExtensible(e)&&Hg(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const r=e._stacked;e._stacked=ao(e.vScale,e),e.stack!==i.stack&&(s=!0,cs(e),e.stack=i.stack),this._resyncElements(t),(s||r!==e._stacked)&&(Mu(this,e._parsed),e._stacked=ao(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:r,_stacked:a}=i,o=r.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],u,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{wt(s[t])?f=this.parseArrayData(i,s,t,e):ft(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const m=()=>h[o]===null||c&&h[o]<c[o];for(u=0;u<e;++u)i._parsed[u+t]=h=f[u],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&Mu(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:r,vScale:a}=t,o=r.axis,l=a.axis,c=r.getLabels(),u=r===a,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[o]:u||r.parse(c[p],p),[l]:a.parse(e[p],p)};return h}parseArrayData(t,e,i,s){const{xScale:r,yScale:a}=t,o=new Array(s);let l,c,u,h;for(l=0,c=s;l<c;++l)u=l+i,h=e[u],o[l]={x:r.parse(h[0],u),y:a.parse(h[1],u)};return o}parseObjectData(t,e,i,s){const{xScale:r,yScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let u,h,f,m;for(u=0,h=s;u<h;++u)f=u+i,m=e[f],c[u]={x:r.parse(_n(m,o),f),y:a.parse(_n(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,r=this._cachedMeta,a=e[t.axis],o={keys:xu(s,!0),values:e._stacks[t.axis]._visualValues};return wu(o,a,r.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const r=i[e.axis];let a=r===null?NaN:r;const o=s&&i._stacks[e.axis];s&&o&&(s.values=o,a=wu(s,r,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,r=i._sorted&&t===i.iScale,a=s.length,o=this._getOtherScale(t),l=ny(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=Qp(o);let f,m;function p(){m=s[f];const _=m[o.axis];return!At(m[t.axis])||u>_||h<_}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),r));++f);if(r){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,r,a;for(s=0,r=e.length;s<r;++s)a=e[s][t.axis],At(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,r=this.getParsed(t);return{label:i?""+i.getLabelForValue(r[i.axis]):"",value:s?""+s.getLabelForValue(r[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Gp(rt(this.options.clip,Xp(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],r=e.chartArea,a=[],o=this._drawStart||0,l=this._drawCount||s.length-o,c=this.options.drawActiveElementsOnTop;let u;for(i.dataset&&i.dataset.draw(t,r,o,l),u=o;u<o+l;++u){const h=s[u];h.hidden||(h.active&&c?a.push(h):h.draw(t,r))}for(u=0;u<a.length;++u)a[u].draw(t,r)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let r;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];r=a.$context||(a.$context=ey(this.getContext(),t,a)),r.parsed=this.getParsed(t),r.raw=s.data[t],r.index=r.dataIndex=t}else r=this.$context||(this.$context=ty(this.chart.getContext(),this.index)),r.dataset=s,r.index=r.datasetIndex=this.index;return r.active=!!e,r.mode=i,r}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",i){const s=e==="active",r=this._cachedDataOpts,a=t+"-"+e,o=r[a],l=this.enableOptionSharing&&ge(i);if(o)return Su(o,l);const c=this.chart.config,u=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),u),m=Object.keys(Pt.elements[t]),p=()=>this.getContext(i,s,e),_=c.resolveNamedOptions(f,m,p,h);return _.$shared&&(_.$shared=l,r[a]=Object.freeze(Su(_,l))),_}_resolveAnimations(t,e,i){const s=this.chart,r=this._cachedDataOpts,a=`animation-${e}`,o=r[a];if(o)return o;let l;if(s.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,e),f=u.getOptionScopes(this.getDataset(),h);l=u.createResolver(f,this.getContext(t,i,e))}const c=new ro(s,l&&l.animations);return l&&l._cacheable&&(r[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||lo(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,r=this.getSharedOptions(i),a=this.includeOptions(e,r)||r!==s;return this.updateSharedOptions(r,e,i),{sharedOptions:r,includeOptions:a}}updateElement(t,e,i,s){lo(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!lo(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const r=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(r)||r})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[o,l,c]of this._syncList)this[o](l,c);this._syncList=[];const s=i.length,r=e.length,a=Math.min(r,s);a&&this.parse(0,a),r>s?this._insertElements(s,r-s,t):r<s&&this._removeElements(r,s-r)}_insertElements(t,e,i=!0){const s=this._cachedMeta,r=s.data,a=t+e;let o;const l=c=>{for(c.length+=e,o=c.length-1;o>=a;o--)c[o]=c[o-e]};for(l(r),o=t;o<a;++o)r[o]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(r,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&cs(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}A(Fe,"defaults",{}),A(Fe,"datasetElementType",null),A(Fe,"dataElementType",null);function iy(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,r=e.length;s<r;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Hc(i.sort((s,r)=>s-r))}return n._cache.$bar}function sy(n){const t=n.iScale,e=iy(t,n.type);let i=t._length,s,r,a,o;const l=()=>{a===32767||a===-32768||(ge(o)&&(i=Math.min(i,Math.abs(a-o)||i)),o=a)};for(s=0,r=e.length;s<r;++s)a=t.getPixelForValue(e[s]),l();for(o=void 0,s=0,r=t.ticks.length;s<r;++s)a=t.getPixelForTick(s),l();return i}function ry(n,t,e,i){const s=e.barThickness;let r,a;return st(s)?(r=t.min*e.categoryPercentage,a=e.barPercentage):(r=s*i,a=1),{chunk:r/i,ratio:a,start:t.pixels[n]-r/2}}function ay(n,t,e,i){const s=t.pixels,r=s[n];let a=n>0?s[n-1]:null,o=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=r-(o===null?t.end-t.start:o-r)),o===null&&(o=r+r-a);const c=r-(r-Math.min(a,o))/2*l;return{chunk:Math.abs(o-a)/2*l/i,ratio:e.barPercentage,start:c}}function oy(n,t,e,i){const s=e.parse(n[0],i),r=e.parse(n[1],i),a=Math.min(s,r),o=Math.max(s,r);let l=a,c=o;Math.abs(a)>Math.abs(o)&&(l=o,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:r,min:a,max:o}}function ku(n,t,e,i){return wt(n)?oy(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Tu(n,t,e,i){const s=n.iScale,r=n.vScale,a=s.getLabels(),o=s===r,l=[];let c,u,h,f;for(c=e,u=e+i;c<u;++c)f=t[c],h={},h[s.axis]=o||s.parse(a[c],c),l.push(ku(f,h,r,c));return l}function co(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function ly(n,t,e){return n!==0?Ve(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function cy(n){let t,e,i,s,r;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",r="start"):(s="start",r="end"),{start:e,end:i,reverse:t,top:s,bottom:r}}function uy(n,t,e,i){let s=t.borderSkipped;const r={};if(!s){n.borderSkipped=r;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:o,reverse:l,top:c,bottom:u}=cy(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=u:(r[Du(u,a,o,l)]=!0,s=c)),r[Du(s,a,o,l)]=!0,n.borderSkipped=r}function Du(n,t,e,i){return i?(n=dy(n,t,e),n=Cu(n,e,t)):n=Cu(n,t,e),n}function dy(n,t,e){return n===t?e:n===e?t:n}function Cu(n,t,e){return n==="start"?t:n==="end"?e:n}function hy(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class us extends Fe{parsePrimitiveData(t,e,i,s){return Tu(t,e,i,s)}parseArrayData(t,e,i,s){return Tu(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:r,vScale:a}=t,{xAxisKey:o="x",yAxisKey:l="y"}=this._parsing,c=r.axis==="x"?o:l,u=a.axis==="x"?o:l,h=[];let f,m,p,_;for(f=i,m=i+s;f<m;++f)_=e[f],p={},p[r.axis]=r.parse(_n(_,c),f),h.push(ku(_n(_,u),p,a,f));return h}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const r=i._custom;r&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,r.min),t.max=Math.max(t.max,r.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:i,vScale:s}=e,r=this.getParsed(t),a=r._custom,o=co(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(r[s.axis]);return{label:""+i.getLabelForValue(r[i.axis]),value:o}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,i,s){const r=s==="reset",{index:a,_cachedMeta:{vScale:o}}=this,l=o.getBasePixel(),c=o.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s);for(let m=e;m<e+i;m++){const p=this.getParsed(m),_=r||st(p[o.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),v=(p._stacks||{})[o.axis],k={horizontal:c,base:_.base,enableBorderRadius:!v||co(p._custom)||a===v._top||a===v._bottom,x:c?_.head:x.center,y:c?x.center:_.head,height:c?x.size:Math.abs(_.size),width:c?Math.abs(_.size):x.size};f&&(k.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const E=k.options||t[m].options;uy(k,E,v,a),hy(k,E,u.ratio),this.updateElement(t[m],m,k,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),r=i.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(e),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 s)if(!(e!==void 0&&c(u))&&((r===!1||a.indexOf(u.stack)===-1||r===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,e=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[rt(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,i){const s=this._getStacks(t,i),r=e!==void 0?s.indexOf(e):-1;return r===-1?s.length-1:r}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let r,a;for(r=0,a=e.data.length;r<a;++r)s.push(i.getPixelForValue(this.getParsed(r)[i.axis],r));const o=t.barThickness;return{min:o||sy(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:o?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:r,minBarLength:a}}=this,o=r||0,l=this.getParsed(t),c=l._custom,u=co(c);let h=l[e.axis],f=0,m=i?this.applyStack(e,l,i):h,p,_;m!==h&&(f=m-h,m=h),u&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&Ve(h)!==Ve(c.barEnd)&&(f=0),f+=h);const x=!st(r)&&!u?r:f;let v=e.getPixelForValue(x);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(f+m):p=v,_=p-v,Math.abs(_)<a){_=ly(_,e,o)*a,h===o&&(v-=_/2);const k=e.getPixelForDecimal(0),E=e.getPixelForDecimal(1),P=Math.min(k,E),O=Math.max(k,E);v=Math.max(Math.min(v,O),P),p=v+_,i&&!u&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(p)-e.getValueForPixel(v))}if(v===e.getPixelForValue(o)){const k=Ve(_)*e.getLineWidthForValue(o)/2;v+=k,_-=k}return{size:_,base:v,head:p,center:p+_/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,r=s.skipNull,a=rt(s.maxBarThickness,1/0);let o,l;const c=this._getAxisCount();if(e.grouped){const u=r?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?ay(t,e,s,u*c):ry(t,e,s,u*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(rt(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,r?t:void 0)+m;o=h.start+h.chunk*p+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,e.min*e.ratio);return{base:o-l/2,head:o+l/2,center:o,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let r=0;for(;r<s;++r)this.getParsed(r)[e.axis]!==null&&!i[r].hidden&&i[r].draw(this._ctx)}}A(us,"id","bar"),A(us,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),A(us,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Sr extends Fe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const r=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<r.length;a++)r[a]._custom=this.resolveDataElementOptions(a+i).radius;return r}parseArrayData(t,e,i,s){const r=super.parseArrayData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=rt(o[2],this.resolveDataElementOptions(a+i).radius)}return r}parseObjectData(t,e,i,s){const r=super.parseObjectData(t,e,i,s);for(let a=0;a<r.length;a++){const o=e[i+a];r[a]._custom=rt(o&&o.r&&+o.r,this.resolveDataElementOptions(a+i).radius)}return r}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+o+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),u=a.axis,h=o.axis;for(let f=e;f<e+i;f++){const m=t[f],p=!r&&this.getParsed(f),_={},x=_[u]=r?a.getPixelForDecimal(.5):a.getPixelForValue(p[u]),v=_[h]=r?o.getBasePixel():o.getPixelForValue(p[h]);_.skip=isNaN(x)||isNaN(v),c&&(_.options=l||this.resolveDataElementOptions(f,m.active?"active":s),r&&(_.options.radius=0)),this.updateElement(m,f,_,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const r=s.radius;return e!=="active"&&(s.radius=0),s.radius+=rt(i&&i._custom,r),s}}A(Sr,"id","bubble"),A(Sr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),A(Sr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function fy(n,t,e){let i=1,s=1,r=0,a=0;if(t<Ct){const o=n,l=o+t,c=Math.cos(o),u=Math.sin(o),h=Math.cos(l),f=Math.sin(l),m=(E,P,O)=>ns(E,o,l,!0)?1:Math.max(P,P*e,O,O*e),p=(E,P,O)=>ns(E,o,l,!0)?-1:Math.min(P,P*e,O,O*e),_=m(0,c,h),x=m(Ot,u,f),v=p(ut,c,h),k=p(ut+Ot,u,f);i=(_-v)/2,s=(x-k)/2,r=-(_+v)/2,a=-(x+k)/2}return{ratioX:i,ratioY:s,offsetX:r,offsetY:a}}class sn extends Fe{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let r=l=>+i[l];if(ft(i[t])){const{key:l="value"}=this._parsing;r=c=>+_n(i[c],l)}let a,o;for(a=t,o=t+e;a<o;++a)s._parsed[a]=r(a)}}_getRotation(){return Yt(this.options.rotation-90)}_getCircumference(){return Yt(this.options.circumference)}_getRotationExtents(){let t=Ct,e=-Ct;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,r=s._getRotation(),a=s._getCircumference();t=Math.min(t,r),e=Math.max(e,r+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:i}=e,s=this._cachedMeta,r=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(r)+this.options.spacing,o=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(Tg(this.options.cutout,o),1),c=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:_}=fy(h,u,l),x=(i.width-a)/f,v=(i.height-a)/m,k=Math.max(Math.min(x,v)/2,0),E=Pc(this.options.radius,k),P=Math.max(E*l,0),O=(E-P)/this._getVisibleDatasetWeightTotal();this.offsetX=p*E,this.offsetY=_*E,s.total=this.calculateTotal(),this.outerRadius=E-O*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-O*c,0),this.updateElements(r,0,r.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,r=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*r/Ct)}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,o=a.chartArea,c=a.options.animation,u=(o.left+o.right)/2,h=(o.top+o.bottom)/2,f=r&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:_,includeOptions:x}=this._getSharedOptions(e,s);let v=this._getRotation(),k;for(k=0;k<e;++k)v+=this._circumference(k,r);for(k=e;k<e+i;++k){const E=this._circumference(k,r),P=t[k],O={x:u+this.offsetX,y:h+this.offsetY,startAngle:v,endAngle:v+E,circumference:E,outerRadius:p,innerRadius:m};x&&(O.options=_||this.resolveDataElementOptions(k,P.active?"active":s)),v+=E,this.updateElement(P,k,O,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const r=t._parsed[s];r!==null&&!isNaN(r)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(r))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?Ct*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ss(e._parsed[t],i.options.locale);return{label:s[t]||"",value:r}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,r,a,o,l;if(!t){for(s=0,r=i.data.datasets.length;s<r;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,o=a.controller;break}}if(!t)return 0;for(s=0,r=t.length;s<r;++s)l=o.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const r=this.resolveDataElementOptions(i);e=Math.max(e,r.offset||0,r.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(rt(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}A(sn,"id","doughnut"),A(sn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),A(sn,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),A(sn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:r,hidden:!t.getDataVisibility(c),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:s,pointStyle:i,borderRadius:a&&(o||h.borderRadius),index:c}}):[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class ds extends Fe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:r}=e,a=this.chart._animationsDisabled;let{start:o,count:l}=Yc(e,s,a);this._drawStart=o,this._drawCount=l,$c(e)&&(o=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!r._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,o,l,t)}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(e,s),f=a.axis,m=o.axis,{spanGaps:p,segment:_}=this.options,x=wn(p)?p:Number.POSITIVE_INFINITY,v=this.chart._animationsDisabled||r||s==="none",k=e+i,E=t.length;let P=e>0&&this.getParsed(e-1);for(let O=0;O<E;++O){const D=t[O],S=v?D:{};if(O<e||O>=k){S.skip=!0;continue}const g=this.getParsed(O),y=st(g[m]),M=S[f]=a.getPixelForValue(g[f],O),C=S[m]=r||y?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,g,l):g[m],O);S.skip=isNaN(M)||isNaN(C)||y,S.stop=O>0&&Math.abs(g[f]-P[f])>x,_&&(S.parsed=g,S.raw=c.data[O]),h&&(S.options=u||this.resolveDataElementOptions(O,D.active?"active":s)),v||this.updateElement(D,O,S,s),P=g}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const r=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,r,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}A(ds,"id","line"),A(ds,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),A(ds,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class hs extends Fe{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],r=ss(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:r}}parseObjectData(t,e,i,s){return ru.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const r=this.getParsed(s).r;!isNaN(r)&&this.chart.getDataVisibility(s)&&(r<e.min&&(e.min=r),r>e.max&&(e.max=r))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),r=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?r/100*i.cutoutPercentage:1,0),o=(r-a)/t.getVisibleDatasetCount();this.outerRadius=r-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const r=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,u=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*ut;let m=f,p;const _=360/this.countVisibleElements();for(p=0;p<e;++p)m+=this._computeAngle(p,s,_);for(p=e;p<e+i;p++){const x=t[p];let v=m,k=m+this._computeAngle(p,s,_),E=a.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=k,r&&(l.animateScale&&(E=0),l.animateRotate&&(v=k=f));const P={x:u,y:h,innerRadius:0,outerRadius:E,startAngle:v,endAngle:k,options:this.resolveDataElementOptions(p,x.active?"active":s)};this.updateElement(x,p,P,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?Yt(this.resolveDataElementOptions(t,e).angle||i):0}}A(hs,"id","polarArea"),A(hs,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),A(hs,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((r,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:r,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class uo extends sn{}A(uo,"id","pie"),A(uo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class kr extends Fe{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return ru.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],r=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const o={_loop:!0,_fullLoop:r.length===s.length,options:a};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const r=this._cachedMeta.rScale,a=s==="reset";for(let o=e;o<e+i;o++){const l=t[o],c=this.resolveDataElementOptions(o,l.active?"active":s),u=r.getPointPositionForValue(o,this.getParsed(o).r),h=a?r.xCenter:u.x,f=a?r.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,o,m,s)}}}A(kr,"id","radar"),A(kr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),A(kr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Tr extends Fe{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:r}=e,a=this.getParsed(t),o=s.getLabelForValue(a.x),l=r.getLabelForValue(a.y);return{label:i[t]||"",value:"("+o+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:r,count:a}=Yc(e,i,s);if(this._drawStart=r,this._drawCount=a,$c(e)&&(r=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:o,_dataset:l}=e;o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!l._decimated,o.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(o,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,r,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const r=s==="reset",{iScale:a,vScale:o,_stacked:l,_dataset:c}=this._cachedMeta,u=this.resolveDataElementOptions(e,s),h=this.getSharedOptions(u),f=this.includeOptions(s,h),m=a.axis,p=o.axis,{spanGaps:_,segment:x}=this.options,v=wn(_)?_:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||r||s==="none";let E=e>0&&this.getParsed(e-1);for(let P=e;P<e+i;++P){const O=t[P],D=this.getParsed(P),S=k?O:{},g=st(D[p]),y=S[m]=a.getPixelForValue(D[m],P),M=S[p]=r||g?o.getBasePixel():o.getPixelForValue(l?this.applyStack(o,D,l):D[p],P);S.skip=isNaN(y)||isNaN(M)||g,S.stop=P>0&&Math.abs(D[m]-E[m])>v,x&&(S.parsed=D,S.raw=c.data[P]),f&&(S.options=h||this.resolveDataElementOptions(P,O.active?"active":s)),k||this.updateElement(O,P,S,s),E=D}this.updateSharedOptions(h,s,u)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let o=0;for(let l=e.length-1;l>=0;--l)o=Math.max(o,e[l].size(this.resolveDataElementOptions(l))/2);return o>0&&o}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const r=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,r,a)/2}}A(Tr,"id","scatter"),A(Tr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),A(Tr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var my=Object.freeze({__proto__:null,BarController:us,BubbleController:Sr,DoughnutController:sn,LineController:ds,PieController:uo,PolarAreaController:hs,RadarController:kr,ScatterController:Tr});function Un(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ho{constructor(t){A(this,"options");this.options=t||{}}static override(t){Object.assign(ho.prototype,t)}init(){}formats(){return Un()}parse(){return Un()}format(){return Un()}add(){return Un()}diff(){return Un()}startOf(){return Un()}endOf(){return Un()}}var Eu={_date:ho};function gy(n,t,e,i){const{controller:s,data:r,_sorted:a}=n,o=s._cachedMeta.iScale,l=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(o&&t===o.axis&&t!=="r"&&a&&r.length){const c=o._reversePixels?Bg:tn;if(i){if(s._sharedOptions){const u=r[0],h=typeof u.getRange=="function"&&u.getRange(t);if(h){const f=c(r,t,e-h),m=c(r,t,e+h);return{lo:f.lo,hi:m.hi}}}}else{const u=c(r,t,e);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(_=>!st(_[h.axis]));u.lo-=Math.max(0,m);const p=f.slice(u.hi).findIndex(_=>!st(_[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:r.length-1}}function fs(n,t,e,i,s){const r=n.getSortedVisibleDatasetMetas(),a=e[t];for(let o=0,l=r.length;o<l;++o){const{index:c,data:u}=r[o],{lo:h,hi:f}=gy(r[o],t,a,s);for(let m=h;m<=f;++m){const p=u[m];p.skip||i(p,c,m)}}}function py(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const r=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(r,2)+Math.pow(a,2))}}function fo(n,t,e,i,s){const r=[];return!s&&!n.isPointInArea(t)||fs(n,e,t,function(o,l,c){!s&&!en(o,n.chartArea,0)||o.inRange(t.x,t.y,i)&&r.push({element:o,datasetIndex:l,index:c})},!0),r}function yy(n,t,e,i){let s=[];function r(a,o,l){const{startAngle:c,endAngle:u}=a.getProps(["startAngle","endAngle"],i),{angle:h}=pr(a,{x:t.x,y:t.y});ns(h,c,u)&&s.push({element:a,datasetIndex:o,index:l})}return fs(n,e,t,r),s}function by(n,t,e,i,s,r){let a=[];const o=py(e);let l=Number.POSITIVE_INFINITY;function c(u,h,f){const m=u.inRange(t.x,t.y,s);if(i&&!m)return;const p=u.getCenterPoint(s);if(!(!!r||n.isPointInArea(p))&&!m)return;const x=o(t,p);x<l?(a=[{element:u,datasetIndex:h,index:f}],l=x):x===l&&a.push({element:u,datasetIndex:h,index:f})}return fs(n,e,t,c),a}function mo(n,t,e,i,s,r){return!r&&!n.isPointInArea(t)?[]:e==="r"&&!i?yy(n,t,e,s):by(n,t,e,i,s,r)}function Ou(n,t,e,i,s){const r=[],a=e==="x"?"inXRange":"inYRange";let o=!1;return fs(n,e,t,(l,c,u)=>{l[a]&&l[a](t[e],s)&&(r.push({element:l,datasetIndex:c,index:u}),o=o||l.inRange(t.x,t.y,s))}),i&&!o?[]:r}var go={evaluateInteractionItems:fs,modes:{index(n,t,e,i){const s=Sn(t,n),r=e.axis||"x",a=e.includeInvisible||!1,o=e.intersect?fo(n,s,r,i,a):mo(n,s,r,!1,i,a),l=[];return o.length?(n.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(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;let o=e.intersect?fo(n,s,r,i,a):mo(n,s,r,!1,i,a);if(o.length>0){const l=o[0].datasetIndex,c=n.getDatasetMeta(l).data;o=[];for(let u=0;u<c.length;++u)o.push({element:c[u],datasetIndex:l,index:u})}return o},point(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return fo(n,s,r,i,a)},nearest(n,t,e,i){const s=Sn(t,n),r=e.axis||"xy",a=e.includeInvisible||!1;return mo(n,s,r,e.intersect,i,a)},x(n,t,e,i){const s=Sn(t,n);return Ou(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Sn(t,n);return Ou(n,s,"y",e.intersect,i)}}};const Pu=["left","top","right","bottom"];function ms(n,t){return n.filter(e=>e.pos===t)}function Au(n,t){return n.filter(e=>Pu.indexOf(e.pos)===-1&&e.box.axis===t)}function gs(n,t){return n.sort((e,i)=>{const s=t?i:e,r=t?e:i;return s.weight===r.weight?s.index-r.index:s.weight-r.weight})}function _y(n){const t=[];let e,i,s,r,a,o;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:r,options:{stack:a,stackWeight:o=1}}=s,t.push({index:e,box:s,pos:r,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&r+a,stackWeight:o});return t}function xy(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:r}=e;if(!i||!Pu.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=r}return t}function wy(n,t){const e=xy(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let r,a,o;for(r=0,a=n.length;r<a;++r){o=n[r];const{fullSize:l}=o.box,c=e[o.stack],u=c&&o.stackWeight/c.weight;o.horizontal?(o.width=u?u*i:l&&t.availableWidth,o.height=s):(o.width=i,o.height=u?u*s:l&&t.availableHeight)}return e}function vy(n){const t=_y(n),e=gs(t.filter(c=>c.box.fullSize),!0),i=gs(ms(t,"left"),!0),s=gs(ms(t,"right")),r=gs(ms(t,"top"),!0),a=gs(ms(t,"bottom")),o=Au(t,"x"),l=Au(t,"y");return{fullSize:e,leftAndTop:i.concat(r),rightAndBottom:s.concat(l).concat(a).concat(o),chartArea:ms(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:r.concat(a).concat(o)}}function Ru(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Iu(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function My(n,t,e,i){const{pos:s,box:r}=e,a=n.maxPadding;if(!ft(s)){e.size&&(n[s]-=e.size);const h=i[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?r.height:r.width),e.size=h.size/h.count,n[s]+=e.size}r.getPadding&&Iu(a,r.getPadding());const o=Math.max(0,t.outerWidth-Ru(a,n,"left","right")),l=Math.max(0,t.outerHeight-Ru(a,n,"top","bottom")),c=o!==n.w,u=l!==n.h;return n.w=o,n.h=l,e.horizontal?{same:c,other:u}:{same:u,other:c}}function Sy(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function ky(n,t){const e=t.maxPadding;function i(s){const r={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{r[a]=Math.max(t[a],e[a])}),r}return i(n?["left","right"]:["top","bottom"])}function ps(n,t,e,i){const s=[];let r,a,o,l,c,u;for(r=0,a=n.length,c=0;r<a;++r){o=n[r],l=o.box,l.update(o.width||t.w,o.height||t.h,ky(o.horizontal,t));const{same:h,other:f}=My(t,e,o,i);c|=h&&s.length,u=u||f,l.fullSize||s.push(o)}return c&&ps(s,t,e,i)||u}function Dr(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Lu(n,t,e,i){const s=e.padding;let{x:r,y:a}=t;for(const o of n){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;ge(c.start)&&(a=c.start),l.fullSize?Dr(l,s.left,a,e.outerWidth-s.right-s.left,f):Dr(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;ge(c.start)&&(r=c.start),l.fullSize?Dr(l,r,s.top,f,e.outerHeight-s.bottom-s.top):Dr(l,r,t.top+c.placed,f,h),c.start=r,c.placed+=h,r=l.right}}t.x=r,t.y=a}var ae={addBox(n,t){n.boxes||(n.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=$t(n.options.layout.padding),r=Math.max(t-s.width,0),a=Math.max(e-s.height,0),o=vy(n.boxes),l=o.vertical,c=o.horizontal;kt(n.boxes,_=>{typeof _.beforeLayout=="function"&&_.beforeLayout()});const u=l.reduce((_,x)=>x.box.options&&x.box.options.display===!1?_:_+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:r,availableHeight:a,vBoxMaxWidth:r/2/u,hBoxMaxHeight:a/2}),f=Object.assign({},s);Iu(f,$t(i));const m=Object.assign({maxPadding:f,w:r,h:a,x:s.left,y:s.top},s),p=wy(l.concat(c),h);ps(o.fullSize,m,h,p),ps(l,m,h,p),ps(c,m,h,p)&&ps(l,m,h,p),Sy(m),Lu(o.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,Lu(o.rightAndBottom,m,h,p),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},kt(o.chartArea,_=>{const x=_.box;Object.assign(x,n.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Nu{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Ty extends Nu{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Cr="$chartjs",Dy={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Fu=n=>n===null||n==="";function Cy(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Cr]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Fu(s)){const r=lu(n,"width");r!==void 0&&(n.width=r)}if(Fu(i))if(n.style.height==="")n.height=n.width/(t||2);else{const r=lu(n,"height");r!==void 0&&(n.height=r)}return n}const Bu=Pp?{passive:!0}:!1;function Ey(n,t,e){n&&n.addEventListener(t,e,Bu)}function Oy(n,t,e){n&&n.canvas&&n.canvas.removeEventListener(t,e,Bu)}function Py(n,t){const e=Dy[n.type]||n.type,{x:i,y:s}=Sn(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Er(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Ay(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Er(o.addedNodes,i),a=a&&!Er(o.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ry(n,t,e){const i=n.canvas,s=new MutationObserver(r=>{let a=!1;for(const o of r)a=a||Er(o.removedNodes,i),a=a&&!Er(o.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const ys=new Map;let zu=0;function Hu(){const n=window.devicePixelRatio;n!==zu&&(zu=n,ys.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Iy(n,t){ys.size||window.addEventListener("resize",Hu),ys.set(n,t)}function Ly(n){ys.delete(n),ys.size||window.removeEventListener("resize",Hu)}function Ny(n,t,e){const i=n.canvas,s=i&&so(i);if(!s)return;const r=Vc((o,l)=>{const c=s.clientWidth;e(o,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(o=>{const l=o[0],c=l.contentRect.width,u=l.contentRect.height;c===0&&u===0||r(c,u)});return a.observe(s),Iy(n,r),a}function po(n,t,e){e&&e.disconnect(),t==="resize"&&Ly(n)}function Fy(n,t,e){const i=n.canvas,s=Vc(r=>{n.ctx!==null&&e(Py(r,n))},n);return Ey(i,t,s),s}class By extends Nu{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Cy(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Cr])return!1;const i=e[Cr].initial;["height","width"].forEach(r=>{const a=i[r];st(a)?e.removeAttribute(r):e.setAttribute(r,a)});const s=i.style||{};return Object.keys(s).forEach(r=>{e.style[r]=s[r]}),e.width=e.width,delete e[Cr],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Ay,detach:Ry,resize:Ny}[e]||Fy;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:po,detach:po,resize:po}[e]||Oy)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Op(t,e,i,s)}isAttached(t){const e=t&&so(t);return!!(e&&e.isConnected)}}function zy(n){return!io()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ty:By}class Zt{constructor(){A(this,"x");A(this,"y");A(this,"active",!1);A(this,"options");A(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return wn(this.x)&&wn(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(r=>{s[r]=i[r]&&i[r].active()?i[r]._to:this[r]}),s}}A(Zt,"defaults",{}),A(Zt,"defaultRoutes");function Hy(n,t){const e=n.options.ticks,i=Wy(n),s=Math.min(e.maxTicksLimit||i,i),r=e.major.enabled?Yy(t):[],a=r.length,o=r[0],l=r[a-1],c=[];if(a>s)return $y(t,c,r,a/s),c;const u=Vy(r,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-o)/(a-1)):null;for(Or(t,c,u,st(m)?0:o-m,o),h=0,f=a-1;h<f;h++)Or(t,c,u,r[h],r[h+1]);return Or(t,c,u,l,st(m)?t.length:l+m),c}return Or(t,c,u),c}function Wy(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function Vy(n,t,e){const i=jy(n),s=t.length/e;if(!i)return Math.max(s,1);const r=Rg(i);for(let a=0,o=r.length-1;a<o;a++){const l=r[a];if(l>s)return l}return Math.max(s,1)}function Yy(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function $y(n,t,e,i){let s=0,r=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===r&&(t.push(n[a]),s++,r=e[s*i])}function Or(n,t,e,i,s){const r=rt(i,0),a=Math.min(rt(s,n.length),n.length);let o=0,l,c,u;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),u=r;u<0;)o++,u=Math.round(r+o*e);for(c=Math.max(r,0);c<a;c++)c===u&&(t.push(n[c]),o++,u=Math.round(r+o*e))}function jy(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const Uy=n=>n==="left"?"right":n==="right"?"left":n,Wu=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Vu=(n,t)=>Math.min(t||n,n);function Yu(n,t){const e=[],i=n.length/t,s=n.length;let r=0;for(;r<s;r+=i)e.push(n[Math.floor(r)]);return e}function qy(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),r=n._startPixel,a=n._endPixel,o=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-r,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<r-o||l>a+o)))return l}function Xy(n,t){kt(n,e=>{const i=e.gc,s=i.length/2;let r;if(s>t){for(r=0;r<s;++r)delete e.data[i[r]];i.splice(0,s)}})}function bs(n){return n.drawTicks?n.tickLength:0}function $u(n,t){if(!n.display)return 0;const e=Rt(n.font,t),i=$t(n.padding);return(wt(n.text)?n.text.length:1)*e.lineHeight+i.height}function Gy(n,t){return Mn(n,{scale:t,type:"scale"})}function Ky(n,t,e){return Mn(n,{tick:e,index:t,type:"tick"})}function Zy(n,t,e){let i=qa(n);return(e&&t!=="right"||!e&&t==="right")&&(i=Uy(i)),i}function Qy(n,t,e,i){const{top:s,left:r,bottom:a,right:o,chart:l}=n,{chartArea:c,scales:u}=l;let h=0,f,m,p;const _=a-s,x=o-r;if(n.isHorizontal()){if(m=re(i,r,o),ft(e)){const v=Object.keys(e)[0],k=e[v];p=u[v].getPixelForValue(k)+_-t}else e==="center"?p=(c.bottom+c.top)/2+_-t:p=Wu(n,e,t);f=o-r}else{if(ft(e)){const v=Object.keys(e)[0],k=e[v];m=u[v].getPixelForValue(k)-x+t}else e==="center"?m=(c.left+c.right)/2-x+t:m=Wu(n,e,t);p=re(i,a,s),h=e==="left"?-Ot:Ot}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class qn extends Zt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=Te(t,Number.POSITIVE_INFINITY),e=Te(e,Number.NEGATIVE_INFINITY),i=Te(i,Number.POSITIVE_INFINITY),s=Te(s,Number.NEGATIVE_INFINITY),{min:Te(t,i),max:Te(e,s),minDefined:At(t),maxDefined:At(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:r}=this.getUserBounds(),a;if(s&&r)return{min:e,max:i};const o=this.getMatchingVisibleMetas();for(let l=0,c=o.length;l<c;++l)a=o[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),r||(i=Math.max(i,a.max));return e=r&&e>i?i:e,i=s&&e>i?e:i,{min:Te(e,Te(i,e)),max:Te(i,Te(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){St(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:r,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=lp(this,r,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=o<this.ticks.length;this._convertTicksToLabels(l?Yu(this.ticks,o):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Hy(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){St(this.options.afterUpdate,[this])}beforeSetDimensions(){St(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(){St(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),St(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){St(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,r;for(i=0,s=t.length;i<s;i++)r=t[i],r.label=St(e.callback,[r.value,i,t],this)}afterTickToLabelConversion(){St(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){St(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Vu(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,r=e.maxRotation;let a=s,o,l,c;if(!this._isVisible()||!e.display||s>=r||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Kt(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-bs(t.grid)-e.padding-$u(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=gr(Math.min(Math.asin(Kt((u.highest.height+6)/o,-1,1)),Math.asin(Kt(l/c,-1,1))-Math.asin(Kt(f/c,-1,1)))),a=Math.max(s,Math.min(r,a))),this.labelRotation=a}afterCalculateLabelRotation(){St(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){St(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:r}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){const l=$u(s,e.options.font);if(o?(t.width=this.maxWidth,t.height=bs(r)+l):(t.height=this.maxHeight,t.width=bs(r)+l),i.display&&this.ticks.length){const{first:c,last:u,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Yt(this.labelRotation),_=Math.cos(p),x=Math.sin(p);if(o){const v=i.mirror?0:x*h.width+_*f.height;t.height=Math.min(this.maxHeight,t.height+v+m)}else{const v=i.mirror?0:_*h.width+x*f.height;t.width=Math.min(this.maxWidth,t.width+v+m)}this._calculatePadding(c,u,x,_)}}this._handleMargins(),o?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:r,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=s*t.width,m=i*e.height):(f=i*t.height,m=s*e.width):r==="start"?m=e.width:r==="end"?f=t.width:r!=="inner"&&(f=t.width/2,m=e.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=e.height/2,h=t.height/2;r==="start"?(u=0,h=t.height):r==="end"&&(u=e.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(){St(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e<i;e++)st(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=Yu(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:r}=this,a=[],o=[],l=Math.floor(e/Vu(e,i));let c=0,u=0,h,f,m,p,_,x,v,k,E,P,O;for(h=0;h<e;h+=l){if(p=t[h].label,_=this._resolveTickFontOptions(h),s.font=x=_.string,v=r[x]=r[x]||{data:{},gc:[]},k=_.lineHeight,E=P=0,!st(p)&&!wt(p))E=_r(s,v.data,v.gc,E,p),P=k;else if(wt(p))for(f=0,m=p.length;f<m;++f)O=p[f],!st(O)&&!wt(O)&&(E=_r(s,v.data,v.gc,E,O),P+=k);a.push(E),o.push(P),c=Math.max(E,c),u=Math.max(P,u)}Xy(r,e);const D=a.indexOf(c),S=o.indexOf(u),g=y=>({width:a[y]||0,height:o[y]||0});return{first:g(0),last:g(e-1),widest:g(D),highest:g(S),widths:a,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Fg(this._alignToPixels?Vn(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const i=e[t];return i.$context||(i.$context=Ky(this.getContext(),t,i))}return this.$context||(this.$context=Gy(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Yt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),r=this._getLabelSizes(),a=t.autoSkipPadding||0,o=r?r.widest.width+a:0,l=r?r.highest.height+a:0;return this.isHorizontal()?l*i>o*s?o/i:l/s:l*s<o*i?l/i:o/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:r,position:a,border:o}=s,l=r.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=bs(r),m=[],p=o.setContext(this.getContext()),_=p.display?p.width:0,x=_/2,v=function(Q){return Vn(i,Q,_)};let k,E,P,O,D,S,g,y,M,C,R,I;if(a==="top")k=v(this.bottom),S=this.bottom-f,y=k-x,C=v(t.top)+x,I=t.bottom;else if(a==="bottom")k=v(this.top),C=t.top,I=v(t.bottom)-x,S=k+x,y=this.top+f;else if(a==="left")k=v(this.right),D=this.right-f,g=k-x,M=v(t.left)+x,R=t.right;else if(a==="right")k=v(this.left),M=t.left,R=v(t.right)-x,D=k+x,g=this.left+f;else if(e==="x"){if(a==="center")k=v((t.top+t.bottom)/2+.5);else if(ft(a)){const Q=Object.keys(a)[0],Y=a[Q];k=v(this.chart.scales[Q].getPixelForValue(Y))}C=t.top,I=t.bottom,S=k+x,y=S+f}else if(e==="y"){if(a==="center")k=v((t.left+t.right)/2);else if(ft(a)){const Q=Object.keys(a)[0],Y=a[Q];k=v(this.chart.scales[Q].getPixelForValue(Y))}D=k-x,g=D-f,M=t.left,R=t.right}const F=rt(s.ticks.maxTicksLimit,h),$=Math.max(1,Math.ceil(h/F));for(E=0;E<h;E+=$){const Q=this.getContext(E),Y=r.setContext(Q),lt=o.setContext(Q),U=Y.lineWidth,z=Y.color,q=lt.dash||[],J=lt.dashOffset,j=Y.tickWidth,yt=Y.tickColor,_t=Y.tickBorderDash||[],V=Y.tickBorderDashOffset;P=qy(this,E,l),P!==void 0&&(O=Vn(i,P,U),c?D=g=M=R=O:S=y=C=I=O,m.push({tx1:D,ty1:S,tx2:g,ty2:y,x1:M,y1:C,x2:R,y2:I,width:U,color:z,borderDash:q,borderDashOffset:J,tickWidth:j,tickColor:yt,tickBorderDash:_t,tickBorderDashOffset:V}))}return this._ticksLength=h,this._borderValue=k,m}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:r}=i,a=this.isHorizontal(),o=this.ticks,{align:l,crossAlign:c,padding:u,mirror:h}=r,f=bs(i.grid),m=f+u,p=h?-u:m,_=-Yt(this.labelRotation),x=[];let v,k,E,P,O,D,S,g,y,M,C,R,I="middle";if(s==="top")D=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const $=this._getYAxisLabelAlignment(f);S=$.textAlign,O=$.x}else if(s==="right"){const $=this._getYAxisLabelAlignment(f);S=$.textAlign,O=$.x}else if(e==="x"){if(s==="center")D=(t.top+t.bottom)/2+m;else if(ft(s)){const $=Object.keys(s)[0],Q=s[$];D=this.chart.scales[$].getPixelForValue(Q)+m}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")O=(t.left+t.right)/2-m;else if(ft(s)){const $=Object.keys(s)[0],Q=s[$];O=this.chart.scales[$].getPixelForValue(Q)}S=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?I="top":l==="end"&&(I="bottom"));const F=this._getLabelSizes();for(v=0,k=o.length;v<k;++v){E=o[v],P=E.label;const $=r.setContext(this.getContext(v));g=this.getPixelForTick(v)+r.labelOffset,y=this._resolveTickFontOptions(v),M=y.lineHeight,C=wt(P)?P.length:1;const Q=C/2,Y=$.color,lt=$.textStrokeColor,U=$.textStrokeWidth;let z=S;a?(O=g,S==="inner"&&(v===k-1?z=this.options.reverse?"left":"right":v===0?z=this.options.reverse?"right":"left":z="center"),s==="top"?c==="near"||_!==0?R=-C*M+M/2:c==="center"?R=-F.highest.height/2-Q*M+M:R=-F.highest.height+M/2:c==="near"||_!==0?R=M/2:c==="center"?R=F.highest.height/2-Q*M:R=F.highest.height-C*M,h&&(R*=-1),_!==0&&!$.showLabelBackdrop&&(O+=M/2*Math.sin(_))):(D=g,R=(1-C)*M/2);let q;if($.showLabelBackdrop){const J=$t($.backdropPadding),j=F.heights[v],yt=F.widths[v];let _t=R-J.top,V=0-J.left;switch(I){case"middle":_t-=j/2;break;case"bottom":_t-=j;break}switch(S){case"center":V-=yt/2;break;case"right":V-=yt;break;case"inner":v===k-1?V-=yt:v>0&&(V-=yt/2);break}q={left:V,top:_t,width:yt+J.width,height:j+J.height,color:$.backdropColor}}x.push({label:P,font:y,textOffset:R,options:{rotation:_,color:Y,strokeColor:lt,strokeWidth:U,textAlign:z,textBaseline:I,translation:[O,D],backdrop:q}})}return x}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Yt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:r}}=this.options,a=this._getLabelSizes(),o=t+r,l=a.widest.width;let c,u;return e==="left"?s?(u=this.right+r,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u+=l)):(u=this.right-o,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u=this.left)):e==="right"?s?(u=this.left+r,i==="near"?c="right":i==="center"?(c="center",u-=l/2):(c="left",u-=l)):(u=this.left+o,i==="near"?c="left":i==="center"?(c="center",u+=l/2):(c="right",u=this.right)):c="right",{textAlign:c,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:s,width:r,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,r,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(r=>r.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let r,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(e.display)for(r=0,a=s.length;r<a;++r){const l=s[r];e.drawOnChartArea&&o({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&o({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,r=i.setContext(this.getContext()),a=i.display?r.width:0;if(!a)return;const o=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,u,h,f;this.isHorizontal()?(c=Vn(t,this.left,a)-a/2,u=Vn(t,this.right,o)+o/2,h=f=l):(h=Vn(t,this.top,a)-a/2,f=Vn(t,this.bottom,o)+o/2,c=u=l),e.save(),e.lineWidth=r.width,e.strokeStyle=r.color,e.beginPath(),e.moveTo(c,h),e.lineTo(u,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&as(i,s);const r=this.getLabelItems(t);for(const a of r){const o=a.options,l=a.font,c=a.label,u=a.textOffset;Yn(i,c,0,u,l,o)}s&&os(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const r=Rt(i.font),a=$t(i.padding),o=i.align;let l=r.lineHeight/2;e==="bottom"||e==="center"||ft(e)?(l+=a.bottom,wt(i.text)&&(l+=r.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:u,maxWidth:h,rotation:f}=Qy(this,l,e,o);Yn(t,i.text,0,0,r,{color:i.color,maxWidth:h,rotation:f,textAlign:Zy(o,e,s),textBaseline:"middle",translation:[c,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,i=rt(t.grid&&t.grid.z,-1),s=rt(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==qn.prototype.draw?[{z:e,draw:r=>{this.draw(r)}}]:[{z:i,draw:r=>{this.drawBackground(),this.drawGrid(r),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:r=>{this.drawLabels(r)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let r,a;for(r=0,a=e.length;r<a;++r){const o=e[r];o[i]===this.id&&(!t||o.type===t)&&s.push(o)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return Rt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Pr{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let i;eb(e)&&(i=this.register(e));const s=this.items,r=t.id,a=this.scope+"."+r;if(!r)throw new Error("class does not have id: "+t);return r in s||(s[r]=t,Jy(t,a,i),this.override&&Pt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Pt[s]&&(delete Pt[s][i],this.override&&delete Wn[i])}}function Jy(n,t,e){const i=Ji(Object.create(null),[e?Pt.get(e):{},Pt.get(t),n.defaults]);Pt.set(t,i),n.defaultRoutes&&tb(t,n.defaultRoutes),n.descriptors&&Pt.describe(t,n.descriptors)}function tb(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),r=[n].concat(i).join("."),a=t[e].split("."),o=a.pop(),l=a.join(".");Pt.route(r,s,l,o)})}function eb(n){return"id"in n&&"defaults"in n}class nb{constructor(){this.controllers=new Pr(Fe,"datasets",!0),this.elements=new Pr(Zt,"elements"),this.plugins=new Pr(Object,"plugins"),this.scales=new Pr(qn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(s=>{const r=i||this._getRegistryForType(s);i||r.isForType(s)||r===this.plugins&&s.id?this._exec(t,r,s):kt(s,a=>{const o=i||this._getRegistryForType(a);this._exec(t,o,a)})})}_exec(t,e,i){const s=$a(t);St(i["before"+s],[],i),e[t](i),St(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var Ye=new nb;class ib{constructor(){this._init=void 0}notify(t,e,i,s){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const r=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(r,t,e,i);return e==="afterDestroy"&&(this._notify(r,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,i,s){s=s||{};for(const r of t){const a=r.plugin,o=a[i],l=[e,s,r.options];if(St(o,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){st(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=rt(i.options&&i.options.plugins,{}),r=sb(i);return s===!1&&!e?[]:ab(t,r,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(r,a)=>r.filter(o=>!a.some(l=>o.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function sb(n){const t={},e=[],i=Object.keys(Ye.plugins.items);for(let r=0;r<i.length;r++)e.push(Ye.getPlugin(i[r]));const s=n.plugins||[];for(let r=0;r<s.length;r++){const a=s[r];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function rb(n,t){return!t&&n===!1?null:n===!0?{}:n}function ab(n,{plugins:t,localIds:e},i,s){const r=[],a=n.getContext();for(const o of t){const l=o.id,c=rb(i[l],s);c!==null&&r.push({plugin:o,options:ob(n.config,{plugin:o,local:e[l]},c,a)})}return r}function ob(n,{plugin:t,local:e},i,s){const r=n.pluginScopeKeys(t),a=n.getOptionScopes(i,r);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yo(n,t){const e=Pt.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function lb(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function cb(n,t){return n===t?"_index_":"_value_"}function ju(n){if(n==="x"||n==="y"||n==="r")return n}function ub(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function bo(n,...t){if(ju(n))return n;for(const e of t){const i=e.axis||ub(e.position)||n.length>1&&ju(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Uu(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function db(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Uu(n,"x",e[0])||Uu(n,"y",e[0])}return{}}function hb(n,t){const e=Wn[n.type]||{scales:{}},i=t.scales||{},s=yo(n.type,t),r=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=bo(a,o,db(a,n),Pt.scales[o.type]),c=cb(l,s),u=e.scales||{};r[a]=ts(Object.create(null),[{axis:l},o,u[l],u[c]])}),n.data.datasets.forEach(a=>{const o=a.type||n.type,l=a.indexAxis||yo(o,t),u=(Wn[o]||{}).scales||{};Object.keys(u).forEach(h=>{const f=lb(h,l),m=a[f+"AxisID"]||f;r[m]=r[m]||Object.create(null),ts(r[m],[{axis:f},i[m],u[h]])})}),Object.keys(r).forEach(a=>{const o=r[a];ts(o,[Pt.scales[o.type],Pt.scale])}),r}function qu(n){const t=n.options||(n.options={});t.plugins=rt(t.plugins,{}),t.scales=hb(n,t)}function Xu(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function fb(n){return n=n||{},n.data=Xu(n.data),qu(n),n}const Gu=new Map,Ku=new Set;function Ar(n,t){let e=Gu.get(n);return e||(e=t(),Gu.set(n,e),Ku.add(e)),e}const _s=(n,t,e)=>{const i=_n(t,e);i!==void 0&&n.add(i)};class mb{constructor(t){this._config=fb(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=Xu(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(),qu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ar(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ar(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ar(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Ar(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:r}=this,a=this._cachedScopes(t,i),o=a.get(e);if(o)return o;const l=new Set;e.forEach(u=>{t&&(l.add(t),u.forEach(h=>_s(l,t,h))),u.forEach(h=>_s(l,s,h)),u.forEach(h=>_s(l,Wn[r]||{},h)),u.forEach(h=>_s(l,Pt,h)),u.forEach(h=>_s(l,Ka,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Ku.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Wn[e]||{},Pt.datasets[e]||{},{type:e},Pt,Ka]}resolveNamedOptions(t,e,i,s=[""]){const r={$shared:!0},{resolver:a,subPrefixes:o}=Zu(this._resolverCache,t,s);let l=a;if(pb(a,e)){r.$shared=!1,i=pe(i)?i():i;const c=this.createResolver(t,i,o);l=bi(a,i,c)}for(const c of e)r[c]=l[c];return r}createResolver(t,e,i=[""],s){const{resolver:r}=Zu(this._resolverCache,t,i);return ft(e)?bi(r,e,void 0,s):r}}function Zu(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let r=i.get(s);return r||(r={resolver:to(t,e),subPrefixes:e.filter(o=>!o.toLowerCase().includes("hover"))},i.set(s,r)),r}const gb=n=>ft(n)&&Object.getOwnPropertyNames(n).some(t=>pe(n[t]));function pb(n,t){const{isScriptable:e,isIndexable:i}=Jc(n);for(const s of t){const r=e(s),a=i(s),o=(a||r)&&n[s];if(r&&(pe(o)||gb(o))||a&&wt(o))return!0}return!1}var yb="4.5.1";const bb=["top","bottom","left","right","chartArea"];function Qu(n,t){return n==="top"||n==="bottom"||bb.indexOf(n)===-1&&t==="x"}function Ju(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function td(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),St(e&&e.onComplete,[n],t)}function _b(n){const t=n.chart,e=t.options.animation;St(e&&e.onProgress,[n],t)}function ed(n){return io()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Rr={},nd=n=>{const t=ed(n);return Object.values(Rr).filter(e=>e.canvas===t).pop()};function xb(n,t,e){const i=Object.keys(n);for(const s of i){const r=+s;if(r>=t){const a=n[s];delete n[s],(e>0||r>t)&&(n[r+e]=a)}}}function wb(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}let ye=(In=class{static register(...t){Ye.add(...t),id()}static unregister(...t){Ye.remove(...t),id()}constructor(t,e){const i=this.config=new mb(e),s=ed(t),r=nd(s);if(r)throw new Error("Canvas is already in use. Chart with ID '"+r.id+"' must be destroyed before the canvas with ID '"+r.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||zy(s)),this.platform.updateConfig(i);const o=this.platform.acquireContext(s,a.aspectRatio),l=o&&o.canvas,c=l&&l.height,u=l&&l.width;if(this.id=kg(),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 ib,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Wg(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Rr[this.id]=this,!o||!l){console.error("Failed to create chart: can't acquire context from the given item");return}nn.listen(this,"complete",td),nn.listen(this,"progress",_b),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:r}=this;return st(t)?e&&r?r:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Ye}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ou(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Kc(this.canvas,this.ctx),this}stop(){return nn.stop(this),this}resize(t,e){nn.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,r=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,r),o=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ou(this,o,!0)&&(this.notifyPlugins("resize",{size:a}),St(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};kt(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,o)=>(a[o]=!1,a),{});let r=[];e&&(r=r.concat(Object.keys(e).map(a=>{const o=e[a],l=bo(a,o),c=l==="r",u=l==="x";return{options:o,dposition:c?"chartArea":u?"bottom":"left",dtype:c?"radialLinear":u?"category":"linear"}}))),kt(r,a=>{const o=a.options,l=o.id,c=bo(l,o),u=rt(o.type,a.dtype);(o.position===void 0||Qu(o.position,c)!==Qu(a.dposition))&&(o.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===u)h=i[l];else{const f=Ye.getScale(u);h=new f({id:l,type:u,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(o,t)}),kt(s,(a,o)=>{a||delete i[o]}),kt(i,a=>{ae.configure(this,a,a.options),ae.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,r)=>s.index-r.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Ju("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(r=>r===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const r=e[i];let a=this.getDatasetMeta(i);const o=r.type||this.config.type;if(a.type&&a.type!==o&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=o,a.indexAxis=r.indexAxis||yo(o,this.options),a.order=r.order||0,a.index=i,a.label=""+r.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=Ye.getController(o),{datasetElementType:c,dataElementType:u}=Pt.datasets[o];Object.assign(l,{dataElementType:Ye.getElement(u),datasetElementType:c&&Ye.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){kt(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const r=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,u=this.data.datasets.length;c<u;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&r.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||kt(r,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ju("z","_idx"));const{_active:o,_lastEvent:l}=this;l?this._eventHandler(l,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){kt(this.scales,t=>{ae.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Ic(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:r}of e){const a=i==="_removeElements"?-r:r;xb(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=r=>new Set(t.filter(a=>a[0]===r).map((a,o)=>o+","+a.splice(1).join(","))),s=i(0);for(let r=1;r<e;r++)if(!Ic(s,i(r)))return;return Array.from(s).map(r=>r.split(",")).map(r=>({method:r[1],start:+r[2],count:+r[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ae.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],kt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,r)=>{s._idx=r}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,pe(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(nn.has(this)?this.attached&&!nn.running(this)&&nn.start(this):(this.draw(),td({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,i=[];let s,r;for(s=0,r=e.length;s<r;++s){const a=e[s];(!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 e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=yu(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&as(e,s),t.controller.draw(),s&&os(e),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return en(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const r=go.modes[e];return typeof r=="function"?r(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(r=>r&&r._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Mn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",r=this.getDatasetMeta(t),a=r.controller._resolveAnimations(void 0,s);ge(e)?(r.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(r,{visible:i}),this.update(o=>o.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),nn.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Kc(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Rr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,i=(r,a)=>{e.addEventListener(this,r,a),t[r]=a},s=(r,a,o)=>{r.offsetX=a,r.offsetY=o,this._eventHandler(r)};kt(this.options.events,r=>i(r,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},r=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const o=()=>{s("attach",o),this.attached=!0,this.resize(),i("resize",r),i("detach",a)};a=()=>{this.attached=!1,s("resize",r),this._stop(),this._resize(0,0),i("attach",o)},e.isAttached(this.canvas)?o():a()}unbindEvents(){kt(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},kt(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let r,a,o,l;for(e==="dataset"&&(r=this.getDatasetMeta(t[0].datasetIndex),r.controller["_"+s+"DatasetHoverStyle"]()),o=0,l=t.length;o<l;++o){a=t[o];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=t.map(({datasetIndex:r,index:a})=>{const o=this.getDatasetMeta(r);if(!o)throw new Error("No dataset found at index "+r);return{datasetIndex:r,element:o.data[a],index:a}});!dr(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,r=(l,c)=>l.filter(u=>!c.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),a=r(e,t),o=i?t:r(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),o.length&&s.mode&&this.updateHoverStyle(o,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const r=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(r||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:r}=this,a=e,o=this._getActiveElements(t,s,i,a),l=Pg(t),c=wb(t,this._lastEvent,i,l);i&&(this._lastEvent=null,St(r.onHover,[t,o,this],this),l&&St(r.onClick,[t,o,this],this));const u=!dr(o,s);return(u||e)&&(this._active=o,this._updateHoverStyles(o,s,e)),this._lastEvent=c,u}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const r=this.options.hover;return this.getElementsAtEventForMode(t,r.mode,r,s)}},A(In,"defaults",Pt),A(In,"instances",Rr),A(In,"overrides",Wn),A(In,"registry",Ye),A(In,"version",yb),A(In,"getChart",nd),In);function id(){return kt(ye.instances,n=>n._plugins.invalidate())}function vb(n,t,e){const{startAngle:i,x:s,y:r,outerRadius:a,innerRadius:o,options:l}=t,{borderWidth:c,borderJoinStyle:u}=l,h=Math.min(c/a,se(i-e));if(n.beginPath(),n.arc(s,r,a-c/2,i+h/2,e-h/2),o>0){const f=Math.min(c/o,se(i-e));n.arc(s,r,o+c/2,e-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*se(i-e));if(u==="round")n.arc(s,r,f,e-ut/2,i+ut/2,!0);else if(u==="bevel"){const m=2*f*f,p=-m*Math.cos(e+ut/2)+s,_=-m*Math.sin(e+ut/2)+r,x=m*Math.cos(i+ut/2)+s,v=m*Math.sin(i+ut/2)+r;n.lineTo(p,_),n.lineTo(x,v)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function Mb(n,t,e){const{startAngle:i,pixelMargin:s,x:r,y:a,outerRadius:o,innerRadius:l}=t;let c=s/o;n.beginPath(),n.arc(r,a,o,i-c,e+c),l>s?(c=s/l,n.arc(r,a,l,e+c,i-c,!0)):n.arc(r,a,s,e+Ot,i-Ot),n.closePath(),n.clip()}function Sb(n){return Ja(n,["outerStart","outerEnd","innerStart","innerEnd"])}function kb(n,t,e,i){const s=Sb(n.options.borderRadius),r=(e-t)/2,a=Math.min(r,i*t/2),o=l=>{const c=(e-Math.min(r,l))*i/2;return Kt(l,0,Math.min(r,c))};return{outerStart:o(s.outerStart),outerEnd:o(s.outerEnd),innerStart:Kt(s.innerStart,0,a),innerEnd:Kt(s.innerEnd,0,a)}}function wi(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function Ir(n,t,e,i,s,r){const{x:a,y:o,startAngle:l,pixelMargin:c,innerRadius:u}=t,h=Math.max(t.outerRadius+i+e-c,0),f=u>0?u+i+e+c:0;let m=0;const p=s-l;if(i){const $=u>0?u-i:0,Q=h>0?h-i:0,Y=($+Q)/2,lt=Y!==0?p*Y/(Y+i):p;m=(p-lt)/2}const _=Math.max(.001,p*h-e/ut)/h,x=(p-_)/2,v=l+x+m,k=s-x-m,{outerStart:E,outerEnd:P,innerStart:O,innerEnd:D}=kb(t,f,h,k-v),S=h-E,g=h-P,y=v+E/S,M=k-P/g,C=f+O,R=f+D,I=v+O/C,F=k-D/R;if(n.beginPath(),r){const $=(y+M)/2;if(n.arc(a,o,h,y,$),n.arc(a,o,h,$,M),P>0){const U=wi(g,M,a,o);n.arc(U.x,U.y,P,M,k+Ot)}const Q=wi(R,k,a,o);if(n.lineTo(Q.x,Q.y),D>0){const U=wi(R,F,a,o);n.arc(U.x,U.y,D,k+Ot,F+Math.PI)}const Y=(k-D/f+(v+O/f))/2;if(n.arc(a,o,f,k-D/f,Y,!0),n.arc(a,o,f,Y,v+O/f,!0),O>0){const U=wi(C,I,a,o);n.arc(U.x,U.y,O,I+Math.PI,v-Ot)}const lt=wi(S,v,a,o);if(n.lineTo(lt.x,lt.y),E>0){const U=wi(S,y,a,o);n.arc(U.x,U.y,E,v-Ot,y)}}else{n.moveTo(a,o);const $=Math.cos(y)*h+a,Q=Math.sin(y)*h+o;n.lineTo($,Q);const Y=Math.cos(M)*h+a,lt=Math.sin(M)*h+o;n.lineTo(Y,lt)}n.closePath()}function Tb(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o}=t;let l=t.endAngle;if(r){Ir(n,t,e,i,l,s);for(let c=0;c<r;++c)n.fill();isNaN(o)||(l=a+(o%Ct||Ct))}return Ir(n,t,e,i,l,s),n.fill(),l}function Db(n,t,e,i,s){const{fullCircles:r,startAngle:a,circumference:o,options:l}=t,{borderWidth:c,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(h||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=u||"round"):(n.lineWidth=c,n.lineJoin=u||"bevel");let _=t.endAngle;if(r){Ir(n,t,e,i,_,s);for(let x=0;x<r;++x)n.stroke();isNaN(o)||(_=a+(o%Ct||Ct))}p&&Mb(n,t,_),l.selfJoin&&_-a>=ut&&m===0&&u!=="miter"&&vb(n,t,_),r||(Ir(n,t,e,i,_,s),n.stroke())}class xs extends Zt{constructor(e){super();A(this,"circumference");A(this,"endAngle");A(this,"fullCircles");A(this,"innerRadius");A(this,"outerRadius");A(this,"pixelMargin");A(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.getProps(["x","y"],s),{angle:a,distance:o}=pr(r,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),m=(this.options.spacing+this.options.borderWidth)/2,p=rt(f,c-l),_=ns(a,l,c)&&l!==c,x=p>=Ct||_,v=Je(o,u+m,h+m);return x&&v}getCenterPoint(e){const{x:i,y:s,startAngle:r,endAngle:a,innerRadius:o,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:u}=this.options,h=(r+a)/2,f=(o+l+u+c)/2;return{x:i+Math.cos(h)*f,y:s+Math.sin(h)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,r=(i.offset||0)/4,a=(i.spacing||0)/2,o=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>Ct?Math.floor(s/Ct):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*r,Math.sin(l)*r);const c=1-Math.sin(Math.min(ut,s||0)),u=r*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Tb(e,this,u,a,o),Db(e,this,u,a,o),e.restore()}}A(xs,"id","arc"),A(xs,"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}),A(xs,"defaultRoutes",{backgroundColor:"backgroundColor"}),A(xs,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function sd(n,t,e=t){n.lineCap=rt(e.borderCapStyle,t.borderCapStyle),n.setLineDash(rt(e.borderDash,t.borderDash)),n.lineDashOffset=rt(e.borderDashOffset,t.borderDashOffset),n.lineJoin=rt(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=rt(e.borderWidth,t.borderWidth),n.strokeStyle=rt(e.borderColor,t.borderColor)}function Cb(n,t,e){n.lineTo(e.x,e.y)}function Eb(n){return n.stepped?Jg:n.tension||n.cubicInterpolationMode==="monotone"?tp:Cb}function rd(n,t,e={}){const i=n.length,{start:s=0,end:r=i-1}=e,{start:a,end:o}=t,l=Math.max(s,a),c=Math.min(r,o),u=s<a&&r<a||s>o&&r>o;return{count:i,start:l,loop:t.loop,ilen:c<l&&!u?i+c-l:c-l}}function Ob(n,t,e,i){const{points:s,options:r}=t,{count:a,start:o,loop:l,ilen:c}=rd(s,e,i),u=Eb(r);let{move:h=!0,reverse:f}=i||{},m,p,_;for(m=0;m<=c;++m)p=s[(o+(f?c-m:m))%a],!p.skip&&(h?(n.moveTo(p.x,p.y),h=!1):u(n,_,p,f,r.stepped),_=p);return l&&(p=s[(o+(f?c:0))%a],u(n,_,p,f,r.stepped)),!!l}function Pb(n,t,e,i){const s=t.points,{count:r,start:a,ilen:o}=rd(s,e,i),{move:l=!0,reverse:c}=i||{};let u=0,h=0,f,m,p,_,x,v;const k=P=>(a+(c?o-P:P))%r,E=()=>{_!==x&&(n.lineTo(u,x),n.lineTo(u,_),n.lineTo(u,v))};for(l&&(m=s[k(0)],n.moveTo(m.x,m.y)),f=0;f<=o;++f){if(m=s[k(f)],m.skip)continue;const P=m.x,O=m.y,D=P|0;D===p?(O<_?_=O:O>x&&(x=O),u=(h*u+P)/++h):(E(),n.lineTo(P,O),p=D,h=0,_=x=O),v=O}E()}function _o(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Pb:Ob}function Ab(n){return n.stepped?Ap:n.tension||n.cubicInterpolationMode==="monotone"?Rp:jn}function Rb(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),sd(n,t.options),n.stroke(s)}function Ib(n,t,e,i){const{segments:s,options:r}=t,a=_o(t);for(const o of s)sd(n,r,o.style),n.beginPath(),a(n,t,o,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Lb=typeof Path2D=="function";function Nb(n,t,e,i){Lb&&!t.options.segment?Rb(n,t,e,i):Ib(n,t,e,i)}class Tn extends Zt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Sp(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=zp(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],r=this.points,a=mu(this,{property:e,start:s,end:s});if(!a.length)return;const o=[],l=Ab(i);let c,u;for(c=0,u=a.length;c<u;++c){const{start:h,end:f}=a[c],m=r[h],p=r[f];if(m===p){o.push(m);continue}const _=Math.abs((s-m[e])/(p[e]-m[e])),x=l(m,p,_,i.stepped);x[e]=t[e],o.push(x)}return o.length===1?o[0]:o}pathSegment(t,e,i){return _o(this)(t,this,e,i)}path(t,e,i){const s=this.segments,r=_o(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const o of s)a&=r(t,this,o,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const r=this.options||{};(this.points||[]).length&&r.borderWidth&&(t.save(),Nb(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}A(Tn,"id","line"),A(Tn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),A(Tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),A(Tn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ad(n,t,e,i){const s=n.options,{[e]:r}=n.getProps([e],i);return Math.abs(t-r)<s.radius+s.hitRadius}class Lr extends Zt{constructor(e){super();A(this,"parsed");A(this,"skip");A(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,i,s){const r=this.options,{x:a,y:o}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-o,2)<Math.pow(r.hitRadius+r.radius,2)}inXRange(e,i){return ad(this,e,"x",i)}inYRange(e,i){return ad(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!en(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,Qa(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}A(Lr,"id","point"),A(Lr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),A(Lr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function od(n,t){const{x:e,y:i,base:s,width:r,height:a}=n.getProps(["x","y","base","width","height"],t);let o,l,c,u,h;return n.horizontal?(h=a/2,o=Math.min(e,s),l=Math.max(e,s),c=i-h,u=i+h):(h=r/2,o=e-h,l=e+h,c=Math.min(i,s),u=Math.max(i,s)),{left:o,top:c,right:l,bottom:u}}function Dn(n,t,e,i){return n?0:Kt(t,e,i)}function Fb(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,r=Qc(i);return{t:Dn(s.top,r.top,0,e),r:Dn(s.right,r.right,0,t),b:Dn(s.bottom,r.bottom,0,e),l:Dn(s.left,r.left,0,t)}}function Bb(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,r=vn(s),a=Math.min(t,e),o=n.borderSkipped,l=i||ft(s);return{topLeft:Dn(!l||o.top||o.left,r.topLeft,0,a),topRight:Dn(!l||o.top||o.right,r.topRight,0,a),bottomLeft:Dn(!l||o.bottom||o.left,r.bottomLeft,0,a),bottomRight:Dn(!l||o.bottom||o.right,r.bottomRight,0,a)}}function zb(n){const t=od(n),e=t.right-t.left,i=t.bottom-t.top,s=Fb(n,e/2,i/2),r=Bb(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:r},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,r.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,r.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,r.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,r.bottomRight-Math.max(s.b,s.r))}}}}function xo(n,t,e,i){const s=t===null,r=e===null,o=n&&!(s&&r)&&od(n,i);return o&&(s||Je(t,o.left,o.right))&&(r||Je(e,o.top,o.bottom))}function Hb(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Wb(n,t){n.rect(t.x,t.y,t.w,t.h)}function wo(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,r=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+r,h:n.h+a,radius:n.radius}}class Nr extends Zt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:i,backgroundColor:s}}=this,{inner:r,outer:a}=zb(this),o=Hb(a.radius)?yi:Wb;t.save(),(a.w!==r.w||a.h!==r.h)&&(t.beginPath(),o(t,wo(a,e,r)),t.clip(),o(t,wo(r,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),o(t,wo(r,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return xo(this,t,e,i)}inXRange(t,e){return xo(this,t,null,e)}inYRange(t,e){return xo(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:r}=this.getProps(["x","y","base","horizontal"],t);return{x:r?(e+s)/2:e,y:r?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}A(Nr,"id","bar"),A(Nr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),A(Nr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Vb=Object.freeze({__proto__:null,ArcElement:xs,BarElement:Nr,LineElement:Tn,PointElement:Lr});const vo=["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)"],ld=vo.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function cd(n){return vo[n%vo.length]}function ud(n){return ld[n%ld.length]}function Yb(n,t){return n.borderColor=cd(t),n.backgroundColor=ud(t),++t}function $b(n,t){return n.backgroundColor=n.data.map(()=>cd(t++)),t}function jb(n,t){return n.backgroundColor=n.data.map(()=>ud(t++)),t}function Ub(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof sn?t=$b(e,t):s instanceof hs?t=jb(e,t):s&&(t=Yb(e,t))}}function dd(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function qb(n){return n&&(n.borderColor||n.backgroundColor)}function Xb(){return Pt.borderColor!=="rgba(0,0,0,0.1)"||Pt.backgroundColor!=="rgba(0,0,0,0.1)"}var Gb={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:r}=s,a=dd(i)||qb(s)||r&&dd(r)||Xb();if(!e.forceOverride&&a)return;const o=Ub(n);i.forEach(o)}};function Kb(n,t,e,i,s){const r=s.samples||i;if(r>=e)return n.slice(t,t+e);const a=[],o=(e-2)/(r-2);let l=0;const c=t+e-1;let u=t,h,f,m,p,_;for(a[l++]=n[u],h=0;h<r-2;h++){let x=0,v=0,k;const E=Math.floor((h+1)*o)+1+t,P=Math.min(Math.floor((h+2)*o)+1,e)+t,O=P-E;for(k=E;k<P;k++)x+=n[k].x,v+=n[k].y;x/=O,v/=O;const D=Math.floor(h*o)+1+t,S=Math.min(Math.floor((h+1)*o)+1,e)+t,{x:g,y}=n[u];for(m=p=-1,k=D;k<S;k++)p=.5*Math.abs((g-x)*(n[k].y-y)-(g-n[k].x)*(v-y)),p>m&&(m=p,f=n[k],_=k);a[l++]=f,u=_}return a[l++]=n[c],a}function Zb(n,t,e,i){let s=0,r=0,a,o,l,c,u,h,f,m,p,_;const x=[],v=t+e-1,k=n[t].x,P=n[v].x-k;for(a=t;a<t+e;++a){o=n[a],l=(o.x-k)/P*i,c=o.y;const O=l|0;if(O===u)c<p?(p=c,h=a):c>_&&(_=c,f=a),s=(r*s+o.x)/++r;else{const D=a-1;if(!st(h)&&!st(f)){const S=Math.min(h,f),g=Math.max(h,f);S!==m&&S!==D&&x.push({...n[S],x:s}),g!==m&&g!==D&&x.push({...n[g],x:s})}a>0&&D!==m&&x.push(n[D]),x.push(o),u=O,r=0,p=_=c,h=f=m=a}}return x}function hd(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function fd(n){n.data.datasets.forEach(t=>{hd(t)})}function Qb(n,t){const e=t.length;let i=0,s;const{iScale:r}=n,{min:a,max:o,minDefined:l,maxDefined:c}=r.getUserBounds();return l&&(i=Kt(tn(t,r.axis,a).lo,0,e-1)),c?s=Kt(tn(t,r.axis,o).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var Jb={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){fd(n);return}const i=n.width;n.data.datasets.forEach((s,r)=>{const{_data:a,indexAxis:o}=s,l=n.getDatasetMeta(r),c=a||s.data;if(ls([o,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const u=n.scales[l.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=Qb(l,c);const m=e.threshold||4*i;if(f<=m){hd(s);return}st(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(_){this._data=_}}));let p;switch(e.algorithm){case"lttb":p=Kb(c,h,f,i,e);break;case"min-max":p=Zb(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=p})},destroy(n){fd(n)}};function t0(n,t,e){const i=n.segments,s=n.points,r=t.points,a=[];for(const o of i){let{start:l,end:c}=o;c=Fr(l,c,s);const u=Mo(e,s[l],s[c],o.loop);if(!t.segments){a.push({source:o,target:u,start:s[l],end:s[c]});continue}const h=mu(t,u);for(const f of h){const m=Mo(e,r[f.start],r[f.end],f.loop),p=fu(o,s,m);for(const _ of p)a.push({source:_,target:f,start:{[e]:md(u,m,"start",Math.max)},end:{[e]:md(u,m,"end",Math.min)}})}}return a}function Mo(n,t,e,i){if(i)return;let s=t[n],r=e[n];return n==="angle"&&(s=se(s),r=se(r)),{property:n,start:s,end:r}}function e0(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,r=[];return t.segments.forEach(({start:a,end:o})=>{o=Fr(a,o,s);const l=s[a],c=s[o];i!==null?(r.push({x:l.x,y:i}),r.push({x:c.x,y:i})):e!==null&&(r.push({x:e,y:l.y}),r.push({x:e,y:c.y}))}),r}function Fr(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function md(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function gd(n,t){let e=[],i=!1;return wt(n)?(i=!0,e=n):e=e0(n,t),e.length?new Tn({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function pd(n){return n&&n.fill!==!1}function n0(n,t,e){let s=n[t].fill;const r=[t];let a;if(!e)return s;for(;s!==!1&&r.indexOf(s)===-1;){if(!At(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;r.push(s),s=a.fill}return!1}function i0(n,t,e){const i=o0(n);if(ft(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return At(s)&&Math.floor(s)===s?s0(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function s0(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function r0(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:ft(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function a0(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:ft(n)?i=n.value:i=t.getBaseValue(),i}function o0(n){const t=n.options,e=t.fill;let i=rt(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function l0(n){const{scale:t,index:e,line:i}=n,s=[],r=i.segments,a=i.points,o=c0(t,e);o.push(gd({x:null,y:t.bottom},i));for(let l=0;l<r.length;l++){const c=r[l];for(let u=c.start;u<=c.end;u++)u0(s,a[u],o)}return new Tn({points:s,options:{}})}function c0(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const r=i[s];if(r.index===t)break;r.hidden||e.unshift(r.dataset)}return e}function u0(n,t,e){const i=[];for(let s=0;s<e.length;s++){const r=e[s],{first:a,last:o,point:l}=d0(r,t,"x");if(!(!l||a&&o)){if(a)i.unshift(l);else if(n.push(l),!o)break}}n.push(...i)}function d0(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],r=n.segments,a=n.points;let o=!1,l=!1;for(let c=0;c<r.length;c++){const u=r[c],h=a[u.start][e],f=a[u.end][e];if(Je(s,h,f)){o=s===h,l=s===f;break}}return{first:o,last:l,point:i}}class yd{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:r,radius:a}=this;return e=e||{start:0,end:Ct},t.arc(s,r,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,r=t.angle;return{x:e+Math.cos(r)*s,y:i+Math.sin(r)*s,angle:r}}}function h0(n){const{chart:t,fill:e,line:i}=n;if(At(e))return f0(t,e);if(e==="stack")return l0(n);if(e==="shape")return!0;const s=m0(n);return s instanceof yd?s:gd(s,i)}function f0(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function m0(n){return(n.scale||{}).getPointPositionForValue?p0(n):g0(n)}function g0(n){const{scale:t={},fill:e}=n,i=r0(e,t);if(At(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function p0(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,r=i.reverse?t.max:t.min,a=a0(e,t,r),o=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,r);return new yd({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)o.push(t.getPointPositionForValue(l,a));return o}function So(n,t,e){const i=h0(t),{chart:s,index:r,line:a,scale:o,axis:l}=t,c=a.options,u=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=u||{},p=s.getDatasetMeta(r),_=yu(s,p);i&&a.points.length&&(as(n,e),y0(n,{line:a,target:i,above:f,below:m,area:e,scale:o,axis:l,clip:_}),os(n))}function y0(n,t){const{line:e,target:i,above:s,below:r,area:a,scale:o,clip:l}=t,c=e._loop?"angle":t.axis;n.save();let u=r;r!==s&&(c==="x"?(bd(n,i,a.top),ko(n,{line:e,target:i,color:s,scale:o,property:c,clip:l}),n.restore(),n.save(),bd(n,i,a.bottom)):c==="y"&&(_d(n,i,a.left),ko(n,{line:e,target:i,color:r,scale:o,property:c,clip:l}),n.restore(),n.save(),_d(n,i,a.right),u=s)),ko(n,{line:e,target:i,color:u,scale:o,property:c,clip:l}),n.restore()}function bd(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Fr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(u.x,e),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(h.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function _d(n,t,e){const{segments:i,points:s}=t;let r=!0,a=!1;n.beginPath();for(const o of i){const{start:l,end:c}=o,u=s[l],h=s[Fr(l,c,s)];r?(n.moveTo(u.x,u.y),r=!1):(n.lineTo(e,u.y),n.lineTo(u.x,u.y)),a=!!t.pathSegment(n,o,{move:a}),a?n.closePath():n.lineTo(e,h.y)}n.lineTo(e,t.first().y),n.closePath(),n.clip()}function ko(n,t){const{line:e,target:i,property:s,color:r,scale:a,clip:o}=t,l=t0(e,i,s);for(const{source:c,target:u,start:h,end:f}of l){const{style:{backgroundColor:m=r}={}}=c,p=i!==!0;n.save(),n.fillStyle=m,b0(n,a,o,p&&Mo(s,h,f)),n.beginPath();const _=!!e.pathSegment(n,c);let x;if(p){_?n.closePath():xd(n,i,f,s);const v=!!i.pathSegment(n,u,{move:_,reverse:!0});x=_&&v,x||xd(n,i,h,s)}n.closePath(),n.fill(x?"evenodd":"nonzero"),n.restore()}}function b0(n,t,e,i){const s=t.chart.chartArea,{property:r,start:a,end:o}=i||{};if(r==="x"||r==="y"){let l,c,u,h;r==="x"?(l=a,c=s.top,u=o,h=s.bottom):(l=s.left,c=a,u=s.right,h=o),n.beginPath(),e&&(l=Math.max(l,e.left),u=Math.min(u,e.right),c=Math.max(c,e.top),h=Math.min(h,e.bottom)),n.rect(l,c,u-l,h-c),n.clip()}}function xd(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var _0={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let r,a,o,l;for(a=0;a<i;++a)r=n.getDatasetMeta(a),o=r.dataset,l=null,o&&o.options&&o instanceof Tn&&(l={visible:n.isDatasetVisible(a),index:a,fill:i0(o,a,i),chart:n,axis:r.controller.options.indexAxis,scale:r.vScale,line:o}),r.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=n0(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),r=n.chartArea;for(let a=s.length-1;a>=0;--a){const o=s[a].$filler;o&&(o.line.updateControlPoints(r,o.axis),i&&o.fill&&So(n.ctx,o,r))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const r=i[s].$filler;pd(r)&&So(n.ctx,r,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!pd(i)||e.drawTime!=="beforeDatasetDraw"||So(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const wd=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},x0=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class vd extends Zt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=St(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=Rt(i.font),r=s.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:l}=wd(i,r);let c,u;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,u=this._fitRows(a,r,o,l)+10):(u=this.maxHeight,c=this._fitCols(a,s,o,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:r,maxWidth:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],u=s+o;let h=t;r.textAlign="left",r.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,_)=>{const x=i+e/2+r.measureText(p.text).width;(_===0||c[c.length-1]+x+2*o>a)&&(h+=u,c[c.length-(_>0?0:1)]=0,m+=u,f++),l[_]={left:0,top:m,row:f,width:x,height:s},c[c.length-1]+=x+o}),h}_fitCols(t,e,i,s){const{ctx:r,maxHeight:a,options:{labels:{padding:o}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],u=a-t;let h=o,f=0,m=0,p=0,_=0;return this.legendItems.forEach((x,v)=>{const{itemWidth:k,itemHeight:E}=w0(i,e,r,x,s);v>0&&m+E+2*o>u&&(h+=f+o,c.push({width:f,height:m}),p+=f+o,_++,f=m=0),l[v]={left:p,top:m,col:_,width:k,height:E},f=Math.max(f,k),m+=E+o}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:r}}=this,a=xi(r,this.left,this.width);if(this.isHorizontal()){let o=0,l=re(i,this.left+s,this.right-this.lineWidths[o]);for(const c of e)o!==c.row&&(o=c.row,l=re(i,this.left+s,this.right-this.lineWidths[o])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let o=0,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const c of e)c.col!==o&&(o=c.col,l=re(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;as(t,this),this._draw(),os(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:r,labels:a}=t,o=Pt.color,l=xi(t.rtl,this.left,this.width),c=Rt(a.font),{padding:u}=a,h=c.size,f=h/2;let m;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:p,boxHeight:_,itemHeight:x}=wd(a,h),v=function(D,S,g){if(isNaN(p)||p<=0||isNaN(_)||_<0)return;s.save();const y=rt(g.lineWidth,1);if(s.fillStyle=rt(g.fillStyle,o),s.lineCap=rt(g.lineCap,"butt"),s.lineDashOffset=rt(g.lineDashOffset,0),s.lineJoin=rt(g.lineJoin,"miter"),s.lineWidth=y,s.strokeStyle=rt(g.strokeStyle,o),s.setLineDash(rt(g.lineDash,[])),a.usePointStyle){const M={radius:_*Math.SQRT2/2,pointStyle:g.pointStyle,rotation:g.rotation,borderWidth:y},C=l.xPlus(D,p/2),R=S+f;Zc(s,M,C,R,a.pointStyleWidth&&p)}else{const M=S+Math.max((h-_)/2,0),C=l.leftForLtr(D,p),R=vn(g.borderRadius);s.beginPath(),Object.values(R).some(I=>I!==0)?yi(s,{x:C,y:M,w:p,h:_,radius:R}):s.rect(C,M,p,_),s.fill(),y!==0&&s.stroke()}s.restore()},k=function(D,S,g){Yn(s,g.text,D,S+x/2,c,{strikethrough:g.hidden,textAlign:l.textAlign(g.textAlign)})},E=this.isHorizontal(),P=this._computeTitleHeight();E?m={x:re(r,this.left+u,this.right-i[0]),y:this.top+u+P,line:0}:m={x:this.left+u,y:re(r,this.top+P+u,this.bottom-e[0].height),line:0},cu(this.ctx,t.textDirection);const O=x+u;this.legendItems.forEach((D,S)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;const g=s.measureText(D.text).width,y=l.textAlign(D.textAlign||(D.textAlign=a.textAlign)),M=p+f+g;let C=m.x,R=m.y;l.setWidth(this.width),E?S>0&&C+M+u>this.right&&(R=m.y+=O,m.line++,C=m.x=re(r,this.left+u,this.right-i[m.line])):S>0&&R+O>this.bottom&&(C=m.x=C+e[m.line].width+u,m.line++,R=m.y=re(r,this.top+P+u,this.bottom-e[m.line].height));const I=l.x(C);if(v(I,R,D),C=Vg(y,C+p+f,E?C+M:this.right,t.rtl),k(l.x(C),R,D),E)m.x+=M+u;else if(typeof D.text!="string"){const F=c.lineHeight;m.y+=Md(D,F)+u}else m.y+=O}),uu(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=Rt(e.font),s=$t(e.padding);if(!e.display)return;const r=xi(t.rtl,this.left,this.width),a=this.ctx,o=e.position,l=i.size/2,c=s.top+l;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+c,h=re(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((_,x)=>Math.max(_,x.height),0);u=c+re(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=re(o,h,h+f);a.textAlign=r.textAlign(qa(o)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Yn(a,e.text,m,u,i)}_computeTitleHeight(){const t=this.options.title,e=Rt(t.font),i=$t(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,r;if(Je(t,this.left,this.right)&&Je(e,this.top,this.bottom)){for(r=this.legendHitBoxes,i=0;i<r.length;++i)if(s=r[i],Je(t,s.left,s.left+s.width)&&Je(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!S0(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,r=x0(s,i);s&&!r&&St(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!r&&St(e.onHover,[t,i,this],this)}else i&&St(e.onClick,[t,i,this],this)}}function w0(n,t,e,i,s){const r=v0(i,n,t,e),a=M0(s,i,t.lineHeight);return{itemWidth:r,itemHeight:a}}function v0(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((r,a)=>r.length>a.length?r:a)),t+e.size/2+i.measureText(s).width}function M0(n,t,e){let i=n;return typeof t.text!="string"&&(i=Md(t,e)),i}function Md(n,t){const e=n.text?n.text.length:0;return t*e}function S0(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var k0={id:"legend",_element:vd,start(n,t,e){const i=n.legend=new vd({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i)},stop(n){ae.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;ae.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:r,useBorderRadius:a,borderRadius:o}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),u=$t(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:r,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(o||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class To extends Zt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=wt(i.text)?i.text.length:1;this._padding=$t(i.padding);const r=s*Rt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=r:this.width=r}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:s,right:r,options:a}=this,o=a.align;let l=0,c,u,h;return this.isHorizontal()?(u=re(o,i,r),h=e+t,c=r-i):(a.position==="left"?(u=i+t,h=re(o,s,e),l=ut*-.5):(u=r-t,h=re(o,e,s),l=ut*.5),c=s-e),{titleX:u,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=Rt(e.font),r=i.lineHeight/2+this._padding.top,{titleX:a,titleY:o,maxWidth:l,rotation:c}=this._drawArgs(r);Yn(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:qa(e.align),textBaseline:"middle",translation:[a,o]})}}function T0(n,t){const e=new To({ctx:n.ctx,options:t,chart:n});ae.configure(n,e,t),ae.addBox(n,e),n.titleBlock=e}var D0={id:"title",_element:To,start(n,t,e){T0(n,e)},stop(n){const t=n.titleBlock;ae.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;ae.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Br=new WeakMap;var C0={id:"subtitle",start(n,t,e){const i=new To({ctx:n.ctx,options:e,chart:n});ae.configure(n,i,e),ae.addBox(n,i),Br.set(n,i)},stop(n){ae.removeBox(n,Br.get(n)),Br.delete(n)},beforeUpdate(n,t,e){const i=Br.get(n);ae.configure(n,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ws={average(n){if(!n.length)return!1;let t,e,i=new Set,s=0,r=0;for(t=0,e=n.length;t<e;++t){const o=n[t].element;if(o&&o.hasValue()){const l=o.tooltipPosition();i.add(l.x),s+=l.y,++r}}return r===0||i.size===0?!1:{x:[...i].reduce((o,l)=>o+l)/i.size,y:s/r}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,r,a,o;for(r=0,a=n.length;r<a;++r){const l=n[r].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),u=pi(t,c);u<s&&(s=u,o=l)}}if(o){const l=o.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function $e(n,t){return t&&(wt(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function rn(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
|
17
17
|
`)>-1?n.split(`
|
|
18
|
-
`):n}function C0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Sd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),h=r.length,f=s.length,m=i.length,p=$t(t.padding);let b=p.height,x=0,v=i.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,h&&(b+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const P=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;b+=m*P+(v-m)*l.lineHeight+(v-1)*t.bodySpacing}f&&(b+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let S=0;const D=function(P){x=Math.max(x,e.measureText(P).width+S)};return e.save(),e.font=c.string,kt(n.title,D),e.font=l.string,kt(n.beforeBody.concat(n.afterBody),D),S=t.displayColors?a+2+t.boxPadding:0,kt(i,P=>{kt(P.before,D),kt(P.lines,D),kt(P.after,D)}),S=0,e.font=u.string,kt(n.footer,D),e.restore(),x+=p.width,{width:x,height:b}}function E0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function O0(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function P0(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),O0(c,n,t,e)&&(c="center"),c}function kd(n,t,e){const i=e.yAlign||t.yAlign||E0(n,e);return{xAlign:e.xAlign||t.xAlign||P0(n,t,e,i),yAlign:i}}function A0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function R0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Td(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=vn(a);let p=A0(t,o);const b=R0(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+s:o==="right"&&(p+=Math.max(h,m)+s),{x:Kt(p,0,i.width-t.width),y:Kt(b,0,i.height-t.height)}}function Br(n,t,e){const i=$t(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Dd(n){return $e([],rn(n))}function I0(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Cd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Ed={beforeTitle:Qe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Qe,beforeBody:Qe,beforeLabel:Qe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return st(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function be(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Ed[t].call(e,i):s}class Do extends Zt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new ro(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=I0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=be(i,"beforeTitle",this,t),r=be(i,"title",this,t),a=be(i,"afterTitle",this,t);let o=[];return o=$e(o,rn(s)),o=$e(o,rn(r)),o=$e(o,rn(a)),o}getBeforeBody(t,e){return Dd(be(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return kt(t,r=>{const a={before:[],lines:[],after:[]},o=Cd(i,r);$e(a.before,rn(be(o,"beforeLabel",this,r))),$e(a.lines,be(o,"label",this,r)),$e(a.after,rn(be(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Dd(be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=be(i,"beforeFooter",this,t),r=be(i,"footer",this,t),a=be(i,"afterFooter",this,t);let o=[];return o=$e(o,rn(s)),o=$e(o,rn(r)),o=$e(o,rn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(C0(this.chart,e[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))),kt(o,u=>{const h=Cd(t.callbacks,u);s.push(be(h,"labelColor",this,u)),r.push(be(h,"labelPointStyle",this,u)),a.push(be(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=ws[i.position].call(this,s,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=Sd(this,i),c=Object.assign({},o,l),u=kd(this.chart,i,c),h=Td(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={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,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=vn(o),{x:f,y:m}=t,{width:p,height:b}=e;let x,v,S,D,P,O;return r==="center"?(P=m+b/2,s==="left"?(x=f,v=x-a,D=P+a,O=P-a):(x=f+p,v=x+a,D=P-a,O=P+a),S=x):(s==="left"?v=f+Math.max(l,u)+a:s==="right"?v=f+p-Math.max(c,h)-a:v=this.caretX,r==="top"?(D=m,P=D-a,x=v-a,S=v+a):(D=m+b,P=D+a,x=v+a,S=v-a),O=D),{x1:x,x2:v,x3:S,y1:D,y2:P,y3:O}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=_i(i.rtl,this.x,this.width);for(t.x=Br(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=Rt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=Rt(r.bodyFont),h=Br(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+m;if(r.usePointStyle){const b={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Qa(t,b,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Qa(t,b,x,v)}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 b=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=vn(a.borderRadius);Object.values(v).some(S=>S!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,pi(t,{x:b,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),pi(t,{x,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(b,p,c,l),t.strokeRect(b,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Rt(i.bodyFont);let f=h.lineHeight,m=0;const p=_i(i.rtl,this.x,this.width),b=function(g){e.fillText(g,p.x(t.x+m),t.y+f/2),t.y+=f+r},x=p.textAlign(a);let v,S,D,P,O,C,k;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=Br(this,x,i),e.fillStyle=i.bodyColor,kt(this.beforeBody,b),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,P=0,C=s.length;P<C;++P){for(v=s[P],S=this.labelTextColors[P],e.fillStyle=S,kt(v.before,b),D=v.lines,o&&D.length&&(this._drawColorBox(e,t,P,p,i),f=Math.max(h.lineHeight,l)),O=0,k=D.length;O<k;++O)b(D[O]),f=h.lineHeight;kt(v.after,b)}m=0,f=h.lineHeight,kt(this.afterBody,b),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=_i(i.rtl,this.x,this.width);for(t.x=Br(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=Rt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+h,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+m,l+u),e.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+h),e.quadraticCurveTo(o,l,o+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const a=ws[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Sd(this,t),l=Object.assign({},a,this._size),c=kd(e,t,l),u=Td(t,l,c,e);(s._to!==u.x||r._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 e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=$t(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),cu(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),uu(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=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}}),r=!dr(i,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!dr(a,r)||o;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=ws[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}A(Do,"positioners",ws);var De={id:"tooltip",_element:Do,positioners:ws,afterInit(n,t,e){e&&(n.tooltip=new Do({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ed},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},L0=Object.freeze({__proto__:null,Colors:Xb,Decimation:Qb,Filler:b0,Legend:S0,SubTitle:D0,Title:T0,Tooltip:De});const N0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function F0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return N0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const z0=(n,t)=>n===null?null:Kt(Math.round(n),0,t);function Od(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Co extends qn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:F0(i,t,rt(e,t),this._addedLabels),z0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Od.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}A(Co,"id","category"),A(Co,"defaults",{ticks:{callback:Od}});function B0(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,p=u-1,{min:b,max:x}=t,v=!st(a),S=!st(o),D=!st(c),P=(x-b)/(h+1);let O=Lc((x-b)/p/m)*m,C,k,g,_;if(O<1e-14&&!v&&!S)return[{value:b},{value:x}];_=Math.ceil(x/O)-Math.floor(b/O),_>p&&(O=Lc(_*O/p/m)*m),st(l)||(C=Math.pow(10,l),O=Math.ceil(O*C)/C),s==="ticks"?(k=Math.floor(b/O)*O,g=Math.ceil(x/O)*O):(k=b,g=x),v&&S&&r&&Ig((o-a)/r,O/1e3)?(_=Math.round(Math.min((o-a)/O,u)),O=(o-a)/_,k=a,g=o):D?(k=v?a:k,g=S?o:g,_=c-1,O=(g-k)/_):(_=(g-k)/O,es(_,Math.round(_),O/1e3)?_=Math.round(_):_=Math.ceil(_));const M=Math.max(Fc(O),Fc(k));C=Math.pow(10,st(l)?M:l),k=Math.round(k*C)/C,g=Math.round(g*C)/C;let E=0;for(v&&(f&&k!==a?(e.push({value:a}),k<a&&E++,es(Math.round((k+E*O)*C)/C,a,Pd(a,P,n))&&E++):k<a&&E++);E<_;++E){const R=Math.round((k+E*O)*C)/C;if(S&&R>o)break;e.push({value:R})}return S&&f&&g!==o?e.length&&es(e[e.length-1].value,o,Pd(o,P,n))?e[e.length-1].value=o:e.push({value:o}):(!S||g===o)&&e.push({value:g}),e}function Pd(n,t,{horizontal:e,minRotation:i}){const s=Vt(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Hr extends qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=Ye(s),c=Ye(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=B0(s,r);return t.bounds==="ticks"&&Nc(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 e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ss(t,this.chart.options.locale,this.options.ticks.format)}}class Eo extends Hr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Vt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}A(Eo,"id","linear"),A(Eo,"defaults",{ticks:{callback:br.formatters.numeric}});const vs=n=>Math.floor(xn(n)),Xn=(n,t)=>Math.pow(10,vs(n)+t);function Ad(n){return n/Math.pow(10,vs(n))===1}function Rd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function H0(n,t){const e=t-n;let i=vs(e);for(;Rd(n,t,i)>10;)i++;for(;Rd(n,t,i)<10;)i--;return Math.min(i,vs(n))}function W0(n,{min:t,max:e}){t=Te(n.min,t);const i=[],s=vs(t);let r=H0(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):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,r)),f=Te(n.min,Math.round((l+u+h*Math.pow(10,r))*a)/a);for(;f<e;)i.push({value:f,major:Ad(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,a=r>=0?1:a),f=Math.round((l+u+h*Math.pow(10,r))*a)/a;const m=Te(n.max,f);return i.push({value:m,major:Ad(m),significand:h}),i}class Oo extends qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Hr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(Xn(i,-1)),a(Xn(s,1)))),i<=0&&r(Xn(s,-1)),s<=0&&a(Xn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=W0(e,this);return t.bounds==="ticks"&&Nc(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":ss(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}A(Oo,"id","logarithmic"),A(Oo,"defaults",{ticks:{callback:br.formatters.logarithmic,major:{enabled:!0}}});function Po(n){const t=n.ticks;if(t.display&&n.display){const e=$t(t.backdropPadding);return rt(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function Y0(n,t,e){return e=wt(e)?e:[e],{w:Zg(n,t.string,e),h:e.length*t.lineHeight}}function Id(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function V0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,a=n.options.pointLabels,o=a.centerPointLabels?ut/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),h=Rt(c.font),f=Y0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=se(n.getIndexAngle(l)+o),p=Math.round(gr(m)),b=Id(p,u.x,f.w,0,180),x=Id(p,u.y,f.h,90,270);$0(e,t,m,b,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=q0(n,i,s)}function $0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function j0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(gr(se(l.angle+Ot))),u=K0(l.y,o.h,c),h=X0(c),f=G0(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 U0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function q0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:Po(r)/2,additionalAngle:a?ut/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=j0(n,u,l);i.push(h),o==="auto"&&(h.visible=U0(h,c),h.visible&&(c=h))}return i}function X0(n){return n===0||n===180?"center":n<180?"left":"right"}function G0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function K0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Z0(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!st(o)){const l=vn(t.borderRadius),c=$t(t.backdropPadding);n.fillStyle=o;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=a-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),pi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}function Q0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const a=i.setContext(n.getPointLabelContext(s));Z0(e,a,r);const o=Rt(a.font),{x:l,y:c,textAlign:u}=r;Vn(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Ld(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ct);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function J0(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Ld(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function t_(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class Ms extends Hr{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=$t(Po(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=At(t)&&!isNaN(t)?t:0,this.max=At(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Po(this.options))}generateTickLabels(t){Hr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=St(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?V0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+Vt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return t_(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Ld(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&Q0(this,a),s.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=s.setContext(f),p=r.setContext(f);J0(this,m,l,a,p)}}),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(e.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Rt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=$t(c.backdropPadding);t.fillRect(-a/2-h.left,-r-u.size/2-h.top,a+h.width,u.size+h.height)}Vn(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}A(Ms,"id","radialLinear"),A(Ms,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:br.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),A(Ms,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),A(Ms,"descriptors",{angleLines:{_fallback:"grid"}});const Wr={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}},_e=Object.keys(Wr);function Nd(n,t){return n-t}function Fd(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),At(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(wn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function zd(n,t,e,i){const s=_e.length;for(let r=_e.indexOf(n);r<s-1;++r){const a=Wr[_e[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return _e[r]}return _e[s-1]}function e_(n,t,e,i,s){for(let r=_e.length-1;r>=_e.indexOf(e);r--){const a=_e[r];if(Wr[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return _e[e?_e.indexOf(e):0]}function n_(n){for(let t=_e.indexOf(n)+1,e=_e.length;t<e;++t)if(Wr[_e[t]].common)return _e[t]}function Bd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Ua(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function i_(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Hd(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:i_(n,i,s,e)}class Ss extends qn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Eu._date(t.adapters.date);s.init(e),ts(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Fd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=At(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,a=this.max,o=zg(s,r,a);return this._unit=e.unit||(i.autoSkip?zd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):e_(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:n_(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),Hd(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Kt(e,0,a),i=Kt(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||zd(r.minUnit,e,i,this._getLabelCapacity(e)),o=rt(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)Bd(u,f,p);return(f===i||s.bounds==="ticks"||m===1)&&Bd(u,f,p),Object.keys(u).sort(Nd).map(b=>+b)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return St(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Vt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Hd(this,[t],this._majorUnit),s),a=this._getLabelSize(r),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||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Fd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Hc(t.sort(Nd))}}A(Ss,"id","time"),A(Ss,"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 Yr(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tn(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tn(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class Ao extends Ss{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Yr(e,this.min),this._tableRange=Yr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Yr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Yr(this._table,i*this._tableRange+this._minPos,!0)}}A(Ao,"id","timeseries"),A(Ao,"defaults",Ss.defaults);var s_=Object.freeze({__proto__:null,CategoryScale:Co,LinearScale:Eo,LogarithmicScale:Oo,RadialLinearScale:Ms,TimeScale:Ss,TimeSeriesScale:Ao});const r_=[fy,Wb,L0,s_],Wd=6048e5,a_=864e5,ks=6e4,wi=36e5,o_=1e3,Yd=Symbol.for("constructDateFrom");function Lt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Yd in n?n[Yd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ct(n,t){return Lt(t||n,n)}function Vr(n,t,e){const i=ct(n,e==null?void 0:e.in);return isNaN(t)?Lt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Ro(n,t,e){const i=ct(n,e==null?void 0:e.in);if(isNaN(t))return Lt(n,NaN);if(!t)return i;const s=i.getDate(),r=Lt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function Io(n,t,e){return Lt(n,+ct(n)+t)}function l_(n,t,e){return Io(n,t*wi)}let c_={};function Gn(){return c_}function je(n,t){var o,l,c,u;const e=Gn(),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)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function vi(n,t){return je(n,{...t,weekStartsOn:1})}function Vd(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Lt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=vi(s),a=Lt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=vi(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function $r(n){const t=ct(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Kn(n,...t){const e=Lt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Lo(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function $d(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Lo(i),a=Lo(s),o=+r-$r(r),l=+a-$r(a);return Math.round((o-l)/a_)}function u_(n,t){const e=Vd(n,t),i=Lt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),vi(i)}function d_(n,t,e){const i=ct(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ks),i}function h_(n,t,e){return Ro(n,t*3,e)}function f_(n,t,e){return Io(n,t*1e3)}function m_(n,t,e){return Vr(n,t*7,e)}function g_(n,t,e){return Ro(n,t*12,e)}function Ts(n,t){const e=+ct(n)-+ct(t);return e<0?-1:e>0?1:e}function p_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function No(n){return!(!p_(n)&&typeof n!="number"||isNaN(+ct(n)))}function y_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function b_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function jd(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Ud(i,s),a=Math.abs($d(i,s));i.setDate(i.getDate()-r*a);const o=+(Ud(i,s)===-r),l=r*(a-o);return l===0?0:l}function Ud(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Ds(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function __(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=(+i-+s)/wi;return Ds(e==null?void 0:e.roundingMethod)(r)}function Fo(n,t){return+ct(n)-+ct(t)}function x_(n,t,e){const i=Fo(n,t)/ks;return Ds(e==null?void 0:e.roundingMethod)(i)}function qd(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Xd(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function w_(n,t){const e=ct(n,t==null?void 0:t.in);return+qd(e,t)==+Xd(e,t)}function Gd(n,t,e){const[i,s,r]=Kn(e==null?void 0:e.in,n,n,t),a=Ts(s,r),o=Math.abs(y_(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=Ts(s,r)===-a;w_(i)&&o===1&&Ts(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function v_(n,t,e){const i=Gd(n,t,e)/3;return Ds(e==null?void 0:e.roundingMethod)(i)}function M_(n,t,e){const i=Fo(n,t)/1e3;return Ds(e==null?void 0:e.roundingMethod)(i)}function S_(n,t,e){const i=jd(n,t,e)/7;return Ds(e==null?void 0:e.roundingMethod)(i)}function k_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Ts(i,s),a=Math.abs(b_(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=Ts(i,s)===-r,l=r*(a-+o);return l===0?0:l}function T_(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function D_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function C_(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Kd(n,t){const e=ct(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function E_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function O_(n,t){var o,l;const e=Gn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function P_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function A_(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function R_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const I_={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"}},L_=(n,t,e)=>{let i;const s=I_[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function zo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const N_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},F_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},B_={date:zo({formats:N_,defaultWidth:"full"}),time:zo({formats:F_,defaultWidth:"full"}),dateTime:zo({formats:z_,defaultWidth:"full"})},H_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},W_=(n,t,e,i)=>H_[n];function Cs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Y_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},V_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$_={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},j_={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"]},U_={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"}},q_={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"}},X_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Cs({values:Y_,defaultWidth:"wide"}),quarter:Cs({values:V_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Cs({values:$_,defaultWidth:"wide"}),day:Cs({values:j_,defaultWidth:"wide"}),dayPeriod:Cs({values:U_,defaultWidth:"wide",formattingValues:q_,defaultFormattingWidth:"wide"})};function Es(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?K_(o,h=>h.test(a)):G_(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function G_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function K_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Z_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const Q_=/^(\d+)(th|st|nd|rd)?/i,J_=/\d+/i,tx={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},ex={any:[/^b/i,/^(a|c)/i]},nx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ix={any:[/1/i,/2/i,/3/i,/4/i]},sx={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},rx={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]},ax={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},ox={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]},lx={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},cx={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}},ux={ordinalNumber:Z_({matchPattern:Q_,parsePattern:J_,valueCallback:n=>parseInt(n,10)}),era:Es({matchPatterns:tx,defaultMatchWidth:"wide",parsePatterns:ex,defaultParseWidth:"any"}),quarter:Es({matchPatterns:nx,defaultMatchWidth:"wide",parsePatterns:ix,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Es({matchPatterns:sx,defaultMatchWidth:"wide",parsePatterns:rx,defaultParseWidth:"any"}),day:Es({matchPatterns:ax,defaultMatchWidth:"wide",parsePatterns:ox,defaultParseWidth:"any"}),dayPeriod:Es({matchPatterns:lx,defaultMatchWidth:"any",parsePatterns:cx,defaultParseWidth:"any"})},Zd={code:"en-US",formatDistance:L_,formatLong:B_,formatRelative:W_,localize:X_,match:ux,options:{weekStartsOn:0,firstWeekContainsDate:1}};function dx(n,t){const e=ct(n,t==null?void 0:t.in);return $d(e,Kd(e))+1}function Qd(n,t){const e=ct(n,t==null?void 0:t.in),i=+vi(e)-+u_(e);return Math.round(i/Wd)+1}function Bo(n,t){var u,h,f,m;const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Gn(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Lt((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=je(a,t),l=Lt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=je(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function hx(n,t){var o,l,c,u;const e=Gn(),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)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=Bo(n,t),r=Lt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),je(r,t)}function Jd(n,t){const e=ct(n,t==null?void 0:t.in),i=+je(e,t)-+hx(e,t);return Math.round(i/Wd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},Mi={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},th={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Cn.y(n,t)},Y:function(n,t,e,i){const s=Bo(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Tt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Vd(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Cn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Jd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Qd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Cn.d(n,t)},D:function(n,t,e){const i=dx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Mi.noon:i===0?s=Mi.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Mi.evening:i>=12?s=Mi.afternoon:i>=4?s=Mi.morning:s=Mi.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return nh(i);case"XXXX":case"XX":return Zn(i);case"XXXXX":case"XXX":default:return Zn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return nh(i);case"xxxx":case"xx":return Zn(i);case"xxxxx":case"xxx":default:return Zn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eh(i,":");case"OOOO":default:return"GMT"+Zn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eh(i,":");case"zzzz":default:return"GMT"+Zn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function eh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function nh(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Zn(n,t)}function Zn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const ih=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},sh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ho={p:sh,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return ih(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",ih(i,t)).replace("{{time}}",sh(s,t))}},fx=/^D+$/,mx=/^Y+$/,gx=["D","DD","YY","YYYY"];function rh(n){return fx.test(n)}function ah(n){return mx.test(n)}function Wo(n,t,e){const i=px(n,t,e);if(console.warn(i),gx.includes(n))throw new RangeError(i)}function px(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const yx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,bx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_x=/^'([^]*?)'?$/,xx=/''/g,wx=/[a-zA-Z]/;function jr(n,t,e){var u,h,f,m,p,b,x,v;const i=Gn(),s=(e==null?void 0:e.locale)??i.locale??Zd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.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=(e==null?void 0:e.weekStartsOn)??((b=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:b.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ct(n,e==null?void 0:e.in);if(!No(o))throw new RangeError("Invalid time value");let l=t.match(bx).map(S=>{const D=S[0];if(D==="p"||D==="P"){const P=Ho[D];return P(S,s.formatLong)}return S}).join("").match(yx).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:vx(S)};if(th[D])return{isToken:!0,value:S};if(D.match(wx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ah(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&rh(D))&&Wo(D,t,String(n));const P=th[D[0]];return P(o,D,s.localize,c)}).join("")}function vx(n){const t=n.match(_x);return t?t[1].replace(xx,"'"):n}function oh(){return Object.assign({},Gn())}function Mx(n,t){const e=ct(n,t==null?void 0:t.in).getDay();return e===0?7:e}function Sx(n,t){const e=kx(t)?new t(0):Lt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function kx(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const Tx=10;class lh{constructor(){A(this,"subPriority",0)}validate(t,e){return!0}}class Dx extends lh{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class Cx extends lh{constructor(e,i){super();A(this,"priority",Tx);A(this,"subPriority",-1);this.context=e||(s=>Lt(i,s))}set(e,i){return i.timestampIsSet?e:Lt(e,Sx(e,this.context))}}class xt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new Dx(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class Ex extends xt{constructor(){super(...arguments);A(this,"priority",140);A(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Ht={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}/},Ue={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 Wt(n,t){return n&&{value:t(n.value),rest:n.rest}}function It(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function qe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*wi+r*ks+a*o_),rest:t.slice(e[0].length)}}function ch(n){return It(Ht.anyDigitsSigned,n)}function Nt(n,t){switch(n){case 1:return It(Ht.singleDigit,t);case 2:return It(Ht.twoDigits,t);case 3:return It(Ht.threeDigits,t);case 4:return It(Ht.fourDigits,t);default:return It(new RegExp("^\\d{1,"+n+"}"),t)}}function Ur(n,t){switch(n){case 1:return It(Ht.singleDigitSigned,t);case 2:return It(Ht.twoDigitsSigned,t);case 3:return It(Ht.threeDigitsSigned,t);case 4:return It(Ht.fourDigitsSigned,t);default:return It(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Yo(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function uh(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function dh(n){return n%400===0||n%4===0&&n%100!==0}class Ox extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Nt(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const o=uh(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class Px extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Nt(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=Bo(e,r);if(s.isTwoDigitYear){const l=uh(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}}class Ax extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Ur(i==="R"?4:i.length,e)}set(e,i,s){const r=Lt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),vi(r)}}class Rx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Ur(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Ix extends xt{constructor(){super(...arguments);A(this,"priority",120);A(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Nt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class Lx extends xt{constructor(){super(...arguments);A(this,"priority",120);A(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Nt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class Nx extends xt{constructor(){super(...arguments);A(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);A(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return Wt(It(Ht.month,e),r);case"MM":return Wt(Nt(2,e),r);case"Mo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class Fx extends xt{constructor(){super(...arguments);A(this,"priority",110);A(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return Wt(It(Ht.month,e),r);case"LL":return Wt(Nt(2,e),r);case"Lo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function zx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Jd(i,e)-t;return i.setDate(i.getDate()-s*7),ct(i,e==null?void 0:e.in)}class Bx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return It(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return je(zx(e,s,r),r)}}function Hx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Qd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Wx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return It(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return vi(Hx(e,s))}}const Yx=[31,28,31,30,31,30,31,31,30,31,30,31],Vx=[31,29,31,30,31,30,31,31,30,31,30,31];class $x extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subPriority",1);A(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return It(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=dh(s),a=e.getMonth();return r?i>=1&&i<=Vx[a]:i>=1&&i<=Yx[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class jx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subpriority",1);A(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return It(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear();return dh(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Vo(n,t,e){var h,f,m,p;const i=Gn(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(m=i.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,r=ct(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Vr(r,u,e)}class Ux extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Vo(e,s,r),e.setHours(0,0,0,0),e}}class qx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Nt(i.length,e),a);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Vo(e,s,r),e.setHours(0,0,0,0),e}}class Xx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Nt(i.length,e),a);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Vo(e,s,r),e.setHours(0,0,0,0),e}}function Gx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Mx(i,e),r=t-s;return Vr(i,r,e)}class Kx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Nt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=Gx(e,s),e.setHours(0,0,0,0),e}}class Zx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Yo(s),0,0,0),e}}class Qx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Yo(s),0,0,0),e}}class Jx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Yo(s),0,0,0),e}}class tw extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return It(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class ew extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return It(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class nw extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return It(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class iw extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return It(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class sw extends xt{constructor(){super(...arguments);A(this,"priority",60);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return It(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class rw extends xt{constructor(){super(...arguments);A(this,"priority",50);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return It(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class aw extends xt{constructor(){super(...arguments);A(this,"priority",30);A(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Nt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class ow extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return qe(Ue.basicOptionalMinutes,e);case"XX":return qe(Ue.basic,e);case"XXXX":return qe(Ue.basicOptionalSeconds,e);case"XXXXX":return qe(Ue.extendedOptionalSeconds,e);case"XXX":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-$r(e)-s)}}class lw extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return qe(Ue.basicOptionalMinutes,e);case"xx":return qe(Ue.basic,e);case"xxxx":return qe(Ue.basicOptionalSeconds,e);case"xxxxx":return qe(Ue.extendedOptionalSeconds,e);case"xxx":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-$r(e)-s)}}class cw extends xt{constructor(){super(...arguments);A(this,"priority",40);A(this,"incompatibleTokens","*")}parse(e){return ch(e)}set(e,i,s){return[Lt(e,s*1e3),{timestampIsSet:!0}]}}class uw extends xt{constructor(){super(...arguments);A(this,"priority",20);A(this,"incompatibleTokens","*")}parse(e){return ch(e)}set(e,i,s){return[Lt(e,s),{timestampIsSet:!0}]}}const dw={G:new Ex,y:new Ox,Y:new Px,R:new Ax,u:new Rx,Q:new Ix,q:new Lx,M:new Nx,L:new Fx,w:new Bx,I:new Wx,d:new $x,D:new jx,E:new Ux,e:new qx,c:new Xx,i:new Kx,a:new Zx,b:new Qx,B:new Jx,h:new tw,H:new ew,K:new nw,k:new iw,m:new sw,s:new rw,S:new aw,X:new ow,x:new lw,t:new cw,T:new uw},hw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mw=/^'([^]*?)'?$/,gw=/''/g,pw=/\S/,yw=/[a-zA-Z]/;function bw(n,t,e,i){var x,v,S,D,P,O,C,k;const s=()=>Lt((i==null?void 0:i.in)||e,NaN),r=oh(),a=(i==null?void 0:i.locale)??r.locale??Zd,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((D=(S=r.locale)==null?void 0:S.options)==null?void 0:D.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((O=(P=i==null?void 0:i.locale)==null?void 0:P.options)==null?void 0:O.weekStartsOn)??r.weekStartsOn??((k=(C=r.locale)==null?void 0:C.options)==null?void 0:k.weekStartsOn)??0;if(!t)return n?s():ct(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new Cx(i==null?void 0:i.in,e)],h=t.match(fw).map(g=>{const _=g[0];if(_ in Ho){const M=Ho[_];return M(g,a.formatLong)}return g}).join("").match(hw),f=[];for(let g of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&ah(g)&&Wo(g,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&rh(g)&&Wo(g,t,n);const _=g[0],M=dw[_];if(M){const{incompatibleTokens:E}=M;if(Array.isArray(E)){const I=f.find(F=>E.includes(F.token)||F.token===_);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${g}\` at the same time`)}else if(M.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${g}\` and any other token at the same time`);f.push({token:_,fullToken:g});const R=M.run(n,g,a.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(_.match(yw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(g==="''"?g="'":_==="'"&&(g=_w(g)),n.indexOf(g)===0)n=n.slice(g.length);else return s()}}if(n.length>0&&pw.test(n))return s();const m=u.map(g=>g.priority).sort((g,_)=>_-g).filter((g,_,M)=>M.indexOf(g)===_).map(g=>u.filter(_=>_.priority===g).sort((_,M)=>M.subPriority-_.subPriority)).map(g=>g[0]);let p=ct(e,i==null?void 0:i.in);if(isNaN(+p))return s();const b={};for(const g of m){if(!g.validate(p,c))return s();const _=g.set(p,b,c);Array.isArray(_)?(p=_[0],Object.assign(b,_[1])):p=_}return p}function _w(n){return n.match(mw)[1].replace(gw,"'")}function xw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function ww(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function vw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Mw(n){const t=n/wi;return Math.trunc(t)}function hh(n,t){const e=()=>Lt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Dw(n);let r;if(s.date){const c=Cw(s.date,i);r=Ew(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=Ow(s.time),isNaN(o)))return e();if(s.timezone){if(l=Pw(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=ct(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 ct(a+o+l,t==null?void 0:t.in)}const qr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Sw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,kw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Tw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Dw(n){const t={},e=n.split(qr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],qr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(qr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=qr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Cw(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Ew(n,t){if(t===null)return new Date(NaN);const e=n.match(Sw);if(!e)return new Date(NaN);const i=!!e[4],s=Os(e[1]),r=Os(e[2])-1,a=Os(e[3]),o=Os(e[4]),l=Os(e[5])-1;if(i)return Nw(t,o,l)?Aw(t,o,l):new Date(NaN);{const c=new Date(0);return!Iw(t,r,a)||!Lw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Os(n){return n?parseInt(n):1}function Ow(n){const t=n.match(kw);if(!t)return NaN;const e=$o(t[1]),i=$o(t[2]),s=$o(t[3]);return Fw(e,i,s)?e*wi+i*ks+s*1e3:NaN}function $o(n){return n&&parseFloat(n.replace(",","."))||0}function Pw(n){if(n==="Z")return 0;const t=n.match(Tw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return zw(i,s)?e*(i*wi+s*ks):NaN}function Aw(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Rw=[31,null,31,30,31,30,31,31,30,31,30,31];function fh(n){return n%400===0||n%4===0&&n%100!==0}function Iw(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Rw[t]||(fh(n)?29:28))}function Lw(n,t){return t>=1&&t<=(fh(n)?366:365)}function Nw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Fw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function zw(n,t){return t>=0&&t<=59}var Bw=Object.defineProperty,Hw=(n,t,e)=>t in n?Bw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Hw(n,typeof t!="symbol"?t+"":t,e);const Ww=1e3;var tt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(tt||{});const Yw=["in","not_in","selector"],Vw=["empty","not_empty"],$w=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Qn=n=>n.filter(t=>t!=="time"),mh=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],gh=Qn(mh),jw=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],jo=[...mh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api"],ph=Qn(jo),yh=[...jw,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],Uw=["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"],bh=Qn(Uw);Qn(["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","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","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","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"]),Qn(["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"]);const qw=[...jo,"mcp_session_id","mcp_method","mcp_tool_name","mcp_error"],Xw=Qn(qw);[...yh],new Set(gh),new Set(ph),new Set(bh),new Set(Xw);const Gw=[...jo,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Kw=Qn(Gw);[...yh];const _h=[{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"}];_h.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Yw},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Vw}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...ph,...gh,...bh,...Kw])]);const Zw={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"}},Qw=(n,t,e)=>{let i;const s=Zw[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Uo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Jw={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},tv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ev={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},nv={date:Uo({formats:Jw,defaultWidth:"full"}),time:Uo({formats:tv,defaultWidth:"full"}),dateTime:Uo({formats:ev,defaultWidth:"full"})},iv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},sv=(n,t,e,i)=>iv[n];function Ps(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const rv={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},av={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ov={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"]},lv={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"]},cv={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"}},uv={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"}},dv=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},hv={ordinalNumber:dv,era:Ps({values:rv,defaultWidth:"wide"}),quarter:Ps({values:av,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ps({values:ov,defaultWidth:"wide"}),day:Ps({values:lv,defaultWidth:"wide"}),dayPeriod:Ps({values:cv,defaultWidth:"wide",formattingValues:uv,defaultFormattingWidth:"wide"})};function As(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?mv(o,h=>h.test(a)):fv(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function fv(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function mv(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function gv(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const pv=/^(\d+)(th|st|nd|rd)?/i,yv=/\d+/i,bv={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},_v={any:[/^b/i,/^(a|c)/i]},xv={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]},vv={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},Mv={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]},Sv={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},kv={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]},Tv={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},Dv={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}},Cv={ordinalNumber:gv({matchPattern:pv,parsePattern:yv,valueCallback:n=>parseInt(n,10)}),era:As({matchPatterns:bv,defaultMatchWidth:"wide",parsePatterns:_v,defaultParseWidth:"any"}),quarter:As({matchPatterns:xv,defaultMatchWidth:"wide",parsePatterns:wv,defaultParseWidth:"any",valueCallback:n=>n+1}),month:As({matchPatterns:vv,defaultMatchWidth:"wide",parsePatterns:Mv,defaultParseWidth:"any"}),day:As({matchPatterns:Sv,defaultMatchWidth:"wide",parsePatterns:kv,defaultParseWidth:"any"}),dayPeriod:As({matchPatterns:Tv,defaultMatchWidth:"any",parsePatterns:Dv,defaultParseWidth:"any"})},Ev={code:"en-US",formatDistance:Qw,formatLong:nv,formatRelative:sv,localize:hv,match:Cv,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Ov={};function Rs(){return Ov}const xh=6048e5,Pv=864e5,Av=60,Rv=3600,wh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wh in n?n[wh](t):n instanceof Date?new n.constructor(t):new Date(t)}function oe(n,t){return Ae(t||n,n)}function vh(n){const t=oe(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Iv(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Si(n,t){const e=oe(n,void 0);return e.setHours(0,0,0,0),e}function Lv(n,t,e){const[i,s]=Iv(void 0,n,t),r=Si(i),a=Si(s),o=+r-vh(r),l=+a-vh(a);return Math.round((o-l)/Pv)}function Nv(n,t){const e=oe(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Fv(n,t){const e=oe(n,void 0);return Lv(e,Nv(e))+1}function an(n,t){var e,i,s,r;const a=Rs(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=oe(n,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 Xr(n,t){return an(n,{...t,weekStartsOn:1})}function Mh(n,t){const e=oe(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Xr(s),a=Ae(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Xr(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function zv(n,t){const e=Mh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Xr(i)}function Bv(n,t){const e=oe(n,void 0),i=+Xr(e)-+zv(e);return Math.round(i/xh)+1}function Sh(n,t){var e,i,s,r;const a=oe(n,t==null?void 0:t.in),o=a.getFullYear(),l=Rs(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const h=an(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=an(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function Hv(n,t){var e,i,s,r;const a=Rs(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Sh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),an(c,t)}function Wv(n,t){const e=oe(n,t==null?void 0:t.in),i=+an(e,t)-+Hv(e,t);return Math.round(i/xh)+1}function Dt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const En={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Dt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Dt(e+1,2)},d(n,t){return Dt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Dt(n.getHours()%12||12,t.length)},H(n,t){return Dt(n.getHours(),t.length)},m(n,t){return Dt(n.getMinutes(),t.length)},s(n,t){return Dt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Dt(s,t.length)}},ki={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},kh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return En.y(n,t)},Y:function(n,t,e,i){const s=Sh(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Dt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Dt(r,t.length)},R:function(n,t){const e=Mh(n);return Dt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Dt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Dt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Dt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return En.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Dt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Wv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Dt(s,t.length)},I:function(n,t,e){const i=Bv(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):En.d(n,t)},D:function(n,t,e){const i=Fv(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Dt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Dt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Dt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Dt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=ki.noon:i===0?s=ki.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=ki.evening:i>=12?s=ki.afternoon:i>=4?s=ki.morning:s=ki.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return En.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):En.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):En.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):En.s(n,t)},S:function(n,t){return En.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Dh(i);case"XXXX":case"XX":return Jn(i);case"XXXXX":case"XXX":default:return Jn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Dh(i);case"xxxx":case"xx":return Jn(i);case"xxxxx":case"xxx":default:return Jn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Th(i,":");case"OOOO":default:return"GMT"+Jn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Th(i,":");case"zzzz":default:return"GMT"+Jn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Dt(i,t.length)},T:function(n,t,e){return Dt(+n,t.length)}};function Th(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Dt(r,2)}function Dh(n,t){return n%60===0?(n>0?"-":"+")+Dt(Math.abs(n)/60,2):Jn(n,t)}function Jn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Dt(Math.trunc(i/60),2),r=Dt(i%60,2);return e+s+t+r}const Ch=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Eh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Yv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ch(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Ch(i,t)).replace("{{time}}",Eh(s,t))},Vv={p:Eh,P:Yv},$v=/^D+$/,jv=/^Y+$/,Uv=["D","DD","YY","YYYY"];function qv(n){return $v.test(n)}function Xv(n){return jv.test(n)}function Gv(n,t,e){const i=Kv(n,t,e);if(console.warn(i),Uv.includes(n))throw new RangeError(i)}function Kv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Zv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Qv(n){return!(!Zv(n)&&typeof n!="number"||isNaN(+oe(n)))}const Jv=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,t1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,e1=/^'([^]*?)'?$/,n1=/''/g,i1=/[a-zA-Z]/;function s1(n,t,e){var i,s,r,a,o,l,c,u;const h=Rs(),f=(e==null?void 0:e.locale)??h.locale??Ev,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(r=h.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.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,b=oe(n,e==null?void 0:e.in);if(!Qv(b))throw new RangeError("Invalid time value");let x=t.match(t1).map(S=>{const D=S[0];if(D==="p"||D==="P"){const P=Vv[D];return P(S,f.formatLong)}return S}).join("").match(Jv).map(S=>{if(S==="''")return{isToken:!1,value:"'"};const D=S[0];if(D==="'")return{isToken:!1,value:r1(S)};if(kh[D])return{isToken:!0,value:S};if(D.match(i1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+D+"`");return{isToken:!1,value:S}});f.localize.preprocessor&&(x=f.localize.preprocessor(b,x));const v={firstWeekContainsDate:m,weekStartsOn:p,locale:f};return x.map(S=>{if(!S.isToken)return S.value;const D=S.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Xv(D)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&qv(D))&&Gv(D,t,String(n));const P=kh[D[0]];return P(b,D,f.localize,v)}).join("")}function r1(n){const t=n.match(e1);return t?t[1].replace(n1,"'"):n}function Gr(n,t,e){const i=oe(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function Oh(n,t,e){const i=oe(n,void 0);if(isNaN(t))return Ae(n,NaN);if(!t)return i;const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function a1(n,t,e){return Oh(n,t*3)}function Ti(n,t){const e=oe(n,void 0),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function Di(n,t){const e=oe(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function o1(n,t){const e=oe(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function l1(){return Object.assign({},Rs())}function Ph(n){return Math.trunc(n*Rv)}function c1(n){const t=n/Av;return Math.trunc(t)}function Ah(n,t,e){return Oh(n,-1)}function Rh(n,t,e){return a1(n,-1)}function Ih(n,t,e){const i=l1(),s=h1(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?u1(s,t):d1(s,t)}function u1(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function d1(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function h1(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function f1(n,t){const e=b1(t);return"formatToParts"in e?g1(e,n):p1(e,n)}const m1={year:0,month:1,day:2,hour:3,minute:4,second:5};function g1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=m1[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function p1(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const qo={},Lh=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")),y1=Lh==="06/25/2014, 00:00:00"||Lh==="06/25/2014 00:00:00";function b1(n){return qo[n]||(qo[n]=y1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),qo[n]}function Xo(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Nh=36e5,_1=6e4,Go={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(n,t,e){if(!n)return 0;let i=Go.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Go.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Fh(s)?-(s*Nh):NaN;if(i=Go.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Fh(s,a)?(r=Math.abs(s)*Nh+a*_1,i[1]==="+"?-r:r):NaN}if(v1(n)){t=new Date(t||Date.now());const a=e?t:x1(t),o=Ko(a,n);return-(e?o:w1(t,o,n))}return NaN}function x1(n){return Xo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ko(n,t){const e=f1(n,t),i=Xo(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function w1(n,t,e){let i=n.getTime()-t;const s=Ko(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ko(new Date(i),e);return s===r?s:Math.max(s,r)}function Fh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const zh={};function v1(n){if(zh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),zh[n]=!0,!0}catch{return!1}}const M1=60*1e3,S1={X:function(n,t,e){const i=Zo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Bh(i);case"XXXX":case"XX":return Ci(i);case"XXXXX":case"XXX":default:return Ci(i,":")}},x:function(n,t,e){const i=Zo(e.timeZone,n);switch(t){case"x":return Bh(i);case"xxxx":case"xx":return Ci(i);case"xxxxx":case"xxx":default:return Ci(i,":")}},O:function(n,t,e){const i=Zo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+k1(i,":");case"OOOO":default:return"GMT"+Ci(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ih("short",n,e);case"zzzz":default:return Ih("long",n,e)}}};function Zo(n,t){const e=n?Is(n,t,!0)/M1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Kr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Ci(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Kr(Math.floor(i/60),2),r=Kr(Math.floor(i%60),2);return e+s+t+r}function Bh(n,t){return n%60===0?(n>0?"-":"+")+Kr(Math.abs(n)/60,2):Ci(n,t)}function k1(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Kr(r,2)}function Hh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Wh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Qo=36e5,Yh=6e4,T1=2,de={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:Wh};function Zr(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?T1:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=D1(n),{year:s,restDateString:r}=C1(i.date,e),a=E1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=O1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Is(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Hh(new Date(o+l)),c=Hh(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function D1(n){const t={};let e=de.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=de.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=de.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function C1(n,t){if(n){const e=de.YYY[t],i=de.YYYYY[t];let s=de.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=de.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function E1(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=de.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,jh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=de.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return R1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=de.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return jh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=de.Www.exec(n),r)return s=parseInt(r[1],10)-1,Uh(s)?Vh(t,s):new Date(NaN);if(r=de.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Uh(s,a)?Vh(t,s,a):new Date(NaN)}return null}function O1(n){let t,e,i=de.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Jo(t)?t%24*Qo:NaN;if(i=de.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Jo(t,e)?t%24*Qo+e*Yh:NaN;if(i=de.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Jo(t,e,s)?t%24*Qo+e*Yh+s*1e3:NaN}return null}function Vh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const P1=[31,28,31,30,31,30,31,31,30,31,30,31],A1=[31,29,31,30,31,30,31,31,30,31,30,31];function $h(n){return n%400===0||n%4===0&&n%100!==0}function jh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=$h(n);if(i&&e>A1[t]||!i&&e>P1[t])return!1}return!0}function R1(n,t){if(t<1)return!1;const e=$h(n);return!(e&&t>366||!e&&t>365)}function Uh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Jo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const I1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function L1(n,t,e={}){t=String(t);const i=t.match(I1);if(i){const s=Zr(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+S1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return s1(n,t,e)}function qh(n,t,e){n=Zr(n,e);const i=Is(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Xh(n,t,e,i){return i={...i,timeZone:t,originalDate:n},L1(qh(n,t,{timeZone:i.timeZone}),e,i)}function N1(n,t,e){if(typeof n=="string"&&!n.match(Wh))return Zr(n,{...e,timeZone:t});n=Zr(n,e);const i=Xo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Is(t,new Date(i));return new Date(i+s)}function F1(n,t){return-Is(n,t)}function Gh(n,t={}){const e=(t==null?void 0:t.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Xh(n,e,i)}function z1(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Xh(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const B1={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 tl(n){return n&&$w.find(t=>n<=B1[t])||null}var Qr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Jr={exports:{}};Jr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[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]",p="[object Object]",b="[object Promise]",x="[object RegExp]",v="[object Set]",S="[object String]",D="[object Symbol]",P="[object WeakMap]",O="[object ArrayBuffer]",C="[object DataView]",k="[object Float32Array]",g="[object Float64Array]",_="[object Int8Array]",M="[object Int16Array]",E="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",F="[object Uint16Array]",$="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,lt=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,B={};B[r]=B[a]=B[O]=B[C]=B[o]=B[l]=B[k]=B[g]=B[_]=B[M]=B[E]=B[f]=B[m]=B[p]=B[x]=B[v]=B[S]=B[D]=B[R]=B[I]=B[F]=B[$]=!0,B[c]=B[u]=B[P]=!1;var q=typeof Qr=="object"&&Qr&&Qr.Object===Object&&Qr,J=typeof self=="object"&&self&&self.Object===Object&&self,j=q||J||Function("return this")(),yt=t&&!t.nodeType&&t,_t=yt&&!0&&n&&!n.nodeType&&n,Y=_t&&_t.exports===yt;function H(w,L){return w.set(L[0],L[1]),w}function X(w,L){return w.add(L),w}function K(w,L){for(var z=-1,et=w?w.length:0;++z<et&&L(w[z],z,w)!==!1;);return w}function Z(w,L){for(var z=-1,et=L.length,Yt=w.length;++z<et;)w[Yt+z]=L[z];return w}function G(w,L,z,et){for(var Yt=-1,Xt=w?w.length:0;++Yt<Xt;)z=L(z,w[Yt],Yt,w);return z}function gt(w,L){for(var z=-1,et=Array(w);++z<w;)et[z]=L(z);return et}function vt(w,L){return w==null?void 0:w[L]}function at(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function bt(w){var L=-1,z=Array(w.size);return w.forEach(function(et,Yt){z[++L]=[Yt,et]}),z}function dt(w,L){return function(z){return w(L(z))}}function jt(w){var L=-1,z=Array(w.size);return w.forEach(function(et){z[++L]=et}),z}var ot=Array.prototype,Mt=Function.prototype,ee=Object.prototype,le=j["__core-js_shared__"],Ut=function(){var w=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Xe=Mt.toString,Et=ee.hasOwnProperty,ne=ee.toString,Ft=RegExp("^"+Xe.call(Et).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=Y?j.Buffer:void 0,ie=j.Symbol,Ge=j.Uint8Array,ai=dt(Object.getPrototypeOf,Object),ze=Object.create,zt=ee.propertyIsEnumerable,ve=ot.splice,oi=Object.getOwnPropertySymbols,va=qt?qt.isBuffer:void 0,Ma=dt(Object.keys,Object),Zs=Fn(j,"DataView"),li=Fn(j,"Map"),Qs=Fn(j,"Promise"),ci=Fn(j,"Set"),cn=Fn(j,"WeakMap"),un=Fn(Object,"create"),Js=ce(Zs),tr=ce(li),ui=ce(Qs),Wl=ce(ci),Yl=ce(cn),Sa=ie?ie.prototype:void 0,ka=Sa?Sa.valueOf:void 0;function dn(w){var L=-1,z=w?w.length:0;for(this.clear();++L<z;){var et=w[L];this.set(et[0],et[1])}}function Bi(){this.__data__=un?un(null):{}}function er(w){return this.has(w)&&delete this.__data__[w]}function Ta(w){var L=this.__data__;if(un){var z=L[w];return z===i?void 0:z}return Et.call(L,w)?L[w]:void 0}function hn(w){var L=this.__data__;return un?L[w]!==void 0:Et.call(L,w)}function Vl(w,L){var z=this.__data__;return z[w]=un&&L===void 0?i:L,this}dn.prototype.clear=Bi,dn.prototype.delete=er,dn.prototype.get=Ta,dn.prototype.has=hn,dn.prototype.set=Vl;function Be(w){var L=-1,z=w?w.length:0;for(this.clear();++L<z;){var et=w[L];this.set(et[0],et[1])}}function $l(){this.__data__=[]}function jl(w){var L=this.__data__,z=Wi(L,w);if(z<0)return!1;var et=L.length-1;return z==et?L.pop():ve.call(L,z,1),!0}function Ul(w){var L=this.__data__,z=Wi(L,w);return z<0?void 0:L[z][1]}function He(w){return Wi(this.__data__,w)>-1}function ql(w,L){var z=this.__data__,et=Wi(z,w);return et<0?z.push([w,L]):z[et][1]=L,this}Be.prototype.clear=$l,Be.prototype.delete=jl,Be.prototype.get=Ul,Be.prototype.has=He,Be.prototype.set=ql;function Ln(w){var L=-1,z=w?w.length:0;for(this.clear();++L<z;){var et=w[L];this.set(et[0],et[1])}}function Xl(){this.__data__={hash:new dn,map:new(li||Be),string:new dn}}function Gl(w){return $i(this,w).delete(w)}function Kl(w){return $i(this,w).get(w)}function We(w){return $i(this,w).has(w)}function Zl(w,L){return $i(this,w).set(w,L),this}Ln.prototype.clear=Xl,Ln.prototype.delete=Gl,Ln.prototype.get=Kl,Ln.prototype.has=We,Ln.prototype.set=Zl;function Nn(w){this.__data__=new Be(w)}function Ql(){this.__data__=new Be}function Jl(w){return this.__data__.delete(w)}function tc(w){return this.__data__.get(w)}function Hi(w){return this.__data__.has(w)}function ec(w,L){var z=this.__data__;if(z instanceof Be){var et=z.__data__;if(!li||et.length<e-1)return et.push([w,L]),this;z=this.__data__=new Ln(et)}return z.set(w,L),this}Nn.prototype.clear=Ql,Nn.prototype.delete=Jl,Nn.prototype.get=tc,Nn.prototype.has=Hi,Nn.prototype.set=ec;function nc(w,L){var z=rr(w)||Ui(w)?gt(w.length,String):[],et=z.length,Yt=!!et;for(var Xt in w)Et.call(w,Xt)&&!(Yt&&(Xt=="length"||_c(Xt,et)))&&z.push(Xt);return z}function Ie(w,L,z){var et=w[L];(!(Et.call(w,L)&&sr(et,z))||z===void 0&&!(L in w))&&(w[L]=z)}function Wi(w,L){for(var z=w.length;z--;)if(sr(w[z][0],L))return z;return-1}function ic(w,L){return w&&Da(L,di(L),w)}function nr(w,L,z,et,Yt,Xt,Me){var Jt;if(et&&(Jt=Xt?et(w,Yt,Xt,Me):et(w)),Jt!==void 0)return Jt;if(!mn(w))return w;var Ia=rr(w);if(Ia){if(Jt=yc(w),!L)return mc(w,Jt)}else{var zn=Ke(w),La=zn==u||zn==h;if(Pa(w))return lc(w,L);if(zn==p||zn==r||La&&!Xt){if(at(w))return Xt?w:{};if(Jt=Ea(La?{}:w),!L)return gc(w,ic(Jt,w))}else{if(!B[zn])return Xt?w:{};Jt=bc(w,zn,nr,L)}}Me||(Me=new Nn);var Na=Me.get(w);if(Na)return Na;if(Me.set(w,Jt),!Ia)var hi=z?pc(w):di(w);return K(hi||w,function(or,qi){hi&&(qi=or,or=w[qi]),Ie(Jt,qi,nr(or,L,z,et,qi,w,Me))}),Jt}function sc(w){return mn(w)?ze(w):{}}function rc(w,L,z){var et=L(w);return rr(w)?et:Z(et,z(w))}function ac(w){return ne.call(w)}function Yi(w){if(!mn(w)||xc(w))return!1;var L=ar(w)||at(w)?Ft:lt;return L.test(ce(w))}function oc(w){if(!fn(w))return Ma(w);var L=[];for(var z in Object(w))Et.call(w,z)&&z!="constructor"&&L.push(z);return L}function lc(w,L){if(L)return w.slice();var z=new w.constructor(w.length);return w.copy(z),z}function Vi(w){var L=new w.constructor(w.byteLength);return new Ge(L).set(new Ge(w)),L}function cc(w,L){var z=L?Vi(w.buffer):w.buffer;return new w.constructor(z,w.byteOffset,w.byteLength)}function uc(w,L,z){var et=L?z(bt(w),!0):bt(w);return G(et,H,new w.constructor)}function ir(w){var L=new w.constructor(w.source,V.exec(w));return L.lastIndex=w.lastIndex,L}function dc(w,L,z){var et=L?z(jt(w),!0):jt(w);return G(et,X,new w.constructor)}function hc(w){return ka?Object(ka.call(w)):{}}function fc(w,L){var z=L?Vi(w.buffer):w.buffer;return new w.constructor(z,w.byteOffset,w.length)}function mc(w,L){var z=-1,et=w.length;for(L||(L=Array(et));++z<et;)L[z]=w[z];return L}function Da(w,L,z,et){z||(z={});for(var Yt=-1,Xt=L.length;++Yt<Xt;){var Me=L[Yt],Jt=void 0;Ie(z,Me,Jt===void 0?w[Me]:Jt)}return z}function gc(w,L){return Da(w,Ca(w),L)}function pc(w){return rc(w,di,Ca)}function $i(w,L){var z=w.__data__;return ji(L)?z[typeof L=="string"?"string":"hash"]:z.map}function Fn(w,L){var z=vt(w,L);return Yi(z)?z:void 0}var Ca=oi?dt(oi,Object):Aa,Ke=ac;(Zs&&Ke(new Zs(new ArrayBuffer(1)))!=C||li&&Ke(new li)!=f||Qs&&Ke(Qs.resolve())!=b||ci&&Ke(new ci)!=v||cn&&Ke(new cn)!=P)&&(Ke=function(w){var L=ne.call(w),z=L==p?w.constructor:void 0,et=z?ce(z):void 0;if(et)switch(et){case Js:return C;case tr:return f;case ui:return b;case Wl:return v;case Yl:return P}return L});function yc(w){var L=w.length,z=w.constructor(L);return L&&typeof w[0]=="string"&&Et.call(w,"index")&&(z.index=w.index,z.input=w.input),z}function Ea(w){return typeof w.constructor=="function"&&!fn(w)?sc(ai(w)):{}}function bc(w,L,z,et){var Yt=w.constructor;switch(L){case O:return Vi(w);case o:case l:return new Yt(+w);case C:return cc(w,et);case k:case g:case _:case M:case E:case R:case I:case F:case $:return fc(w,et);case f:return uc(w,et,z);case m:case S:return new Yt(w);case x:return ir(w);case v:return dc(w,et,z);case D:return hc(w)}}function _c(w,L){return L=L??s,!!L&&(typeof w=="number"||U.test(w))&&w>-1&&w%1==0&&w<L}function ji(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function xc(w){return!!Ut&&Ut in w}function fn(w){var L=w&&w.constructor,z=typeof L=="function"&&L.prototype||ee;return w===z}function ce(w){if(w!=null){try{return Xe.call(w)}catch{}try{return w+""}catch{}}return""}function wc(w){return nr(w,!0,!0)}function sr(w,L){return w===L||w!==w&&L!==L}function Ui(w){return vc(w)&&Et.call(w,"callee")&&(!zt.call(w,"callee")||ne.call(w)==r)}var rr=Array.isArray;function Oa(w){return w!=null&&Mc(w.length)&&!ar(w)}function vc(w){return gn(w)&&Oa(w)}var Pa=va||Ra;function ar(w){var L=mn(w)?ne.call(w):"";return L==u||L==h}function Mc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function mn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function gn(w){return!!w&&typeof w=="object"}function di(w){return Oa(w)?nc(w):oc(w)}function Aa(){return[]}function Ra(){return!1}n.exports=wc}(Jr,Jr.exports),Jr.exports;const Re=(n,t)=>new Date(n.getTime()-F1(t,n));class Qt{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=N1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return qh(e,t)}}class H1 extends Qt{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class W1 extends Qt{rawStart(t){let e=Di(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class Y1 extends Qt{rawStart(t){let e=Ti(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*92}}class V1 extends Qt{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*366}}class $1 extends Qt{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Re(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Re(i,t)),i}}class j1 extends Qt{rawEnd(t){let e=Ti(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}rawStart(t){let e=Ti(Rh(this.tzAdjustedDate(t)));return t&&(e=Re(e,t)),e}}class U1 extends Qt{rawEnd(t){let e=Di(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}rawStart(t){let e=Di(Ah(this.tzAdjustedDate(t)));return t&&(e=Re(e,t)),e}}class q1 extends Qt{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Re(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Re(e,t)),e}}tt.FIFTEEN_MIN,new Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 H1({key:tt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(Si(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.CURRENT_MONTH,new W1({key:tt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Di(new Date);return(Si(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_QUARTER,new Y1({key:tt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Ti(new Date);return(Si(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_YEAR,new V1({key:tt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(Si(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_WEEK,new $1({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 U1({key:tt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Di(new Date),e=Di(Ah(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Kh(t,e)),60*60*24*o1(new Date().setMonth(new Date().getMonth()-1))+Ph(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_QUARTER,new j1({key:tt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Ti(new Date),t=Ti(Rh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_YEAR,new q1({key:tt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Kh(n,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Ph(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Kh(n,t){return c1(n.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_QUARTER,tt.CURRENT_YEAR,tt.PREVIOUS_WEEK,tt.PREVIOUS_MONTH,tt.PREVIOUS_QUARTER,tt.PREVIOUS_YEAR;const X1=new Map(_h.map(n=>[n.code,{code:n.code,name:n.name}])),el=n=>{var t;return((t=X1.get(n))==null?void 0:t.name)||n},Zh=1e3,G1=1e4,Qh=1e6,Jh=1e9,tf=1e12,ta=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,r)=>{r&&r%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},Ls=(n,t,e)=>{const i=n/t,s=e.round?"round":"floor";if(e.decimal===!1)return Math[s](i).toString();let r;e.precision?r=i:r=i<10?Math[s](i*10)/10:Math[s](i);let a=r.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function ea(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const s=t.min10k?G1:Zh;return n<s||t.precision&&t.precision>Math.log10(n)?e=ta(Ls(n,1,t),t):n<Qh?e=`${Ls(n,Zh,t)}k`:n<Jh?e=`${Ls(n,Qh,t)}m`:n<tf?e=`${ta(Ls(n,Jh,t),t)}b`:e=`${ta(Ls(n,tf,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}ea.addCommas=ta;var ef;const K1=typeof document<"u"&&((ef=document.documentElement)==null?void 0:ef.lang)||"en-US",na=new Intl.NumberFormat(K1);function Ei({i18n:n}){const t=(i,s)=>{if(isNaN(i))return"0 B";const r=s?Math.pow(2,50):1e15,a=s?Math.pow(2,40):1e12,o=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=r?u=n.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=n.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},e=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?n.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:r=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,r);case"usd":return e(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${ea(i,{capital:!0})} ${c}`:i>=.01?`${na.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:e,formatRange:(i,s,r,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(r,s);switch(r){case"bytes":return`${t(i,a)} - ${t(s,a)}`;case"usd":return`${e(i,o)} - ${e(s,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${ea(i,{capital:!0})} - ${ea(s,{capital:!0})} ${u}`}const h=i>=.01?`${na.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${na.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const ia=n=>["interactive","zoom-interactive"].includes(n),nf=(n,t,e,i)=>{var l,c;const{tooltip:s}=t;if(s.opacity===0&&!ia(n.interactionMode)){n.showTooltip=!1;return}const{i18n:r}=mt.useI18n(),{formatUnit:a}=Ei({i18n:r}),o=n.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(s.body&&!ia(n.interactionMode)){const u=s.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y",f=s.dataPoints[0].parsed.x??0;n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(f,e):Bs({tickValue:new Date(f),granularity:e}),n.tooltipSeries=s.dataPoints.map((m,p)=>{const b=m.parsed[h],x=a(b??0,n.units,{translateUnit:n.translateUnit}),v=m.dataset.label;return{backgroundColor:u[p].backgroundColor,borderColor:u[p].borderColor,label:v,value:x,rawValue:b,isSegmentEmpty:m.dataset.isSegmentEmpty}}).sort(o),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},sf=(n,t)=>{var a,o;const{tooltip:e}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=Ei({i18n:i});if(e.opacity===0&&!ia(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(e.body&&!ia(n.interactionMode)){const l=e.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[c],p=s(m??0,n.units,{translateUnit:n.translateUnit});let b;return u?b=h.dataset.labels[h.dataIndex]:b=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:b,value:p,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Z1=n=>n&&n.datasets&&n.datasets.length,Q1=n=>Z1(n)&&n.datasets.some(t=>t.data.length),J1=n=>n.datasets.some(t=>t.data[0]&&No(t.data[0].x)),tM=n=>!!Q1(n)&&n.datasets.some(t=>t.data.length==1),eM=n=>J1(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),nl=(n,t,e)=>{const s=Math.min(t/1150,1),r=.15,a=1.15,o=n.x??0;return o<e?o+t*r*(1-s):o-t*a*(1-s)},nM=(n,t,e)=>{const r=n.y??0;return r<e?r+t*.15:r-t*.5};function rf(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const af=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},iM=2,of=10,lf=12,sa=10,cf="#6c7489",sM="#d60027",rM="#ad000e",il="#6c7489",uf="#52596e",aM="#007d60",oM="#995c00",lM="#ffc400",Ns="16px",cM="20px",uM="'Inter', Roboto, Helvetica, sans-serif",df={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ra=(n,t)=>(t||on)[n%on.length],hf=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},ff="#6f7787",mf={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"}},dM=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=mf[t])==null?void 0:e.background)||"#fafafa"},hM={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},fM={"4XX":"#FFBA81","5XX":"#FF8484"},mM={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},gM="#dad4c7",gf="#afb7c5",pM=n=>{const t=Object.entries(df).find(([e])=>new RegExp(e).test(n));return t&&t[1]||df.standard},sl=(n,t,e,i)=>{let s;return e?s=gf:Array.isArray(i)?s=ra(n,i):s=i[t],s||ra(n)},aa=n=>{switch(n){case"error":return sM;case"warning":return lM;case"neutral":return cf;default:return cf}},yM={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},bM=2,_M=0,rl=new Map,pf=(n,t)=>{const{i18n:e}=mt.useI18n(),{formatBytes:i}=Ei({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):na.format(n)},xM=n=>{const e=document.createElement("canvas").getContext("2d"),i=Rt({});return e.font=i.string,e.measureText(n).width},wM=()=>{const n="label_height";if(!rl.has(n)){const t=Rt({});rl.set(n,t.lineHeight)}return rl.get(n)},vM=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),MM=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,al="#e0e4ea",SM={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"]},Fs=(n,t)=>{let e=1;const i=SM[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},yf=new Map([[100,Fs("100",[100,101,102,103])],[200,Fs("200",[200,201,202,203,204,205,206,207,208,226])],[300,Fs("300",[300,301,302,303,304,305,307,308])],[400,Fs("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,Fs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ol=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=yf.get(e);return i===void 0?al:i.get(t)??i.get(-1)??al},kM=n=>{const t=ol(n);return{solid:t,light:t}},oa={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=ol(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function bf(n,t,e){const i=oh(),s=CM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?TM(s,t):DM(s,t)}function TM(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function DM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function CM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function EM(n,t){const e=IM(t);return"formatToParts"in e?PM(e,n):AM(e,n)}const OM={year:0,month:1,day:2,hour:3,minute:4,second:5};function PM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=OM[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function AM(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ll={},_f=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")),RM=_f==="06/25/2014, 00:00:00"||_f==="06/25/2014 00:00:00";function IM(n){return ll[n]||(ll[n]=RM?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ll[n]}function xf(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const wf=36e5,LM=6e4,cl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ul(n,t,e){if(!n)return 0;let i=cl.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=cl.timezoneHH.exec(n),i)return s=parseInt(i[1],10),vf(s)?-(s*wf):NaN;if(i=cl.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return vf(s,a)?(r=Math.abs(s)*wf+a*LM,i[1]==="+"?-r:r):NaN}if(zM(n)){t=new Date(t||Date.now());const a=e?t:NM(t),o=dl(a,n);return-(e?o:FM(t,o,n))}return NaN}function NM(n){return xf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function dl(n,t){const e=EM(n,t),i=xf(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function FM(n,t,e){let s=n.getTime()-t;const r=dl(new Date(s),e);if(t===r)return t;s-=r-t;const a=dl(new Date(s),e);return r===a?r:Math.max(r,a)}function vf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Mf={};function zM(n){if(Mf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Mf[n]=!0,!0}catch{return!1}}const BM=60*1e3,HM={X:function(n,t,e){const i=hl(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Sf(i);case"XXXX":case"XX":return Oi(i);case"XXXXX":case"XXX":default:return Oi(i,":")}},x:function(n,t,e){const i=hl(e.timeZone,n);switch(t){case"x":return Sf(i);case"xxxx":case"xx":return Oi(i);case"xxxxx":case"xxx":default:return Oi(i,":")}},O:function(n,t,e){const i=hl(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+WM(i,":");case"OOOO":default:return"GMT"+Oi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return bf("short",n,e);case"zzzz":default:return bf("long",n,e)}}};function hl(n,t){const e=n?ul(n,t,!0)/BM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function la(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Oi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=la(Math.floor(i/60),2),r=la(Math.floor(i%60),2);return e+s+t+r}function Sf(n,t){return n%60===0?(n>0?"-":"+")+la(Math.abs(n)/60,2):Oi(n,t)}function WM(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+la(r,2)}function kf(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const YM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,fl=36e5,Tf=6e4,VM=2,he={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:YM};function Df(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?VM:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=$M(n),{year:s,restDateString:r}=jM(i.date,e),a=UM(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=qM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=ul(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=kf(new Date(o+l)),c=kf(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function $M(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function jM(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function UM(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Of(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return KM(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return Of(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Pf(s)?Cf(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Pf(s,a)?Cf(t,s,a):new Date(NaN)}return null}function qM(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ml(t)?t%24*fl:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ml(t,e)?t%24*fl+e*Tf:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ml(t,e,s)?t%24*fl+e*Tf+s*1e3:NaN}return null}function Cf(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const XM=[31,28,31,30,31,30,31,31,30,31,30,31],GM=[31,29,31,30,31,30,31,31,30,31,30,31];function Ef(n){return n%400===0||n%4===0&&n%100!==0}function Of(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ef(n);if(i&&e>GM[t]||!i&&e>XM[t])return!1}return!0}function KM(n,t){if(t<1)return!1;const e=Ef(n);return!(e&&t>366||!e&&t>365)}function Pf(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ml(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const ZM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function gl(n,t,e={}){t=String(t);const i=t.match(ZM);if(i){const s=Df(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+HM[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return jr(n,t,e)}function QM(n,t,e){n=Df(n,e);const i=ul(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function zs(n,t,e,i){return i={...i,timeZone:t,originalDate:n},gl(QM(n,t,{timeZone:i.timeZone}),e,i)}const JM=(n,t)=>`${zs(n,t,"yyyy")} W${zs(n,t,"II")}`,pl="yyyy-MM-dd h:mm:ss a",yl="h:mm:ss a",ti="yyyy-MM-dd h:mm a",Pi="h:mm a",tS="yyyy-MM-dd",bl="MMM dd, yyyy h:mm:ss a",On="MMM dd, yyyy h:mm a",eS={secondly:n=>n?pl:yl,tenSecondly:n=>n?pl:yl,thirtySecondly:n=>n?pl:yl,minutely:n=>n?ti:Pi,fiveMinutely:n=>n?ti:Pi,tenMinutely:n=>n?ti:Pi,thirtyMinutely:n=>n?ti:Pi,hourly:n=>n?ti:Pi,twoHourly:n=>n?ti:Pi,twelveHourly:()=>ti,daily:()=>tS},nS={secondly:()=>bl,tenSecondly:()=>bl,thirtySecondly:()=>bl,minutely:()=>On,fiveMinutely:()=>On,tenMinutely:()=>On,thirtyMinutely:()=>On,hourly:()=>On,twoHourly:()=>On,twelveHourly:()=>On,daily:()=>On};function Af({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:a}){const o=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return JM(n,o);if(s&&s[t]){const l=s[t](i);return zs(n,o,l)}if(r&&r[t]){const l=r[t]();return zs(n,o,l)}return zs(n,o,a)}const iS=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Af({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:eS,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),Bs=({tickValue:n,granularity:t,timezone:e})=>Af({tickValue:n,granularity:t,timezone:e,tooltipMap:nS,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),sS=n=>{var e,i,s,r,a;const{i18n:t}=mt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(n==null?void 0:n.message)}},rS=new Set(["control_plane_count","service_count","route_count","consumer_count","plugin_count","node_count","usd"]),Hs=n=>rS.has(n);function aS(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};De.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=nl(c,h,f),p=c.y,b=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:b}},go.modes.customInteractionMode=function(l,c){const u=Sn(c,l),h=[];return go.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&u.x!==null&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=n.numLabels.value>25?of:lf,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,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>sa?c.slice(0,sa)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,p,b;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(b=n.dimensionAxesTitle)==null?void 0:b.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{sf(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.getCurrentInstance()&&d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),o}ye.register(...r_);const oS=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function lS(n,t,e,i,s){const r=d.shallowRef(null),a=(o,l)=>{if(t.value)return new ye(t.value,{type:n,data:o,plugins:i,options:l})};return d.onMounted(()=>{r.value=a(e.value,s.value)}),d.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),d.watch(e,(o,l)=>{if(oS(l,o)&&!st(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=a(o,s.value)}),d.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),d.watch(s,(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(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}const Rf=1e3,cS=1e4,If=1e6,Lf=1e9,Nf=1e12,Ws=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,a)=>{a&&a%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},Ai=(n,t,e)=>{const i=n/t,s=e.round?"round":"floor";if(e.decimal===!1)return Math[s](i).toString();let r;e.precision?r=i:r=i<10?Math[s](i*10)/10:Math[s](i);let a=r.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function Ys(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const s=t.min10k?cS:Rf;return n<s||t.precision&&t.precision>Math.log10(n)?e=Ws(Ai(n,1,t),t):n<If?e=`${Ai(n,Rf,t)}k`:n<Lf?e=`${Ai(n,If,t)}m`:n<Nf?e=`${Ws(Ai(n,Lf,t),t)}b`:e=`${Ws(Ai(n,Nf,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}Ys.addCommas=Ws;function uS(n,t,e){const{i18n:i}=mt.useI18n(),{formatBytes:s}=Ei({i18n:i}),{translateUnit:r}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>n.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(e.value==="bytes")u=s(c);else{const h=r(e.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Ys(c,{capital:!0}),unit:h})||`${Ys(c,{capital:!0})} ${e.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function dS(n){return d.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Gh(new Date(e))} - ${Gh(new Date(i),{includeTZ:!0})}`:""})}function hS(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};De.positioners[e]=function(r,a){if(!r.length||a.x===null||a.y===null)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=o.width/2,u=nl(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{sf(n.tooltipState,r)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),{options:s}}function fS(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return iS({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=d.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};De.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,p=u.height/2,b=nl(c,h,m);let x=nM(c,f,p);const v=c.y<p?"top":"bottom",S=c.x<m?"left":"center";return f>u.height&&(x=0),{x:b,y:x,xAlign:S,yAlign:v}};const a=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Mw(l)>24||u.getDate()!==c.getDate()}),o=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:u=>{nf(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.onUnmounted(()=>{De.positioners[s]&&delete De.positioners[s]}),{options:o}}function mS(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:ra(i.indexOf(u),on),data:a.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=sl(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=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function gS(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0,u=c&&o.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],p=Object.fromEntries(l?s.flatMap(_=>a.map((M,E)=>{const R=_.event[f],I=c?`${R},${M}`:`${E},${M}`,F=_.event[M];return[I,F]})):s.map(_=>{const M=c?`${_.event[f]},${_.event[m]}`:`${f},${m}`,E=_.event[a[0]];return[M,E]})),b=Object.keys(p).reduce((_,M)=>{const[E]=M.split(","),R=p[M];return _[E]?_[E]+=R:_[E]=R,_},{}),x=Object.entries(b).sort(([,_],[,M])=>Number(M)-Number(_)).map(([_])=>_),v=r[f],S=r[m];let D=c&&v&&Object.entries(v).map(([_,M])=>({id:_,name:M.name}))||a.map(_=>({id:_,name:_})),P=c&&S&&Object.entries(S).map(([_,M])=>({id:_,name:M.name}))||a.map(_=>({id:_,name:_}));if(c&&f==="country_code"&&(D=D.map(_=>({..._,name:el(_.id)||_.name}))),c&&m==="country_code"&&(P=P.map(_=>({..._,name:el(_.id)||_.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(D.sort((_,M)=>x.indexOf(_.id)-x.indexOf(M.id)),P.sort((_,M)=>x.indexOf(_.id)-x.indexOf(M.id))),!D||!P)return{labels:[],datasets:[]};const O=mS({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:P,pivotRecords:p,rowLabels:D,colorPalette:n.colorPalette||on}),C=c?D.map(_=>e&&e.te(`chartLabels.${_.name}`)&&e.t(`chartLabels.${_.name}`)||_.name):a.map(_=>e&&e.te(`chartLabels.${_}`)&&e.t(`chartLabels.${_}`)||_),k=D.map(_=>_.id==="empty");return{labels:C,datasets:O,isLabelEmpty:k,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const pS=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),yS=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return hh(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},bS=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return pS(o,l,e)};function _S(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start:o,end:l}=t.value.meta,c=new Date(o).getTime(),u=new Date(l).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const h=r&&Object.keys(r)||a,f=h&&h[0],m=r[f];let p=r&&m&&Object.keys(m).map(C=>({id:C,name:m[C].name}))||a.map(C=>({id:C,name:C}));f==="country_code"&&(p=p.map(C=>({...C,name:el(C.id)||C.name})));const b=t.value.meta.granularity_ms;if(typeof b!="number"||isNaN(b)||!isFinite(b)||b===0)return console.error("Invalid step value:",b),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const x=yS(c),v=bS(c,u,b,x,s),S=new Set,D=s!=null&&s.length?s.reduce((C,k)=>{const g=new Date(k.timestamp).valueOf(),_=k.event;for(const M of a)S.add(M),g in C||(C[g]={}),M in C[g]||(C[g][M]={});for(const M of a)p.forEach(E=>{_[f]===E.id||M===E.id?(C[g][M]||(C[g][M]={}),C[g][M][E.name]=Math.round(Number(_[M])*1e3)/1e3):h.length||(C[g][M]||(C[g][M]={}),C[g][M][E.name]=Math.round(Number(_[E.id])*1e3)/1e3)});return C},{}):{},O=[...a.length===1?a.flatMap(C=>p.map(k=>[C,k.name,k.id==="empty"])):p.map(C=>[C.name,C.name,C.id==="empty"])].map(([C,k,g],_)=>{const M=v.map(F=>F in D&&C in D[F]?{x:F,y:D[F][C][k]||0}:{x:F,y:0});let{colorPalette:E,fill:R}=n;st(E)&&(E=on);const I=sl(_,k,g,E);return{rawDimension:k,rawMetric:C,label:e&&e.te(`chartLabels.${k}`)&&e.t(`chartLabels.${k}`)||k,borderColor:I,backgroundColor:I,data:M,total:M.reduce((F,{y:$})=>F+Number($),0),...yM,fill:R,borderWidth:R?_M:bM,isSegmentEmpty:g}});return f==="status_code"||f==="status_code_grouped"?O.sort((C,k)=>(C.label??"")<(k.label??"")?-1:1):O.sort((C,k)=>Number(C.total)<Number(k.total)?-1:1),{datasets:O}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const xS=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function wS(){const{i18n:n}=mt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return Hs(e)?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const vS="analytics-query-provider",Ff=2;function MS(){const n=d.inject(vS);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function _l(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const zf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const SS=n=>n!=null,kS=Object.prototype.toString,TS=n=>kS.call(n)==="[object Object]";function ca(n){return Array.isArray(n)?n:[n]}function DS(n){return d.getCurrentInstance()}function CS(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const o=[...n.value];o[i]=s,n.value=o}else{const o={...n.value,[i]:s};Object.setPrototypeOf(o,Object.getPrototypeOf(n.value)),n.value=o}else n.value[i]=s}}));return e}function ES(n,t=!0,e){DS()?d.onMounted(n,e):t?n():d.nextTick(n)}function OS(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const ua=zf?window:void 0;function Ri(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Vs(...n){const t=[],e=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),s=d.computed(()=>{const o=ca(d.toValue(n[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),r=OS(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(c=>Ri(c)))!=null?l:[ua].filter(c=>c!=null),ca(d.toValue(s.value?n[1]:n[0])),ca(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([o,l,c,u])=>{if(e(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=TS(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(p=>i(f,m,p,h)))))},{flush:"post"}),a=()=>{r(),e()};return _l(e),a}function PS(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function Bf(n){const t=PS();return d.computed(()=>(t.value,!!n()))}function AS(n,t,e={}){const{window:i=ua,...s}=e;let r;const a=Bf(()=>i&&"MutationObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=ca(f).map(Ri).filter(SS);return new Set(m)}),c=d.watch(l,f=>{o(),a.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),o()};return _l(h),{isSupported:a,stop:h,takeRecords:u}}function RS(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=ua,containerElement:m,handle:p=n,buttons:b=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),v=d.ref(),S=k=>i?i.includes(k.pointerType):!0,D=k=>{d.toValue(s)&&k.preventDefault(),d.toValue(r)&&k.stopPropagation()},P=k=>{var g;if(!d.toValue(b).includes(k.button)||d.toValue(t.disabled)||!S(k)||d.toValue(a)&&k.target!==d.toValue(n))return;const _=d.toValue(m),M=(g=_==null?void 0:_.getBoundingClientRect)==null?void 0:g.call(_),E=d.toValue(n).getBoundingClientRect(),R={x:k.clientX-(_?E.left-M.left+_.scrollLeft:E.left),y:k.clientY-(_?E.top-M.top+_.scrollTop:E.top)};(c==null?void 0:c(R,k))!==!1&&(v.value=R,D(k))},O=k=>{if(d.toValue(t.disabled)||!S(k)||!v.value)return;const g=d.toValue(m),_=d.toValue(n).getBoundingClientRect();let{x:M,y:E}=x.value;(h==="x"||h==="both")&&(M=k.clientX-v.value.x,g&&(M=Math.min(Math.max(0,M),g.scrollWidth-_.width))),(h==="y"||h==="both")&&(E=k.clientY-v.value.y,g&&(E=Math.min(Math.max(0,E),g.scrollHeight-_.height))),x.value={x:M,y:E},o==null||o(x.value,k),D(k)},C=k=>{d.toValue(t.disabled)||!S(k)||v.value&&(v.value=void 0,l==null||l(x.value,k),D(k))};if(zf){const k=()=>{var g;return{capture:(g=t.capture)!=null?g:!0,passive:!d.toValue(s)}};Vs(p,"pointerdown",P,k),Vs(f,"pointermove",O,k),Vs(f,"pointerup",C,k)}return{...CS(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function IS(n,t,e={}){const{window:i=ua,...s}=e;let r;const a=Bf(()=>i&&"ResizeObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Ri(f)):[Ri(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return _l(u),{isSupported:a,stop:u}}function LS(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!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),p=d.shallowRef(0);function b(){const v=Ri(n);if(!v){e&&(o.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const S=v.getBoundingClientRect();o.value=S.height,l.value=S.bottom,c.value=S.left,u.value=S.right,h.value=S.top,f.value=S.width,m.value=S.x,p.value=S.y}function x(){a==="sync"?b():a==="next-frame"&&requestAnimationFrame(()=>b())}return IS(n,x),d.watch(()=>Ri(n),v=>!v&&x()),AS(n,x,{attributeFilter:["style","class"]}),s&&Vs("scroll",x,{capture:!0,passive:!0}),i&&Vs("resize",x,{passive:!0}),ES(()=>{r&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:p,update:x}}function NS(n,t){const{top:e,left:i}=LS(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const FS=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=e).sort((l,c)=>l-c),r=[];if(e-t<n-2)return[];const a=(e-t)/n;let o=0;for(let l=0;l<n;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<s.length&&s[o]>=c&&s[o]<=u;)h++,o++;r.push([Math.ceil(c),h])}return r},Hf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),$s=d.ref({}),zS=n=>($s.value[n]||($s.value[n]=Hf()),$s.value[n]),BS=(n,t)=>{const e=$s.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete $s.value[t])};function HS({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=e!==void 0&&n!==void 0?zS(e):Hf(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((M,{timestamps:E})=>[...M,...E],[])),m=d.computed(()=>i||f.value.reduce((M,E)=>M===0?E:Math.min(M,E),0)),p=d.computed(()=>s||f.value.reduce((M,E)=>Math.max(M,E),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=p.value,o!==void 0&&(u.renderPoints[h]=o)});const b=d.computed(()=>Object.values(u.minStamps).reduce((M,E)=>M===0?E:Math.min(M,E),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((M,E)=>Math.max(M,E),0)),v=d.computed(()=>{const M=Object.values(u.renderPoints);return M.length===0?24:M.reduce((E,R)=>Math.max(E,R),2)}),S=d.computed(()=>{const M=x.value-b.value;return Math.ceil(M/v.value)}),D=d.computed(()=>t.length>1),P=d.computed(()=>t.map(({timestamps:M,color:E,label:R})=>({data:FS({bucketCount:v.value,minStamp:b.value,maxStamp:x.value,timestamps:M}).map(([$,Q])=>({x:$,y:Q})),label:R,...(l==="sparkline_bar"||D.value)&&E&&{backgroundColor:E},...l!=="sparkline_bar"&&E&&{borderColor:E},...D.value&&l!=="sparkline_bar"&&{fill:!0}}))),O=d.computed(()=>{var R,I;const M=((I=(R=P.value[0])==null?void 0:R.data)==null?void 0:I.length)??0,E=[];for(let F=0;F<M;F++){let $=0;for(let Q=0;Q<P.value.length;Q++)$+=P.value[Q].data[F].y;E.push($)}return E}),C=d.computed(()=>{const M=O.value.reduce((E,R)=>Math.max(E,R),0);return Math.max(M,a??0)}),k=d.computed(()=>{const M=P.value.reduce((I,{data:F})=>[...I,...F.map(({y:$})=>$)],[]),E=M.length?M[0]:0,R=M.reduce((I,F)=>Math.min(I,F),E);return r===void 0?R:Math.min(R,r)});d.watchEffect(()=>{u.maxCounts[h]=C.value,u.minCounts[h]=k.value});const g=d.computed(()=>{const M=Object.values(u.minCounts),E=M.length?M[0]:0;return M.reduce((R,I)=>Math.min(R,I),E)}),_=d.computed(()=>Object.values(u.maxCounts).reduce((M,E)=>Math.max(M,E),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&BS(n,e)}),{syncedMinStamp:b,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:P,syncedGroupSizeMs:S,syncedMinCount:g,syncedMaxCount:_}}const mt={useBarChartOptions:aS,useChartJSCommon:lS,useChartLegendValues:uS,useChartSelectedRange:dS,useExploreResultToDatasets:gS,useExploreResultToTimeDataset:_S,useDonutChartOptions:hS,useLineChartOptions:fS,useI18n:eg,useReportChartDataForSynthetics:xS,useTranslatedUnits:wS,useEvaluateFeatureFlag:MS,useTooltipAbsolutePosition:NS,useSparklineSync:HS};var xe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(xe||{});/*!
|
|
18
|
+
`):n}function E0(n,t){const{element:e,datasetIndex:i,index:s}=t,r=n.getDatasetMeta(i).controller,{label:a,value:o}=r.getLabelAndValue(s);return{chart:n,label:a,parsed:r.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:o,dataset:r.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function Sd(n,t){const e=n.chart.ctx,{body:i,footer:s,title:r}=n,{boxWidth:a,boxHeight:o}=t,l=Rt(t.bodyFont),c=Rt(t.titleFont),u=Rt(t.footerFont),h=r.length,f=s.length,m=i.length,p=$t(t.padding);let _=p.height,x=0,v=i.reduce((P,O)=>P+O.before.length+O.lines.length+O.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,h&&(_+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),v){const P=t.displayColors?Math.max(o,l.lineHeight):l.lineHeight;_+=m*P+(v-m)*l.lineHeight+(v-1)*t.bodySpacing}f&&(_+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let k=0;const E=function(P){x=Math.max(x,e.measureText(P).width+k)};return e.save(),e.font=c.string,kt(n.title,E),e.font=l.string,kt(n.beforeBody.concat(n.afterBody),E),k=t.displayColors?a+2+t.boxPadding:0,kt(i,P=>{kt(P.before,E),kt(P.lines,E),kt(P.after,E)}),k=0,e.font=u.string,kt(n.footer,E),e.restore(),x+=p.width,{width:x,height:_}}function O0(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function P0(n,t,e,i){const{x:s,width:r}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+r+a>t.width||n==="right"&&s-r-a<0)return!0}function A0(n,t,e,i){const{x:s,width:r}=e,{width:a,chartArea:{left:o,right:l}}=n;let c="center";return i==="center"?c=s<=(o+l)/2?"left":"right":s<=r/2?c="left":s>=a-r/2&&(c="right"),P0(c,n,t,e)&&(c="center"),c}function kd(n,t,e){const i=e.yAlign||t.yAlign||O0(n,e);return{xAlign:e.xAlign||t.xAlign||A0(n,t,e,i),yAlign:i}}function R0(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function I0(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Td(n,t,e,i){const{caretSize:s,caretPadding:r,cornerRadius:a}=n,{xAlign:o,yAlign:l}=e,c=s+r,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=vn(a);let p=R0(t,o);const _=I0(t,l,c);return l==="center"?o==="left"?p+=c:o==="right"&&(p-=c):o==="left"?p-=Math.max(u,f)+s:o==="right"&&(p+=Math.max(h,m)+s),{x:Kt(p,0,i.width-t.width),y:Kt(_,0,i.height-t.height)}}function zr(n,t,e){const i=$t(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Dd(n){return $e([],rn(n))}function L0(n,t,e){return Mn(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Cd(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Ed={beforeTitle:Qe,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Qe,beforeBody:Qe,beforeLabel:Qe,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return st(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Qe,afterBody:Qe,beforeFooter:Qe,footer:Qe,afterFooter:Qe};function be(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Ed[t].call(e,i):s}class Do extends Zt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,r=new ro(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(r)),r}getContext(){return this.$context||(this.$context=L0(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=be(i,"beforeTitle",this,t),r=be(i,"title",this,t),a=be(i,"afterTitle",this,t);let o=[];return o=$e(o,rn(s)),o=$e(o,rn(r)),o=$e(o,rn(a)),o}getBeforeBody(t,e){return Dd(be(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return kt(t,r=>{const a={before:[],lines:[],after:[]},o=Cd(i,r);$e(a.before,rn(be(o,"beforeLabel",this,r))),$e(a.lines,be(o,"label",this,r)),$e(a.after,rn(be(o,"afterLabel",this,r))),s.push(a)}),s}getAfterBody(t,e){return Dd(be(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=be(i,"beforeFooter",this,t),r=be(i,"footer",this,t),a=be(i,"afterFooter",this,t);let o=[];return o=$e(o,rn(s)),o=$e(o,rn(r)),o=$e(o,rn(a)),o}_createItems(t){const e=this._active,i=this.chart.data,s=[],r=[],a=[];let o=[],l,c;for(l=0,c=e.length;l<c;++l)o.push(E0(this.chart,e[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))),kt(o,u=>{const h=Cd(t.callbacks,u);s.push(be(h,"labelColor",this,u)),r.push(be(h,"labelPointStyle",this,u)),a.push(be(h,"labelTextColor",this,u))}),this.labelColors=s,this.labelPointStyles=r,this.labelTextColors=a,this.dataPoints=o,o}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let r,a=[];if(!s.length)this.opacity!==0&&(r={opacity:0});else{const o=ws[i.position].call(this,s,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=Sd(this,i),c=Object.assign({},o,l),u=kd(this.chart,i,c),h=Td(i,c,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,r={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,r&&this._resolveAnimations().update(this,r),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const r=this.getCaretPosition(t,i,s);e.lineTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.lineTo(r.x3,r.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:r}=this,{caretSize:a,cornerRadius:o}=i,{topLeft:l,topRight:c,bottomLeft:u,bottomRight:h}=vn(o),{x:f,y:m}=t,{width:p,height:_}=e;let x,v,k,E,P,O;return r==="center"?(P=m+_/2,s==="left"?(x=f,v=x-a,E=P+a,O=P-a):(x=f+p,v=x+a,E=P-a,O=P+a),k=x):(s==="left"?v=f+Math.max(l,u)+a:s==="right"?v=f+p-Math.max(c,h)-a:v=this.caretX,r==="top"?(E=m,P=E-a,x=v-a,k=v+a):(E=m+_,P=E+a,x=v+a,k=v-a),O=E),{x1:x,x2:v,x3:k,y1:E,y2:P,y3:O}}drawTitle(t,e,i){const s=this.title,r=s.length;let a,o,l;if(r){const c=xi(i.rtl,this.x,this.width);for(t.x=zr(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=Rt(i.titleFont),o=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<r;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+o,l+1===r&&(t.y+=i.titleMarginBottom-o)}}_drawColorBox(t,e,i,s,r){const a=this.labelColors[i],o=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=r,u=Rt(r.bodyFont),h=zr(this,"left",r),f=s.x(h),m=l<u.lineHeight?(u.lineHeight-l)/2:0,p=e.y+m;if(r.usePointStyle){const _={radius:Math.min(c,l)/2,pointStyle:o.pointStyle,rotation:o.rotation,borderWidth:1},x=s.leftForLtr(f,c)+c/2,v=p+l/2;t.strokeStyle=r.multiKeyBackground,t.fillStyle=r.multiKeyBackground,Qa(t,_,x,v),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Qa(t,_,x,v)}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 _=s.leftForLtr(f,c),x=s.leftForLtr(s.xPlus(f,1),c-2),v=vn(a.borderRadius);Object.values(v).some(k=>k!==0)?(t.beginPath(),t.fillStyle=r.multiKeyBackground,yi(t,{x:_,y:p,w:c,h:l,radius:v}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),yi(t,{x,y:p+1,w:c-2,h:l-2,radius:v}),t.fill()):(t.fillStyle=r.multiKeyBackground,t.fillRect(_,p,c,l),t.strokeRect(_,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(x,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:r,bodyAlign:a,displayColors:o,boxHeight:l,boxWidth:c,boxPadding:u}=i,h=Rt(i.bodyFont);let f=h.lineHeight,m=0;const p=xi(i.rtl,this.x,this.width),_=function(g){e.fillText(g,p.x(t.x+m),t.y+f/2),t.y+=f+r},x=p.textAlign(a);let v,k,E,P,O,D,S;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=zr(this,x,i),e.fillStyle=i.bodyColor,kt(this.beforeBody,_),m=o&&x!=="right"?a==="center"?c/2+u:c+2+u:0,P=0,D=s.length;P<D;++P){for(v=s[P],k=this.labelTextColors[P],e.fillStyle=k,kt(v.before,_),E=v.lines,o&&E.length&&(this._drawColorBox(e,t,P,p,i),f=Math.max(h.lineHeight,l)),O=0,S=E.length;O<S;++O)_(E[O]),f=h.lineHeight;kt(v.after,_)}m=0,f=h.lineHeight,kt(this.afterBody,_),t.y-=r}drawFooter(t,e,i){const s=this.footer,r=s.length;let a,o;if(r){const l=xi(i.rtl,this.x,this.width);for(t.x=zr(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=Rt(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,o=0;o<r;++o)e.fillText(s[o],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:r,yAlign:a}=this,{x:o,y:l}=t,{width:c,height:u}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=vn(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(o+h,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(o+c-f,l),e.quadraticCurveTo(o+c,l,o+c,l+f),a==="center"&&r==="right"&&this.drawCaret(t,e,i,s),e.lineTo(o+c,l+u-p),e.quadraticCurveTo(o+c,l+u,o+c-p,l+u),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(o+m,l+u),e.quadraticCurveTo(o,l+u,o,l+u-m),a==="center"&&r==="left"&&this.drawCaret(t,e,i,s),e.lineTo(o,l+h),e.quadraticCurveTo(o,l,o+h,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,r=i&&i.y;if(s||r){const a=ws[t.position].call(this,this._active,this._eventPosition);if(!a)return;const o=this._size=Sd(this,t),l=Object.assign({},a,this._size),c=kd(e,t,l),u=Td(t,l,c,e);(s._to!==u.x||r._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 e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},r={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=$t(e.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&o&&(t.save(),t.globalAlpha=i,this.drawBackground(r,t,s,e),cu(t,e.textDirection),r.y+=a.top,this.drawTitle(r,t,e),this.drawBody(r,t,e),this.drawFooter(r,t,e),uu(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=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}}),r=!dr(i,s),a=this._positionChanged(s,e);(r||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,r=this._active||[],a=this._getActiveElements(t,r,e,i),o=this._positionChanged(a,t),l=e||!dr(a,r)||o;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const r=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(o=>this.chart.data.datasets[o.datasetIndex]&&this.chart.getDatasetMeta(o.datasetIndex).controller.getParsed(o.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,r.mode,r,i);return r.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:r}=this,a=ws[r.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}A(Do,"positioners",ws);var De={id:"tooltip",_element:Do,positioners:ws,afterInit(n,t,e){e&&(n.tooltip=new Do({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,t)=>t.bodyFont.size,boxWidth:(n,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Ed},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},N0=Object.freeze({__proto__:null,Colors:Gb,Decimation:Jb,Filler:_0,Legend:k0,SubTitle:C0,Title:D0,Tooltip:De});const F0=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function B0(n,t,e,i){const s=n.indexOf(t);if(s===-1)return F0(n,t,e,i);const r=n.lastIndexOf(t);return s!==r?e:s}const z0=(n,t)=>n===null?null:Kt(Math.round(n),0,t);function Od(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Co extends qn{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:r}of e)i[s]===r&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(st(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:B0(i,t,rt(e,t),this._addedLabels),z0(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let r=this.getLabels();r=t===0&&e===r.length-1?r:r.slice(t,e+1),this._valueRange=Math.max(r.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Od.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}A(Co,"id","category"),A(Co,"defaults",{ticks:{callback:Od}});function H0(n,t){const e=[],{bounds:s,step:r,min:a,max:o,precision:l,count:c,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=r||1,p=u-1,{min:_,max:x}=t,v=!st(a),k=!st(o),E=!st(c),P=(x-_)/(h+1);let O=Lc((x-_)/p/m)*m,D,S,g,y;if(O<1e-14&&!v&&!k)return[{value:_},{value:x}];y=Math.ceil(x/O)-Math.floor(_/O),y>p&&(O=Lc(y*O/p/m)*m),st(l)||(D=Math.pow(10,l),O=Math.ceil(O*D)/D),s==="ticks"?(S=Math.floor(_/O)*O,g=Math.ceil(x/O)*O):(S=_,g=x),v&&k&&r&&Lg((o-a)/r,O/1e3)?(y=Math.round(Math.min((o-a)/O,u)),O=(o-a)/y,S=a,g=o):E?(S=v?a:S,g=k?o:g,y=c-1,O=(g-S)/y):(y=(g-S)/O,es(y,Math.round(y),O/1e3)?y=Math.round(y):y=Math.ceil(y));const M=Math.max(Fc(O),Fc(S));D=Math.pow(10,st(l)?M:l),S=Math.round(S*D)/D,g=Math.round(g*D)/D;let C=0;for(v&&(f&&S!==a?(e.push({value:a}),S<a&&C++,es(Math.round((S+C*O)*D)/D,a,Pd(a,P,n))&&C++):S<a&&C++);C<y;++C){const R=Math.round((S+C*O)*D)/D;if(k&&R>o)break;e.push({value:R})}return k&&f&&g!==o?e.length&&es(e[e.length-1].value,o,Pd(o,P,n))?e[e.length-1].value=o:e.push({value:o}):(!k||g===o)&&e.push({value:g}),e}function Pd(n,t,{horizontal:e,minRotation:i}){const s=Yt(i),r=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/r,a)}class Hr extends qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return st(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:r}=this;const a=l=>s=e?s:l,o=l=>r=i?r:l;if(t){const l=Ve(s),c=Ve(r);l<0&&c<0?o(0):l>0&&c>0&&a(0)}if(s===r){let l=r===0?1:Math.abs(r*.05);o(r+l),t||a(s-l)}this.min=s,this.max=r}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},r=this._range||this,a=H0(s,r);return t.bounds==="ticks"&&Nc(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 e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return ss(t,this.chart.options.locale,this.options.ticks.format)}}class Eo extends Hr{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?t:0,this.max=At(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=Yt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,r=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,r.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}A(Eo,"id","linear"),A(Eo,"defaults",{ticks:{callback:br.formatters.numeric}});const vs=n=>Math.floor(xn(n)),Xn=(n,t)=>Math.pow(10,vs(n)+t);function Ad(n){return n/Math.pow(10,vs(n))===1}function Rd(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function W0(n,t){const e=t-n;let i=vs(e);for(;Rd(n,t,i)>10;)i++;for(;Rd(n,t,i)<10;)i--;return Math.min(i,vs(n))}function V0(n,{min:t,max:e}){t=Te(n.min,t);const i=[],s=vs(t);let r=W0(t,e),a=r<0?Math.pow(10,Math.abs(r)):1;const o=Math.pow(10,r),l=s>r?Math.pow(10,s):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,r)),f=Te(n.min,Math.round((l+u+h*Math.pow(10,r))*a)/a);for(;f<e;)i.push({value:f,major:Ad(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(r++,h=2,a=r>=0?1:a),f=Math.round((l+u+h*Math.pow(10,r))*a)/a;const m=Te(n.max,f);return i.push({value:m,major:Ad(m),significand:h}),i}class Oo extends qn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Hr.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return At(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=At(t)?Math.max(0,t):null,this.max=At(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!At(this._userMin)&&(this.min=t===Xn(this.min,0)?Xn(this.min,-1):Xn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const r=o=>i=t?i:o,a=o=>s=e?s:o;i===s&&(i<=0?(r(1),a(10)):(r(Xn(i,-1)),a(Xn(s,1)))),i<=0&&r(Xn(s,-1)),s<=0&&a(Xn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=V0(e,this);return t.bounds==="ticks"&&Nc(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":ss(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=xn(t),this._valueRange=xn(this.max)-xn(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(xn(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}A(Oo,"id","logarithmic"),A(Oo,"defaults",{ticks:{callback:br.formatters.logarithmic,major:{enabled:!0}}});function Po(n){const t=n.ticks;if(t.display&&n.display){const e=$t(t.backdropPadding);return rt(t.font&&t.font.size,Pt.font.size)+e.height}return 0}function Y0(n,t,e){return e=wt(e)?e:[e],{w:Qg(n,t.string,e),h:e.length*t.lineHeight}}function Id(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function $0(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],r=n._pointLabels.length,a=n.options.pointLabels,o=a.centerPointLabels?ut/r:0;for(let l=0;l<r;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const u=n.getPointPosition(l,n.drawingArea+s[l],o),h=Rt(c.font),f=Y0(n.ctx,h,n._pointLabels[l]);i[l]=f;const m=se(n.getIndexAngle(l)+o),p=Math.round(gr(m)),_=Id(p,u.x,f.w,0,180),x=Id(p,u.y,f.h,90,270);j0(e,t,m,_,x)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=X0(n,i,s)}function j0(n,t,e,i,s){const r=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let o=0,l=0;i.start<t.l?(o=(t.l-i.start)/r,n.l=Math.min(n.l,t.l-o)):i.end>t.r&&(o=(i.end-t.r)/r,n.r=Math.max(n.r,t.r+o)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function U0(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:r,padding:a,size:o}=e,l=n.getPointPosition(t,i+s+a,r),c=Math.round(gr(se(l.angle+Ot))),u=Z0(l.y,o.h,c),h=G0(c),f=K0(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 q0(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:r}=n;return!(en({x:e,y:i},t)||en({x:e,y:r},t)||en({x:s,y:i},t)||en({x:s,y:r},t))}function X0(n,t,e){const i=[],s=n._pointLabels.length,r=n.options,{centerPointLabels:a,display:o}=r.pointLabels,l={extra:Po(r)/2,additionalAngle:a?ut/s:0};let c;for(let u=0;u<s;u++){l.padding=e[u],l.size=t[u];const h=U0(n,u,l);i.push(h),o==="auto"&&(h.visible=q0(h,c),h.visible&&(c=h))}return i}function G0(n){return n===0||n===180?"center":n<180?"left":"right"}function K0(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Z0(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function Q0(n,t,e){const{left:i,top:s,right:r,bottom:a}=e,{backdropColor:o}=t;if(!st(o)){const l=vn(t.borderRadius),c=$t(t.backdropPadding);n.fillStyle=o;const u=i-c.left,h=s-c.top,f=r-i+c.width,m=a-s+c.height;Object.values(l).some(p=>p!==0)?(n.beginPath(),yi(n,{x:u,y:h,w:f,h:m,radius:l}),n.fill()):n.fillRect(u,h,f,m)}}function J0(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const r=n._pointLabelItems[s];if(!r.visible)continue;const a=i.setContext(n.getPointLabelContext(s));Q0(e,a,r);const o=Rt(a.font),{x:l,y:c,textAlign:u}=r;Yn(e,n._pointLabels[s],l,c+o.lineHeight/2,o,{color:a.color,textAlign:u,textBaseline:"middle"})}}function Ld(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,Ct);else{let r=n.getPointPosition(0,t);s.moveTo(r.x,r.y);for(let a=1;a<i;a++)r=n.getPointPosition(a,t),s.lineTo(r.x,r.y)}}function t_(n,t,e,i,s){const r=n.ctx,a=t.circular,{color:o,lineWidth:l}=t;!a&&!i||!o||!l||e<0||(r.save(),r.strokeStyle=o,r.lineWidth=l,r.setLineDash(s.dash||[]),r.lineDashOffset=s.dashOffset,r.beginPath(),Ld(n,e,a,i),r.closePath(),r.stroke(),r.restore())}function e_(n,t,e){return Mn(n,{label:e,index:t,type:"pointLabel"})}class Ms extends Hr{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=$t(Po(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=At(t)&&!isNaN(t)?t:0,this.max=At(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Po(this.options))}generateTickLabels(t){Hr.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=St(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?$0(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=Ct/(this._pointLabels.length||1),i=this.options.startAngle||0;return se(t*e+Yt(i))}getDistanceFromCenterForValue(t){if(st(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(st(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return e_(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Ot+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:i,right:s,bottom:r}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:r}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Ld(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:r}=e,a=this._pointLabels.length;let o,l,c;if(e.pointLabels.display&&J0(this,a),s.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=s.setContext(f),p=r.setContext(f);t_(this,m,l,a,p)}}),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(e.reverse?this.min:this.max),c=this.getPointPosition(o,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let r,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((o,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),u=Rt(c.font);if(r=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=u.string,a=t.measureText(o.label).width,t.fillStyle=c.backdropColor;const h=$t(c.backdropPadding);t.fillRect(-a/2-h.left,-r-u.size/2-h.top,a+h.width,u.size+h.height)}Yn(t,o.label,0,-r,u,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}A(Ms,"id","radialLinear"),A(Ms,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:br.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),A(Ms,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),A(Ms,"descriptors",{angleLines:{_fallback:"grid"}});const Wr={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}},_e=Object.keys(Wr);function Nd(n,t){return n-t}function Fd(n,t){if(st(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:r}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),At(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(wn(r)||r===!0)?e.startOf(a,"isoWeek",r):e.startOf(a,s)),+a)}function Bd(n,t,e,i){const s=_e.length;for(let r=_e.indexOf(n);r<s-1;++r){const a=Wr[_e[r]],o=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(o*a.size))<=i)return _e[r]}return _e[s-1]}function n_(n,t,e,i,s){for(let r=_e.length-1;r>=_e.indexOf(e);r--){const a=_e[r];if(Wr[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return _e[e?_e.indexOf(e):0]}function i_(n){for(let t=_e.indexOf(n)+1,e=_e.length;t<e;++t)if(Wr[_e[t]].common)return _e[t]}function zd(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Ua(e,t),r=e[i]>=t?e[i]:e[s];n[r]=!0}}function s_(n,t,e,i){const s=n._adapter,r=+s.startOf(t[0].value,i),a=t[t.length-1].value;let o,l;for(o=r;o<=a;o=+s.add(o,1,i))l=e[o],l>=0&&(t[l].major=!0);return t}function Hd(n,t,e){const i=[],s={},r=t.length;let a,o;for(a=0;a<r;++a)o=t[a],s[o]=a,i.push({value:o,major:!1});return r===0||!e?i:s_(n,i,s,e)}class Ss extends qn{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const i=t.time||(t.time={}),s=this._adapter=new Eu._date(t.adapters.date);s.init(e),ts(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Fd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:r,minDefined:a,maxDefined:o}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!o&&!isNaN(c.max)&&(r=Math.max(r,c.max))}(!a||!o)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=At(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),r=At(r)&&!isNaN(r)?r:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,r-1),this.max=Math.max(s+1,r)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const r=this.min,a=this.max,o=zg(s,r,a);return this._unit=e.unit||(i.autoSkip?Bd(e.minUnit,this.min,this.max,this._getLabelCapacity(r)):n_(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:i_(this._unit),this.initOffsets(s),t.reverse&&o.reverse(),Hd(this,o,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,r;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,r=this.getDecimalForValue(t[t.length-1]),t.length===1?i=r:i=(r-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Kt(e,0,a),i=Kt(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,r=s.time,a=r.unit||Bd(r.minUnit,e,i,this._getLabelCapacity(e)),o=rt(s.ticks.stepSize,1),l=a==="week"?r.isoWeekday:!1,c=wn(l)||l===!0,u={};let h=e,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,e,a)>1e5*o)throw new Error(e+" and "+i+" are too far apart with stepSize of "+o+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,o,a),m++)zd(u,f,p);return(f===i||s.bounds==="ticks"||m===1)&&zd(u,f,p),Object.keys(u).sort(Nd).map(_=>+_)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,r=this._unit,a=e||s[r];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const r=this.options,a=r.ticks.callback;if(a)return St(a,[t,e,i],this);const o=r.time.displayFormats,l=this._unit,c=this._majorUnit,u=l&&o[l],h=c&&o[c],f=i[e],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:u))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=Yt(this.isHorizontal()?e.maxRotation:e.minRotation),r=Math.cos(s),a=Math.sin(s),o=this._resolveTickFontOptions(0).size;return{w:i*r+o*a,h:i*a+o*r}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,r=this._tickFormatFunction(t,0,Hd(this,[t],this._majorUnit),s),a=this._getLabelSize(r),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||[],e,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(Fd(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Hc(t.sort(Nd))}}A(Ss,"id","time"),A(Ss,"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 Vr(n,t,e){let i=0,s=n.length-1,r,a,o,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=tn(n,"pos",t)),{pos:r,time:o}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=tn(n,"time",t)),{time:r,pos:o}=n[i],{time:a,pos:l}=n[s]);const c=a-r;return c?o+(l-o)*(t-r)/c:o}class Ao extends Ss{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Vr(e,this.min),this._tableRange=Vr(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],r=[];let a,o,l,c,u;for(a=0,o=t.length;a<o;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,o=s.length;a<o;++a)u=s[a+1],l=s[a-1],c=s[a],Math.round((u+l)/2)!==c&&r.push({time:c,pos:a/(o-1)});return r}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,r)=>s-r)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Vr(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Vr(this._table,i*this._tableRange+this._minPos,!0)}}A(Ao,"id","timeseries"),A(Ao,"defaults",Ss.defaults);var r_=Object.freeze({__proto__:null,CategoryScale:Co,LinearScale:Eo,LogarithmicScale:Oo,RadialLinearScale:Ms,TimeScale:Ss,TimeSeriesScale:Ao});const a_=[my,Vb,N0,r_],Wd=6048e5,o_=864e5,ks=6e4,vi=36e5,l_=1e3,Vd=Symbol.for("constructDateFrom");function Lt(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&Vd in n?n[Vd](t):n instanceof Date?new n.constructor(t):new Date(t)}function ct(n,t){return Lt(t||n,n)}function Yr(n,t,e){const i=ct(n,e==null?void 0:e.in);return isNaN(t)?Lt((e==null?void 0:e.in)||n,NaN):(t&&i.setDate(i.getDate()+t),i)}function Ro(n,t,e){const i=ct(n,e==null?void 0:e.in);if(isNaN(t))return Lt(n,NaN);if(!t)return i;const s=i.getDate(),r=Lt(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function Io(n,t,e){return Lt(n,+ct(n)+t)}function c_(n,t,e){return Io(n,t*vi)}let u_={};function Gn(){return u_}function je(n,t){var o,l,c,u;const e=Gn(),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)??e.weekStartsOn??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?7:0)+r-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Mi(n,t){return je(n,{...t,weekStartsOn:1})}function Yd(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Lt(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Mi(s),a=Lt(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Mi(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function $r(n){const t=ct(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Kn(n,...t){const e=Lt.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function Lo(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(0,0,0,0),e}function $d(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Lo(i),a=Lo(s),o=+r-$r(r),l=+a-$r(a);return Math.round((o-l)/o_)}function d_(n,t){const e=Yd(n,t),i=Lt(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Mi(i)}function h_(n,t,e){const i=ct(n,e==null?void 0:e.in);return i.setTime(i.getTime()+t*ks),i}function f_(n,t,e){return Ro(n,t*3,e)}function m_(n,t,e){return Io(n,t*1e3)}function g_(n,t,e){return Yr(n,t*7,e)}function p_(n,t,e){return Ro(n,t*12,e)}function Ts(n,t){const e=+ct(n)-+ct(t);return e<0?-1:e>0?1:e}function y_(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function No(n){return!(!y_(n)&&typeof n!="number"||isNaN(+ct(n)))}function b_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return r*12+a}function __(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t);return i.getFullYear()-s.getFullYear()}function jd(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Ud(i,s),a=Math.abs($d(i,s));i.setDate(i.getDate()-r*a);const o=+(Ud(i,s)===-r),l=r*(a-o);return l===0?0:l}function Ud(n,t){const e=n.getFullYear()-t.getFullYear()||n.getMonth()-t.getMonth()||n.getDate()-t.getDate()||n.getHours()-t.getHours()||n.getMinutes()-t.getMinutes()||n.getSeconds()-t.getSeconds()||n.getMilliseconds()-t.getMilliseconds();return e<0?-1:e>0?1:e}function Ds(n){return t=>{const i=(n?Math[n]:Math.trunc)(t);return i===0?0:i}}function x_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=(+i-+s)/vi;return Ds(e==null?void 0:e.roundingMethod)(r)}function Fo(n,t){return+ct(n)-+ct(t)}function w_(n,t,e){const i=Fo(n,t)/ks;return Ds(e==null?void 0:e.roundingMethod)(i)}function qd(n,t){const e=ct(n,t==null?void 0:t.in);return e.setHours(23,59,59,999),e}function Xd(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getMonth();return e.setFullYear(e.getFullYear(),i+1,0),e.setHours(23,59,59,999),e}function v_(n,t){const e=ct(n,t==null?void 0:t.in);return+qd(e,t)==+Xd(e,t)}function Gd(n,t,e){const[i,s,r]=Kn(e==null?void 0:e.in,n,n,t),a=Ts(s,r),o=Math.abs(b_(s,r));if(o<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*o);let l=Ts(s,r)===-a;v_(i)&&o===1&&Ts(i,r)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function M_(n,t,e){const i=Gd(n,t,e)/3;return Ds(e==null?void 0:e.roundingMethod)(i)}function S_(n,t,e){const i=Fo(n,t)/1e3;return Ds(e==null?void 0:e.roundingMethod)(i)}function k_(n,t,e){const i=jd(n,t,e)/7;return Ds(e==null?void 0:e.roundingMethod)(i)}function T_(n,t,e){const[i,s]=Kn(e==null?void 0:e.in,n,t),r=Ts(i,s),a=Math.abs(__(i,s));i.setFullYear(1584),s.setFullYear(1584);const o=Ts(i,s)===-r,l=r*(a-+o);return l===0?0:l}function D_(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function C_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setDate(1),e.setHours(0,0,0,0),e}function E_(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getFullYear();return e.setFullYear(i+1,0,0),e.setHours(23,59,59,999),e}function Kd(n,t){const e=ct(n,t==null?void 0:t.in);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function O_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(59,59,999),e}function P_(n,t){var o,l;const e=Gn(),i=e.weekStartsOn??((l=(o=e.locale)==null?void 0:o.options)==null?void 0:l.weekStartsOn)??0,s=ct(n,t==null?void 0:t.in),r=s.getDay(),a=(r<i?-7:0)+6-(r-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function A_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(59,999),e}function R_(n,t){const e=ct(n,t==null?void 0:t.in),i=e.getMonth(),s=i-i%3+3;return e.setMonth(s,0),e.setHours(23,59,59,999),e}function I_(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(999),e}const L_={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"}},N_=(n,t,e)=>{let i;const s=L_[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Bo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const F_={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},B_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z_={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},H_={date:Bo({formats:F_,defaultWidth:"full"}),time:Bo({formats:B_,defaultWidth:"full"}),dateTime:Bo({formats:z_,defaultWidth:"full"})},W_={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},V_=(n,t,e,i)=>W_[n];function Cs(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const Y_={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},$_={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},j_={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"]},U_={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"]},q_={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"}},X_={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"}},G_={ordinalNumber:(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Cs({values:Y_,defaultWidth:"wide"}),quarter:Cs({values:$_,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Cs({values:j_,defaultWidth:"wide"}),day:Cs({values:U_,defaultWidth:"wide"}),dayPeriod:Cs({values:q_,defaultWidth:"wide",formattingValues:X_,defaultFormattingWidth:"wide"})};function Es(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?Z_(o,h=>h.test(a)):K_(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function K_(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Z_(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function Q_(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const J_=/^(\d+)(th|st|nd|rd)?/i,tx=/\d+/i,ex={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},nx={any:[/^b/i,/^(a|c)/i]},ix={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sx={any:[/1/i,/2/i,/3/i,/4/i]},rx={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},ax={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},lx={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]},cx={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},ux={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}},dx={ordinalNumber:Q_({matchPattern:J_,parsePattern:tx,valueCallback:n=>parseInt(n,10)}),era:Es({matchPatterns:ex,defaultMatchWidth:"wide",parsePatterns:nx,defaultParseWidth:"any"}),quarter:Es({matchPatterns:ix,defaultMatchWidth:"wide",parsePatterns:sx,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Es({matchPatterns:rx,defaultMatchWidth:"wide",parsePatterns:ax,defaultParseWidth:"any"}),day:Es({matchPatterns:ox,defaultMatchWidth:"wide",parsePatterns:lx,defaultParseWidth:"any"}),dayPeriod:Es({matchPatterns:cx,defaultMatchWidth:"any",parsePatterns:ux,defaultParseWidth:"any"})},Zd={code:"en-US",formatDistance:N_,formatLong:H_,formatRelative:V_,localize:G_,match:dx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hx(n,t){const e=ct(n,t==null?void 0:t.in);return $d(e,Kd(e))+1}function Qd(n,t){const e=ct(n,t==null?void 0:t.in),i=+Mi(e)-+d_(e);return Math.round(i/Wd)+1}function zo(n,t){var u,h,f,m;const e=ct(n,t==null?void 0:t.in),i=e.getFullYear(),s=Gn(),r=(t==null?void 0:t.firstWeekContainsDate)??((h=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(f=s.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,a=Lt((t==null?void 0:t.in)||n,0);a.setFullYear(i+1,0,r),a.setHours(0,0,0,0);const o=je(a,t),l=Lt((t==null?void 0:t.in)||n,0);l.setFullYear(i,0,r),l.setHours(0,0,0,0);const c=je(l,t);return+e>=+o?i+1:+e>=+c?i:i-1}function fx(n,t){var o,l,c,u;const e=Gn(),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)??e.firstWeekContainsDate??((u=(c=e.locale)==null?void 0:c.options)==null?void 0:u.firstWeekContainsDate)??1,s=zo(n,t),r=Lt((t==null?void 0:t.in)||n,0);return r.setFullYear(s,0,i),r.setHours(0,0,0,0),je(r,t)}function Jd(n,t){const e=ct(n,t==null?void 0:t.in),i=+je(e,t)-+fx(e,t);return Math.round(i/Wd)+1}function Tt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const Cn={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Tt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Tt(e+1,2)},d(n,t){return Tt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Tt(n.getHours()%12||12,t.length)},H(n,t){return Tt(n.getHours(),t.length)},m(n,t){return Tt(n.getMinutes(),t.length)},s(n,t){return Tt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Tt(s,t.length)}},Si={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},th={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return Cn.y(n,t)},Y:function(n,t,e,i){const s=zo(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Tt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Tt(r,t.length)},R:function(n,t){const e=Yd(n);return Tt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Tt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Tt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Tt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return Cn.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Tt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Jd(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Tt(s,t.length)},I:function(n,t,e){const i=Qd(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Tt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):Cn.d(n,t)},D:function(n,t,e){const i=hx(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Tt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Tt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Tt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Tt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const s=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Si.noon:i===0?s=Si.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Si.evening:i>=12?s=Si.afternoon:i>=4?s=Si.morning:s=Si.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return Cn.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):Cn.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Tt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):Cn.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):Cn.s(n,t)},S:function(n,t){return Cn.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return nh(i);case"XXXX":case"XX":return Zn(i);case"XXXXX":case"XXX":default:return Zn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return nh(i);case"xxxx":case"xx":return Zn(i);case"xxxxx":case"xxx":default:return Zn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+eh(i,":");case"OOOO":default:return"GMT"+Zn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+eh(i,":");case"zzzz":default:return"GMT"+Zn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Tt(i,t.length)},T:function(n,t,e){return Tt(+n,t.length)}};function eh(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Tt(r,2)}function nh(n,t){return n%60===0?(n>0?"-":"+")+Tt(Math.abs(n)/60,2):Zn(n,t)}function Zn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Tt(Math.trunc(i/60),2),r=Tt(i%60,2);return e+s+t+r}const ih=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},sh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Ho={p:sh,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return ih(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",ih(i,t)).replace("{{time}}",sh(s,t))}},mx=/^D+$/,gx=/^Y+$/,px=["D","DD","YY","YYYY"];function rh(n){return mx.test(n)}function ah(n){return gx.test(n)}function Wo(n,t,e){const i=yx(n,t,e);if(console.warn(i),px.includes(n))throw new RangeError(i)}function yx(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const bx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_x=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,xx=/^'([^]*?)'?$/,wx=/''/g,vx=/[a-zA-Z]/;function jr(n,t,e){var u,h,f,m,p,_,x,v;const i=Gn(),s=(e==null?void 0:e.locale)??i.locale??Zd,r=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.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=(e==null?void 0:e.weekStartsOn)??((_=(p=e==null?void 0:e.locale)==null?void 0:p.options)==null?void 0:_.weekStartsOn)??i.weekStartsOn??((v=(x=i.locale)==null?void 0:x.options)==null?void 0:v.weekStartsOn)??0,o=ct(n,e==null?void 0:e.in);if(!No(o))throw new RangeError("Invalid time value");let l=t.match(_x).map(k=>{const E=k[0];if(E==="p"||E==="P"){const P=Ho[E];return P(k,s.formatLong)}return k}).join("").match(bx).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const E=k[0];if(E==="'")return{isToken:!1,value:Mx(k)};if(th[E])return{isToken:!0,value:k};if(E.match(vx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:k}});s.localize.preprocessor&&(l=s.localize.preprocessor(o,l));const c={firstWeekContainsDate:r,weekStartsOn:a,locale:s};return l.map(k=>{if(!k.isToken)return k.value;const E=k.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&ah(E)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&rh(E))&&Wo(E,t,String(n));const P=th[E[0]];return P(o,E,s.localize,c)}).join("")}function Mx(n){const t=n.match(xx);return t?t[1].replace(wx,"'"):n}function oh(){return Object.assign({},Gn())}function Sx(n,t){const e=ct(n,t==null?void 0:t.in).getDay();return e===0?7:e}function kx(n,t){const e=Tx(t)?new t(0):Lt(t,0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}function Tx(n){var t;return typeof n=="function"&&((t=n.prototype)==null?void 0:t.constructor)===n}const Dx=10;class lh{constructor(){A(this,"subPriority",0)}validate(t,e){return!0}}class Cx extends lh{constructor(t,e,i,s,r){super(),this.value=t,this.validateValue=e,this.setValue=i,this.priority=s,r&&(this.subPriority=r)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,i){return this.setValue(t,e,this.value,i)}}class Ex extends lh{constructor(e,i){super();A(this,"priority",Dx);A(this,"subPriority",-1);this.context=e||(s=>Lt(i,s))}set(e,i){return i.timestampIsSet?e:Lt(e,kx(e,this.context))}}class xt{run(t,e,i,s){const r=this.parse(t,e,i,s);return r?{setter:new Cx(r.value,this.validate,this.set,this.priority,this.subPriority),rest:r.rest}:null}validate(t,e,i){return!0}}class Ox extends xt{constructor(){super(...arguments);A(this,"priority",140);A(this,"incompatibleTokens",["R","u","t","T"])}parse(e,i,s){switch(i){case"G":case"GG":case"GGG":return s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"});case"GGGGG":return s.era(e,{width:"narrow"});case"GGGG":default:return s.era(e,{width:"wide"})||s.era(e,{width:"abbreviated"})||s.era(e,{width:"narrow"})}}set(e,i,s){return i.era=s,e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}const Ht={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}/},Ue={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 Wt(n,t){return n&&{value:t(n.value),rest:n.rest}}function It(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function qe(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const i=e[1]==="+"?1:-1,s=e[2]?parseInt(e[2],10):0,r=e[3]?parseInt(e[3],10):0,a=e[5]?parseInt(e[5],10):0;return{value:i*(s*vi+r*ks+a*l_),rest:t.slice(e[0].length)}}function ch(n){return It(Ht.anyDigitsSigned,n)}function Nt(n,t){switch(n){case 1:return It(Ht.singleDigit,t);case 2:return It(Ht.twoDigits,t);case 3:return It(Ht.threeDigits,t);case 4:return It(Ht.fourDigits,t);default:return It(new RegExp("^\\d{1,"+n+"}"),t)}}function Ur(n,t){switch(n){case 1:return It(Ht.singleDigitSigned,t);case 2:return It(Ht.twoDigitsSigned,t);case 3:return It(Ht.threeDigitsSigned,t);case 4:return It(Ht.fourDigitsSigned,t);default:return It(new RegExp("^-?\\d{1,"+n+"}"),t)}}function Vo(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function uh(n,t){const e=t>0,i=e?t:1-t;let s;if(i<=50)s=n||100;else{const r=i+50,a=Math.trunc(r/100)*100,o=n>=r%100;s=n+a-(o?100:0)}return e?s:1-s}function dh(n){return n%400===0||n%4===0&&n%100!==0}class Px extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="yy"});switch(i){case"y":return Wt(Nt(4,e),r);case"yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s){const r=e.getFullYear();if(s.isTwoDigitYear){const o=uh(s.year,r);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const a=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(a,0,1),e.setHours(0,0,0,0),e}}class Ax extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,i,s){const r=a=>({year:a,isTwoDigitYear:i==="YY"});switch(i){case"Y":return Wt(Nt(4,e),r);case"Yo":return Wt(s.ordinalNumber(e,{unit:"year"}),r);default:return Wt(Nt(i.length,e),r)}}validate(e,i){return i.isTwoDigitYear||i.year>0}set(e,i,s,r){const a=zo(e,r);if(s.isTwoDigitYear){const l=uh(s.year,a);return e.setFullYear(l,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}const o=!("era"in i)||i.era===1?s.year:1-s.year;return e.setFullYear(o,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),je(e,r)}}class Rx extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,i){return Ur(i==="R"?4:i.length,e)}set(e,i,s){const r=Lt(e,0);return r.setFullYear(s,0,4),r.setHours(0,0,0,0),Mi(r)}}class Ix extends xt{constructor(){super(...arguments);A(this,"priority",130);A(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,i){return Ur(i==="u"?4:i.length,e)}set(e,i,s){return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Lx extends xt{constructor(){super(...arguments);A(this,"priority",120);A(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"Q":case"QQ":return Nt(i.length,e);case"Qo":return s.ordinalNumber(e,{unit:"quarter"});case"QQQ":return s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return s.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(e,{width:"wide",context:"formatting"})||s.quarter(e,{width:"abbreviated",context:"formatting"})||s.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class Nx extends xt{constructor(){super(...arguments);A(this,"priority",120);A(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"q":case"qq":return Nt(i.length,e);case"qo":return s.ordinalNumber(e,{unit:"quarter"});case"qqq":return s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return s.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(e,{width:"wide",context:"standalone"})||s.quarter(e,{width:"abbreviated",context:"standalone"})||s.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=1&&i<=4}set(e,i,s){return e.setMonth((s-1)*3,1),e.setHours(0,0,0,0),e}}class Fx extends xt{constructor(){super(...arguments);A(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);A(this,"priority",110)}parse(e,i,s){const r=a=>a-1;switch(i){case"M":return Wt(It(Ht.month,e),r);case"MM":return Wt(Nt(2,e),r);case"Mo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"MMM":return s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return s.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(e,{width:"wide",context:"formatting"})||s.month(e,{width:"abbreviated",context:"formatting"})||s.month(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}class Bx extends xt{constructor(){super(...arguments);A(this,"priority",110);A(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,i,s){const r=a=>a-1;switch(i){case"L":return Wt(It(Ht.month,e),r);case"LL":return Wt(Nt(2,e),r);case"Lo":return Wt(s.ordinalNumber(e,{unit:"month"}),r);case"LLL":return s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return s.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(e,{width:"wide",context:"standalone"})||s.month(e,{width:"abbreviated",context:"standalone"})||s.month(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.setMonth(s,1),e.setHours(0,0,0,0),e}}function zx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Jd(i,e)-t;return i.setDate(i.getDate()-s*7),ct(i,e==null?void 0:e.in)}class Hx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,i,s){switch(i){case"w":return It(Ht.week,e);case"wo":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s,r){return je(zx(e,s,r),r)}}function Wx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Qd(i,e)-t;return i.setDate(i.getDate()-s*7),i}class Vx extends xt{constructor(){super(...arguments);A(this,"priority",100);A(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,i,s){switch(i){case"I":return It(Ht.week,e);case"Io":return s.ordinalNumber(e,{unit:"week"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=53}set(e,i,s){return Mi(Wx(e,s))}}const Yx=[31,28,31,30,31,30,31,31,30,31,30,31],$x=[31,29,31,30,31,30,31,31,30,31,30,31];class jx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subPriority",1);A(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"d":return It(Ht.date,e);case"do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear(),r=dh(s),a=e.getMonth();return r?i>=1&&i<=$x[a]:i>=1&&i<=Yx[a]}set(e,i,s){return e.setDate(s),e.setHours(0,0,0,0),e}}class Ux extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"subpriority",1);A(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,i,s){switch(i){case"D":case"DD":return It(Ht.dayOfYear,e);case"Do":return s.ordinalNumber(e,{unit:"date"});default:return Nt(i.length,e)}}validate(e,i){const s=e.getFullYear();return dh(s)?i>=1&&i<=366:i>=1&&i<=365}set(e,i,s){return e.setMonth(0,s),e.setHours(0,0,0,0),e}}function Yo(n,t,e){var h,f,m,p;const i=Gn(),s=(e==null?void 0:e.weekStartsOn)??((f=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:f.weekStartsOn)??i.weekStartsOn??((p=(m=i.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,r=ct(n,e==null?void 0:e.in),a=r.getDay(),l=(t%7+7)%7,c=7-s,u=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return Yr(r,u,e)}class qx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,i,s){switch(i){case"E":case"EE":case"EEE":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return s.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Yo(e,s,r),e.setHours(0,0,0,0),e}}class Xx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"e":case"ee":return Wt(Nt(i.length,e),a);case"eo":return Wt(s.ordinalNumber(e,{unit:"day"}),a);case"eee":return s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeeee":return s.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Yo(e,s,r),e.setHours(0,0,0,0),e}}class Gx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,i,s,r){const a=o=>{const l=Math.floor((o-1)/7)*7;return(o+r.weekStartsOn+6)%7+l};switch(i){case"c":case"cc":return Wt(Nt(i.length,e),a);case"co":return Wt(s.ordinalNumber(e,{unit:"day"}),a);case"ccc":return s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"ccccc":return s.day(e,{width:"narrow",context:"standalone"});case"cccccc":return s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return s.day(e,{width:"wide",context:"standalone"})||s.day(e,{width:"abbreviated",context:"standalone"})||s.day(e,{width:"short",context:"standalone"})||s.day(e,{width:"narrow",context:"standalone"})}}validate(e,i){return i>=0&&i<=6}set(e,i,s,r){return e=Yo(e,s,r),e.setHours(0,0,0,0),e}}function Kx(n,t,e){const i=ct(n,e==null?void 0:e.in),s=Sx(i,e),r=t-s;return Yr(i,r,e)}class Zx extends xt{constructor(){super(...arguments);A(this,"priority",90);A(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,i,s){const r=a=>a===0?7:a;switch(i){case"i":case"ii":return Nt(i.length,e);case"io":return s.ordinalNumber(e,{unit:"day"});case"iii":return Wt(s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return Wt(s.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return Wt(s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r);case"iiii":default:return Wt(s.day(e,{width:"wide",context:"formatting"})||s.day(e,{width:"abbreviated",context:"formatting"})||s.day(e,{width:"short",context:"formatting"})||s.day(e,{width:"narrow",context:"formatting"}),r)}}validate(e,i){return i>=1&&i<=7}set(e,i,s){return e=Kx(e,s),e.setHours(0,0,0,0),e}}class Qx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,i,s){switch(i){case"a":case"aa":case"aaa":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Vo(s),0,0,0),e}}class Jx extends xt{constructor(){super(...arguments);A(this,"priority",80);A(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,i,s){switch(i){case"b":case"bb":case"bbb":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Vo(s),0,0,0),e}}class tw extends xt{constructor(){super(...arguments);A(this,"priority",80);A(this,"incompatibleTokens",["a","b","t","T"])}parse(e,i,s){switch(i){case"B":case"BB":case"BBB":return s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return s.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(e,{width:"wide",context:"formatting"})||s.dayPeriod(e,{width:"abbreviated",context:"formatting"})||s.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,i,s){return e.setHours(Vo(s),0,0,0),e}}class ew extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,i,s){switch(i){case"h":return It(Ht.hour12h,e);case"ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=12}set(e,i,s){const r=e.getHours()>=12;return r&&s<12?e.setHours(s+12,0,0,0):!r&&s===12?e.setHours(0,0,0,0):e.setHours(s,0,0,0),e}}class nw extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,i,s){switch(i){case"H":return It(Ht.hour23h,e);case"Ho":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=23}set(e,i,s){return e.setHours(s,0,0,0),e}}class iw extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,i,s){switch(i){case"K":return It(Ht.hour11h,e);case"Ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=11}set(e,i,s){return e.getHours()>=12&&s<12?e.setHours(s+12,0,0,0):e.setHours(s,0,0,0),e}}class sw extends xt{constructor(){super(...arguments);A(this,"priority",70);A(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,i,s){switch(i){case"k":return It(Ht.hour24h,e);case"ko":return s.ordinalNumber(e,{unit:"hour"});default:return Nt(i.length,e)}}validate(e,i){return i>=1&&i<=24}set(e,i,s){const r=s<=24?s%24:s;return e.setHours(r,0,0,0),e}}class rw extends xt{constructor(){super(...arguments);A(this,"priority",60);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"m":return It(Ht.minute,e);case"mo":return s.ordinalNumber(e,{unit:"minute"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setMinutes(s,0,0),e}}class aw extends xt{constructor(){super(...arguments);A(this,"priority",50);A(this,"incompatibleTokens",["t","T"])}parse(e,i,s){switch(i){case"s":return It(Ht.second,e);case"so":return s.ordinalNumber(e,{unit:"second"});default:return Nt(i.length,e)}}validate(e,i){return i>=0&&i<=59}set(e,i,s){return e.setSeconds(s,0),e}}class ow extends xt{constructor(){super(...arguments);A(this,"priority",30);A(this,"incompatibleTokens",["t","T"])}parse(e,i){const s=r=>Math.trunc(r*Math.pow(10,-i.length+3));return Wt(Nt(i.length,e),s)}set(e,i,s){return e.setMilliseconds(s),e}}class lw extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","x"])}parse(e,i){switch(i){case"X":return qe(Ue.basicOptionalMinutes,e);case"XX":return qe(Ue.basic,e);case"XXXX":return qe(Ue.basicOptionalSeconds,e);case"XXXXX":return qe(Ue.extendedOptionalSeconds,e);case"XXX":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-$r(e)-s)}}class cw extends xt{constructor(){super(...arguments);A(this,"priority",10);A(this,"incompatibleTokens",["t","T","X"])}parse(e,i){switch(i){case"x":return qe(Ue.basicOptionalMinutes,e);case"xx":return qe(Ue.basic,e);case"xxxx":return qe(Ue.basicOptionalSeconds,e);case"xxxxx":return qe(Ue.extendedOptionalSeconds,e);case"xxx":default:return qe(Ue.extended,e)}}set(e,i,s){return i.timestampIsSet?e:Lt(e,e.getTime()-$r(e)-s)}}class uw extends xt{constructor(){super(...arguments);A(this,"priority",40);A(this,"incompatibleTokens","*")}parse(e){return ch(e)}set(e,i,s){return[Lt(e,s*1e3),{timestampIsSet:!0}]}}class dw extends xt{constructor(){super(...arguments);A(this,"priority",20);A(this,"incompatibleTokens","*")}parse(e){return ch(e)}set(e,i,s){return[Lt(e,s),{timestampIsSet:!0}]}}const hw={G:new Ox,y:new Px,Y:new Ax,R:new Rx,u:new Ix,Q:new Lx,q:new Nx,M:new Fx,L:new Bx,w:new Hx,I:new Vx,d:new jx,D:new Ux,E:new qx,e:new Xx,c:new Gx,i:new Zx,a:new Qx,b:new Jx,B:new tw,h:new ew,H:new nw,K:new iw,k:new sw,m:new rw,s:new aw,S:new ow,X:new lw,x:new cw,t:new uw,T:new dw},fw=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mw=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,gw=/^'([^]*?)'?$/,pw=/''/g,yw=/\S/,bw=/[a-zA-Z]/;function _w(n,t,e,i){var x,v,k,E,P,O,D,S;const s=()=>Lt((i==null?void 0:i.in)||e,NaN),r=oh(),a=(i==null?void 0:i.locale)??r.locale??Zd,o=(i==null?void 0:i.firstWeekContainsDate)??((v=(x=i==null?void 0:i.locale)==null?void 0:x.options)==null?void 0:v.firstWeekContainsDate)??r.firstWeekContainsDate??((E=(k=r.locale)==null?void 0:k.options)==null?void 0:E.firstWeekContainsDate)??1,l=(i==null?void 0:i.weekStartsOn)??((O=(P=i==null?void 0:i.locale)==null?void 0:P.options)==null?void 0:O.weekStartsOn)??r.weekStartsOn??((S=(D=r.locale)==null?void 0:D.options)==null?void 0:S.weekStartsOn)??0;if(!t)return n?s():ct(e,i==null?void 0:i.in);const c={firstWeekContainsDate:o,weekStartsOn:l,locale:a},u=[new Ex(i==null?void 0:i.in,e)],h=t.match(mw).map(g=>{const y=g[0];if(y in Ho){const M=Ho[y];return M(g,a.formatLong)}return g}).join("").match(fw),f=[];for(let g of h){!(i!=null&&i.useAdditionalWeekYearTokens)&&ah(g)&&Wo(g,t,n),!(i!=null&&i.useAdditionalDayOfYearTokens)&&rh(g)&&Wo(g,t,n);const y=g[0],M=hw[y];if(M){const{incompatibleTokens:C}=M;if(Array.isArray(C)){const I=f.find(F=>C.includes(F.token)||F.token===y);if(I)throw new RangeError(`The format string mustn't contain \`${I.fullToken}\` and \`${g}\` at the same time`)}else if(M.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${g}\` and any other token at the same time`);f.push({token:y,fullToken:g});const R=M.run(n,g,a.match,c);if(!R)return s();u.push(R.setter),n=R.rest}else{if(y.match(bw))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");if(g==="''"?g="'":y==="'"&&(g=xw(g)),n.indexOf(g)===0)n=n.slice(g.length);else return s()}}if(n.length>0&&yw.test(n))return s();const m=u.map(g=>g.priority).sort((g,y)=>y-g).filter((g,y,M)=>M.indexOf(g)===y).map(g=>u.filter(y=>y.priority===g).sort((y,M)=>M.subPriority-y.subPriority)).map(g=>g[0]);let p=ct(e,i==null?void 0:i.in);if(isNaN(+p))return s();const _={};for(const g of m){if(!g.validate(p,c))return s();const y=g.set(p,_,c);Array.isArray(y)?(p=y[0],Object.assign(_,y[1])):p=y}return p}function xw(n){return n.match(gw)[1].replace(pw,"'")}function ww(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMinutes(0,0,0),e}function vw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setSeconds(0,0),e}function Mw(n,t){const e=ct(n,t==null?void 0:t.in);return e.setMilliseconds(0),e}function Sw(n){const t=n/vi;return Math.trunc(t)}function hh(n,t){const e=()=>Lt(t==null?void 0:t.in,NaN),i=(t==null?void 0:t.additionalDigits)??2,s=Cw(n);let r;if(s.date){const c=Ew(s.date,i);r=Ow(c.restDateString,c.year)}if(!r||isNaN(+r))return e();const a=+r;let o=0,l;if(s.time&&(o=Pw(s.time),isNaN(o)))return e();if(s.timezone){if(l=Aw(s.timezone),isNaN(l))return e()}else{const c=new Date(a+o),u=ct(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 ct(a+o+l,t==null?void 0:t.in)}const qr={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},kw=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tw=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Dw=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Cw(n){const t={},e=n.split(qr.dateTimeDelimiter);let i;if(e.length>2)return t;if(/:/.test(e[0])?i=e[0]:(t.date=e[0],i=e[1],qr.timeZoneDelimiter.test(t.date)&&(t.date=n.split(qr.timeZoneDelimiter)[0],i=n.substr(t.date.length,n.length))),i){const s=qr.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Ew(n,t){const e=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=n.match(e);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,r=i[2]?parseInt(i[2]):null;return{year:r===null?s:r*100,restDateString:n.slice((i[1]||i[2]).length)}}function Ow(n,t){if(t===null)return new Date(NaN);const e=n.match(kw);if(!e)return new Date(NaN);const i=!!e[4],s=Os(e[1]),r=Os(e[2])-1,a=Os(e[3]),o=Os(e[4]),l=Os(e[5])-1;if(i)return Fw(t,o,l)?Rw(t,o,l):new Date(NaN);{const c=new Date(0);return!Lw(t,r,a)||!Nw(t,s)?new Date(NaN):(c.setUTCFullYear(t,r,Math.max(s,a)),c)}}function Os(n){return n?parseInt(n):1}function Pw(n){const t=n.match(Tw);if(!t)return NaN;const e=$o(t[1]),i=$o(t[2]),s=$o(t[3]);return Bw(e,i,s)?e*vi+i*ks+s*1e3:NaN}function $o(n){return n&&parseFloat(n.replace(",","."))||0}function Aw(n){if(n==="Z")return 0;const t=n.match(Dw);if(!t)return 0;const e=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return zw(i,s)?e*(i*vi+s*ks):NaN}function Rw(n,t,e){const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=(t-1)*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const Iw=[31,null,31,30,31,30,31,31,30,31,30,31];function fh(n){return n%400===0||n%4===0&&n%100!==0}function Lw(n,t,e){return t>=0&&t<=11&&e>=1&&e<=(Iw[t]||(fh(n)?29:28))}function Nw(n,t){return t>=1&&t<=(fh(n)?366:365)}function Fw(n,t,e){return t>=1&&t<=53&&e>=0&&e<=6}function Bw(n,t,e){return n===24?t===0&&e===0:e>=0&&e<60&&t>=0&&t<60&&n>=0&&n<25}function zw(n,t){return t>=0&&t<=59}var Hw=Object.defineProperty,Ww=(n,t,e)=>t in n?Hw(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e,Pe=(n,t,e)=>Ww(n,typeof t!="symbol"?t+"":t,e);const Vw=1e3;var tt=(n=>(n.FIFTEEN_MIN="15m",n.ONE_HOUR="1h",n.SIX_HOUR="6h",n.TWELVE_HOUR="12h",n.ONE_DAY="24h",n.SEVEN_DAY="7d",n.THIRTY_DAY="30d",n.NINETY_DAY="90d",n.ONE_HUNDRED_EIGHTY_DAY="180d",n.ONE_YEAR="365d",n.CURRENT_WEEK="current_week",n.CURRENT_MONTH="current_month",n.CURRENT_QUARTER="current_quarter",n.CURRENT_YEAR="current_year",n.PREVIOUS_WEEK="previous_week",n.PREVIOUS_MONTH="previous_month",n.PREVIOUS_QUARTER="previous_quarter",n.PREVIOUS_YEAR="previous_year",n))(tt||{});const Yw=["in","not_in","selector"],$w=["empty","not_empty"],jw=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Qn=n=>n.filter(t=>t!=="time"),mh=["api","api_package","api_product","api_product_version","control_plane","control_plane_group","data_plane_node","gateway_service","portal","route","status_code","status_code_grouped","time"],gh=Qn(mh),Uw=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],jo=[...mh,"application","consumer","country_code","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api"],ph=Qn(jo),yh=[...Uw,"response_latency_p99","response_latency_p95","response_latency_p50","upstream_latency_p99","upstream_latency_p95","upstream_latency_p50","upstream_latency_average","kong_latency_p99","kong_latency_p95","kong_latency_p50","kong_latency_average","response_size_p99","response_size_p95","response_size_p50","response_size_average","response_size_sum","request_size_p99","request_size_p95","request_size_p50","request_size_average","request_size_sum"],qw=["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"],bh=Qn(qw);Qn(["a2a_context_id","a2a_error","a2a_method","a2a_task_id","api","api_package","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","mcp_error","mcp_method","mcp_session_id","mcp_tool_name","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"]),Qn(["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"]);const Xw=[...jo,"mcp_session_id","mcp_method","mcp_tool_name","mcp_error"],Gw=Qn(Xw);[...yh],new Set(gh),new Set(ph),new Set(bh),new Set(Gw);const Kw=[...jo,"a2a_context_id","a2a_error","a2a_method","a2a_task_id","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],Zw=Qn(Kw);[...yh];const _h=[{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"}];_h.map(n=>n.code),(n=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:Yw},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...n?{enum:n}:{}},operator:{type:"string",enum:$w}},required:["field","operator"],additionalProperties:!1}]}}))([...new Set([...ph,...gh,...bh,...Zw])]);const Qw={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"}},Jw=(n,t,e)=>{let i;const s=Qw[n];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+i:i+" ago":i};function Uo(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const tv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ev={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iv={date:Uo({formats:tv,defaultWidth:"full"}),time:Uo({formats:ev,defaultWidth:"full"}),dateTime:Uo({formats:nv,defaultWidth:"full"})},sv={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},rv=(n,t,e,i)=>sv[n];function Ps(n){return(t,e)=>{const i=e!=null&&e.context?String(e.context):"standalone";let s;if(i==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,o=e!=null&&e.width?String(e.width):a;s=n.formattingValues[o]||n.formattingValues[a]}else{const a=n.defaultWidth,o=e!=null&&e.width?String(e.width):n.defaultWidth;s=n.values[o]||n.values[a]}const r=n.argumentCallback?n.argumentCallback(t):t;return s[r]}}const av={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ov={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lv={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"]},cv={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"]},uv={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"}},dv={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"}},hv=(n,t)=>{const e=Number(n),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},fv={ordinalNumber:hv,era:Ps({values:av,defaultWidth:"wide"}),quarter:Ps({values:ov,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Ps({values:lv,defaultWidth:"wide"}),day:Ps({values:cv,defaultWidth:"wide"}),dayPeriod:Ps({values:uv,defaultWidth:"wide",formattingValues:dv,defaultFormattingWidth:"wide"})};function As(n){return(t,e={})=>{const i=e.width,s=i&&n.matchPatterns[i]||n.matchPatterns[n.defaultMatchWidth],r=t.match(s);if(!r)return null;const a=r[0],o=i&&n.parsePatterns[i]||n.parsePatterns[n.defaultParseWidth],l=Array.isArray(o)?gv(o,h=>h.test(a)):mv(o,h=>h.test(a));let c;c=n.valueCallback?n.valueCallback(l):l,c=e.valueCallback?e.valueCallback(c):c;const u=t.slice(a.length);return{value:c,rest:u}}}function mv(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function gv(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function pv(n){return(t,e={})=>{const i=t.match(n.matchPattern);if(!i)return null;const s=i[0],r=t.match(n.parsePattern);if(!r)return null;let a=n.valueCallback?n.valueCallback(r[0]):r[0];a=e.valueCallback?e.valueCallback(a):a;const o=t.slice(s.length);return{value:a,rest:o}}}const yv=/^(\d+)(th|st|nd|rd)?/i,bv=/\d+/i,_v={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},xv={any:[/^b/i,/^(a|c)/i]},wv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vv={any:[/1/i,/2/i,/3/i,/4/i]},Mv={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},Sv={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]},kv={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},Tv={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]},Dv={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},Cv={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}},Ev={ordinalNumber:pv({matchPattern:yv,parsePattern:bv,valueCallback:n=>parseInt(n,10)}),era:As({matchPatterns:_v,defaultMatchWidth:"wide",parsePatterns:xv,defaultParseWidth:"any"}),quarter:As({matchPatterns:wv,defaultMatchWidth:"wide",parsePatterns:vv,defaultParseWidth:"any",valueCallback:n=>n+1}),month:As({matchPatterns:Mv,defaultMatchWidth:"wide",parsePatterns:Sv,defaultParseWidth:"any"}),day:As({matchPatterns:kv,defaultMatchWidth:"wide",parsePatterns:Tv,defaultParseWidth:"any"}),dayPeriod:As({matchPatterns:Dv,defaultMatchWidth:"any",parsePatterns:Cv,defaultParseWidth:"any"})},Ov={code:"en-US",formatDistance:Jw,formatLong:iv,formatRelative:rv,localize:fv,match:Ev,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Pv={};function Rs(){return Pv}const xh=6048e5,Av=864e5,Rv=60,Iv=3600,wh=Symbol.for("constructDateFrom");function Ae(n,t){return typeof n=="function"?n(t):n&&typeof n=="object"&&wh in n?n[wh](t):n instanceof Date?new n.constructor(t):new Date(t)}function oe(n,t){return Ae(t||n,n)}function vh(n){const t=oe(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Lv(n,...t){const e=Ae.bind(null,t.find(i=>typeof i=="object"));return t.map(e)}function ki(n,t){const e=oe(n,void 0);return e.setHours(0,0,0,0),e}function Nv(n,t,e){const[i,s]=Lv(void 0,n,t),r=ki(i),a=ki(s),o=+r-vh(r),l=+a-vh(a);return Math.round((o-l)/Av)}function Fv(n,t){const e=oe(n,void 0);return e.setFullYear(e.getFullYear(),0,1),e.setHours(0,0,0,0),e}function Bv(n,t){const e=oe(n,void 0);return Nv(e,Fv(e))+1}function an(n,t){var e,i,s,r;const a=Rs(),o=(t==null?void 0:t.weekStartsOn)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.weekStartsOn)??a.weekStartsOn??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.weekStartsOn)??0,l=oe(n,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 Xr(n,t){return an(n,{...t,weekStartsOn:1})}function Mh(n,t){const e=oe(n,void 0),i=e.getFullYear(),s=Ae(e,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const r=Xr(s),a=Ae(e,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const o=Xr(a);return e.getTime()>=r.getTime()?i+1:e.getTime()>=o.getTime()?i:i-1}function zv(n,t){const e=Mh(n),i=Ae(n,0);return i.setFullYear(e,0,4),i.setHours(0,0,0,0),Xr(i)}function Hv(n,t){const e=oe(n,void 0),i=+Xr(e)-+zv(e);return Math.round(i/xh)+1}function Sh(n,t){var e,i,s,r;const a=oe(n,t==null?void 0:t.in),o=a.getFullYear(),l=Rs(),c=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??l.firstWeekContainsDate??((r=(s=l.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,u=Ae((t==null?void 0:t.in)||n,0);u.setFullYear(o+1,0,c),u.setHours(0,0,0,0);const h=an(u,t),f=Ae((t==null?void 0:t.in)||n,0);f.setFullYear(o,0,c),f.setHours(0,0,0,0);const m=an(f,t);return+a>=+h?o+1:+a>=+m?o:o-1}function Wv(n,t){var e,i,s,r;const a=Rs(),o=(t==null?void 0:t.firstWeekContainsDate)??((i=(e=t==null?void 0:t.locale)==null?void 0:e.options)==null?void 0:i.firstWeekContainsDate)??a.firstWeekContainsDate??((r=(s=a.locale)==null?void 0:s.options)==null?void 0:r.firstWeekContainsDate)??1,l=Sh(n,t),c=Ae((t==null?void 0:t.in)||n,0);return c.setFullYear(l,0,o),c.setHours(0,0,0,0),an(c,t)}function Vv(n,t){const e=oe(n,t==null?void 0:t.in),i=+an(e,t)-+Wv(e,t);return Math.round(i/xh)+1}function Dt(n,t){const e=n<0?"-":"",i=Math.abs(n).toString().padStart(t,"0");return e+i}const En={y(n,t){const e=n.getFullYear(),i=e>0?e:1-e;return Dt(t==="yy"?i%100:i,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Dt(e+1,2)},d(n,t){return Dt(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Dt(n.getHours()%12||12,t.length)},H(n,t){return Dt(n.getHours(),t.length)},m(n,t){return Dt(n.getMinutes(),t.length)},s(n,t){return Dt(n.getSeconds(),t.length)},S(n,t){const e=t.length,i=n.getMilliseconds(),s=Math.trunc(i*Math.pow(10,e-3));return Dt(s,t.length)}},Ti={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},kh={G:function(n,t,e){const i=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(i,{width:"abbreviated"});case"GGGGG":return e.era(i,{width:"narrow"});case"GGGG":default:return e.era(i,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const i=n.getFullYear(),s=i>0?i:1-i;return e.ordinalNumber(s,{unit:"year"})}return En.y(n,t)},Y:function(n,t,e,i){const s=Sh(n,i),r=s>0?s:1-s;if(t==="YY"){const a=r%100;return Dt(a,2)}return t==="Yo"?e.ordinalNumber(r,{unit:"year"}):Dt(r,t.length)},R:function(n,t){const e=Mh(n);return Dt(e,t.length)},u:function(n,t){const e=n.getFullYear();return Dt(e,t.length)},Q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return Dt(i,2);case"Qo":return e.ordinalNumber(i,{unit:"quarter"});case"QQQ":return e.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(i,{width:"wide",context:"formatting"})}},q:function(n,t,e){const i=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return Dt(i,2);case"qo":return e.ordinalNumber(i,{unit:"quarter"});case"qqq":return e.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(i,{width:"wide",context:"standalone"})}},M:function(n,t,e){const i=n.getMonth();switch(t){case"M":case"MM":return En.M(n,t);case"Mo":return e.ordinalNumber(i+1,{unit:"month"});case"MMM":return e.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(i,{width:"wide",context:"formatting"})}},L:function(n,t,e){const i=n.getMonth();switch(t){case"L":return String(i+1);case"LL":return Dt(i+1,2);case"Lo":return e.ordinalNumber(i+1,{unit:"month"});case"LLL":return e.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(i,{width:"wide",context:"standalone"})}},w:function(n,t,e,i){const s=Vv(n,i);return t==="wo"?e.ordinalNumber(s,{unit:"week"}):Dt(s,t.length)},I:function(n,t,e){const i=Hv(n);return t==="Io"?e.ordinalNumber(i,{unit:"week"}):Dt(i,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):En.d(n,t)},D:function(n,t,e){const i=Bv(n);return t==="Do"?e.ordinalNumber(i,{unit:"dayOfYear"}):Dt(i,t.length)},E:function(n,t,e){const i=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(i,{width:"short",context:"formatting"});case"EEEE":default:return e.day(i,{width:"wide",context:"formatting"})}},e:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(r);case"ee":return Dt(r,2);case"eo":return e.ordinalNumber(r,{unit:"day"});case"eee":return e.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(s,{width:"short",context:"formatting"});case"eeee":default:return e.day(s,{width:"wide",context:"formatting"})}},c:function(n,t,e,i){const s=n.getDay(),r=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(r);case"cc":return Dt(r,t.length);case"co":return e.ordinalNumber(r,{unit:"day"});case"ccc":return e.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(s,{width:"narrow",context:"standalone"});case"cccccc":return e.day(s,{width:"short",context:"standalone"});case"cccc":default:return e.day(s,{width:"wide",context:"standalone"})}},i:function(n,t,e){const i=n.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return Dt(s,t.length);case"io":return e.ordinalNumber(s,{unit:"day"});case"iii":return e.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(i,{width:"short",context:"formatting"});case"iiii":default:return e.day(i,{width:"wide",context:"formatting"})}},a:function(n,t,e){const i=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(n,t,e){const i=n.getHours();let s;switch(i===12?s=Ti.noon:i===0?s=Ti.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(n,t,e){const i=n.getHours();let s;switch(i>=17?s=Ti.evening:i>=12?s=Ti.afternoon:i>=4?s=Ti.morning:s=Ti.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let i=n.getHours()%12;return i===0&&(i=12),e.ordinalNumber(i,{unit:"hour"})}return En.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):En.H(n,t)},K:function(n,t,e){const i=n.getHours()%12;return t==="Ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},k:function(n,t,e){let i=n.getHours();return i===0&&(i=24),t==="ko"?e.ordinalNumber(i,{unit:"hour"}):Dt(i,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):En.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):En.s(n,t)},S:function(n,t){return En.S(n,t)},X:function(n,t,e){const i=n.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Dh(i);case"XXXX":case"XX":return Jn(i);case"XXXXX":case"XXX":default:return Jn(i,":")}},x:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"x":return Dh(i);case"xxxx":case"xx":return Jn(i);case"xxxxx":case"xxx":default:return Jn(i,":")}},O:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Th(i,":");case"OOOO":default:return"GMT"+Jn(i,":")}},z:function(n,t,e){const i=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Th(i,":");case"zzzz":default:return"GMT"+Jn(i,":")}},t:function(n,t,e){const i=Math.trunc(+n/1e3);return Dt(i,t.length)},T:function(n,t,e){return Dt(+n,t.length)}};function Th(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.trunc(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Dt(r,2)}function Dh(n,t){return n%60===0?(n>0?"-":"+")+Dt(Math.abs(n)/60,2):Jn(n,t)}function Jn(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Dt(Math.trunc(i/60),2),r=Dt(i%60,2);return e+s+t+r}const Ch=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Eh=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},Yv=(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],i=e[1],s=e[2];if(!s)return Ch(n,t);let r;switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;case"PPPP":default:r=t.dateTime({width:"full"});break}return r.replace("{{date}}",Ch(i,t)).replace("{{time}}",Eh(s,t))},$v={p:Eh,P:Yv},jv=/^D+$/,Uv=/^Y+$/,qv=["D","DD","YY","YYYY"];function Xv(n){return jv.test(n)}function Gv(n){return Uv.test(n)}function Kv(n,t,e){const i=Zv(n,t,e);if(console.warn(i),qv.includes(n))throw new RangeError(i)}function Zv(n,t,e){const i=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${i} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Qv(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function Jv(n){return!(!Qv(n)&&typeof n!="number"||isNaN(+oe(n)))}const t1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,e1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,n1=/^'([^]*?)'?$/,i1=/''/g,s1=/[a-zA-Z]/;function r1(n,t,e){var i,s,r,a,o,l,c,u;const h=Rs(),f=(e==null?void 0:e.locale)??h.locale??Ov,m=(e==null?void 0:e.firstWeekContainsDate)??((s=(i=e==null?void 0:e.locale)==null?void 0:i.options)==null?void 0:s.firstWeekContainsDate)??h.firstWeekContainsDate??((a=(r=h.locale)==null?void 0:r.options)==null?void 0:a.firstWeekContainsDate)??1,p=(e==null?void 0:e.weekStartsOn)??((l=(o=e==null?void 0:e.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,_=oe(n,e==null?void 0:e.in);if(!Jv(_))throw new RangeError("Invalid time value");let x=t.match(e1).map(k=>{const E=k[0];if(E==="p"||E==="P"){const P=$v[E];return P(k,f.formatLong)}return k}).join("").match(t1).map(k=>{if(k==="''")return{isToken:!1,value:"'"};const E=k[0];if(E==="'")return{isToken:!1,value:a1(k)};if(kh[E])return{isToken:!0,value:k};if(E.match(s1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+E+"`");return{isToken:!1,value:k}});f.localize.preprocessor&&(x=f.localize.preprocessor(_,x));const v={firstWeekContainsDate:m,weekStartsOn:p,locale:f};return x.map(k=>{if(!k.isToken)return k.value;const E=k.value;(!(e!=null&&e.useAdditionalWeekYearTokens)&&Gv(E)||!(e!=null&&e.useAdditionalDayOfYearTokens)&&Xv(E))&&Kv(E,t,String(n));const P=kh[E[0]];return P(_,E,f.localize,v)}).join("")}function a1(n){const t=n.match(n1);return t?t[1].replace(i1,"'"):n}function Gr(n,t,e){const i=oe(n,void 0);return isNaN(t)?Ae(n,NaN):(i.setDate(i.getDate()+t),i)}function Oh(n,t,e){const i=oe(n,void 0);if(isNaN(t))return Ae(n,NaN);if(!t)return i;const s=i.getDate(),r=Ae(n,i.getTime());r.setMonth(i.getMonth()+t+1,0);const a=r.getDate();return s>=a?r:(i.setFullYear(r.getFullYear(),r.getMonth(),s),i)}function o1(n,t,e){return Oh(n,t*3)}function Di(n,t){const e=oe(n,void 0),i=e.getMonth(),s=i-i%3;return e.setMonth(s,1),e.setHours(0,0,0,0),e}function Ci(n,t){const e=oe(n,void 0);return e.setDate(1),e.setHours(0,0,0,0),e}function l1(n,t){const e=oe(n,void 0),i=e.getFullYear(),s=e.getMonth(),r=Ae(e,0);return r.setFullYear(i,s+1,0),r.setHours(0,0,0,0),r.getDate()}function c1(){return Object.assign({},Rs())}function Ph(n){return Math.trunc(n*Iv)}function u1(n){const t=n/Rv;return Math.trunc(t)}function Ah(n,t,e){return Oh(n,-1)}function Rh(n,t,e){return o1(n,-1)}function Ih(n,t,e){const i=c1(),s=f1(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?d1(s,t):h1(s,t)}function d1(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function h1(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function f1(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function m1(n,t){const e=_1(t);return"formatToParts"in e?p1(e,n):y1(e,n)}const g1={year:0,month:1,day:2,hour:3,minute:4,second:5};function p1(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=g1[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function y1(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const qo={},Lh=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=Lh==="06/25/2014, 00:00:00"||Lh==="06/25/2014 00:00:00";function _1(n){return qo[n]||(qo[n]=b1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),qo[n]}function Xo(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const Nh=36e5,x1=6e4,Go={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Is(n,t,e){if(!n)return 0;let i=Go.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=Go.timezoneHH.exec(n),i)return s=parseInt(i[1],10),Fh(s)?-(s*Nh):NaN;if(i=Go.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Fh(s,a)?(r=Math.abs(s)*Nh+a*x1,i[1]==="+"?-r:r):NaN}if(M1(n)){t=new Date(t||Date.now());const a=e?t:w1(t),o=Ko(a,n);return-(e?o:v1(t,o,n))}return NaN}function w1(n){return Xo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function Ko(n,t){const e=m1(n,t),i=Xo(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function v1(n,t,e){let i=n.getTime()-t;const s=Ko(new Date(i),e);if(t===s)return t;i-=s-t;const r=Ko(new Date(i),e);return s===r?s:Math.max(s,r)}function Fh(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Bh={};function M1(n){if(Bh[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Bh[n]=!0,!0}catch{return!1}}const S1=60*1e3,k1={X:function(n,t,e){const i=Zo(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return zh(i);case"XXXX":case"XX":return Ei(i);case"XXXXX":case"XXX":default:return Ei(i,":")}},x:function(n,t,e){const i=Zo(e.timeZone,n);switch(t){case"x":return zh(i);case"xxxx":case"xx":return Ei(i);case"xxxxx":case"xxx":default:return Ei(i,":")}},O:function(n,t,e){const i=Zo(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+T1(i,":");case"OOOO":default:return"GMT"+Ei(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return Ih("short",n,e);case"zzzz":default:return Ih("long",n,e)}}};function Zo(n,t){const e=n?Is(n,t,!0)/S1:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function Kr(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Ei(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Kr(Math.floor(i/60),2),r=Kr(Math.floor(i%60),2);return e+s+t+r}function zh(n,t){return n%60===0?(n>0?"-":"+")+Kr(Math.abs(n)/60,2):Ei(n,t)}function T1(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+Kr(r,2)}function Hh(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const Wh=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Qo=36e5,Vh=6e4,D1=2,de={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:Wh};function Zr(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?D1:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=C1(n),{year:s,restDateString:r}=E1(i.date,e),a=O1(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=P1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Is(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=Hh(new Date(o+l)),c=Hh(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function C1(n){const t={};let e=de.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=de.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=de.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function E1(n,t){if(n){const e=de.YYY[t],i=de.YYYYY[t];let s=de.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=de.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function O1(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=de.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,jh(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=de.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return I1(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=de.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return jh(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=de.Www.exec(n),r)return s=parseInt(r[1],10)-1,Uh(s)?Yh(t,s):new Date(NaN);if(r=de.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Uh(s,a)?Yh(t,s,a):new Date(NaN)}return null}function P1(n){let t,e,i=de.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),Jo(t)?t%24*Qo:NaN;if(i=de.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),Jo(t,e)?t%24*Qo+e*Vh:NaN;if(i=de.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Jo(t,e,s)?t%24*Qo+e*Vh+s*1e3:NaN}return null}function Yh(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const A1=[31,28,31,30,31,30,31,31,30,31,30,31],R1=[31,29,31,30,31,30,31,31,30,31,30,31];function $h(n){return n%400===0||n%4===0&&n%100!==0}function jh(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=$h(n);if(i&&e>R1[t]||!i&&e>A1[t])return!1}return!0}function I1(n,t){if(t<1)return!1;const e=$h(n);return!(e&&t>366||!e&&t>365)}function Uh(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function Jo(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const L1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function N1(n,t,e={}){t=String(t);const i=t.match(L1);if(i){const s=Zr(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+k1[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return r1(n,t,e)}function qh(n,t,e){n=Zr(n,e);const i=Is(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Xh(n,t,e,i){return i={...i,timeZone:t,originalDate:n},N1(qh(n,t,{timeZone:i.timeZone}),e,i)}function F1(n,t,e){if(typeof n=="string"&&!n.match(Wh))return Zr(n,{...e,timeZone:t});n=Zr(n,e);const i=Xo(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()).getTime(),s=Is(t,new Date(i));return new Date(i+s)}function B1(n,t){return-Is(n,t)}function Gh(n,t={}){const e=(t==null?void 0:t.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone;let i="MMM dd, yyy hh:mm a";switch(t.format){case"short":i="MMM dd, yyyy";break;case"default":i="MMM dd, yyyy hh:mm a";break;case"full":i="MMM dd, yyyy hh:mm:ss.SSS a";break}return t.includeTZ&&(i+=" (z)"),Xh(n,e,i)}function z1(n,t={}){if(!n)return n;const e=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(n);return Xh(s,e,i)}catch{return console.error("Invalid value passed to formatTime",n),"(invalid date)"}}const H1={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 tl(n){return n&&jw.find(t=>n<=H1[t])||null}var Qr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Jr={exports:{}};Jr.exports,function(n,t){var e=200,i="__lodash_hash_undefined__",s=9007199254740991,r="[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]",p="[object Object]",_="[object Promise]",x="[object RegExp]",v="[object Set]",k="[object String]",E="[object Symbol]",P="[object WeakMap]",O="[object ArrayBuffer]",D="[object DataView]",S="[object Float32Array]",g="[object Float64Array]",y="[object Int8Array]",M="[object Int16Array]",C="[object Int32Array]",R="[object Uint8Array]",I="[object Uint8ClampedArray]",F="[object Uint16Array]",$="[object Uint32Array]",Q=/[\\^$.*+?()[\]{}|]/g,Y=/\w*$/,lt=/^\[object .+?Constructor\]$/,U=/^(?:0|[1-9]\d*)$/,z={};z[r]=z[a]=z[O]=z[D]=z[o]=z[l]=z[S]=z[g]=z[y]=z[M]=z[C]=z[f]=z[m]=z[p]=z[x]=z[v]=z[k]=z[E]=z[R]=z[I]=z[F]=z[$]=!0,z[c]=z[u]=z[P]=!1;var q=typeof Qr=="object"&&Qr&&Qr.Object===Object&&Qr,J=typeof self=="object"&&self&&self.Object===Object&&self,j=q||J||Function("return this")(),yt=t&&!t.nodeType&&t,_t=yt&&!0&&n&&!n.nodeType&&n,V=_t&&_t.exports===yt;function H(w,L){return w.set(L[0],L[1]),w}function X(w,L){return w.add(L),w}function K(w,L){for(var B=-1,et=w?w.length:0;++B<et&&L(w[B],B,w)!==!1;);return w}function Z(w,L){for(var B=-1,et=L.length,Vt=w.length;++B<et;)w[Vt+B]=L[B];return w}function G(w,L,B,et){for(var Vt=-1,Xt=w?w.length:0;++Vt<Xt;)B=L(B,w[Vt],Vt,w);return B}function gt(w,L){for(var B=-1,et=Array(w);++B<w;)et[B]=L(B);return et}function vt(w,L){return w==null?void 0:w[L]}function at(w){var L=!1;if(w!=null&&typeof w.toString!="function")try{L=!!(w+"")}catch{}return L}function bt(w){var L=-1,B=Array(w.size);return w.forEach(function(et,Vt){B[++L]=[Vt,et]}),B}function dt(w,L){return function(B){return w(L(B))}}function jt(w){var L=-1,B=Array(w.size);return w.forEach(function(et){B[++L]=et}),B}var ot=Array.prototype,Mt=Function.prototype,ee=Object.prototype,le=j["__core-js_shared__"],Ut=function(){var w=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||"");return w?"Symbol(src)_1."+w:""}(),Xe=Mt.toString,Et=ee.hasOwnProperty,ne=ee.toString,Ft=RegExp("^"+Xe.call(Et).replace(Q,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qt=V?j.Buffer:void 0,ie=j.Symbol,Ge=j.Uint8Array,oi=dt(Object.getPrototypeOf,Object),Be=Object.create,Bt=ee.propertyIsEnumerable,ve=ot.splice,li=Object.getOwnPropertySymbols,va=qt?qt.isBuffer:void 0,Ma=dt(Object.keys,Object),Zs=Fn(j,"DataView"),ci=Fn(j,"Map"),Qs=Fn(j,"Promise"),ui=Fn(j,"Set"),cn=Fn(j,"WeakMap"),un=Fn(Object,"create"),Js=ce(Zs),tr=ce(ci),di=ce(Qs),Wl=ce(ui),Vl=ce(cn),Sa=ie?ie.prototype:void 0,ka=Sa?Sa.valueOf:void 0;function dn(w){var L=-1,B=w?w.length:0;for(this.clear();++L<B;){var et=w[L];this.set(et[0],et[1])}}function zi(){this.__data__=un?un(null):{}}function er(w){return this.has(w)&&delete this.__data__[w]}function Ta(w){var L=this.__data__;if(un){var B=L[w];return B===i?void 0:B}return Et.call(L,w)?L[w]:void 0}function hn(w){var L=this.__data__;return un?L[w]!==void 0:Et.call(L,w)}function Yl(w,L){var B=this.__data__;return B[w]=un&&L===void 0?i:L,this}dn.prototype.clear=zi,dn.prototype.delete=er,dn.prototype.get=Ta,dn.prototype.has=hn,dn.prototype.set=Yl;function ze(w){var L=-1,B=w?w.length:0;for(this.clear();++L<B;){var et=w[L];this.set(et[0],et[1])}}function $l(){this.__data__=[]}function jl(w){var L=this.__data__,B=Wi(L,w);if(B<0)return!1;var et=L.length-1;return B==et?L.pop():ve.call(L,B,1),!0}function Ul(w){var L=this.__data__,B=Wi(L,w);return B<0?void 0:L[B][1]}function He(w){return Wi(this.__data__,w)>-1}function ql(w,L){var B=this.__data__,et=Wi(B,w);return et<0?B.push([w,L]):B[et][1]=L,this}ze.prototype.clear=$l,ze.prototype.delete=jl,ze.prototype.get=Ul,ze.prototype.has=He,ze.prototype.set=ql;function Ln(w){var L=-1,B=w?w.length:0;for(this.clear();++L<B;){var et=w[L];this.set(et[0],et[1])}}function Xl(){this.__data__={hash:new dn,map:new(ci||ze),string:new dn}}function Gl(w){return $i(this,w).delete(w)}function Kl(w){return $i(this,w).get(w)}function We(w){return $i(this,w).has(w)}function Zl(w,L){return $i(this,w).set(w,L),this}Ln.prototype.clear=Xl,Ln.prototype.delete=Gl,Ln.prototype.get=Kl,Ln.prototype.has=We,Ln.prototype.set=Zl;function Nn(w){this.__data__=new ze(w)}function Ql(){this.__data__=new ze}function Jl(w){return this.__data__.delete(w)}function tc(w){return this.__data__.get(w)}function Hi(w){return this.__data__.has(w)}function ec(w,L){var B=this.__data__;if(B instanceof ze){var et=B.__data__;if(!ci||et.length<e-1)return et.push([w,L]),this;B=this.__data__=new Ln(et)}return B.set(w,L),this}Nn.prototype.clear=Ql,Nn.prototype.delete=Jl,Nn.prototype.get=tc,Nn.prototype.has=Hi,Nn.prototype.set=ec;function nc(w,L){var B=rr(w)||Ui(w)?gt(w.length,String):[],et=B.length,Vt=!!et;for(var Xt in w)Et.call(w,Xt)&&!(Vt&&(Xt=="length"||_c(Xt,et)))&&B.push(Xt);return B}function Ie(w,L,B){var et=w[L];(!(Et.call(w,L)&&sr(et,B))||B===void 0&&!(L in w))&&(w[L]=B)}function Wi(w,L){for(var B=w.length;B--;)if(sr(w[B][0],L))return B;return-1}function ic(w,L){return w&&Da(L,hi(L),w)}function nr(w,L,B,et,Vt,Xt,Me){var Jt;if(et&&(Jt=Xt?et(w,Vt,Xt,Me):et(w)),Jt!==void 0)return Jt;if(!mn(w))return w;var Ia=rr(w);if(Ia){if(Jt=yc(w),!L)return mc(w,Jt)}else{var Bn=Ke(w),La=Bn==u||Bn==h;if(Pa(w))return lc(w,L);if(Bn==p||Bn==r||La&&!Xt){if(at(w))return Xt?w:{};if(Jt=Ea(La?{}:w),!L)return gc(w,ic(Jt,w))}else{if(!z[Bn])return Xt?w:{};Jt=bc(w,Bn,nr,L)}}Me||(Me=new Nn);var Na=Me.get(w);if(Na)return Na;if(Me.set(w,Jt),!Ia)var fi=B?pc(w):hi(w);return K(fi||w,function(or,qi){fi&&(qi=or,or=w[qi]),Ie(Jt,qi,nr(or,L,B,et,qi,w,Me))}),Jt}function sc(w){return mn(w)?Be(w):{}}function rc(w,L,B){var et=L(w);return rr(w)?et:Z(et,B(w))}function ac(w){return ne.call(w)}function Vi(w){if(!mn(w)||xc(w))return!1;var L=ar(w)||at(w)?Ft:lt;return L.test(ce(w))}function oc(w){if(!fn(w))return Ma(w);var L=[];for(var B in Object(w))Et.call(w,B)&&B!="constructor"&&L.push(B);return L}function lc(w,L){if(L)return w.slice();var B=new w.constructor(w.length);return w.copy(B),B}function Yi(w){var L=new w.constructor(w.byteLength);return new Ge(L).set(new Ge(w)),L}function cc(w,L){var B=L?Yi(w.buffer):w.buffer;return new w.constructor(B,w.byteOffset,w.byteLength)}function uc(w,L,B){var et=L?B(bt(w),!0):bt(w);return G(et,H,new w.constructor)}function ir(w){var L=new w.constructor(w.source,Y.exec(w));return L.lastIndex=w.lastIndex,L}function dc(w,L,B){var et=L?B(jt(w),!0):jt(w);return G(et,X,new w.constructor)}function hc(w){return ka?Object(ka.call(w)):{}}function fc(w,L){var B=L?Yi(w.buffer):w.buffer;return new w.constructor(B,w.byteOffset,w.length)}function mc(w,L){var B=-1,et=w.length;for(L||(L=Array(et));++B<et;)L[B]=w[B];return L}function Da(w,L,B,et){B||(B={});for(var Vt=-1,Xt=L.length;++Vt<Xt;){var Me=L[Vt],Jt=void 0;Ie(B,Me,Jt===void 0?w[Me]:Jt)}return B}function gc(w,L){return Da(w,Ca(w),L)}function pc(w){return rc(w,hi,Ca)}function $i(w,L){var B=w.__data__;return ji(L)?B[typeof L=="string"?"string":"hash"]:B.map}function Fn(w,L){var B=vt(w,L);return Vi(B)?B:void 0}var Ca=li?dt(li,Object):Aa,Ke=ac;(Zs&&Ke(new Zs(new ArrayBuffer(1)))!=D||ci&&Ke(new ci)!=f||Qs&&Ke(Qs.resolve())!=_||ui&&Ke(new ui)!=v||cn&&Ke(new cn)!=P)&&(Ke=function(w){var L=ne.call(w),B=L==p?w.constructor:void 0,et=B?ce(B):void 0;if(et)switch(et){case Js:return D;case tr:return f;case di:return _;case Wl:return v;case Vl:return P}return L});function yc(w){var L=w.length,B=w.constructor(L);return L&&typeof w[0]=="string"&&Et.call(w,"index")&&(B.index=w.index,B.input=w.input),B}function Ea(w){return typeof w.constructor=="function"&&!fn(w)?sc(oi(w)):{}}function bc(w,L,B,et){var Vt=w.constructor;switch(L){case O:return Yi(w);case o:case l:return new Vt(+w);case D:return cc(w,et);case S:case g:case y:case M:case C:case R:case I:case F:case $:return fc(w,et);case f:return uc(w,et,B);case m:case k:return new Vt(w);case x:return ir(w);case v:return dc(w,et,B);case E:return hc(w)}}function _c(w,L){return L=L??s,!!L&&(typeof w=="number"||U.test(w))&&w>-1&&w%1==0&&w<L}function ji(w){var L=typeof w;return L=="string"||L=="number"||L=="symbol"||L=="boolean"?w!=="__proto__":w===null}function xc(w){return!!Ut&&Ut in w}function fn(w){var L=w&&w.constructor,B=typeof L=="function"&&L.prototype||ee;return w===B}function ce(w){if(w!=null){try{return Xe.call(w)}catch{}try{return w+""}catch{}}return""}function wc(w){return nr(w,!0,!0)}function sr(w,L){return w===L||w!==w&&L!==L}function Ui(w){return vc(w)&&Et.call(w,"callee")&&(!Bt.call(w,"callee")||ne.call(w)==r)}var rr=Array.isArray;function Oa(w){return w!=null&&Mc(w.length)&&!ar(w)}function vc(w){return gn(w)&&Oa(w)}var Pa=va||Ra;function ar(w){var L=mn(w)?ne.call(w):"";return L==u||L==h}function Mc(w){return typeof w=="number"&&w>-1&&w%1==0&&w<=s}function mn(w){var L=typeof w;return!!w&&(L=="object"||L=="function")}function gn(w){return!!w&&typeof w=="object"}function hi(w){return Oa(w)?nc(w):oc(w)}function Aa(){return[]}function Ra(){return!1}n.exports=wc}(Jr,Jr.exports),Jr.exports;const Re=(n,t)=>new Date(n.getTime()-B1(t,n));class Qt{constructor(t){Pe(this,"timeframeText"),Pe(this,"key"),Pe(this,"display"),Pe(this,"timeframeLength"),Pe(this,"allowedTiers"),Pe(this,"defaultResponseGranularity"),Pe(this,"dataGranularity"),Pe(this,"isRelative"),Pe(this,"fineGrainedDefaultGranularity"),Pe(this,"_startCustom"),Pe(this,"_endCustom"),Pe(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 e=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&e.add("minutely"),i>=2&&i<=7*24&&e.add("hourly"),i>=2*24&&e.add("daily"),i>=2*24*14&&e.add("weekly"),e}cacheKey(){return this.key!=="custom"?this.key:`${this.rawStart().toISOString()}-${this.rawEnd().toISOString()}`}v4Query(t){return this.key==="custom"?{type:"absolute",start:this.rawStart(),end:this.rawEnd(),tz:t}:{type:"relative",time_range:this.key,tz:t}}tzAdjustedDate(t){if(!t)return new Date;const e=F1(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return qh(e,t)}}class W1 extends Qt{rawStart(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*7}}class V1 extends Qt{rawStart(t){let e=Ci(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*31}}class Y1 extends Qt{rawStart(t){let e=Di(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*92}}class $1 extends Qt{rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Re(e,t)),e}maximumTimeframeLength(){return 60*60*24*366}}class j1 extends Qt{rawEnd(t){let e=an(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(e=Re(e,t)),e}rawStart(t){const e=this.tzAdjustedDate(t);let i=an(e.setDate(e.getDate()-7),{weekStartsOn:1});return t&&(i=Re(i,t)),i}}class U1 extends Qt{rawEnd(t){let e=Di(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}rawStart(t){let e=Di(Rh(this.tzAdjustedDate(t)));return t&&(e=Re(e,t)),e}}class q1 extends Qt{rawEnd(t){let e=Ci(this.tzAdjustedDate(t));return t&&(e=Re(e,t)),e}rawStart(t){let e=Ci(Ah(this.tzAdjustedDate(t)));return t&&(e=Re(e,t)),e}}class X1 extends Qt{rawEnd(t){let e=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(e=Re(e,t)),e}rawStart(t){let e=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(e=Re(e,t)),e}}tt.FIFTEEN_MIN,new Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 Qt({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 W1({key:tt.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const n=an(new Date,{weekStartsOn:1});return(ki(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),tt.CURRENT_MONTH,new V1({key:tt.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const n=Ci(new Date);return(ki(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_QUARTER,new Y1({key:tt.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Di(new Date);return(ki(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.CURRENT_YEAR,new $1({key:tt.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1);return(ki(Gr(new Date,1)).getTime()-n.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_WEEK,new j1({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 q1({key:tt.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let n=0;const t=Ci(new Date),e=Ci(Ah(new Date));return t.getTimezoneOffset()!==e.getTimezoneOffset()&&(n=Kh(t,e)),60*60*24*l1(new Date().setMonth(new Date().getMonth()-1))+Ph(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_QUARTER,new U1({key:tt.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const n=Di(new Date),t=Di(Rh(new Date));return(n.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),tt.PREVIOUS_YEAR,new X1({key:tt.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const n=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let e=0;return n.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=Kh(n,t)),60*60*24*(365+(t.getFullYear()%4===0?1:0))+Ph(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function Kh(n,t){return u1(n.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_QUARTER,tt.CURRENT_YEAR,tt.PREVIOUS_WEEK,tt.PREVIOUS_MONTH,tt.PREVIOUS_QUARTER,tt.PREVIOUS_YEAR;const G1=new Map(_h.map(n=>[n.code,{code:n.code,name:n.name}])),el=n=>{var t;return((t=G1.get(n))==null?void 0:t.name)||n},Zh=1e3,K1=1e4,Qh=1e6,Jh=1e9,tf=1e12,ta=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((s,r)=>{r&&r%3===0&&i.push(e),i.push(s)}),i.reverse().join("")},Ls=(n,t,e)=>{const i=n/t,s=e.round?"round":"floor";if(e.decimal===!1)return Math[s](i).toString();let r;e.precision?r=i:r=i<10?Math[s](i*10)/10:Math[s](i);let a=r.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function ea(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const s=t.min10k?K1:Zh;return n<s||t.precision&&t.precision>Math.log10(n)?e=ta(Ls(n,1,t),t):n<Qh?e=`${Ls(n,Zh,t)}k`:n<Jh?e=`${Ls(n,Qh,t)}m`:n<tf?e=`${ta(Ls(n,Jh,t),t)}b`:e=`${ta(Ls(n,tf,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}ea.addCommas=ta;var ef;const Z1=typeof document<"u"&&((ef=document.documentElement)==null?void 0:ef.lang)||"en-US",na=new Intl.NumberFormat(Z1);function ti({i18n:n}){const t=(i,s)=>{if(isNaN(i))return"0 B";const r=s?Math.pow(2,50):1e15,a=s?Math.pow(2,40):1e12,o=s?Math.pow(2,30):1e9,l=s?Math.pow(2,20):1e6,c=s?Math.pow(2,10):1e3;let u;return i>=r?u=n.formatNumber(Number.parseFloat((i/r).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):i>=a?u=n.formatNumber(Number.parseFloat((i/a).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):i>=o?u=n.formatNumber(Number.parseFloat((i/o).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):i>=l?u=n.formatNumber(Number.parseFloat((i/l).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):i>=c?u=n.formatNumber(Number.parseFloat((i/c).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):u=n.formatNumber(Number.parseFloat(i.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),u.replace(/([a-zA-Z]*)$/," $1")},e=(i,s="USD")=>isNaN(i)?s==="USD"?"$0.00":`${i}`:i>=.01||s!=="USD"?n.formatNumber(i,{style:"currency",currency:s}):i<1e-4?"< $0.0001":`$${Number.parseFloat(i.toPrecision(4))}`;return{formatUnit:(i,s,{isBytes1024:r=!1,currency:a="USD",approximate:o=!1,translateUnit:l=c=>c}={})=>{const c=l(s,i);switch(s){case"bytes":return t(i,r);case"usd":return e(i,a);case"ms":case"count/minute":case"token count":case"count":default:return isNaN(i)?`${i}`:o?`${ea(i,{capital:!0})} ${c}`:i>=.01?`${na.format(Number.parseFloat(i.toFixed(2)))} ${c}`:`${Number.parseFloat(i.toPrecision(4))} ${c}`}},formatBytes:t,formatCost:e,formatRange:(i,s,r,{isBytes1024:a=!1,currency:o="USD",approximate:l=!1,translateUnit:c=u=>u}={})=>{const u=c(r,s);switch(r){case"bytes":return`${t(i,a)} - ${t(s,a)}`;case"usd":return`${e(i,o)} - ${e(s,o)}`;case"ms":case"count/minute":case"token count":case"count":default:if(isNaN(i)||isNaN(s))return`${i} - ${s}`;if(l)return`${ea(i,{capital:!0})} - ${ea(s,{capital:!0})} ${u}`}const h=i>=.01?`${na.format(Number.parseFloat(i.toFixed(2)))}`:`${Number.parseFloat(i.toPrecision(4))}`,f=s>=.01?`${na.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`;return`${h} - ${f} ${u}`}}}const ia=n=>["interactive","zoom-interactive"].includes(n),nf=(n,t,e,i)=>{var l,c;const{tooltip:s}=t;if(s.opacity===0&&!ia(n.interactionMode)){n.showTooltip=!1;return}const{i18n:r}=mt.useI18n(),{formatUnit:a}=ti({i18n:r}),o=n.chartTooltipSortFn||((u,h)=>h.rawValue-u.rawValue);if(s.body&&!ia(n.interactionMode)){const u=s.labelColors,h=((c=(l=t.chart.config)==null?void 0:l.options)==null?void 0:c.indexAxis)==="y"?"x":"y",f=s.dataPoints[0].parsed.x??0;n.tooltipContext=i!=null&&i.contextFormatter?i.contextFormatter(f,e):zs({tickValue:new Date(f),granularity:e}),n.tooltipSeries=s.dataPoints.map((m,p)=>{const _=m.parsed[h],x=a(_??0,n.units,{translateUnit:n.translateUnit}),v=m.dataset.label;return{backgroundColor:u[p].backgroundColor,borderColor:u[p].borderColor,label:v,value:x,rawValue:_,isSegmentEmpty:m.dataset.isSegmentEmpty}}).sort(o),n.left=`${s.x}px`,n.top=`${s.y}px`,n.showTooltip=!0}},sf=(n,t)=>{var a,o;const{tooltip:e}=t,{i18n:i}=mt.useI18n(),{formatUnit:s}=ti({i18n:i});if(e.opacity===0&&!ia(n.interactionMode)){n.showTooltip=!1;return}const r=n.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(e.body&&!ia(n.interactionMode)){const l=e.labelColors,c=((o=(a=t.chart.config)==null?void 0:a.options)==null?void 0:o.indexAxis)==="y"?"x":"y",u=["gauge","donut"].includes(n.chartType);u?n.tooltipContext=n.dimensionDisplay||e.dataPoints[0].label:e.chart.data.isMultiDimension?n.tooltipContext=e.dataPoints[0].label:n.tooltipContext=n.dimensionDisplay||"",n.tooltipSeries=e.dataPoints.map((h,f)=>{const m=u?h.parsed:h.parsed[c],p=s(m??0,n.units,{translateUnit:n.translateUnit});let _;return u?_=h.dataset.labels[h.dataIndex]:_=h.dataset.label,{backgroundColor:l[f].backgroundColor,borderColor:l[f].borderColor,label:_,value:p,rawValue:m,isSegmentEmpty:h.dataset.isSegmentEmpty}}).sort(r),n.left=`${e.x}px`,n.top=`${e.y}px`,n.showTooltip=!0}},Q1=n=>n&&n.datasets&&n.datasets.length,J1=n=>Q1(n)&&n.datasets.some(t=>t.data.length),tM=n=>n.datasets.some(t=>t.data[0]&&No(t.data[0].x)),eM=n=>!!J1(n)&&n.datasets.some(t=>t.data.length==1),nM=n=>tM(n)&&n.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),nl=(n,t,e)=>{const s=Math.min(t/1150,1),r=.15,a=1.15,o=n.x??0;return o<e?o+t*r*(1-s):o-t*a*(1-s)},iM=(n,t,e)=>{const r=n.y??0;return r<e?r+t*.15:r-t*.5};function rf(n,t){let e;return(...i)=>{clearTimeout(e),e=window.setTimeout(()=>{n(...i)},t)}}const af=(n,t,e)=>{const i=n.data;return n.options.plugins.legend.labels.generateLabels(n).filter(s=>{var r;return!((r=t==null?void 0:t[s.text])!=null&&r.isThreshold)}).map((s,r)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[r].isSegmentEmpty})).sort(e)},sM=2,of=10,lf=12,sa=10,cf="#6c7489",rM="#d60027",aM="#ad000e",il="#6c7489",uf="#52596e",oM="#007d60",lM="#995c00",cM="#ffc400",Ns="16px",uM="20px",dM="'Inter', Roboto, Helvetica, sans-serif",df={"1XXCount|1XX|1[0-9][0-9]":{solid:"#0072E5",light:"#4DA6FF",description:"Informational"},"SuccessfulRequests|2XXCount|2XX|2[0-9][0-9]|SUCCESS":{solid:"#0BB652",light:"#6FCC83",description:"Success"},"3XXCount|3XX|3[0-9][0-9]":{solid:"#FDC53B",light:"#FFD982",description:"Redirection"},"4XXCount|4XX|4[0-9][0-9]":{solid:"#FE9439",light:"#FFBA81",description:"Client Errors"},"5XXCount|5XX|5[0-9][0-9]":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},"errorCount|FailedRequests|FAILURE":{solid:"#FF4545",light:"#FF8484",description:"Server Errors"},nonStandard:{solid:"#6f7787",light:"#e7e7ec"},standard:{solid:"#1155cb",light:"#8ab3fa"},p99:{solid:"#1356cb",light:"#1356cb"},p95:{solid:"#1fbecd",light:"#1fbecd"},p50:{solid:"#1df97d",light:"#1df97d"},LatencyP99:{solid:"#1356cb",light:"#1356cb"},LatencyP95:{solid:"#1fbecd",light:"#1fbecd"},LatencyP50:{solid:"#1df97d",light:"#1df97d"}},on=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],ra=(n,t)=>(t||on)[n%on.length],hf=(n,t)=>{n[0]==="#"&&(n=n.slice(1));let e=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);e=e-t,i=i-t,s=s-t,e>255?e=255:e<0&&(e=0),i>255?i=255:i<0&&(i=0),s>255?s=255:s<0&&(s=0);const r=e.toString(16).length===1?"0"+e.toString(16):e.toString(16),a=i.toString(16).length===1?"0"+i.toString(16):i.toString(16),o=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return`#${r}${a}${o}`},ff="#6f7787",mf={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"}},hM=n=>{var e;const t=Math.floor(parseInt(n,10)/100)*100;return((e=mf[t])==null?void 0:e.background)||"#fafafa"},fM={SUCCESS:"#6FCC83",FAILURE:"#FF8484"},mM={"4XX":"#FFBA81","5XX":"#FF8484"},gM={LatencyP99:"#1356cb",LatencyP95:"#1fbecd",LatencyP50:"#1df97d"},pM="#dad4c7",gf="#afb7c5",yM=n=>{const t=Object.entries(df).find(([e])=>new RegExp(e).test(n));return t&&t[1]||df.standard},sl=(n,t,e,i)=>{let s;return e?s=gf:Array.isArray(i)?s=ra(n,i):s=i[t],s||ra(n)},aa=n=>{switch(n){case"error":return rM;case"warning":return cM;case"neutral":return cf;default:return cf}},bM={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},_M=2,xM=0,rl=new Map,pf=(n,t)=>{const{i18n:e}=mt.useI18n(),{formatBytes:i}=ti({i18n:e});return t==="bytes"?i(n):t==="count/minute"?n.toFixed(2):na.format(n)},wM=n=>{const e=document.createElement("canvas").getContext("2d"),i=Rt({});return e.font=i.string,e.measureText(n).width},vM=()=>{const n="label_height";if(!rl.has(n)){const t=Rt({});rl.set(n,t.lineHeight)}return rl.get(n)},MM=(n,t)=>t.datasets.reduce((e,i,s)=>n.isDatasetVisible(s)?e+i.data.reduce((r,a)=>isNaN(a)?r:r+a,0):e,0),SM=(n,t)=>t===0?" (0.0%)":` (${(n/t*100).toFixed(1)}%)`,al="#e0e4ea",kM={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"]},Fs=(n,t)=>{let e=1;const i=kM[n],s=new Map;for(const r of t)s.set(r,i[e]),e=e%(i.length-1)+1;return s.set(-1,i[0]),s},yf=new Map([[100,Fs("100",[100,101,102,103])],[200,Fs("200",[200,201,202,203,204,205,206,207,208,226])],[300,Fs("300",[300,301,302,303,304,305,307,308])],[400,Fs("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,Fs("500",[500,501,502,503,504,505,506,507,508,510,511])]]),ol=n=>{const t=parseInt(n,10),e=Math.floor(t/100)*100,i=yf.get(e);return i===void 0?al:i.get(t)??i.get(-1)??al},TM=n=>{const t=ol(n);return{solid:t,light:t}},oa={...Array.from({length:500},(n,t)=>100+t).reduce((n,t)=>(n[`${t}`]=ol(`${t}`),n),{}),____OTHER____:"#DAD4C7","1XX":"#4DA6FF","2XX":"#6FCC83","3XX":"#FFD982","4XX":"#FFBA81","5XX":"#FF8484"};function bf(n,t,e){const i=oh(),s=EM(n,e.timeZone,e.locale??i.locale);return"formatToParts"in s?DM(s,t):CM(s,t)}function DM(n,t){const e=n.formatToParts(t);for(let i=e.length-1;i>=0;--i)if(e[i].type==="timeZoneName")return e[i].value}function CM(n,t){const e=n.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(e);return i?i[0].substr(1):""}function EM(n,t,e){return new Intl.DateTimeFormat(e?[e.code,"en-US"]:void 0,{timeZone:t,timeZoneName:n})}function OM(n,t){const e=LM(t);return"formatToParts"in e?AM(e,n):RM(e,n)}const PM={year:0,month:1,day:2,hour:3,minute:4,second:5};function AM(n,t){try{const e=n.formatToParts(t),i=[];for(let s=0;s<e.length;s++){const r=PM[e[s].type];r!==void 0&&(i[r]=parseInt(e[s].value,10))}return i}catch(e){if(e instanceof RangeError)return[NaN];throw e}}function RM(n,t){const e=n.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(e);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const ll={},_f=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")),IM=_f==="06/25/2014, 00:00:00"||_f==="06/25/2014 00:00:00";function LM(n){return ll[n]||(ll[n]=IM?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),ll[n]}function xf(n,t,e,i,s,r,a){const o=new Date(0);return o.setUTCFullYear(n,t,e),o.setUTCHours(i,s,r,a),o}const wf=36e5,NM=6e4,cl={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ul(n,t,e){if(!n)return 0;let i=cl.timezoneZ.exec(n);if(i)return 0;let s,r;if(i=cl.timezoneHH.exec(n),i)return s=parseInt(i[1],10),vf(s)?-(s*wf):NaN;if(i=cl.timezoneHHMM.exec(n),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return vf(s,a)?(r=Math.abs(s)*wf+a*NM,i[1]==="+"?-r:r):NaN}if(zM(n)){t=new Date(t||Date.now());const a=e?t:FM(t),o=dl(a,n);return-(e?o:BM(t,o,n))}return NaN}function FM(n){return xf(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())}function dl(n,t){const e=OM(n,t),i=xf(e[0],e[1]-1,e[2],e[3]%24,e[4],e[5],0).getTime();let s=n.getTime();const r=s%1e3;return s-=r>=0?r:1e3+r,i-s}function BM(n,t,e){let s=n.getTime()-t;const r=dl(new Date(s),e);if(t===r)return t;s-=r-t;const a=dl(new Date(s),e);return r===a?r:Math.max(r,a)}function vf(n,t){return-23<=n&&n<=23&&(t==null||0<=t&&t<=59)}const Mf={};function zM(n){if(Mf[n])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:n}),Mf[n]=!0,!0}catch{return!1}}const HM=60*1e3,WM={X:function(n,t,e){const i=hl(e.timeZone,n);if(i===0)return"Z";switch(t){case"X":return Sf(i);case"XXXX":case"XX":return Oi(i);case"XXXXX":case"XXX":default:return Oi(i,":")}},x:function(n,t,e){const i=hl(e.timeZone,n);switch(t){case"x":return Sf(i);case"xxxx":case"xx":return Oi(i);case"xxxxx":case"xxx":default:return Oi(i,":")}},O:function(n,t,e){const i=hl(e.timeZone,n);switch(t){case"O":case"OO":case"OOO":return"GMT"+VM(i,":");case"OOOO":default:return"GMT"+Oi(i,":")}},z:function(n,t,e){switch(t){case"z":case"zz":case"zzz":return bf("short",n,e);case"zzzz":default:return bf("long",n,e)}}};function hl(n,t){const e=n?ul(n,t,!0)/HM:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(e))throw new RangeError("Invalid time zone specified: "+n);return e}function la(n,t){const e=n<0?"-":"";let i=Math.abs(n).toString();for(;i.length<t;)i="0"+i;return e+i}function Oi(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=la(Math.floor(i/60),2),r=la(Math.floor(i%60),2);return e+s+t+r}function Sf(n,t){return n%60===0?(n>0?"-":"+")+la(Math.abs(n)/60,2):Oi(n,t)}function VM(n,t=""){const e=n>0?"-":"+",i=Math.abs(n),s=Math.floor(i/60),r=i%60;return r===0?e+String(s):e+String(s)+t+la(r,2)}function kf(n){const t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return t.setUTCFullYear(n.getFullYear()),+n-+t}const YM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,fl=36e5,Tf=6e4,$M=2,he={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:YM};function Df(n,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(n===null)return new Date(NaN);const e=t.additionalDigits==null?$M:Number(t.additionalDigits);if(e!==2&&e!==1&&e!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]")return new Date(n.getTime());if(typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]")return new Date(n);if(Object.prototype.toString.call(n)!=="[object String]")return new Date(NaN);const i=jM(n),{year:s,restDateString:r}=UM(i.date,e),a=qM(r,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const o=a.getTime();let l=0,c;if(i.time&&(l=XM(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=ul(i.timeZone||t.timeZone,new Date(o+l)),isNaN(c))return new Date(NaN)}else c=kf(new Date(o+l)),c=kf(new Date(o+l+c));return new Date(o+l+c)}else return new Date(NaN)}function jM(n){const t={};let e=he.dateTimePattern.exec(n),i;if(e?(t.date=e[1],i=e[3]):(e=he.datePattern.exec(n),e?(t.date=e[1],i=e[2]):(t.date=null,i=n)),i){const s=he.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function UM(n,t){if(n){const e=he.YYY[t],i=he.YYYYY[t];let s=he.YYYY.exec(n)||i.exec(n);if(s){const r=s[1];return{year:parseInt(r,10),restDateString:n.slice(r.length)}}if(s=he.YY.exec(n)||e.exec(n),s){const r=s[1];return{year:parseInt(r,10)*100,restDateString:n.slice(r.length)}}}return{year:null}}function qM(n,t){if(t===null)return null;let e,i,s;if(!n||!n.length)return e=new Date(0),e.setUTCFullYear(t),e;let r=he.MM.exec(n);if(r)return e=new Date(0),i=parseInt(r[1],10)-1,Of(t,i)?(e.setUTCFullYear(t,i),e):new Date(NaN);if(r=he.DDD.exec(n),r){e=new Date(0);const a=parseInt(r[1],10);return ZM(t,a)?(e.setUTCFullYear(t,0,a),e):new Date(NaN)}if(r=he.MMDD.exec(n),r){e=new Date(0),i=parseInt(r[1],10)-1;const a=parseInt(r[2],10);return Of(t,i,a)?(e.setUTCFullYear(t,i,a),e):new Date(NaN)}if(r=he.Www.exec(n),r)return s=parseInt(r[1],10)-1,Pf(s)?Cf(t,s):new Date(NaN);if(r=he.WwwD.exec(n),r){s=parseInt(r[1],10)-1;const a=parseInt(r[2],10)-1;return Pf(s,a)?Cf(t,s,a):new Date(NaN)}return null}function XM(n){let t,e,i=he.HH.exec(n);if(i)return t=parseFloat(i[1].replace(",",".")),ml(t)?t%24*fl:NaN;if(i=he.HHMM.exec(n),i)return t=parseInt(i[1],10),e=parseFloat(i[2].replace(",",".")),ml(t,e)?t%24*fl+e*Tf:NaN;if(i=he.HHMMSS.exec(n),i){t=parseInt(i[1],10),e=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return ml(t,e,s)?t%24*fl+e*Tf+s*1e3:NaN}return null}function Cf(n,t,e){t=t||0,e=e||0;const i=new Date(0);i.setUTCFullYear(n,0,4);const s=i.getUTCDay()||7,r=t*7+e+1-s;return i.setUTCDate(i.getUTCDate()+r),i}const GM=[31,28,31,30,31,30,31,31,30,31,30,31],KM=[31,29,31,30,31,30,31,31,30,31,30,31];function Ef(n){return n%400===0||n%4===0&&n%100!==0}function Of(n,t,e){if(t<0||t>11)return!1;if(e!=null){if(e<1)return!1;const i=Ef(n);if(i&&e>KM[t]||!i&&e>GM[t])return!1}return!0}function ZM(n,t){if(t<1)return!1;const e=Ef(n);return!(e&&t>366||!e&&t>365)}function Pf(n,t){return!(n<0||n>52||t!=null&&(t<0||t>6))}function ml(n,t,e){return!(n<0||n>=25||t!=null&&(t<0||t>=60)||e!=null&&(e<0||e>=60))}const QM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function gl(n,t,e={}){t=String(t);const i=t.match(QM);if(i){const s=Df(e.originalDate||n,e);t=i.reduce(function(r,a){if(a[0]==="'")return r;const o=r.indexOf(a),l=r[o-1]==="'",c=r.replace(a,"'"+WM[a[0]](s,a,e)+"'");return l?c.substring(0,o-1)+c.substring(o+1):c},t)}return jr(n,t,e)}function JM(n,t,e){n=Df(n,e);const i=ul(t,n,!0),s=new Date(n.getTime()-i),r=new Date(0);return r.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),r.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),r}function Bs(n,t,e,i){return i={...i,timeZone:t,originalDate:n},gl(JM(n,t,{timeZone:i.timeZone}),e,i)}const tS=(n,t)=>`${Bs(n,t,"yyyy")} W${Bs(n,t,"II")}`,pl="yyyy-MM-dd h:mm:ss a",yl="h:mm:ss a",ei="yyyy-MM-dd h:mm a",Pi="h:mm a",eS="yyyy-MM-dd",bl="MMM dd, yyyy h:mm:ss a",On="MMM dd, yyyy h:mm a",nS={secondly:n=>n?pl:yl,tenSecondly:n=>n?pl:yl,thirtySecondly:n=>n?pl:yl,minutely:n=>n?ei:Pi,fiveMinutely:n=>n?ei:Pi,tenMinutely:n=>n?ei:Pi,thirtyMinutely:n=>n?ei:Pi,hourly:n=>n?ei:Pi,twoHourly:n=>n?ei:Pi,twelveHourly:()=>ei,daily:()=>eS},iS={secondly:()=>bl,tenSecondly:()=>bl,thirtySecondly:()=>bl,minutely:()=>On,fiveMinutely:()=>On,tenMinutely:()=>On,thirtyMinutely:()=>On,hourly:()=>On,twoHourly:()=>On,twelveHourly:()=>On,daily:()=>On};function Af({tickValue:n,granularity:t,timezone:e,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:r,defaultFormat:a}){const o=e||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return tS(n,o);if(s&&s[t]){const l=s[t](i);return Bs(n,o,l)}if(r&&r[t]){const l=r[t]();return Bs(n,o,l)}return Bs(n,o,a)}const sS=({tickValue:n,granularity:t,dayBoundaryCrossed:e,timezone:i})=>Af({tickValue:n,granularity:t,timezone:i,dayBoundaryCrossed:e,tickMap:nS,defaultFormat:"yyyy-MM-dd h:mm:ss a"}),zs=({tickValue:n,granularity:t,timezone:e})=>Af({tickValue:n,granularity:t,timezone:e,tooltipMap:iS,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),rS=n=>{var e,i,s,r,a;const{i18n:t}=mt.useI18n();return(n==null?void 0:n.status)===403?{status:n.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:(n==null?void 0:n.status)===408?{status:n.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)==="Range not allowed for this tier"?{status:n.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:n.status,type:"other",message:t.t("query_errors.other.message"),details:((a=(r=(s=n.response)==null?void 0:s.data)==null?void 0:r.invalid_parameters)==null?void 0:a.map(o=>o.reason).join(", "))||(n==null?void 0:n.message)}},aS=new Set(["control_plane_count","service_count","route_count","consumer_count","plugin_count","node_count","usd"]),Hs=n=>aS.has(n),oS=new Set(["count","requests","usd","token count"]),Rf=n=>oS.has(n);function lS(n){const e=`barChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};De.positioners[e]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=u.width/2,m=nl(c,h,f),p=c.y,_=c.x<f?"left":"center";return{x:m-n.tooltipState.offsetX,y:p-n.tooltipState.offsetY,xAlign:_}},go.modes.customInteractionMode=function(l,c){const u=Sn(c,l),h=[];return go.evaluateInteractionItems(l,l.options.indexAxis||"x",u,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(u.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&u.x!==null&&f.inXRange(u.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=n.numLabels.value>25?of:lf,r=({chart:l,index:c})=>{var h;const u=l.data;return{size:s,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>sa?c.slice(0,sa)+"...":c):l.getLabelForValue(Number(c)),o=d.computed(()=>{var l,c,u,h,f,m,p,_;return{indexAxis:n.indexAxis,skipNull:!0,scales:{x:{stacked:n.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="y"?!st((l=n.metricAxesTitle)==null?void 0:l.value):!st((c=n.dimensionAxesTitle)==null?void 0:c.value),text:n.indexAxis==="y"?(u=n.metricAxesTitle)==null?void 0:u.value:(h=n.dimensionAxesTitle)==null?void 0:h.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:n.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:r,callback:function(x,v){return a(this,x,v)}},title:{display:n.indexAxis==="x"?!st((f=n.metricAxesTitle)==null?void 0:f.value):!st((m=n.dimensionAxesTitle)==null?void 0:m.value),text:n.indexAxis==="x"?(p=n.metricAxesTitle)==null?void 0:p.value:(_=n.dimensionAxesTitle)==null?void 0:_.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:x=>{sf(n.tooltipState,x)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.getCurrentInstance()&&d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),o}ye.register(...a_);const cS=(n,t)=>{const e=t.datasets.map(s=>s.label),i=n.datasets.map(s=>s.label);return n.datasets.length===t.datasets.length&&e.every((s,r)=>s===i[r])};function uS(n,t,e,i,s){const r=d.shallowRef(null),a=(o,l)=>{if(t.value)return new ye(t.value,{type:n,data:o,plugins:i,options:l})};return d.onMounted(()=>{r.value=a(e.value,s.value)}),d.onBeforeUnmount(()=>{st(r.value)||r.value.destroy()}),d.watch(e,(o,l)=>{if(cS(l,o)&&!st(r.value)){for(const[c,u]of o.datasets.entries())Object.assign(r.value.data.datasets[c],u);r.value.data.labels=o.labels,r.value.update()}else st(r.value)||r.value.destroy(),r.value=a(o,s.value)}),d.watch(t,()=>{st(r.value)||r.value.destroy(),r.value=a(e.value,s.value)}),d.watch(s,(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(r.value)||r.value.destroy(),r.value=a(e.value,o))}),r}const If=1e3,dS=1e4,Lf=1e6,Nf=1e9,Ff=1e12,Ws=(n,t)=>{if(t.separator===!1||n<1e3)return n.toString();const e=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(n).toString().split("").reverse().forEach((r,a)=>{a&&a%3===0&&i.push(e),i.push(r)}),i.reverse().join("")},Ai=(n,t,e)=>{const i=n/t,s=e.round?"round":"floor";if(e.decimal===!1)return Math[s](i).toString();let r;e.precision?r=i:r=i<10?Math[s](i*10)/10:Math[s](i);let a=r.toString();return typeof e.decimal=="string"&&(a=a.replace(".",e.decimal)),a};function Vs(n,t={}){let e;const i=n<0;i&&(n=Math.abs(n)),t.precision&&(n=parseFloat(n.toPrecision(t.precision)));const s=t.min10k?dS:If;return n<s||t.precision&&t.precision>Math.log10(n)?e=Ws(Ai(n,1,t),t):n<Lf?e=`${Ai(n,If,t)}k`:n<Nf?e=`${Ai(n,Lf,t)}m`:n<Ff?e=`${Ws(Ai(n,Nf,t),t)}b`:e=`${Ws(Ai(n,Ff,t),t)}t`,i&&(e=`-${e}`),t.capital&&(e=e.toUpperCase()),t.prefix&&(e=`${t.prefix}${e}`),t.suffix&&(e=`${e}${t.suffix}`),e}Vs.addCommas=Ws;function hS(n,t,e){const{i18n:i}=mt.useI18n(),{formatBytes:s}=ti({i18n:i}),{translateUnit:r}=mt.useTranslatedUnits();return{legendValues:d.computed(()=>n.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(e.value==="bytes")u=s(c);else{const h=r(e.value,c);u=i&&i.t("legend.datapointValueDisplay",{value:Vs(c,{capital:!0}),unit:h})||`${Vs(c,{capital:!0})} ${e.value}`}return{...o,[l.label]:{raw:c,formatted:u,isThreshold:l.isThreshold}}},{}))}}function fS(n){return d.computed(()=>{var s;if(!((s=n.value)!=null&&s.meta))return"";const e=n.value.meta.start,i=n.value.meta.end;return e&&i?`${Gh(new Date(e))} - ${Gh(new Date(i),{includeTZ:!0})}`:""})}function mS(n){const e=`donutChartTooltipPosition-${n.tooltipState.chartID}`,i={enabled:!1,position:e,callbacks:{label:r=>({label:r.dataset.label,value:r.label})}};De.positioners[e]=function(r,a){if(!r.length||a.x===null||a.y===null)return!1;const o=this.chart.canvas.getBoundingClientRect(),l=n.tooltipState.width||this.width,c=o.width/2,u=nl(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:u-n.tooltipState.offsetX,y:h,xAlign:f}};const s=d.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},tooltip:{...i,external:r=>{sf(n.tooltipState,r)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return d.onUnmounted(()=>{De.positioners[e]&&delete De.positioners[e]}),{options:s}}function gS(n){const t=d.computed(()=>{var l,c;return{type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:u=>{const h=new Date(u);return sS({tickValue:h,granularity:n.granularity.value,dayBoundaryCrossed:a.value})}},title:{display:!st((l=n.dimensionAxesTitle)==null?void 0:l.value),text:(c=n.dimensionAxesTitle)==null?void 0:c.value,padding:{top:3},font:{weight:"bold"}},border:{display:!1},stacked:n.stacked.value}}),e=d.computed(()=>{var l,c;return{title:{display:!st((l=n.metricAxesTitle)==null?void 0:l.value),text:(c=n.metricAxesTitle)==null?void 0:c.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:n.stacked.value}}),s=`lineChartTooltipPosition-${n.tooltipState.chartID}`,r={enabled:!1,position:s};De.positioners[s]=function(l,c){if(!l.length||n.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const u=this.chart.canvas.getBoundingClientRect(),h=n.tooltipState.width||this.width,f=n.tooltipState.height||this.height,m=u.width/2,p=u.height/2,_=nl(c,h,m);let x=iM(c,f,p);const v=c.y<p?"top":"bottom",k=c.x<m?"left":"center";return f>u.height&&(x=0),{x:_,y:x,xAlign:k,yAlign:v}};const a=d.computed(()=>{const l=Number(n.timeRangeMs.value),c=new Date,u=new Date(c.getTime()-l);return Sw(l)>24||u.getDate()!==c.getDate()}),o=d.computed(()=>{var l,c;return{hover:{mode:"index",intersect:!1},elements:{point:{radius:(l=n.pointsWithoutHover)!=null&&l.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:e.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:n.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:u=>{nf(n.tooltipState,u,n.granularity.value)}},thresholdPlugin:{threshold:(c=n.threshold)==null?void 0:c.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}});return d.onUnmounted(()=>{De.positioners[s]&&delete De.positioners[s]}),{options:o}}function pS(n){const{isMultiMetric:t,hasDimensions:e,metricNames:i,barSegmentLabels:s,pivotRecords:r,rowLabels:a,colorPalette:o}=n,{i18n:l}=mt.useI18n();return t?i.map(u=>({label:l&&l.te(`chartLabels.${u}`)&&l.t(`chartLabels.${u}`)||u,backgroundColor:ra(i.indexOf(u),on),data:a.map((h,f)=>e?r[`${h.id},${u}`]||0:r[`${f},${u}`]||null)})):Array.from(s).flatMap((u,h)=>{if(!u)return[];const f=sl(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=>r[`${m.id},${u.id}`]||null),isSegmentEmpty:u.id==="empty"}})}function yS(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a}=t.value.meta,o=r&&Object.keys(r),l=a&&a.length>1,c=r&&o&&o.length>0,u=c&&o.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&o||a,f=h[0],m=h.length>1?h[1]:h[0],p=Object.fromEntries(l?s.flatMap(y=>a.map((M,C)=>{const R=y.event[f],I=c?`${R},${M}`:`${C},${M}`,F=y.event[M];return[I,F]})):s.map(y=>{const M=c?`${y.event[f]},${y.event[m]}`:`${f},${m}`,C=y.event[a[0]];return[M,C]})),_=Object.keys(p).reduce((y,M)=>{const[C]=M.split(","),R=p[M];return y[C]?y[C]+=R:y[C]=R,y},{}),x=Object.entries(_).sort(([,y],[,M])=>Number(M)-Number(y)).map(([y])=>y),v=r[f],k=r[m];let E=c&&v&&Object.entries(v).map(([y,M])=>({id:y,name:M.name}))||a.map(y=>({id:y,name:y})),P=c&&k&&Object.entries(k).map(([y,M])=>({id:y,name:M.name}))||a.map(y=>({id:y,name:y}));if(c&&f==="country_code"&&(E=E.map(y=>({...y,name:el(y.id)||y.name}))),c&&m==="country_code"&&(P=P.map(y=>({...y,name:el(y.id)||y.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(E.sort((y,M)=>x.indexOf(y.id)-x.indexOf(M.id)),P.sort((y,M)=>x.indexOf(y.id)-x.indexOf(M.id))),!E||!P)return{labels:[],datasets:[]};const O=pS({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:P,pivotRecords:p,rowLabels:E,colorPalette:n.colorPalette||on}),D=c?E.map(y=>e&&e.te(`chartLabels.${y.name}`)&&e.t(`chartLabels.${y.name}`)||y.name):a.map(y=>e&&e.te(`chartLabels.${y}`)&&e.t(`chartLabels.${y}`)||y),S=E.map(y=>y.id==="empty");return{labels:D,datasets:O,isLabelEmpty:S,isMultiDimension:u}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const bS=(n,t,e=1)=>Array(Math.ceil((t-n)/e)).fill(n).map((i,s)=>i+s*e),_S=n=>{if(typeof n=="string"){const t=+n;if(t)return t;try{return hh(n).getTime()}catch(e){if(e instanceof RangeError)return 0;throw e}}return n},xS=(n,t,e,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),o=Math.floor((n-i)/e)*e+i,l=Math.floor((a-i)/e)*e+i+e;return bS(o,l,e)};function wS(n,t){const{i18n:e}=mt.useI18n();return d.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:r,metric_names:a,start:o,end:l}=t.value.meta,c=new Date(o).getTime(),u=new Date(l).getTime();if(!a)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const h=r&&Object.keys(r)||a,f=h&&h[0],m=r[f];let p=r&&m&&Object.keys(m).map(D=>({id:D,name:m[D].name}))||a.map(D=>({id:D,name:D}));f==="country_code"&&(p=p.map(D=>({...D,name:el(D.id)||D.name})));const _=t.value.meta.granularity_ms;if(typeof _!="number"||isNaN(_)||!isFinite(_)||_===0)return console.error("Invalid step value:",_),{datasets:[],labels:[]};if(!s.length)return{datasets:[],labels:[]};const x=_S(c),v=xS(c,u,_,x,s),k=new Set,E=s!=null&&s.length?s.reduce((D,S)=>{const g=new Date(S.timestamp).valueOf(),y=S.event;for(const M of a)k.add(M),g in D||(D[g]={}),M in D[g]||(D[g][M]={});for(const M of a)p.forEach(C=>{y[f]===C.id||M===C.id?(D[g][M]||(D[g][M]={}),D[g][M][C.name]=Math.round(Number(y[M])*1e3)/1e3):h.length||(D[g][M]||(D[g][M]={}),D[g][M][C.name]=Math.round(Number(y[C.id])*1e3)/1e3)});return D},{}):{},O=[...a.length===1?a.flatMap(D=>p.map(S=>[D,S.name,S.id==="empty"])):p.map(D=>[D.name,D.name,D.id==="empty"])].map(([D,S,g],y)=>{const M=v.map(F=>F in E&&D in E[F]?{x:F,y:E[F][D][S]||0}:{x:F,y:0});let{colorPalette:C,fill:R}=n;st(C)&&(C=on);const I=sl(y,S,g,C);return{rawDimension:S,rawMetric:D,label:e&&e.te(`chartLabels.${S}`)&&e.t(`chartLabels.${S}`)||S,borderColor:I,backgroundColor:I,data:M,total:M.reduce((F,{y:$})=>F+Number($),0),...bM,fill:R,borderWidth:R?xM:_M,isSegmentEmpty:g}});return f==="status_code"||f==="status_code_grouped"?O.sort((D,S)=>(D.label??"")<(S.label??"")?-1:1):O.sort((D,S)=>Number(D.total)<Number(S.total)?-1:1),{datasets:O}}}catch(s){return console.error(s),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const vS=(n,t)=>{d.watch([n,t],(e,i,s)=>{const[r,a]=e;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,r),s(()=>{var o;(o=window._AnalyticsChartDataInternal)==null||o.delete(a)}))},{immediate:!0})};function MS(){const{i18n:n}=mt.useI18n();return{translateUnit:(e,i)=>{const s=i===1,r=`chartUnits.${e}`;return Hs(e)?"":n.te(r)?n.t(r,{plural:s?"":"s"}):e}}}const SS="analytics-query-provider",Bf=2;function kS(){const n=d.inject(SS);return{evaluateFeatureFlag:(e,i)=>n?n.evaluateFeatureFlagFn(e,i):i}}function _l(n){return d.getCurrentScope()?(d.onScopeDispose(n),!0):!1}const zf=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const TS=n=>n!=null,DS=Object.prototype.toString,CS=n=>DS.call(n)==="[object Object]";function ca(n){return Array.isArray(n)?n:[n]}function ES(n){return d.getCurrentInstance()}function OS(n,t={}){if(!d.isRef(n))return d.toRefs(n);const e=Array.isArray(n.value)?Array.from({length:n.value.length}):{};for(const i in n.value)e[i]=d.customRef(()=>({get(){return n.value[i]},set(s){var r;if((r=d.toValue(t.replaceRef))!=null?r:!0)if(Array.isArray(n.value)){const o=[...n.value];o[i]=s,n.value=o}else{const o={...n.value,[i]:s};Object.setPrototypeOf(o,Object.getPrototypeOf(n.value)),n.value=o}else n.value[i]=s}}));return e}function PS(n,t=!0,e){ES()?d.onMounted(n,e):t?n():d.nextTick(n)}function AS(n,t,e){return d.watch(n,t,{...e,immediate:!0})}const ua=zf?window:void 0;function Ri(n){var t;const e=d.toValue(n);return(t=e==null?void 0:e.$el)!=null?t:e}function Ys(...n){const t=[],e=()=>{t.forEach(o=>o()),t.length=0},i=(o,l,c,u)=>(o.addEventListener(l,c,u),()=>o.removeEventListener(l,c,u)),s=d.computed(()=>{const o=ca(d.toValue(n[0])).filter(l=>l!=null);return o.every(l=>typeof l!="string")?o:void 0}),r=AS(()=>{var o,l;return[(l=(o=s.value)==null?void 0:o.map(c=>Ri(c)))!=null?l:[ua].filter(c=>c!=null),ca(d.toValue(s.value?n[1]:n[0])),ca(d.unref(s.value?n[2]:n[1])),d.toValue(s.value?n[3]:n[2])]},([o,l,c,u])=>{if(e(),!(o!=null&&o.length)||!(l!=null&&l.length)||!(c!=null&&c.length))return;const h=CS(u)?{...u}:u;t.push(...o.flatMap(f=>l.flatMap(m=>c.map(p=>i(f,m,p,h)))))},{flush:"post"}),a=()=>{r(),e()};return _l(e),a}function RS(){const n=d.shallowRef(!1),t=d.getCurrentInstance();return t&&d.onMounted(()=>{n.value=!0},t),n}function Hf(n){const t=RS();return d.computed(()=>(t.value,!!n()))}function IS(n,t,e={}){const{window:i=ua,...s}=e;let r;const a=Hf(()=>i&&"MutationObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const f=d.toValue(n),m=ca(f).map(Ri).filter(TS);return new Set(m)}),c=d.watch(l,f=>{o(),a.value&&f.size&&(r=new MutationObserver(t),f.forEach(m=>r.observe(m,s)))},{immediate:!0,flush:"post"}),u=()=>r==null?void 0:r.takeRecords(),h=()=>{c(),o()};return _l(h),{isSupported:a,stop:h,takeRecords:u}}function LS(n,t={}){var e;const{pointerTypes:i,preventDefault:s,stopPropagation:r,exact:a,onMove:o,onEnd:l,onStart:c,initialValue:u,axis:h="both",draggingElement:f=ua,containerElement:m,handle:p=n,buttons:_=[0]}=t,x=d.ref((e=d.toValue(u))!=null?e:{x:0,y:0}),v=d.ref(),k=S=>i?i.includes(S.pointerType):!0,E=S=>{d.toValue(s)&&S.preventDefault(),d.toValue(r)&&S.stopPropagation()},P=S=>{var g;if(!d.toValue(_).includes(S.button)||d.toValue(t.disabled)||!k(S)||d.toValue(a)&&S.target!==d.toValue(n))return;const y=d.toValue(m),M=(g=y==null?void 0:y.getBoundingClientRect)==null?void 0:g.call(y),C=d.toValue(n).getBoundingClientRect(),R={x:S.clientX-(y?C.left-M.left+y.scrollLeft:C.left),y:S.clientY-(y?C.top-M.top+y.scrollTop:C.top)};(c==null?void 0:c(R,S))!==!1&&(v.value=R,E(S))},O=S=>{if(d.toValue(t.disabled)||!k(S)||!v.value)return;const g=d.toValue(m),y=d.toValue(n).getBoundingClientRect();let{x:M,y:C}=x.value;(h==="x"||h==="both")&&(M=S.clientX-v.value.x,g&&(M=Math.min(Math.max(0,M),g.scrollWidth-y.width))),(h==="y"||h==="both")&&(C=S.clientY-v.value.y,g&&(C=Math.min(Math.max(0,C),g.scrollHeight-y.height))),x.value={x:M,y:C},o==null||o(x.value,S),E(S)},D=S=>{d.toValue(t.disabled)||!k(S)||v.value&&(v.value=void 0,l==null||l(x.value,S),E(S))};if(zf){const S=()=>{var g;return{capture:(g=t.capture)!=null?g:!0,passive:!d.toValue(s)}};Ys(p,"pointerdown",P,S),Ys(f,"pointermove",O,S),Ys(f,"pointerup",D,S)}return{...OS(x),position:x,isDragging:d.computed(()=>!!v.value),style:d.computed(()=>`left:${x.value.x}px;top:${x.value.y}px;`)}}function NS(n,t,e={}){const{window:i=ua,...s}=e;let r;const a=Hf(()=>i&&"ResizeObserver"in i),o=()=>{r&&(r.disconnect(),r=void 0)},l=d.computed(()=>{const h=d.toValue(n);return Array.isArray(h)?h.map(f=>Ri(f)):[Ri(h)]}),c=d.watch(l,h=>{if(o(),a.value&&i){r=new ResizeObserver(t);for(const f of h)f&&r.observe(f,s)}},{immediate:!0,flush:"post"}),u=()=>{o(),c()};return _l(u),{isSupported:a,stop:u}}function FS(n,t={}){const{reset:e=!0,windowResize:i=!0,windowScroll:s=!0,immediate:r=!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),p=d.shallowRef(0);function _(){const v=Ri(n);if(!v){e&&(o.value=0,l.value=0,c.value=0,u.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const k=v.getBoundingClientRect();o.value=k.height,l.value=k.bottom,c.value=k.left,u.value=k.right,h.value=k.top,f.value=k.width,m.value=k.x,p.value=k.y}function x(){a==="sync"?_():a==="next-frame"&&requestAnimationFrame(()=>_())}return NS(n,x),d.watch(()=>Ri(n),v=>!v&&x()),IS(n,x,{attributeFilter:["style","class"]}),s&&Ys("scroll",x,{capture:!0,passive:!0}),i&&Ys("resize",x,{passive:!0}),PS(()=>{r&&x()}),{height:o,bottom:l,left:c,right:u,top:h,width:f,x:m,y:p,update:x}}function BS(n,t){const{top:e,left:i}=FS(n),s=d.computed(()=>n.value?`${parseFloat(t.left)+i.value}px`:t.left),r=d.computed(()=>n.value?`${parseFloat(t.top)+e.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:r}}const zS=({bucketCount:n,minStamp:t,maxStamp:e,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=e).sort((l,c)=>l-c),r=[];if(e-t<n-2)return[];const a=(e-t)/n;let o=0;for(let l=0;l<n;l++){const c=t+l*a,u=t+(l+1)*a;let h=0;for(;o<s.length&&s[o]>=c&&s[o]<=u;)h++,o++;r.push([Math.ceil(c),h])}return r},Wf=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),$s=d.ref({}),HS=n=>($s.value[n]||($s.value[n]=Wf()),$s.value[n]),WS=(n,t)=>{const e=$s.value[t];if(!e)return;const i=e.minCounts[n]!==void 0||e.maxCounts[n]!==void 0||e.minStamps[n]!==void 0||e.maxStamps[n]!==void 0||e.renderPoints[n]!==void 0;e&&i&&(delete e.minCounts[n],delete e.maxCounts[n],delete e.minStamps[n],delete e.maxStamps[n],delete e.renderPoints[n],Object.keys(e.minCounts).length||Object.keys(e.maxCounts).length||Object.keys(e.minStamps).length||Object.keys(e.maxStamps).length||Object.keys(e.renderPoints).length||delete $s.value[t])};function VS({chartKey:n,datasets:t,groupKey:e,minStamp:i=void 0,maxStamp:s=void 0,minCount:r=void 0,maxCount:a=void 0,renderPoints:o=void 0,type:l}){const u=e!==void 0&&n!==void 0?HS(e):Wf(),h=n!==void 0?n:"static-chart-key",f=d.computed(()=>t.reduce((M,{timestamps:C})=>[...M,...C],[])),m=d.computed(()=>i||f.value.reduce((M,C)=>M===0?C:Math.min(M,C),0)),p=d.computed(()=>s||f.value.reduce((M,C)=>Math.max(M,C),0));d.watchEffect(()=>{u.minStamps[h]=m.value,u.maxStamps[h]=p.value,o!==void 0&&(u.renderPoints[h]=o)});const _=d.computed(()=>Object.values(u.minStamps).reduce((M,C)=>M===0?C:Math.min(M,C),0)),x=d.computed(()=>Object.values(u.maxStamps).reduce((M,C)=>Math.max(M,C),0)),v=d.computed(()=>{const M=Object.values(u.renderPoints);return M.length===0?24:M.reduce((C,R)=>Math.max(C,R),2)}),k=d.computed(()=>{const M=x.value-_.value;return Math.ceil(M/v.value)}),E=d.computed(()=>t.length>1),P=d.computed(()=>t.map(({timestamps:M,color:C,label:R})=>({data:zS({bucketCount:v.value,minStamp:_.value,maxStamp:x.value,timestamps:M}).map(([$,Q])=>({x:$,y:Q})),label:R,...(l==="sparkline_bar"||E.value)&&C&&{backgroundColor:C},...l!=="sparkline_bar"&&C&&{borderColor:C},...E.value&&l!=="sparkline_bar"&&{fill:!0}}))),O=d.computed(()=>{var R,I;const M=((I=(R=P.value[0])==null?void 0:R.data)==null?void 0:I.length)??0,C=[];for(let F=0;F<M;F++){let $=0;for(let Q=0;Q<P.value.length;Q++)$+=P.value[Q].data[F].y;C.push($)}return C}),D=d.computed(()=>{const M=O.value.reduce((C,R)=>Math.max(C,R),0);return Math.max(M,a??0)}),S=d.computed(()=>{const M=P.value.reduce((I,{data:F})=>[...I,...F.map(({y:$})=>$)],[]),C=M.length?M[0]:0,R=M.reduce((I,F)=>Math.min(I,F),C);return r===void 0?R:Math.min(R,r)});d.watchEffect(()=>{u.maxCounts[h]=D.value,u.minCounts[h]=S.value});const g=d.computed(()=>{const M=Object.values(u.minCounts),C=M.length?M[0]:0;return M.reduce((R,I)=>Math.min(R,I),C)}),y=d.computed(()=>Object.values(u.maxCounts).reduce((M,C)=>Math.max(M,C),0));return d.onUnmounted(()=>{n!==void 0&&e!==void 0&&WS(n,e)}),{syncedMinStamp:_,syncedMaxStamp:x,syncedRenderPoints:v,syncedChartDatasets:P,syncedGroupSizeMs:k,syncedMinCount:g,syncedMaxCount:y}}const mt={useBarChartOptions:lS,useChartJSCommon:uS,useChartLegendValues:hS,useChartSelectedRange:fS,useExploreResultToDatasets:yS,useExploreResultToTimeDataset:wS,useDonutChartOptions:mS,useLineChartOptions:gS,useI18n:ng,useReportChartDataForSynthetics:vS,useTranslatedUnits:MS,useEvaluateFeatureFlag:kS,useTooltipAbsolutePosition:BS,useSparklineSync:VS};var xe=(n=>(n.Hidden="hidden",n.Bottom="bottom",n))(xe||{});/*!
|
|
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 Wf={modes:{point(n,t){return da(n,t,{intersect:!0})},nearest(n,t,e){return VS(n,t,e)},x(n,t,e){return da(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return da(n,t,{intersect:e.intersect,axis:"y"})}}};function xl(n,t,e){return(Wf.modes[e.mode]||Wf.modes.nearest)(n,t,e)}function WS(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function YS(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function da(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):WS(i,t,e.axis))}function VS(n,t,e){let i=Number.POSITIVE_INFINITY;return da(n,t,e).reduce((s,r)=>{const a=r.getCenterPoint(),o=YS(t,a,e.axis),l=gi(t,o);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function ei(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,a=t.y;return{x:r+i*(n.x-r)-s*(n.y-a),y:a+s*(n.x-r)+i*(n.y-a)}}const $S=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ni=.001,ha=(n,t,e)=>Math.min(e,Math.max(t,n)),Yf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function jS(n,t,e){for(const i of Object.keys(n))n[i]=ha(n[i],t,e);return n}function US(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function Vf(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:a,hitTolerance:o}){const l=(a+o)/2,c=n.x>=t-l-ni&&n.x<=i+l+ni,u=n.y>=e-l-ni&&n.y<=s+l+ni;return r==="x"?c:(r==="y"||c)&&u}function $f(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:a}){const o=ei(n,e,Vt(-s));return Vf(o,t,i,{borderWidth:r,hitTolerance:a})}function ii(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function qS(n,t,e,i=!0){const s=e.split(".");let r=0;for(const a of t.split(".")){const o=s[r++];if(parseInt(a,10)<parseInt(o,10))break;if($S(o,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const jf=n=>typeof n=="string"&&n.endsWith("%"),Uf=n=>parseFloat(n)/100,qf=n=>ha(Uf(n),0,1),js=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),XS={box:n=>js(n.centerX,n.centerY),doughnutLabel:n=>js(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>js(n.centerX,n.centerY),line:n=>js(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>js(n.centerX,n.centerY)};function wl(n,t){return t==="start"?0:t==="end"?n:jf(t)?qf(t)*n:n/2}function Pn(n,t,e=!0){return typeof t=="number"?t:jf(t)?(e?qf(t):Uf(t))*n:n}function GS(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function Xf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},a){const o=ft(a),l=t.width+(o?a.width:0)+e,c=t.height+(o?a.height:0)+e,u=vl(i),h=Qf(n.x,l,s,u.x),f=Qf(n.y,c,r,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 vl(n,t="center"){return ft(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}const Gf=(n,t)=>n&&n.autoFit&&t<1;function Kf(n,t){const e=n.font,i=wt(e)?e:[e];return Gf(n,t)?i.map(function(s){const r=Rt(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,Rt(r)}):i.map(s=>Rt(s))}function Zf(n){return n&&(ge(n.xValue)||ge(n.yValue))}function Qf(n,t,e=0,i){return n-wl(t,i)+e}function Ii(n,t,e){const i=e.init;if(i){if(i===!0)return tm(t,e)}else return;return KS(n,t,e)}function Jf(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function tm(n,t){const e=t.type||"line";return XS[e](n)}function KS(n,t,e){const i=St(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return tm(t,e);if(ft(i))return i}const Ml=new Map,ZS=n=>isNaN(n)||n<=0,QS=n=>n.reduce(function(t,e){return t+=e.string,t},"");function fa(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function ma(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Vt(i)),n.translate(-t,-e))}function ln(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Li(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function ga(n,t){const e=t.content;if(fa(e))return{width:Pn(e.width,t.width),height:Pn(e.height,t.height)};const i=Kf(t),s=t.textStrokeWidth,r=wt(e)?e:[e],a=r.join()+QS(i)+s+(n._measureText?"-spriting":"");return Ml.has(a)||Ml.set(a,nk(n,r,i,s)),Ml.get(a)}function em(n,t,e){const{x:i,y:s,width:r,height:a}=t;n.save(),Li(n,e);const o=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),pi(n,{x:i,y:s,w:r,h:a,radius:jS(vn(e.borderRadius),0,Math.min(r,a)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function nm(n,t,e,i){const s=e.content;if(fa(s)){n.save(),n.globalAlpha=rk(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=wt(s)?s:[s],a=Kf(e,i),o=e.color,l=wt(o)?o:[o],c=GS(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,JS(n,e)&&ik(n,{x:c,y:u},r,a),sk(n,{x:c,y:u},r,{fonts:a,colors:l}),n.restore()}function JS(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function tk(n,t,e,i){const{radius:s,options:r}=t,a=r.pointStyle,o=r.rotation;let l=(o||0)*ja;if(fa(a)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}ZS(s)||ek(n,{x:e,y:i,radius:s,rotation:o,style:a,rad:l})}function ek(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:a}){let o,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=mr,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=mr,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(a+Oe)*c,l=Math.sin(a+Oe)*c,n.arc(t-o,e-l,u,a-ut,a-Ot),n.arc(t+l,e-o,u,a-Ot,a),n.arc(t+o,e+l,u,a,a+Ot),n.arc(t-l,e+o,u,a+Ot,a+ut),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}a+=Oe;case"rectRot":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":a+=Oe;case"cross":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),a+=Oe,o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function nk(n,t,e,i){n.save();const s=t.length;let r=0,a=i;for(let o=0;o<s;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];r=Math.max(r,n.measureText(c).width+i),a+=l.lineHeight}return n.restore(),{width:r,height:a}}function ik(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(a,o){const l=s[Math.min(o,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(a,t,e+c/2+r),r+=c}),n.stroke()}function sk(n,{x:t,y:e},i,{fonts:s,colors:r}){let a=0;i.forEach(function(o,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+h/2+a),a+=h,n.fill()})}function rk(n,t){const e=wn(n)?n:t;return wn(e)?ha(e,0,1):1}const im=["left","bottom","top","right"];function ak(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,a=r&&r.display&&dk(t,r);if(!a||fk(t,r,a))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=ok(t,a),{sideStart:u,sideEnd:h}=ck(t,a,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(h.x,h.y);const f=ei({x:e,y:i},t.getCenterPoint(),Vt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function ok(n,t){const{x:e,y:i,x2:s,y2:r}=n,a=lk(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+a,y:i},l={x:o.x,y:r}):(o={x:e,y:i+a},l={x:s,y:o.y}),{separatorStart:o,separatorEnd:l}}function lk(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function ck(n,t,e){const{y:i,width:s,height:r,options:a}=n,o=a.callout.start,l=uk(t,a.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Pn(r,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+Pn(s,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function uk(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function dk(n,t){const e=t.position;return im.includes(e)?e:hk(n,t)}function hk(n,t){const{x:e,y:i,x2:s,y2:r,width:a,height:o,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=n,m={x:u,y:h},p=t.start,b=Pn(a,p),x=Pn(o,p),v=[e,e+b,e+b,s],S=[i+x,r,i,r],D=[];for(let P=0;P<4;P++){const O=ei({x:v[P],y:S[P]},m,Vt(f));D.push({position:im[P],distance:gi(O,{x:l,y:c})})}return D.sort((P,O)=>P.distance-O.distance)[0].position}function fk(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let a=i,o=s;return e==="left"?a+=r:e==="right"?a-=r:e==="top"?o+=r:e==="bottom"&&(o-=r),n.inRange(a,o)}const sm={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Ni(n,t,e){return t=typeof t=="number"?t:n.parse(t),At(t)?n.getPixelForValue(t):e}function si(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(a=>a.axis&&a.axis===s);return r.length?r[0].id:s}function rm(n,t){if(n){const e=n.options.reverse,i=Ni(n,t.min,e?t.end:t.start),s=Ni(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function am(n,t){const{chartArea:e,scales:i}=n,s=i[si(i,t,"xScaleID")],r=i[si(i,t,"yScaleID")];let a=e.width/2,o=e.height/2;return s&&(a=Ni(s,t.xValue,s.left+s.width/2)),r&&(o=Ni(r,t.yValue,r.top+r.height/2)),{x:a,y:o}}function Sl(n,t){const e=n.scales,i=e[si(e,t,"xScaleID")],s=e[si(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:a}=i||n.chartArea,{top:o,bottom:l}=s||n.chartArea;const c=cm(i,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;const u=cm(s,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:r,y:o,x2:a,y2:l,width:a-r,height:l-o,centerX:r+(a-r)/2,centerY:o+(l-o)/2}}function om(n,t){if(!Zf(t)){const e=Sl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:r-i,y:a-i,x2:r+i,y2:a+i,centerX:r,centerY:a,width:s,height:s,radius:i}}return gk(n,t)}function mk(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?pk(s,r,t):yk(e,r,t),r}function lm(n,t){const e=Sl(n,t);return e.initProperties=Ii(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:xk(n,e,t),initProperties:e.initProperties}],e}function gk(n,t){const e=am(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function cm(n,t){const e=rm(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function pk(n,t,e){const i=Ni(n,e.value,NaN),s=Ni(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function yk(n,t,e){for(const i of Object.keys(sm)){const s=n[si(n,e,i)];if(s){const{min:r,max:a,start:o,end:l,startProp:c,endProp:u}=sm[i],h=rm(s,{min:e[r],max:e[a],start:s[o],end:s[l]});t[c]=h.start,t[u]=h.end}}}function bk({properties:n,options:t},e,i,s){const{x:r,x2:a,width:o}=n;return um({start:r,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function _k({properties:n,options:t},e,i,s){const{y:r,y2:a,height:o}=n;return um({start:r,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function um(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:a,end:o},adjust:l}=t,c=i-s-e-a-o-t.size;return e+s/2+l+wl(c,r)}function xk(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=vl(i.position),r=$t(i.padding),a=ga(n.ctx,i),o=bk({properties:t,options:e},a,s,r),l=_k({properties:t,options:e},a,s,r),c=a.width+r.width,u=a.height+r.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 kl=["enter","leave"],Tl=kl.concat("click");function wk(n,t,e){t.listened=Jf(e,Tl,t.listeners),t.moveListened=!1,kl.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||kl.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function vk(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return Mk(n,t,e);case"click":return Sk(n,t,e)}}function Mk(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=xl(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let a=dm(r,"leave",s,i);return dm(r,"enter",i,s)||a}function dm({state:n,event:t},e,i,s){let r;for(const a of i)s.indexOf(a)<0&&(r=hm(a.options[e]||n.listeners[e],a,t)||r);return r}function Sk(n,t,e){const i=n.listeners,s=xl(n.visibleElements,t,e.interaction);let r;for(const a of s)r=hm(a.options.click||i.click,a,t)||r;return r}function hm(n,t,e){return St(n,[t.$context,e])===!0}const pa=["afterDraw","beforeDraw"];function kk(n,t,e){const i=t.visibleElements;t.hooked=Jf(e,pa,t.hooks),t.hooked||i.forEach(s=>{t.hooked||pa.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function fm(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return St(i,[t.$context])}}function Tk(n,t,e){const i=Pk(n.scales,t,e);let s=mm(t,i,"min","suggestedMin");s=mm(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function Dk(n,t){for(const e of n)Ek(e,t)}function mm(n,t,e,i){if(At(t[e])&&!Ck(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Ck(n,t,e){return ge(n[t])||ge(n[e])}function Ek(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=si(t,n,e);i&&!t[i]&&Ok(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Ok(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function Pk(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",a={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===s?gm(o,t,["value","endValue"],a):si(n,o,r)===s&&gm(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function gm(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const a=t.parse(r);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Fi extends Zt{inRange(t,e,i,s){const{x:r,y:a}=ei({x:t,y:e},this.getCenterPoint(s),Vt(-this.options.rotation));return Vf({x:r,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return ii(this,t)}draw(t){t.save(),ma(t,this.getCenterPoint(),this.options.rotation),em(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return lm(t,e)}}Fi.id="boxAnnotation",Fi.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},Fi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Fi.descriptors={label:{_fallback:!0}};class ya extends Zt{inRange(t,e,i,s){return $f({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ii(this,t)}draw(t){const e=this.options;!e.display||!e.content||(Fk(t,this),t.save(),ma(t,this.getCenterPoint(),this.rotation),nm(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=Ak(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:a}=Ik(t,e,i);let o=ga(t.ctx,e);const l=Lk(o,a);Gf(e,l)&&(o={width:o.width*l,height:o.height*l});const{position:c,xAdjust:u,yAdjust:h}=e,f=Xf(r,o,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ii(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}ya.id="doughnutLabelAnnotation",ya.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},ya.defaultRoutes={};function Ak(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof sn&&Rk(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function Rk(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function Ik({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:a}=n,{innerRadius:o,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,h=(s+a)/2+c,f={left:Math.max(u-o,i),right:Math.min(u+o,r),top:Math.max(h-o,s),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,b=o-p,x=m.y>h,v=x?s+p:a-p,S=Nk(v,u,h,b);return{controllerMeta:{_centerX:u,_centerY:h,_radius:b,_counterclockwise:x,...S},point:m,radius:Math.min(o,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function Lk({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function Nk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),a=t*-2,o=Math.pow(t,2)+s-r,l=Math.pow(a,2)-4*o;if(l<=0)return{_startAngle:0,_endAngle:Ct};const c=(-a-Math.sqrt(l))/2,u=(-a+Math.sqrt(l))/2;return{_startAngle:pr({x:t,y:e},{x:c,y:n}).angle,_endAngle:pr({x:t,y:e},{x:u,y:n}).angle}}function Fk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:a,_counterclockwise:o,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,a,o),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Us extends Zt{inRange(t,e,i,s){return $f({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return ii(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),ma(t,this.getCenterPoint(),this.rotation),ak(t,this),em(t,this,e),nm(t,zk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Zf(e))i=am(t,e);else{const{centerX:o,centerY:l}=Sl(t,e);i={x:o,y:l}}const s=$t(e.padding),r=ga(t.ctx,e),a=Xf(i,r,e,s);return{initProperties:Ii(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}Us.id="labelAnnotation",Us.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},Us.defaultRoutes={borderColor:"color"};function zk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,a=$t(s.padding);return{x:n+a.left+r,y:t+a.top+r,width:e-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const Dl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Cl=(n,t,e)=>Dl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,pm=(n,t,e)=>Dl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,qs=n=>n*n,Bk=(n,t,{x:e,y:i,x2:s,y2:r},a)=>a==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},ym=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,El=(n,t,e,i)=>({x:ym(n.x,t.x,e.x,i),y:ym(n.y,t.y,e.y,i)}),bm=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),_m=(n,t,e,i)=>-Math.atan2(bm(n.x,t.x,e.x,i),bm(n.y,t.y,e.y,i))+.5*ut;class Xs extends Zt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,m=l.isPointInStroke(o,h,f)||Ol(this,a,s);return l.restore(),m}const c=qs(r);return Vk(this,a,c,s)||Ol(this,a,s)}return Hk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return ii(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:a,options:o}=this;if(t.save(),!ln(t,o))return t.restore();Li(t,o);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(o.curve&&a)return Zk(t,this,a,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=Sm(this),m=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Pl(t,0,h,c),Pl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=mk(t,e),{x:s,y:r,x2:a,y2:o}=i,l=Wk(i,t.chartArea),c=l?Yk({x:s,y:r},{x:a,y:o},t.chartArea):{x:s,y:r,x2:a,y2:o,width:Math.abs(a-s),height:Math.abs(o-r)};if(c.centerX=(a+s)/2,c.centerY=(o+r)/2,c.initProperties=Ii(t,c,e),e.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Kk(c,e,gi(h,f))}const u=$k(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Xs.id="lineAnnotation";const xm={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};Xs.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},xm),fill:!1,length:12,start:Object.assign({},xm),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({},Us.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},Xs.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Xs.defaultRoutes={borderColor:"color"};function Hk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const a=Bk(t,e,n.getProps(["x","y","x2","y2"],r),i);return Yf(a,s)||Ol(n,{mouseX:t,mouseY:e},r,i)}function Wk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:a,left:o}){return!(n<o&&e<o||n>r&&e>r||t<s&&i<s||t>a&&i>a)}function wm({x:n,y:t},e,{top:i,right:s,bottom:r,left:a}){return n<a&&(t=pm(a,{x:n,y:t},e),n=a),n>s&&(t=pm(s,{x:n,y:t},e),n=s),t<i&&(n=Cl(i,{x:n,y:t},e),t=i),t>r&&(n=Cl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function Yk(n,t,e){const{x:i,y:s}=wm(n,t,e),{x:r,y:a}=wm(t,n,e);return{x:i,y:s,x2:r,y2:a,width:Math.abs(r-i),height:Math.abs(a-s)}}function Vk(n,{mouseX:t,mouseY:e},i=ni,s){const{x:r,y:a,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],s),c=o-r,u=l-a,h=qs(c)+qs(u),f=h===0?-1:((t-r)*c+(e-a)*u)/h;let m,p;return f<0?(m=r,p=a):f>1?(m=o,p=l):(m=r+f*c,p=a+f*u),qs(t-m)+qs(e-p)<=i}function Ol(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function $k(n,t,e){const i=e.borderWidth,s=$t(e.padding),r=ga(n.ctx,e),a=r.width+s.width+i,o=r.height+s.height+i;return Uk(t,e,{width:a,height:o,padding:s},n.chartArea)}function jk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ut/2?r-ut:r<ut/-2?r+ut:r}function Uk(n,t,e,i){const{width:s,height:r,padding:a}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},h=t.rotation==="auto"?jk(n):Vt(t.rotation),f=qk(s,r,h),m=Xk(n,t,{labelSize:f,padding:a},i),p=n.cp?El(c,n.cp,u,m):Dl(c,u,m),b={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},v=Mm(p.x,b)+o,S=Mm(p.y,x)+l;return{x:v-s/2,y:S-r/2,x2:v+s/2,y2:S+r/2,centerX:v,centerY:S,pointX:p.x,pointY:p.y,width:s,height:r,rotation:gr(h)}}function qk(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function Xk(n,t,e,i){let s;const r=Gk(n,i);return t.position==="start"?s=vm({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-vm({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=wl(1,t.position),s}function vm(n,t,e,i){const{labelSize:s,padding:r}=t,a=n.w*i.dx,o=n.h*i.dy,l=a>0&&(s.w/2+r.left-i.x)/a,c=o>0&&(s.h/2+r.top-i.y)/o;return ha(Math.max(l,c),0,.25)}function Gk(n,t){const{x:e,x2:i,y:s,y2:r}=n,a=Math.min(s,r)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(a,l),dx:o<=c?1:-1,dy:a<=l?1:-1}}function Mm(n,t){const{size:e,min:i,max:s,padding:r}=t,a=e/2;return e>s-i?(s+i)/2:(i>=n-r-a&&(n=i+r+a),s<=n+r+a&&(n=s-r-a),n)}function Sm(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:km(n,e),endAdjust:km(n,i)}}function km(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(Cl(0,r,{x:0,y:s}))}function Pl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:a,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Li(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),a===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Kk(n,t,e){const{x:i,y:s,x2:r,y2:a,centerX:o,centerY:l}=n,c=Math.atan2(a-s,r-i),u=vl(t.controlPoint,0),h={x:o+Pn(e,u.x,!1),y:l+Pn(e,u.y,!1)};return ei(h,{x:o,y:l},c)}function Tm(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),Pl(n,0,-s,r),n.restore())}function Zk(n,t,e,i){const{x:s,y:r,x2:a,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=Sm(t),m={x:s,y:r},p={x:a,y:o},b=_m(m,e,p,0),x=_m(m,e,p,1)-ut,v=El(m,e,p,h/i),S=El(m,e,p,1-f/i),D=new Path2D;n.beginPath(),D.moveTo(v.x,v.y),D.quadraticCurveTo(e.x,e.y,S.x,S.y),n.shadowColor=l.borderShadowColor,n.stroke(D),t.path=D,t.ctx=n,Tm(n,v,{angle:b,adjust:h},c),Tm(n,S,{angle:x,adjust:f},u)}class Gs extends Zt{inRange(t,e,i,s){const r=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return Qk({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,a);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:o,end:c},f=ei({x:t,y:e},this.getCenterPoint(s),Vt(-r));return f[i]>=h.start-a-ni&&f[i]<=h.end+a+ni}getCenterPoint(t){return ii(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:a}=this;t.save(),ma(t,this.getCenterPoint(),a.rotation),Li(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=ln(t,a);t.ellipse(s,r,i/2,e/2,ut/2,0,2*ut),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return lm(t,e)}}Gs.id="ellipseAnnotation",Gs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Fi.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},Gs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Gs.descriptors={label:{_fallback:!0}};function Qk(n,t,e,i){const{width:s,height:r,centerX:a,centerY:o}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Vt(e||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(n.x-a)+f*(n.y-o),2),p=Math.pow(f*(n.x-a)-h*(n.y-o),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class ba extends Zt{inRange(t,e,i,s){const{x:r,y:a,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?US({x:t,y:e},this.getCenterPoint(s),c/2,u):Yf(i==="y"?{start:a,end:l,value:e}:{start:r,end:o,value:t},u)}getCenterPoint(t){return ii(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Li(t,e);const s=ln(t,e);tk(t,this,this.centerX,this.centerY),s&&!fa(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=om(t,e);return i.initProperties=Ii(t,i,e),i}}ba.id="pointAnnotation",ba.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},ba.defaultRoutes={borderColor:"color",backgroundColor:"color"};class _a extends Zt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&tT(this.elements,t,e,s);const r=ei({x:t,y:e},this.getCenterPoint(s),Vt(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...a),l=Math.max(...a);return r[i]>=o&&r[i]<=l}getCenterPoint(t){return ii(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Li(t,i);const s=ln(t,i);let r=!0;for(const a of e)r?(t.moveTo(a.x,a.y),r=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=om(t,e),{sides:s,rotation:r}=e,a=[],o=2*ut/s;let l=r*ja;for(let c=0;c<s;c++,l+=o){const u=Jk(i,e,l);u.initProperties=Ii(t,i,e),a.push(u)}return i.elements=a,i}}_a.id="polygonAnnotation",_a.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},_a.defaultRoutes={borderColor:"color",backgroundColor:"color"};function Jk({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const a=(i+s)/2,o=Math.sin(r),l=Math.cos(r),c={x:n+o*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+o*(e+a),bY:t-l*(e+a)}}}function tT(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const o=a.getProps(["bX","bY"],i);o.bY>e!=r.bY>e&&t<(r.bX-o.bX)*(e-o.bY)/(r.bY-o.bY)+o.bX&&(s=!s),r=o}return s}const An={box:Fi,doughnutLabel:ya,ellipse:Gs,label:Us,line:Xs,point:ba,polygon:_a};Object.keys(An).forEach(n=>{Pt.describe(`elements.${An[n].id}`,{_fallback:"plugins.annotation.common"})});const eT={update:Object.assign},nT=Tl.concat(pa),Dm=(n,t)=>ft(t)?Il(n,t):n,Al=n=>n==="color"||n==="font";function Rl(n="line"){return An[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function iT(n,t,e,i){const s=rT(n,e.animations,i),r=t.annotations,a=lT(t.elements,r);for(let o=0;o<r.length;o++){const l=r[o],c=Cm(a,o,l.type),u=l.setContext(oT(n,c,a,l)),h=c.resolveElementProperties(n,u);h.skip=sT(h),"elements"in h&&(aT(c,h.elements,u,s),delete h.elements),ge(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=Em(u),s.update(c,h)}}function sT(n){return isNaN(n.x)||isNaN(n.y)}function rT(n,t,e){return e==="reset"||e==="none"||e==="resize"?eT:new ro(n,t)}function aT(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const a=t[r],o=a.properties,l=Cm(s,r,a.type,a.initProperties),c=e[a.optionScope].override(a);o.options=Em(c),i.update(l,o)}}function Cm(n,t,e,i){const s=An[Rl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Em(n){const t=An[Rl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Il(n,t.defaults),Il(n,t.defaultRoutes));for(const i of nT)e[i]=n[i];return e}function Il(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];Al(i)&&wt(r)?e[i]=r.map(a=>Dm(a,s)):e[i]=Dm(r,s)}return e}function oT(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function lT(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var cT="3.1.0";const Rn=new Map,Om=n=>n.type!=="doughnutLabel",uT=Tl.concat(pa);var Pm={id:"annotation",version:cT,beforeRegister(){qS("chart.js","4.0",ye.version)},afterRegister(){ye.register(An)},afterUnregister(){ye.unregister(An)},beforeInit(n){Rn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Rn.get(n),s=i.annotations=[];let r=e.annotations;ft(r)?Object.keys(r).forEach(a=>{const o=r[a];ft(o)&&(o.id=a,s.push(o))}):wt(r)&&s.push(...r),Dk(s.filter(Om),n.scales)},afterDataLimits(n,t){const e=Rn.get(n);Tk(n,t.scale,e.annotations.filter(Om).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Rn.get(n);wk(n,i,e),iT(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),kk(n,i,e)},beforeDatasetsDraw(n,t,e){Ks(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Ks(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Ks(n,t.index,e.clip)},beforeDraw(n,t,e){Ks(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Ks(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Rn.get(n);vk(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Rn.delete(n)},getAnnotations(n){const t=Rn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return xl(n,t,e)},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:n=>!uT.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${An[Rl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Al,_fallback:!0},_indexable:Al}},additionalOptionScopes:[""]};function Ks(n,t,e){const{ctx:i,chartArea:s}=n,r=Rn.get(n);e&&as(i,s);const a=dT(r.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of a)hT(i,s,r,o);e&&os(i)}function dT(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function hT(n,t,e,i){const s=i.element;i.main?(fm(e,s,"beforeDraw"),s.draw(n,t),fm(e,s,"afterDraw")):s.draw(n,t)}const fT={class:"zoom-timerange-container"},mT={class:"zoom-timerange-details"},gT={class:"label","data-testid":"zoom-timerange-from"},pT={class:"label","data-testid":"zoom-timerange-to"},yT=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.ref(Bs({tickValue:t.start,granularity:t.granularity})),s=d.ref(Bs({tickValue:t.end,granularity:t.granularity})),r=(a,o)=>{rf(()=>{i.value=Bs({tickValue:a,granularity:t.granularity}),s.value=Bs({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{r(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",fT,[d.createElementVNode("div",mT,[d.createElementVNode("div",gT,d.toDisplayString(d.unref(e).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",pT,d.toDisplayString(d.unref(e).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),Ce=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},Am=Ce(yT,[["__scopeId","data-v-4fa681cf"]]),bT={class:"zoom-actions-container"},_T={class:"zoom-actions-heading"},xT={class:"zoom-action-select"},wT=["data-testid"],vT=["aria-disabled","href"],MT=["onClick"],ST=Ce(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,a)=>(d.openBlock(),d.createElementBlock("div",bT,[d.createElementVNode("div",_T,[d.createVNode(Am,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Xi.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(il),size:d.unref(Ns),onClick:a[0]||(a[0]=o=>r.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",xT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.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=>r.$emit("onAction"))},d.toDisplayString(o.label),9,vT)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(o)},d.toDisplayString(o.label),9,MT))],10,wT))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),kT={key:2},TT={class:"tooltip-title"},DT={class:"title"},CT={key:0,class:"subtitle"},ET={class:"context"},OT={class:"metric"},PT={class:"tooltip"},AT={key:0},RT={class:"display-value"},xa=Ce(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(n,{emit:t}){const e=t,i=n,s=d.ref(null),{x:r,y:a,isDragging:o}=RS(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${a.value}px`),c=d.computed(()=>`${r.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,p])=>{o.value||(r.value=parseFloat(m),a.value=parseFloat(p))}),d.watch(o,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:p,height:b}=m.getBoundingClientRect();e("dimensions",{width:p,height:b})}}),(m,p)=>{var b,x;return n.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(d.openBlock(),d.createBlock(Am,{key:0,end:(b=n.zoomTimeRange)==null?void 0:b.end,granularity:n.granularity,start:(x=n.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(d.openBlock(),d.createBlock(ST,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:p[0]||(p[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",kT,[d.createElementVNode("div",TT,[d.createElementVNode("div",DT,[d.createElementVNode("div",null,d.toDisplayString(n.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Xi.DragIcon),{key:0,class:"drag-icon",color:d.unref(il),size:d.unref(Ns)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",CT,[d.createElementVNode("div",ET,d.toDisplayString(u.value),1),d.createElementVNode("div",OT,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",PT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:S,label:D,value:P,isSegmentEmpty:O},C)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:D+C},[n.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",AT,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:String(v),borderColor:String(S)})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:O}])},d.toDisplayString(D),3),d.createElementVNode("span",RT,d.toDisplayString(P),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-b449481c"]]),IT={key:0,class:"legend-container","data-testid":"legend"},LT=["onClick"],NT=["title"],FT={class:"label truncate-label"},zT={key:0,class:"sub-label"},BT={class:"tooltip-content"},Ll=Ce(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.inject("showLegendValues",!1),s=d.inject("legendPosition",d.ref(xe.Bottom)),r=(o=0,l)=>{if(t.chartInstance===null)return;const c=t.chartInstance instanceof ye?t.chartInstance:t.chartInstance.chart;a(o,l)?c.hide(o,l):c.show(o,l),c.update()},a=(o=0,l)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const c=t.chartInstance instanceof ye?t.chartInstance:t.chartInstance.chart,u=c.getDatasetMeta(o);return u.dataset||l===void 0?c.isDatasetVisible(o):!(u.data.length&&u.data[l].hidden)};return(o,l)=>{const c=d.resolveComponent("KTooltip");return d.unref(s)!==d.unref(xe).Hidden?(d.openBlock(),d.createElementBlock("ul",IT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.items,({fillStyle:u,strokeStyle:h,text:f,datasetIndex:m,index:p,value:b,isSegmentEmpty:x})=>(d.openBlock(),d.createElementBlock("li",{key:f,onClick:v=>r(m,p)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:u,"border-color":h})},null,4),d.createVNode(c,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!a(m,p)}]),title:b&&d.unref(i)?`${f}: ${b.formatted}`:f},[d.createElementVNode("div",FT,d.toDisplayString(f),1),b&&d.unref(i)?(d.openBlock(),d.createElementBlock("div",zT,d.toDisplayString(b.formatted),1)):d.createCommentVNode("",!0)],10,NT)]),_:2},[x?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",BT,d.toDisplayString(d.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,LT))),128))])):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-27d1c6d3"]]),te=[];for(let n=0;n<256;++n)te.push((n+256).toString(16).slice(1));function HT(n,t=0){return(te[n[t+0]]+te[n[t+1]]+te[n[t+2]]+te[n[t+3]]+"-"+te[n[t+4]]+te[n[t+5]]+"-"+te[n[t+6]]+te[n[t+7]]+"-"+te[n[t+8]]+te[n[t+9]]+"-"+te[n[t+10]]+te[n[t+11]]+te[n[t+12]]+te[n[t+13]]+te[n[t+14]]+te[n[t+15]]).toLowerCase()}const WT=new Uint8Array(16);function YT(){return crypto.getRandomValues(WT)}function Nl(n,t,e){return crypto.randomUUID?crypto.randomUUID():VT(n)}function VT(n,t,e){var s;n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??YT();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,HT(i)}const Rm=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class Im{constructor(){A(this,"id","highlightPlugin");A(this,"_clickedElements");A(this,"_previousHoverOption");A(this,"_clicked",!1);A(this,"_pause",!1);A(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Rm(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,Rm(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 $T=["id"],jT=["id"],UT={class:"axis-tooltip-content"},qT="100%",XT="100%",GT=20,KT=20,Lm=6,ZT=0,QT=10,JT=10,tD=1,eD=Ce(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:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=mt.useI18n(),{translateUnit:i}=mt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),a=new Im,o=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:Y},H)=>{var Z;const X=Y.data,K=(Z=X.labels)==null?void 0:Z.indexOf(H);return X.datasets.reduce((G,gt,vt)=>{if(Y.isDatasetVisible(vt)){const at=gt.data[K];return isNaN(at)?G:G+at}else return G},0)},u=(Y,H,X,K)=>{const Z=K==="horizontal";H===null&&(H=e.t("entityNoName"));const G={type:"label",yValue:at=>Z?H:c(at,H),xValue:at=>Z?c(at,H):H},gt={...G,position:Z?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>Z?0:-Math.abs(wM()),content:at=>pf(c(at,H),X)},vt={...G,content:at=>MM(c(at,H),vM(at.chart,Y)),position:Z?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:at=>Z?xM(pf(c(at,H),X)):0,color:ff};return{[`${H}-value`]:gt,[`${H}-percent`]:vt}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=Nl(),p=Nl(),b=d.ref([]),x=d.inject("legendPosition",xe.Bottom),v=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),S=d.toRef(t,"metricUnit"),D=d.computed(()=>t.orientation==="horizontal"),P=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:D.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:O,tooltipAbsoluteTop:C}=mt.useTooltipAbsolutePosition(l,P),k=d.ref(0),g=()=>{var Y;return t.annotations&&((Y=t.chartData.labels)==null?void 0:Y.reduce((H,X)=>Object.assign(H,u(t.chartData,X,S.value,t.orientation)),{}))},_={id:m,afterUpdate(Y){k.value+=1,b.value=af(Y,t.legendValues,t.chartLegendSortFn)}},M={id:p,afterUpdate(Y){Y.options.plugins.annotation.annotations=t.annotations?g():{}}},R=[_,{id:"axisHover",afterEvent(Y,H){var X;if(v.show=!1,H.event.type==="mousemove"){const K=H.event,Z=Y.options.indexAxis,G=Y.scales,gt=Y.scales[Z].getLabelForValue(Number(Y.scales[Z].getValueForPixel(K[Z]))),at=Y.scales[Z].getLabels().indexOf(gt),bt=(X=t.chartData.isLabelEmpty)==null?void 0:X[at];if((jt=>jt==="x"?K.y>G.x.top:K.x<G.y.right)(Z)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ot=Y.canvas.getContext("2d").measureText(gt).width,Mt=Math.abs(Math.round(K.x-ot*.5)),ee=Math.round(K.x+ot*.5),le=Y.canvas.getBoundingClientRect(),Ut=40;v.left=Z==="x"?`${(Mt>0?Mt:ee)-v.offset+le.left}px`:`${K.x-ot*.5-v.offset+le.left}px`,v.top=`${K.y-Ut+le.top}px`,gt.length>sa?(v.show=!0,v.text=gt):bt?(v.text=e.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},a,...t.annotations?[M]:[]],I=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),F=d.ref(0),$=d.ref(0),Q=new ResizeObserver(rf(Y=>{F.value=Y[0].contentRect.width,$.value=Y[0].contentRect.height},100)),V=d.computed(()=>{var H,X;const Y=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&Y&&!D.value?`${Math.max(Y*(GT+Lm),F.value)}px`:qT}),lt=d.computed(()=>{var H,X;const Y=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&Y&&D.value?`${Math.max(Y*(KT+Lm),$.value)}px`:XT});mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&ye.register(Pm),o.value&&(F.value=o.value.offsetWidth,$.value=o.value.offsetHeight,Q.observe(o.value))}),d.onUnmounted(()=>{o.value&&Q.unobserve(o.value)});const U=d.computed(()=>{const Y=mt.useBarChartOptions({tooltipState:P,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:D.value?"y":"x",numLabels:I});return{...Y.value,plugins:{...Y.value.plugins,annotation:{annotations:g(),clip:!1}}}}),B=mt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),R,U);d.onBeforeUnmount(()=>{ye.unregister(Pm)});const q={[xe.Bottom]:"column"},J=d.computed(()=>{if(f.value&&B.value){const Y=window.devicePixelRatio,H=B.value,X=H.scales.y.width*Y+tD,K=(H.scales.y.height+H.scales.y.top+H.scales.x.height)*Y,Z=f.value.getContext("2d");return Z.scale(Y,Y),Z.canvas.width=X,Z.canvas.height=K,Z.canvas.style.width=`${X/Y}px`,Z.canvas.style.height=`${K/Y}px`,{scale:Y,width:X*Y,height:K*Y,targetCtx:Z}}return null}),j=Y=>{const H=Y.target;if(J.value&&B.value&&!D.value){const X=J.value.scale,K=J.value.targetCtx,Z=J.value.width,G=J.value.height,gt=B.value,vt=gt.canvas;K.fillStyle="white",H.scrollLeft>=ZT&&H.scrollLeft<=QT?(K.globalCompositeOperation="source-over",K.clearRect(0,0,Z,G),K.drawImage(vt,0,0,Z,G,0,0,Z,G),K.globalCompositeOperation="destination-over",K.fillRect(0,0,Z,G)):(K.globalCompositeOperation="source-over",K.fillRect(0,(gt.scales.y.height+gt.scales.y.top+JT)*X,Z,gt.scales.x.height*X))}P.offsetY=H.scrollTop,P.offsetX=H.scrollLeft,v.offset=H.scrollLeft},yt=({width:Y,height:H})=>{P.width=Y,P.height=H};d.watch(()=>t.orientation,()=>{var Y;if(f.value&&J.value){const H=J.value.width,X=J.value.height;((Y=f.value)==null?void 0:Y.getContext("2d")).clearRect(0,0,H,X)}P.showTooltip=!1,P.interactionMode="idle"}),d.watch(()=>t.annotations,Y=>{B.value&&(Y?B.value.options.plugins.annotation.annotations=g(t.chartData):delete B.value.options.plugins.annotation.annotations)});const _t=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(Y,H)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",q[d.unref(x)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,$T),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:H[0]||(H[0]=X=>_t()),onScroll:j},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:V.value,height:lt.value})},[d.createElementVNode("canvas",{id:d.unref(r),ref:"canvas",class:"chart-canvas"},null,8,jT)],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",UT,d.toDisplayString(v.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(xa,{"absolute-left":d.unref(O),"absolute-top":d.unref(C),"chart-parent-ref":l.value,state:P,"tooltip-title":n.tooltipTitle,onDimensions:yt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Ll,{id:d.unref(m),"chart-instance":d.unref(B),items:b.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);/*!
|
|
23
|
+
*/const Vf={modes:{point(n,t){return da(n,t,{intersect:!0})},nearest(n,t,e){return jS(n,t,e)},x(n,t,e){return da(n,t,{intersect:e.intersect,axis:"x"})},y(n,t,e){return da(n,t,{intersect:e.intersect,axis:"y"})}}};function xl(n,t,e){return(Vf.modes[e.mode]||Vf.modes.nearest)(n,t,e)}function YS(n,t,e){return e!=="x"&&e!=="y"?n.inRange(t.x,t.y,"x",!0)||n.inRange(t.x,t.y,"y",!0):n.inRange(t.x,t.y,e,!0)}function $S(n,t,e){return e==="x"?{x:n.x,y:t.y}:e==="y"?{x:t.x,y:n.y}:t}function da(n,t,e){return n.filter(i=>e.intersect?i.inRange(t.x,t.y):YS(i,t,e.axis))}function jS(n,t,e){let i=Number.POSITIVE_INFINITY;return da(n,t,e).reduce((s,r)=>{const a=r.getCenterPoint(),o=$S(t,a,e.axis),l=pi(t,o);return l<i?(s=[r],i=l):l===i&&s.push(r),s},[]).sort((s,r)=>s._index-r._index).slice(0,1)}function ni(n,t,e){const i=Math.cos(e),s=Math.sin(e),r=t.x,a=t.y;return{x:r+i*(n.x-r)-s*(n.y-a),y:a+s*(n.x-r)+i*(n.y-a)}}const US=(n,t)=>t>n||n.length>t.length&&n.slice(0,t.length)===t,ii=.001,ha=(n,t,e)=>Math.min(e,Math.max(t,n)),Yf=(n,t)=>n.value>=n.start-t&&n.value<=n.end+t;function qS(n,t,e){for(const i of Object.keys(n))n[i]=ha(n[i],t,e);return n}function XS(n,t,e,i){return!n||!t||e<=0?!1:Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2)<=Math.pow(e+i,2)}function $f(n,{x:t,y:e,x2:i,y2:s},r,{borderWidth:a,hitTolerance:o}){const l=(a+o)/2,c=n.x>=t-l-ii&&n.x<=i+l+ii,u=n.y>=e-l-ii&&n.y<=s+l+ii;return r==="x"?c:(r==="y"||c)&&u}function jf(n,{rect:t,center:e},i,{rotation:s,borderWidth:r,hitTolerance:a}){const o=ni(n,e,Yt(-s));return $f(o,t,i,{borderWidth:r,hitTolerance:a})}function si(n,t){const{centerX:e,centerY:i}=n.getProps(["centerX","centerY"],t);return{x:e,y:i}}function GS(n,t,e,i=!0){const s=e.split(".");let r=0;for(const a of t.split(".")){const o=s[r++];if(parseInt(a,10)<parseInt(o,10))break;if(US(o,a)){if(i)throw new Error(`${n} v${e} is not supported. v${t} or newer is required.`);return!1}}return!0}const Uf=n=>typeof n=="string"&&n.endsWith("%"),qf=n=>parseFloat(n)/100,Xf=n=>ha(qf(n),0,1),js=(n,t)=>({x:n,y:t,x2:n,y2:t,width:0,height:0}),KS={box:n=>js(n.centerX,n.centerY),doughnutLabel:n=>js(n.centerX,n.centerY),ellipse:n=>({centerX:n.centerX,centerY:n.centerX,radius:0,width:0,height:0}),label:n=>js(n.centerX,n.centerY),line:n=>js(n.x,n.y),point:n=>({centerX:n.centerX,centerY:n.centerY,radius:0,width:0,height:0}),polygon:n=>js(n.centerX,n.centerY)};function wl(n,t){return t==="start"?0:t==="end"?n:Uf(t)?Xf(t)*n:n/2}function Pn(n,t,e=!0){return typeof t=="number"?t:Uf(t)?(e?Xf(t):qf(t))*n:n}function ZS(n,t){const{x:e,width:i}=n,s=t.textAlign;return s==="center"?e+i/2:s==="end"||s==="right"?e+i:e}function Gf(n,t,{borderWidth:e,position:i,xAdjust:s,yAdjust:r},a){const o=ft(a),l=t.width+(o?a.width:0)+e,c=t.height+(o?a.height:0)+e,u=vl(i),h=Jf(n.x,l,s,u.x),f=Jf(n.y,c,r,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 vl(n,t="center"){return ft(n)?{x:rt(n.x,t),y:rt(n.y,t)}:(n=rt(n,t),{x:n,y:n})}const Kf=(n,t)=>n&&n.autoFit&&t<1;function Zf(n,t){const e=n.font,i=wt(e)?e:[e];return Kf(n,t)?i.map(function(s){const r=Rt(s);return r.size=Math.floor(s.size*t),r.lineHeight=s.lineHeight,Rt(r)}):i.map(s=>Rt(s))}function Qf(n){return n&&(ge(n.xValue)||ge(n.yValue))}function Jf(n,t,e=0,i){return n-wl(t,i)+e}function Ii(n,t,e){const i=e.init;if(i){if(i===!0)return em(t,e)}else return;return QS(n,t,e)}function tm(n,t,e){let i=!1;return t.forEach(s=>{pe(n[s])?(i=!0,e[s]=n[s]):ge(e[s])&&delete e[s]}),i}function em(n,t){const e=t.type||"line";return KS[e](n)}function QS(n,t,e){const i=St(e.init,[{chart:n,properties:t,options:e}]);if(i===!0)return em(t,e);if(ft(i))return i}const Ml=new Map,JS=n=>isNaN(n)||n<=0,tk=n=>n.reduce(function(t,e){return t+=e.string,t},"");function fa(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function ma(n,{x:t,y:e},i){i&&(n.translate(t,e),n.rotate(Yt(i)),n.translate(-t,-e))}function ln(n,t){if(t&&t.borderWidth)return n.lineCap=t.borderCapStyle||"butt",n.setLineDash(t.borderDash),n.lineDashOffset=t.borderDashOffset,n.lineJoin=t.borderJoinStyle||"miter",n.lineWidth=t.borderWidth,n.strokeStyle=t.borderColor,!0}function Li(n,t){n.shadowColor=t.backgroundShadowColor,n.shadowBlur=t.shadowBlur,n.shadowOffsetX=t.shadowOffsetX,n.shadowOffsetY=t.shadowOffsetY}function ga(n,t){const e=t.content;if(fa(e))return{width:Pn(e.width,t.width),height:Pn(e.height,t.height)};const i=Zf(t),s=t.textStrokeWidth,r=wt(e)?e:[e],a=r.join()+tk(i)+s+(n._measureText?"-spriting":"");return Ml.has(a)||Ml.set(a,sk(n,r,i,s)),Ml.get(a)}function nm(n,t,e){const{x:i,y:s,width:r,height:a}=t;n.save(),Li(n,e);const o=ln(n,e);n.fillStyle=e.backgroundColor,n.beginPath(),yi(n,{x:i,y:s,w:r,h:a,radius:qS(vn(e.borderRadius),0,Math.min(r,a)/2)}),n.closePath(),n.fill(),o&&(n.shadowColor=e.borderShadowColor,n.stroke()),n.restore()}function im(n,t,e,i){const s=e.content;if(fa(s)){n.save(),n.globalAlpha=ok(e.opacity,s.style.opacity),n.drawImage(s,t.x,t.y,t.width,t.height),n.restore();return}const r=wt(s)?s:[s],a=Zf(e,i),o=e.color,l=wt(o)?o:[o],c=ZS(t,e),u=t.y+e.textStrokeWidth/2;n.save(),n.textBaseline="middle",n.textAlign=e.textAlign,ek(n,e)&&rk(n,{x:c,y:u},r,a),ak(n,{x:c,y:u},r,{fonts:a,colors:l}),n.restore()}function ek(n,t){if(t.textStrokeWidth>0)return n.lineJoin="round",n.miterLimit=2,n.lineWidth=t.textStrokeWidth,n.strokeStyle=t.textStrokeColor,!0}function nk(n,t,e,i){const{radius:s,options:r}=t,a=r.pointStyle,o=r.rotation;let l=(o||0)*ja;if(fa(a)){n.save(),n.translate(e,i),n.rotate(l),n.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),n.restore();return}JS(s)||ik(n,{x:e,y:i,radius:s,rotation:o,style:a,rad:l})}function ik(n,{x:t,y:e,radius:i,rotation:s,style:r,rad:a}){let o,l,c,u;switch(n.beginPath(),r){default:n.arc(t,e,i,0,Ct),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=mr,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),a+=mr,n.lineTo(t+Math.sin(a)*i,e-Math.cos(a)*i),n.closePath();break;case"rectRounded":u=i*.516,c=i-u,o=Math.cos(a+Oe)*c,l=Math.sin(a+Oe)*c,n.arc(t-o,e-l,u,a-ut,a-Ot),n.arc(t+l,e-o,u,a-Ot,a),n.arc(t+o,e+l,u,a,a+Ot),n.arc(t-l,e+o,u,a+Ot,a+ut),n.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,n.rect(t-c,e-c,2*c,2*c);break}a+=Oe;case"rectRot":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+l,e-o),n.lineTo(t+o,e+l),n.lineTo(t-l,e+o),n.closePath();break;case"crossRot":a+=Oe;case"cross":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"star":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o),a+=Oe,o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l),n.moveTo(t+l,e-o),n.lineTo(t-l,e+o);break;case"line":o=Math.cos(a)*i,l=Math.sin(a)*i,n.moveTo(t-o,e-l),n.lineTo(t+o,e+l);break;case"dash":n.moveTo(t,e),n.lineTo(t+Math.cos(a)*i,e+Math.sin(a)*i);break}n.fill()}function sk(n,t,e,i){n.save();const s=t.length;let r=0,a=i;for(let o=0;o<s;o++){const l=e[Math.min(o,e.length-1)];n.font=l.string;const c=t[o];r=Math.max(r,n.measureText(c).width+i),a+=l.lineHeight}return n.restore(),{width:r,height:a}}function rk(n,{x:t,y:e},i,s){n.beginPath();let r=0;i.forEach(function(a,o){const l=s[Math.min(o,s.length-1)],c=l.lineHeight;n.font=l.string,n.strokeText(a,t,e+c/2+r),r+=c}),n.stroke()}function ak(n,{x:t,y:e},i,{fonts:s,colors:r}){let a=0;i.forEach(function(o,l){const c=r[Math.min(l,r.length-1)],u=s[Math.min(l,s.length-1)],h=u.lineHeight;n.beginPath(),n.font=u.string,n.fillStyle=c,n.fillText(o,t,e+h/2+a),a+=h,n.fill()})}function ok(n,t){const e=wn(n)?n:t;return wn(e)?ha(e,0,1):1}const sm=["left","bottom","top","right"];function lk(n,t){const{pointX:e,pointY:i,options:s}=t,r=s.callout,a=r&&r.display&&fk(t,r);if(!a||gk(t,r,a))return;if(n.save(),n.beginPath(),!ln(n,r))return n.restore();const{separatorStart:l,separatorEnd:c}=ck(t,a),{sideStart:u,sideEnd:h}=dk(t,a,l);(r.margin>0||s.borderWidth===0)&&(n.moveTo(l.x,l.y),n.lineTo(c.x,c.y)),n.moveTo(u.x,u.y),n.lineTo(h.x,h.y);const f=ni({x:e,y:i},t.getCenterPoint(),Yt(-t.rotation));n.lineTo(f.x,f.y),n.stroke(),n.restore()}function ck(n,t){const{x:e,y:i,x2:s,y2:r}=n,a=uk(n,t);let o,l;return t==="left"||t==="right"?(o={x:e+a,y:i},l={x:o.x,y:r}):(o={x:e,y:i+a},l={x:s,y:o.y}),{separatorStart:o,separatorEnd:l}}function uk(n,t){const{width:e,height:i,options:s}=n,r=s.callout.margin+s.borderWidth/2;return t==="right"?e+r:t==="bottom"?i+r:-r}function dk(n,t,e){const{y:i,width:s,height:r,options:a}=n,o=a.callout.start,l=hk(t,a.callout);let c,u;return t==="left"||t==="right"?(c={x:e.x,y:i+Pn(r,o)},u={x:c.x+l,y:c.y}):(c={x:e.x+Pn(s,o),y:e.y},u={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:u}}function hk(n,t){const e=t.side;return n==="left"||n==="top"?-e:e}function fk(n,t){const e=t.position;return sm.includes(e)?e:mk(n,t)}function mk(n,t){const{x:e,y:i,x2:s,y2:r,width:a,height:o,pointX:l,pointY:c,centerX:u,centerY:h,rotation:f}=n,m={x:u,y:h},p=t.start,_=Pn(a,p),x=Pn(o,p),v=[e,e+_,e+_,s],k=[i+x,r,i,r],E=[];for(let P=0;P<4;P++){const O=ni({x:v[P],y:k[P]},m,Yt(f));E.push({position:sm[P],distance:pi(O,{x:l,y:c})})}return E.sort((P,O)=>P.distance-O.distance)[0].position}function gk(n,t,e){const{pointX:i,pointY:s}=n,r=t.margin;let a=i,o=s;return e==="left"?a+=r:e==="right"?a-=r:e==="top"?o+=r:e==="bottom"&&(o-=r),n.inRange(a,o)}const rm={xScaleID:{min:"xMin",max:"xMax",start:"left",end:"right",startProp:"x",endProp:"x2"},yScaleID:{min:"yMin",max:"yMax",start:"bottom",end:"top",startProp:"y",endProp:"y2"}};function Ni(n,t,e){return t=typeof t=="number"?t:n.parse(t),At(t)?n.getPixelForValue(t):e}function ri(n,t,e){const i=t[e];if(i||e==="scaleID")return i;const s=e.charAt(0),r=Object.values(n).filter(a=>a.axis&&a.axis===s);return r.length?r[0].id:s}function am(n,t){if(n){const e=n.options.reverse,i=Ni(n,t.min,e?t.end:t.start),s=Ni(n,t.max,e?t.start:t.end);return{start:i,end:s}}}function om(n,t){const{chartArea:e,scales:i}=n,s=i[ri(i,t,"xScaleID")],r=i[ri(i,t,"yScaleID")];let a=e.width/2,o=e.height/2;return s&&(a=Ni(s,t.xValue,s.left+s.width/2)),r&&(o=Ni(r,t.yValue,r.top+r.height/2)),{x:a,y:o}}function Sl(n,t){const e=n.scales,i=e[ri(e,t,"xScaleID")],s=e[ri(e,t,"yScaleID")];if(!i&&!s)return{};let{left:r,right:a}=i||n.chartArea,{top:o,bottom:l}=s||n.chartArea;const c=um(i,{min:t.xMin,max:t.xMax,start:r,end:a});r=c.start,a=c.end;const u=um(s,{min:t.yMin,max:t.yMax,start:l,end:o});return o=u.start,l=u.end,{x:r,y:o,x2:a,y2:l,width:a-r,height:l-o,centerX:r+(a-r)/2,centerY:o+(l-o)/2}}function lm(n,t){if(!Qf(t)){const e=Sl(n,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(e.width,e.height)/2,t.radius=i);const s=i*2,r=e.centerX+t.xAdjust,a=e.centerY+t.yAdjust;return{x:r-i,y:a-i,x2:r+i,y2:a+i,centerX:r,centerY:a,width:s,height:s,radius:i}}return yk(n,t)}function pk(n,t){const{scales:e,chartArea:i}=n,s=e[t.scaleID],r={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?bk(s,r,t):_k(e,r,t),r}function cm(n,t){const e=Sl(n,t);return e.initProperties=Ii(n,e,t),e.elements=[{type:"label",optionScope:"label",properties:vk(n,e,t),initProperties:e.initProperties}],e}function yk(n,t){const e=om(n,t),i=t.radius*2;return{x:e.x-t.radius+t.xAdjust,y:e.y-t.radius+t.yAdjust,x2:e.x+t.radius+t.xAdjust,y2:e.y+t.radius+t.yAdjust,centerX:e.x+t.xAdjust,centerY:e.y+t.yAdjust,radius:t.radius,width:i,height:i}}function um(n,t){const e=am(n,t)||t;return{start:Math.min(e.start,e.end),end:Math.max(e.start,e.end)}}function bk(n,t,e){const i=Ni(n,e.value,NaN),s=Ni(n,e.endValue,i);n.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function _k(n,t,e){for(const i of Object.keys(rm)){const s=n[ri(n,e,i)];if(s){const{min:r,max:a,start:o,end:l,startProp:c,endProp:u}=rm[i],h=am(s,{min:e[r],max:e[a],start:s[o],end:s[l]});t[c]=h.start,t[u]=h.end}}}function xk({properties:n,options:t},e,i,s){const{x:r,x2:a,width:o}=n;return dm({start:r,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:e.width})}function wk({properties:n,options:t},e,i,s){const{y:r,y2:a,height:o}=n;return dm({start:r,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:e.height})}function dm(n,t){const{start:e,end:i,borderWidth:s}=n,{position:r,padding:{start:a,end:o},adjust:l}=t,c=i-s-e-a-o-t.size;return e+s/2+l+wl(c,r)}function vk(n,t,e){const i=e.label;i.backgroundColor="transparent",i.callout.display=!1;const s=vl(i.position),r=$t(i.padding),a=ga(n.ctx,i),o=xk({properties:t,options:e},a,s,r),l=wk({properties:t,options:e},a,s,r),c=a.width+r.width,u=a.height+r.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 kl=["enter","leave"],Tl=kl.concat("click");function Mk(n,t,e){t.listened=tm(e,Tl,t.listeners),t.moveListened=!1,kl.forEach(i=>{pe(e[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&pe(i.click)&&(t.listened=!0),t.moveListened||kl.forEach(s=>{pe(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function Sk(n,t,e){if(n.listened)switch(t.type){case"mousemove":case"mouseout":return kk(n,t,e);case"click":return Tk(n,t,e)}}function kk(n,t,e){if(!n.moveListened)return;let i;t.type==="mousemove"?i=xl(n.visibleElements,t,e.interaction):i=[];const s=n.hovered;n.hovered=i;const r={state:n,event:t};let a=hm(r,"leave",s,i);return hm(r,"enter",i,s)||a}function hm({state:n,event:t},e,i,s){let r;for(const a of i)s.indexOf(a)<0&&(r=fm(a.options[e]||n.listeners[e],a,t)||r);return r}function Tk(n,t,e){const i=n.listeners,s=xl(n.visibleElements,t,e.interaction);let r;for(const a of s)r=fm(a.options.click||i.click,a,t)||r;return r}function fm(n,t,e){return St(n,[t.$context,e])===!0}const pa=["afterDraw","beforeDraw"];function Dk(n,t,e){const i=t.visibleElements;t.hooked=tm(e,pa,t.hooks),t.hooked||i.forEach(s=>{t.hooked||pa.forEach(r=>{pe(s.options[r])&&(t.hooked=!0)})})}function mm(n,t,e){if(n.hooked){const i=t.options[e]||n.hooks[e];return St(i,[t.$context])}}function Ck(n,t,e){const i=Rk(n.scales,t,e);let s=gm(t,i,"min","suggestedMin");s=gm(t,i,"max","suggestedMax")||s,s&&pe(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function Ek(n,t){for(const e of n)Pk(e,t)}function gm(n,t,e,i){if(At(t[e])&&!Ok(n.options,e,i)){const s=n[e]!==t[e];return n[e]=t[e],s}}function Ok(n,t,e){return ge(n[t])||ge(n[e])}function Pk(n,t){for(const e of["scaleID","xScaleID","yScaleID"]){const i=ri(t,n,e);i&&!t[i]&&Ak(n,e)&&console.warn(`No scale found with id '${i}' for annotation '${n.id}'`)}}function Ak(n,t){if(t==="scaleID")return!0;const e=t.charAt(0);for(const i of["Min","Max","Value"])if(ge(n[e+i]))return!0;return!1}function Rk(n,t,e){const i=t.axis,s=t.id,r=i+"ScaleID",a={min:rt(t.min,Number.NEGATIVE_INFINITY),max:rt(t.max,Number.POSITIVE_INFINITY)};for(const o of e)o.scaleID===s?pm(o,t,["value","endValue"],a):ri(n,o,r)===s&&pm(o,t,[i+"Min",i+"Max",i+"Value"],a);return a}function pm(n,t,e,i){for(const s of e){const r=n[s];if(ge(r)){const a=t.parse(r);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class Fi extends Zt{inRange(t,e,i,s){const{x:r,y:a}=ni({x:t,y:e},this.getCenterPoint(s),Yt(-this.options.rotation));return $f({x:r,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return si(this,t)}draw(t){t.save(),ma(t,this.getCenterPoint(),this.options.rotation),nm(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return cm(t,e)}}Fi.id="boxAnnotation",Fi.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},Fi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Fi.descriptors={label:{_fallback:!0}};class ya extends Zt{inRange(t,e,i,s){return jf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:0,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return si(this,t)}draw(t){const e=this.options;!e.display||!e.content||(zk(t,this),t.save(),ma(t,this.getCenterPoint(),this.rotation),im(t,this,e,this._fitRatio),t.restore())}resolveElementProperties(t,e){const i=Ik(t,e);if(!i)return{};const{controllerMeta:s,point:r,radius:a}=Nk(t,e,i);let o=ga(t.ctx,e);const l=Fk(o,a);Kf(e,l)&&(o={width:o.width*l,height:o.height*l});const{position:c,xAdjust:u,yAdjust:h}=e,f=Gf(r,o,{borderWidth:0,position:c,xAdjust:u,yAdjust:h});return{initProperties:Ii(t,f,e),...f,...s,rotation:e.rotation,_fitRatio:l}}}ya.id="doughnutLabelAnnotation",ya.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},ya.defaultRoutes={};function Ik(n,t){return n.getSortedVisibleDatasetMetas().reduce(function(e,i){const s=i.controller;return s instanceof sn&&Lk(n,t,i.data)&&(!e||s.innerRadius<e.controller.innerRadius)&&s.options.circumference>=90?i:e},void 0)}function Lk(n,t,e){if(!t.autoHide)return!0;for(let i=0;i<e.length;i++)if(!e[i].hidden&&n.getDataVisibility(i))return!0}function Nk({chartArea:n},t,e){const{left:i,top:s,right:r,bottom:a}=n,{innerRadius:o,offsetX:l,offsetY:c}=e.controller,u=(i+r)/2+l,h=(s+a)/2+c,f={left:Math.max(u-o,i),right:Math.min(u+o,r),top:Math.max(h-o,s),bottom:Math.min(h+o,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,_=o-p,x=m.y>h,v=x?s+p:a-p,k=Bk(v,u,h,_);return{controllerMeta:{_centerX:u,_centerY:h,_radius:_,_counterclockwise:x,...k},point:m,radius:Math.min(o,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function Fk({width:n,height:t},e){const i=Math.sqrt(Math.pow(n,2)+Math.pow(t,2));return e*2/i}function Bk(n,t,e,i){const s=Math.pow(e-n,2),r=Math.pow(i,2),a=t*-2,o=Math.pow(t,2)+s-r,l=Math.pow(a,2)-4*o;if(l<=0)return{_startAngle:0,_endAngle:Ct};const c=(-a-Math.sqrt(l))/2,u=(-a+Math.sqrt(l))/2;return{_startAngle:pr({x:t,y:e},{x:c,y:n}).angle,_endAngle:pr({x:t,y:e},{x:u,y:n}).angle}}function zk(n,t){const{_centerX:e,_centerY:i,_radius:s,_startAngle:r,_endAngle:a,_counterclockwise:o,options:l}=t;n.save();const c=ln(n,l);n.fillStyle=l.backgroundColor,n.beginPath(),n.arc(e,i,s,r,a,o),n.closePath(),n.fill(),c&&n.stroke(),n.restore()}class Us extends Zt{inRange(t,e,i,s){return jf({x:t,y:e},{rect:this.getProps(["x","y","x2","y2"],s),center:this.getCenterPoint(s)},i,{rotation:this.rotation,borderWidth:this.options.borderWidth,hitTolerance:this.options.hitTolerance})}getCenterPoint(t){return si(this,t)}draw(t){const e=this.options,i=!ge(this._visible)||this._visible;!e.display||!e.content||!i||(t.save(),ma(t,this.getCenterPoint(),this.rotation),lk(t,this),nm(t,this,e),im(t,Hk(this),e),t.restore())}resolveElementProperties(t,e){let i;if(Qf(e))i=om(t,e);else{const{centerX:o,centerY:l}=Sl(t,e);i={x:o,y:l}}const s=$t(e.padding),r=ga(t.ctx,e),a=Gf(i,r,e,s);return{initProperties:Ii(t,a,e),pointX:i.x,pointY:i.y,...a,rotation:e.rotation}}}Us.id="labelAnnotation",Us.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},Us.defaultRoutes={borderColor:"color"};function Hk({x:n,y:t,width:e,height:i,options:s}){const r=s.borderWidth/2,a=$t(s.padding);return{x:n+a.left+r,y:t+a.top+r,width:e-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const Dl=(n,t,e)=>({x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}),Cl=(n,t,e)=>Dl(t,e,Math.abs((n-t.y)/(e.y-t.y))).x,ym=(n,t,e)=>Dl(t,e,Math.abs((n-t.x)/(e.x-t.x))).y,qs=n=>n*n,Wk=(n,t,{x:e,y:i,x2:s,y2:r},a)=>a==="y"?{start:Math.min(i,r),end:Math.max(i,r),value:t}:{start:Math.min(e,s),end:Math.max(e,s),value:n},bm=(n,t,e,i)=>(1-i)*(1-i)*n+2*(1-i)*i*t+i*i*e,El=(n,t,e,i)=>({x:bm(n.x,t.x,e.x,i),y:bm(n.y,t.y,e.y,i)}),_m=(n,t,e,i)=>2*(1-i)*(t-n)+2*i*(e-t),xm=(n,t,e,i)=>-Math.atan2(_m(n.x,t.x,e.x,i),_m(n.y,t.y,e.y,i))+.5*ut;class Xs extends Zt{inRange(t,e,i,s){const r=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:e},{path:o,ctx:l}=this;if(o){ln(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:u}=this.$context,h=t*u.currentDevicePixelRatio,f=e*u.currentDevicePixelRatio,m=l.isPointInStroke(o,h,f)||Ol(this,a,s);return l.restore(),m}const c=qs(r);return jk(this,a,c,s)||Ol(this,a,s)}return Vk(this,{mouseX:t,mouseY:e},i,{hitSize:r,useFinalPosition:s})}getCenterPoint(t){return si(this,t)}draw(t){const{x:e,y:i,x2:s,y2:r,cp:a,options:o}=this;if(t.save(),!ln(t,o))return t.restore();Li(t,o);const l=Math.sqrt(Math.pow(s-e,2)+Math.pow(r-i,2));if(o.curve&&a)return Jk(t,this,a,l),t.restore();const{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=km(this),m=Math.atan2(r-i,s-e);t.translate(e,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=o.borderShadowColor,t.stroke(),Pl(t,0,h,c),Pl(t,l,-f,u),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){const i=pk(t,e),{x:s,y:r,x2:a,y2:o}=i,l=Yk(i,t.chartArea),c=l?$k({x:s,y:r},{x:a,y:o},t.chartArea):{x:s,y:r,x2:a,y2:o,width:Math.abs(a-s),height:Math.abs(o-r)};if(c.centerX=(a+s)/2,c.centerY=(o+r)/2,c.initProperties=Ii(t,c,e),e.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=Qk(c,e,pi(h,f))}const u=Uk(t,c,e.label);return u._visible=l,c.elements=[{type:"label",optionScope:"label",properties:u,initProperties:c.initProperties}],c}}Xs.id="lineAnnotation";const wm={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};Xs.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},wm),fill:!1,length:12,start:Object.assign({},wm),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({},Us.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},Xs.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Xs.defaultRoutes={borderColor:"color"};function Vk(n,{mouseX:t,mouseY:e},i,{hitSize:s,useFinalPosition:r}){const a=Wk(t,e,n.getProps(["x","y","x2","y2"],r),i);return Yf(a,s)||Ol(n,{mouseX:t,mouseY:e},r,i)}function Yk({x:n,y:t,x2:e,y2:i},{top:s,right:r,bottom:a,left:o}){return!(n<o&&e<o||n>r&&e>r||t<s&&i<s||t>a&&i>a)}function vm({x:n,y:t},e,{top:i,right:s,bottom:r,left:a}){return n<a&&(t=ym(a,{x:n,y:t},e),n=a),n>s&&(t=ym(s,{x:n,y:t},e),n=s),t<i&&(n=Cl(i,{x:n,y:t},e),t=i),t>r&&(n=Cl(r,{x:n,y:t},e),t=r),{x:n,y:t}}function $k(n,t,e){const{x:i,y:s}=vm(n,t,e),{x:r,y:a}=vm(t,n,e);return{x:i,y:s,x2:r,y2:a,width:Math.abs(r-i),height:Math.abs(a-s)}}function jk(n,{mouseX:t,mouseY:e},i=ii,s){const{x:r,y:a,x2:o,y2:l}=n.getProps(["x","y","x2","y2"],s),c=o-r,u=l-a,h=qs(c)+qs(u),f=h===0?-1:((t-r)*c+(e-a)*u)/h;let m,p;return f<0?(m=r,p=a):f>1?(m=o,p=l):(m=r+f*c,p=a+f*u),qs(t-m)+qs(e-p)<=i}function Ol(n,{mouseX:t,mouseY:e},i,s){const r=n.label;return r.options.display&&r.inRange(t,e,s,i)}function Uk(n,t,e){const i=e.borderWidth,s=$t(e.padding),r=ga(n.ctx,e),a=r.width+s.width+i,o=r.height+s.height+i;return Xk(t,e,{width:a,height:o,padding:s},n.chartArea)}function qk(n){const{x:t,y:e,x2:i,y2:s}=n,r=Math.atan2(s-e,i-t);return r>ut/2?r-ut:r<ut/-2?r+ut:r}function Xk(n,t,e,i){const{width:s,height:r,padding:a}=e,{xAdjust:o,yAdjust:l}=t,c={x:n.x,y:n.y},u={x:n.x2,y:n.y2},h=t.rotation==="auto"?qk(n):Yt(t.rotation),f=Gk(s,r,h),m=Kk(n,t,{labelSize:f,padding:a},i),p=n.cp?El(c,n.cp,u,m):Dl(c,u,m),_={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},v=Sm(p.x,_)+o,k=Sm(p.y,x)+l;return{x:v-s/2,y:k-r/2,x2:v+s/2,y2:k+r/2,centerX:v,centerY:k,pointX:p.x,pointY:p.y,width:s,height:r,rotation:gr(h)}}function Gk(n,t,e){const i=Math.cos(e),s=Math.sin(e);return{w:Math.abs(n*i)+Math.abs(t*s),h:Math.abs(n*s)+Math.abs(t*i)}}function Kk(n,t,e,i){let s;const r=Zk(n,i);return t.position==="start"?s=Mm({w:n.x2-n.x,h:n.y2-n.y},e,t,r):t.position==="end"?s=1-Mm({w:n.x-n.x2,h:n.y-n.y2},e,t,r):s=wl(1,t.position),s}function Mm(n,t,e,i){const{labelSize:s,padding:r}=t,a=n.w*i.dx,o=n.h*i.dy,l=a>0&&(s.w/2+r.left-i.x)/a,c=o>0&&(s.h/2+r.top-i.y)/o;return ha(Math.max(l,c),0,.25)}function Zk(n,t){const{x:e,x2:i,y:s,y2:r}=n,a=Math.min(s,r)-t.top,o=Math.min(e,i)-t.left,l=t.bottom-Math.max(s,r),c=t.right-Math.max(e,i);return{x:Math.min(o,c),y:Math.min(a,l),dx:o<=c?1:-1,dy:a<=l?1:-1}}function Sm(n,t){const{size:e,min:i,max:s,padding:r}=t,a=e/2;return e>s-i?(s+i)/2:(i>=n-r-a&&(n=i+r+a),s<=n+r+a&&(n=s-r-a),n)}function km(n){const t=n.options,e=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:e,endOpts:i,startAdjust:Tm(n,e),endAdjust:Tm(n,i)}}function Tm(n,t){if(!t||!t.display)return 0;const{length:e,width:i}=t,s=n.options.borderWidth/2,r={x:e,y:i+s};return Math.abs(Cl(0,r,{x:0,y:s}))}function Pl(n,t,e,i){if(!i||!i.display)return;const{length:s,width:r,fill:a,backgroundColor:o,borderColor:l}=i,c=Math.abs(t-s)+e;n.beginPath(),Li(n,i),ln(n,i),n.moveTo(c,-r),n.lineTo(t+e,0),n.lineTo(c,r),a===!0?(n.fillStyle=o||l,n.closePath(),n.fill(),n.shadowColor="transparent"):n.shadowColor=i.borderShadowColor,n.stroke()}function Qk(n,t,e){const{x:i,y:s,x2:r,y2:a,centerX:o,centerY:l}=n,c=Math.atan2(a-s,r-i),u=vl(t.controlPoint,0),h={x:o+Pn(e,u.x,!1),y:l+Pn(e,u.y,!1)};return ni(h,{x:o,y:l},c)}function Dm(n,{x:t,y:e},{angle:i,adjust:s},r){!r||!r.display||(n.save(),n.translate(t,e),n.rotate(i),Pl(n,0,-s,r),n.restore())}function Jk(n,t,e,i){const{x:s,y:r,x2:a,y2:o,options:l}=t,{startOpts:c,endOpts:u,startAdjust:h,endAdjust:f}=km(t),m={x:s,y:r},p={x:a,y:o},_=xm(m,e,p,0),x=xm(m,e,p,1)-ut,v=El(m,e,p,h/i),k=El(m,e,p,1-f/i),E=new Path2D;n.beginPath(),E.moveTo(v.x,v.y),E.quadraticCurveTo(e.x,e.y,k.x,k.y),n.shadowColor=l.borderShadowColor,n.stroke(E),t.path=E,t.ctx=n,Dm(n,v,{angle:_,adjust:h},c),Dm(n,k,{angle:x,adjust:f},u)}class Gs extends Zt{inRange(t,e,i,s){const r=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return tT({x:t,y:e},this.getProps(["width","height","centerX","centerY"],s),r,a);const{x:o,y:l,x2:c,y2:u}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:u}:{start:o,end:c},f=ni({x:t,y:e},this.getCenterPoint(s),Yt(-r));return f[i]>=h.start-a-ii&&f[i]<=h.end+a+ii}getCenterPoint(t){return si(this,t)}draw(t){const{width:e,height:i,centerX:s,centerY:r,options:a}=this;t.save(),ma(t,this.getCenterPoint(),a.rotation),Li(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const o=ln(t,a);t.ellipse(s,r,i/2,e/2,ut/2,0,2*ut),t.fill(),o&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,e){return cm(t,e)}}Gs.id="ellipseAnnotation",Gs.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},Fi.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},Gs.defaultRoutes={borderColor:"color",backgroundColor:"color"},Gs.descriptors={label:{_fallback:!0}};function tT(n,t,e,i){const{width:s,height:r,centerX:a,centerY:o}=t,l=s/2,c=r/2;if(l<=0||c<=0)return!1;const u=Yt(e||0),h=Math.cos(u),f=Math.sin(u),m=Math.pow(h*(n.x-a)+f*(n.y-o),2),p=Math.pow(f*(n.x-a)-h*(n.y-o),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class ba extends Zt{inRange(t,e,i,s){const{x:r,y:a,x2:o,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),u=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?XS({x:t,y:e},this.getCenterPoint(s),c/2,u):Yf(i==="y"?{start:a,end:l,value:e}:{start:r,end:o,value:t},u)}getCenterPoint(t){return si(this,t)}draw(t){const e=this.options,i=e.borderWidth;if(e.radius<.1)return;t.save(),t.fillStyle=e.backgroundColor,Li(t,e);const s=ln(t,e);nk(t,this,this.centerX,this.centerY),s&&!fa(e.pointStyle)&&(t.shadowColor=e.borderShadowColor,t.stroke()),t.restore(),e.borderWidth=i}resolveElementProperties(t,e){const i=lm(t,e);return i.initProperties=Ii(t,i,e),i}}ba.id="pointAnnotation",ba.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},ba.defaultRoutes={borderColor:"color",backgroundColor:"color"};class _a extends Zt{inRange(t,e,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&nT(this.elements,t,e,s);const r=ni({x:t,y:e},this.getCenterPoint(s),Yt(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),o=Math.min(...a),l=Math.max(...a);return r[i]>=o&&r[i]<=l}getCenterPoint(t){return si(this,t)}draw(t){const{elements:e,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Li(t,i);const s=ln(t,i);let r=!0;for(const a of e)r?(t.moveTo(a.x,a.y),r=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,e){const i=lm(t,e),{sides:s,rotation:r}=e,a=[],o=2*ut/s;let l=r*ja;for(let c=0;c<s;c++,l+=o){const u=eT(i,e,l);u.initProperties=Ii(t,i,e),a.push(u)}return i.elements=a,i}}_a.id="polygonAnnotation",_a.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},_a.defaultRoutes={borderColor:"color",backgroundColor:"color"};function eT({centerX:n,centerY:t},{radius:e,borderWidth:i,hitTolerance:s},r){const a=(i+s)/2,o=Math.sin(r),l=Math.cos(r),c={x:n+o*e,y:t-l*e};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:n+o*(e+a),bY:t-l*(e+a)}}}function nT(n,t,e,i){let s=!1,r=n[n.length-1].getProps(["bX","bY"],i);for(const a of n){const o=a.getProps(["bX","bY"],i);o.bY>e!=r.bY>e&&t<(r.bX-o.bX)*(e-o.bY)/(r.bY-o.bY)+o.bX&&(s=!s),r=o}return s}const An={box:Fi,doughnutLabel:ya,ellipse:Gs,label:Us,line:Xs,point:ba,polygon:_a};Object.keys(An).forEach(n=>{Pt.describe(`elements.${An[n].id}`,{_fallback:"plugins.annotation.common"})});const iT={update:Object.assign},sT=Tl.concat(pa),Cm=(n,t)=>ft(t)?Il(n,t):n,Al=n=>n==="color"||n==="font";function Rl(n="line"){return An[n]?n:(console.warn(`Unknown annotation type: '${n}', defaulting to 'line'`),"line")}function rT(n,t,e,i){const s=oT(n,e.animations,i),r=t.annotations,a=uT(t.elements,r);for(let o=0;o<r.length;o++){const l=r[o],c=Em(a,o,l.type),u=l.setContext(cT(n,c,a,l)),h=c.resolveElementProperties(n,u);h.skip=aT(h),"elements"in h&&(lT(c,h.elements,u,s),delete h.elements),ge(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=Om(u),s.update(c,h)}}function aT(n){return isNaN(n.x)||isNaN(n.y)}function oT(n,t,e){return e==="reset"||e==="none"||e==="resize"?iT:new ro(n,t)}function lT(n,t,e,i){const s=n.elements||(n.elements=[]);s.length=t.length;for(let r=0;r<t.length;r++){const a=t[r],o=a.properties,l=Em(s,r,a.type,a.initProperties),c=e[a.optionScope].override(a);o.options=Om(c),i.update(l,o)}}function Em(n,t,e,i){const s=An[Rl(e)];let r=n[t];return(!r||!(r instanceof s))&&(r=n[t]=new s,Object.assign(r,i)),r}function Om(n){const t=An[Rl(n.type)],e={};e.id=n.id,e.type=n.type,e.drawTime=n.drawTime,Object.assign(e,Il(n,t.defaults),Il(n,t.defaultRoutes));for(const i of sT)e[i]=n[i];return e}function Il(n,t){const e={};for(const i of Object.keys(t)){const s=t[i],r=n[i];Al(i)&&wt(r)?e[i]=r.map(a=>Cm(a,s)):e[i]=Cm(r,s)}return e}function cT(n,t,e,i){return t.$context||(t.$context=Object.assign(Object.create(n.getContext()),{element:t,get elements(){return e.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function uT(n,t){const e=t.length,i=n.length;if(i<e){const s=e-i;n.splice(i,0,...new Array(s))}else i>e&&n.splice(e,i-e);return n}var dT="3.1.0";const Rn=new Map,Pm=n=>n.type!=="doughnutLabel",hT=Tl.concat(pa);var Am={id:"annotation",version:dT,beforeRegister(){GS("chart.js","4.0",ye.version)},afterRegister(){ye.register(An)},afterUnregister(){ye.unregister(An)},beforeInit(n){Rn.set(n,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(n,t,e){const i=Rn.get(n),s=i.annotations=[];let r=e.annotations;ft(r)?Object.keys(r).forEach(a=>{const o=r[a];ft(o)&&(o.id=a,s.push(o))}):wt(r)&&s.push(...r),Ek(s.filter(Pm),n.scales)},afterDataLimits(n,t){const e=Rn.get(n);Ck(n,t.scale,e.annotations.filter(Pm).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(n,t,e){const i=Rn.get(n);Mk(n,i,e),rT(n,i,e,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),Dk(n,i,e)},beforeDatasetsDraw(n,t,e){Ks(n,"beforeDatasetsDraw",e.clip)},afterDatasetsDraw(n,t,e){Ks(n,"afterDatasetsDraw",e.clip)},beforeDatasetDraw(n,t,e){Ks(n,t.index,e.clip)},beforeDraw(n,t,e){Ks(n,"beforeDraw",e.clip)},afterDraw(n,t,e){Ks(n,"afterDraw",e.clip)},beforeEvent(n,t,e){const i=Rn.get(n);Sk(i,t.event,e)&&(t.changed=!0)},afterDestroy(n){Rn.delete(n)},getAnnotations(n){const t=Rn.get(n);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(n,t,e){return xl(n,t,e)},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:n=>!hT.includes(n)&&n!=="init",annotations:{_allKeys:!1,_fallback:(n,t)=>`elements.${An[Rl(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:Al,_fallback:!0},_indexable:Al}},additionalOptionScopes:[""]};function Ks(n,t,e){const{ctx:i,chartArea:s}=n,r=Rn.get(n);e&&as(i,s);const a=fT(r.visibleElements,t).sort((o,l)=>o.element.options.z-l.element.options.z);for(const o of a)mT(i,s,r,o);e&&os(i)}function fT(n,t){const e=[];for(const i of n)if(i.options.drawTime===t&&e.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&e.push({element:s});return e}function mT(n,t,e,i){const s=i.element;i.main?(mm(e,s,"beforeDraw"),s.draw(n,t),mm(e,s,"afterDraw")):s.draw(n,t)}const gT={class:"zoom-timerange-container"},pT={class:"zoom-timerange-details"},yT={class:"label","data-testid":"zoom-timerange-from"},bT={class:"label","data-testid":"zoom-timerange-to"},_T=d.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.ref(zs({tickValue:t.start,granularity:t.granularity})),s=d.ref(zs({tickValue:t.end,granularity:t.granularity})),r=(a,o)=>{rf(()=>{i.value=zs({tickValue:a,granularity:t.granularity}),s.value=zs({tickValue:o,granularity:t.granularity})},100)()};return d.watch(()=>[t.start,t.end],([a,o])=>{r(a,o)},{immediate:!0}),(a,o)=>(d.openBlock(),d.createElementBlock("div",gT,[d.createElementVNode("div",pT,[d.createElementVNode("div",yT,d.toDisplayString(d.unref(e).t("zoom_time_range.from")),1),d.createElementVNode("div",null,d.toDisplayString(i.value),1),d.createElementVNode("div",bT,d.toDisplayString(d.unref(e).t("zoom_time_range.to")),1),d.createElementVNode("div",null,d.toDisplayString(s.value),1)])]))}}),Ce=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},Rm=Ce(_T,[["__scopeId","data-v-4fa681cf"]]),xT={class:"zoom-actions-container"},wT={class:"zoom-actions-heading"},vT={class:"zoom-action-select"},MT=["data-testid"],ST=["aria-disabled","href"],kT=["onClick"],TT=Ce(d.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(n,{emit:t}){const e=n,i=t,s=r=>{r.action&&(r.action(e.newTimeRange),i("onAction"))};return(r,a)=>(d.openBlock(),d.createElementBlock("div",xT,[d.createElementVNode("div",wT,[d.createVNode(Rm,{end:n.newTimeRange.end,granularity:n.granularity,start:n.newTimeRange.start},null,8,["end","granularity","start"]),d.createVNode(d.unref(Xi.CloseIcon),{class:"zoom-actions-close-icon",color:d.unref(il),size:d.unref(Ns),onClick:a[0]||(a[0]=o=>r.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=d.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),d.createElementVNode("div",vT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.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=>r.$emit("onAction"))},d.toDisplayString(o.label),9,ST)):(d.openBlock(),d.createElementBlock("div",{key:1,onClick:l=>s(o)},d.toDisplayString(o.label),9,kT))],10,MT))),128))])]))}}),[["__scopeId","data-v-179abac7"]]),DT={key:2},CT={class:"tooltip-title"},ET={class:"title"},OT={key:0,class:"subtitle"},PT={class:"context"},AT={class:"metric"},RT={class:"tooltip"},IT={key:0},LT={class:"display-value"},xa=Ce(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(n,{emit:t}){const e=t,i=n,s=d.ref(null),{x:r,y:a,isDragging:o}=LS(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=d.computed(()=>`${a.value}px`),c=d.computed(()=>`${r.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,p])=>{o.value||(r.value=parseFloat(m),a.value=parseFloat(p))}),d.watch(o,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),d.watch(s,m=>{if(m){const{width:p,height:_}=m.getBoundingClientRect();e("dimensions",{width:p,height:_})}}),(m,p)=>{var _,x;return n.state.showTooltip?(d.openBlock(),d.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:d.normalizeClass(["tooltip-container",{locked:n.state.interactionMode==="interactive"}]),style:d.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${n.absoluteLeft}, ${n.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[n.state.interactionMode==="selecting-chart-area"&&n.granularity&&n.zoomTimeRange&&n.zoomTimeRange.end&&n.zoomTimeRange.start?(d.openBlock(),d.createBlock(Rm,{key:0,end:(_=n.zoomTimeRange)==null?void 0:_.end,granularity:n.granularity,start:(x=n.zoomTimeRange)==null?void 0:x.start},null,8,["end","granularity","start"])):n.state.interactionMode==="zoom-interactive"&&n.zoomTimeRange&&n.zoomActionItems&&n.granularity?(d.openBlock(),d.createBlock(TT,{key:1,granularity:n.granularity,"new-time-range":n.zoomTimeRange,"zoom-action-items":n.zoomActionItems,onOnAction:p[0]||(p[0]=v=>e("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(d.openBlock(),d.createElementBlock("div",DT,[d.createElementVNode("div",CT,[d.createElementVNode("div",ET,[d.createElementVNode("div",null,d.toDisplayString(n.tooltipTitle),1),f.value?(d.openBlock(),d.createBlock(d.unref(Xi.DragIcon),{key:0,class:"drag-icon",color:d.unref(il),size:d.unref(Ns)},null,8,["color","size"])):d.createCommentVNode("",!0)]),u.value||h.value?(d.openBlock(),d.createElementBlock("div",OT,[d.createElementVNode("div",PT,d.toDisplayString(u.value),1),d.createElementVNode("div",AT,d.toDisplayString(h.value),1)])):d.createCommentVNode("",!0)]),d.createElementVNode("ul",RT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.state.tooltipSeries,({backgroundColor:v,borderColor:k,label:E,value:P,isSegmentEmpty:O},D)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:E+D},[n.state.tooltipSeries.length?(d.openBlock(),d.createElementBlock("li",IT,[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:String(v),borderColor:String(k)})},null,4),d.createElementVNode("span",{class:d.normalizeClass(["display-label",{empty:O}])},d.toDisplayString(E),3),d.createElementVNode("span",LT,d.toDisplayString(P),1)])):d.createCommentVNode("",!0)],64))),128))])]))],6)):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-b449481c"]]),NT={key:0,class:"legend-container","data-testid":"legend"},FT=["onClick"],BT=["title"],zT={class:"label truncate-label"},HT={key:0,class:"sub-label"},WT={class:"tooltip-content"},Ll=Ce(d.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.inject("showLegendValues",!1),s=d.inject("legendPosition",d.ref(xe.Bottom)),r=(o=0,l)=>{if(t.chartInstance===null)return;const c=t.chartInstance instanceof ye?t.chartInstance:t.chartInstance.chart;a(o,l)?c.hide(o,l):c.show(o,l),c.update()},a=(o=0,l)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const c=t.chartInstance instanceof ye?t.chartInstance:t.chartInstance.chart,u=c.getDatasetMeta(o);return u.dataset||l===void 0?c.isDatasetVisible(o):!(u.data.length&&u.data[l].hidden)};return(o,l)=>{const c=d.resolveComponent("KTooltip");return d.unref(s)!==d.unref(xe).Hidden?(d.openBlock(),d.createElementBlock("ul",NT,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(n.items,({fillStyle:u,strokeStyle:h,text:f,datasetIndex:m,index:p,value:_,isSegmentEmpty:x})=>(d.openBlock(),d.createElementBlock("li",{key:f,onClick:v=>r(m,p)},[d.createElementVNode("div",{class:"square-marker",style:d.normalizeStyle({background:u,"border-color":h})},null,4),d.createVNode(c,null,d.createSlots({default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass(["label-container",{"strike-through":!a(m,p)}]),title:_&&d.unref(i)?`${f}: ${_.formatted}`:f},[d.createElementVNode("div",zT,d.toDisplayString(f),1),_&&d.unref(i)?(d.openBlock(),d.createElementBlock("div",HT,d.toDisplayString(_.formatted),1)):d.createCommentVNode("",!0)],10,BT)]),_:2},[x?{name:"content",fn:d.withCtx(()=>[d.createElementVNode("div",WT,d.toDisplayString(d.unref(e).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],8,FT))),128))])):d.createCommentVNode("",!0)}}}),[["__scopeId","data-v-27d1c6d3"]]),te=[];for(let n=0;n<256;++n)te.push((n+256).toString(16).slice(1));function VT(n,t=0){return(te[n[t+0]]+te[n[t+1]]+te[n[t+2]]+te[n[t+3]]+"-"+te[n[t+4]]+te[n[t+5]]+"-"+te[n[t+6]]+te[n[t+7]]+"-"+te[n[t+8]]+te[n[t+9]]+"-"+te[n[t+10]]+te[n[t+11]]+te[n[t+12]]+te[n[t+13]]+te[n[t+14]]+te[n[t+15]]).toLowerCase()}const YT=new Uint8Array(16);function $T(){return crypto.getRandomValues(YT)}function Nl(n,t,e){return crypto.randomUUID?crypto.randomUUID():jT(n)}function jT(n,t,e){var s;n=n||{};const i=n.random??((s=n.rng)==null?void 0:s.call(n))??$T();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,VT(i)}const Im=(n,t)=>{const e=n.ctx,i=n.scales.y,s=n.scales.x,r=t[t.length-1].element;e.save(),e.strokeStyle="rgba(100, 100, 100, 1)",e.lineWidth=3,n.options.indexAxis==="x"?e.strokeRect(r.x-r.width/2,r.y,r.width,i.bottom-r.y):e.strokeRect(s.left,r.y-r.height/2,r.x-s.left,r.height),e.restore()};class Lm{constructor(){A(this,"id","highlightPlugin");A(this,"_clickedElements");A(this,"_previousHoverOption");A(this,"_clicked",!1);A(this,"_pause",!1);A(this,"_suppressNextClick",!1)}afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&Im(t,this._clickedElements)}afterEvent(t,{event:e}){var r;if(e.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(e.type!=="click"||!e.native||this._pause)return;this._clicked=!this._clicked;const i=((r=t.options.interaction)==null?void 0:r.mode)||"index",s=t.getElementsAtEventForMode(e.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,Im(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 UT=["id"],qT=["id"],XT={class:"axis-tooltip-content"},GT="100%",KT="100%",ZT=20,QT=20,Nm=6,JT=0,tD=10,eD=10,nD=1,iD=Ce(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:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{i18n:e}=mt.useI18n(),{translateUnit:i}=mt.useTranslatedUnits(),s=crypto.randomUUID(),r=crypto.randomUUID(),a=new Lm,o=d.useTemplateRef("chartContainer"),l=d.useTemplateRef("chartParent"),c=({chart:V},H)=>{var Z;const X=V.data,K=(Z=X.labels)==null?void 0:Z.indexOf(H);return X.datasets.reduce((G,gt,vt)=>{if(V.isDatasetVisible(vt)){const at=gt.data[K];return isNaN(at)?G:G+at}else return G},0)},u=(V,H,X,K)=>{const Z=K==="horizontal";H===null&&(H=e.t("entityNoName"));const G={type:"label",yValue:at=>Z?H:c(at,H),xValue:at=>Z?c(at,H):H},gt={...G,position:Z?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>Z?0:-Math.abs(vM()),content:at=>pf(c(at,H),X)},vt={...G,content:at=>SM(c(at,H),MM(at.chart,V)),position:Z?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:at=>Z?wM(pf(c(at,H),X)):0,color:ff};return{[`${H}-value`]:gt,[`${H}-percent`]:vt}},h=d.useTemplateRef("canvas"),f=d.useTemplateRef("axis"),m=Nl(),p=Nl(),_=d.ref([]),x=d.inject("legendPosition",xe.Bottom),v=d.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),k=d.toRef(t,"metricUnit"),E=d.computed(()=>t.orientation==="horizontal"),P=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:E.value?"horizontal_bar":"vertical_bar",chartID:r,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:O,tooltipAbsoluteTop:D}=mt.useTooltipAbsolutePosition(l,P),S=d.ref(0),g=()=>{var V;return t.annotations&&((V=t.chartData.labels)==null?void 0:V.reduce((H,X)=>Object.assign(H,u(t.chartData,X,k.value,t.orientation)),{}))},y={id:m,afterUpdate(V){S.value+=1,_.value=af(V,t.legendValues,t.chartLegendSortFn)}},M={id:p,afterUpdate(V){V.options.plugins.annotation.annotations=t.annotations?g():{}}},R=[y,{id:"axisHover",afterEvent(V,H){var X;if(v.show=!1,H.event.type==="mousemove"){const K=H.event,Z=V.options.indexAxis,G=V.scales,gt=V.scales[Z].getLabelForValue(Number(V.scales[Z].getValueForPixel(K[Z]))),at=V.scales[Z].getLabels().indexOf(gt),bt=(X=t.chartData.isLabelEmpty)==null?void 0:X[at];if((jt=>jt==="x"?K.y>G.x.top:K.x<G.y.right)(Z)){P.interactionMode!=="interactive"&&(P.showTooltip=!1);const ot=V.canvas.getContext("2d").measureText(gt).width,Mt=Math.abs(Math.round(K.x-ot*.5)),ee=Math.round(K.x+ot*.5),le=V.canvas.getBoundingClientRect(),Ut=40;v.left=Z==="x"?`${(Mt>0?Mt:ee)-v.offset+le.left}px`:`${K.x-ot*.5-v.offset+le.left}px`,v.top=`${K.y-Ut+le.top}px`,gt.length>sa?(v.show=!0,v.text=gt):bt?(v.text=e.t("emptyEntityInfo"),v.show=!0):v.show=!1}else v.show=!1}}},a,...t.annotations?[M]:[]],I=d.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),F=d.ref(0),$=d.ref(0),Q=new ResizeObserver(rf(V=>{F.value=V[0].contentRect.width,$.value=V[0].contentRect.height},100)),Y=d.computed(()=>{var H,X;const V=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&V&&!E.value?`${Math.max(V*(ZT+Nm),F.value)}px`:GT}),lt=d.computed(()=>{var H,X;const V=(X=(H=t.chartData)==null?void 0:H.labels)==null?void 0:X.length;return h.value&&V&&E.value?`${Math.max(V*(QT+Nm),$.value)}px`:KT});mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey")),d.onMounted(()=>{t.annotations&&ye.register(Am),o.value&&(F.value=o.value.offsetWidth,$.value=o.value.offsetHeight,Q.observe(o.value))}),d.onUnmounted(()=>{o.value&&Q.unobserve(o.value)});const U=d.computed(()=>{const V=mt.useBarChartOptions({tooltipState:P,legendID:m,stacked:d.toRef(t,"stacked"),metricAxesTitle:d.toRef(t,"metricAxesTitle"),dimensionAxesTitle:d.toRef(t,"dimensionAxesTitle"),indexAxis:E.value?"y":"x",numLabels:I});return{...V.value,plugins:{...V.value.plugins,annotation:{annotations:g(),clip:!1}}}}),z=mt.useChartJSCommon("bar",h,d.toRef(t,"chartData"),R,U);d.onBeforeUnmount(()=>{ye.unregister(Am)});const q={[xe.Bottom]:"column"},J=d.computed(()=>{if(f.value&&z.value){const V=window.devicePixelRatio,H=z.value,X=H.scales.y.width*V+nD,K=(H.scales.y.height+H.scales.y.top+H.scales.x.height)*V,Z=f.value.getContext("2d");return Z.scale(V,V),Z.canvas.width=X,Z.canvas.height=K,Z.canvas.style.width=`${X/V}px`,Z.canvas.style.height=`${K/V}px`,{scale:V,width:X*V,height:K*V,targetCtx:Z}}return null}),j=V=>{const H=V.target;if(J.value&&z.value&&!E.value){const X=J.value.scale,K=J.value.targetCtx,Z=J.value.width,G=J.value.height,gt=z.value,vt=gt.canvas;K.fillStyle="white",H.scrollLeft>=JT&&H.scrollLeft<=tD?(K.globalCompositeOperation="source-over",K.clearRect(0,0,Z,G),K.drawImage(vt,0,0,Z,G,0,0,Z,G),K.globalCompositeOperation="destination-over",K.fillRect(0,0,Z,G)):(K.globalCompositeOperation="source-over",K.fillRect(0,(gt.scales.y.height+gt.scales.y.top+eD)*X,Z,gt.scales.x.height*X))}P.offsetY=H.scrollTop,P.offsetX=H.scrollLeft,v.offset=H.scrollLeft},yt=({width:V,height:H})=>{P.width=V,P.height=H};d.watch(()=>t.orientation,()=>{var V;if(f.value&&J.value){const H=J.value.width,X=J.value.height;((V=f.value)==null?void 0:V.getContext("2d")).clearRect(0,0,H,X)}P.showTooltip=!1,P.interactionMode="idle"}),d.watch(()=>t.annotations,V=>{z.value&&(V?z.value.options.plugins.annotation.annotations=g(t.chartData):delete z.value.options.plugins.annotation.annotations)});const _t=()=>{P.showTooltip&&(P.interactionMode!=="idle"?P.interactionMode="idle":P.interactionMode="interactive")};return(V,H)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",q[d.unref(x)]])},[d.createElementVNode("canvas",{id:d.unref(s),ref:"axis",class:"axis"},null,8,UT),d.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:H[0]||(H[0]=X=>_t()),onScroll:j},[d.createElementVNode("div",{class:"chart-body",style:d.normalizeStyle({width:Y.value,height:lt.value})},[d.createElementVNode("canvas",{id:d.unref(r),ref:"canvas",class:"chart-canvas"},null,8,qT)],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",XT,d.toDisplayString(v.text),1)],4)):d.createCommentVNode("",!0),d.createVNode(xa,{"absolute-left":d.unref(O),"absolute-top":d.unref(D),"chart-parent-ref":l.value,state:P,"tooltip-title":n.tooltipTitle,onDimensions:yt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),d.createVNode(Ll,{id:d.unref(m),"chart-instance":d.unref(z),items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-60e5a1a7"]]);/*!
|
|
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 nD={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"};Eu._date.override({_id:"date-fns",formats:function(){return nD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=ct(n):e==="string"&&(typeof t=="string"?n=bw(n,t,new Date,this.options):n=hh(n,this.options)),No(n)?n.getTime():null},format:function(n,t){return jr(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Io(n,t);case"second":return f_(n,t);case"minute":return d_(n,t);case"hour":return l_(n,t);case"day":return Vr(n,t);case"week":return m_(n,t);case"month":return Ro(n,t);case"quarter":return h_(n,t);case"year":return g_(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Fo(n,t);case"second":return M_(n,t);case"minute":return x_(n,t);case"hour":return __(n,t);case"day":return jd(n,t);case"week":return S_(n,t);case"month":return Gd(n,t);case"quarter":return v_(n,t);case"year":return k_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return vw(n);case"minute":return ww(n);case"hour":return xw(n);case"day":return Lo(n);case"week":return je(n);case"isoWeek":return je(n,{weekStartsOn:+e});case"month":return D_(n);case"quarter":return T_(n);case"year":return Kd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return R_(n);case"minute":return P_(n);case"hour":return E_(n);case"day":return qd(n);case"week":return O_(n);case"month":return Xd(n);case"quarter":return A_(n);case"year":return C_(n);default:return n}}});const Nm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},iD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Nm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},sD=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function zi(n){return d.isProxy(n)?d.toRaw(n):n}function rD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function aD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Fm(n,t){n.labels=t}function zm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(a=>a[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function oD(n,t){const e={labels:[],datasets:[]};return Fm(e,n.labels),zm(e,n.datasets,t),e}const lD=d.defineComponent({props:iD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const a=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,p=oD(u,m),b=rD(p,u);r.value=new ye(s.value,{type:c,data:b,options:{...h},plugins:f})},o=()=>{const c=d.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return d.onMounted(a),d.onUnmounted(o),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,p]=u;const b=d.toRaw(r.value);if(!b)return;let x=!1;if(h){const v=zi(h),S=zi(m);v&&v!==S&&(aD(b,v),x=!0)}if(f){const v=zi(f.labels),S=zi(p.labels),D=zi(f.datasets),P=zi(p.datasets);v!==S&&(Fm(b.config.data,v),x=!0),D&&D!==P&&(zm(b.config.data,D,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(b)})},{deep:!0}),()=>d.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function Fl(n,t){return ye.register(t),d.defineComponent({props:Nm,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),a=o=>{r.value=o==null?void 0:o.chart};return s({chart:r}),()=>d.h(lD,sD({ref:a},{type:n,...e}))}})}const Bm=Fl("bar",us),Hm=Fl("doughnut",sn),Wm=Fl("line",ds),cD={class:"chart-container"},uD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:xe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>on},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""}},setup(n){const t=n,{translateUnit:e}=mt.useTranslatedUnits(),i=crypto.randomUUID(),s=crypto.randomUUID(),r=d.ref([]),a=d.useTemplateRef("chartParent"),o=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:s,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:l,tooltipAbsoluteTop:c}=mt.useTooltipAbsolutePosition(a,o),u={id:i,afterUpdate(S){r.value=S.options.plugins.legend.labels.generateLabels(S).map(D=>({...D,value:t.legendValues&&t.legendValues[D.text],hidden:!1}))}},h=d.computed(()=>[u]),f=d.computed(()=>[t.chartData.datasets.reduce((D,P)=>(D.labels.push(P.label),D.backgroundColor.push(P.backgroundColor),D.borderColor.push(hf(P.backgroundColor,50)),D.data.push(P.data.reduce((O,C)=>O+C,0)),D),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),m=d.computed(()=>({...t.chartData,datasets:f.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:p}=mt.useDonutChartOptions({tooltipState:o,legendID:i}),b=d.ref(),x=S=>({[xe.Bottom]:"column",[xe.Hidden]:"hidden"})[S],v=({width:S,height:D})=>{o.width=S,o.height=D};return(S,D)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",x(n.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",cD,[d.createVNode(d.unref(Hm),{ref_key:"chartInstance",ref:b,"chart-id":d.unref(s),data:m.value,options:d.unref(p),plugins:h.value},null,8,["chart-id","data","options","plugins"]),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(xa,{"absolute-left":d.unref(l),"absolute-top":d.unref(c),state:o,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:v},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Ll,{id:d.unref(i),"chart-instance":b.value,items:r.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),dD=Ce(uD,[["__scopeId","data-v-c26458b8"]]),zl=(n,t,e,i,s="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=s,n.stroke(),n.restore()},fe={},hD=()=>{fe.x=void 0,fe.chart=void 0,fe.strategy=void 0,fe.group=void 0},fD=10;class Ym{constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){A(this,"id","verticalLinePlugin");A(this,"_clickedSegment");A(this,"_pause",!1);A(this,"_useBrushingState",!1);A(this,"_brushStrategy");A(this,"_brushGroup");A(this,"_lastMouseBrushEvent",0);let s=!1;e==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<fD)return;const s=()=>{fe.chart=e,fe.strategy=this._brushStrategy,fe.group=this._brushGroup;for(const r of Object.values(ye.instances))r!==e&&r.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(fe.x=e.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(fe.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;zl(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:s}=t.tooltip.dataPoints[0].element;zl(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(fe.x===void 0)return;const e=fe.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&fe.group===this._brushGroup&&zl(t.ctx,fe.x,t.scales.y.top,t.scales.y.bottom,e)}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&&fe.chart===t){const e=fe.x!==void 0;if(hD(),e)for(const i of Object.values(ye.instances))i!==t&&i.update("none")}}}const mD=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},gD=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},Vm=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class pD{constructor(){A(this,"id","dragSelectPlugin");A(this,"_isDragging",!1);A(this,"_startX",0);A(this,"_endX",0);A(this,"_dragTimeout");A(this,"_clearSelectionArea",!0);A(this,"_chart",null);A(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=o=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-l.left},150)},r=o=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-l.left,Vm("dragSelectMove",t,this))},a=o=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-l.left,Vm("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(gD(t,this._startX,this._endX),mD(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const yD=["hidden","single","full"];var ri=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ri||{});const bD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],_D=["gauge","top_n","single_value"],xD=20,wD="rgba(255, 171, 171, 0.4)",vD="rgba(255, 196, 0, 0.2)",$m=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},MD=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const o=r.map(c=>({ts:c.x,aboveThreshold:c.y>=a.value}));let l=o[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<o.length;c++)!o[c-1].aboveThreshold&&o[c].aboveThreshold?l=$m(r[c-1],r[c],a.value):o[c-1].aboveThreshold&&!o[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:$m(r[c-1],r[c],a.value),type:a.type}),l=void 0);l!==void 0&&e.push({start:l,end:o[o.length-1].ts,type:a.type})})}),e},SD=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class kD{constructor(t){A(this,"id","thresholdPlugin");A(this,"_thresholds");A(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(a=>({...a,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=a=>{var o;if(t){const l=a.clientY,c=t.scales.y,u=s.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(p=>{p.hovered=Math.abs(p.value-h)<xD})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const a=(s=this._thresholds)==null?void 0:s[r];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=aa(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=aa(c.type),i.font=uM,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=MD(t,a);SD(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"?wD:vD,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=aa(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const TD=Ce(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:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=mt.useI18n(),r=new Ym,a=new Im,o=new pD,l=new kD(s),{translateUnit:c}=mt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),p=d.inject("legendPosition",xe.Bottom),b=d.useTemplateRef("chartParent"),x=d.ref(void 0),v=d.ref(!1),S=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:d.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(e,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:D,tooltipAbsoluteTop:P}=mt.useTooltipAbsolutePosition(b,S),O={id:h,afterUpdate(B){m.value=af(B,e.legendValues,e.chartLegendSortFn)}},C=d.computed(()=>[O,a,...e.brush?[o]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),k=d.computed(()=>`line-${C.value.map(B=>B.id).join("-")}`),g=d.computed(()=>`bar-${C.value.map(B=>B.id).join("-")}`),_=d.computed(()=>e.chartData&&tM(e.chartData)),{options:M}=mt.useLineChartOptions({tooltipState:S,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:_,threshold:d.toRef(e,"threshold")});mt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const E=B=>({[xe.Bottom]:"column",[xe.Hidden]:"hidden"})[B],R=({width:B,height:q})=>{S.width=B,S.height=q},I=(B=!0)=>{S.interactionMode="idle",S.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(B),r.isPaused&&r.resume()},F=()=>{S.interactionMode="interactive"},$=()=>{var B,q;!u.value||!((q=(B=u.value.chart.tooltip)==null?void 0:B.dataPoints)!=null&&q.length)||(S.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},Q=()=>{if(v.value){v.value=!1;return}S.interactionMode!=="idle"?I():F(),$()};d.watch(()=>e.type,()=>{S.interactionMode="idle",S.showTooltip=!1,r.destroyClickedSegment()});const V=B=>{B.preventDefault(),B.stopPropagation();const{xStart:q,xEnd:J}=B.detail;q&&J&&(x.value={start:new Date(q),end:new Date(J),type:"absolute"},S.interactionMode="zoom-interactive",i("select-chart-range",x.value))},lt=B=>{S.interactionMode="selecting-chart-area",v.value=!0,r.pause(),a.pause();const{xStart:q,xEnd:J}=B.detail;q&&J&&(x.value={start:new Date(q),end:new Date(J),type:"absolute"})},U=B=>{if(!b.value||S.interactionMode==="idle")return;const q=B.target;q&&b.value.contains(q)||v.value||I(!1)};return d.watch(()=>{var B;return(B=u.value)==null?void 0:B.chart},()=>{var B;(B=u.value)!=null&&B.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",V),u.value.chart.canvas.removeEventListener("dragSelectMove",lt),u.value.chart.canvas.addEventListener("dragSelect",V),u.value.chart.canvas.addEventListener("dragSelectMove",lt))}),d.onMounted(()=>{document.addEventListener("click",U,!0)}),d.onUnmounted(()=>{var B;(B=u.value)!=null&&B.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",V),u.value.chart.canvas.removeEventListener("dragSelectMove",lt)),document.removeEventListener("click",U,!0)}),(B,q)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",E(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:q[0]||(q[0]=J=>Q())},[n.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Wm),{key:k.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:d.unref(M),plugins:C.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Bm),{key:g.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:d.unref(M),plugins:C.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(xa,{"absolute-left":d.unref(D),"absolute-top":d.unref(P),"data-testid":"tooltip",granularity:n.granularity,state:S,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":x.value,onDimensions:R,onOnAction:q[1]||(q[1]=()=>I(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(Ll,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-ac6e8bbc"]]),DD={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},CD={class:"tooltip-content"},ED={key:2,class:"analytics-chart-parent"},OD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:xe.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},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(n,{emit:t}){const e=t,i=n,{i18n:s}=mt.useI18n(),r=d.computed(()=>b.value?mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||oa},d.toRef(i,"chartData")).value:mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||oa},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=d.computed(()=>{var I;if(!((I=i.chartData)!=null&&I.meta))return 0;if(i.chartData.meta.start&&i.chartData.meta.end){const F=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-F}}),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!==xe.Hidden),{legendValues:u}=mt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var I,F,$;return(($=(F=(I=i.chartData)==null?void 0:I.meta)==null?void 0:F.limit)==null?void 0:$.toString())||null}),f=d.computed(()=>{var I,F;return i.chartOptions.hideTruncationWarning?!1:((F=(I=i.chartData)==null?void 0:I.meta)==null?void 0:F.truncated)||!1}),m=d.computed(()=>s.t("limitedResultsShown",{maxReturned:h.value})),p=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),b=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),v=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),S=d.computed(()=>{var $,Q;if(!(($=i.chartData)!=null&&$.meta.metric_names)||!((Q=i.chartData)!=null&&Q.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[I]||"";if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}if(I)return Hs(F)&&s.te(`metricAxisTitles.${I}`)?s.t(`metricAxisTitles.${I}`)||void 0:s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),D=d.computed(()=>{var $,Q,V,lt;if(($=i.chartOptions)!=null&&$.metricAxesTitle)return(Q=i.chartOptions)==null?void 0:Q.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],F=i.chartData.meta.metric_units[I]||"";if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return s.te(`metricAxisTitles.${I}`)&&(Hs(F)||s.te(`chartUnits.${F}`))?Hs(F)?s.t(`metricAxisTitles.${I}`)||void 0:s.t(`metricAxisTitles.${I}`,{unit:s.t(`chartUnits.${F}`,{plural:"s"})})||void 0:I||void 0}),P=d.computed(()=>{var F;if((F=i.chartOptions)!=null&&F.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=b.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),O=d.computed(()=>{const I=tl(Number(i.chartData.meta.granularity_ms));if(I)return s.te(`granularityAxisTitles.${I}`)?s.t(`granularityAxisTitles.${I}`):I}),C=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),k=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),g=d.computed(()=>b.value?eM(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),_=d.computed(()=>i.chartData.meta.granularity_ms?tl(i.chartData.meta.granularity_ms)||"hourly":tl(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),M=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,F)=>I.text===s.t("chartLabels.____OTHER____")?1:F.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.text,10))&&!isNaN(parseInt(F.text,10))?I.text<F.text?-1:1:I.value&&F.value?F.value.raw-I.value.raw:0),E=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,F)=>I.label===s.t("chartLabels.____OTHER____")?1:F.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.label,10))&&!isNaN(parseInt(F.label,10))?I.label<F.label?-1:1:I.value&&F.value?F.rawValue-I.rawValue:0),R=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>e("zoom-time-range",I)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.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,F)=>{const $=d.resolveComponent("KTooltip"),Q=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["analytics-chart-shell",{"show-values":c.value}])},[g.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",DD,[d.createVNode($,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",CD,d.toDisplayString(m.value),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Xi.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(oM)})`,size:d.unref(cM)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),g.value?(d.openBlock(),d.createElementBlock("div",ED,[b.value?(d.openBlock(),d.createBlock(TD,{key:0,brush:a.value,"chart-data":r.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":E.value,"dimension-axes-title":O.value,fill:n.chartOptions.stacked,granularity:_.value,"legend-values":d.unref(u),"metric-axes-title":D.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":S.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":R.value,onSelectChartRange:F[0]||(F[0]=V=>e("select-chart-range",V)),onZoomTimeRange:F[1]||(F[1]=V=>e("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"])):p.value?(d.openBlock(),d.createBlock(eD,{key:1,annotations:n.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":E.value,"data-testid":"bar-chart-container","dimension-axes-title":P.value,"legend-values":d.unref(u),"metric-axes-title":D.value,"metric-unit":l.value,orientation:v.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":S.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(dD,{key:2,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors||d.unref(oa),"legend-position":n.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":P.value,"tooltip-metric-display":S.value,"tooltip-title":n.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(Q,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(C.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(k.value),1)]),_:1}))],2)}}}),PD=Ce(OD,[["__scopeId","data-v-1ff6f989"]]),AD={class:"chart-parent","data-testid":"gauge-chart-parent"},RD={class:"chart-totals-flex"},ID={key:1,class:"metric-small","data-testid":"gauge-chart-total"},LD=Ce(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:on},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.ref(Nl()),s=d.computed(()=>[t.chartData.datasets.reduce((m,p)=>(m.labels.push(p.label),m.borderColor.push(p.backgroundColor),m.backgroundColor.push(p.backgroundColor),m.data.push(p.data.reduce((b,x)=>b+x,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));mt.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.computed(()=>{var f;return Ys((f=s==null?void 0:s.value[0])==null?void 0:f.data[t.numerator],{capital:!0})}),l=d.computed(()=>{var f,m;return Ys(((f=s==null?void 0:s.value[0])==null?void 0:f.data[0])+((m=s==null?void 0:s.value[0])==null?void 0:m.data[1]),{capital:!0})}),c=d.computed(()=>{var f;return`color: ${(f=s==null?void 0:s.value[0])==null?void 0:f.backgroundColor[t.numerator]}`}),u=d.computed(()=>["full","single"].includes(t.metricDisplay)),h=d.computed(()=>t.metricDisplay==="full");return(f,m)=>(d.openBlock(),d.createElementBlock("div",AD,[d.createElementVNode("div",RD,[u.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(c.value)},d.toDisplayString(o.value),5)):d.createCommentVNode("",!0),h.value?(d.openBlock(),d.createElementBlock("div",ID,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(l.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(Hm),{"chart-id":i.value,data:r.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),ND={key:1,class:"single-value-wrapper"},FD={class:"single-value-metric"},zD={class:"name-unit-alignment"},BD={class:"single-value","data-testid":"single-value-chart"},HD={key:0,class:"single-value-unit"},WD={class:"single-value-metric-name"},YD={key:0,class:"single-value-trend"},VD={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},$D=Ce(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Ff},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(n){const{i18n:t}=mt.useI18n(),{formatBytes:e,formatCost:i}=Ei({i18n:t}),s=n,r=d.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),a=d.computed(()=>s.data.data),o=d.computed(()=>{var O,C;return(C=(O=s.data.meta)==null?void 0:O.metric_names)==null?void 0:C[0]}),l=d.computed(()=>t.te(`chartLabels.${o.value}`)?t.t(`chartLabels.${o.value}`):""),c=d.computed(()=>{var C,k;const O=o.value?(k=(C=s.data.meta)==null?void 0:C.metric_units)==null?void 0:k[o.value]:void 0;if(O){const g=`chartUnits.${O}`;return t.te(g)?t.t(g,{plural:""}):""}}),u=d.computed(()=>{var O;return o.value==="request_per_minute"||!!((O=o.value)!=null&&O.includes("_latency_"))||o.value==="error_rate"}),h=d.computed(()=>{if(!s.showTrend||a.value.length<2||!o.value)return null;const O=a.value[0].event[o.value];return typeof O!="number"||isNaN(O)?null:O}),f=d.computed(()=>{if(!o.value)return null;const O=s.showTrend?2:1,C=s.showTrend?1:0;if(a.value.length<O)return null;const k=a.value[C].event[o.value];return typeof k!="number"||isNaN(k)?null:k}),m=d.computed(()=>{var g,_,M;const O=f.value;if(O===null)return"";if((o.value?(_=(g=s.data.meta)==null?void 0:g.metric_units)==null?void 0:_[o.value]:void 0)==="usd")return i(O);if((M=o.value)!=null&&M.includes("_size_"))return e(O);if(O>=1e9){const E=(O/1e9).toFixed(1);return E.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${E}B`}if(O>=1e7){const E=(O/1e6).toFixed(1);return E.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${E}M`}const k=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:Ff;return O.toLocaleString("en-US",{maximumFractionDigits:k})}),p=d.computed(()=>Gi.calculateChange(f.value??0,h.value??0)||0),b=d.computed(()=>Gi.changePolarity(p.value,!0,s.increaseIsBad)),x=d.computed(()=>Gi.defineIcon(b.value)),v=d.computed(()=>Gi.metricChange(p.value,!0,t.t("singleValue.trend.not_available"))),S=Gi.useTrendRange(d.computed(()=>s.showTrend),void 0,d.computed(()=>s.data.meta)),D=O=>O>0?"positive":O<0?"negative":"neutral",P=O=>O>0?aM:O<0?rM:uf;return d.onMounted(()=>{var O,C,k,g;!s.showTrend&&((C=(O=s.data)==null?void 0:O.data)==null?void 0:C.length)>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&((g=(k=s.data)==null?void 0:k.data)==null?void 0:g.length)!==2&&console.warn("SingleValue with trend expects exactly 2 data points. Data length:",s.data.data.length)}),(O,C)=>{const k=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["chart-parent",r.value]),"data-testid":"single-value-parent"},[f.value===null?(d.openBlock(),d.createBlock(k,{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",ND,[d.createElementVNode("div",FD,[d.createElementVNode("div",zD,[d.createElementVNode("span",BD,d.toDisplayString(m.value),1),u.value&&c.value?(d.openBlock(),d.createElementBlock("span",HD," "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",WD,d.toDisplayString(l.value),1)]),n.showTrend?(d.openBlock(),d.createElementBlock("div",YD,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",D(b.value)]),"data-testid":"single-value-trend"},[b.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(x.value),{key:0,color:P(b.value),size:d.unref(Ns)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(Xi.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(uf)})`,size:d.unref(Ns)},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(v.value),1)],2),d.unref(S)?(d.openBlock(),d.createElementBlock("div",VD,d.toDisplayString(d.unref(S)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-645383c7"]]),jD={class:"simple-chart-shell"},UD={key:1,class:"analytics-chart-parent"},qD=Ce(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:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.computed(()=>{var u;const c=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=d.computed(()=>t.emptyStateTitle||e.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",jD,[l.value?(d.openBlock(),d.createElementBlock("div",UD,[r.value?(d.openBlock(),d.createBlock(LD,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),a.value?(d.openBlock(),d.createBlock($D,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.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"]]),XD={class:"top-n-card-title","data-testid":"top-n-card-title"},GD={class:"top-n-card-description","data-testid":"top-n-card-description"},KD={key:3,class:"top-n-table","data-testid":"top-n-table"},ZD={class:"top-n-table-table"},QD={"data-testid":"top-n-table-header"},JD={class:"top-n-table-header-row"},tC={class:"table-header-label"},eC={class:"top-n-table-cell top-n-table-cell--name"},nC=["data-testid"],iC=["data-testid"],sC=["data-testid"],rC=Ce(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=mt.useI18n(),{formatUnit:i}=Ei({i18n:e}),s=d.computed(()=>t.data.data),r=d.computed(()=>{var C;return!!((C=s.value)!=null&&C.length)}),a=d.computed(()=>{var C,k;return(C=t.data.meta)!=null&&C.display&&((k=Object.keys(t.data.meta.display))==null?void 0:k[0])||""}),o=d.computed(()=>a.value?t.data.meta.display[a.value]:{}),l=d.computed(()=>{var C,k;return(k=(C=t.data.meta)==null?void 0:C.metric_names)!=null&&k.length?t.data.meta.metric_names:[]}),c=d.computed(()=>l.value[0]),u=d.computed(()=>c.value?e.t(`chartLabels.${c.value}`)||c.value:""),h=d.computed(()=>{const C=[{key:"name",label:e.t("topNTable.nameLabel")}];return c.value&&C.push({key:"value",label:u.value}),l.value.forEach((k,g)=>{if(g===0)return;const _=e.t(`chartLabels.${k}`)||k;C.push({key:k,label:_})}),C}),f=d.computed(()=>h.value.filter(C=>C.key!=="name")),m=C=>{const k=C.event;return String(k[a.value])},p=C=>{const k=m(C),g=o.value&&o.value[k];return g?g.name:"-"},b=C=>{const k=m(C),g=o.value&&o.value[k];return g?!!g.deleted:!1},x=(C,k)=>{var R,I;const g=C.event[k];if(g==null)return"–";const _=typeof g=="number"?g:Number(g);if(Number.isNaN(_))return"–";const M=((I=(R=t.data.meta)==null?void 0:R.metric_units)==null?void 0:I[k])||"count",E=["count","count/minute","token count"].includes(M);return i(_,M,{approximate:E,isBytes1024:!0,translateUnit:F=>O(F,_)})},v=C=>c.value?x(C,c.value):"–",S=d.computed(()=>{var C;return(C=s.value)!=null&&C.length?s.value.map(k=>{const _={id:m(k),name:p(k),deleted:b(k),original:k};return c.value&&(_.value=v(k)),l.value.forEach((M,E)=>{E!==0&&(_[M]=x(k,M))}),_}):[]}),D=d.computed(()=>{if(!r.value)return"";if(t.data.meta){if(a.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!c.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),P=(C,k)=>{const g=C[k];return typeof g=="string"?g:g==null?"–":String(g)},O=(C,k)=>{if(Hs(C)||C==="count"||C==="requests")return"";const g=k===1?"":"s";return e.te(`chartUnits.${C}`)?e.t(`chartUnits.${C}`,{plural:g}):C};return(C,k)=>{const g=d.resolveComponent("KEmptyState"),_=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},d.createSlots({default:d.withCtx(()=>[D.value?(d.openBlock(),d.createBlock(g,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(D.value),1)]),_:1})):n.isLoading?(d.openBlock(),d.createBlock(_,{key:1,"table-columns":2,type:"table"})):r.value?(d.openBlock(),d.createElementBlock("div",KD,[d.createElementVNode("table",ZD,[d.createElementVNode("thead",QD,[d.createElementVNode("tr",JD,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.value,E=>(d.openBlock(),d.createElementBlock("th",{key:E.key,class:d.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":E.key!=="name"}]),"data-testid":"top-n-table-header-column"},[d.createElementVNode("span",tC,d.toDisplayString(E.label),1)],2))),128))])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(S.value,E=>(d.openBlock(),d.createElementBlock("tr",{key:E.id,class:"top-n-table-row"},[d.createElementVNode("td",eC,[d.createElementVNode("span",{"data-testid":`row-${E.id}`},[d.renderSlot(C.$slots,"name",{record:{id:E.id,name:E.name,deleted:E.deleted,dimension:a.value}},()=>[d.createTextVNode(d.toDisplayString(E.name),1)],!0)],8,nC)]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,R=>(d.openBlock(),d.createElementBlock("td",{key:R.key,class:"top-n-table-cell top-n-table-cell-metric"},[R.key==="value"?(d.openBlock(),d.createElementBlock("span",{key:0,"data-testid":`row-${E.id}`},d.toDisplayString(P(E,R.key)),9,iC)):(d.openBlock(),d.createElementBlock("span",{key:1,"data-testid":`row-${E.id}-${R.key}`},d.toDisplayString(P(E,R.key)),9,sC))]))),128))]))),128))])])])):(d.openBlock(),d.createBlock(g,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(n.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",XD,d.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",GD,d.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-f05687f1"]]);var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function jm(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wa={exports:{}};wa.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,a=2,o=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",p="[object GeneratorFunction]",b="[object Map]",x="[object Number]",v="[object Object]",S="[object Promise]",D="[object RegExp]",P="[object Set]",O="[object String]",C="[object Symbol]",k="[object WeakMap]",g="[object ArrayBuffer]",_="[object DataView]",M="[object Float32Array]",E="[object Float64Array]",R="[object Int8Array]",I="[object Int16Array]",F="[object Int32Array]",$="[object Uint8Array]",Q="[object Uint8ClampedArray]",V="[object Uint16Array]",lt="[object Uint32Array]",U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,B=/^\w*$/,q=/^\./,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,yt=/\\(\\)?/g,_t=/^\[object .+?Constructor\]$/,Y=/^(?:0|[1-9]\d*)$/,H={};H[M]=H[E]=H[R]=H[I]=H[F]=H[$]=H[Q]=H[V]=H[lt]=!0,H[l]=H[c]=H[g]=H[u]=H[_]=H[h]=H[f]=H[m]=H[b]=H[x]=H[v]=H[D]=H[P]=H[O]=H[k]=!1;var X=typeof we=="object"&&we&&we.Object===Object&&we,K=typeof self=="object"&&self&&self.Object===Object&&self,Z=X||K||Function("return this")(),G=t&&!t.nodeType&&t,gt=G&&!0&&n&&!n.nodeType&&n,vt=gt&>.exports===G,at=vt&&X.process,bt=function(){try{return at&&at.binding("util")}catch{}}(),dt=bt&&bt.isTypedArray;function jt(y,T){for(var N=-1,W=y?y.length:0;++N<W;)if(T(y[N],N,y))return!0;return!1}function ot(y){return function(T){return T==null?void 0:T[y]}}function Mt(y,T){for(var N=-1,W=Array(y);++N<y;)W[N]=T(N);return W}function ee(y){return function(T){return y(T)}}function le(y,T){return y==null?void 0:y[T]}function Ut(y){var T=!1;if(y!=null&&typeof y.toString!="function")try{T=!!(y+"")}catch{}return T}function Xe(y){var T=-1,N=Array(y.size);return y.forEach(function(W,ht){N[++T]=[ht,W]}),N}function Et(y,T){return function(N){return y(T(N))}}function ne(y){var T=-1,N=Array(y.size);return y.forEach(function(W){N[++T]=W}),N}var Ft=Array.prototype,qt=Function.prototype,ie=Object.prototype,Ge=Z["__core-js_shared__"],ai=function(){var y=/[^.]+$/.exec(Ge&&Ge.keys&&Ge.keys.IE_PROTO||"");return y?"Symbol(src)_1."+y:""}(),ze=qt.toString,zt=ie.hasOwnProperty,ve=ie.toString,oi=RegExp("^"+ze.call(zt).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),va=Z.Symbol,Ma=Z.Uint8Array,Zs=ie.propertyIsEnumerable,li=Ft.splice,Qs=Et(Object.keys,Object),ci=fn(Z,"DataView"),cn=fn(Z,"Map"),un=fn(Z,"Promise"),Js=fn(Z,"Set"),tr=fn(Z,"WeakMap"),ui=fn(Object,"create"),Wl=gn(ci),Yl=gn(cn),Sa=gn(un),ka=gn(Js),dn=gn(tr),Bi=va?va.prototype:void 0,er=Bi?Bi.valueOf:void 0,Ta=Bi?Bi.toString:void 0;function hn(y){var T=-1,N=y?y.length:0;for(this.clear();++T<N;){var W=y[T];this.set(W[0],W[1])}}function Vl(){this.__data__=ui?ui(null):{}}function Be(y){return this.has(y)&&delete this.__data__[y]}function $l(y){var T=this.__data__;if(ui){var N=T[y];return N===s?void 0:N}return zt.call(T,y)?T[y]:void 0}function jl(y){var T=this.__data__;return ui?T[y]!==void 0:zt.call(T,y)}function Ul(y,T){var N=this.__data__;return N[y]=ui&&T===void 0?s:T,this}hn.prototype.clear=Vl,hn.prototype.delete=Be,hn.prototype.get=$l,hn.prototype.has=jl,hn.prototype.set=Ul;function He(y){var T=-1,N=y?y.length:0;for(this.clear();++T<N;){var W=y[T];this.set(W[0],W[1])}}function ql(){this.__data__=[]}function Ln(y){var T=this.__data__,N=Yi(T,y);if(N<0)return!1;var W=T.length-1;return N==W?T.pop():li.call(T,N,1),!0}function Xl(y){var T=this.__data__,N=Yi(T,y);return N<0?void 0:T[N][1]}function Gl(y){return Yi(this.__data__,y)>-1}function Kl(y,T){var N=this.__data__,W=Yi(N,y);return W<0?N.push([y,T]):N[W][1]=T,this}He.prototype.clear=ql,He.prototype.delete=Ln,He.prototype.get=Xl,He.prototype.has=Gl,He.prototype.set=Kl;function We(y){var T=-1,N=y?y.length:0;for(this.clear();++T<N;){var W=y[T];this.set(W[0],W[1])}}function Zl(){this.__data__={hash:new hn,map:new(cn||He),string:new hn}}function Nn(y){return ji(this,y).delete(y)}function Ql(y){return ji(this,y).get(y)}function Jl(y){return ji(this,y).has(y)}function tc(y,T){return ji(this,y).set(y,T),this}We.prototype.clear=Zl,We.prototype.delete=Nn,We.prototype.get=Ql,We.prototype.has=Jl,We.prototype.set=tc;function Hi(y){var T=-1,N=y?y.length:0;for(this.__data__=new We;++T<N;)this.add(y[T])}function ec(y){return this.__data__.set(y,s),this}function nc(y){return this.__data__.has(y)}Hi.prototype.add=Hi.prototype.push=ec,Hi.prototype.has=nc;function Ie(y){this.__data__=new He(y)}function Wi(){this.__data__=new He}function ic(y){return this.__data__.delete(y)}function nr(y){return this.__data__.get(y)}function sc(y){return this.__data__.has(y)}function rc(y,T){var N=this.__data__;if(N instanceof He){var W=N.__data__;if(!cn||W.length<e-1)return W.push([y,T]),this;N=this.__data__=new We(W)}return N.set(y,T),this}Ie.prototype.clear=Wi,Ie.prototype.delete=ic,Ie.prototype.get=nr,Ie.prototype.has=sc,Ie.prototype.set=rc;function ac(y,T){var N=w(y)||Ra(y)?Mt(y.length,String):[],W=N.length,ht=!!W;for(var nt in y)zt.call(y,nt)&&!(ht&&(nt=="length"||sr(nt,W)))&&N.push(nt);return N}function Yi(y,T){for(var N=y.length;N--;)if(Aa(y[N][0],T))return N;return-1}var oc=yc();function lc(y,T){return y&&oc(y,T,hi)}function Vi(y,T){T=Ui(T,y)?[T]:Ke(T);for(var N=0,W=T.length;y!=null&&N<W;)y=y[mn(T[N++])];return N&&N==W?y:void 0}function cc(y){return ve.call(y)}function uc(y,T){return y!=null&&T in Object(y)}function ir(y,T,N,W,ht){return y===T?!0:y==null||T==null||!Xt(y)&&!Me(T)?y!==y&&T!==T:dc(y,T,ir,N,W,ht)}function dc(y,T,N,W,ht,nt){var pt=w(y),Gt=w(T),Bt=c,ue=c;pt||(Bt=ce(y),Bt=Bt==l?v:Bt),Gt||(ue=ce(T),ue=ue==l?v:ue);var Se=Bt==v&&!Ut(y),ke=ue==v&&!Ut(T),me=Bt==ue;if(me&&!Se)return nt||(nt=new Ie),pt||Ia(y)?Ea(y,T,N,W,ht,nt):bc(y,T,Bt,N,W,ht,nt);if(!(ht&a)){var Le=Se&&zt.call(y,"__wrapped__"),Ne=ke&&zt.call(T,"__wrapped__");if(Le||Ne){var Bn=Le?y.value():y,pn=Ne?T.value():T;return nt||(nt=new Ie),N(Bn,pn,W,ht,nt)}}return me?(nt||(nt=new Ie),_c(y,T,N,W,ht,nt)):!1}function hc(y,T,N,W){var ht=N.length,nt=ht;if(y==null)return!nt;for(y=Object(y);ht--;){var pt=N[ht];if(pt[2]?pt[1]!==y[pt[0]]:!(pt[0]in y))return!1}for(;++ht<nt;){pt=N[ht];var Gt=pt[0],Bt=y[Gt],ue=pt[1];if(pt[2]){if(Bt===void 0&&!(Gt in y))return!1}else{var Se=new Ie,ke;if(!(ke===void 0?ir(ue,Bt,W,r|a,Se):ke))return!1}}return!0}function fc(y){if(!Xt(y)||Oa(y))return!1;var T=et(y)||Ut(y)?oi:_t;return T.test(gn(y))}function mc(y){return Me(y)&&Yt(y.length)&&!!H[ve.call(y)]}function Da(y){return typeof y=="function"?y:y==null?qi:typeof y=="object"?w(y)?$i(y[0],y[1]):pc(y):ZC(y)}function gc(y){if(!vc(y))return Qs(y);var T=[];for(var N in Object(y))zt.call(y,N)&&N!="constructor"&&T.push(N);return T}function pc(y){var T=xc(y);return T.length==1&&T[0][2]?ar(T[0][0],T[0][1]):function(N){return N===y||hc(N,y,T)}}function $i(y,T){return Ui(y)&&Pa(T)?ar(mn(y),T):function(N){var W=La(N,y);return W===void 0&&W===T?Na(N,y):ir(T,W,void 0,r|a)}}function Fn(y){return function(T){return Vi(T,y)}}function Ca(y){if(typeof y=="string")return y;if(Jt(y))return Ta?Ta.call(y):"";var T=y+"";return T=="0"&&1/y==-1/0?"-0":T}function Ke(y){return w(y)?y:Mc(y)}function yc(y){return function(T,N,W){for(var ht=-1,nt=Object(T),pt=W(T),Gt=pt.length;Gt--;){var Bt=pt[++ht];if(N(nt[Bt],Bt,nt)===!1)break}return T}}function Ea(y,T,N,W,ht,nt){var pt=ht&a,Gt=y.length,Bt=T.length;if(Gt!=Bt&&!(pt&&Bt>Gt))return!1;var ue=nt.get(y);if(ue&&nt.get(T))return ue==T;var Se=-1,ke=!0,me=ht&r?new Hi:void 0;for(nt.set(y,T),nt.set(T,y);++Se<Gt;){var Le=y[Se],Ne=T[Se];if(W)var Bn=pt?W(Ne,Le,Se,T,y,nt):W(Le,Ne,Se,y,T,nt);if(Bn!==void 0){if(Bn)continue;ke=!1;break}if(me){if(!jt(T,function(pn,fi){if(!me.has(fi)&&(Le===pn||N(Le,pn,W,ht,nt)))return me.add(fi)})){ke=!1;break}}else if(!(Le===Ne||N(Le,Ne,W,ht,nt))){ke=!1;break}}return nt.delete(y),nt.delete(T),ke}function bc(y,T,N,W,ht,nt,pt){switch(N){case _:if(y.byteLength!=T.byteLength||y.byteOffset!=T.byteOffset)return!1;y=y.buffer,T=T.buffer;case g:return!(y.byteLength!=T.byteLength||!W(new Ma(y),new Ma(T)));case u:case h:case x:return Aa(+y,+T);case f:return y.name==T.name&&y.message==T.message;case D:case O:return y==T+"";case b:var Gt=Xe;case P:var Bt=nt&a;if(Gt||(Gt=ne),y.size!=T.size&&!Bt)return!1;var ue=pt.get(y);if(ue)return ue==T;nt|=r,pt.set(y,T);var Se=Ea(Gt(y),Gt(T),W,ht,nt,pt);return pt.delete(y),Se;case C:if(er)return er.call(y)==er.call(T)}return!1}function _c(y,T,N,W,ht,nt){var pt=ht&a,Gt=hi(y),Bt=Gt.length,ue=hi(T),Se=ue.length;if(Bt!=Se&&!pt)return!1;for(var ke=Bt;ke--;){var me=Gt[ke];if(!(pt?me in T:zt.call(T,me)))return!1}var Le=nt.get(y);if(Le&&nt.get(T))return Le==T;var Ne=!0;nt.set(y,T),nt.set(T,y);for(var Bn=pt;++ke<Bt;){me=Gt[ke];var pn=y[me],fi=T[me];if(W)var Jm=pt?W(fi,pn,me,T,y,nt):W(pn,fi,me,y,T,nt);if(!(Jm===void 0?pn===fi||N(pn,fi,W,ht,nt):Jm)){Ne=!1;break}Bn||(Bn=me=="constructor")}if(Ne&&!Bn){var Fa=y.constructor,za=T.constructor;Fa!=za&&"constructor"in y&&"constructor"in T&&!(typeof Fa=="function"&&Fa instanceof Fa&&typeof za=="function"&&za instanceof za)&&(Ne=!1)}return nt.delete(y),nt.delete(T),Ne}function ji(y,T){var N=y.__data__;return rr(T)?N[typeof T=="string"?"string":"hash"]:N.map}function xc(y){for(var T=hi(y),N=T.length;N--;){var W=T[N],ht=y[W];T[N]=[W,ht,Pa(ht)]}return T}function fn(y,T){var N=le(y,T);return fc(N)?N:void 0}var ce=cc;(ci&&ce(new ci(new ArrayBuffer(1)))!=_||cn&&ce(new cn)!=b||un&&ce(un.resolve())!=S||Js&&ce(new Js)!=P||tr&&ce(new tr)!=k)&&(ce=function(y){var T=ve.call(y),N=T==v?y.constructor:void 0,W=N?gn(N):void 0;if(W)switch(W){case Wl:return _;case Yl:return b;case Sa:return S;case ka:return P;case dn:return k}return T});function wc(y,T,N){T=Ui(T,y)?[T]:Ke(T);for(var W,ht=-1,pt=T.length;++ht<pt;){var nt=mn(T[ht]);if(!(W=y!=null&&N(y,nt)))break;y=y[nt]}if(W)return W;var pt=y?y.length:0;return!!pt&&Yt(pt)&&sr(nt,pt)&&(w(y)||Ra(y))}function sr(y,T){return T=T??o,!!T&&(typeof y=="number"||Y.test(y))&&y>-1&&y%1==0&&y<T}function Ui(y,T){if(w(y))return!1;var N=typeof y;return N=="number"||N=="symbol"||N=="boolean"||y==null||Jt(y)?!0:B.test(y)||!U.test(y)||T!=null&&y in Object(T)}function rr(y){var T=typeof y;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?y!=="__proto__":y===null}function Oa(y){return!!ai&&ai in y}function vc(y){var T=y&&y.constructor,N=typeof T=="function"&&T.prototype||ie;return y===N}function Pa(y){return y===y&&!Xt(y)}function ar(y,T){return function(N){return N==null?!1:N[y]===T&&(T!==void 0||y in Object(N))}}var Mc=di(function(y){y=zn(y);var T=[];return q.test(y)&&T.push(""),y.replace(J,function(N,W,ht,nt){T.push(ht?nt.replace(yt,"$1"):W||N)}),T});function mn(y){if(typeof y=="string"||Jt(y))return y;var T=y+"";return T=="0"&&1/y==-1/0?"-0":T}function gn(y){if(y!=null){try{return ze.call(y)}catch{}try{return y+""}catch{}}return""}function di(y,T){if(typeof y!="function"||T&&typeof T!="function")throw new TypeError(i);var N=function(){var W=arguments,ht=T?T.apply(this,W):W[0],nt=N.cache;if(nt.has(ht))return nt.get(ht);var pt=y.apply(this,W);return N.cache=nt.set(ht,pt),pt};return N.cache=new(di.Cache||We),N}di.Cache=We;function Aa(y,T){return y===T||y!==y&&T!==T}function Ra(y){return z(y)&&zt.call(y,"callee")&&(!Zs.call(y,"callee")||ve.call(y)==l)}var w=Array.isArray;function L(y){return y!=null&&Yt(y.length)&&!et(y)}function z(y){return Me(y)&&L(y)}function et(y){var T=Xt(y)?ve.call(y):"";return T==m||T==p}function Yt(y){return typeof y=="number"&&y>-1&&y%1==0&&y<=o}function Xt(y){var T=typeof y;return!!y&&(T=="object"||T=="function")}function Me(y){return!!y&&typeof y=="object"}function Jt(y){return typeof y=="symbol"||Me(y)&&ve.call(y)==C}var Ia=dt?ee(dt):mc;function zn(y){return y==null?"":Ca(y)}function La(y,T,N){var W=y==null?void 0:Vi(y,T);return W===void 0?N:W}function Na(y,T){return y!=null&&wc(y,T,uc)}function hi(y){return L(y)?ac(y):gc(y)}function or(y,T){var N={};return T=Da(T),lc(y,function(W,ht,nt){N[T(W,ht,nt)]=W}),N}function qi(y){return y}function ZC(y){return Ui(y)?ot(mn(y)):Fn(y)}n.exports=or}(wa,wa.exports);var aC=wa.exports;const oC=jm(aC);var lC=9007199254740991,cC="[object Arguments]",uC="[object Function]",dC="[object GeneratorFunction]",hC="[object Symbol]",fC=typeof we=="object"&&we&&we.Object===Object&&we,mC=typeof self=="object"&&self&&self.Object===Object&&self,gC=fC||mC||Function("return this")();function pC(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function yC(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function bC(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var Bl=Object.prototype,_C=Bl.hasOwnProperty,Hl=Bl.toString,Um=gC.Symbol,xC=Bl.propertyIsEnumerable,qm=Um?Um.isConcatSpreadable:void 0,Xm=Math.max;function wC(n,t,e,i,s){var r=-1,a=n.length;for(e||(e=kC),s||(s=[]);++r<a;){var o=n[r];e(o)?bC(s,o):s[s.length]=o}return s}function vC(n,t){return n=Object(n),MC(n,t,function(e,i){return i in n})}function MC(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var a=t[i],o=n[a];e(o,a)&&(r[a]=o)}return r}function SC(n,t){return t=Xm(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Xm(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=e[i];return a[t]=r,pC(n,this,a)}}function kC(n){return CC(n)||DC(n)||!!(qm&&n&&n[qm])}function TC(n){if(typeof n=="string"||IC(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function DC(n){return OC(n)&&_C.call(n,"callee")&&(!xC.call(n,"callee")||Hl.call(n)==cC)}var CC=Array.isArray;function EC(n){return n!=null&&AC(n.length)&&!PC(n)}function OC(n){return Gm(n)&&EC(n)}function PC(n){var t=RC(n)?Hl.call(n):"";return t==uC||t==dC}function AC(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=lC}function RC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Gm(n){return!!n&&typeof n=="object"}function IC(n){return typeof n=="symbol"||Gm(n)&&Hl.call(n)==hC}var LC=SC(function(n,t){return n==null?{}:vC(n,yC(wC(t),TC))}),NC=LC;const FC=jm(NC);var Km={exports:{}};(function(n,t){(function(e,i){i()})(we,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,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 s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof we=="object"&&we.global===we?we: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?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(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",p=/constructor/i.test(a.HTMLElement)||a.safari,b=/CriOS\/[\d]+/.test(navigator.userAgent);if((b||m&&p||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var D=x.result;D=b?D:D.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=D:location=D,f=null},x.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,S=v.createObjectURL(c);f?f.location=S:location.href=S,f=null,setTimeout(function(){v.revokeObjectURL(S)},4e4)}});a.saveAs=l.saveAs=l,n.exports=l})})(Km);var zC=Km.exports,Zm={exports:{}};/* @license
|
|
28
|
+
*/const sD={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"};Eu._date.override({_id:"date-fns",formats:function(){return sD},parse:function(n,t){if(n===null||typeof n>"u")return null;const e=typeof n;return e==="number"||n instanceof Date?n=ct(n):e==="string"&&(typeof t=="string"?n=_w(n,t,new Date,this.options):n=hh(n,this.options)),No(n)?n.getTime():null},format:function(n,t){return jr(n,t,this.options)},add:function(n,t,e){switch(e){case"millisecond":return Io(n,t);case"second":return m_(n,t);case"minute":return h_(n,t);case"hour":return c_(n,t);case"day":return Yr(n,t);case"week":return g_(n,t);case"month":return Ro(n,t);case"quarter":return f_(n,t);case"year":return p_(n,t);default:return n}},diff:function(n,t,e){switch(e){case"millisecond":return Fo(n,t);case"second":return S_(n,t);case"minute":return w_(n,t);case"hour":return x_(n,t);case"day":return jd(n,t);case"week":return k_(n,t);case"month":return Gd(n,t);case"quarter":return M_(n,t);case"year":return T_(n,t);default:return 0}},startOf:function(n,t,e){switch(t){case"second":return Mw(n);case"minute":return vw(n);case"hour":return ww(n);case"day":return Lo(n);case"week":return je(n);case"isoWeek":return je(n,{weekStartsOn:+e});case"month":return C_(n);case"quarter":return D_(n);case"year":return Kd(n);default:return n}},endOf:function(n,t){switch(t){case"second":return I_(n);case"minute":return A_(n);case"hour":return O_(n);case"day":return qd(n);case"week":return P_(n);case"month":return Xd(n);case"quarter":return R_(n);case"year":return E_(n);default:return n}}});const Fm={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},rD={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Fm,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},aD=d.version[0]==="2"?(n,t)=>Object.assign(n,{attrs:t}):(n,t)=>Object.assign(n,t);function Bi(n){return d.isProxy(n)?d.toRaw(n):n}function oD(n){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n;return d.isProxy(t)?new Proxy(n,{}):n}function lD(n,t){const e=n.options;e&&t&&Object.assign(e,t)}function Bm(n,t){n.labels=t}function zm(n,t,e){const i=[];n.datasets=t.map(s=>{const r=n.datasets.find(a=>a[e]===s[e]);return!r||!s.data||i.includes(r)?{...s}:(i.push(r),Object.assign(r,s),r)})}function cD(n,t){const e={labels:[],datasets:[]};return Bm(e,n.labels),zm(e,n.datasets,t),e}const uD=d.defineComponent({props:rD,setup(n,t){let{expose:e,slots:i}=t;const s=d.ref(null),r=d.shallowRef(null);e({chart:r});const a=()=>{if(!s.value)return;const{type:c,data:u,options:h,plugins:f,datasetIdKey:m}=n,p=cD(u,m),_=oD(p,u);r.value=new ye(s.value,{type:c,data:_,options:{...h},plugins:f})},o=()=>{const c=d.toRaw(r.value);c&&(n.destroyDelay>0?setTimeout(()=>{c.destroy(),r.value=null},n.destroyDelay):(c.destroy(),r.value=null))},l=c=>{c.update(n.updateMode)};return d.onMounted(a),d.onUnmounted(o),d.watch([()=>n.options,()=>n.data],(c,u)=>{let[h,f]=c,[m,p]=u;const _=d.toRaw(r.value);if(!_)return;let x=!1;if(h){const v=Bi(h),k=Bi(m);v&&v!==k&&(lD(_,v),x=!0)}if(f){const v=Bi(f.labels),k=Bi(p.labels),E=Bi(f.datasets),P=Bi(p.datasets);v!==k&&(Bm(_.config.data,v),x=!0),E&&E!==P&&(zm(_.config.data,E,n.datasetIdKey),x=!0)}x&&d.nextTick(()=>{l(_)})},{deep:!0}),()=>d.h("canvas",{role:"img","aria-label":n.ariaLabel,"aria-describedby":n.ariaDescribedby,ref:s},[d.h("p",{},[i.default?i.default():""])])}});function Fl(n,t){return ye.register(t),d.defineComponent({props:Fm,setup(e,i){let{expose:s}=i;const r=d.shallowRef(null),a=o=>{r.value=o==null?void 0:o.chart};return s({chart:r}),()=>d.h(uD,aD({ref:a},{type:n,...e}))}})}const Hm=Fl("bar",us),Wm=Fl("doughnut",sn),Vm=Fl("line",ds),dD={class:"chart-container"},hD={key:0,class:"chart-center-metric"},fD={class:"chart-center-total"},mD={key:0,class:"chart-center-unit"},gD=d.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},legendPosition:{default:xe.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},datasetColors:{default:()=>on},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!1}},setup(n){const t=n,{translateUnit:e}=mt.useTranslatedUnits(),{i18n:i}=mt.useI18n(),s=crypto.randomUUID(),r=crypto.randomUUID(),a=d.ref([]),o=d.useTemplateRef("chartParent"),l=d.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:d.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:d.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(t,"metricUnit"),translateUnit:e,offsetX:0,offsetY:0,width:0,height:0,chartID:r,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:c,tooltipAbsoluteTop:u}=mt.useTooltipAbsolutePosition(o,l),h={id:s,afterUpdate(S){a.value=S.options.plugins.legend.labels.generateLabels(S).map(g=>({...g,value:t.legendValues&&t.legendValues[g.text],hidden:!1}))}},f=d.computed(()=>[h]),m=d.computed(()=>[t.chartData.datasets.reduce((g,y)=>(g.labels.push(y.label),g.backgroundColor.push(y.backgroundColor),g.hoverBorderColor.push(hf(y.backgroundColor,50)),g.data.push(y.data.reduce((M,C)=>M+C,0)),g),{labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:3,hoverBorderColor:[],hoverBorderWidth:3,data:[],hoverOffset:10})]),{formatUnit:p}=ti({i18n:i}),_=d.computed(()=>Rf(t.metricUnit)),x=d.computed(()=>{var g;const S=((g=m.value[0])==null?void 0:g.data.reduce((y,M)=>y+M,0))??0;return p(S,t.metricUnit,{approximate:!0,translateUnit:(y,M)=>Rf(y)&&y!=="usd"?"":e(y,M)}).trim()}),v=d.computed(()=>t.tooltipMetricDisplay||""),k=d.computed(()=>({...t.chartData,datasets:m.value}));mt.useReportChartDataForSynthetics(d.toRef(t,"chartData"),d.toRef(t,"syntheticsDataKey"));const{options:E}=mt.useDonutChartOptions({tooltipState:l,legendID:s}),P=d.ref(),O=S=>({[xe.Bottom]:"column",[xe.Hidden]:"hidden"})[S],D=({width:S,height:g})=>{l.width=S,l.height=g};return(S,g)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",O(n.legendPosition)]),"data-testid":"donut-chart-parent"},[d.createElementVNode("div",dD,[d.createVNode(d.unref(Wm),{ref_key:"chartInstance",ref:P,"chart-id":d.unref(r),data:k.value,options:d.unref(E),plugins:f.value},null,8,["chart-id","data","options","plugins"]),n.showCenterMetric&&_.value?(d.openBlock(),d.createElementBlock("div",hD,[d.createElementVNode("span",fD,d.toDisplayString(x.value),1),v.value?(d.openBlock(),d.createElementBlock("span",mD,d.toDisplayString(v.value),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[d.createVNode(xa,{"absolute-left":d.unref(c),"absolute-top":d.unref(u),state:l,"tooltip-title":n.tooltipTitle,unit:n.metricUnit,onDimensions:D},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),d.createVNode(Ll,{id:d.unref(s),"chart-instance":P.value,items:a.value,position:n.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),pD=Ce(gD,[["__scopeId","data-v-6ef911d9"]]),Bl=(n,t,e,i,s="#0275d8")=>{n.save(),n.beginPath(),n.moveTo(t,e),n.lineTo(t,i),n.lineWidth=1,n.strokeStyle=s,n.stroke(),n.restore()},fe={},yD=()=>{fe.x=void 0,fe.chart=void 0,fe.strategy=void 0,fe.group=void 0},bD=10;class Ym{constructor({brushGroup:t=void 0,brushStrategy:e=void 0,enableBrushing:i=!1}={}){A(this,"id","verticalLinePlugin");A(this,"_clickedSegment");A(this,"_pause",!1);A(this,"_useBrushingState",!1);A(this,"_brushStrategy");A(this,"_brushGroup");A(this,"_lastMouseBrushEvent",0);let s=!1;e==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=e,this._brushGroup=t}afterEvent(t,e){if(!this._useBrushingState)return;const{event:i}=e;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}onMouseBrush(t,e,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<bD)return;const s=()=>{fe.chart=e,fe.strategy=this._brushStrategy,fe.group=this._brushGroup;for(const r of Object.values(ye.instances))r!==e&&r.update("none")};t==="mousemove"?e.tooltip&&e.tooltip.getActiveElements()&&e.tooltip.getActiveElements().length&&(fe.x=e.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(fe.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const e=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;Bl(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(e){const{x:s}=t.tooltip.dataPoints[0].element;Bl(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(fe.x===void 0)return;const e=fe.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&fe.group===this._brushGroup&&Bl(t.ctx,fe.x,t.scales.y.top,t.scales.y.bottom,e)}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&&fe.chart===t){const e=fe.x!==void 0;if(yD(),e)for(const i of Object.values(ye.instances))i!==t&&i.update("none")}}}const _D=(n,t,e)=>{const i=n.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,n.chartArea.top),i.lineTo(t,n.chartArea.bottom),i.moveTo(e,n.chartArea.top),i.lineTo(e,n.chartArea.bottom),i.stroke(),i.restore()},xD=(n,t,e)=>{const i=n.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,n.chartArea.top,e-t,n.chartArea.bottom-n.chartArea.top),i.restore()},$m=(n,t,e)=>{const i=t.scales.x.getValueForPixel(e.startX),s=t.scales.x.getValueForPixel(e.endX);i&&s&&t.canvas.dispatchEvent(new CustomEvent(n,{detail:{xStart:Math.min(i,s),xEnd:Math.max(i,s)}}))};class wD{constructor(){A(this,"id","dragSelectPlugin");A(this,"_isDragging",!1);A(this,"_startX",0);A(this,"_endX",0);A(this,"_dragTimeout");A(this,"_clearSelectionArea",!0);A(this,"_chart",null);A(this,"_dragSelectHandlers")}get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const e=t.canvas;let i=!1;const s=o=>{this._dragTimeout=window.setTimeout(()=>{const l=e.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=o.clientX-l.left},150)},r=o=>{const l=e.getBoundingClientRect();i&&this._isDragging&&(this._endX=o.clientX-l.left,$m("dragSelectMove",t,this))},a=o=>{const l=e.getBoundingClientRect();clearTimeout(this._dragTimeout),i&&this._isDragging&&(this._endX=o.clientX-l.left,$m("dragSelect",t,this),i=!1,this._isDragging=!1)};e.addEventListener("mousedown",s),e.addEventListener("mousemove",r),e.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:r,onMouseUp:a}}beforeDestroy(t){const e=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:r}=this._dragSelectHandlers;e.removeEventListener("mousedown",i),e.removeEventListener("mousemove",s),e.removeEventListener("mouseup",r)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(xD(t,this._startX,this._endX),_D(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const vD=["hidden","single","full"];var ai=(n=>(n.String="string",n.Number="number",n.Boolean="boolean",n.Object="object",n.Undefined="undefined",n))(ai||{});const MD=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar"],SD=["gauge","top_n","single_value"],kD=20,TD="rgba(255, 171, 171, 0.4)",DD="rgba(255, 196, 0, 0.2)",jm=(n,t,e)=>{const i=t.y-n.y;if(i===0)return t.x;const s=(e-n.y)/i;return n.x+s*(t.x-n.x)},CD=(n,t)=>{const e=[];return n.data.datasets.forEach(i=>{if(!n.getDatasetMeta(n.data.datasets.indexOf(i)).visible)return;const r=i.data;r!=null&&r.length&&t.filter(a=>a.highlightIntersections).forEach(a=>{const o=r.map(c=>({ts:c.x,aboveThreshold:c.y>=a.value}));let l=o[0].aboveThreshold?r[0].x:void 0;for(let c=1;c<o.length;c++)!o[c-1].aboveThreshold&&o[c].aboveThreshold?l=jm(r[c-1],r[c],a.value):o[c-1].aboveThreshold&&!o[c].aboveThreshold&&l!==void 0&&(e.push({start:l,end:jm(r[c-1],r[c],a.value),type:a.type}),l=void 0);l!==void 0&&e.push({start:l,end:o[o.length-1].ts,type:a.type})})}),e},ED=n=>{if(!n.length)return[];n.sort((e,i)=>e.type.localeCompare(i.type)||e.start-i.start);const t=[];for(const e of n){const i=t.findLast(({type:s})=>s===e.type);i&&e.start<=i.end?i.end=Math.max(i.end,e.end):t.push({...e})}return t};class OD{constructor(t){A(this,"id","thresholdPlugin");A(this,"_thresholds");A(this,"_mouseMoveHandler");this.i18n=t}_syncThresholds(t){var e,i;for(const s of Object.keys(t.threshold||{})){const r=(e=t.threshold)==null?void 0:e[s];r&&(this._thresholds={...this._thresholds,[s]:r.map(a=>({...a,hovered:!1}))})}if(this._thresholds)for(const s of Object.keys(this._thresholds))(i=t.threshold)!=null&&i[s]||delete this._thresholds[s]}get thresholds(){return this._thresholds}beforeUpdate(t,e,i){this._syncThresholds(i)}beforeInit(t,e,i){const s=t.canvas;this._syncThresholds(i);const r=a=>{var o;if(t){const l=a.clientY,c=t.scales.y,u=s.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(p=>{p.hovered=Math.abs(p.value-h)<kD})}}};s.addEventListener("mousemove",r),this._mouseMoveHandler=r}afterDatasetsDraw(t,e){var s;const i=t.ctx;for(const r of Object.keys(this._thresholds||{})){const a=(s=this._thresholds)==null?void 0:s[r];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=aa(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=aa(c.type),i.font=dM,i.fillText(f,t.chartArea.left,h-4),i.restore())});const o=CD(t,a);ED(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"?TD:DD,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=aa(c.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const PD=Ce(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:(n,t)=>n.value&&t.value&&t.value.raw-n.value.raw},chartTooltipSortFn:{type:Function,default:(n,t)=>t.rawValue-n.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(n,{emit:t}){const e=n,i=t,{i18n:s}=mt.useI18n(),r=new Ym,a=new Lm,o=new wD,l=new OD(s),{translateUnit:c}=mt.useTranslatedUnits(),u=d.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=d.ref([]),p=d.inject("legendPosition",xe.Bottom),_=d.useTemplateRef("chartParent"),x=d.ref(void 0),v=d.ref(!1),k=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:d.toRef(e,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:d.toRef(e,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:e.type,chartID:f,chartTooltipSortFn:e.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:E,tooltipAbsoluteTop:P}=mt.useTooltipAbsolutePosition(_,k),O={id:h,afterUpdate(z){m.value=af(z,e.legendValues,e.chartLegendSortFn)}},D=d.computed(()=>[O,a,...e.brush?[o]:[],...e.type==="timeseries_line"?[r]:[],...e.threshold?[l]:[]]),S=d.computed(()=>`line-${D.value.map(z=>z.id).join("-")}`),g=d.computed(()=>`bar-${D.value.map(z=>z.id).join("-")}`),y=d.computed(()=>e.chartData&&eM(e.chartData)),{options:M}=mt.useLineChartOptions({tooltipState:k,timeRangeMs:d.toRef(e,"timeRangeMs"),granularity:d.toRef(e,"granularity"),legendID:h,stacked:d.toRef(e,"stacked"),metricAxesTitle:d.toRef(e,"metricAxesTitle"),dimensionAxesTitle:d.toRef(e,"dimensionAxesTitle"),pointsWithoutHover:y,threshold:d.toRef(e,"threshold")});mt.useReportChartDataForSynthetics(d.toRef(e,"chartData"),d.toRef(e,"syntheticsDataKey"));const C=z=>({[xe.Bottom]:"column",[xe.Hidden]:"hidden"})[z],R=({width:z,height:q})=>{k.width=z,k.height=q},I=(z=!0)=>{k.interactionMode="idle",k.showTooltip=!1,o.clearSelectionArea(),a.isPaused&&a.resume(z),r.isPaused&&r.resume()},F=()=>{k.interactionMode="interactive"},$=()=>{var z,q;!u.value||!((q=(z=u.value.chart.tooltip)==null?void 0:z.dataPoints)!=null&&q.length)||(k.interactionMode==="interactive"?r.clickedSegment=u.value.chart.tooltip.dataPoints[0]:r.destroyClickedSegment())},Q=()=>{if(v.value){v.value=!1;return}k.interactionMode!=="idle"?I():F(),$()};d.watch(()=>e.type,()=>{k.interactionMode="idle",k.showTooltip=!1,r.destroyClickedSegment()});const Y=z=>{z.preventDefault(),z.stopPropagation();const{xStart:q,xEnd:J}=z.detail;q&&J&&(x.value={start:new Date(q),end:new Date(J),type:"absolute"},k.interactionMode="zoom-interactive",i("select-chart-range",x.value))},lt=z=>{k.interactionMode="selecting-chart-area",v.value=!0,r.pause(),a.pause();const{xStart:q,xEnd:J}=z.detail;q&&J&&(x.value={start:new Date(q),end:new Date(J),type:"absolute"})},U=z=>{if(!_.value||k.interactionMode==="idle")return;const q=z.target;q&&_.value.contains(q)||v.value||I(!1)};return d.watch(()=>{var z;return(z=u.value)==null?void 0:z.chart},()=>{var z;(z=u.value)!=null&&z.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",Y),u.value.chart.canvas.removeEventListener("dragSelectMove",lt),u.value.chart.canvas.addEventListener("dragSelect",Y),u.value.chart.canvas.addEventListener("dragSelectMove",lt))}),d.onMounted(()=>{document.addEventListener("click",U,!0)}),d.onUnmounted(()=>{var z;(z=u.value)!=null&&z.chart&&(u.value.chart.canvas.removeEventListener("dragSelect",Y),u.value.chart.canvas.removeEventListener("dragSelectMove",lt)),document.removeEventListener("click",U,!0)}),(z,q)=>(d.openBlock(),d.createElementBlock("div",{ref:"chartParent",class:d.normalizeClass(["chart-parent",C(d.unref(p))]),"data-testid":"line-chart-parent"},[d.createElementVNode("div",{class:"chart-container",onClick:q[0]||(q[0]=J=>Q())},[n.type==="timeseries_line"?(d.openBlock(),d.createBlock(d.unref(Vm),{key:S.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-line-chart",options:d.unref(M),plugins:D.value},null,8,["chart-id","data","options","plugins"])):n.type==="timeseries_bar"?(d.openBlock(),d.createBlock(d.unref(Hm),{key:g.value,ref_key:"chartInstance",ref:u,"chart-id":d.unref(f),class:"chart-canvas",data:n.chartData,"data-testid":"time-series-bar-chart",options:d.unref(M),plugins:D.value},null,8,["chart-id","data","options","plugins"])):d.createCommentVNode("",!0)]),d.createVNode(xa,{"absolute-left":d.unref(E),"absolute-top":d.unref(P),"data-testid":"tooltip",granularity:n.granularity,state:k,"tooltip-title":n.tooltipTitle,"zoom-action-items":n.zoomActionItems,"zoom-time-range":x.value,onDimensions:R,onOnAction:q[1]||(q[1]=()=>I(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),d.createVNode(Ll,{id:d.unref(h),"chart-instance":u.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-ac6e8bbc"]]),AD={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},RD={class:"tooltip-content"},ID={key:2,class:"analytics-chart-parent"},LD=d.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:xe.Bottom},syntheticsDataKey:{default:""},showLegendValues:{type:Boolean,default:!1},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(n,{emit:t}){const e=t,i=n,{i18n:s}=mt.useI18n(),r=d.computed(()=>_.value?mt.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||oa},d.toRef(i,"chartData")).value:mt.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||oa},d.toRef(i,"chartData")).value),a=d.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),o=d.computed(()=>{var I;if(!((I=i.chartData)!=null&&I.meta))return 0;if(i.chartData.meta.start&&i.chartData.meta.end){const F=new Date(i.chartData.meta.start).getTime();return new Date(i.chartData.meta.end).getTime()-F}}),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!==xe.Hidden),{legendValues:u}=mt.useChartLegendValues(r,i.chartOptions.type,l),h=d.computed(()=>{var I,F,$;return(($=(F=(I=i.chartData)==null?void 0:I.meta)==null?void 0:F.limit)==null?void 0:$.toString())||null}),f=d.computed(()=>{var I,F;return i.chartOptions.hideTruncationWarning?!1:((F=(I=i.chartData)==null?void 0:I.meta)==null?void 0:F.truncated)||!1}),m=d.computed(()=>s.t("limitedResultsShown",{maxReturned:h.value})),p=d.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),_=d.computed(()=>["timeseries_bar","timeseries_line"].some(I=>I===i.chartOptions.type)),x=d.computed(()=>i.chartOptions.type==="donut"),v=d.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),k=d.computed(()=>{var $,Q;if(!(($=i.chartData)!=null&&$.meta.metric_names)||!((Q=i.chartData)!=null&&Q.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[I]||"";if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}if(I)return Hs(F)&&s.te(`metricAxisTitles.${I}`)?s.t(`metricAxisTitles.${I}`)||void 0:s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),E=d.computed(()=>{var $,Q,Y,lt;if(($=i.chartOptions)!=null&&$.metricAxesTitle)return(Q=i.chartOptions)==null?void 0:Q.metricAxesTitle;if(!((Y=i.chartData)!=null&&Y.meta.metric_names)||!((lt=i.chartData)!=null&<.meta.metric_units))return;const I=i.chartData.meta.metric_names[0],F=i.chartData.meta.metric_units[I]||"";if(i.chartData.meta.metric_names.length>1){if(I.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})});if(I.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${F}`,{plural:"s"})})}return s.te(`metricAxisTitles.${I}`)&&(Hs(F)||s.te(`chartUnits.${F}`))?Hs(F)?s.t(`metricAxisTitles.${I}`)||void 0:s.t(`metricAxisTitles.${I}`,{unit:s.t(`chartUnits.${F}`,{plural:"s"})})||void 0:I||void 0}),P=d.computed(()=>{var F;if((F=i.chartOptions)!=null&&F.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const I=_.value?"Time":Object.keys(i.chartData.meta.display||i.chartData.meta.metric_names)[0];if(I)return s.te(`chartLabels.${I}`)?s.t(`chartLabels.${I}`):I}),O=d.computed(()=>{const I=tl(Number(i.chartData.meta.granularity_ms));if(I)return s.te(`granularityAxisTitles.${I}`)?s.t(`granularityAxisTitles.${I}`):I}),D=d.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),S=d.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),g=d.computed(()=>_.value?nM(r.value):i.chartData&&i.chartData.meta&&i.chartData.data.length),y=d.computed(()=>i.chartData.meta.granularity_ms?tl(i.chartData.meta.granularity_ms)||"hourly":tl(new Date(i.chartData.data[1].timestamp).getTime()-new Date(i.chartData.data[0].timestamp).getTime())||"hourly"),M=d.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(I,F)=>I.text===s.t("chartLabels.____OTHER____")?1:F.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.text,10))&&!isNaN(parseInt(F.text,10))?I.text<F.text?-1:1:I.value&&F.value?F.value.raw-I.value.raw:0),C=d.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(I,F)=>I.label===s.t("chartLabels.____OTHER____")?1:F.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(I.label,10))&&!isNaN(parseInt(F.label,10))?I.label<F.label?-1:1:I.value&&F.value?F.rawValue-I.rawValue:0),R=d.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:I=>e("zoom-time-range",I)}]:[],...i.exploreLink?[{label:s.t("zoom_action_items.explore"),key:"explore",href:i.exploreLink.href}]:[],...i.requestsLink?[{label:s.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,F)=>{const $=d.resolveComponent("KTooltip"),Q=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["analytics-chart-shell",{"show-values":c.value}])},[g.value&&f.value&&h.value?(d.openBlock(),d.createElementBlock("div",AD,[d.createVNode($,{class:"tooltip","max-width":"500",placement:"right"},{content:d.withCtx(()=>[d.createElementVNode("div",RD,d.toDisplayString(m.value),1)]),default:d.withCtx(()=>[d.createVNode(d.unref(Xi.WarningIcon),{color:`var(--kui-color-text-warning, ${d.unref(lM)})`,size:d.unref(uM)},null,8,["color","size"])]),_:1})])):d.createCommentVNode("",!0),g.value?(d.openBlock(),d.createElementBlock("div",ID,[_.value?(d.openBlock(),d.createBlock(PD,{key:0,brush:a.value,"chart-data":r.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":C.value,"dimension-axes-title":O.value,fill:n.chartOptions.stacked,granularity:y.value,"legend-values":d.unref(u),"metric-axes-title":E.value,"metric-unit":l.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,threshold:n.chartOptions.threshold,"time-range-ms":o.value,"tooltip-metric-display":k.value,"tooltip-title":n.tooltipTitle,type:n.chartOptions.type,"zoom-action-items":R.value,onSelectChartRange:F[0]||(F[0]=Y=>e("select-chart-range",Y)),onZoomTimeRange:F[1]||(F[1]=Y=>e("zoom-time-range",Y))},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"])):p.value?(d.openBlock(),d.createBlock(iD,{key:1,annotations:n.showAnnotations,"chart-data":r.value,"chart-legend-sort-fn":M.value,"chart-tooltip-sort-fn":C.value,"data-testid":"bar-chart-container","dimension-axes-title":P.value,"legend-values":d.unref(u),"metric-axes-title":E.value,"metric-unit":l.value,orientation:v.value,stacked:n.chartOptions.stacked,"synthetics-data-key":n.syntheticsDataKey,"tooltip-metric-display":k.value,"tooltip-title":n.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):x.value?(d.openBlock(),d.createBlock(pD,{key:2,"chart-data":r.value,"dataset-colors":n.chartOptions.chartDatasetColors||d.unref(oa),"legend-position":n.legendPosition,"legend-values":d.unref(u),"metric-unit":l.value,"show-center-metric":n.chartOptions.showCenterMetric,"synthetics-data-key":n.syntheticsDataKey,"tooltip-dimension-display":P.value,"tooltip-metric-display":k.value,"tooltip-title":n.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):d.createCommentVNode("",!0)])):(d.openBlock(),d.createBlock(Q,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(D.value),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(S.value),1)]),_:1}))],2)}}}),ND=Ce(LD,[["__scopeId","data-v-0f65cbd1"]]),FD={class:"chart-parent","data-testid":"gauge-chart-parent"},BD={class:"chart-totals-flex"},zD={key:1,class:"metric-small","data-testid":"gauge-chart-total"},HD=Ce(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:on},height:{type:String,required:!1,default:"400px",validator:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.ref(Nl()),s=d.computed(()=>[t.chartData.datasets.reduce((m,p)=>(m.labels.push(p.label),m.borderColor.push(p.backgroundColor),m.backgroundColor.push(p.backgroundColor),m.data.push(p.data.reduce((_,x)=>_+x,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),r=d.computed(()=>({...t.chartData,datasets:s.value}));mt.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.computed(()=>{var f;return Vs((f=s==null?void 0:s.value[0])==null?void 0:f.data[t.numerator],{capital:!0})}),l=d.computed(()=>{var f,m;return Vs(((f=s==null?void 0:s.value[0])==null?void 0:f.data[0])+((m=s==null?void 0:s.value[0])==null?void 0:m.data[1]),{capital:!0})}),c=d.computed(()=>{var f;return`color: ${(f=s==null?void 0:s.value[0])==null?void 0:f.backgroundColor[t.numerator]}`}),u=d.computed(()=>["full","single"].includes(t.metricDisplay)),h=d.computed(()=>t.metricDisplay==="full");return(f,m)=>(d.openBlock(),d.createElementBlock("div",FD,[d.createElementVNode("div",BD,[u.value?(d.openBlock(),d.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:d.normalizeStyle(c.value)},d.toDisplayString(o.value),5)):d.createCommentVNode("",!0),h.value?(d.openBlock(),d.createElementBlock("div",zD,d.toDisplayString(d.unref(e).t("total"))+": "+d.toDisplayString(l.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",{class:"chart-container",style:d.normalizeStyle({height:n.height,width:n.width})},[d.createVNode(d.unref(Wm),{"chart-id":i.value,data:r.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),WD={key:1,class:"single-value-wrapper"},VD={class:"single-value-metric"},YD={class:"name-unit-alignment"},$D={class:"single-value","data-testid":"single-value-chart"},jD={key:0,class:"single-value-unit"},UD={class:"single-value-metric-name"},qD={key:0,class:"single-value-trend"},XD={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},GD=Ce(d.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Bf},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"space-evenly"}},setup(n){const{i18n:t}=mt.useI18n(),{formatBytes:e,formatCost:i}=ti({i18n:t}),s=n,r=d.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),a=d.computed(()=>s.data.data),o=d.computed(()=>{var O,D;return(D=(O=s.data.meta)==null?void 0:O.metric_names)==null?void 0:D[0]}),l=d.computed(()=>t.te(`chartLabels.${o.value}`)?t.t(`chartLabels.${o.value}`):""),c=d.computed(()=>{var D,S;const O=o.value?(S=(D=s.data.meta)==null?void 0:D.metric_units)==null?void 0:S[o.value]:void 0;if(O){const g=`chartUnits.${O}`;return t.te(g)?t.t(g,{plural:""}):""}}),u=d.computed(()=>{var O;return o.value==="request_per_minute"||!!((O=o.value)!=null&&O.includes("_latency_"))||o.value==="error_rate"}),h=d.computed(()=>{if(!s.showTrend||a.value.length<2||!o.value)return null;const O=a.value[0].event[o.value];return typeof O!="number"||isNaN(O)?null:O}),f=d.computed(()=>{if(!o.value)return null;const O=s.showTrend?2:1,D=s.showTrend?1:0;if(a.value.length<O)return null;const S=a.value[D].event[o.value];return typeof S!="number"||isNaN(S)?null:S}),m=d.computed(()=>{var g,y,M;const O=f.value;if(O===null)return"";if((o.value?(y=(g=s.data.meta)==null?void 0:g.metric_units)==null?void 0:y[o.value]:void 0)==="usd")return i(O);if((M=o.value)!=null&&M.includes("_size_"))return e(O);if(O>=1e9){const C=(O/1e9).toFixed(1);return C.endsWith(".0")?`${Math.floor(O/1e9)}B`:`${C}B`}if(O>=1e7){const C=(O/1e6).toFixed(1);return C.endsWith(".0")?`${Math.floor(O/1e6)}M`:`${C}M`}const S=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:Bf;return O.toLocaleString("en-US",{maximumFractionDigits:S})}),p=d.computed(()=>Gi.calculateChange(f.value??0,h.value??0)||0),_=d.computed(()=>Gi.changePolarity(p.value,!0,s.increaseIsBad)),x=d.computed(()=>Gi.defineIcon(_.value)),v=d.computed(()=>Gi.metricChange(p.value,!0,t.t("singleValue.trend.not_available"))),k=Gi.useTrendRange(d.computed(()=>s.showTrend),void 0,d.computed(()=>s.data.meta)),E=O=>O>0?"positive":O<0?"negative":"neutral",P=O=>O>0?oM:O<0?aM:uf;return d.onMounted(()=>{var O,D,S,g;!s.showTrend&&((D=(O=s.data)==null?void 0:O.data)==null?void 0:D.length)>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&((g=(S=s.data)==null?void 0:S.data)==null?void 0:g.length)!==2&&console.warn("SingleValue with trend expects exactly 2 data points. Data length:",s.data.data.length)}),(O,D)=>{const S=d.resolveComponent("KEmptyState");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["chart-parent",r.value]),"data-testid":"single-value-parent"},[f.value===null?(d.openBlock(),d.createBlock(S,{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",WD,[d.createElementVNode("div",VD,[d.createElementVNode("div",YD,[d.createElementVNode("span",$D,d.toDisplayString(m.value),1),u.value&&c.value?(d.openBlock(),d.createElementBlock("span",jD," "+d.toDisplayString(c.value),1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",UD,d.toDisplayString(l.value),1)]),n.showTrend?(d.openBlock(),d.createElementBlock("div",qD,[d.createElementVNode("div",{class:d.normalizeClass(["trend-change",E(_.value)]),"data-testid":"single-value-trend"},[_.value!==0?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(x.value),{key:0,color:P(_.value),size:d.unref(Ns)},null,8,["color","size"])):(d.openBlock(),d.createBlock(d.unref(Xi.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${d.unref(uf)})`,size:d.unref(Ns)},null,8,["color","size"])),d.createElementVNode("div",null,d.toDisplayString(v.value),1)],2),d.unref(k)?(d.openBlock(),d.createElementBlock("div",XD,d.toDisplayString(d.unref(k)),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-645383c7"]]),KD={class:"simple-chart-shell"},ZD={key:1,class:"analytics-chart-parent"},QD=Ce(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:n=>/(\d *)(px|%)/.test(n)},width:{type:String,required:!1,default:"100%",validator:n=>/(\d *)(px|%)/.test(n)}},setup(n){const t=n,{i18n:e}=mt.useI18n(),i=d.computed(()=>{var u;const c=mt.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||on},d.toRef(t,"chartData")).value;return(u=t.chartOptions)!=null&&u.reverseDataset&&(c==null||c.datasets.reverse()),c}),s=d.computed(()=>{var c;return(c=t.chartData.meta)!=null&&c.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""}),r=d.computed(()=>t.chartOptions.type==="gauge"),a=d.computed(()=>t.chartOptions.type==="single_value"),o=d.computed(()=>t.emptyStateTitle||e.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",KD,[l.value?(d.openBlock(),d.createElementBlock("div",ZD,[r.value?(d.openBlock(),d.createBlock(HD,{key:0,"chart-data":i.value,"dataset-colors":n.chartOptions.chartDatasetColors,"is-simple":"","metric-display":n.chartOptions.metricDisplay,"metric-unit":s.value,numerator:n.chartOptions.numerator,"synthetics-data-key":n.syntheticsDataKey,width:n.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):d.createCommentVNode("",!0),a.value?(d.openBlock(),d.createBlock(GD,{key:1,"align-x":n.chartOptions.alignX,data:n.chartData,"decimal-points":n.chartOptions.decimalPoints,"increase-is-bad":n.chartOptions.increaseIsBad,"show-trend":n.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"]]),JD={class:"top-n-card-title","data-testid":"top-n-card-title"},tC={class:"top-n-card-description","data-testid":"top-n-card-description"},eC={key:3,class:"top-n-table","data-testid":"top-n-table"},nC={class:"top-n-table-table"},iC={"data-testid":"top-n-table-header"},sC={class:"top-n-table-header-row"},rC={class:"table-header-label"},aC={class:"top-n-table-cell top-n-table-cell--name"},oC=["data-testid"],lC=["data-testid"],cC=["data-testid"],uC=Ce(d.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"}},setup(n){const t=n,{i18n:e}=mt.useI18n(),{formatUnit:i}=ti({i18n:e}),s=d.computed(()=>t.data.data),r=d.computed(()=>{var D;return!!((D=s.value)!=null&&D.length)}),a=d.computed(()=>{var D,S;return(D=t.data.meta)!=null&&D.display&&((S=Object.keys(t.data.meta.display))==null?void 0:S[0])||""}),o=d.computed(()=>a.value?t.data.meta.display[a.value]:{}),l=d.computed(()=>{var D,S;return(S=(D=t.data.meta)==null?void 0:D.metric_names)!=null&&S.length?t.data.meta.metric_names:[]}),c=d.computed(()=>l.value[0]),u=d.computed(()=>c.value?e.t(`chartLabels.${c.value}`)||c.value:""),h=d.computed(()=>{const D=[{key:"name",label:e.t("topNTable.nameLabel")}];return c.value&&D.push({key:"value",label:u.value}),l.value.forEach((S,g)=>{if(g===0)return;const y=e.t(`chartLabels.${S}`)||S;D.push({key:S,label:y})}),D}),f=d.computed(()=>h.value.filter(D=>D.key!=="name")),m=D=>{const S=D.event;return String(S[a.value])},p=D=>{const S=m(D),g=o.value&&o.value[S];return g?g.name:"-"},_=D=>{const S=m(D),g=o.value&&o.value[S];return g?!!g.deleted:!1},x=(D,S)=>{var R,I;const g=D.event[S];if(g==null)return"–";const y=typeof g=="number"?g:Number(g);if(Number.isNaN(y))return"–";const M=((I=(R=t.data.meta)==null?void 0:R.metric_units)==null?void 0:I[S])||"count",C=["count","count/minute","token count"].includes(M);return i(y,M,{approximate:C,isBytes1024:!0,translateUnit:F=>O(F,y)})},v=D=>c.value?x(D,c.value):"–",k=d.computed(()=>{var D;return(D=s.value)!=null&&D.length?s.value.map(S=>{const y={id:m(S),name:p(S),deleted:_(S),original:S};return c.value&&(y.value=v(S)),l.value.forEach((M,C)=>{C!==0&&(y[M]=x(S,M))}),y}):[]}),E=d.computed(()=>{if(!r.value)return"";if(t.data.meta){if(a.value&&!Object.keys(o.value).length)return e.t("topNTable.errors.display");if(!c.value)return e.t("topNTable.errors.metricNames")}else return e.t("topNTable.errors.meta");return""}),P=(D,S)=>{const g=D[S];return typeof g=="string"?g:g==null?"–":String(g)},O=(D,S)=>{if(Hs(D)||D==="count"||D==="requests")return"";const g=S===1?"":"s";return e.te(`chartUnits.${D}`)?e.t(`chartUnits.${D}`,{plural:g}):D};return(D,S)=>{const g=d.resolveComponent("KEmptyState"),y=d.resolveComponent("KSkeleton"),M=d.resolveComponent("KCard");return d.openBlock(),d.createBlock(M,{class:"kong-ui-public-top-n-table","title-tag":n.titleTag},d.createSlots({default:d.withCtx(()=>[E.value?(d.openBlock(),d.createBlock(g,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("topNTable.defaultErrorStateTitle")),1)]),default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(E.value),1)]),_:1})):n.isLoading?(d.openBlock(),d.createBlock(y,{key:1,"table-columns":2,type:"table"})):r.value?(d.openBlock(),d.createElementBlock("div",eC,[d.createElementVNode("table",nC,[d.createElementVNode("thead",iC,[d.createElementVNode("tr",sC,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.value,C=>(d.openBlock(),d.createElementBlock("th",{key:C.key,class:d.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":C.key!=="name"}]),"data-testid":"top-n-table-header-column"},[d.createElementVNode("span",rC,d.toDisplayString(C.label),1)],2))),128))])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(k.value,C=>(d.openBlock(),d.createElementBlock("tr",{key:C.id,class:"top-n-table-row"},[d.createElementVNode("td",aC,[d.createElementVNode("span",{"data-testid":`row-${C.id}`},[d.renderSlot(D.$slots,"name",{record:{id:C.id,name:C.name,deleted:C.deleted,dimension:a.value}},()=>[d.createTextVNode(d.toDisplayString(C.name),1)],!0)],8,oC)]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,R=>(d.openBlock(),d.createElementBlock("td",{key:R.key,class:"top-n-table-cell top-n-table-cell-metric"},[R.key==="value"?(d.openBlock(),d.createElementBlock("span",{key:0,"data-testid":`row-${C.id}`},d.toDisplayString(P(C,R.key)),9,lC)):(d.openBlock(),d.createElementBlock("span",{key:1,"data-testid":`row-${C.id}-${R.key}`},d.toDisplayString(P(C,R.key)),9,cC))]))),128))]))),128))])])])):(d.openBlock(),d.createBlock(g,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(n.emptyStateTitle||d.unref(e).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[n.title?{name:"title",fn:d.withCtx(()=>[d.createElementVNode("span",JD,d.toDisplayString(n.title),1)]),key:"0"}:void 0,n.description?{name:"actions",fn:d.withCtx(()=>[d.createElementVNode("div",tC,d.toDisplayString(n.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-f05687f1"]]);var we=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Um(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var wa={exports:{}};wa.exports,function(n,t){var e=200,i="Expected a function",s="__lodash_hash_undefined__",r=1,a=2,o=9007199254740991,l="[object Arguments]",c="[object Array]",u="[object Boolean]",h="[object Date]",f="[object Error]",m="[object Function]",p="[object GeneratorFunction]",_="[object Map]",x="[object Number]",v="[object Object]",k="[object Promise]",E="[object RegExp]",P="[object Set]",O="[object String]",D="[object Symbol]",S="[object WeakMap]",g="[object ArrayBuffer]",y="[object DataView]",M="[object Float32Array]",C="[object Float64Array]",R="[object Int8Array]",I="[object Int16Array]",F="[object Int32Array]",$="[object Uint8Array]",Q="[object Uint8ClampedArray]",Y="[object Uint16Array]",lt="[object Uint32Array]",U=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,z=/^\w*$/,q=/^\./,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/[\\^$.*+?()[\]{}|]/g,yt=/\\(\\)?/g,_t=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,H={};H[M]=H[C]=H[R]=H[I]=H[F]=H[$]=H[Q]=H[Y]=H[lt]=!0,H[l]=H[c]=H[g]=H[u]=H[y]=H[h]=H[f]=H[m]=H[_]=H[x]=H[v]=H[E]=H[P]=H[O]=H[S]=!1;var X=typeof we=="object"&&we&&we.Object===Object&&we,K=typeof self=="object"&&self&&self.Object===Object&&self,Z=X||K||Function("return this")(),G=t&&!t.nodeType&&t,gt=G&&!0&&n&&!n.nodeType&&n,vt=gt&>.exports===G,at=vt&&X.process,bt=function(){try{return at&&at.binding("util")}catch{}}(),dt=bt&&bt.isTypedArray;function jt(b,T){for(var N=-1,W=b?b.length:0;++N<W;)if(T(b[N],N,b))return!0;return!1}function ot(b){return function(T){return T==null?void 0:T[b]}}function Mt(b,T){for(var N=-1,W=Array(b);++N<b;)W[N]=T(N);return W}function ee(b){return function(T){return b(T)}}function le(b,T){return b==null?void 0:b[T]}function Ut(b){var T=!1;if(b!=null&&typeof b.toString!="function")try{T=!!(b+"")}catch{}return T}function Xe(b){var T=-1,N=Array(b.size);return b.forEach(function(W,ht){N[++T]=[ht,W]}),N}function Et(b,T){return function(N){return b(T(N))}}function ne(b){var T=-1,N=Array(b.size);return b.forEach(function(W){N[++T]=W}),N}var Ft=Array.prototype,qt=Function.prototype,ie=Object.prototype,Ge=Z["__core-js_shared__"],oi=function(){var b=/[^.]+$/.exec(Ge&&Ge.keys&&Ge.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""}(),Be=qt.toString,Bt=ie.hasOwnProperty,ve=ie.toString,li=RegExp("^"+Be.call(Bt).replace(j,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),va=Z.Symbol,Ma=Z.Uint8Array,Zs=ie.propertyIsEnumerable,ci=Ft.splice,Qs=Et(Object.keys,Object),ui=fn(Z,"DataView"),cn=fn(Z,"Map"),un=fn(Z,"Promise"),Js=fn(Z,"Set"),tr=fn(Z,"WeakMap"),di=fn(Object,"create"),Wl=gn(ui),Vl=gn(cn),Sa=gn(un),ka=gn(Js),dn=gn(tr),zi=va?va.prototype:void 0,er=zi?zi.valueOf:void 0,Ta=zi?zi.toString:void 0;function hn(b){var T=-1,N=b?b.length:0;for(this.clear();++T<N;){var W=b[T];this.set(W[0],W[1])}}function Yl(){this.__data__=di?di(null):{}}function ze(b){return this.has(b)&&delete this.__data__[b]}function $l(b){var T=this.__data__;if(di){var N=T[b];return N===s?void 0:N}return Bt.call(T,b)?T[b]:void 0}function jl(b){var T=this.__data__;return di?T[b]!==void 0:Bt.call(T,b)}function Ul(b,T){var N=this.__data__;return N[b]=di&&T===void 0?s:T,this}hn.prototype.clear=Yl,hn.prototype.delete=ze,hn.prototype.get=$l,hn.prototype.has=jl,hn.prototype.set=Ul;function He(b){var T=-1,N=b?b.length:0;for(this.clear();++T<N;){var W=b[T];this.set(W[0],W[1])}}function ql(){this.__data__=[]}function Ln(b){var T=this.__data__,N=Vi(T,b);if(N<0)return!1;var W=T.length-1;return N==W?T.pop():ci.call(T,N,1),!0}function Xl(b){var T=this.__data__,N=Vi(T,b);return N<0?void 0:T[N][1]}function Gl(b){return Vi(this.__data__,b)>-1}function Kl(b,T){var N=this.__data__,W=Vi(N,b);return W<0?N.push([b,T]):N[W][1]=T,this}He.prototype.clear=ql,He.prototype.delete=Ln,He.prototype.get=Xl,He.prototype.has=Gl,He.prototype.set=Kl;function We(b){var T=-1,N=b?b.length:0;for(this.clear();++T<N;){var W=b[T];this.set(W[0],W[1])}}function Zl(){this.__data__={hash:new hn,map:new(cn||He),string:new hn}}function Nn(b){return ji(this,b).delete(b)}function Ql(b){return ji(this,b).get(b)}function Jl(b){return ji(this,b).has(b)}function tc(b,T){return ji(this,b).set(b,T),this}We.prototype.clear=Zl,We.prototype.delete=Nn,We.prototype.get=Ql,We.prototype.has=Jl,We.prototype.set=tc;function Hi(b){var T=-1,N=b?b.length:0;for(this.__data__=new We;++T<N;)this.add(b[T])}function ec(b){return this.__data__.set(b,s),this}function nc(b){return this.__data__.has(b)}Hi.prototype.add=Hi.prototype.push=ec,Hi.prototype.has=nc;function Ie(b){this.__data__=new He(b)}function Wi(){this.__data__=new He}function ic(b){return this.__data__.delete(b)}function nr(b){return this.__data__.get(b)}function sc(b){return this.__data__.has(b)}function rc(b,T){var N=this.__data__;if(N instanceof He){var W=N.__data__;if(!cn||W.length<e-1)return W.push([b,T]),this;N=this.__data__=new We(W)}return N.set(b,T),this}Ie.prototype.clear=Wi,Ie.prototype.delete=ic,Ie.prototype.get=nr,Ie.prototype.has=sc,Ie.prototype.set=rc;function ac(b,T){var N=w(b)||Ra(b)?Mt(b.length,String):[],W=N.length,ht=!!W;for(var nt in b)Bt.call(b,nt)&&!(ht&&(nt=="length"||sr(nt,W)))&&N.push(nt);return N}function Vi(b,T){for(var N=b.length;N--;)if(Aa(b[N][0],T))return N;return-1}var oc=yc();function lc(b,T){return b&&oc(b,T,fi)}function Yi(b,T){T=Ui(T,b)?[T]:Ke(T);for(var N=0,W=T.length;b!=null&&N<W;)b=b[mn(T[N++])];return N&&N==W?b:void 0}function cc(b){return ve.call(b)}function uc(b,T){return b!=null&&T in Object(b)}function ir(b,T,N,W,ht){return b===T?!0:b==null||T==null||!Xt(b)&&!Me(T)?b!==b&&T!==T:dc(b,T,ir,N,W,ht)}function dc(b,T,N,W,ht,nt){var pt=w(b),Gt=w(T),zt=c,ue=c;pt||(zt=ce(b),zt=zt==l?v:zt),Gt||(ue=ce(T),ue=ue==l?v:ue);var Se=zt==v&&!Ut(b),ke=ue==v&&!Ut(T),me=zt==ue;if(me&&!Se)return nt||(nt=new Ie),pt||Ia(b)?Ea(b,T,N,W,ht,nt):bc(b,T,zt,N,W,ht,nt);if(!(ht&a)){var Le=Se&&Bt.call(b,"__wrapped__"),Ne=ke&&Bt.call(T,"__wrapped__");if(Le||Ne){var zn=Le?b.value():b,pn=Ne?T.value():T;return nt||(nt=new Ie),N(zn,pn,W,ht,nt)}}return me?(nt||(nt=new Ie),_c(b,T,N,W,ht,nt)):!1}function hc(b,T,N,W){var ht=N.length,nt=ht;if(b==null)return!nt;for(b=Object(b);ht--;){var pt=N[ht];if(pt[2]?pt[1]!==b[pt[0]]:!(pt[0]in b))return!1}for(;++ht<nt;){pt=N[ht];var Gt=pt[0],zt=b[Gt],ue=pt[1];if(pt[2]){if(zt===void 0&&!(Gt in b))return!1}else{var Se=new Ie,ke;if(!(ke===void 0?ir(ue,zt,W,r|a,Se):ke))return!1}}return!0}function fc(b){if(!Xt(b)||Oa(b))return!1;var T=et(b)||Ut(b)?li:_t;return T.test(gn(b))}function mc(b){return Me(b)&&Vt(b.length)&&!!H[ve.call(b)]}function Da(b){return typeof b=="function"?b:b==null?qi:typeof b=="object"?w(b)?$i(b[0],b[1]):pc(b):nE(b)}function gc(b){if(!vc(b))return Qs(b);var T=[];for(var N in Object(b))Bt.call(b,N)&&N!="constructor"&&T.push(N);return T}function pc(b){var T=xc(b);return T.length==1&&T[0][2]?ar(T[0][0],T[0][1]):function(N){return N===b||hc(N,b,T)}}function $i(b,T){return Ui(b)&&Pa(T)?ar(mn(b),T):function(N){var W=La(N,b);return W===void 0&&W===T?Na(N,b):ir(T,W,void 0,r|a)}}function Fn(b){return function(T){return Yi(T,b)}}function Ca(b){if(typeof b=="string")return b;if(Jt(b))return Ta?Ta.call(b):"";var T=b+"";return T=="0"&&1/b==-1/0?"-0":T}function Ke(b){return w(b)?b:Mc(b)}function yc(b){return function(T,N,W){for(var ht=-1,nt=Object(T),pt=W(T),Gt=pt.length;Gt--;){var zt=pt[++ht];if(N(nt[zt],zt,nt)===!1)break}return T}}function Ea(b,T,N,W,ht,nt){var pt=ht&a,Gt=b.length,zt=T.length;if(Gt!=zt&&!(pt&&zt>Gt))return!1;var ue=nt.get(b);if(ue&&nt.get(T))return ue==T;var Se=-1,ke=!0,me=ht&r?new Hi:void 0;for(nt.set(b,T),nt.set(T,b);++Se<Gt;){var Le=b[Se],Ne=T[Se];if(W)var zn=pt?W(Ne,Le,Se,T,b,nt):W(Le,Ne,Se,b,T,nt);if(zn!==void 0){if(zn)continue;ke=!1;break}if(me){if(!jt(T,function(pn,mi){if(!me.has(mi)&&(Le===pn||N(Le,pn,W,ht,nt)))return me.add(mi)})){ke=!1;break}}else if(!(Le===Ne||N(Le,Ne,W,ht,nt))){ke=!1;break}}return nt.delete(b),nt.delete(T),ke}function bc(b,T,N,W,ht,nt,pt){switch(N){case y:if(b.byteLength!=T.byteLength||b.byteOffset!=T.byteOffset)return!1;b=b.buffer,T=T.buffer;case g:return!(b.byteLength!=T.byteLength||!W(new Ma(b),new Ma(T)));case u:case h:case x:return Aa(+b,+T);case f:return b.name==T.name&&b.message==T.message;case E:case O:return b==T+"";case _:var Gt=Xe;case P:var zt=nt&a;if(Gt||(Gt=ne),b.size!=T.size&&!zt)return!1;var ue=pt.get(b);if(ue)return ue==T;nt|=r,pt.set(b,T);var Se=Ea(Gt(b),Gt(T),W,ht,nt,pt);return pt.delete(b),Se;case D:if(er)return er.call(b)==er.call(T)}return!1}function _c(b,T,N,W,ht,nt){var pt=ht&a,Gt=fi(b),zt=Gt.length,ue=fi(T),Se=ue.length;if(zt!=Se&&!pt)return!1;for(var ke=zt;ke--;){var me=Gt[ke];if(!(pt?me in T:Bt.call(T,me)))return!1}var Le=nt.get(b);if(Le&&nt.get(T))return Le==T;var Ne=!0;nt.set(b,T),nt.set(T,b);for(var zn=pt;++ke<zt;){me=Gt[ke];var pn=b[me],mi=T[me];if(W)var tg=pt?W(mi,pn,me,T,b,nt):W(pn,mi,me,b,T,nt);if(!(tg===void 0?pn===mi||N(pn,mi,W,ht,nt):tg)){Ne=!1;break}zn||(zn=me=="constructor")}if(Ne&&!zn){var Fa=b.constructor,Ba=T.constructor;Fa!=Ba&&"constructor"in b&&"constructor"in T&&!(typeof Fa=="function"&&Fa instanceof Fa&&typeof Ba=="function"&&Ba instanceof Ba)&&(Ne=!1)}return nt.delete(b),nt.delete(T),Ne}function ji(b,T){var N=b.__data__;return rr(T)?N[typeof T=="string"?"string":"hash"]:N.map}function xc(b){for(var T=fi(b),N=T.length;N--;){var W=T[N],ht=b[W];T[N]=[W,ht,Pa(ht)]}return T}function fn(b,T){var N=le(b,T);return fc(N)?N:void 0}var ce=cc;(ui&&ce(new ui(new ArrayBuffer(1)))!=y||cn&&ce(new cn)!=_||un&&ce(un.resolve())!=k||Js&&ce(new Js)!=P||tr&&ce(new tr)!=S)&&(ce=function(b){var T=ve.call(b),N=T==v?b.constructor:void 0,W=N?gn(N):void 0;if(W)switch(W){case Wl:return y;case Vl:return _;case Sa:return k;case ka:return P;case dn:return S}return T});function wc(b,T,N){T=Ui(T,b)?[T]:Ke(T);for(var W,ht=-1,pt=T.length;++ht<pt;){var nt=mn(T[ht]);if(!(W=b!=null&&N(b,nt)))break;b=b[nt]}if(W)return W;var pt=b?b.length:0;return!!pt&&Vt(pt)&&sr(nt,pt)&&(w(b)||Ra(b))}function sr(b,T){return T=T??o,!!T&&(typeof b=="number"||V.test(b))&&b>-1&&b%1==0&&b<T}function Ui(b,T){if(w(b))return!1;var N=typeof b;return N=="number"||N=="symbol"||N=="boolean"||b==null||Jt(b)?!0:z.test(b)||!U.test(b)||T!=null&&b in Object(T)}function rr(b){var T=typeof b;return T=="string"||T=="number"||T=="symbol"||T=="boolean"?b!=="__proto__":b===null}function Oa(b){return!!oi&&oi in b}function vc(b){var T=b&&b.constructor,N=typeof T=="function"&&T.prototype||ie;return b===N}function Pa(b){return b===b&&!Xt(b)}function ar(b,T){return function(N){return N==null?!1:N[b]===T&&(T!==void 0||b in Object(N))}}var Mc=hi(function(b){b=Bn(b);var T=[];return q.test(b)&&T.push(""),b.replace(J,function(N,W,ht,nt){T.push(ht?nt.replace(yt,"$1"):W||N)}),T});function mn(b){if(typeof b=="string"||Jt(b))return b;var T=b+"";return T=="0"&&1/b==-1/0?"-0":T}function gn(b){if(b!=null){try{return Be.call(b)}catch{}try{return b+""}catch{}}return""}function hi(b,T){if(typeof b!="function"||T&&typeof T!="function")throw new TypeError(i);var N=function(){var W=arguments,ht=T?T.apply(this,W):W[0],nt=N.cache;if(nt.has(ht))return nt.get(ht);var pt=b.apply(this,W);return N.cache=nt.set(ht,pt),pt};return N.cache=new(hi.Cache||We),N}hi.Cache=We;function Aa(b,T){return b===T||b!==b&&T!==T}function Ra(b){return B(b)&&Bt.call(b,"callee")&&(!Zs.call(b,"callee")||ve.call(b)==l)}var w=Array.isArray;function L(b){return b!=null&&Vt(b.length)&&!et(b)}function B(b){return Me(b)&&L(b)}function et(b){var T=Xt(b)?ve.call(b):"";return T==m||T==p}function Vt(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=o}function Xt(b){var T=typeof b;return!!b&&(T=="object"||T=="function")}function Me(b){return!!b&&typeof b=="object"}function Jt(b){return typeof b=="symbol"||Me(b)&&ve.call(b)==D}var Ia=dt?ee(dt):mc;function Bn(b){return b==null?"":Ca(b)}function La(b,T,N){var W=b==null?void 0:Yi(b,T);return W===void 0?N:W}function Na(b,T){return b!=null&&wc(b,T,uc)}function fi(b){return L(b)?ac(b):gc(b)}function or(b,T){var N={};return T=Da(T),lc(b,function(W,ht,nt){N[T(W,ht,nt)]=W}),N}function qi(b){return b}function nE(b){return Ui(b)?ot(mn(b)):Fn(b)}n.exports=or}(wa,wa.exports);var dC=wa.exports;const hC=Um(dC);var fC=9007199254740991,mC="[object Arguments]",gC="[object Function]",pC="[object GeneratorFunction]",yC="[object Symbol]",bC=typeof we=="object"&&we&&we.Object===Object&&we,_C=typeof self=="object"&&self&&self.Object===Object&&self,xC=bC||_C||Function("return this")();function wC(n,t,e){switch(e.length){case 0:return n.call(t);case 1:return n.call(t,e[0]);case 2:return n.call(t,e[0],e[1]);case 3:return n.call(t,e[0],e[1],e[2])}return n.apply(t,e)}function vC(n,t){for(var e=-1,i=n?n.length:0,s=Array(i);++e<i;)s[e]=t(n[e],e,n);return s}function MC(n,t){for(var e=-1,i=t.length,s=n.length;++e<i;)n[s+e]=t[e];return n}var zl=Object.prototype,SC=zl.hasOwnProperty,Hl=zl.toString,qm=xC.Symbol,kC=zl.propertyIsEnumerable,Xm=qm?qm.isConcatSpreadable:void 0,Gm=Math.max;function TC(n,t,e,i,s){var r=-1,a=n.length;for(e||(e=OC),s||(s=[]);++r<a;){var o=n[r];e(o)?MC(s,o):s[s.length]=o}return s}function DC(n,t){return n=Object(n),CC(n,t,function(e,i){return i in n})}function CC(n,t,e){for(var i=-1,s=t.length,r={};++i<s;){var a=t[i],o=n[a];e(o,a)&&(r[a]=o)}return r}function EC(n,t){return t=Gm(t===void 0?n.length-1:t,0),function(){for(var e=arguments,i=-1,s=Gm(e.length-t,0),r=Array(s);++i<s;)r[i]=e[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=e[i];return a[t]=r,wC(n,this,a)}}function OC(n){return RC(n)||AC(n)||!!(Xm&&n&&n[Xm])}function PC(n){if(typeof n=="string"||zC(n))return n;var t=n+"";return t=="0"&&1/n==-1/0?"-0":t}function AC(n){return LC(n)&&SC.call(n,"callee")&&(!kC.call(n,"callee")||Hl.call(n)==mC)}var RC=Array.isArray;function IC(n){return n!=null&&FC(n.length)&&!NC(n)}function LC(n){return Km(n)&&IC(n)}function NC(n){var t=BC(n)?Hl.call(n):"";return t==gC||t==pC}function FC(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=fC}function BC(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function Km(n){return!!n&&typeof n=="object"}function zC(n){return typeof n=="symbol"||Km(n)&&Hl.call(n)==yC}var HC=EC(function(n,t){return n==null?{}:DC(n,vC(TC(t),PC))}),WC=HC;const VC=Um(WC);var Zm={exports:{}};(function(n,t){(function(e,i){i()})(we,function(){function e(c,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(c.type)?new Blob(["\uFEFF",c],{type:c.type}):c}function i(c,u,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 s(c){var u=new XMLHttpRequest;u.open("HEAD",c,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function r(c){try{c.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),c.dispatchEvent(u)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof we=="object"&&we.global===we?we: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?r(m):s(m.href)?i(c,u,h):r(m,m.target="_blank")):(m.href=f.createObjectURL(c),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){r(m)},0))}:"msSaveOrOpenBlob"in navigator?function(c,u,h){if(u=u||c.name||"download",typeof c!="string")navigator.msSaveOrOpenBlob(e(c,h),u);else if(s(c))i(c,u,h);else{var f=document.createElement("a");f.href=c,f.target="_blank",setTimeout(function(){r(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",p=/constructor/i.test(a.HTMLElement)||a.safari,_=/CriOS\/[\d]+/.test(navigator.userAgent);if((_||m&&p||o)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var E=x.result;E=_?E:E.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=E:location=E,f=null},x.readAsDataURL(c)}else{var v=a.URL||a.webkitURL,k=v.createObjectURL(c);f?f.location=k:location.href=k,f=null,setTimeout(function(){v.revokeObjectURL(k)},4e4)}});a.saveAs=l.saveAs=l,n.exports=l})})(Zm);var YC=Zm.exports,Qm={exports:{}};/* @license
|
|
29
29
|
Papa Parse
|
|
30
30
|
v5.5.3
|
|
31
31
|
https://github.com/mholt/PapaParse
|
|
32
32
|
License: MIT
|
|
33
|
-
*/(function(n,t){((e,i)=>{n.exports=i()})(we,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,o={},l=0,c={};function u(g){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(
|
|
33
|
+
*/(function(n,t){((e,i)=>{n.exports=i()})(we,function e(){var i=typeof self<"u"?self:typeof window<"u"?window:i!==void 0?i:{},s,r=!i.document&&!!i.postMessage,a=i.IS_PAPA_WORKER||!1,o={},l=0,c={};function u(g){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(y){var M=O(y);M.chunkSize=parseInt(M.chunkSize),y.step||y.chunk||(M.chunkSize=null),this._handle=new _(M),(this._handle.streamer=this)._config=M}).call(this,g),this.parseChunk=function(y,M){var C=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<C){let I=this._config.newline;I||(R=this._config.quoteChar||'"',I=this._handle.guessLineEndings(y,R)),y=[...y.split(I).slice(C)].join(I)}this.isFirstChunk&&S(this._config.beforeFirstChunk)&&(R=this._config.beforeFirstChunk(y))!==void 0&&(y=R),this.isFirstChunk=!1,this._halted=!1;var C=this._partialLine+y,R=(this._partialLine="",this._handle.parse(C,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(y=R.meta.cursor,C=(this._finished||(this._partialLine=C.substring(y-this._baseIndex),this._baseIndex=y),R&&R.data&&(this._rowCount+=R.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),a)i.postMessage({results:R,workerId:c.WORKER_ID,finished:C});else if(S(this._config.chunk)&&!M){if(this._config.chunk(R,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=R=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(R.data),this._completeResults.errors=this._completeResults.errors.concat(R.errors),this._completeResults.meta=R.meta),this._completed||!C||!S(this._config.complete)||R&&R.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),C||R&&R.meta.paused||this._nextChunk(),R}this._halted=!0},this._sendError=function(y){S(this._config.error)?this._config.error(y):a&&this._config.error&&i.postMessage({workerId:c.WORKER_ID,error:y,finished:!1})}}function h(g){var y;(g=g||{}).chunkSize||(g.chunkSize=c.RemoteChunkSize),u.call(this,g),this._nextChunk=r?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(M){this._input=M,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(y=new XMLHttpRequest,this._config.withCredentials&&(y.withCredentials=this._config.withCredentials),r||(y.onload=D(this._chunkLoaded,this),y.onerror=D(this._chunkError,this)),y.open(this._config.downloadRequestBody?"POST":"GET",this._input,!r),this._config.downloadRequestHeaders){var M,C=this._config.downloadRequestHeaders;for(M in C)y.setRequestHeader(M,C[M])}var R;this._config.chunkSize&&(R=this._start+this._config.chunkSize-1,y.setRequestHeader("Range","bytes="+this._start+"-"+R));try{y.send(this._config.downloadRequestBody)}catch(I){this._chunkError(I.message)}r&&y.status===0&&this._chunkError()}},this._chunkLoaded=function(){y.readyState===4&&(y.status<200||400<=y.status?this._chunkError():(this._start+=this._config.chunkSize||y.responseText.length,this._finished=!this._config.chunkSize||this._start>=(M=>(M=M.getResponseHeader("Content-Range"))!==null?parseInt(M.substring(M.lastIndexOf("/")+1)):-1)(y),this.parseChunk(y.responseText)))},this._chunkError=function(M){M=y.statusText||M,this._sendError(new Error(M))}}function f(g){(g=g||{}).chunkSize||(g.chunkSize=c.LocalChunkSize),u.call(this,g);var y,M,C=typeof FileReader<"u";this.stream=function(R){this._input=R,M=R.slice||R.webkitSlice||R.mozSlice,C?((y=new FileReader).onload=D(this._chunkLoaded,this),y.onerror=D(this._chunkError,this)):y=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var R=this._input,I=(this._config.chunkSize&&(I=Math.min(this._start+this._config.chunkSize,this._input.size),R=M.call(R,this._start,I)),y.readAsText(R,this._config.encoding));C||this._chunkLoaded({target:{result:I}})},this._chunkLoaded=function(R){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(R.target.result)},this._chunkError=function(){this._sendError(y.error)}}function m(g){var y;u.call(this,g=g||{}),this.stream=function(M){return y=M,this._nextChunk()},this._nextChunk=function(){var M,C;if(!this._finished)return M=this._config.chunkSize,y=M?(C=y.substring(0,M),y.substring(M)):(C=y,""),this._finished=!y,this.parseChunk(C)}}function p(g){u.call(this,g=g||{});var y=[],M=!0,C=!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(R){this._input=R,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){C&&y.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),y.length?this.parseChunk(y.shift()):M=!0},this._streamData=D(function(R){try{y.push(typeof R=="string"?R:R.toString(this._config.encoding)),M&&(M=!1,this._checkIsFinished(),this.parseChunk(y.shift()))}catch(I){this._streamError(I)}},this),this._streamError=D(function(R){this._streamCleanUp(),this._sendError(R)},this),this._streamEnd=D(function(){this._streamCleanUp(),C=!0,this._streamData("")},this),this._streamCleanUp=D(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function _(g){var y,M,C,R,I=Math.pow(2,53),F=-I,$=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,Q=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,Y=this,lt=0,U=0,z=!1,q=!1,J=[],j={data:[],errors:[],meta:{}};function yt(X){return g.skipEmptyLines==="greedy"?X.join("").trim()==="":X.length===1&&X[0].length===0}function _t(){if(j&&C&&(H("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+c.DefaultDelimiter+"'"),C=!1),g.skipEmptyLines&&(j.data=j.data.filter(function(G){return!yt(G)})),V()){let G=function(gt,vt){S(g.transformHeader)&&(gt=g.transformHeader(gt,vt)),J.push(gt)};if(j)if(Array.isArray(j.data[0])){for(var X=0;V()&&X<j.data.length;X++)j.data[X].forEach(G);j.data.splice(0,1)}else j.data.forEach(G)}function K(G,gt){for(var vt=g.header?{}:[],at=0;at<G.length;at++){var bt=at,dt=G[at],dt=((jt,ot)=>(Mt=>(g.dynamicTypingFunction&&g.dynamicTyping[Mt]===void 0&&(g.dynamicTyping[Mt]=g.dynamicTypingFunction(Mt)),(g.dynamicTyping[Mt]||g.dynamicTyping)===!0))(jt)?ot==="true"||ot==="TRUE"||ot!=="false"&&ot!=="FALSE"&&((Mt=>{if($.test(Mt)&&(Mt=parseFloat(Mt),F<Mt&&Mt<I))return 1})(ot)?parseFloat(ot):Q.test(ot)?new Date(ot):ot===""?null:ot):ot)(bt=g.header?at>=J.length?"__parsed_extra":J[at]:bt,dt=g.transform?g.transform(dt,bt):dt);bt==="__parsed_extra"?(vt[bt]=vt[bt]||[],vt[bt].push(dt)):vt[bt]=dt}return g.header&&(at>J.length?H("FieldMismatch","TooManyFields","Too many fields: expected "+J.length+" fields but parsed "+at,U+gt):at<J.length&&H("FieldMismatch","TooFewFields","Too few fields: expected "+J.length+" fields but parsed "+at,U+gt)),vt}var Z;j&&(g.header||g.dynamicTyping||g.transform)&&(Z=1,!j.data.length||Array.isArray(j.data[0])?(j.data=j.data.map(K),Z=j.data.length):j.data=K(j.data,0),g.header&&j.meta&&(j.meta.fields=J),U+=Z)}function V(){return g.header&&J.length===0}function H(X,K,Z,G){X={type:X,code:K,message:Z},G!==void 0&&(X.row=G),j.errors.push(X)}S(g.step)&&(R=g.step,g.step=function(X){j=X,V()?_t():(_t(),j.data.length!==0&&(lt+=X.data.length,g.preview&<>g.preview?M.abort():(j.data=j.data[0],R(j,Y))))}),this.parse=function(X,K,Z){var G=g.quoteChar||'"',G=(g.newline||(g.newline=this.guessLineEndings(X,G)),C=!1,g.delimiter?S(g.delimiter)&&(g.delimiter=g.delimiter(X),j.meta.delimiter=g.delimiter):((G=((gt,vt,at,bt,dt)=>{var jt,ot,Mt,ee;dt=dt||[","," ","|",";",c.RECORD_SEP,c.UNIT_SEP];for(var le=0;le<dt.length;le++){for(var Ut,Xe=dt[le],Et=0,ne=0,Ft=0,qt=(Mt=void 0,new v({comments:bt,delimiter:Xe,newline:vt,preview:10}).parse(gt)),ie=0;ie<qt.data.length;ie++)at&&yt(qt.data[ie])?Ft++:(Ut=qt.data[ie].length,ne+=Ut,Mt===void 0?Mt=Ut:0<Ut&&(Et+=Math.abs(Ut-Mt),Mt=Ut));0<qt.data.length&&(ne/=qt.data.length-Ft),(ot===void 0||Et<=ot)&&(ee===void 0||ee<ne)&&1.99<ne&&(ot=Et,jt=Xe,ee=ne)}return{successful:!!(g.delimiter=jt),bestDelimiter:jt}})(X,g.newline,g.skipEmptyLines,g.comments,g.delimitersToGuess)).successful?g.delimiter=G.bestDelimiter:(C=!0,g.delimiter=c.DefaultDelimiter),j.meta.delimiter=g.delimiter),O(g));return g.preview&&g.header&&G.preview++,y=X,M=new v(G),j=M.parse(y,K,Z),_t(),z?{meta:{paused:!0}}:j||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,M.abort(),y=S(g.chunk)?"":y.substring(M.getCharIndex())},this.resume=function(){Y.streamer._halted?(z=!1,Y.streamer.parseChunk(y,!0)):setTimeout(Y.resume,3)},this.aborted=function(){return q},this.abort=function(){q=!0,M.abort(),j.meta.aborted=!0,S(g.complete)&&g.complete(j),y=""},this.guessLineEndings=function(gt,G){gt=gt.substring(0,1048576);var G=new RegExp(x(G)+"([^]*?)"+x(G),"gm"),Z=(gt=gt.replace(G,"")).split("\r"),G=gt.split(`
|
|
34
34
|
`),gt=1<G.length&&G[0].length<Z[0].length;if(Z.length===1||gt)return`
|
|
35
35
|
`;for(var vt=0,at=0;at<Z.length;at++)Z[at][0]===`
|
|
36
36
|
`&&vt++;return vt>=Z.length/2?`\r
|
|
37
|
-
`:"\r"}}function x(g){return g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(g){var
|
|
37
|
+
`:"\r"}}function x(g){return g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(g){var y=(g=g||{}).delimiter,M=g.newline,C=g.comments,R=g.step,I=g.preview,F=g.fastMode,$=null,Q=!1,Y=g.quoteChar==null?'"':g.quoteChar,lt=Y;if(g.escapeChar!==void 0&&(lt=g.escapeChar),(typeof y!="string"||-1<c.BAD_DELIMITERS.indexOf(y))&&(y=","),C===y)throw new Error("Comment character same as delimiter");C===!0?C="#":(typeof C!="string"||-1<c.BAD_DELIMITERS.indexOf(C))&&(C=!1),M!==`
|
|
38
38
|
`&&M!=="\r"&&M!==`\r
|
|
39
39
|
`&&(M=`
|
|
40
|
-
`);var U=0,
|
|
41
|
-
`,F='"',$=F+F,Q=!1,
|
|
42
|
-
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=
|
|
43
|
-
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});zC.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(n.filename),1)])],8,HC))}}),YC=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(WC,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),VC={class:"kong-ui-public-csv-export-modal"},$C={key:0,class:"selected-range"},jC={key:4,class:"text-muted",tag:"span"},Qm=3,UC=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=mt.useI18n(),i=n,s=t,r=`${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 p,b;return i.exportState.status==="success"&&!!((b=(p=i.exportState.chartData)==null?void 0:p.data)!=null&&b.length)}),c=d.computed(()=>i.exportState.status!=="success"?"":mt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(Qm,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{var O,C,k;if(i.exportState.status!=="success"||!l.value||!((O=i.exportState.chartData)!=null&&O.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const p=i.exportState.chartData,b=p.data.some(g=>g.timestamp!==p.data[0].timestamp),x=p.data.map(g=>{const _=new Date(g.timestamp);return{...Object.keys(g.event).reduce((E,R)=>{if(R in p.meta.display){const I=g.event[R],F=p.meta.display[R];E[R]=I&&F&&F[I].name||g.event[R]}else E[R]=g.event[R];return E},{}),...b?{timestamp:gl(_,"yyyy-MM-dd HH:mm:ss"),tzOffset:gl(_,"XXX")}:{}}});let v=[];b&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const S="display"in i.exportState.chartData.meta&&((C=i.exportState.chartData.meta)!=null&&C.display)?(k=i.exportState.chartData.meta)==null?void 0:k.display:{},D=[...v,...Object.keys(S).map(g=>({label:e.t(`chartLabels.${g}`),key:g})),...i.exportState.chartData.meta.metric_names.map(g=>({label:e.t(`chartLabels.${g}`),key:g}))],P=D.reduce((g,_)=>(g[_.key]=_.label,g),{});return{headers:D,csvHeaders:P,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:p}=f.value;return{total:Number(p.length)||0,data:p.slice(0,Qm)}};return d.watch(f,()=>{a.value++}),(p,b)=>{const x=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KEmptyState"),S=d.resolveComponent("KTableData"),D=d.resolveComponent("KTooltip"),P=d.resolveComponent("KButton"),O=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",VC,[d.createVNode(O,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var C;return[d.createElementVNode("div",null,[n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",$C,[d.createElementVNode("p",null,d.toDisplayString(n.modalDescription?n.modalDescription:d.unref(e).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),n.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(d.openBlock(),d.createBlock(S,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((C=f.value)==null?void 0:C.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(v,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(d.openBlock(),d.createBlock(v,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",jC,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(D,{class:"preview-tooltip",placement:"right",text:d.unref(e).t("csvExport.maximumRecordAmount",{value:d.unref(Ww)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Xi.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(il)})`,size:d.unref(Ns)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(P,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(YC,{class:"vitals-report-export-button",filename:r,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(P,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),qC={class:"container"},XC={key:0,class:"no-data","data-testid":"sparkline-empty"},GC=["title"],KC=Ce(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(n){const t=crypto.randomUUID(),{i18n:e}=mt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:r,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:l,syncedChartDatasets:c}=mt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:k,height:g})=>{u.width=k,u.height=g},f=d.computed(()=>n.disableTooltip?[]:[new Ym({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),m=d.computed(()=>c.value.reduce((k,{data:g,label:_})=>({...k,[_]:g.reduce((M,{y:E})=>M+E,0)}),{})),p=d.computed(()=>c.value.map(({label:k})=>[m.value[k],`${k}: ${m.value[k]}`]).sort(([k],[g])=>g-k).map(([,k])=>k).join(", ")),b=d.computed(()=>Object.keys(m.value).map(k=>m.value[k]).reduce((k,g)=>k+g,0)),x=d.computed(()=>b.value>0),v=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),S=d.computed(()=>n.datasets.length>1),D=`SparklineTooltipPosition-${t}`,P=d.computed(()=>{const k=n.type==="sparkline_bar",g=k?s.value-1:s.value,_=k?r.value:r.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:k?0:2,right:k?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:D,external:M=>{nf(u,M,"minutely",{contextFormatter:E=>{const R=E+i.value;let I="";return i.value>24*60*60*1e3?I=jr(new Date(R),"MMM dd, yyy hh:mm a"):I=jr(new Date(R),"hh:mm a"),`${z1(E)} - ${I}`}})}}},scales:{x:{min:g,max:_,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:S.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:S.value}}}}),O=d.ref("0"),C=d.ref("0");return d.onMounted(()=>{De.positioners[D]=function(k,g){if(!k.length||u.interactionMode==="interactive"||g.x===null)return!1;const _=10,M=this.chart.canvas.getBoundingClientRect(),E=u.width||this.width,R=u.height||this.height,I=M.top-R>0,F=I?M.top-R-_:M.top+M.height+_,$=M.left>E/2-g.x,Q=Math.max(_,window.innerWidth-_-E),V=Math.min(Q,$?Math.floor(M.left-E/2)+g.x:0+_);return O.value=`${F}px`,C.value=`${V}px`,{x:V,y:F,xAlign:"center",yAlign:I?"top":"bottom"}}}),d.onUnmounted(()=>{De.positioners[D]&&delete De.positioners[D]}),(k,g)=>(d.openBlock(),d.createElementBlock("div",qC,[x.value?n.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Bm),{key:1,"chart-id":d.unref(t),data:v.value,"data-testid":"sparkline-bar",options:P.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Wm),{key:2,"chart-id":d.unref(t),data:v.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",XC,[d.renderSlot(k.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(xa,{key:3,"absolute-left":C.value,"absolute-top":O.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":n.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&n.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:k.$slots.label?"":p.value},[d.renderSlot(k.$slots,"label",{total:b.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(p.value),1)],!0)],8,GC)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);it.AnalyticsChart=PD,it.ChartLegendPosition=xe,it.CsvExportModal=UC,it.DECIMAL_DISPLAY=iM,it.EMPTY_COLOR=gf,it.FONT_SIZE_REGULAR=lf,it.FONT_SIZE_SMALL=of,it.MAX_LABEL_LENGTH=sa,it.OTHERS_COLOR=gM,it.SimpleChart=qD,it.SparklineChart=KC,it.TopNTable=rC,it.ValidType=ri,it.accessibleGrey=ff,it.apiRequestStatusCodeColors=mf,it.chartTypes=bD,it.codesInSpec=yf,it.darkenColor=hf,it.datavisPalette=on,it.defaultStatusCodeColors=oa,it.determineBaseColor=sl,it.errorRateColors=fM,it.handleQueryError=sS,it.latencyColors=mM,it.lightGrey=al,it.lookupColor=pM,it.lookupDatavisColor=ra,it.lookupStatusCodeCategoryColor=kM,it.lookupStatusCodeColor=ol,it.simpleChartMetricDisplay=yD,it.simpleChartTypes=_D,it.statusCodeBadgeBackgroundColor=dM,it.thresholdColor=aa,it.trafficColors=hM,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})});
|
|
40
|
+
`);var U=0,z=!1;this.parse=function(q,J,j){if(typeof q!="string")throw new Error("Input must be a string");var yt=q.length,_t=y.length,V=M.length,H=C.length,X=S(R),K=[],Z=[],G=[],gt=U=0;if(!q)return Et();if(F||F!==!1&&q.indexOf(Y)===-1){for(var vt=q.split(M),at=0;at<vt.length;at++){if(G=vt[at],U+=G.length,at!==vt.length-1)U+=M.length;else if(j)return Et();if(!C||G.substring(0,H)!==C){if(X){if(K=[],ee(G.split(y)),ne(),z)return Et()}else ee(G.split(y));if(I&&I<=at)return K=K.slice(0,I),Et(!0)}}return Et()}for(var bt=q.indexOf(y,U),dt=q.indexOf(M,U),jt=new RegExp(x(lt)+x(Y),"g"),ot=q.indexOf(Y,U);;)if(q[U]===Y)for(ot=U,U++;;){if((ot=q.indexOf(Y,ot+1))===-1)return j||Z.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:K.length,index:U}),Ut();if(ot===yt-1)return Ut(q.substring(U,ot).replace(jt,Y));if(Y===lt&&q[ot+1]===lt)ot++;else if(Y===lt||ot===0||q[ot-1]!==lt){bt!==-1&&bt<ot+1&&(bt=q.indexOf(y,ot+1));var Mt=le((dt=dt!==-1&&dt<ot+1?q.indexOf(M,ot+1):dt)===-1?bt:Math.min(bt,dt));if(q.substr(ot+1+Mt,_t)===y){G.push(q.substring(U,ot).replace(jt,Y)),q[U=ot+1+Mt+_t]!==Y&&(ot=q.indexOf(Y,U)),bt=q.indexOf(y,U),dt=q.indexOf(M,U);break}if(Mt=le(dt),q.substring(ot+1+Mt,ot+1+Mt+V)===M){if(G.push(q.substring(U,ot).replace(jt,Y)),Xe(ot+1+Mt+V),bt=q.indexOf(y,U),ot=q.indexOf(Y,U),X&&(ne(),z))return Et();if(I&&K.length>=I)return Et(!0);break}Z.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:K.length,index:U}),ot++}}else if(C&&G.length===0&&q.substring(U,U+H)===C){if(dt===-1)return Et();U=dt+V,dt=q.indexOf(M,U),bt=q.indexOf(y,U)}else if(bt!==-1&&(bt<dt||dt===-1))G.push(q.substring(U,bt)),U=bt+_t,bt=q.indexOf(y,U);else{if(dt===-1)break;if(G.push(q.substring(U,dt)),Xe(dt+V),X&&(ne(),z))return Et();if(I&&K.length>=I)return Et(!0)}return Ut();function ee(Ft){K.push(Ft),gt=U}function le(Ft){var qt=0;return qt=Ft!==-1&&(Ft=q.substring(ot+1,Ft))&&Ft.trim()===""?Ft.length:qt}function Ut(Ft){return j||(Ft===void 0&&(Ft=q.substring(U)),G.push(Ft),U=yt,ee(G),X&&ne()),Et()}function Xe(Ft){U=Ft,ee(G),G=[],dt=q.indexOf(M,U)}function Et(Ft){if(g.header&&!J&&K.length&&!Q){var qt=K[0],ie=Object.create(null),Ge=new Set(qt);let oi=!1;for(let Be=0;Be<qt.length;Be++){let Bt=qt[Be];if(ie[Bt=S(g.transformHeader)?g.transformHeader(Bt,Be):Bt]){let ve,li=ie[Bt];for(;ve=Bt+"_"+li,li++,Ge.has(ve););Ge.add(ve),qt[Be]=ve,ie[Bt]++,oi=!0,($=$===null?{}:$)[ve]=Bt}else ie[Bt]=1,qt[Be]=Bt;Ge.add(Bt)}oi&&console.warn("Duplicate headers found and renamed."),Q=!0}return{data:K,errors:Z,meta:{delimiter:y,linebreak:M,aborted:z,truncated:!!Ft,cursor:gt+(J||0),renamedHeaders:$}}}function ne(){R(Et()),K=[],Z=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return U}}function k(g){var y=g.data,M=o[y.workerId],C=!1;if(y.error)M.userError(y.error,y.file);else if(y.results&&y.results.data){var R={abort:function(){C=!0,E(y.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:P,resume:P};if(S(M.userStep)){for(var I=0;I<y.results.data.length&&(M.userStep({data:y.results.data[I],errors:y.results.errors,meta:y.results.meta},R),!C);I++);delete y.results}else S(M.userChunk)&&(M.userChunk(y.results,R,y.file),delete y.results)}y.finished&&!C&&E(y.workerId,y.results)}function E(g,y){var M=o[g];S(M.userComplete)&&M.userComplete(y),M.terminate(),delete o[g]}function P(){throw new Error("Not implemented.")}function O(g){if(typeof g!="object"||g===null)return g;var y,M=Array.isArray(g)?[]:{};for(y in g)M[y]=O(g[y]);return M}function D(g,y){return function(){g.apply(y,arguments)}}function S(g){return typeof g=="function"}return c.parse=function(g,y){var M=(y=y||{}).dynamicTyping||!1;if(S(M)&&(y.dynamicTypingFunction=M,M={}),y.dynamicTyping=M,y.transform=!!S(y.transform)&&y.transform,!y.worker||!c.WORKERS_SUPPORTED)return M=null,c.NODE_STREAM_INPUT,typeof g=="string"?(g=(C=>C.charCodeAt(0)!==65279?C:C.slice(1))(g),M=new(y.download?h:m)(y)):g.readable===!0&&S(g.read)&&S(g.on)?M=new p(y):(i.File&&g instanceof File||g instanceof Object)&&(M=new f(y)),M.stream(g);(M=(()=>{var C;return!!c.WORKERS_SUPPORTED&&(C=(()=>{var R=i.URL||i.webkitURL||null,I=e.toString();return c.BLOB_URL||(c.BLOB_URL=R.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"})))})(),(C=new i.Worker(C)).onmessage=k,C.id=l++,o[C.id]=C)})()).userStep=y.step,M.userChunk=y.chunk,M.userComplete=y.complete,M.userError=y.error,y.step=S(y.step),y.chunk=S(y.chunk),y.complete=S(y.complete),y.error=S(y.error),delete y.worker,M.postMessage({input:g,config:y,workerId:M.id})},c.unparse=function(g,y){var M=!1,C=!0,R=",",I=`\r
|
|
41
|
+
`,F='"',$=F+F,Q=!1,Y=null,lt=!1,U=((()=>{if(typeof y=="object"){if(typeof y.delimiter!="string"||c.BAD_DELIMITERS.filter(function(J){return y.delimiter.indexOf(J)!==-1}).length||(R=y.delimiter),typeof y.quotes!="boolean"&&typeof y.quotes!="function"&&!Array.isArray(y.quotes)||(M=y.quotes),typeof y.skipEmptyLines!="boolean"&&typeof y.skipEmptyLines!="string"||(Q=y.skipEmptyLines),typeof y.newline=="string"&&(I=y.newline),typeof y.quoteChar=="string"&&(F=y.quoteChar),typeof y.header=="boolean"&&(C=y.header),Array.isArray(y.columns)){if(y.columns.length===0)throw new Error("Option columns is empty");Y=y.columns}y.escapeChar!==void 0&&($=y.escapeChar+F),y.escapeFormulae instanceof RegExp?lt=y.escapeFormulae:typeof y.escapeFormulae=="boolean"&&y.escapeFormulae&&(lt=/^[=+\-@\t\r].*$/)}})(),new RegExp(x(F),"g"));if(typeof g=="string"&&(g=JSON.parse(g)),Array.isArray(g)){if(!g.length||Array.isArray(g[0]))return z(null,g,Q);if(typeof g[0]=="object")return z(Y||Object.keys(g[0]),g,Q)}else if(typeof g=="object")return typeof g.data=="string"&&(g.data=JSON.parse(g.data)),Array.isArray(g.data)&&(g.fields||(g.fields=g.meta&&g.meta.fields||Y),g.fields||(g.fields=Array.isArray(g.data[0])?g.fields:typeof g.data[0]=="object"?Object.keys(g.data[0]):[]),Array.isArray(g.data[0])||typeof g.data[0]=="object"||(g.data=[g.data])),z(g.fields||[],g.data||[],Q);throw new Error("Unable to serialize unrecognized input");function z(J,j,yt){var _t="",V=(typeof J=="string"&&(J=JSON.parse(J)),typeof j=="string"&&(j=JSON.parse(j)),Array.isArray(J)&&0<J.length),H=!Array.isArray(j[0]);if(V&&C){for(var X=0;X<J.length;X++)0<X&&(_t+=R),_t+=q(J[X],X);0<j.length&&(_t+=I)}for(var K=0;K<j.length;K++){var Z=(V?J:j[K]).length,G=!1,gt=V?Object.keys(j[K]).length===0:j[K].length===0;if(yt&&!V&&(G=yt==="greedy"?j[K].join("").trim()==="":j[K].length===1&&j[K][0].length===0),yt==="greedy"&&V){for(var vt=[],at=0;at<Z;at++){var bt=H?J[at]:at;vt.push(j[K][bt])}G=vt.join("").trim()===""}if(!G){for(var dt=0;dt<Z;dt++){0<dt&&!gt&&(_t+=R);var jt=V&&H?J[dt]:dt;_t+=q(j[K][jt],dt)}K<j.length-1&&(!yt||0<Z&&!gt)&&(_t+=I)}}return _t}function q(J,j){var yt,_t;return J==null?"":J.constructor===Date?JSON.stringify(J).slice(1,25):(_t=!1,lt&&typeof J=="string"&<.test(J)&&(J="'"+J,_t=!0),yt=J.toString().replace(U,$),(_t=_t||M===!0||typeof M=="function"&&M(J,j)||Array.isArray(M)&&M[j]||((V,H)=>{for(var X=0;X<H.length;X++)if(-1<V.indexOf(H[X]))return!0;return!1})(yt,c.BAD_DELIMITERS)||-1<yt.indexOf(R)||yt.charAt(0)===" "||yt.charAt(yt.length-1)===" ")?F+yt+F:yt)}},c.RECORD_SEP="",c.UNIT_SEP="",c.BYTE_ORDER_MARK="\uFEFF",c.BAD_DELIMITERS=["\r",`
|
|
42
|
+
`,'"',c.BYTE_ORDER_MARK],c.WORKERS_SUPPORTED=!r&&!!i.Worker,c.NODE_STREAM_INPUT=1,c.LocalChunkSize=10485760,c.RemoteChunkSize=5242880,c.DefaultDelimiter=",",c.Parser=v,c.ParserHandle=_,c.NetworkStreamer=h,c.FileStreamer=f,c.StringStreamer=m,c.ReadableStreamStreamer=p,i.jQuery&&((s=i.jQuery).fn.parse=function(g){var y=g.config||{},M=[];return this.each(function(I){if(!(s(this).prop("tagName").toUpperCase()==="INPUT"&&s(this).attr("type").toLowerCase()==="file"&&i.FileReader)||!this.files||this.files.length===0)return!0;for(var F=0;F<this.files.length;F++)M.push({file:this.files[F],inputElem:this,instanceConfig:s.extend({},y)})}),C(),this;function C(){if(M.length===0)S(g.complete)&&g.complete();else{var I,F,$,Q,Y=M[0];if(S(g.before)){var lt=g.before(Y.file,Y.inputElem);if(typeof lt=="object"){if(lt.action==="abort")return I="AbortError",F=Y.file,$=Y.inputElem,Q=lt.reason,void(S(g.error)&&g.error({name:I},F,$,Q));if(lt.action==="skip")return void R();typeof lt.config=="object"&&(Y.instanceConfig=s.extend(Y.instanceConfig,lt.config))}else if(lt==="skip")return void R()}var U=Y.instanceConfig.complete;Y.instanceConfig.complete=function(z){S(U)&&U(z,Y.file,Y.inputElem),R()},c.parse(Y.file,Y.instanceConfig)}}function R(){M.splice(0,1),C()}}),a&&(i.onmessage=function(g){g=g.data,c.WORKER_ID===void 0&&g&&(c.WORKER_ID=g.workerId),typeof g.input=="string"?i.postMessage({workerId:c.WORKER_ID,results:c.parse(g.input,g.config),finished:!0}):(i.File&&g.input instanceof File||g.input instanceof Object)&&(g=c.parse(g.input,g.config))&&i.postMessage({workerId:c.WORKER_ID,results:g,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,(p.prototype=Object.create(u.prototype)).constructor=p,c})})(Qm);var $C=Qm.exports;const jC=["id"],UC=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(n,{emit:t}){const e=t,i=n,s=d.computed(()=>`export_${new Date().getTime()}`),r=d.computed(()=>{const u=l();return u.length?u:null}),a=()=>{const u=i.labels;if(typeof i.fields!==ai.Object)throw new Error("Labels needs to be a object containing key / value pairs.");return typeof u===ai.Object?h=>hC(h,(f,m)=>u[m]||m):h=>h},o=()=>{const u=i.fields;if(typeof i.fields!==ai.Object&&!Array.isArray(u))throw new Error("Fields needs to be an array of strings.");return Array.isArray(u)?h=>VC(h,u):h=>h},l=()=>{if(typeof i.fields===ai.Undefined&&typeof i.labels===ai.Undefined)return i.data;const u=a(),h=o();return i.data.map(f=>u(h(f)))},c=()=>{if(!(r!=null&&r.value)){console.warn("No data to export");return}e("export-started",r.value);let u=$C.unparse(r.value,Object.assign({delimiter:i.delimiter,encoding:i.encoding}));if(i.separatorExcel&&(u="SEP="+i.delimiter+`\r
|
|
43
|
+
`+u),i.encoding==="utf-8"&&(u="\uFEFF"+u),e("export-finished",i.filename),!i.testing){const h=new Blob([u],{type:"text/csv;charset="+i.encoding});YC.saveAs(h,i.filename)}};return(u,h)=>(d.openBlock(),d.createElementBlock("div",{id:s.value,"data-testid":"export-csv",onClick:c},[d.renderSlot(u.$slots,"default",{},()=>[d.createTextVNode("Download "+d.toDisplayString(n.filename),1)])],8,jC))}}),qC=d.defineComponent({__name:"DownloadCsv",props:{rows:{},headers:{},filename:{}},setup(n){const t=n,e=d.computed(()=>Object.keys(t.headers));return(i,s)=>(d.openBlock(),d.createElementBlock("div",null,[d.createVNode(UC,{data:n.rows,fields:e.value,filename:n.filename,labels:n.headers},{default:d.withCtx(()=>[d.renderSlot(i.$slots,"default")]),_:3},8,["data","fields","filename","labels"])]))}}),XC={class:"kong-ui-public-csv-export-modal"},GC={key:0,class:"selected-range"},KC={key:4,class:"text-muted",tag:"span"},Jm=3,ZC=d.defineComponent({__name:"CsvExportModal",props:{exportState:{},filename:{},modalDescription:{default:void 0}},emits:["closeModal"],setup(n,{emit:t}){const{i18n:e}=mt.useI18n(),i=n,s=t,r=`${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 p,_;return i.exportState.status==="success"&&!!((_=(p=i.exportState.chartData)==null?void 0:p.data)!=null&&_.length)}),c=d.computed(()=>i.exportState.status!=="success"?"":mt.useChartSelectedRange(d.toRef(i.exportState,"chartData"))),u=d.computed(()=>i.exportState.status!=="success"?"":e.t("csvExport.previewRows",{rowsMax:Math.min(Jm,o.value),rowsTotal:o.value,plural:o.value===1?"":"s"})),h=()=>{s("closeModal")},f=d.computed(()=>{var O,D,S;if(i.exportState.status!=="success"||!l.value||!((O=i.exportState.chartData)!=null&&O.meta.metric_names))return{headers:[],rows:[],csvHeaders:{}};const p=i.exportState.chartData,_=p.data.some(g=>g.timestamp!==p.data[0].timestamp),x=p.data.map(g=>{const y=new Date(g.timestamp);return{...Object.keys(g.event).reduce((C,R)=>{if(R in p.meta.display){const I=g.event[R],F=p.meta.display[R];C[R]=I&&F&&F[I].name||g.event[R]}else C[R]=g.event[R];return C},{}),..._?{timestamp:gl(y,"yyyy-MM-dd HH:mm:ss"),tzOffset:gl(y,"XXX")}:{}}});let v=[];_&&(v=[{label:e.t("csvExport.Timestamp"),key:"timestamp"},{label:e.t("csvExport.UtcOffset"),key:"tzOffset"}]);const k="display"in i.exportState.chartData.meta&&((D=i.exportState.chartData.meta)!=null&&D.display)?(S=i.exportState.chartData.meta)==null?void 0:S.display:{},E=[...v,...Object.keys(k).map(g=>({label:e.t(`chartLabels.${g}`),key:g})),...i.exportState.chartData.meta.metric_names.map(g=>({label:e.t(`chartLabels.${g}`),key:g}))],P=E.reduce((g,y)=>(g[y.key]=y.label,g),{});return{headers:E,csvHeaders:P,rows:x}}),m=async()=>{if(i.exportState.status!=="success")return{total:0,data:[]};const{rows:p}=f.value;return{total:Number(p.length)||0,data:p.slice(0,Jm)}};return d.watch(f,()=>{a.value++}),(p,_)=>{const x=d.resolveComponent("KSkeleton"),v=d.resolveComponent("KEmptyState"),k=d.resolveComponent("KTableData"),E=d.resolveComponent("KTooltip"),P=d.resolveComponent("KButton"),O=d.resolveComponent("KModal");return d.openBlock(),d.createElementBlock("div",XC,[d.createVNode(O,{class:"vitals-report","data-testid":"csv-export-modal","show-dismiss-icon":"",title:d.unref(e).t("csvExport.exportPreview"),visible:"",onCancel:h,onKeyup:d.withKeys(h,["esc"])},{default:d.withCtx(()=>{var D;return[d.createElementVNode("div",null,[n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",GC,[d.createElementVNode("p",null,d.toDisplayString(n.modalDescription?n.modalDescription:d.unref(e).t("csvExport.exportDescription")),1),d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.exportTimeRange"))+": "+d.toDisplayString(c.value),1)])):d.createCommentVNode("",!0),n.exportState.status==="loading"?(d.openBlock(),d.createBlock(x,{key:1,class:"chart-skeleton",type:"table"})):n.exportState.status==="success"?(d.openBlock(),d.createBlock(k,{key:2,class:"vitals-table",fetcher:m,"fetcher-cache-key":String(a.value),headers:((D=f.value)==null?void 0:D.headers)||[],"hide-pagination":"","row-hover":!1,sortable:!1},{"empty-state":d.withCtx(()=>[d.createVNode(v,{"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRange")),1)]),default:d.withCtx(()=>[d.createElementVNode("p",null,d.toDisplayString(d.unref(e).t("csvExport.noDataRetry")),1)]),_:1})]),_:1},8,["fetcher-cache-key","headers"])):n.exportState.status==="error"?(d.openBlock(),d.createBlock(v,{key:3,"action-button-visible":!1},{title:d.withCtx(()=>[d.createElementVNode("h5",null,d.toDisplayString(d.unref(e).t("csvExport.dataError")),1)]),_:1})):d.createCommentVNode("",!0),n.exportState.status==="success"&&l.value?(d.openBlock(),d.createElementBlock("div",KC,[d.createTextVNode(d.toDisplayString(u.value)+" ",1),d.createVNode(E,{class:"preview-tooltip",placement:"right",text:d.unref(e).t("csvExport.maximumRecordAmount",{value:d.unref(Vw)})},{default:d.withCtx(()=>[d.createVNode(d.unref(Xi.InfoIcon),{color:`var(--kui-color-text-neutral, ${d.unref(il)})`,size:d.unref(Ns)},null,8,["color","size"])]),_:1},8,["text"])])):d.createCommentVNode("",!0)])]}),"footer-actions":d.withCtx(()=>[d.createVNode(P,{appearance:"tertiary",class:"cancel-btn",onClick:h},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.cancelButton")),1)]),_:1}),d.createVNode(qC,{class:"vitals-report-export-button",filename:r,headers:f.value.csvHeaders,rows:f.value.rows},{default:d.withCtx(()=>[d.createVNode(P,{appearance:"primary","data-testid":"csv-download-button",disabled:n.exportState.status!=="success"||!l.value},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("csvExport.downloadButton")),1)]),_:1},8,["disabled"])]),_:1},8,["headers","rows"])]),_:1},8,["title"])])}}}),QC={class:"container"},JC={key:0,class:"no-data","data-testid":"sparkline-empty"},tE=["title"],eE=Ce(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(n){const t=crypto.randomUUID(),{i18n:e}=mt.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:r,syncedMinCount:a,syncedMaxCount:o,syncedRenderPoints:l,syncedChartDatasets:c}=mt.useSparklineSync({chartKey:n.chartKey,datasets:n.datasets,groupKey:n.groupKey,minStamp:n.minStamp,maxStamp:n.maxStamp,minCount:n.minCount,maxCount:n.maxCount,renderPoints:n.pointRenderCount,type:n.type}),u=d.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:n.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:S,height:g})=>{u.width=S,u.height=g},f=d.computed(()=>n.disableTooltip?[]:[new Ym({enableBrushing:n.groupKey!==void 0&&n.chartKey!==void 0&&n.enableBrushing,brushStrategy:"group",brushGroup:n.groupKey})]),m=d.computed(()=>c.value.reduce((S,{data:g,label:y})=>({...S,[y]:g.reduce((M,{y:C})=>M+C,0)}),{})),p=d.computed(()=>c.value.map(({label:S})=>[m.value[S],`${S}: ${m.value[S]}`]).sort(([S],[g])=>g-S).map(([,S])=>S).join(", ")),_=d.computed(()=>Object.keys(m.value).map(S=>m.value[S]).reduce((S,g)=>S+g,0)),x=d.computed(()=>_.value>0),v=d.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),k=d.computed(()=>n.datasets.length>1),E=`SparklineTooltipPosition-${t}`,P=d.computed(()=>{const S=n.type==="sparkline_bar",g=S?s.value-1:s.value,y=S?r.value:r.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:n.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:S?0:2,right:S?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:E,external:M=>{nf(u,M,"minutely",{contextFormatter:C=>{const R=C+i.value;let I="";return i.value>24*60*60*1e3?I=jr(new Date(R),"MMM dd, yyy hh:mm a"):I=jr(new Date(R),"hh:mm a"),`${z1(C)} - ${I}`}})}}},scales:{x:{min:g,max:y,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:k.value},y:{min:Math.max(a.value-1,0),max:o.value,grid:{display:!1},display:!1,stacked:k.value}}}}),O=d.ref("0"),D=d.ref("0");return d.onMounted(()=>{De.positioners[E]=function(S,g){if(!S.length||u.interactionMode==="interactive"||g.x===null)return!1;const y=10,M=this.chart.canvas.getBoundingClientRect(),C=u.width||this.width,R=u.height||this.height,I=M.top-R>0,F=I?M.top-R-y:M.top+M.height+y,$=M.left>C/2-g.x,Q=Math.max(y,window.innerWidth-y-C),Y=Math.min(Q,$?Math.floor(M.left-C/2)+g.x:0+y);return O.value=`${F}px`,D.value=`${Y}px`,{x:Y,y:F,xAlign:"center",yAlign:I?"top":"bottom"}}}),d.onUnmounted(()=>{De.positioners[E]&&delete De.positioners[E]}),(S,g)=>(d.openBlock(),d.createElementBlock("div",QC,[x.value?n.type==="sparkline_bar"?(d.openBlock(),d.createBlock(d.unref(Hm),{key:1,"chart-id":d.unref(t),data:v.value,"data-testid":"sparkline-bar",options:P.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):n.type==="sparkline_line"||n.type==="sparkline_step"?(d.openBlock(),d.createBlock(d.unref(Vm),{key:2,"chart-id":d.unref(t),data:v.value,"data-testid":n.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:P.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",JC,[d.renderSlot(S.$slots,"empty",{},()=>[d.createTextVNode(d.toDisplayString(d.unref(e).t("sparkline_no_data")),1)],!0)])),n.disableTooltip?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(xa,{key:3,"absolute-left":D.value,"absolute-top":O.value,class:"tooltip","data-testid":"sparkline-tooltip",state:u,"tooltip-title":n.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),x.value&&n.showLabel?(d.openBlock(),d.createElementBlock("div",{key:4,class:"label",title:S.$slots.label?"":p.value},[d.renderSlot(S.$slots,"label",{total:_.value,totalByDataset:m.value},()=>[d.createTextVNode(d.toDisplayString(p.value),1)],!0)],8,tE)):d.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]);it.AnalyticsChart=ND,it.ChartLegendPosition=xe,it.CsvExportModal=ZC,it.DECIMAL_DISPLAY=sM,it.EMPTY_COLOR=gf,it.FONT_SIZE_REGULAR=lf,it.FONT_SIZE_SMALL=of,it.MAX_LABEL_LENGTH=sa,it.OTHERS_COLOR=pM,it.SimpleChart=QD,it.SparklineChart=eE,it.TopNTable=uC,it.ValidType=ai,it.accessibleGrey=ff,it.apiRequestStatusCodeColors=mf,it.chartTypes=MD,it.codesInSpec=yf,it.darkenColor=hf,it.datavisPalette=on,it.defaultStatusCodeColors=oa,it.determineBaseColor=sl,it.errorRateColors=mM,it.handleQueryError=rS,it.latencyColors=gM,it.lightGrey=al,it.lookupColor=yM,it.lookupDatavisColor=ra,it.lookupStatusCodeCategoryColor=TM,it.lookupStatusCodeColor=ol,it.simpleChartMetricDisplay=vD,it.simpleChartTypes=SD,it.statusCodeBadgeBackgroundColor=hM,it.thresholdColor=aa,it.trafficColors=fM,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})});
|