@kong-ui-public/analytics-chart 12.3.1 → 12.3.2-pr.3939.2da2cd39f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/types/components/AnalyticsChart.vue.d.ts.map +1 -1
- package/dist/types/components/SimpleChart.vue.d.ts.map +1 -1
- package/dist/types/components/chart-plugins/CoordinatorPlugin.d.ts +2 -2
- package/dist/types/components/chart-plugins/CoordinatorPlugin.d.ts.map +1 -1
- package/dist/types/components/chart-plugins/ThresholdPlugin.d.ts.map +1 -1
- package/dist/types/components/chart-types/DonutChart.vue.d.ts +3 -0
- package/dist/types/components/chart-types/DonutChart.vue.d.ts.map +1 -1
- package/dist/types/components/chart-types/GaugeChart.vue.d.ts +2 -2
- package/dist/types/components/chart-types/GaugeChart.vue.d.ts.map +1 -1
- package/dist/types/components/chart-types/ScatterChart.vue.d.ts +3 -1
- package/dist/types/components/chart-types/ScatterChart.vue.d.ts.map +1 -1
- package/dist/types/components/chart-types/StackedBarChart.vue.d.ts +3 -0
- package/dist/types/components/chart-types/StackedBarChart.vue.d.ts.map +1 -1
- package/dist/types/components/chart-types/TimeSeriesChart.vue.d.ts +3 -1
- package/dist/types/components/chart-types/TimeSeriesChart.vue.d.ts.map +1 -1
- package/dist/types/composables/useExploreResultToDatasets.d.ts +2 -2
- package/dist/types/composables/useExploreResultToDatasets.d.ts.map +1 -1
- package/dist/types/composables/useExploreResultToTimeDatasets.d.ts +2 -2
- package/dist/types/composables/useExploreResultToTimeDatasets.d.ts.map +1 -1
- package/dist/types/composables/useScatterDatasets.d.ts +2 -1
- package/dist/types/composables/useScatterDatasets.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +0 -1
- package/dist/types/types/index.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/vitals-chart.es.js +5542 -5517
- package/dist/vitals-chart.umd.js +4 -4
- package/package.json +3 -3
- package/dist/types/types/dataset-generation-types.d.ts +0 -15
- package/dist/types/types/dataset-generation-types.d.ts.map +0 -1
- package/dist/types/utils/colors.d.ts +0 -8
- package/dist/types/utils/colors.d.ts.map +0 -1
package/dist/vitals-chart.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(function(ot,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong/kongponents"],u):(ot=typeof globalThis<"u"?globalThis:ot||self,u(ot["kong-ui-publicvitals-chart"]={},ot.Vue,ot.KongIcons,ot["kong-ui-public-i18n"],ot["kong-ui-public-analytics-metric-provider"],ot.Kongponents))})(this,(function(ot,u,Tt,Ar,We,Kn){"use strict";var Y=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(Y||{});const Lf=["in","not_in","selector"],Nf=["empty","not_empty"],Bf=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],je=e=>e.filter(t=>t!=="time"),Pr=["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"],po=je(Pr),Ff=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Er=[...Pr,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],go=je(Er),zf=[...Ff,"share_of_requests","cache_hit_rate","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","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_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"],Uf=["ai_gateway","ai_gateway_agent","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_version","ai_plugin","ai_provider","ai_request_model","ai_response_model","application","cache_status","consumer","control_plane","control_plane_group","gateway_service","llm_cache_status","llm_embeddings_model","llm_embeddings_provider","oidc_credential","principal","realm","response_source","route","status_code","status_code_grouped","time","upstream_status_code","upstream_status_code_grouped"],yo=je(Uf),Vf=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","ai_gateway_version","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_ban_type","bot_info_detection_reason","bot_info_header_names","bot_info_ja4_fingerprint","cache_status","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","oidc_credential","portal","principal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_status_code_grouped","upstream_uri","websocket"],Hf=je(Vf),$f=["ai_gateway_version","auth_type","cache_status","client_ip","data_plane_node_version","header_host","header_user_agent","http_method","oidc_credential","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Yf=$f,Wf=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],jf=je(Wf),qf=["platform","platform_usage"],Gf=e=>qf.includes(e),Xf=[...Er.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","ai_gateway_version","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],bo=je(Xf);[...zf];const Kf=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],_o=je(Kf);new Set(po),new Set(go),new Set(yo),new Set(bo),new Set(_o);const Rr=[{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"}],Me=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Lf},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Nf}},required:["field","operator"],additionalProperties:!1}]}});({...Me()},Rr.map(e=>e.code));const Zf=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Me(go),Me(po),Me(yo),Me(bo),Me(_o),Me(Array.from(new Set([...Hf,...Yf,...jf]))),Me([...new Set([...go,...po,...yo,...bo,...Zf,..._o])]);const Qf={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"}},Jf=(e,t,n)=>{let i;const s=Qf[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function xo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const tm={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},em={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},nm={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},im={date:xo({formats:tm,defaultWidth:"full"}),time:xo({formats:em,defaultWidth:"full"}),dateTime:xo({formats:nm,defaultWidth:"full"})},sm={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},om=(e,t,n,i)=>sm[e];function Zn(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):a;s=e.formattingValues[r]||e.formattingValues[a]}else{const a=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;s=e.values[r]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const am={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},rm={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lm={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"]},cm={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"]},um={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"}},dm={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"}},hm=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},fm={ordinalNumber:hm,era:Zn({values:am,defaultWidth:"wide"}),quarter:Zn({values:rm,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Zn({values:lm,defaultWidth:"wide"}),day:Zn({values:cm,defaultWidth:"wide"}),dayPeriod:Zn({values:um,defaultWidth:"wide",formattingValues:dm,defaultFormattingWidth:"wide"})};function Qn(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?pm(r,h=>h.test(a)):mm(r,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function mm(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function pm(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function gm(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const r=t.slice(s.length);return{value:a,rest:r}}}const ym=/^(\d+)(th|st|nd|rd)?/i,bm=/\d+/i,_m={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},xm={any:[/^b/i,/^(a|c)/i]},wm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},km={any:[/1/i,/2/i,/3/i,/4/i]},Tm={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},Sm={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]},vm={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},Mm={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]},Dm={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},Cm={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}},Om={ordinalNumber:gm({matchPattern:ym,parsePattern:bm,valueCallback:e=>parseInt(e,10)}),era:Qn({matchPatterns:_m,defaultMatchWidth:"wide",parsePatterns:xm,defaultParseWidth:"any"}),quarter:Qn({matchPatterns:wm,defaultMatchWidth:"wide",parsePatterns:km,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Qn({matchPatterns:Tm,defaultMatchWidth:"wide",parsePatterns:Sm,defaultParseWidth:"any"}),day:Qn({matchPatterns:vm,defaultMatchWidth:"wide",parsePatterns:Mm,defaultParseWidth:"any"}),dayPeriod:Qn({matchPatterns:Dm,defaultMatchWidth:"any",parsePatterns:Cm,defaultParseWidth:"any"})},Am={code:"en-US",formatDistance:Jf,formatLong:im,formatRelative:om,localize:fm,match:Om,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Pm={};function Jn(){return Pm}const Ir=6048e5,Em=864e5,Rm=60,Im=3600,Lr=Symbol.for("constructDateFrom");function ee(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Lr in e?e[Lr](t):e instanceof Date?new e.constructor(t):new Date(t)}function Bt(e,t){return ee(t||e,e)}function Nr(e){const t=Bt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Lm(e,...t){const n=ee.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function bn(e,t){const n=Bt(e,t?.in);return n.setHours(0,0,0,0),n}function Nm(e,t,n){const[i,s]=Lm(n?.in,e,t),o=bn(i),a=bn(s),r=+o-Nr(o),l=+a-Nr(a);return Math.round((r-l)/Em)}function Bm(e,t){const n=Bt(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Fm(e,t){const n=Bt(e,t?.in);return Nm(n,Bm(n))+1}function me(e,t){const n=Jn(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Bt(e,t?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Xi(e,t){return me(e,{...t,weekStartsOn:1})}function Br(e,t){const n=Bt(e,t?.in),i=n.getFullYear(),s=ee(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Xi(s),a=ee(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const r=Xi(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=r.getTime()?i:i-1}function zm(e,t){const n=Br(e,t),i=ee(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Xi(i)}function Um(e,t){const n=Bt(e,t?.in),i=+Xi(n)-+zm(n);return Math.round(i/Ir)+1}function Fr(e,t){const n=Bt(e,t?.in),i=n.getFullYear(),s=Jn(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=ee(t?.in||e,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const r=me(a,t),l=ee(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=me(l,t);return+n>=+r?i+1:+n>=+c?i:i-1}function Vm(e,t){const n=Jn(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Fr(e,t),o=ee(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),me(o,t)}function Hm(e,t){const n=Bt(e,t?.in),i=+me(n,t)-+Vm(n,t);return Math.round(i/Ir)+1}function ht(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const De={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return ht(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ht(n+1,2)},d(e,t){return ht(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ht(e.getHours()%12||12,t.length)},H(e,t){return ht(e.getHours(),t.length)},m(e,t){return ht(e.getMinutes(),t.length)},s(e,t){return ht(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ht(s,t.length)}},_n={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},zr={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return De.y(e,t)},Y:function(e,t,n,i){const s=Fr(e,i),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return ht(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ht(o,t.length)},R:function(e,t){const n=Br(e);return ht(n,t.length)},u:function(e,t){const n=e.getFullYear();return ht(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ht(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ht(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return De.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return ht(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Hm(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ht(s,t.length)},I:function(e,t,n){const i=Um(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):ht(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):De.d(e,t)},D:function(e,t,n){const i=Fm(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ht(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ht(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ht(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ht(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=_n.noon:i===0?s=_n.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=_n.evening:i>=12?s=_n.afternoon:i>=4?s=_n.morning:s=_n.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return De.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):De.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):De.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):De.s(e,t)},S:function(e,t){return De.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Vr(i);case"XXXX":case"XX":return qe(i);default:return qe(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Vr(i);case"xxxx":case"xx":return qe(i);default:return qe(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ur(i,":");default:return"GMT"+qe(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ur(i,":");default:return"GMT"+qe(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return ht(i,t.length)},T:function(e,t,n){return ht(+e,t.length)}};function Ur(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+ht(o,2)}function Vr(e,t){return e%60===0?(e>0?"-":"+")+ht(Math.abs(e)/60,2):qe(e,t)}function qe(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=ht(Math.trunc(i/60),2),o=ht(i%60,2);return n+s+t+o}const Hr=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},$r=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},$m=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Hr(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Hr(i,t)).replace("{{time}}",$r(s,t))},Ym={p:$r,P:$m},Wm=/^D+$/,jm=/^Y+$/,qm=["D","DD","YY","YYYY"];function Gm(e){return Wm.test(e)}function Xm(e){return jm.test(e)}function Km(e,t,n){const i=Zm(e,t,n);if(console.warn(i),qm.includes(e))throw new RangeError(i)}function Zm(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function Qm(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Jm(e){return!(!Qm(e)&&typeof e!="number"||isNaN(+Bt(e)))}const tp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ep=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,np=/^'([^]*?)'?$/,ip=/''/g,sp=/[a-zA-Z]/;function op(e,t,n){const i=Jn(),s=n?.locale??i.locale??Am,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=Bt(e,n?.in);if(!Jm(r))throw new RangeError("Invalid time value");let l=t.match(ep).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=Ym[h];return f(d,s.formatLong)}return d}).join("").match(tp).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:ap(d)};if(zr[h])return{isToken:!0,value:d};if(h.match(sp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(l=s.localize.preprocessor(r,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!n?.useAdditionalWeekYearTokens&&Xm(h)||!n?.useAdditionalDayOfYearTokens&&Gm(h))&&Km(h,t,String(e));const f=zr[h[0]];return f(r,h,s.localize,c)}).join("")}function ap(e){const t=e.match(np);return t?t[1].replace(ip,"'"):e}function Ki(e,t,n){const i=Bt(e,n?.in);return isNaN(t)?ee(e,NaN):(i.setDate(i.getDate()+t),i)}function Yr(e,t,n){const i=Bt(e,n?.in);if(isNaN(t))return ee(e,NaN);if(!t)return i;const s=i.getDate(),o=ee(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function rp(e,t,n){return Yr(e,t*3,n)}function xn(e,t){const n=Bt(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function wn(e,t){const n=Bt(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function lp(e,t){const n=Bt(e,t?.in),i=n.getFullYear(),s=n.getMonth(),o=ee(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function cp(){return Object.assign({},Jn())}function Wr(e){return Math.trunc(e*Im)}function up(e){const t=e/Rm;return Math.trunc(t)}function jr(e,t,n){return Yr(e,-1,n)}function qr(e,t,n){return rp(e,-1,n)}function Gr(e,t,n){const i=cp(),s=fp(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?dp(s,t):hp(s,t)}function dp(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function hp(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function fp(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function mp(e,t){const n=_p(t);return"formatToParts"in n?gp(n,e):yp(n,e)}const pp={year:0,month:1,day:2,hour:3,minute:4,second:5};function gp(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=pp[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function yp(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const wo={},Xr=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")),bp=Xr==="06/25/2014, 00:00:00"||Xr==="06/25/2014 00:00:00";function _p(e){return wo[e]||(wo[e]=bp?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),wo[e]}function ko(e,t,n,i,s,o,a){const r=new Date(0);return r.setUTCFullYear(e,t,n),r.setUTCHours(i,s,o,a),r}const Kr=36e5,xp=6e4,To={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ti(e,t,n){if(!e)return 0;let i=To.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=To.timezoneHH.exec(e),i)return s=parseInt(i[1],10),Zr(s)?-(s*Kr):NaN;if(i=To.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Zr(s,a)?(o=Math.abs(s)*Kr+a*xp,i[1]==="+"?-o:o):NaN}if(Tp(e)){t=new Date(t||Date.now());const a=n?t:wp(t),r=So(a,e);return-(n?r:kp(t,r,e))}return NaN}function wp(e){return ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function So(e,t){const n=mp(e,t),i=ko(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function kp(e,t,n){let i=e.getTime()-t;const s=So(new Date(i),n);if(t===s)return t;i-=s-t;const o=So(new Date(i),n);return s===o?s:Math.max(s,o)}function Zr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Qr={};function Tp(e){if(Qr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Qr[e]=!0,!0}catch{return!1}}const Sp=60*1e3,vp={X:function(e,t,n){const i=vo(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Jr(i);case"XXXX":case"XX":return kn(i);default:return kn(i,":")}},x:function(e,t,n){const i=vo(n.timeZone,e);switch(t){case"x":return Jr(i);case"xxxx":case"xx":return kn(i);default:return kn(i,":")}},O:function(e,t,n){const i=vo(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+Mp(i,":");default:return"GMT"+kn(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Gr("short",e,n);default:return Gr("long",e,n)}}};function vo(e,t){const n=e?ti(e,t,!0)/Sp:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Zi(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function kn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Zi(Math.floor(i/60),2),o=Zi(Math.floor(i%60),2);return n+s+t+o}function Jr(e,t){return e%60===0?(e>0?"-":"+")+Zi(Math.abs(e)/60,2):kn(e,t)}function Mp(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Zi(o,2)}function tl(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const el=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Mo=36e5,nl=6e4,Dp=2,Yt={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:el};function Qi(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?Dp:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=Cp(e),{year:s,restDateString:o}=Op(i.date,n),a=Ap(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const r=a.getTime();let l=0,c;if(i.time&&(l=Pp(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=ti(i.timeZone||t.timeZone,new Date(r+l)),isNaN(c))return new Date(NaN)}else c=tl(new Date(r+l)),c=tl(new Date(r+l+c));return new Date(r+l+c)}else return new Date(NaN)}function Cp(e){const t={};let n=Yt.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Yt.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=Yt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function Op(e,t){if(e){const n=Yt.YYY[t],i=Yt.YYYYY[t];let s=Yt.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=Yt.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Ap(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=Yt.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,ol(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=Yt.DDD.exec(e),o){n=new Date(0);const a=parseInt(o[1],10);return Ip(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(o=Yt.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return ol(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(o=Yt.Www.exec(e),o)return s=parseInt(o[1],10)-1,al(s)?il(t,s):new Date(NaN);if(o=Yt.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return al(s,a)?il(t,s,a):new Date(NaN)}return null}function Pp(e){let t,n,i=Yt.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Do(t)?t%24*Mo:NaN;if(i=Yt.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Do(t,n)?t%24*Mo+n*nl:NaN;if(i=Yt.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Do(t,n,s)?t%24*Mo+n*nl+s*1e3:NaN}return null}function il(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Ep=[31,28,31,30,31,30,31,31,30,31,30,31],Rp=[31,29,31,30,31,30,31,31,30,31,30,31];function sl(e){return e%400===0||e%4===0&&e%100!==0}function ol(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=sl(e);if(i&&n>Rp[t]||!i&&n>Ep[t])return!1}return!0}function Ip(e,t){if(t<1)return!1;const n=sl(e);return!(n&&t>366||!n&&t>365)}function al(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Do(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Lp=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Np(e,t,n={}){t=String(t);const i=t.match(Lp);if(i){const s=Qi(n.originalDate||e,n);t=i.reduce(function(o,a){if(a[0]==="'")return o;const r=o.indexOf(a),l=o[r-1]==="'",c=o.replace(a,"'"+vp[a[0]](s,a,n)+"'");return l?c.substring(0,r-1)+c.substring(r+1):c},t)}return op(e,t,n)}function rl(e,t,n){e=Qi(e,n);const i=ti(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Bp(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Np(rl(e,t,{timeZone:i.timeZone}),n,i)}function Fp(e,t,n){if(typeof e=="string"&&!e.match(el))return Qi(e,{...n,timeZone:t});e=Qi(e,n);const i=ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),s=ti(t,new Date(i));return new Date(i+s)}function zp(e,t){return-ti(e,t)}function Up(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(e);return Bp(s,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const Vp={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function Ji(e){return e&&Bf.find(t=>e<=Vp[t])||null}var ts=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},es={exports:{}};es.exports;var ll;function Hp(){return ll||(ll=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",a="[object Array]",r="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object Promise]",y="[object RegExp]",_="[object Set]",x="[object String]",T="[object Symbol]",v="[object WeakMap]",w="[object ArrayBuffer]",M="[object DataView]",D="[object Float32Array]",P="[object Float64Array]",k="[object Int8Array]",S="[object Int16Array]",A="[object Int32Array]",L="[object Uint8Array]",R="[object Uint8ClampedArray]",H="[object Uint16Array]",W="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,K=/\w*$/,lt=/^\[object .+?Constructor\]$/,rt=/^(?:0|[1-9]\d*)$/,X={};X[o]=X[a]=X[w]=X[M]=X[r]=X[l]=X[D]=X[P]=X[k]=X[S]=X[A]=X[f]=X[m]=X[p]=X[y]=X[_]=X[x]=X[T]=X[L]=X[R]=X[H]=X[W]=!0,X[c]=X[d]=X[v]=!1;var z=typeof ts=="object"&&ts&&ts.Object===Object&&ts,C=typeof self=="object"&&self&&self.Object===Object&&self,E=z||C||Function("return this")(),N=t&&!t.nodeType&&t,V=N&&!0&&e&&!e.nodeType&&e,tt=V&&V.exports===N;function Z(b,O){return b.set(O[0],O[1]),b}function F(b,O){return b.add(O),b}function nt(b,O){for(var I=-1,j=b?b.length:0;++I<j&&O(b[I],I,b)!==!1;);return b}function gt(b,O){for(var I=-1,j=O.length,Nt=b.length;++I<j;)b[Nt+I]=O[I];return b}function ct(b,O,I,j){for(var Nt=-1,Qt=b?b.length:0;++Nt<Qt;)I=O(I,b[Nt],Nt,b);return I}function at(b,O){for(var I=-1,j=Array(b);++I<b;)j[I]=O(I);return j}function Ct(b,O){return b?.[O]}function B(b){var O=!1;if(b!=null&&typeof b.toString!="function")try{O=!!(b+"")}catch{}return O}function U(b){var O=-1,I=Array(b.size);return b.forEach(function(j,Nt){I[++O]=[Nt,j]}),I}function J(b,O){return function(I){return b(O(I))}}function $t(b){var O=-1,I=Array(b.size);return b.forEach(function(j){I[++O]=j}),I}var fe=Array.prototype,fn=Function.prototype,Te=Object.prototype,mn=E["__core-js_shared__"],Wn=(function(){var b=/[^.]+$/.exec(mn&&mn.keys&&mn.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""})(),lo=fn.toString,Ye=Te.hasOwnProperty,co=Te.toString,lP=RegExp("^"+lo.call(Ye).replace($,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),bf=tt?E.Buffer:void 0,_f=E.Symbol,xf=E.Uint8Array,cP=J(Object.getPrototypeOf,Object),uP=Object.create,dP=Te.propertyIsEnumerable,hP=fe.splice,wf=Object.getOwnPropertySymbols,fP=bf?bf.isBuffer:void 0,mP=J(Object.keys,Object),wr=Gn(E,"DataView"),qi=Gn(E,"Map"),kr=Gn(E,"Promise"),Tr=Gn(E,"Set"),Sr=Gn(E,"WeakMap"),Gi=Gn(Object,"create"),pP=yn(wr),gP=yn(qi),yP=yn(kr),bP=yn(Tr),_P=yn(Sr),kf=_f?_f.prototype:void 0,Tf=kf?kf.valueOf:void 0;function pn(b){var O=-1,I=b?b.length:0;for(this.clear();++O<I;){var j=b[O];this.set(j[0],j[1])}}function xP(){this.__data__=Gi?Gi(null):{}}function wP(b){return this.has(b)&&delete this.__data__[b]}function kP(b){var O=this.__data__;if(Gi){var I=O[b];return I===i?void 0:I}return Ye.call(O,b)?O[b]:void 0}function TP(b){var O=this.__data__;return Gi?O[b]!==void 0:Ye.call(O,b)}function SP(b,O){var I=this.__data__;return I[b]=Gi&&O===void 0?i:O,this}pn.prototype.clear=xP,pn.prototype.delete=wP,pn.prototype.get=kP,pn.prototype.has=TP,pn.prototype.set=SP;function Se(b){var O=-1,I=b?b.length:0;for(this.clear();++O<I;){var j=b[O];this.set(j[0],j[1])}}function vP(){this.__data__=[]}function MP(b){var O=this.__data__,I=uo(O,b);if(I<0)return!1;var j=O.length-1;return I==j?O.pop():hP.call(O,I,1),!0}function DP(b){var O=this.__data__,I=uo(O,b);return I<0?void 0:O[I][1]}function CP(b){return uo(this.__data__,b)>-1}function OP(b,O){var I=this.__data__,j=uo(I,b);return j<0?I.push([b,O]):I[j][1]=O,this}Se.prototype.clear=vP,Se.prototype.delete=MP,Se.prototype.get=DP,Se.prototype.has=CP,Se.prototype.set=OP;function jn(b){var O=-1,I=b?b.length:0;for(this.clear();++O<I;){var j=b[O];this.set(j[0],j[1])}}function AP(){this.__data__={hash:new pn,map:new(qi||Se),string:new pn}}function PP(b){return ho(this,b).delete(b)}function EP(b){return ho(this,b).get(b)}function RP(b){return ho(this,b).has(b)}function IP(b,O){return ho(this,b).set(b,O),this}jn.prototype.clear=AP,jn.prototype.delete=PP,jn.prototype.get=EP,jn.prototype.has=RP,jn.prototype.set=IP;function qn(b){this.__data__=new Se(b)}function LP(){this.__data__=new Se}function NP(b){return this.__data__.delete(b)}function BP(b){return this.__data__.get(b)}function FP(b){return this.__data__.has(b)}function zP(b,O){var I=this.__data__;if(I instanceof Se){var j=I.__data__;if(!qi||j.length<n-1)return j.push([b,O]),this;I=this.__data__=new jn(j)}return I.set(b,O),this}qn.prototype.clear=LP,qn.prototype.delete=NP,qn.prototype.get=BP,qn.prototype.has=FP,qn.prototype.set=zP;function UP(b,O){var I=Dr(b)||uE(b)?at(b.length,String):[],j=I.length,Nt=!!j;for(var Qt in b)Ye.call(b,Qt)&&!(Nt&&(Qt=="length"||aE(Qt,j)))&&I.push(Qt);return I}function Sf(b,O,I){var j=b[O];(!(Ye.call(b,O)&&Cf(j,I))||I===void 0&&!(O in b))&&(b[O]=I)}function uo(b,O){for(var I=b.length;I--;)if(Cf(b[I][0],O))return I;return-1}function VP(b,O){return b&&vf(O,Cr(O),b)}function vr(b,O,I,j,Nt,Qt,ve){var Jt;if(j&&(Jt=Qt?j(b,Nt,Qt,ve):j(b)),Jt!==void 0)return Jt;if(!fo(b))return b;var Pf=Dr(b);if(Pf){if(Jt=iE(b),!O)return tE(b,Jt)}else{var Xn=gn(b),Ef=Xn==d||Xn==h;if(hE(b))return qP(b,O);if(Xn==p||Xn==o||Ef&&!Qt){if(B(b))return Qt?b:{};if(Jt=sE(Ef?{}:b),!O)return eE(b,VP(Jt,b))}else{if(!X[Xn])return Qt?b:{};Jt=oE(b,Xn,vr,O)}}ve||(ve=new qn);var Rf=ve.get(b);if(Rf)return Rf;if(ve.set(b,Jt),!Pf)var If=I?nE(b):Cr(b);return nt(If||b,function(Or,mo){If&&(mo=Or,Or=b[mo]),Sf(Jt,mo,vr(Or,O,I,j,mo,b,ve))}),Jt}function HP(b){return fo(b)?uP(b):{}}function $P(b,O,I){var j=O(b);return Dr(b)?j:gt(j,I(b))}function YP(b){return co.call(b)}function WP(b){if(!fo(b)||lE(b))return!1;var O=Af(b)||B(b)?lP:lt;return O.test(yn(b))}function jP(b){if(!Df(b))return mP(b);var O=[];for(var I in Object(b))Ye.call(b,I)&&I!="constructor"&&O.push(I);return O}function qP(b,O){if(O)return b.slice();var I=new b.constructor(b.length);return b.copy(I),I}function Mr(b){var O=new b.constructor(b.byteLength);return new xf(O).set(new xf(b)),O}function GP(b,O){var I=O?Mr(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.byteLength)}function XP(b,O,I){var j=O?I(U(b),!0):U(b);return ct(j,Z,new b.constructor)}function KP(b){var O=new b.constructor(b.source,K.exec(b));return O.lastIndex=b.lastIndex,O}function ZP(b,O,I){var j=O?I($t(b),!0):$t(b);return ct(j,F,new b.constructor)}function QP(b){return Tf?Object(Tf.call(b)):{}}function JP(b,O){var I=O?Mr(b.buffer):b.buffer;return new b.constructor(I,b.byteOffset,b.length)}function tE(b,O){var I=-1,j=b.length;for(O||(O=Array(j));++I<j;)O[I]=b[I];return O}function vf(b,O,I,j){I||(I={});for(var Nt=-1,Qt=O.length;++Nt<Qt;){var ve=O[Nt],Jt=void 0;Sf(I,ve,Jt===void 0?b[ve]:Jt)}return I}function eE(b,O){return vf(b,Mf(b),O)}function nE(b){return $P(b,Cr,Mf)}function ho(b,O){var I=b.__data__;return rE(O)?I[typeof O=="string"?"string":"hash"]:I.map}function Gn(b,O){var I=Ct(b,O);return WP(I)?I:void 0}var Mf=wf?J(wf,Object):pE,gn=YP;(wr&&gn(new wr(new ArrayBuffer(1)))!=M||qi&&gn(new qi)!=f||kr&&gn(kr.resolve())!=g||Tr&&gn(new Tr)!=_||Sr&&gn(new Sr)!=v)&&(gn=function(b){var O=co.call(b),I=O==p?b.constructor:void 0,j=I?yn(I):void 0;if(j)switch(j){case pP:return M;case gP:return f;case yP:return g;case bP:return _;case _P:return v}return O});function iE(b){var O=b.length,I=b.constructor(O);return O&&typeof b[0]=="string"&&Ye.call(b,"index")&&(I.index=b.index,I.input=b.input),I}function sE(b){return typeof b.constructor=="function"&&!Df(b)?HP(cP(b)):{}}function oE(b,O,I,j){var Nt=b.constructor;switch(O){case w:return Mr(b);case r:case l:return new Nt(+b);case M:return GP(b,j);case D:case P:case k:case S:case A:case L:case R:case H:case W:return JP(b,j);case f:return XP(b,j,I);case m:case x:return new Nt(b);case y:return KP(b);case _:return ZP(b,j,I);case T:return QP(b)}}function aE(b,O){return O=O??s,!!O&&(typeof b=="number"||rt.test(b))&&b>-1&&b%1==0&&b<O}function rE(b){var O=typeof b;return O=="string"||O=="number"||O=="symbol"||O=="boolean"?b!=="__proto__":b===null}function lE(b){return!!Wn&&Wn in b}function Df(b){var O=b&&b.constructor,I=typeof O=="function"&&O.prototype||Te;return b===I}function yn(b){if(b!=null){try{return lo.call(b)}catch{}try{return b+""}catch{}}return""}function cE(b){return vr(b,!0,!0)}function Cf(b,O){return b===O||b!==b&&O!==O}function uE(b){return dE(b)&&Ye.call(b,"callee")&&(!dP.call(b,"callee")||co.call(b)==o)}var Dr=Array.isArray;function Of(b){return b!=null&&fE(b.length)&&!Af(b)}function dE(b){return mE(b)&&Of(b)}var hE=fP||gE;function Af(b){var O=fo(b)?co.call(b):"";return O==d||O==h}function fE(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=s}function fo(b){var O=typeof b;return!!b&&(O=="object"||O=="function")}function mE(b){return!!b&&typeof b=="object"}function Cr(b){return Of(b)?UP(b):jP(b)}function pE(){return[]}function gE(){return!1}e.exports=cE})(es,es.exports)),es.exports}Hp();const ne=(e,t)=>new Date(e.getTime()-zp(t,e));class Et{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}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 n=Fp(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return rl(n,t)}}class $p extends Et{rawStart(t){let n=me(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class Yp extends Et{rawStart(t){let n=wn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Wp extends Et{rawStart(t){let n=xn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class jp extends Et{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=ne(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class qp extends Et{rawEnd(t){let n=me(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=ne(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=me(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=ne(i,t)),i}}class Gp extends Et{rawEnd(t){let n=xn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}rawStart(t){let n=xn(qr(this.tzAdjustedDate(t)));return t&&(n=ne(n,t)),n}}class Xp extends Et{rawEnd(t){let n=wn(this.tzAdjustedDate(t));return t&&(n=ne(n,t)),n}rawStart(t){let n=wn(jr(this.tzAdjustedDate(t)));return t&&(n=ne(n,t)),n}}class Kp extends Et{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=ne(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=ne(n,t)),n}}Y.FIFTEEN_MIN,new Et({key:Y.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),Y.ONE_HOUR,new Et({key:Y.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),Y.SIX_HOUR,new Et({key:Y.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Y.TWELVE_HOUR,new Et({key:Y.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Y.ONE_DAY,new Et({key:Y.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),Y.SEVEN_DAY,new Et({key:Y.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Y.THIRTY_DAY,new Et({key:Y.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.NINETY_DAY,new Et({key:Y.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.ONE_HUNDRED_EIGHTY_DAY,new Et({key:Y.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.ONE_YEAR,new Et({key:Y.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),Y.CURRENT_WEEK,new $p({key:Y.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=me(new Date,{weekStartsOn:1});return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Y.CURRENT_MONTH,new Yp({key:Y.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=wn(new Date);return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.CURRENT_QUARTER,new Wp({key:Y.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=xn(new Date);return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.CURRENT_YEAR,new jp({key:Y.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(bn(Ki(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.PREVIOUS_WEEK,new qp({key:Y.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),Y.PREVIOUS_MONTH,new Xp({key:Y.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=wn(new Date),n=wn(jr(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=cl(t,n)),3600*24*lp(new Date().setMonth(new Date().getMonth()-1))+Wr(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.PREVIOUS_QUARTER,new Gp({key:Y.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=xn(new Date),t=xn(qr(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),Y.PREVIOUS_YEAR,new Kp({key:Y.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=cl(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Wr(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function cl(e,t){return up(e.getTimezoneOffset()-t.getTimezoneOffset())}Y.FIFTEEN_MIN,Y.ONE_HOUR,Y.SIX_HOUR,Y.TWELVE_HOUR,Y.ONE_DAY,Y.SEVEN_DAY,Y.FIFTEEN_MIN,Y.ONE_HOUR,Y.SIX_HOUR,Y.TWELVE_HOUR,Y.ONE_DAY,Y.SEVEN_DAY,Y.THIRTY_DAY,Y.NINETY_DAY,Y.ONE_HUNDRED_EIGHTY_DAY,Y.ONE_YEAR,Y.CURRENT_WEEK,Y.CURRENT_MONTH,Y.CURRENT_QUARTER,Y.CURRENT_YEAR,Y.PREVIOUS_WEEK,Y.PREVIOUS_MONTH,Y.PREVIOUS_QUARTER,Y.PREVIOUS_YEAR;const Zp=new Map(Rr.map(e=>[e.code,{code:e.code,name:e.name}])),Co=e=>Zp.get(e)?.name||e,ul=1e3,Qp=1e4,dl=1e6,hl=1e9,fl=1e12,ns=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,o)=>{o&&o%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},ei=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let a=o.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function is(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?Qp:ul;return e<s||t.precision&&t.precision>Math.log10(e)?n=ns(ei(e,1,t),t):e<dl?n=`${ei(e,ul,t)}k`:e<hl?n=`${ei(e,dl,t)}m`:e<fl?n=`${ns(ei(e,hl,t),t)}b`:n=`${ns(ei(e,fl,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}is.addCommas=ns;const Jp=typeof document<"u"&&document.documentElement?.lang||"en-US",ss=new Intl.NumberFormat(Jp),tg=new Set(["%"]),eg=e=>tg.has(e)?"flush":"spaced";function oe({i18n:e}){const t=(s,o)=>{if(isNaN(s))return"0 B";const a=o?Math.pow(2,50):1e15,r=o?Math.pow(2,40):1e12,l=o?Math.pow(2,30):1e9,c=o?Math.pow(2,20):1e6,d=o?Math.pow(2,10):1e3;let h;return s>=a?h=e.formatNumber(Number.parseFloat((s/a).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):s>=r?h=e.formatNumber(Number.parseFloat((s/r).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):s>=l?h=e.formatNumber(Number.parseFloat((s/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):s>=c?h=e.formatNumber(Number.parseFloat((s/c).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):s>=d?h=e.formatNumber(Number.parseFloat((s/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=e.formatNumber(Number.parseFloat(s.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},n=(s,o="USD")=>isNaN(s)?o==="USD"?"$0.00":`${s}`:s>=.01||o!=="USD"?e.formatNumber(s,{style:"currency",currency:o}):s<1e-4?"< $0.0001":`$${Number.parseFloat(s.toPrecision(4))}`,i=(s,o,a)=>{if(!a)return s;const r=eg(o)==="flush"?"":" ";return`${s}${r}${a}`};return{formatUnit:(s,o,{isBytes1024:a=!1,currency:r="USD",approximate:l=!1,translateUnit:c=d=>d}={})=>{const d=c(o,s);switch(o){case"bytes":return t(s,a);case"usd":return n(s,r);default:return isNaN(s)?`${s}`:l?i(is(s,{capital:!0}),o,d):s<.01?i(`${Number.parseFloat(s.toPrecision(4))}`,o,d):i(ss.format(Number.parseFloat(s.toFixed(2))),o,d)}},formatBytes:t,formatCost:n,formatRange:(s,o,a,{isBytes1024:r=!1,currency:l="USD",approximate:c=!1,translateUnit:d=h=>h}={})=>{const h=d(a,o);switch(a){case"bytes":return`${t(s,r)} - ${t(o,r)}`;case"usd":return`${n(s,l)} - ${n(o,l)}`;default:if(isNaN(s)||isNaN(o))return`${s} - ${o}`;if(c)return i(`${is(s,{capital:!0})} - ${is(o,{capital:!0})}`,a,h)}const f=s>=.01?`${ss.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`,m=o>=.01?`${ss.format(Number.parseFloat(o.toFixed(2)))}`:`${Number.parseFloat(o.toPrecision(4))}`;return i(`${f} - ${m}`,a,h)}}}const ml="#d60027",pl="#ffe5e5",ng="#f1f0ff",ig="#e0e4ea",gl="#6c7489",sg="#afb7c5",yl="#0d0e14",og="#d60027",ag="#ad000e",bl="#6c7489",_l="#52596e",rg="#007d60",lg="#995c00",cg="#ffc400",ug="'Inter', Roboto, Helvetica, sans-serif",Tn="16px",dg="20px",hg="#bee2ff",fg="#8fc1ff",mg="#5f9aff",pg="#306fff",gg="#b5ffee",yg="#00fabe",bg="#00d6a4",_g="#00a17b",xg="#007d60",wg="#005944",kg="#b5ffee",Tg="#00fabe",Sg="#b5ffee",vg="#00a17b",Mg="#fff296",Dg="#ffe04b",Cg="#ffc400",Og="#b37600",Ag="#995c00",Pg="#804400",Eg="#fff296",Rg="#ffe04b",Ig="#ffc2b3",Lg="#ff9877",Ng="#ff723c",Bg="#f75008",Fg="#d13500",zg="#a31f00",Ug="#ffc2b3",Vg="#ff9877",Hg="#ff723c",$g="#f75008",Yg="#d13500",Wg="#a31f00",jg="#ffc2b3",qg="#ff9877",Gg="#ff723c",Xg="#f75008",Kg="#d13500",Zg="#a31f00",Qg="#ffc2b3",Jg="#ff9877",ty="#ff723c",ey="#f75008",ny="#d13500",iy="#a31f00",sy="#ffc2b3",oy="#ff9877",ay="#ff723c",ry="#f75008",ly="#d13500",cy="#ffabab",uy="#ff7272",dy="#ff3954",hy="#f50045",fy="#d60027",my="#ad000e",py="#ffabab",gy="#ff7272",yy="#ff3954",by="#f50045",_y="#d60027",xy="#eefaff",wy="#ecfffb",ky="#fffce0",Ty="#fff1ef",Sy="#ffe5e5",vy="#5f9aff",My="#00d6a4",Dy="#ffc400",Cy="#ff723c",Oy="#ff3954",xl=6048e5,Ay=864e5,ni=6e4,Sn=36e5,Py=1e3,wl=Symbol.for("constructDateFrom");function St(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&wl in e?e[wl](t):e instanceof Date?new e.constructor(t):new Date(t)}function et(e,t){return St(t||e,e)}function os(e,t,n){const i=et(e,n?.in);return isNaN(t)?St(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Oo(e,t,n){const i=et(e,n?.in);if(isNaN(t))return St(e,NaN);if(!t)return i;const s=i.getDate(),o=St(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function Ao(e,t,n){return St(e,+et(e)+t)}function Ey(e,t,n){return Ao(e,t*Sn)}let Ry={};function Ge(){return Ry}function ae(e,t){const n=Ge(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=et(e,t?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function vn(e,t){return ae(e,{...t,weekStartsOn:1})}function kl(e,t){const n=et(e,t?.in),i=n.getFullYear(),s=St(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=vn(s),a=St(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const r=vn(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=r.getTime()?i:i-1}function as(e){const t=et(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Xe(e,...t){const n=St.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Po(e,t){const n=et(e,t?.in);return n.setHours(0,0,0,0),n}function Tl(e,t,n){const[i,s]=Xe(n?.in,e,t),o=Po(i),a=Po(s),r=+o-as(o),l=+a-as(a);return Math.round((r-l)/Ay)}function Iy(e,t){const n=kl(e,t),i=St(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),vn(i)}function Ly(e,t,n){const i=et(e,n?.in);return i.setTime(i.getTime()+t*ni),i}function Ny(e,t,n){return Oo(e,t*3,n)}function By(e,t,n){return Ao(e,t*1e3)}function Fy(e,t,n){return os(e,t*7,n)}function zy(e,t,n){return Oo(e,t*12,n)}function ii(e,t){const n=+et(e)-+et(t);return n<0?-1:n>0?1:n}function Uy(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Eo(e){return!(!Uy(e)&&typeof e!="number"||isNaN(+et(e)))}function Vy(e,t,n){const[i,s]=Xe(n?.in,e,t),o=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return o*12+a}function Hy(e,t,n){const[i,s]=Xe(n?.in,e,t);return i.getFullYear()-s.getFullYear()}function Sl(e,t,n){const[i,s]=Xe(n?.in,e,t),o=vl(i,s),a=Math.abs(Tl(i,s));i.setDate(i.getDate()-o*a);const r=+(vl(i,s)===-o),l=o*(a-r);return l===0?0:l}function vl(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function si(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function $y(e,t,n){const[i,s]=Xe(n?.in,e,t),o=(+i-+s)/Sn;return si(n?.roundingMethod)(o)}function Ro(e,t){return+et(e)-+et(t)}function Yy(e,t,n){const i=Ro(e,t)/ni;return si(n?.roundingMethod)(i)}function Ml(e,t){const n=et(e,t?.in);return n.setHours(23,59,59,999),n}function Dl(e,t){const n=et(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function Wy(e,t){const n=et(e,t?.in);return+Ml(n,t)==+Dl(n,t)}function Cl(e,t,n){const[i,s,o]=Xe(n?.in,e,e,t),a=ii(s,o),r=Math.abs(Vy(s,o));if(r<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*r);let l=ii(s,o)===-a;Wy(i)&&r===1&&ii(i,o)===1&&(l=!1);const c=a*(r-+l);return c===0?0:c}function jy(e,t,n){const i=Cl(e,t,n)/3;return si(n?.roundingMethod)(i)}function qy(e,t,n){const i=Ro(e,t)/1e3;return si(n?.roundingMethod)(i)}function Gy(e,t,n){const i=Sl(e,t,n)/7;return si(n?.roundingMethod)(i)}function Xy(e,t,n){const[i,s]=Xe(n?.in,e,t),o=ii(i,s),a=Math.abs(Hy(i,s));i.setFullYear(1584),s.setFullYear(1584);const r=ii(i,s)===-o,l=o*(a-+r);return l===0?0:l}function Ky(e,t){const n=et(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function Zy(e,t){const n=et(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Qy(e,t){const n=et(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function Ol(e,t){const n=et(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Jy(e,t){const n=et(e,t?.in);return n.setMinutes(59,59,999),n}function t0(e,t){const n=Ge(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=et(e,t?.in),o=s.getDay(),a=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function e0(e,t){const n=et(e,t?.in);return n.setSeconds(59,999),n}function n0(e,t){const n=et(e,t?.in),i=n.getMonth(),s=i-i%3+3;return n.setMonth(s,0),n.setHours(23,59,59,999),n}function i0(e,t){const n=et(e,t?.in);return n.setMilliseconds(999),n}const s0={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"}},o0=(e,t,n)=>{let i;const s=s0[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Io(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const a0={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},r0={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},l0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},c0={date:Io({formats:a0,defaultWidth:"full"}),time:Io({formats:r0,defaultWidth:"full"}),dateTime:Io({formats:l0,defaultWidth:"full"})},u0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},d0=(e,t,n,i)=>u0[e];function oi(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):a;s=e.formattingValues[r]||e.formattingValues[a]}else{const a=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;s=e.values[r]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const h0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},f0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},m0={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"]},p0={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"]},g0={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"}},y0={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"}},b0={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:oi({values:h0,defaultWidth:"wide"}),quarter:oi({values:f0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oi({values:m0,defaultWidth:"wide"}),day:oi({values:p0,defaultWidth:"wide"}),dayPeriod:oi({values:g0,defaultWidth:"wide",formattingValues:y0,defaultFormattingWidth:"wide"})};function ai(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?x0(r,h=>h.test(a)):_0(r,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function _0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function x0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function w0(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const r=t.slice(s.length);return{value:a,rest:r}}}const k0=/^(\d+)(th|st|nd|rd)?/i,T0=/\d+/i,S0={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},v0={any:[/^b/i,/^(a|c)/i]},M0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},D0={any:[/1/i,/2/i,/3/i,/4/i]},C0={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},O0={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]},A0={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},P0={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]},E0={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},R0={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}},I0={ordinalNumber:w0({matchPattern:k0,parsePattern:T0,valueCallback:e=>parseInt(e,10)}),era:ai({matchPatterns:S0,defaultMatchWidth:"wide",parsePatterns:v0,defaultParseWidth:"any"}),quarter:ai({matchPatterns:M0,defaultMatchWidth:"wide",parsePatterns:D0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ai({matchPatterns:C0,defaultMatchWidth:"wide",parsePatterns:O0,defaultParseWidth:"any"}),day:ai({matchPatterns:A0,defaultMatchWidth:"wide",parsePatterns:P0,defaultParseWidth:"any"}),dayPeriod:ai({matchPatterns:E0,defaultMatchWidth:"any",parsePatterns:R0,defaultParseWidth:"any"})},Al={code:"en-US",formatDistance:o0,formatLong:c0,formatRelative:d0,localize:b0,match:I0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function L0(e,t){const n=et(e,t?.in);return Tl(n,Ol(n))+1}function Pl(e,t){const n=et(e,t?.in),i=+vn(n)-+Iy(n);return Math.round(i/xl)+1}function Lo(e,t){const n=et(e,t?.in),i=n.getFullYear(),s=Ge(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=St(t?.in||e,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const r=ae(a,t),l=St(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=ae(l,t);return+n>=+r?i+1:+n>=+c?i:i-1}function N0(e,t){const n=Ge(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Lo(e,t),o=St(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),ae(o,t)}function El(e,t){const n=et(e,t?.in),i=+ae(n,t)-+N0(n,t);return Math.round(i/xl)+1}function ft(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Ce={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return ft(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ft(n+1,2)},d(e,t){return ft(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ft(e.getHours()%12||12,t.length)},H(e,t){return ft(e.getHours(),t.length)},m(e,t){return ft(e.getMinutes(),t.length)},s(e,t){return ft(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ft(s,t.length)}},Mn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Rl={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Ce.y(e,t)},Y:function(e,t,n,i){const s=Lo(e,i),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return ft(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ft(o,t.length)},R:function(e,t){const n=kl(e);return ft(n,t.length)},u:function(e,t){const n=e.getFullYear();return ft(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ft(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ft(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Ce.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return ft(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=El(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ft(s,t.length)},I:function(e,t,n){const i=Pl(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):ft(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ce.d(e,t)},D:function(e,t,n){const i=L0(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ft(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ft(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ft(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ft(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=Mn.noon:i===0?s=Mn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=Mn.evening:i>=12?s=Mn.afternoon:i>=4?s=Mn.morning:s=Mn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ce.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ce.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):ft(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ce.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ce.s(e,t)},S:function(e,t){return Ce.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Ll(i);case"XXXX":case"XX":return Ke(i);default:return Ke(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Ll(i);case"xxxx":case"xx":return Ke(i);default:return Ke(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Il(i,":");default:return"GMT"+Ke(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Il(i,":");default:return"GMT"+Ke(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return ft(i,t.length)},T:function(e,t,n){return ft(+e,t.length)}};function Il(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+ft(o,2)}function Ll(e,t){return e%60===0?(e>0?"-":"+")+ft(Math.abs(e)/60,2):Ke(e,t)}function Ke(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=ft(Math.trunc(i/60),2),o=ft(i%60,2);return n+s+t+o}const Nl=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Bl=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},No={p:Bl,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Nl(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Nl(i,t)).replace("{{time}}",Bl(s,t))}},B0=/^D+$/,F0=/^Y+$/,z0=["D","DD","YY","YYYY"];function Fl(e){return B0.test(e)}function zl(e){return F0.test(e)}function Bo(e,t,n){const i=U0(e,t,n);if(console.warn(i),z0.includes(e))throw new RangeError(i)}function U0(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const V0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,H0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$0=/^'([^]*?)'?$/,Y0=/''/g,W0=/[a-zA-Z]/;function rs(e,t,n){const i=Ge(),s=n?.locale??i.locale??Al,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=et(e,n?.in);if(!Eo(r))throw new RangeError("Invalid time value");let l=t.match(H0).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=No[h];return f(d,s.formatLong)}return d}).join("").match(V0).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:j0(d)};if(Rl[h])return{isToken:!0,value:d};if(h.match(W0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(l=s.localize.preprocessor(r,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!n?.useAdditionalWeekYearTokens&&zl(h)||!n?.useAdditionalDayOfYearTokens&&Fl(h))&&Bo(h,t,String(e));const f=Rl[h[0]];return f(r,h,s.localize,c)}).join("")}function j0(e){const t=e.match($0);return t?t[1].replace(Y0,"'"):e}function Ul(){return Object.assign({},Ge())}function q0(e,t){const n=et(e,t?.in).getDay();return n===0?7:n}function G0(e,t){const n=X0(t)?new t(0):St(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function X0(e){return typeof e=="function"&&e.prototype?.constructor===e}const K0=10;class Vl{subPriority=0;validate(t,n){return!0}}class Z0 extends Vl{constructor(t,n,i,s,o){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class Q0 extends Vl{priority=K0;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>St(n,i))}set(t,n){return n.timestampIsSet?t:St(t,G0(t,this.context))}}class ut{run(t,n,i,s){const o=this.parse(t,n,i,s);return o?{setter:new Z0(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,i){return!0}}class J0 extends ut{priority=140;parse(t,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Mt={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}/},re={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 Dt(e,t){return e&&{value:t(e.value),rest:e.rest}}function kt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function le(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(s*Sn+o*ni+a*Py),rest:t.slice(n[0].length)}}function Hl(e){return kt(Mt.anyDigitsSigned,e)}function vt(e,t){switch(e){case 1:return kt(Mt.singleDigit,t);case 2:return kt(Mt.twoDigits,t);case 3:return kt(Mt.threeDigits,t);case 4:return kt(Mt.fourDigits,t);default:return kt(new RegExp("^\\d{1,"+e+"}"),t)}}function ls(e,t){switch(e){case 1:return kt(Mt.singleDigitSigned,t);case 2:return kt(Mt.twoDigitsSigned,t);case 3:return kt(Mt.threeDigitsSigned,t);case 4:return kt(Mt.fourDigitsSigned,t);default:return kt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function Fo(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function $l(e,t){const n=t>0,i=n?t:1-t;let s;if(i<=50)s=e||100;else{const o=i+50,a=Math.trunc(o/100)*100,r=e>=o%100;s=e+a-(r?100:0)}return n?s:1-s}function Yl(e){return e%400===0||e%4===0&&e%100!==0}class tb extends ut{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Dt(vt(4,t),s);case"yo":return Dt(i.ordinalNumber(t,{unit:"year"}),s);default:return Dt(vt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const s=t.getFullYear();if(i.isTwoDigitYear){const a=$l(i.year,s);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class eb extends ut{priority=130;parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Dt(vt(4,t),s);case"Yo":return Dt(i.ordinalNumber(t,{unit:"year"}),s);default:return Dt(vt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,s){const o=Lo(t,s);if(i.isTwoDigitYear){const r=$l(i.year,o);return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ae(t,s)}const a=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ae(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class nb extends ut{priority=130;parse(t,n){return ls(n==="R"?4:n.length,t)}set(t,n,i){const s=St(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),vn(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class ib extends ut{priority=130;parse(t,n){return ls(n==="u"?4:n.length,t)}set(t,n,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class sb extends ut{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return vt(n.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class ob extends ut{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return vt(n.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class ab extends ut{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"M":return Dt(kt(Mt.month,t),s);case"MM":return Dt(vt(2,t),s);case"Mo":return Dt(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class rb extends ut{priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"L":return Dt(kt(Mt.month,t),s);case"LL":return Dt(vt(2,t),s);case"Lo":return Dt(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function lb(e,t,n){const i=et(e,n?.in),s=El(i,n)-t;return i.setDate(i.getDate()-s*7),et(i,n?.in)}class cb extends ut{priority=100;parse(t,n,i){switch(n){case"w":return kt(Mt.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,s){return ae(lb(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function ub(e,t,n){const i=et(e,n?.in),s=Pl(i,n)-t;return i.setDate(i.getDate()-s*7),i}class db extends ut{priority=100;parse(t,n,i){switch(n){case"I":return kt(Mt.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return vn(ub(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const hb=[31,28,31,30,31,30,31,31,30,31,30,31],fb=[31,29,31,30,31,30,31,31,30,31,30,31];class mb extends ut{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return kt(Mt.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return vt(n.length,t)}}validate(t,n){const i=t.getFullYear(),s=Yl(i),o=t.getMonth();return s?n>=1&&n<=fb[o]:n>=1&&n<=hb[o]}set(t,n,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class pb extends ut{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return kt(Mt.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return vt(n.length,t)}}validate(t,n){const i=t.getFullYear();return Yl(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function zo(e,t,n){const i=Ge(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=et(e,n?.in),a=o.getDay(),l=(t%7+7)%7,c=7-s,d=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return os(o,d,n)}class gb extends ut{priority=90;parse(t,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=zo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class yb extends ut{priority=90;parse(t,n,i,s){const o=a=>{const r=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+r};switch(n){case"e":case"ee":return Dt(vt(n.length,t),o);case"eo":return Dt(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=zo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class bb extends ut{priority=90;parse(t,n,i,s){const o=a=>{const r=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+r};switch(n){case"c":case"cc":return Dt(vt(n.length,t),o);case"co":return Dt(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=zo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function _b(e,t,n){const i=et(e,n?.in),s=q0(i,n),o=t-s;return os(i,o,n)}class xb extends ut{priority=90;parse(t,n,i){const s=o=>o===0?7:o;switch(n){case"i":case"ii":return vt(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Dt(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return Dt(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Dt(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);default:return Dt(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,n){return n>=1&&n<=7}set(t,n,i){return t=_b(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class wb extends ut{priority=80;parse(t,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Fo(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class kb extends ut{priority=80;parse(t,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Fo(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class Tb extends ut{priority=80;parse(t,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(Fo(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Sb extends ut{priority=70;parse(t,n,i){switch(n){case"h":return kt(Mt.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,i){const s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class vb extends ut{priority=70;parse(t,n,i){switch(n){case"H":return kt(Mt.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Mb extends ut{priority=70;parse(t,n,i){switch(n){case"K":return kt(Mt.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Db extends ut{priority=70;parse(t,n,i){switch(n){case"k":return kt(Mt.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,i){const s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class Cb extends ut{priority=60;parse(t,n,i){switch(n){case"m":return kt(Mt.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class Ob extends ut{priority=50;parse(t,n,i){switch(n){case"s":return kt(Mt.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class Ab extends ut{priority=30;parse(t,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return Dt(vt(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class Pb extends ut{priority=10;parse(t,n){switch(n){case"X":return le(re.basicOptionalMinutes,t);case"XX":return le(re.basic,t);case"XXXX":return le(re.basicOptionalSeconds,t);case"XXXXX":return le(re.extendedOptionalSeconds,t);default:return le(re.extended,t)}}set(t,n,i){return n.timestampIsSet?t:St(t,t.getTime()-as(t)-i)}incompatibleTokens=["t","T","x"]}class Eb extends ut{priority=10;parse(t,n){switch(n){case"x":return le(re.basicOptionalMinutes,t);case"xx":return le(re.basic,t);case"xxxx":return le(re.basicOptionalSeconds,t);case"xxxxx":return le(re.extendedOptionalSeconds,t);default:return le(re.extended,t)}}set(t,n,i){return n.timestampIsSet?t:St(t,t.getTime()-as(t)-i)}incompatibleTokens=["t","T","X"]}class Rb extends ut{priority=40;parse(t){return Hl(t)}set(t,n,i){return[St(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Ib extends ut{priority=20;parse(t){return Hl(t)}set(t,n,i){return[St(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const Lb={G:new J0,y:new tb,Y:new eb,R:new nb,u:new ib,Q:new sb,q:new ob,M:new ab,L:new rb,w:new cb,I:new db,d:new mb,D:new pb,E:new gb,e:new yb,c:new bb,i:new xb,a:new wb,b:new kb,B:new Tb,h:new Sb,H:new vb,K:new Mb,k:new Db,m:new Cb,s:new Ob,S:new Ab,X:new Pb,x:new Eb,t:new Rb,T:new Ib},Nb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Bb=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Fb=/^'([^]*?)'?$/,zb=/''/g,Ub=/\S/,Vb=/[a-zA-Z]/;function Hb(e,t,n,i){const s=()=>St(i?.in||n,NaN),o=Ul(),a=i?.locale??o.locale??Al,r=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?s():et(n,i?.in);const c={firstWeekContainsDate:r,weekStartsOn:l,locale:a},d=[new Q0(i?.in,n)],h=t.match(Bb).map(y=>{const _=y[0];if(_ in No){const x=No[_];return x(y,a.formatLong)}return y}).join("").match(Nb),f=[];for(let y of h){!i?.useAdditionalWeekYearTokens&&zl(y)&&Bo(y,t,e),!i?.useAdditionalDayOfYearTokens&&Fl(y)&&Bo(y,t,e);const _=y[0],x=Lb[_];if(x){const{incompatibleTokens:T}=x;if(Array.isArray(T)){const w=f.find(M=>T.includes(M.token)||M.token===_);if(w)throw new RangeError(`The format string mustn't contain \`${w.fullToken}\` and \`${y}\` at the same time`)}else if(x.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);f.push({token:_,fullToken:y});const v=x.run(e,y,a.match,c);if(!v)return s();d.push(v.setter),e=v.rest}else{if(_.match(Vb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(y==="''"?y="'":_==="'"&&(y=$b(y)),e.indexOf(y)===0)e=e.slice(y.length);else return s()}}if(e.length>0&&Ub.test(e))return s();const m=d.map(y=>y.priority).sort((y,_)=>_-y).filter((y,_,x)=>x.indexOf(y)===_).map(y=>d.filter(_=>_.priority===y).sort((_,x)=>x.subPriority-_.subPriority)).map(y=>y[0]);let p=et(n,i?.in);if(isNaN(+p))return s();const g={};for(const y of m){if(!y.validate(p,c))return s();const _=y.set(p,g,c);Array.isArray(_)?(p=_[0],Object.assign(g,_[1])):p=_}return p}function $b(e){return e.match(Fb)[1].replace(zb,"'")}function Yb(e,t){const n=et(e,t?.in);return n.setMinutes(0,0,0),n}function Wb(e,t){const n=et(e,t?.in);return n.setSeconds(0,0),n}function jb(e,t){const n=et(e,t?.in);return n.setMilliseconds(0),n}function Wl(e){const t=e/Sn;return Math.trunc(t)}function jl(e,t){const n=()=>St(t?.in,NaN),i=t?.additionalDigits??2,s=Kb(e);let o;if(s.date){const c=Zb(s.date,i);o=Qb(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const a=+o;let r=0,l;if(s.time&&(r=Jb(s.time),isNaN(r)))return n();if(s.timezone){if(l=t_(s.timezone),isNaN(l))return n()}else{const c=new Date(a+r),d=et(0,t?.in);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return et(a+r+l,t?.in)}const cs={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},qb=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Gb=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Xb=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Kb(e){const t={},n=e.split(cs.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],cs.timeZoneDelimiter.test(t.date)&&(t.date=e.split(cs.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const s=cs.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function Zb(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((i[1]||i[2]).length)}}function Qb(e,t){if(t===null)return new Date(NaN);const n=e.match(qb);if(!n)return new Date(NaN);const i=!!n[4],s=ri(n[1]),o=ri(n[2])-1,a=ri(n[3]),r=ri(n[4]),l=ri(n[5])-1;if(i)return o_(t,r,l)?e_(t,r,l):new Date(NaN);{const c=new Date(0);return!i_(t,o,a)||!s_(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,a)),c)}}function ri(e){return e?parseInt(e):1}function Jb(e){const t=e.match(Gb);if(!t)return NaN;const n=Uo(t[1]),i=Uo(t[2]),s=Uo(t[3]);return a_(n,i,s)?n*Sn+i*ni+s*1e3:NaN}function Uo(e){return e&&parseFloat(e.replace(",","."))||0}function t_(e){if(e==="Z")return 0;const t=e.match(Xb);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return r_(i,s)?n*(i*Sn+s*ni):NaN}function e_(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const n_=[31,null,31,30,31,30,31,31,30,31,30,31];function ql(e){return e%400===0||e%4===0&&e%100!==0}function i_(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(n_[t]||(ql(e)?29:28))}function s_(e,t){return t>=1&&t<=(ql(e)?366:365)}function o_(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function a_(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function r_(e,t){return t>=0&&t<=59}const Gl={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",scatter:{median:"Median",percentile:"p{value}",outlier:"Outlier (> {label})"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},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."},canceled:{message:"Request canceled"},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_gateway_version:"AI gateway version",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",share_of_requests:"Share of requests",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)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal 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",consumer_group:"Consumer group",oidc_credential:"OIDC credential",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)",total_tokens_per_minute:"Total tokens per minute",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",cost_per_request_average:"Request cost (avg per million)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)","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",active_agents:"Active agents",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",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","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",share_of_requests:"Share of requests",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}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal 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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)",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",active_agents:"Active agents",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",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",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)",total_tokens_per_minute:"Total tokens per minute"},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"},timestampAxisTitles:{platform:"@timestamp created at"},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)"}},topTalkers:{total:"{value} total",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong"},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 Xl(){const e=Ar.createI18n("en-us",Gl);return{i18n:e,i18nT:Ar.i18nTComponent(e)}}function li(e){return e+.5|0}const Oe=(e,t,n)=>Math.max(Math.min(e,n),t);function ci(e){return Oe(li(e*2.55),0,255)}function Ae(e){return Oe(li(e*255),0,255)}function pe(e){return Oe(li(e/2.55)/100,0,1)}function Kl(e){return Oe(li(e*100),0,100)}const ie={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},Vo=[..."0123456789ABCDEF"],l_=e=>Vo[e&15],c_=e=>Vo[(e&240)>>4]+Vo[e&15],us=e=>(e&240)>>4===(e&15),u_=e=>us(e.r)&&us(e.g)&&us(e.b)&&us(e.a);function d_(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&ie[e[1]]*17,g:255&ie[e[2]]*17,b:255&ie[e[3]]*17,a:t===5?ie[e[4]]*17:255}:(t===7||t===9)&&(n={r:ie[e[1]]<<4|ie[e[2]],g:ie[e[3]]<<4|ie[e[4]],b:ie[e[5]]<<4|ie[e[6]],a:t===9?ie[e[7]]<<4|ie[e[8]]:255})),n}const h_=(e,t)=>e<255?t(e):"";function f_(e){var t=u_(e)?l_:c_;return e?"#"+t(e.r)+t(e.g)+t(e.b)+h_(e.a,t):void 0}const m_=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Zl(e,t,n){const i=t*Math.min(n,1-n),s=(o,a=(o+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function p_(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function g_(e,t,n){const i=Zl(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function y_(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Ho(e){const n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),a=Math.min(n,i,s),r=(o+a)/2;let l,c,d;return o!==a&&(d=o-a,c=r>.5?d/(2-o-a):d/(o+a),l=y_(n,i,s,d,o),l=l*60+.5),[l|0,c||0,r]}function $o(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Ae)}function Yo(e,t,n){return $o(Zl,e,t,n)}function b_(e,t,n){return $o(g_,e,t,n)}function __(e,t,n){return $o(p_,e,t,n)}function Ql(e){return(e%360+360)%360}function x_(e){const t=m_.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?ci(+t[5]):Ae(+t[5]));const s=Ql(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=b_(s,o,a):t[1]==="hsv"?i=__(s,o,a):i=Yo(s,o,a),{r:i[0],g:i[1],b:i[2],a:n}}function w_(e,t){var n=Ho(e);n[0]=Ql(n[0]+t),n=Yo(n),e.r=n[0],e.g=n[1],e.b=n[2]}function k_(e){if(!e)return;const t=Ho(e),n=t[0],i=Kl(t[1]),s=Kl(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${pe(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const Jl={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"},tc={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 T_(){const e={},t=Object.keys(tc),n=Object.keys(Jl);let i,s,o,a,r;for(i=0;i<t.length;i++){for(a=r=t[i],s=0;s<n.length;s++)o=n[s],r=r.replace(o,Jl[o]);o=parseInt(tc[a],16),e[r]=[o>>16&255,o>>8&255,o&255]}return e}let ds;function S_(e){ds||(ds=T_(),ds.transparent=[0,0,0,0]);const t=ds[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const v_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function M_(e){const t=v_.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?ci(a):Oe(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?ci(i):Oe(i,0,255)),s=255&(t[4]?ci(s):Oe(s,0,255)),o=255&(t[6]?ci(o):Oe(o,0,255)),{r:i,g:s,b:o,a:n}}}function D_(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${pe(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Wo=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Dn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function C_(e,t,n){const i=Dn(pe(e.r)),s=Dn(pe(e.g)),o=Dn(pe(e.b));return{r:Ae(Wo(i+n*(Dn(pe(t.r))-i))),g:Ae(Wo(s+n*(Dn(pe(t.g))-s))),b:Ae(Wo(o+n*(Dn(pe(t.b))-o))),a:e.a+n*(t.a-e.a)}}function hs(e,t,n){if(e){let i=Ho(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Yo(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function ec(e,t){return e&&Object.assign(t||{},e)}function nc(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ae(e[3]))):(t=ec(e,{r:0,g:0,b:0,a:1}),t.a=Ae(t.a)),t}function O_(e){return e.charAt(0)==="r"?M_(e):x_(e)}class ui{constructor(t){if(t instanceof ui)return t;const n=typeof t;let i;n==="object"?i=nc(t):n==="string"&&(i=d_(t)||S_(t)||O_(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ec(this._rgb);return t&&(t.a=pe(t.a)),t}set rgb(t){this._rgb=nc(t)}rgbString(){return this._valid?D_(this._rgb):void 0}hexString(){return this._valid?f_(this._rgb):void 0}hslString(){return this._valid?k_(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const a=n===o?.5:n,r=2*a-1,l=i.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=C_(this._rgb,t._rgb,n)),this}clone(){return new ui(this.rgb)}alpha(t){return this._rgb.a=Ae(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=li(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return hs(this._rgb,2,t),this}darken(t){return hs(this._rgb,2,-t),this}saturate(t){return hs(this._rgb,1,t),this}desaturate(t){return hs(this._rgb,1,-t),this}rotate(t){return w_(this._rgb,t),this}}function ge(){}const A_=(()=>{let e=0;return()=>e++})();function G(e){return e==null}function dt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function st(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function xt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function te(e,t){return xt(e)?e:t}function Q(e,t){return typeof e>"u"?t:e}const P_=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,ic=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function mt(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function pt(e,t,n,i){let s,o,a;if(dt(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(st(e))for(a=Object.keys(e),o=a.length,s=0;s<o;s++)t.call(n,e[a[s]],a[s])}function fs(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ms(e){if(dt(e))return e.map(ms);if(st(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=ms(e[n[s]]);return t}return e}function sc(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function E_(e,t,n,i){if(!sc(e))return;const s=t[e],o=n[e];st(s)&&st(o)?di(s,o,i):t[e]=ms(o)}function di(e,t,n){const i=dt(t)?t:[t],s=i.length;if(!st(e))return e;n=n||{};const o=n.merger||E_;let a;for(let r=0;r<s;++r){if(a=i[r],!st(a))continue;const l=Object.keys(a);for(let c=0,d=l.length;c<d;++c)o(l[c],e,a,n)}return e}function hi(e,t){return di(e,t,{merger:R_})}function R_(e,t,n){if(!sc(e))return;const i=t[e],s=n[e];st(i)&&st(s)?hi(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ms(s))}const oc={"":e=>e,x:e=>e.x,y:e=>e.y};function I_(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function L_(e){const t=I_(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Pe(e,t){return(oc[t]||(oc[t]=L_(t)))(e)}function jo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const qt=e=>typeof e<"u",Gt=e=>typeof e=="function",ac=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function N_(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const it=Math.PI,yt=2*it,B_=yt+it,ps=Number.POSITIVE_INFINITY,qo=it/180,bt=it/2,se=it/4,gs=it*2/3,Ee=Math.log10,ce=Math.sign;function fi(e,t,n){return Math.abs(e-t)<n}function rc(e){const t=Math.round(e);e=fi(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ee(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function F_(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function z_(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Re(e){return!z_(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function U_(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function lc(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ot(e){return e*(it/180)}function ys(e){return e*(180/it)}function cc(e){if(!xt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function bs(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*it&&(o+=yt),{angle:o,distance:s}}function Cn(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function V_(e,t){return(e-t+B_)%yt-it}function Ft(e){return(e%yt+yt)%yt}function mi(e,t,n,i){const s=Ft(e),o=Ft(t),a=Ft(n),r=Ft(o-s),l=Ft(a-s),c=Ft(s-o),d=Ft(s-a);return s===o||s===a||i&&o===a||r>l&&c<d}function Rt(e,t,n){return Math.max(t,Math.min(n,e))}function H_(e){return Rt(e,-32768,32767)}function ye(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Go(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const be=(e,t,n,i)=>Go(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),$_=(e,t,n)=>Go(e,n,i=>e[i][t]>=n);function Y_(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const uc=["push","pop","shift","splice","unshift"];function W_(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),uc.forEach(n=>{const i="_onData"+jo(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return e._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...o)}),a}})})}function dc(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(uc.forEach(o=>{delete e[o]}),delete e._chartjs)}function hc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const fc=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function mc(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,fc.call(window,()=>{i=!1,e.apply(t,n)}))}}function j_(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Xo=e=>e==="start"?"left":e==="end"?"right":"center",zt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,q_=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function pc(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:a,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=a.axis,{min:h,max:f,minDefined:m,maxDefined:p}=a.getUserBounds();if(m){if(s=Math.min(be(l,d,h).lo,n?i:be(t,d,a.getPixelForValue(h)).lo),c){const g=l.slice(0,s+1).reverse().findIndex(y=>!G(y[r.axis]));s-=Math.max(0,g)}s=Rt(s,0,i-1)}if(p){let g=Math.max(be(l,a.axis,f,!0).hi+1,n?0:be(t,d,a.getPixelForValue(f),!0).hi+1);if(c){const y=l.slice(g-1).findIndex(_=>!G(_[r.axis]));g+=Math.max(0,y)}o=Rt(g,s,i)-s}else o=i-s}return{start:s,count:o}}function gc(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const _s=e=>e===0||e===1,yc=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*yt/n)),bc=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*yt/n)+1,pi={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*bt)+1,easeOutSine:e=>Math.sin(e*bt),easeInOutSine:e=>-.5*(Math.cos(it*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>_s(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>_s(e)?e:yc(e,.075,.3),easeOutElastic:e=>_s(e)?e:bc(e,.075,.3),easeInOutElastic(e){return _s(e)?e:e<.5?.5*yc(e*2,.1125,.45):.5+.5*bc(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-pi.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?pi.easeInBounce(e*2)*.5:pi.easeOutBounce(e*2-1)*.5+.5};function Ko(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xs(e){return Ko(e)?e:new ui(e)}function Zo(e){return Ko(e)?e:new ui(e).saturate(.5).darken(.1).hexString()}const G_=["x","y","borderWidth","radius","tension"],X_=["color","borderColor","backgroundColor"];function K_(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:X_},numbers:{type:"number",properties:G_}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Z_(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const _c=new Map;function Q_(e,t){t=t||{};const n=e+JSON.stringify(t);let i=_c.get(n);return i||(i=new Intl.NumberFormat(e,t),_c.set(n,i)),i}function gi(e,t,n){return Q_(t,n).format(e)}const xc={values(e){return dt(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=J_(e,n)}const a=Ee(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),gi(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ee(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?xc.numeric.call(this,e,t,n):""}};function J_(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var ws={formatters:xc};function tx(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ws.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ze=Object.create(null),Qo=Object.create(null);function yi(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Jo(e,t,n){return typeof t=="string"?di(yi(e,t),n):di(yi(e,""),t)}class ex{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Zo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Zo(s.borderColor),this.hoverColor=(i,s)=>Zo(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(n)}set(t,n){return Jo(this,t,n)}get(t){return yi(this,t)}describe(t,n){return Jo(Qo,t,n)}override(t,n){return Jo(Ze,t,n)}route(t,n,i,s){const o=yi(this,t),a=yi(this,i),r="_"+n;Object.defineProperties(o,{[r]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[r],c=a[s];return st(l)?Object.assign({},c,l):Q(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(n=>n(this))}}var _t=new ex({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[K_,Z_,tx]);function nx(e){return!e||G(e.size)||G(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ks(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function ix(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const r=n.length;let l,c,d,h,f;for(l=0;l<r;l++)if(h=n[l],h!=null&&!dt(h))a=ks(e,s,o,a,h);else if(dt(h))for(c=0,d=h.length;c<d;c++)f=h[c],f!=null&&!dt(f)&&(a=ks(e,s,o,a,f));e.restore();const m=o.length/2;if(m>n.length){for(l=0;l<m;l++)delete s[o[l]];o.splice(0,m)}return a}function Qe(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function wc(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ta(e,t,n,i){kc(e,t,n,i,null)}function kc(e,t,n,i,s){let o,a,r,l,c,d,h,f;const m=t.pointStyle,p=t.rotation,g=t.radius;let y=(p||0)*qo;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),m){default:s?e.ellipse(n,i,s/2,g,0,0,yt):e.arc(n,i,g,0,yt),e.closePath();break;case"triangle":d=s?s/2:g,e.moveTo(n+Math.sin(y)*d,i-Math.cos(y)*g),y+=gs,e.lineTo(n+Math.sin(y)*d,i-Math.cos(y)*g),y+=gs,e.lineTo(n+Math.sin(y)*d,i-Math.cos(y)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(y+se)*l,h=Math.cos(y+se)*(s?s/2-c:l),r=Math.sin(y+se)*l,f=Math.sin(y+se)*(s?s/2-c:l),e.arc(n-h,i-r,c,y-it,y-bt),e.arc(n+f,i-a,c,y-bt,y),e.arc(n+h,i+r,c,y,y+bt),e.arc(n-f,i+a,c,y+bt,y+it),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,d=s?s/2:l,e.rect(n-d,i-l,2*d,2*l);break}y+=se;case"rectRot":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+f,i-a),e.lineTo(n+h,i+r),e.lineTo(n-f,i+a),e.closePath();break;case"crossRot":y+=se;case"cross":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"star":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a),y+=se,h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"line":a=s?s/2:Math.cos(y)*g,r=Math.sin(y)*g,e.moveTo(n-a,i-r),e.lineTo(n+a,i+r);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function _e(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function bi(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function _i(e){e.restore()}function sx(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function ox(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function ax(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),G(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function rx(e,t,n,i,s){if(s.strikethrough||s.underline){const o=e.measureText(i),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(a,d),e.lineTo(r,d),e.stroke()}}function lx(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function Je(e,t,n,i,s,o={}){const a=dt(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,ax(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&lx(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),G(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),rx(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function On(e,t){const{x:n,y:i,w:s,h:o,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*it,it,!0),e.lineTo(n,i+o-a.bottomLeft),e.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,it,bt,!0),e.lineTo(n+s-a.bottomRight,i+o),e.arc(n+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,bt,0,!0),e.lineTo(n+s,i+a.topRight),e.arc(n+s-a.topRight,i+a.topRight,a.topRight,0,-bt,!0),e.lineTo(n+a.topLeft,i)}const cx=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ux=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function dx(e,t){const n=(""+e).match(cx);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const hx=e=>+e||0;function ea(e,t){const n={},i=st(t),s=i?Object.keys(t):t,o=st(e)?i?a=>Q(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of s)n[a]=hx(o(a));return n}function Tc(e){return ea(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ie(e){return ea(e,["topLeft","topRight","bottomLeft","bottomRight"])}function At(e){const t=Tc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function wt(e,t){e=e||{},t=t||_t.font;let n=Q(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Q(e.style,t.style);i&&!(""+i).match(ux)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Q(e.family,t.family),lineHeight:dx(Q(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Q(e.weight,t.weight),string:""};return s.string=nx(s),s}function xi(e,t,n,i){let s,o,a;for(s=0,o=e.length;s<o;++s)if(a=e[s],a!==void 0&&a!==void 0)return a}function fx(e,t,n){const{min:i,max:s}=e,o=ic(t,(s-i)/2),a=(r,l)=>n&&r===0?0:r+l;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function Le(e,t){return Object.assign(Object.create(e),t)}function na(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=Cc("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>na([r,...e],t,o,i)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete e[0][l],!0},get(r,l){return vc(r,l,()=>wx(l,t,e,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,l){return Oc(r).includes(l)},ownKeys(r){return Oc(r)},set(r,l,c){const d=r._storage||(r._storage=s());return r[l]=d[l]=c,delete r._keys,!0}})}function An(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:Sc(e,i),setContext:o=>An(e,o,n,i),override:o=>An(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete e[a],!0},get(o,a,r){return vc(o,a,()=>px(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(o,a,r){return e[a]=r,delete o[a],!0}})}function Sc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Gt(n)?n:()=>n,isIndexable:Gt(i)?i:()=>i}}const mx=(e,t)=>e?e+jo(t):t,ia=(e,t)=>st(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function px(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=e;let r=i[t];return Gt(r)&&a.isScriptable(t)&&(r=gx(t,r,e,n)),dt(r)&&r.length&&(r=yx(t,r,e,a.isIndexable)),ia(t,r)&&(r=An(r,s,o&&o[t],a)),r}function gx(e,t,n,i){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=n;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=t(o,a||i);return r.delete(e),ia(e,l)&&(l=sa(s._scopes,s,e,l)),l}function yx(e,t,n,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(st(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const h=sa(c,s,e,d);t.push(An(h,o,a&&a[e],r))}}return t}function Mc(e,t,n){return Gt(e)?e(t,n):e}const bx=(e,t)=>e===!0?t:typeof e=="string"?Pe(t,e):void 0;function _x(e,t,n,i,s){for(const o of t){const a=bx(n,o);if(a){e.add(a);const r=Mc(a._fallback,n,s);if(typeof r<"u"&&r!==n&&r!==i)return r}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function sa(e,t,n,i){const s=t._rootScopes,o=Mc(t._fallback,n,i),a=[...e,...s],r=new Set;r.add(i);let l=Dc(r,a,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=Dc(r,a,o,l,i),l===null)?!1:na(Array.from(r),[""],s,o,()=>xx(t,n,i))}function Dc(e,t,n,i,s){for(;n;)n=_x(e,t,n,i,s);return n}function xx(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return dt(s)&&st(n)?n:s||{}}function wx(e,t,n,i){let s;for(const o of t)if(s=Cc(mx(o,e),n),typeof s<"u")return ia(e,s)?sa(n,i,e,s):s}function Cc(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function Oc(e){let t=e._keys;return t||(t=e._keys=kx(e._scopes)),t}function kx(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Ac(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,a=new Array(i);let r,l,c,d;for(r=0,l=i;r<l;++r)c=r+n,d=t[c],a[r]={r:s.parse(Pe(d,o),c)};return a}const Tx=Number.EPSILON||1e-14,Pn=(e,t)=>t<e.length&&!e[t].skip&&e[t],Pc=e=>e==="x"?"y":"x";function Sx(e,t,n,i){const s=e.skip?t:e,o=t,a=n.skip?t:n,r=Cn(o,s),l=Cn(a,o);let c=r/(r+l),d=l/(r+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const h=i*c,f=i*d;return{previous:{x:o.x-h*(a.x-s.x),y:o.y-h*(a.y-s.y)},next:{x:o.x+f*(a.x-s.x),y:o.y+f*(a.y-s.y)}}}function vx(e,t,n){const i=e.length;let s,o,a,r,l,c=Pn(e,0);for(let d=0;d<i-1;++d)if(l=c,c=Pn(e,d+1),!(!l||!c)){if(fi(t[d],0,Tx)){n[d]=n[d+1]=0;continue}s=n[d]/t[d],o=n[d+1]/t[d],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),n[d]=s*a*t[d],n[d+1]=o*a*t[d])}}function Mx(e,t,n="x"){const i=Pc(n),s=e.length;let o,a,r,l=Pn(e,0);for(let c=0;c<s;++c){if(a=r,r=l,l=Pn(e,c+1),!r)continue;const d=r[n],h=r[i];a&&(o=(d-a[n])/3,r[`cp1${n}`]=d-o,r[`cp1${i}`]=h-o*t[c]),l&&(o=(l[n]-d)/3,r[`cp2${n}`]=d+o,r[`cp2${i}`]=h+o*t[c])}}function Dx(e,t="x"){const n=Pc(t),i=e.length,s=Array(i).fill(0),o=Array(i);let a,r,l,c=Pn(e,0);for(a=0;a<i;++a)if(r=l,l=c,c=Pn(e,a+1),!!l){if(c){const d=c[t]-l[t];s[a]=d!==0?(c[n]-l[n])/d:0}o[a]=r?c?ce(s[a-1])!==ce(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}vx(e,s,o),Mx(e,o,t)}function Ts(e,t,n){return Math.max(Math.min(e,n),t)}function Cx(e,t){let n,i,s,o,a,r=_e(e[0],t);for(n=0,i=e.length;n<i;++n)a=o,o=r,r=n<i-1&&_e(e[n+1],t),o&&(s=e[n],a&&(s.cp1x=Ts(s.cp1x,t.left,t.right),s.cp1y=Ts(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=Ts(s.cp2x,t.left,t.right),s.cp2y=Ts(s.cp2y,t.top,t.bottom)))}function Ox(e,t,n,i,s){let o,a,r,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Dx(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=Sx(c,r,e[Math.min(o+1,a-(i?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&Cx(e,n)}function oa(){return typeof window<"u"&&typeof document<"u"}function aa(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ss(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const vs=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function Ax(e,t){return vs(e).getPropertyValue(t)}const Px=["top","right","bottom","left"];function tn(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Px[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ex=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Rx(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(Ex(s,o,e.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Ne(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=vs(n),o=s.boxSizing==="border-box",a=tn(s,"padding"),r=tn(s,"border","width"),{x:l,y:c,box:d}=Rx(e,n),h=a.left+(d&&r.left),f=a.top+(d&&r.top);let{width:m,height:p}=t;return o&&(m-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-h)/m*n.width/i),y:Math.round((c-f)/p*n.height/i)}}function Ix(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&aa(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const a=o.getBoundingClientRect(),r=vs(o),l=tn(r,"border","width"),c=tn(r,"padding");t=a.width-c.width-l.width,n=a.height-c.height-l.height,i=Ss(r.maxWidth,o,"clientWidth"),s=Ss(r.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||ps,maxHeight:s||ps}}const Be=e=>Math.round(e*10)/10;function Lx(e,t,n,i){const s=vs(e),o=tn(s,"margin"),a=Ss(s.maxWidth,e,"clientWidth")||ps,r=Ss(s.maxHeight,e,"clientHeight")||ps,l=Ix(e,t,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const f=tn(s,"border","width"),m=tn(s,"padding");c-=m.width+f.width,d-=m.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,i?c/i:d-o.height),c=Be(Math.min(c,a,l.maxWidth)),d=Be(Math.min(d,r,l.maxHeight)),c&&!d&&(d=Be(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&d>l.height&&(d=l.height,c=Be(Math.floor(d*i))),{width:c,height:d}}function Ec(e,t,n){const i=t||1,s=Be(e.height*i),o=Be(e.width*i);e.height=Be(e.height),e.width=Be(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(e.currentDevicePixelRatio=i,a.height=s,a.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Nx=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};oa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Rc(e,t){const n=Ax(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function en(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Bx(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Fx(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},a=en(e,s,n),r=en(s,o,n),l=en(o,t,n),c=en(a,r,n),d=en(r,l,n);return en(c,d,n)}const zx=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Ux=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function En(e,t,n){return e?zx(t,n):Ux()}function Ic(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Lc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Nc(e){return e==="angle"?{between:mi,compare:V_,normalize:Ft}:{between:ye,compare:(t,n)=>t-n,normalize:t=>t}}function Bc({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function Vx(e,t,n){const{property:i,start:s,end:o}=n,{between:a,normalize:r}=Nc(i),l=t.length;let{start:c,end:d,loop:h}=e,f,m;if(h){for(c+=l,d+=l,f=0,m=l;f<m&&a(r(t[c%l][i]),s,o);++f)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:h,style:e.style}}function Fc(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,a=t.length,{compare:r,between:l,normalize:c}=Nc(i),{start:d,end:h,loop:f,style:m}=Vx(e,t,n),p=[];let g=!1,y=null,_,x,T;const v=()=>l(s,T,_)&&r(s,T)!==0,w=()=>r(o,_)===0||l(o,T,_),M=()=>g||v(),D=()=>!g||w();for(let P=d,k=d;P<=h;++P)x=t[P%a],!x.skip&&(_=c(x[i]),_!==T&&(g=l(_,s,o),y===null&&M()&&(y=r(_,s)===0?P:k),y!==null&&D()&&(p.push(Bc({start:y,end:P,loop:f,count:a,style:m})),y=null),k=P,T=_));return y!==null&&p.push(Bc({start:y,end:h,loop:f,count:a,style:m})),p}function zc(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=Fc(i[s],e.points,t);o.length&&n.push(...o)}return n}function Hx(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function $x(e,t,n,i){const s=e.length,o=[];let a=t,r=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?r.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function Yx(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:a,end:r}=Hx(n,s,o,i);if(i===!0)return Uc(e,[{start:a,end:r,loop:o}],n,t);const l=r<a?r+s:r,c=!!e._fullLoop&&a===0&&r===s-1;return Uc(e,$x(n,a,l,c),n,t)}function Uc(e,t,n,i){return!i||!i.setContext||!n?t:Wx(e,t,n,i)}function Wx(e,t,n,i){const s=e._chart.getContext(),o=Vc(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=n.length,c=[];let d=o,h=t[0].start,f=h;function m(p,g,y,_){const x=r?-1:1;if(p!==g){for(p+=l;n[p%l].skip;)p-=x;for(;n[g%l].skip;)g+=x;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:y,style:_}),d=_,h=g%l)}}for(const p of t){h=r?h:p.start;let g=n[h%l],y;for(f=h+1;f<=p.end;f++){const _=n[f%l];y=Vc(i.setContext(Le(s,{type:"segment",p0:g,p1:_,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),jx(y,d)&&m(h,f-1,p.loop,d),g=_,d=y}h<f-1&&m(h,f-1,p.loop,d)}return c}function Vc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function jx(e,t){if(!t)return!1;const n=[],i=function(s,o){return Ko(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Ms(e,t,n){return e.options.clip?e[n]:t[n]}function qx(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Ms(n,t,"left"),right:Ms(n,t,"right"),top:Ms(i,t,"top"),bottom:Ms(i,t,"bottom")}:t}function Hc(e,t){const n=t._clip;if(n.disabled)return!1;const i=qx(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class Gx{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],a=n.duration;o.forEach(r=>r({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=fc.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var xe=new Gx;const $c="transparent",Xx={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=xs(e||$c),s=i.valid&&xs(t||$c);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Kx{constructor(t,n,i,s){const o=n[i];s=xi([t.to,s,o,t.from]);const a=xi([t.from,o,s]);this._active=!0,this._fn=t.fn||Xx[t.type||typeof a],this._easing=pi[t.easing]||pi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=xi([t.to,n,s,t.from]),this._from=xi([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||n<i),!this._active){this._target[s]=r,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class ra{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!st(t))return;const n=Object.keys(_t.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!st(o))return;const a={};for(const r of n)a[r]=o[r];(dt(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,n){const i=n.options,s=Qx(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&Zx(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),r=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,n));continue}const d=n[c];let h=o[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,d,r);continue}else h.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=h=new Kx(f,t,c,d),s.push(h)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return xe.add(this._chart,i),!0}}function Zx(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Qx(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Yc(e,t){const n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Jx(e,t,n){if(n===!1)return!1;const i=Yc(e,n),s=Yc(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function tw(e){let t,n,i,s;return st(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function Wc(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function jc(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let a,r,l,c;if(t===null)return;let d=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===n){if(d=!0,i.all)continue;break}c=e.values[l],xt(c)&&(o||t===0||ce(t)===ce(c))&&(t+=c)}return!d&&!i.all?0:t}function ew(e,t){const{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(e),r=new Array(a.length);let l,c,d;for(l=0,c=a.length;l<c;++l)d=a[l],r[l]={[s]:d,[o]:e[d]};return r}function la(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function nw(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function iw(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function sw(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function qc(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Gc(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,d=nw(o,a,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:g,[c]:y}=p,_=p._stacks||(p._stacks={});f=_[c]=sw(s,d,g),f[r]=y,f._top=qc(f,a,!0,i.type),f._bottom=qc(f,a,!1,i.type);const x=f._visualValues||(f._visualValues={});x[r]=y}}function ca(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function ow(e,t){return Le(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function aw(e,t,n){return Le(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function wi(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const ua=e=>e==="reset"||e==="none",Xc=(e,t)=>t?e:Object.assign({},e),rw=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Wc(n,!0),values:null};class Fe{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=la(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&wi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,o=n.xAxisID=Q(i.xAxisID,ca(t,"x")),a=n.yAxisID=Q(i.yAxisID,ca(t,"y")),r=n.rAxisID=Q(i.rAxisID,ca(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,a,r),d=n.vAxisID=s(l,a,o,r);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(r),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&dc(this._data,this),t._stacked&&wi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(st(n)){const s=this._cachedMeta;this._data=ew(n,s)}else if(i!==n){if(i){dc(i,this);const s=this._cachedMeta;wi(s),s._parsed=[]}n&&Object.isExtensible(n)&&W_(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=la(n.vScale,n),n.stack!==i.stack&&(s=!0,wi(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(Gc(this,n._parsed),n._stacked=la(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],d,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{dt(s[t])?f=this.parseArrayData(i,s,t,n):st(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);const m=()=>h[r]===null||c&&h[r]<c[r];for(d=0;d<n;++d)i._parsed[d+t]=h=f[d],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&Gc(this,f)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),d=o===a,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[r]:d||o.parse(c[p],p),[l]:a.parse(n[p],p)};return h}parseArrayData(t,n,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,d,h;for(l=0,c=s;l<c;++l)d=l+i,h=n[d],r[l]={x:o.parse(h[0],d),y:a.parse(h[1],d)};return r}parseObjectData(t,n,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,h,f,m;for(d=0,h=s;d<h;++d)f=d+i,m=n[f],c[d]={x:o.parse(Pe(m,r),f),y:a.parse(Pe(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,a=n[t.axis],r={keys:Wc(s,!0),values:n._stacks[t.axis]._visualValues};return jc(r,a,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let a=o===null?NaN:o;const r=s&&i._stacks[n.axis];s&&r&&(s.values=r,a=jc(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=rw(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=iw(r);let f,m;function p(){m=s[f];const g=m[r.axis];return!xt(m[t.axis])||d>g||h<g}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=n.length;s<o;++s)a=n[s][t.axis],xt(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=tw(Q(this.options.clip,Jx(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(t,o,r,l),d=r;d<r+l;++d){const h=s[d];h.hidden||(h.active&&c?a.push(h):h.draw(t,o))}for(d=0;d<a.length;++d)a[d].draw(t,o)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=aw(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=ow(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const s=n==="active",o=this._cachedDataOpts,a=t+"-"+n,r=o[a],l=this.enableOptionSharing&&qt(i);if(r)return Xc(r,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),d),m=Object.keys(_t.elements[t]),p=()=>this.getContext(i,s,n),g=c.resolveNamedOptions(f,m,p,h);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(Xc(g,l))),g}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(f,this.getContext(t,i,n))}const c=new ra(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||ua(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:a}}updateElement(t,n,i,s){ua(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!ua(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=i.length,o=n.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,a=t+n;let r;const l=c=>{for(c.length+=n,r=c.length-1;r>=a;r--)c[r]=c[r-n]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&wi(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](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,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function lw(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=hc(i.sort((s,o)=>s-o))}return e._cache.$bar}function cw(e){const t=e.iScale,n=lw(t,e.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(qt(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(s=0,o=n.length;s<o;++s)a=t.getPixelForValue(n[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return i}function uw(e,t,n,i){const s=n.barThickness;let o,a;return G(s)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[e]-o/2}}function dw(e,t,n,i){const s=t.pixels,o=s[e];let a=e>0?s[e-1]:null,r=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:n.barPercentage,start:c}}function hw(e,t,n,i){const s=n.parse(e[0],i),o=n.parse(e[1],i),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function Kc(e,t,n,i){return dt(e)?hw(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Zc(e,t,n,i){const s=e.iScale,o=e.vScale,a=s.getLabels(),r=s===o,l=[];let c,d,h,f;for(c=n,d=n+i;c<d;++c)f=t[c],h={},h[s.axis]=r||s.parse(a[c],c),l.push(Kc(f,h,o,c));return l}function da(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function fw(e,t,n){return e!==0?ce(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function mw(e){let t,n,i,s,o;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:t,top:s,bottom:o}}function pw(e,t,n,i){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:d}=mw(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?s=c:(n._bottom||0)===i?s=d:(o[Qc(d,a,r,l)]=!0,s=c)),o[Qc(s,a,r,l)]=!0,e.borderSkipped=o}function Qc(e,t,n,i){return i?(e=gw(e,t,n),e=Jc(e,n,t)):e=Jc(e,t,n),e}function gw(e,t,n){return e===t?n:e===n?t:e}function Jc(e,t,n){return e==="start"?t:e==="end"?n:e}function yw(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class tu extends Fe{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,s){return Zc(t,n,i,s)}parseArrayData(t,n,i,s){return Zc(t,n,i,s)}parseObjectData(t,n,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,d=a.axis==="x"?r:l,h=[];let f,m,p,g;for(f=i,m=i+s;f<m;++f)g=n[f],p={},p[o.axis]=o.parse(Pe(g,c),f),h.push(Kc(Pe(g,d),p,a,f));return h}updateRangeFromParsed(t,n,i,s){super.updateRangeFromParsed(t,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(t),a=o._custom,r=da(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),g=o||G(p[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,d),_=(p._stacks||{})[r.axis],x={horizontal:c,base:g.base,enableBorderRadius:!_||da(p._custom)||a===_._top||a===_._bottom,x:c?g.head:y.center,y:c?y.center:g.head,height:c?y.size:Math.abs(g.size),width:c?Math.abs(g.size):y.size};f&&(x.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const T=x.options||t[m].options;pw(x,T,_,a),yw(x,T,d.ratio),this.updateElement(t[m],m,x,s)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(n),l=r&&r[i.axis],c=d=>{const h=d._parsed.find(m=>m[i.axis]===l),f=h&&h[d.vScale.axis];if(G(f)||isNaN(f))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((o===!1||a.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Q(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const s=this._getStacks(t,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,a;for(o=0,a=n.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||cw(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,d=da(c);let h=l[n.axis],f=0,m=i?this.applyStack(n,l,i):h,p,g;m!==h&&(f=m-h,m=h),d&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&ce(h)!==ce(c.barEnd)&&(f=0),f+=h);const y=!G(o)&&!d?o:f;let _=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+m):p=_,g=p-_,Math.abs(g)<a){g=fw(g,n,r)*a,h===r&&(_-=g/2);const x=n.getPixelForDecimal(0),T=n.getPixelForDecimal(1),v=Math.min(x,T),w=Math.max(x,T);_=Math.max(Math.min(_,w),v),p=_+g,i&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(_))}if(_===n.getPixelForValue(r)){const x=ce(g)*n.getLineWidthForValue(r)/2;_+=x,g-=x}return{size:g,base:_,head:p,center:p+g/2}}_calculateBarIndexPixels(t,n){const i=n.scale,s=this.options,o=s.skipNull,a=Q(s.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(n.grouped){const d=o?this._getStackCount(t):n.stackCount,h=s.barThickness==="flex"?dw(t,n,s,d*c):uw(t,n,s,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Q(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;r=h.start+h.chunk*p+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,n.min*n.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class bw extends Fe{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,s){const o=super.parsePrimitiveData(t,n,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(t,n,i,s){const o=super.parseArrayData(t,n,i,s);for(let a=0;a<o.length;a++){const r=n[i+a];o[a]._custom=Q(r[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(t,n,i,s){const o=super.parseObjectData(t,n,i,s);for(let a=0;a<o.length;a++){const r=n[i+a];o[a]._custom=Q(r&&r.r&&+r.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),d=a.axis,h=r.axis;for(let f=n;f<n+i;f++){const m=t[f],p=!o&&this.getParsed(f),g={},y=g[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[d]),_=g[h]=o?r.getBasePixel():r.getPixelForValue(p[h]);g.skip=isNaN(y)||isNaN(_),c&&(g.options=l||this.resolveDataElementOptions(f,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,f,g,s)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=Q(i&&i._custom,o),s}}function _w(e,t,n){let i=1,s=1,o=0,a=0;if(t<yt){const r=e,l=r+t,c=Math.cos(r),d=Math.sin(r),h=Math.cos(l),f=Math.sin(l),m=(T,v,w)=>mi(T,r,l,!0)?1:Math.max(v,v*n,w,w*n),p=(T,v,w)=>mi(T,r,l,!0)?-1:Math.min(v,v*n,w,w*n),g=m(0,c,h),y=m(bt,d,f),_=p(it,c,h),x=p(it+bt,d,f);i=(g-_)/2,s=(y-x)/2,o=-(g+_)/2,a=-(y+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class ki extends Fe{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,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&&(r||h.borderRadius),index:c}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(st(i[t])){const{key:l="value"}=this._parsing;o=c=>+Pe(i[c],l)}let a,r;for(a=t,r=t+n;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return Ot(this.options.rotation-90)}_getCircumference(){return Ot(this.options.circumference)}_getRotationExtents(){let t=yt,n=-yt;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(P_(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:g}=_w(h,d,l),y=(i.width-a)/f,_=(i.height-a)/m,x=Math.max(Math.min(y,_)/2,0),T=ic(this.options.radius,x),v=Math.max(T*l,0),w=(T-v)/this._getVisibleDatasetWeightTotal();this.offsetX=p*T,this.offsetY=g*T,s.total=this.calculateTotal(),this.outerRadius=T-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/yt)}updateElements(t,n,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,d=(r.left+r.right)/2,h=(r.top+r.bottom)/2,f=o&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(n,s);let _=this._getRotation(),x;for(x=0;x<n;++x)_+=this._circumference(x,o);for(x=n;x<n+i;++x){const T=this._circumference(x,o),v=t[x],w={x:d+this.offsetX,y:h+this.offsetY,startAngle:_,endAngle:_+T,circumference:T,outerRadius:p,innerRadius:m};y&&(w.options=g||this.resolveDataElementOptions(x,v.active?"active":s)),_+=T,this.updateElement(v,x,w,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?yt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=gi(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Q(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class eu extends Fe{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:r,count:l}=pc(n,s,a);this._drawStart=r,this._drawCount=l,gc(n)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._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,r,l,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,s),f=a.axis,m=r.axis,{spanGaps:p,segment:g}=this.options,y=Re(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",x=n+i,T=t.length;let v=n>0&&this.getParsed(n-1);for(let w=0;w<T;++w){const M=t[w],D=_?M:{};if(w<n||w>=x){D.skip=!0;continue}const P=this.getParsed(w),k=G(P[m]),S=D[f]=a.getPixelForValue(P[f],w),A=D[m]=o||k?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,P,l):P[m],w);D.skip=isNaN(S)||isNaN(A)||k,D.stop=w>0&&Math.abs(P[f]-v[f])>y,g&&(D.parsed=P,D.raw=c.data[w]),h&&(D.options=d||this.resolveDataElementOptions(w,M.active?"active":s)),_||this.updateElement(M,w,D,s),v=P}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class nu extends Fe{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=gi(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return Ac.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,n,i,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*it;let m=f,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,g);for(p=n;p<n+i;p++){const y=t[p];let _=m,x=m+this._computeAngle(p,s,g),T=a.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=x,o&&(l.animateScale&&(T=0),l.animateRotate&&(_=x=f));const v={x:d,y:h,innerRadius:0,outerRadius:T,startAngle:_,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,v,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Ot(this.resolveDataElementOptions(t,n).angle||i):0}}class xw extends ki{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class ww extends Fe{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return Ac.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=n;r<n+i;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),d=o.getPointPositionForValue(r,this.getParsed(r).r),h=a?o.xCenter:d.x,f=a?o.yCenter:d.y,m={x:h,y:f,angle:d.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,r,m,s)}}}class iu extends Fe{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+l+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:a}=pc(n,i,s);if(this._drawStart=o,this._drawCount=a,gc(n)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=n;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,s),h=this.getSharedOptions(d),f=this.includeOptions(s,h),m=a.axis,p=r.axis,{spanGaps:g,segment:y}=this.options,_=Re(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let T=n>0&&this.getParsed(n-1);for(let v=n;v<n+i;++v){const w=t[v],M=this.getParsed(v),D=x?w:{},P=G(M[p]),k=D[m]=a.getPixelForValue(M[m],v),S=D[p]=o||P?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,M,l):M[p],v);D.skip=isNaN(k)||isNaN(S)||P,D.stop=v>0&&Math.abs(M[m]-T[m])>_,y&&(D.parsed=M,D.raw=c.data[v]),f&&(D.options=h||this.resolveDataElementOptions(v,w.active?"active":s)),x||this.updateElement(w,v,D,s),T=M}this.updateSharedOptions(h,s,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let r=0;for(let l=n.length-1;l>=0;--l)r=Math.max(r,n[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}}var kw=Object.freeze({__proto__:null,BarController:tu,BubbleController:bw,DoughnutController:ki,LineController:eu,PieController:xw,PolarAreaController:nu,RadarController:ww,ScatterController:iu});function nn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ha{static override(t){Object.assign(ha.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return nn()}parse(){return nn()}format(){return nn()}add(){return nn()}diff(){return nn()}startOf(){return nn()}endOf(){return nn()}}var su={_date:ha};function Tw(e,t,n,i){const{controller:s,data:o,_sorted:a}=e,r=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?$_:be;if(i){if(s._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(o,t,n-h),m=c(o,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const d=c(o,t,n);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=e,m=f.slice(0,d.lo+1).reverse().findIndex(g=>!G(g[h.axis]));d.lo-=Math.max(0,m);const p=f.slice(d.hi).findIndex(g=>!G(g[h.axis]));d.hi+=Math.max(0,p)}return d}}return{lo:0,hi:o.length-1}}function Ti(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:d}=o[r],{lo:h,hi:f}=Tw(o[r],t,a,s);for(let m=h;m<=f;++m){const p=d[m];p.skip||i(p,c,m)}}}function Sw(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,a=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function fa(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||Ti(e,n,t,function(r,l,c){!s&&!_e(r,e.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function vw(e,t,n,i){let s=[];function o(a,r,l){const{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:h}=bs(a,{x:t.x,y:t.y});mi(h,c,d)&&s.push({element:a,datasetIndex:r,index:l})}return Ti(e,n,t,o),s}function Mw(e,t,n,i,s,o){let a=[];const r=Sw(n);let l=Number.POSITIVE_INFINITY;function c(d,h,f){const m=d.inRange(t.x,t.y,s);if(i&&!m)return;const p=d.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!m)return;const y=r(t,p);y<l?(a=[{element:d,datasetIndex:h,index:f}],l=y):y===l&&a.push({element:d,datasetIndex:h,index:f})}return Ti(e,n,t,c),a}function ma(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?vw(e,t,n,s):Mw(e,t,n,i,s,o)}function ou(e,t,n,i,s){const o=[],a=n==="x"?"inXRange":"inYRange";let r=!1;return Ti(e,n,t,(l,c,d)=>{l[a]&&l[a](t[n],s)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var pa={evaluateInteractionItems:Ti,modes:{index(e,t,n,i){const s=Ne(t,e),o=n.axis||"x",a=n.includeInvisible||!1,r=n.intersect?fa(e,s,o,i,a):ma(e,s,o,!1,i,a),l=[];return r.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,h=c.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,i){const s=Ne(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let r=n.intersect?fa(e,s,o,i,a):ma(e,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=e.getDatasetMeta(l).data;r=[];for(let d=0;d<c.length;++d)r.push({element:c[d],datasetIndex:l,index:d})}return r},point(e,t,n,i){const s=Ne(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return fa(e,s,o,i,a)},nearest(e,t,n,i){const s=Ne(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return ma(e,s,o,n.intersect,i,a)},x(e,t,n,i){const s=Ne(t,e);return ou(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=Ne(t,e);return ou(e,s,"y",n.intersect,i)}}};const au=["left","top","right","bottom"];function Si(e,t){return e.filter(n=>n.pos===t)}function ru(e,t){return e.filter(n=>au.indexOf(n.pos)===-1&&n.box.axis===t)}function vi(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Dw(e){const t=[];let n,i,s,o,a,r;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function Cw(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!au.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Ow(e,t){const n=Cw(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=e.length;o<a;++o){r=e[o];const{fullSize:l}=r.box,c=n[r.stack],d=c&&r.stackWeight/c.weight;r.horizontal?(r.width=d?d*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=d?d*s:l&&t.availableHeight)}return n}function Aw(e){const t=Dw(e),n=vi(t.filter(c=>c.box.fullSize),!0),i=vi(Si(t,"left"),!0),s=vi(Si(t,"right")),o=vi(Si(t,"top"),!0),a=vi(Si(t,"bottom")),r=ru(t,"x"),l=ru(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Si(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function lu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function cu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Pw(e,t,n,i){const{pos:s,box:o}=n,a=e.maxPadding;if(!st(s)){n.size&&(e[s]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[s]+=n.size}o.getPadding&&cu(a,o.getPadding());const r=Math.max(0,t.outerWidth-lu(a,e,"left","right")),l=Math.max(0,t.outerHeight-lu(a,e,"top","bottom")),c=r!==e.w,d=l!==e.h;return e.w=r,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function Ew(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Rw(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return i(e?["left","right"]:["top","bottom"])}function Mi(e,t,n,i){const s=[];let o,a,r,l,c,d;for(o=0,a=e.length,c=0;o<a;++o){r=e[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Rw(r.horizontal,t));const{same:h,other:f}=Pw(t,n,r,i);c|=h&&s.length,d=d||f,l.fullSize||s.push(r)}return c&&Mi(s,t,n,i)||d}function Ds(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function uu(e,t,n,i){const s=n.padding;let{x:o,y:a}=t;for(const r of e){const l=r.box,c=i[r.stack]||{placed:0,weight:1},d=r.stackWeight/c.weight||1;if(r.horizontal){const h=t.w*d,f=c.size||l.height;qt(c.start)&&(a=c.start),l.fullSize?Ds(l,s.left,a,n.outerWidth-s.right-s.left,f):Ds(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*d,f=c.size||l.width;qt(c.start)&&(o=c.start),l.fullSize?Ds(l,o,s.top,f,n.outerHeight-s.bottom-s.top):Ds(l,o,t.top+c.placed,f,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=a}var Ut={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const s=At(e.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(n-s.height,0),r=Aw(e.boxes),l=r.vertical,c=r.horizontal;pt(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const d=l.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},s);cu(f,At(i));const m=Object.assign({maxPadding:f,w:o,h:a,x:s.left,y:s.top},s),p=Ow(l.concat(c),h);Mi(r.fullSize,m,h,p),Mi(l,m,h,p),Mi(c,m,h,p)&&Mi(l,m,h,p),Ew(m),uu(r.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,uu(r.rightAndBottom,m,h,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},pt(r.chartArea,g=>{const y=g.box;Object.assign(y,e.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class du{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Iw extends du{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Cs="$chartjs",Lw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hu=e=>e===null||e==="";function Nw(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Cs]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",hu(s)){const o=Rc(e,"width");o!==void 0&&(e.width=o)}if(hu(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Rc(e,"height");o!==void 0&&(e.height=o)}return e}const fu=Nx?{passive:!0}:!1;function Bw(e,t,n){e&&e.addEventListener(t,n,fu)}function Fw(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,fu)}function zw(e,t){const n=Lw[e.type]||e.type,{x:i,y:s}=Ne(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Os(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Uw(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Os(r.addedNodes,i),a=a&&!Os(r.removedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Vw(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Os(r.removedNodes,i),a=a&&!Os(r.addedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Di=new Map;let mu=0;function pu(){const e=window.devicePixelRatio;e!==mu&&(mu=e,Di.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Hw(e,t){Di.size||window.addEventListener("resize",pu),Di.set(e,t)}function $w(e){Di.delete(e),Di.size||window.removeEventListener("resize",pu)}function Yw(e,t,n){const i=e.canvas,s=i&&aa(i);if(!s)return;const o=mc((r,l)=>{const c=s.clientWidth;n(r,l),c<s.clientWidth&&n()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(s),Hw(e,o),a}function ga(e,t,n){n&&n.disconnect(),t==="resize"&&$w(e)}function Ww(e,t,n){const i=e.canvas,s=mc(o=>{e.ctx!==null&&n(zw(o,e))},e);return Bw(i,t,s),s}class jw extends du{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Nw(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Cs])return!1;const i=n[Cs].initial;["height","width"].forEach(o=>{const a=i[o];G(a)?n.removeAttribute(o):n.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Cs],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),a={attach:Uw,detach:Vw,resize:Yw}[n]||Ww;s[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ga,detach:ga,resize:ga}[n]||Fw)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Lx(t,n,i,s)}isAttached(t){const n=t&&aa(t);return!!(n&&n.isConnected)}}function qw(e){return!oa()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Iw:jw}class Vt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Re(this.x)&&Re(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Gw(e,t){const n=e.options.ticks,i=Xw(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?Zw(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Qw(t,c,o,a/s),c;const d=Kw(o,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-r)/(a-1)):null;for(As(t,c,d,G(m)?0:r-m,r),h=0,f=a-1;h<f;h++)As(t,c,d,o[h],o[h+1]);return As(t,c,d,l,G(m)?t.length:l+m),c}return As(t,c,d),c}function Xw(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function Kw(e,t,n){const i=Jw(e),s=t.length/n;if(!i)return Math.max(s,1);const o=F_(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function Zw(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function Qw(e,t,n,i){let s=0,o=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===o&&(t.push(e[a]),s++,o=n[s*i])}function As(e,t,n,i,s){const o=Q(i,0),a=Math.min(Q(s,e.length),e.length);let r=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),d=o;d<0;)r++,d=Math.round(o+r*n);for(c=Math.max(o,0);c<a;c++)c===d&&(t.push(e[c]),r++,d=Math.round(o+r*n))}function Jw(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const tk=e=>e==="left"?"right":e==="right"?"left":e,gu=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,yu=(e,t)=>Math.min(t||e,e);function bu(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function ek(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,a=e._endPixel,r=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function nk(e,t){pt(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ci(e){return e.drawTicks?e.tickLength:0}function _u(e,t){if(!e.display)return 0;const n=wt(e.font,t),i=At(e.padding);return(dt(e.text)?e.text.length:1)*n.lineHeight+i.height}function ik(e,t){return Le(e,{scale:t,type:"scale"})}function sk(e,t,n){return Le(e,{tick:n,index:t,type:"tick"})}function ok(e,t,n){let i=Xo(e);return(n&&t!=="right"||!n&&t==="right")&&(i=tk(i)),i}function ak(e,t,n,i){const{top:s,left:o,bottom:a,right:r,chart:l}=e,{chartArea:c,scales:d}=l;let h=0,f,m,p;const g=a-s,y=r-o;if(e.isHorizontal()){if(m=zt(i,o,r),st(n)){const _=Object.keys(n)[0],x=n[_];p=d[_].getPixelForValue(x)+g-t}else n==="center"?p=(c.bottom+c.top)/2+g-t:p=gu(e,n,t);f=r-o}else{if(st(n)){const _=Object.keys(n)[0],x=n[_];m=d[_].getPixelForValue(x)-y+t}else n==="center"?m=(c.left+c.right)/2-y+t:m=gu(e,n,t);p=zt(i,a,s),h=n==="left"?-bt:bt}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class sn extends Vt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=te(t,Number.POSITIVE_INFINITY),n=te(n,Number.NEGATIVE_INFINITY),i=te(i,Number.POSITIVE_INFINITY),s=te(s,Number.NEGATIVE_INFINITY),{min:te(t,i),max:te(n,s),minDefined:xt(t),maxDefined:xt(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:n,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(n=Math.min(n,a.min)),o||(i=Math.max(i,a.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:te(n,te(i,n)),max:te(i,te(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){mt(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=fx(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?bu(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Gw(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){mt(this.options.afterUpdate,[this])}beforeSetDimensions(){mt(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){mt(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),mt(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){mt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=mt(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){mt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){mt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=yu(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),h=d.widest.width,f=d.highest.height,m=Rt(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:m/(i-1),h+6>r&&(r=m/(i-(t.offset?.5:1)),l=this.maxHeight-Ci(t.grid)-n.padding-_u(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=ys(Math.min(Math.asin(Rt((d.highest.height+6)/r,-1,1)),Math.asin(Rt(l/c,-1,1))-Math.asin(Rt(f/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){mt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){mt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=_u(s,n.options.font);if(r?(t.width=this.maxWidth,t.height=Ci(o)+l):(t.height=this.maxHeight,t.width=Ci(o)+l),i.display&&this.ticks.length){const{first:c,last:d,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Ot(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(r){const _=i.mirror?0:y*h.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+_+m)}else{const _=i.mirror?0:g*h.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+_+m)}this._calculatePadding(c,d,y,g)}}this._handleMargins(),r?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=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*n.height):(f=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let d=n.height/2,h=t.height/2;o==="start"?(d=0,h=t.height):o==="end"&&(d=n.height,h=0),this.paddingTop=d+a,this.paddingBottom=h+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){mt(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)G(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=bu(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(n/yu(n,i));let c=0,d=0,h,f,m,p,g,y,_,x,T,v,w;for(h=0;h<n;h+=l){if(p=t[h].label,g=this._resolveTickFontOptions(h),s.font=y=g.string,_=o[y]=o[y]||{data:{},gc:[]},x=g.lineHeight,T=v=0,!G(p)&&!dt(p))T=ks(s,_.data,_.gc,T,p),v=x;else if(dt(p))for(f=0,m=p.length;f<m;++f)w=p[f],!G(w)&&!dt(w)&&(T=ks(s,_.data,_.gc,T,w),v+=x);a.push(T),r.push(v),c=Math.max(T,c),d=Math.max(v,d)}nk(o,n);const M=a.indexOf(c),D=r.indexOf(d),P=k=>({width:a[k]||0,height:r[k]||0});return{first:P(0),last:P(n-1),widest:P(M),highest:P(D),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return H_(this._alignToPixels?Qe(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=sk(this.getContext(),t,i))}return this.$context||(this.$context=ik(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ot(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=Ci(o),m=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,_=function($){return Qe(i,$,g)};let x,T,v,w,M,D,P,k,S,A,L,R;if(a==="top")x=_(this.bottom),D=this.bottom-f,k=x-y,A=_(t.top)+y,R=t.bottom;else if(a==="bottom")x=_(this.top),A=t.top,R=_(t.bottom)-y,D=x+y,k=this.top+f;else if(a==="left")x=_(this.right),M=this.right-f,P=x-y,S=_(t.left)+y,L=t.right;else if(a==="right")x=_(this.left),S=t.left,L=_(t.right)-y,M=x+y,P=this.left+f;else if(n==="x"){if(a==="center")x=_((t.top+t.bottom)/2+.5);else if(st(a)){const $=Object.keys(a)[0],K=a[$];x=_(this.chart.scales[$].getPixelForValue(K))}A=t.top,R=t.bottom,D=x+y,k=D+f}else if(n==="y"){if(a==="center")x=_((t.left+t.right)/2);else if(st(a)){const $=Object.keys(a)[0],K=a[$];x=_(this.chart.scales[$].getPixelForValue(K))}M=x-y,P=M-f,S=t.left,L=t.right}const H=Q(s.ticks.maxTicksLimit,h),W=Math.max(1,Math.ceil(h/H));for(T=0;T<h;T+=W){const $=this.getContext(T),K=o.setContext($),lt=r.setContext($),rt=K.lineWidth,X=K.color,z=lt.dash||[],C=lt.dashOffset,E=K.tickWidth,N=K.tickColor,V=K.tickBorderDash||[],tt=K.tickBorderDashOffset;v=ek(this,T,l),v!==void 0&&(w=Qe(i,v,rt),c?M=P=S=L=w:D=k=A=R=w,m.push({tx1:M,ty1:D,tx2:P,ty2:k,x1:S,y1:A,x2:L,y2:R,width:rt,color:X,borderDash:z,borderDashOffset:C,tickWidth:E,tickColor:N,tickBorderDash:V,tickBorderDashOffset:tt}))}return this._ticksLength=h,this._borderValue=x,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:d,mirror:h}=o,f=Ci(i.grid),m=f+d,p=h?-d:m,g=-Ot(this.labelRotation),y=[];let _,x,T,v,w,M,D,P,k,S,A,L,R="middle";if(s==="top")M=this.bottom-p,D=this._getXAxisLabelAlignment();else if(s==="bottom")M=this.top+p,D=this._getXAxisLabelAlignment();else if(s==="left"){const W=this._getYAxisLabelAlignment(f);D=W.textAlign,w=W.x}else if(s==="right"){const W=this._getYAxisLabelAlignment(f);D=W.textAlign,w=W.x}else if(n==="x"){if(s==="center")M=(t.top+t.bottom)/2+m;else if(st(s)){const W=Object.keys(s)[0],$=s[W];M=this.chart.scales[W].getPixelForValue($)+m}D=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")w=(t.left+t.right)/2-m;else if(st(s)){const W=Object.keys(s)[0],$=s[W];w=this.chart.scales[W].getPixelForValue($)}D=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?R="top":l==="end"&&(R="bottom"));const H=this._getLabelSizes();for(_=0,x=r.length;_<x;++_){T=r[_],v=T.label;const W=o.setContext(this.getContext(_));P=this.getPixelForTick(_)+o.labelOffset,k=this._resolveTickFontOptions(_),S=k.lineHeight,A=dt(v)?v.length:1;const $=A/2,K=W.color,lt=W.textStrokeColor,rt=W.textStrokeWidth;let X=D;a?(w=P,D==="inner"&&(_===x-1?X=this.options.reverse?"left":"right":_===0?X=this.options.reverse?"right":"left":X="center"),s==="top"?c==="near"||g!==0?L=-A*S+S/2:c==="center"?L=-H.highest.height/2-$*S+S:L=-H.highest.height+S/2:c==="near"||g!==0?L=S/2:c==="center"?L=H.highest.height/2-$*S:L=H.highest.height-A*S,h&&(L*=-1),g!==0&&!W.showLabelBackdrop&&(w+=S/2*Math.sin(g))):(M=P,L=(1-A)*S/2);let z;if(W.showLabelBackdrop){const C=At(W.backdropPadding),E=H.heights[_],N=H.widths[_];let V=L-C.top,tt=0-C.left;switch(R){case"middle":V-=E/2;break;case"bottom":V-=E;break}switch(D){case"center":tt-=N/2;break;case"right":tt-=N;break;case"inner":_===x-1?tt-=N:_>0&&(tt-=N/2);break}z={left:tt,top:V,width:N+C.width,height:E+C.height,color:W.backdropColor}}y.push({label:v,font:k,textOffset:L,options:{rotation:g,color:K,strokeColor:lt,strokeWidth:rt,textAlign:X,textBaseline:R,translation:[w,M],backdrop:z}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ot(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,d;return n==="left"?s?(d=this.right+o,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+o,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,a=s.length;o<a;++o){const l=s[o];n.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,h,f;this.isHorizontal()?(c=Qe(t,this.left,a)-a/2,d=Qe(t,this.right,r)+r/2,h=f=l):(h=Qe(t,this.top,a)-a/2,f=Qe(t,this.bottom,r)+r/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,h),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&bi(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,d=a.textOffset;Je(i,c,0,d,l,r)}s&&_i(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=wt(i.font),a=At(i.padding),r=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||st(n)?(l+=a.bottom,dt(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:d,maxWidth:h,rotation:f}=ak(this,l,n,r);Je(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:f,textAlign:ok(r,n,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=Q(t.grid&&t.grid.z,-1),s=Q(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==sn.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=n.length;o<a;++o){const r=n[o];r[i]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return wt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ps{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;ck(n)&&(i=this.register(n));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,rk(t,a,i),this.override&&_t.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in _t[s]&&(delete _t[s][i],this.override&&delete Ze[i])}}function rk(e,t,n){const i=di(Object.create(null),[n?_t.get(n):{},_t.get(t),e.defaults]);_t.set(t,i),e.defaultRoutes&&lk(t,e.defaultRoutes),e.descriptors&&_t.describe(t,e.descriptors)}function lk(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),a=t[n].split("."),r=a.pop(),l=a.join(".");_t.route(o,s,l,r)})}function ck(e){return"id"in e&&"defaults"in e}class uk{constructor(){this.controllers=new Ps(Fe,"datasets",!0),this.elements=new Ps(Vt,"elements"),this.plugins=new Ps(Object,"plugins"),this.scales=new Ps(sn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):pt(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,n,i){const s=jo(t);mt(i["before"+s],[],i),n[t](i),mt(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var ue=new uk;class dk{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,n,i,s){s=s||{};for(const o of t){const a=o.plugin,r=a[i],l=[n,s,o.options];if(mt(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){G(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=Q(i.options&&i.options.plugins,{}),o=hk(i);return s===!1&&!n?[]:mk(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function hk(e){const t={},n=[],i=Object.keys(ue.plugins.items);for(let o=0;o<i.length;o++)n.push(ue.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function fk(e,t){return!t&&e===!1?null:e===!0?{}:e}function mk(e,{plugins:t,localIds:n},i,s){const o=[],a=e.getContext();for(const r of t){const l=r.id,c=fk(i[l],s);c!==null&&o.push({plugin:r,options:pk(e.config,{plugin:r,local:n[l]},c,a)})}return o}function pk(e,{plugin:t,local:n},i,s){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(i,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ya(e,t){const n=_t.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function gk(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function yk(e,t){return e===t?"_index_":"_value_"}function xu(e){if(e==="x"||e==="y"||e==="r")return e}function bk(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function ba(e,...t){if(xu(e))return e;for(const n of t){const i=n.axis||bk(n.position)||e.length>1&&xu(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function wu(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function _k(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return wu(e,"x",n[0])||wu(e,"y",n[0])}return{}}function xk(e,t){const n=Ze[e.type]||{scales:{}},i=t.scales||{},s=ya(e.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!st(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=ba(a,r,_k(a,e),_t.scales[r.type]),c=yk(l,s),d=n.scales||{};o[a]=hi(Object.create(null),[{axis:l},r,d[l],d[c]])}),e.data.datasets.forEach(a=>{const r=a.type||e.type,l=a.indexAxis||ya(r,t),d=(Ze[r]||{}).scales||{};Object.keys(d).forEach(h=>{const f=gk(h,l),m=a[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),hi(o[m],[{axis:f},i[m],d[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];hi(r,[_t.scales[r.type],_t.scale])}),o}function ku(e){const t=e.options||(e.options={});t.plugins=Q(t.plugins,{}),t.scales=xk(e,t)}function Tu(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function wk(e){return e=e||{},e.data=Tu(e.data),ku(e),e}const Su=new Map,vu=new Set;function Es(e,t){let n=Su.get(e);return n||(n=t(),Su.set(e,n),vu.add(n)),n}const Oi=(e,t,n)=>{const i=Pe(t,n);i!==void 0&&e.add(i)};class kk{constructor(t){this._config=wk(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=Tu(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(),ku(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Es(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Es(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Es(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Es(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(n);if(r)return r;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(h=>Oi(l,t,h))),d.forEach(h=>Oi(l,s,h)),d.forEach(h=>Oi(l,Ze[o]||{},h)),d.forEach(h=>Oi(l,_t,h)),d.forEach(h=>Oi(l,Qo,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),vu.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Ze[n]||{},_t.datasets[n]||{},{type:n},_t,Qo]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Mu(this._resolverCache,t,s);let l=a;if(Sk(a,n)){o.$shared=!1,i=Gt(i)?i():i;const c=this.createResolver(t,i,r);l=An(a,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=Mu(this._resolverCache,t,i);return st(n)?An(o,n,void 0,s):o}}function Mu(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:na(t,n),subPrefixes:n.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Tk=e=>st(e)&&Object.getOwnPropertyNames(e).some(t=>Gt(e[t]));function Sk(e,t){const{isScriptable:n,isIndexable:i}=Sc(e);for(const s of t){const o=n(s),a=i(s),r=(a||o)&&e[s];if(o&&(Gt(r)||Tk(r))||a&&dt(r))return!0}return!1}var vk="4.5.1";const Mk=["top","bottom","left","right","chartArea"];function Du(e,t){return e==="top"||e==="bottom"||Mk.indexOf(e)===-1&&t==="x"}function Cu(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function Ou(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),mt(n&&n.onComplete,[e],t)}function Dk(e){const t=e.chart,n=t.options.animation;mt(n&&n.onProgress,[e],t)}function Au(e){return oa()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Rs={},Pu=e=>{const t=Au(e);return Object.values(Rs).filter(n=>n.canvas===t).pop()};function Ck(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const a=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=a)}}}function Ok(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let Xt=class{static defaults=_t;static instances=Rs;static overrides=Ze;static registry=ue;static version=vk;static getChart=Pu;static register(...t){ue.add(...t),Eu()}static unregister(...t){ue.remove(...t),Eu()}constructor(t,n){const i=this.config=new kk(n),s=Au(t),o=Pu(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||qw(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=A_(),this.ctx=r,this.canvas=l,this.width=d,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 dk,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=j_(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Rs[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}xe.listen(this,"complete",Ou),xe.listen(this,"progress",Dk),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return G(t)?n&&o?o: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 ue}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ec(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wc(this.canvas,this.ctx),this}stop(){return xe.stop(this),this}resize(t,n){xe.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,n,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ec(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),mt(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};pt(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const r=n[a],l=ba(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),pt(o,a=>{const r=a.options,l=r.id,c=ba(l,r),d=Q(r.type,a.dtype);(r.position===void 0||Du(r.position,c)!==Du(a.dposition))&&(r.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===d)h=i[l];else{const f=ue.getScale(d);h=new f({id:l,type:d,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(r,t)}),pt(s,(a,r)=>{a||delete i[r]}),pt(i,a=>{Ut.configure(this,a,a.options),Ut.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(Cu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||ya(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=ue.getController(r),{datasetElementType:c,dataElementType:d}=_t.datasets[r];Object.assign(l,{dataElementType:ue.getElement(d),datasetElementType:c&&ue.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){pt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),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 o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||pt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Cu("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){pt(this.scales,t=>{Ut.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!ac(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const a=i==="_removeElements"?-o:o;Ck(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!ac(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ut.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],pt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Gt(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(xe.has(this)?this.attached&&!xe.running(this)&&xe.start(this):(this.draw(),Ou({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 n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[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 n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Hc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&bi(n,s),t.controller.draw(),s&&_i(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return _e(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=pa.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Le(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);qt(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),xe.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wc(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Rs[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,i=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};pt(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",r)},n.isAttached(this.canvas)?r():a()}unbindEvents(){pt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},pt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,a,r,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];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 n=this._active||[],i=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!fs(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),a=o(n,t),r=i?t:o(t,n);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,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 o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,a=n,r=this._getActiveElements(t,s,i,a),l=N_(t),c=Ok(t,this._lastEvent,i,l);i&&(this._lastEvent=null,mt(o.onHover,[t,r,this],this),l&&mt(o.onClick,[t,r,this],this));const d=!fs(r,s);return(d||n)&&(this._active=r,this._updateHoverStyles(r,s,n)),this._lastEvent=c,d}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Eu(){return pt(Xt.instances,e=>e._plugins.invalidate())}function Ak(e,t,n){const{startAngle:i,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,h=Math.min(c/a,Ft(i-n));if(e.beginPath(),e.arc(s,o,a-c/2,i+h/2,n-h/2),r>0){const f=Math.min(c/r,Ft(i-n));e.arc(s,o,r+c/2,n-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*Ft(i-n));if(d==="round")e.arc(s,o,f,n-it/2,i+it/2,!0);else if(d==="bevel"){const m=2*f*f,p=-m*Math.cos(n+it/2)+s,g=-m*Math.sin(n+it/2)+o,y=m*Math.cos(i+it/2)+s,_=m*Math.sin(i+it/2)+o;e.lineTo(p,g),e.lineTo(y,_)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Pk(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;e.beginPath(),e.arc(o,a,r,i-c,n+c),l>s?(c=s/l,e.arc(o,a,l,n+c,i-c,!0)):e.arc(o,a,s,n+bt,i-bt),e.closePath(),e.clip()}function Ek(e){return ea(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Rk(e,t,n,i){const s=Ek(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,i*t/2),r=l=>{const c=(n-Math.min(o,l))*i/2;return Rt(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:Rt(s.innerStart,0,a),innerEnd:Rt(s.innerEnd,0,a)}}function Rn(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Is(e,t,n,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:d}=t,h=Math.max(t.outerRadius+i+n-c,0),f=d>0?d+i+n+c:0;let m=0;const p=s-l;if(i){const W=d>0?d-i:0,$=h>0?h-i:0,K=(W+$)/2,lt=K!==0?p*K/(K+i):p;m=(p-lt)/2}const g=Math.max(.001,p*h-n/it)/h,y=(p-g)/2,_=l+y+m,x=s-y-m,{outerStart:T,outerEnd:v,innerStart:w,innerEnd:M}=Rk(t,f,h,x-_),D=h-T,P=h-v,k=_+T/D,S=x-v/P,A=f+w,L=f+M,R=_+w/A,H=x-M/L;if(e.beginPath(),o){const W=(k+S)/2;if(e.arc(a,r,h,k,W),e.arc(a,r,h,W,S),v>0){const rt=Rn(P,S,a,r);e.arc(rt.x,rt.y,v,S,x+bt)}const $=Rn(L,x,a,r);if(e.lineTo($.x,$.y),M>0){const rt=Rn(L,H,a,r);e.arc(rt.x,rt.y,M,x+bt,H+Math.PI)}const K=(x-M/f+(_+w/f))/2;if(e.arc(a,r,f,x-M/f,K,!0),e.arc(a,r,f,K,_+w/f,!0),w>0){const rt=Rn(A,R,a,r);e.arc(rt.x,rt.y,w,R+Math.PI,_-bt)}const lt=Rn(D,_,a,r);if(e.lineTo(lt.x,lt.y),T>0){const rt=Rn(D,k,a,r);e.arc(rt.x,rt.y,T,_-bt,k)}}else{e.moveTo(a,r);const W=Math.cos(k)*h+a,$=Math.sin(k)*h+r;e.lineTo(W,$);const K=Math.cos(S)*h+a,lt=Math.sin(S)*h+r;e.lineTo(K,lt)}e.closePath()}function Ik(e,t,n,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Is(e,t,n,i,l,s);for(let c=0;c<o;++c)e.fill();isNaN(r)||(l=a+(r%yt||yt))}return Is(e,t,n,i,l,s),e.fill(),l}function Lk(e,t,n,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=f,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let g=t.endAngle;if(o){Is(e,t,n,i,g,s);for(let y=0;y<o;++y)e.stroke();isNaN(r)||(g=a+(r%yt||yt))}p&&Pk(e,t,g),l.selfJoin&&g-a>=it&&m===0&&d!=="miter"&&Ak(e,t,g),o||(Is(e,t,n,i,g,s),e.stroke())}class Nk extends Vt{static id="arc";static 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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=bs(s,{x:t,y:n}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,m=Q(h,l-r),p=mi(o,r,l)&&r!==l,g=m>=yt||p,y=ye(a,c+f,d+f);return g&&y}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,d=(s+o)/2,h=(a+r+c+l)/2;return{x:n+Math.cos(d)*h,y:i+Math.sin(d)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>yt?Math.floor(i/yt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(it,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,Ik(t,this,c,o,a),Lk(t,this,c,o,a),t.restore()}}function Ru(e,t,n=t){e.lineCap=Q(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Q(n.borderDash,t.borderDash)),e.lineDashOffset=Q(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Q(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Q(n.borderWidth,t.borderWidth),e.strokeStyle=Q(n.borderColor,t.borderColor)}function Bk(e,t,n){e.lineTo(n.x,n.y)}function Fk(e){return e.stepped?sx:e.tension||e.cubicInterpolationMode==="monotone"?ox:Bk}function Iu(e,t,n={}){const i=e.length,{start:s=0,end:o=i-1}=n,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),d=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!d?i+c-l:c-l}}function zk(e,t,n,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=Iu(s,n,i),d=Fk(o);let{move:h=!0,reverse:f}=i||{},m,p,g;for(m=0;m<=c;++m)p=s[(r+(f?c-m:m))%a],!p.skip&&(h?(e.moveTo(p.x,p.y),h=!1):d(e,g,p,f,o.stepped),g=p);return l&&(p=s[(r+(f?c:0))%a],d(e,g,p,f,o.stepped)),!!l}function Uk(e,t,n,i){const s=t.points,{count:o,start:a,ilen:r}=Iu(s,n,i),{move:l=!0,reverse:c}=i||{};let d=0,h=0,f,m,p,g,y,_;const x=v=>(a+(c?r-v:v))%o,T=()=>{g!==y&&(e.lineTo(d,y),e.lineTo(d,g),e.lineTo(d,_))};for(l&&(m=s[x(0)],e.moveTo(m.x,m.y)),f=0;f<=r;++f){if(m=s[x(f)],m.skip)continue;const v=m.x,w=m.y,M=v|0;M===p?(w<g?g=w:w>y&&(y=w),d=(h*d+v)/++h):(T(),e.lineTo(v,w),p=M,h=0,g=y=w),_=w}T()}function _a(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Uk:zk}function Vk(e){return e.stepped?Bx:e.tension||e.cubicInterpolationMode==="monotone"?Fx:en}function Hk(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Ru(e,t.options),e.stroke(s)}function $k(e,t,n,i){const{segments:s,options:o}=t,a=_a(t);for(const r of s)Ru(e,o,r.style),e.beginPath(),a(e,t,r,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Yk=typeof Path2D=="function";function Wk(e,t,n,i){Yk&&!t.options.segment?Hk(e,t,n,i):$k(e,t,n,i)}class Ls extends Vt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;Ox(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Yx(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],o=this.points,a=zc(this,{property:n,start:s,end:s});if(!a.length)return;const r=[],l=Vk(i);let c,d;for(c=0,d=a.length;c<d;++c){const{start:h,end:f}=a[c],m=o[h],p=o[f];if(m===p){r.push(m);continue}const g=Math.abs((s-m[n])/(p[n]-m[n])),y=l(m,p,g,i.stepped);y[n]=t[n],r.push(y)}return r.length===1?r[0]:r}pathSegment(t,n,i){return _a(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=_a(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const r of s)a&=o(t,this,r,{start:n,end:n+i-1});return!!a}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Wk(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Lu(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class jk extends Vt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Lu(this,t,"x",n)}inYRange(t,n){return Lu(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!_e(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ta(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Nu(e,t){const{x:n,y:i,base:s,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let r,l,c,d,h;return e.horizontal?(h=a/2,r=Math.min(n,s),l=Math.max(n,s),c=i-h,d=i+h):(h=o/2,r=n-h,l=n+h,c=Math.min(i,s),d=Math.max(i,s)),{left:r,top:c,right:l,bottom:d}}function ze(e,t,n,i){return e?0:Rt(t,n,i)}function qk(e,t,n){const i=e.options.borderWidth,s=e.borderSkipped,o=Tc(i);return{t:ze(s.top,o.top,0,n),r:ze(s.right,o.right,0,t),b:ze(s.bottom,o.bottom,0,n),l:ze(s.left,o.left,0,t)}}function Gk(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Ie(s),a=Math.min(t,n),r=e.borderSkipped,l=i||st(s);return{topLeft:ze(!l||r.top||r.left,o.topLeft,0,a),topRight:ze(!l||r.top||r.right,o.topRight,0,a),bottomLeft:ze(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:ze(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Xk(e){const t=Nu(e),n=t.right-t.left,i=t.bottom-t.top,s=qk(e,n/2,i/2),o=Gk(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function xa(e,t,n,i){const s=t===null,o=n===null,r=e&&!(s&&o)&&Nu(e,i);return r&&(s||ye(t,r.left,r.right))&&(o||ye(n,r.top,r.bottom))}function Kk(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function Zk(e,t){e.rect(t.x,t.y,t.w,t.h)}function wa(e,t,n={}){const i=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+i,y:e.y+s,w:e.w+o,h:e.h+a,radius:e.radius}}class Qk extends Vt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=Xk(this),r=Kk(a.radius)?On:Zk;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,wa(a,n,o)),t.clip(),r(t,wa(o,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,wa(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,i){return xa(this,t,n,i)}inXRange(t,n){return xa(this,t,null,n)}inYRange(t,n){return xa(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var Jk=Object.freeze({__proto__:null,ArcElement:Nk,BarElement:Qk,LineElement:Ls,PointElement:jk});const ka=["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)"],Bu=ka.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Fu(e){return ka[e%ka.length]}function zu(e){return Bu[e%Bu.length]}function tT(e,t){return e.borderColor=Fu(t),e.backgroundColor=zu(t),++t}function eT(e,t){return e.backgroundColor=e.data.map(()=>Fu(t++)),t}function nT(e,t){return e.backgroundColor=e.data.map(()=>zu(t++)),t}function iT(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof ki?t=eT(n,t):s instanceof nu?t=nT(n,t):s&&(t=tT(n,t))}}function Uu(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function sT(e){return e&&(e.borderColor||e.backgroundColor)}function oT(){return _t.borderColor!=="rgba(0,0,0,0.1)"||_t.backgroundColor!=="rgba(0,0,0,0.1)"}var aT={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s,a=Uu(i)||sT(s)||o&&Uu(o)||oT();if(!n.forceOverride&&a)return;const r=iT(e);i.forEach(r)}};function rT(e,t,n,i,s){const o=s.samples||i;if(o>=n)return e.slice(t,t+n);const a=[],r=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,h,f,m,p,g;for(a[l++]=e[d],h=0;h<o-2;h++){let y=0,_=0,x;const T=Math.floor((h+1)*r)+1+t,v=Math.min(Math.floor((h+2)*r)+1,n)+t,w=v-T;for(x=T;x<v;x++)y+=e[x].x,_+=e[x].y;y/=w,_/=w;const M=Math.floor(h*r)+1+t,D=Math.min(Math.floor((h+1)*r)+1,n)+t,{x:P,y:k}=e[d];for(m=p=-1,x=M;x<D;x++)p=.5*Math.abs((P-y)*(e[x].y-k)-(P-e[x].x)*(_-k)),p>m&&(m=p,f=e[x],g=x);a[l++]=f,d=g}return a[l++]=e[c],a}function lT(e,t,n,i){let s=0,o=0,a,r,l,c,d,h,f,m,p,g;const y=[],_=t+n-1,x=e[t].x,v=e[_].x-x;for(a=t;a<t+n;++a){r=e[a],l=(r.x-x)/v*i,c=r.y;const w=l|0;if(w===d)c<p?(p=c,h=a):c>g&&(g=c,f=a),s=(o*s+r.x)/++o;else{const M=a-1;if(!G(h)&&!G(f)){const D=Math.min(h,f),P=Math.max(h,f);D!==m&&D!==M&&y.push({...e[D],x:s}),P!==m&&P!==M&&y.push({...e[P],x:s})}a>0&&M!==m&&y.push(e[M]),y.push(r),d=w,o=0,p=g=c,h=f=m=a}}return y}function Vu(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Hu(e){e.data.datasets.forEach(t=>{Vu(t)})}function cT(e,t){const n=t.length;let i=0,s;const{iScale:o}=e,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=Rt(be(t,o.axis,a).lo,0,n-1)),c?s=Rt(be(t,o.axis,r).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var uT={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Hu(e);return}const i=e.width;e.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=e.getDatasetMeta(o),c=a||s.data;if(xi([r,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:h,count:f}=cT(l,c);const m=n.threshold||4*i;if(f<=m){Vu(s);return}G(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=rT(c,h,f,i,n);break;case"min-max":p=lT(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Hu(e)}};function dT(e,t,n){const i=e.segments,s=e.points,o=t.points,a=[];for(const r of i){let{start:l,end:c}=r;c=Ns(l,c,s);const d=Ta(n,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:d,start:s[l],end:s[c]});continue}const h=zc(t,d);for(const f of h){const m=Ta(n,o[f.start],o[f.end],f.loop),p=Fc(r,s,m);for(const g of p)a.push({source:g,target:f,start:{[n]:$u(d,m,"start",Math.max)},end:{[n]:$u(d,m,"end",Math.min)}})}}return a}function Ta(e,t,n,i){if(i)return;let s=t[e],o=n[e];return e==="angle"&&(s=Ft(s),o=Ft(o)),{property:e,start:s,end:o}}function hT(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Ns(a,r,s);const l=s[a],c=s[r];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function Ns(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function $u(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Yu(e,t){let n=[],i=!1;return dt(e)?(i=!0,n=e):n=hT(e,t),n.length?new Ls({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function Wu(e){return e&&e.fill!==!1}function fT(e,t,n){let s=e[t].fill;const o=[t];let a;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!xt(s))return s;if(a=e[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function mT(e,t,n){const i=bT(e);if(st(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return xt(s)&&Math.floor(s)===s?pT(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function pT(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function gT(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:st(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function yT(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:st(e)?i=e.value:i=t.getBaseValue(),i}function bT(e){const t=e.options,n=t.fill;let i=Q(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function _T(e){const{scale:t,index:n,line:i}=e,s=[],o=i.segments,a=i.points,r=xT(t,n);r.push(Yu({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)wT(s,a[d],r)}return new Ls({points:s,options:{}})}function xT(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function wT(e,t,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:a,last:r,point:l}=kT(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(e.push(l),!r)break}}e.push(...i)}function kT(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const s=i[n],o=e.segments,a=e.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],h=a[d.start][n],f=a[d.end][n];if(ye(s,h,f)){r=s===h,l=s===f;break}}return{first:r,last:l,point:i}}class ju{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:s,y:o,radius:a}=this;return n=n||{start:0,end:yt},t.arc(s,o,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function TT(e){const{chart:t,fill:n,line:i}=e;if(xt(n))return ST(t,n);if(n==="stack")return _T(e);if(n==="shape")return!0;const s=vT(e);return s instanceof ju?s:Yu(s,i)}function ST(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function vT(e){return(e.scale||{}).getPointPositionForValue?DT(e):MT(e)}function MT(e){const{scale:t={},fill:n}=e,i=gT(n,t);if(xt(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function DT(e){const{scale:t,fill:n}=e,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=yT(n,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new ju({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function Sa(e,t,n){const i=TT(t),{chart:s,index:o,line:a,scale:r,axis:l}=t,c=a.options,d=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=d||{},p=s.getDatasetMeta(o),g=Hc(s,p);i&&a.points.length&&(bi(e,n),CT(e,{line:a,target:i,above:f,below:m,area:n,scale:r,axis:l,clip:g}),_i(e))}function CT(e,t){const{line:n,target:i,above:s,below:o,area:a,scale:r,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let d=o;o!==s&&(c==="x"?(qu(e,i,a.top),va(e,{line:n,target:i,color:s,scale:r,property:c,clip:l}),e.restore(),e.save(),qu(e,i,a.bottom)):c==="y"&&(Gu(e,i,a.left),va(e,{line:n,target:i,color:o,scale:r,property:c,clip:l}),e.restore(),e.save(),Gu(e,i,a.right),d=s)),va(e,{line:n,target:i,color:d,scale:r,property:c,clip:l}),e.restore()}function qu(e,t,n){const{segments:i,points:s}=t;let o=!0,a=!1;e.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],h=s[Ns(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Gu(e,t,n){const{segments:i,points:s}=t;let o=!0,a=!1;e.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],h=s[Ns(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(n,d.y),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function va(e,t){const{line:n,target:i,property:s,color:o,scale:a,clip:r}=t,l=dT(n,i,s);for(const{source:c,target:d,start:h,end:f}of l){const{style:{backgroundColor:m=o}={}}=c,p=i!==!0;e.save(),e.fillStyle=m,OT(e,a,r,p&&Ta(s,h,f)),e.beginPath();const g=!!n.pathSegment(e,c);let y;if(p){g?e.closePath():Xu(e,i,f,s);const _=!!i.pathSegment(e,d,{move:g,reverse:!0});y=g&&_,y||Xu(e,i,h,s)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function OT(e,t,n,i){const s=t.chart.chartArea,{property:o,start:a,end:r}=i||{};if(o==="x"||o==="y"){let l,c,d,h;o==="x"?(l=a,c=s.top,d=r,h=s.bottom):(l=s.left,c=a,d=s.right,h=r),e.beginPath(),n&&(l=Math.max(l,n.left),d=Math.min(d,n.right),c=Math.max(c,n.top),h=Math.min(h,n.bottom)),e.rect(l,c,d-l,h-c),e.clip()}}function Xu(e,t,n,i){const s=t.interpolate(n,i);s&&e.lineTo(s.x,s.y)}var AT={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<i;++a)o=e.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Ls&&(l={visible:e.isDatasetVisible(a),index:a,fill:mT(r,a,i),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=fT(s,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),i&&r.fill&&Sa(e.ctx,r,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;Wu(o)&&Sa(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!Wu(i)||n.drawTime!=="beforeDatasetDraw"||Sa(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ku=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},PT=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Zu extends Vt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=mt(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=wt(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Ku(i,o);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+r;let h=t;o.textAlign="left",o.textBaseline="middle";let f=-1,m=-d;return this.legendItems.forEach((p,g)=>{const y=i+n/2+o.measureText(p.text).width;(g===0||c[c.length-1]+y+2*r>a)&&(h+=d,c[c.length-(g>0?0:1)]=0,m+=d,f++),l[g]={left:0,top:m,row:f,width:y,height:s},c[c.length-1]+=y+r}),h}_fitCols(t,n,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let h=r,f=0,m=0,p=0,g=0;return this.legendItems.forEach((y,_)=>{const{itemWidth:x,itemHeight:T}=ET(i,n,o,y,s);_>0&&m+T+2*r>d&&(h+=f+r,c.push({width:f,height:m}),p+=f+r,g++,f=m=0),l[_]={left:p,top:m,col:g,width:x,height:T},f=Math.max(f,x),m+=T+r}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,a=En(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=zt(i,this.left+s,this.right-this.lineWidths[r]);for(const c of n)r!==c.row&&(r=c.row,l=zt(i,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=zt(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of n)c.col!==r&&(r=c.col,l=zt(i,this.top+t+s,this.bottom-this.columnSizes[r].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;bi(t,this),this._draw(),_i(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=_t.color,l=En(t.rtl,this.left,this.width),c=wt(a.font),{padding:d}=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:g,itemHeight:y}=Ku(a,h),_=function(M,D,P){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const k=Q(P.lineWidth,1);if(s.fillStyle=Q(P.fillStyle,r),s.lineCap=Q(P.lineCap,"butt"),s.lineDashOffset=Q(P.lineDashOffset,0),s.lineJoin=Q(P.lineJoin,"miter"),s.lineWidth=k,s.strokeStyle=Q(P.strokeStyle,r),s.setLineDash(Q(P.lineDash,[])),a.usePointStyle){const S={radius:g*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:k},A=l.xPlus(M,p/2),L=D+f;kc(s,S,A,L,a.pointStyleWidth&&p)}else{const S=D+Math.max((h-g)/2,0),A=l.leftForLtr(M,p),L=Ie(P.borderRadius);s.beginPath(),Object.values(L).some(R=>R!==0)?On(s,{x:A,y:S,w:p,h:g,radius:L}):s.rect(A,S,p,g),s.fill(),k!==0&&s.stroke()}s.restore()},x=function(M,D,P){Je(s,P.text,M,D+y/2,c,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})},T=this.isHorizontal(),v=this._computeTitleHeight();T?m={x:zt(o,this.left+d,this.right-i[0]),y:this.top+d+v,line:0}:m={x:this.left+d,y:zt(o,this.top+v+d,this.bottom-n[0].height),line:0},Ic(this.ctx,t.textDirection);const w=y+d;this.legendItems.forEach((M,D)=>{s.strokeStyle=M.fontColor,s.fillStyle=M.fontColor;const P=s.measureText(M.text).width,k=l.textAlign(M.textAlign||(M.textAlign=a.textAlign)),S=p+f+P;let A=m.x,L=m.y;l.setWidth(this.width),T?D>0&&A+S+d>this.right&&(L=m.y+=w,m.line++,A=m.x=zt(o,this.left+d,this.right-i[m.line])):D>0&&L+w>this.bottom&&(A=m.x=A+n[m.line].width+d,m.line++,L=m.y=zt(o,this.top+v+d,this.bottom-n[m.line].height));const R=l.x(A);if(_(R,L,M),A=q_(k,A+p+f,T?A+S:this.right,t.rtl),x(l.x(A),L,M),T)m.x+=S+d;else if(typeof M.text!="string"){const H=c.lineHeight;m.y+=Qu(M,H)+d}else m.y+=w}),Lc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=wt(n.font),s=At(n.padding);if(!n.display)return;const o=En(t.rtl,this.left,this.width),a=this.ctx,r=n.position,l=i.size/2,c=s.top+l;let d,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,h=zt(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);d=c+zt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=zt(r,h,h+f);a.textAlign=o.textAlign(Xo(r)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,Je(a,n.text,m,d,i)}_computeTitleHeight(){const t=this.options.title,n=wt(t.font),i=At(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(ye(t,this.left,this.right)&&ye(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],ye(t,s.left,s.left+s.width)&&ye(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!LT(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=PT(s,i);s&&!o&&mt(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&mt(n.onHover,[t,i,this],this)}else i&&mt(n.onClick,[t,i,this],this)}}function ET(e,t,n,i,s){const o=RT(i,e,t,n),a=IT(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function RT(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+i.measureText(s).width}function IT(e,t,n){let i=e;return typeof t.text!="string"&&(i=Qu(t,n)),i}function Qu(e,t){const n=e.text?e.text.length:0;return t*n}function LT(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var NT={id:"legend",_element:Zu,start(e,t,n){const i=e.legend=new Zu({ctx:e.ctx,options:n,chart:e});Ut.configure(e,i,n),Ut.addBox(e,i)},stop(e){Ut.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;Ut.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=At(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Ma extends Vt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=dt(i.text)?i.text.length:1;this._padding=At(i.padding);const o=s*wt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,d,h;return this.isHorizontal()?(d=zt(r,i,o),h=n+t,c=o-i):(a.position==="left"?(d=i+t,h=zt(r,s,n),l=it*-.5):(d=o-t,h=zt(r,n,s),l=it*.5),c=s-n),{titleX:d,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=wt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Je(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Xo(n.align),textBaseline:"middle",translation:[a,r]})}}function BT(e,t){const n=new Ma({ctx:e.ctx,options:t,chart:e});Ut.configure(e,n,t),Ut.addBox(e,n),e.titleBlock=n}var FT={id:"title",_element:Ma,start(e,t,n){BT(e,n)},stop(e){const t=e.titleBlock;Ut.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;Ut.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Bs=new WeakMap;var zT={id:"subtitle",start(e,t,n){const i=new Ma({ctx:e.ctx,options:n,chart:e});Ut.configure(e,i,n),Ut.addBox(e,i),Bs.set(e,i)},stop(e){Ut.removeBox(e,Bs.get(e)),Bs.delete(e)},beforeUpdate(e,t,n){const i=Bs.get(e);Ut.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ai={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const r=e[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((r,l)=>r+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=e.length;o<a;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Cn(t,c);d<s&&(s=d,r=l)}}if(r){const l=r.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function de(e,t){return t&&(dt(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function we(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
1
|
+
(function(it,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue"),require("@kong/icons"),require("@kong-ui-public/i18n"),require("@kong-ui-public/analytics-metric-provider"),require("@kong/kongponents")):typeof define=="function"&&define.amd?define(["exports","vue","@kong/icons","@kong-ui-public/i18n","@kong-ui-public/analytics-metric-provider","@kong/kongponents"],u):(it=typeof globalThis<"u"?globalThis:it||self,u(it["kong-ui-publicvitals-chart"]={},it.Vue,it.KongIcons,it["kong-ui-public-i18n"],it["kong-ui-public-analytics-metric-provider"],it.Kongponents))})(this,(function(it,u,kt,vr,qe,Kn){"use strict";const Df="analytics-query-provider",Cf="analytics-dashboard-coordinator",mo="____OTHER____",Of="empty";var W=(e=>(e.FIFTEEN_MIN="15m",e.ONE_HOUR="1h",e.SIX_HOUR="6h",e.TWELVE_HOUR="12h",e.ONE_DAY="24h",e.SEVEN_DAY="7d",e.THIRTY_DAY="30d",e.NINETY_DAY="90d",e.ONE_HUNDRED_EIGHTY_DAY="180d",e.ONE_YEAR="365d",e.CURRENT_WEEK="current_week",e.CURRENT_MONTH="current_month",e.CURRENT_QUARTER="current_quarter",e.CURRENT_YEAR="current_year",e.PREVIOUS_WEEK="previous_week",e.PREVIOUS_MONTH="previous_month",e.PREVIOUS_QUARTER="previous_quarter",e.PREVIOUS_YEAR="previous_year",e))(W||{});const Af=["in","not_in","selector"],Pf=["empty","not_empty"],Ef=["secondly","tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly","twoHourly","twelveHourly","daily","weekly","trend"],Ge=e=>e.filter(t=>t!=="time"),Sr=["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"],po=Ge(Sr),Rf=["active_services","error_rate","request_count","request_per_minute","response_latency_average"],Mr=[...Sr,"ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","application","bot_info_action","bot_info_detection_reason","bot_info_ban_type","cache_status","consumer","consumer_group","country_code","oidc_credential","upstream_status_code","upstream_status_code_grouped","response_source","data_plane_node_version","realm","portal_api","principal"],go=Ge(Mr),If=[...Rf,"share_of_requests","cache_hit_rate","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","kong_internal_latency_p99","kong_internal_latency_p95","kong_internal_latency_p50","kong_internal_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"],Lf=["ai_gateway","ai_gateway_agent","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_version","ai_plugin","ai_provider","ai_request_model","ai_response_model","application","cache_status","consumer","control_plane","control_plane_group","gateway_service","llm_cache_status","llm_embeddings_model","llm_embeddings_provider","oidc_credential","principal","realm","response_source","route","status_code","status_code_grouped","time","upstream_status_code","upstream_status_code_grouped"],yo=Ge(Lf),Nf=["a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway","ai_gateway_consumer","ai_gateway_consumer_group","ai_gateway_data_plane_node","ai_gateway_version","api","api_package","api_product","api_product_version","application","auth_type","bot_info_action","bot_info_ban_type","bot_info_detection_reason","bot_info_header_names","bot_info_ja4_fingerprint","cache_status","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","oidc_credential","portal","principal","realm","request_id","request_uri","response_header_content_type","response_source","route","service_port","service_protocol","sse","status_code_grouped","time","trace_id","upstream_status_code_grouped","upstream_uri","websocket"],Bf=Ge(Nf),zf=["ai_gateway_version","auth_type","cache_status","client_ip","data_plane_node_version","header_host","header_user_agent","http_method","oidc_credential","request_id","request_uri","response_header_content_type","response_source","service_port","service_protocol","trace_id","upstream_uri"],Ff=zf,Uf=["ai_count","latencies_response_ms","latencies_upstream_ms","latencies_kong_gateway_ms","latencies_kong_internal_ms","request_body_size","response_body_size","response_header_content_length","status_code","upstream_status_code"],Vf=Ge(Uf),Hf=["platform","platform_usage"],$f=e=>Hf.includes(e),Yf=[...Mr.filter(e=>e!=="consumer_group"),"a2a_context_id","a2a_error","a2a_method","a2a_task_id","a2a_task_state","ai_gateway_agent","ai_gateway_mcp_server","ai_gateway_model","ai_gateway_version","ai_provider","mcp_error","mcp_method","mcp_session_id","mcp_tool_name"],bo=Ge(Yf);[...If];const Wf=["control_plane","data_plane_group","managed_cache","network","provider","provider_region","time"],_o=Ge(Wf);new Set(po),new Set(go),new Set(yo),new Set(bo),new Set(_o);const Dr=[{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"}],Ce=e=>({type:"array",description:"A list of filters to apply to the query",items:{oneOf:[{type:"object",description:"In filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Af},value:{type:"array",items:{type:["string","number","null"]}}},required:["field","operator","value"],additionalProperties:!1},{type:"object",description:"Empty filter",properties:{field:{type:"string",...e?{enum:e}:{}},operator:{type:"string",enum:Pf}},required:["field","operator"],additionalProperties:!1}]}});({...Ce()},Dr.map(e=>e.code));const jf=["control_plane","gateway_service","realm","route","plugin","plugin_name","plugin_scope","data_plane_node_version","env","team","region","hostname"];Ce(go),Ce(po),Ce(yo),Ce(bo),Ce(_o),Ce(Array.from(new Set([...Bf,...Ff,...Vf]))),Ce([...new Set([...go,...po,...yo,...bo,...jf,..._o])]);const qf={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"}},Gf=(e,t,n)=>{let i;const s=qf[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function xo(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Xf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Kf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Zf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Qf={date:xo({formats:Xf,defaultWidth:"full"}),time:xo({formats:Kf,defaultWidth:"full"}),dateTime:xo({formats:Zf,defaultWidth:"full"})},Jf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},tm=(e,t,n,i)=>Jf[e];function Zn(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):a;s=e.formattingValues[r]||e.formattingValues[a]}else{const a=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;s=e.values[r]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const em={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},nm={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},im={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"]},sm={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"]},om={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"}},am={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"}},rm=(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},lm={ordinalNumber:rm,era:Zn({values:em,defaultWidth:"wide"}),quarter:Zn({values:nm,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Zn({values:im,defaultWidth:"wide"}),day:Zn({values:sm,defaultWidth:"wide"}),dayPeriod:Zn({values:om,defaultWidth:"wide",formattingValues:am,defaultFormattingWidth:"wide"})};function Qn(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?um(r,h=>h.test(a)):cm(r,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function cm(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function um(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function dm(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const r=t.slice(s.length);return{value:a,rest:r}}}const hm=/^(\d+)(th|st|nd|rd)?/i,fm=/\d+/i,mm={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},pm={any:[/^b/i,/^(a|c)/i]},gm={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ym={any:[/1/i,/2/i,/3/i,/4/i]},bm={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},_m={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]},xm={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},wm={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]},km={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},Tm={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}},vm={ordinalNumber:dm({matchPattern:hm,parsePattern:fm,valueCallback:e=>parseInt(e,10)}),era:Qn({matchPatterns:mm,defaultMatchWidth:"wide",parsePatterns:pm,defaultParseWidth:"any"}),quarter:Qn({matchPatterns:gm,defaultMatchWidth:"wide",parsePatterns:ym,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Qn({matchPatterns:bm,defaultMatchWidth:"wide",parsePatterns:_m,defaultParseWidth:"any"}),day:Qn({matchPatterns:xm,defaultMatchWidth:"wide",parsePatterns:wm,defaultParseWidth:"any"}),dayPeriod:Qn({matchPatterns:km,defaultMatchWidth:"any",parsePatterns:Tm,defaultParseWidth:"any"})},Sm={code:"en-US",formatDistance:Gf,formatLong:Qf,formatRelative:tm,localize:lm,match:vm,options:{weekStartsOn:0,firstWeekContainsDate:1}};let Mm={};function Jn(){return Mm}const Cr=6048e5,Dm=864e5,Cm=60,Om=3600,Or=Symbol.for("constructDateFrom");function ie(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Or in e?e[Or](t):e instanceof Date?new e.constructor(t):new Date(t)}function Ut(e,t){return ie(t||e,e)}function Ar(e){const t=Ut(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Am(e,...t){const n=ie.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function bn(e,t){const n=Ut(e,t?.in);return n.setHours(0,0,0,0),n}function Pm(e,t,n){const[i,s]=Am(n?.in,e,t),o=bn(i),a=bn(s),r=+o-Ar(o),l=+a-Ar(a);return Math.round((r-l)/Dm)}function Em(e,t){const n=Ut(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Rm(e,t){const n=Ut(e,t?.in);return Pm(n,Em(n))+1}function ge(e,t){const n=Jn(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=Ut(e,t?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Gi(e,t){return ge(e,{...t,weekStartsOn:1})}function Pr(e,t){const n=Ut(e,t?.in),i=n.getFullYear(),s=ie(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Gi(s),a=ie(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const r=Gi(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=r.getTime()?i:i-1}function Im(e,t){const n=Pr(e,t),i=ie(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Gi(i)}function Lm(e,t){const n=Ut(e,t?.in),i=+Gi(n)-+Im(n);return Math.round(i/Cr)+1}function Er(e,t){const n=Ut(e,t?.in),i=n.getFullYear(),s=Jn(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=ie(t?.in||e,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const r=ge(a,t),l=ie(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=ge(l,t);return+n>=+r?i+1:+n>=+c?i:i-1}function Nm(e,t){const n=Jn(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Er(e,t),o=ie(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),ge(o,t)}function Bm(e,t){const n=Ut(e,t?.in),i=+ge(n,t)-+Nm(n,t);return Math.round(i/Cr)+1}function dt(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Oe={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return dt(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):dt(n+1,2)},d(e,t){return dt(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return dt(e.getHours()%12||12,t.length)},H(e,t){return dt(e.getHours(),t.length)},m(e,t){return dt(e.getMinutes(),t.length)},s(e,t){return dt(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return dt(s,t.length)}},_n={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Rr={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Oe.y(e,t)},Y:function(e,t,n,i){const s=Er(e,i),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return dt(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):dt(o,t.length)},R:function(e,t){const n=Pr(e);return dt(n,t.length)},u:function(e,t){const n=e.getFullYear();return dt(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return dt(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return dt(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Oe.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return dt(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Bm(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):dt(s,t.length)},I:function(e,t,n){const i=Lm(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):dt(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Oe.d(e,t)},D:function(e,t,n){const i=Rm(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):dt(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return dt(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return dt(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return dt(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=_n.noon:i===0?s=_n.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=_n.evening:i>=12?s=_n.afternoon:i>=4?s=_n.morning:s=_n.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Oe.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Oe.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):dt(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):dt(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Oe.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Oe.s(e,t)},S:function(e,t){return Oe.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Lr(i);case"XXXX":case"XX":return Xe(i);default:return Xe(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Lr(i);case"xxxx":case"xx":return Xe(i);default:return Xe(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ir(i,":");default:return"GMT"+Xe(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ir(i,":");default:return"GMT"+Xe(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return dt(i,t.length)},T:function(e,t,n){return dt(+e,t.length)}};function Ir(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+dt(o,2)}function Lr(e,t){return e%60===0?(e>0?"-":"+")+dt(Math.abs(e)/60,2):Xe(e,t)}function Xe(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=dt(Math.trunc(i/60),2),o=dt(i%60,2);return n+s+t+o}const Nr=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Br=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},zm=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Nr(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Nr(i,t)).replace("{{time}}",Br(s,t))},Fm={p:Br,P:zm},Um=/^D+$/,Vm=/^Y+$/,Hm=["D","DD","YY","YYYY"];function $m(e){return Um.test(e)}function Ym(e){return Vm.test(e)}function Wm(e,t,n){const i=jm(e,t,n);if(console.warn(i),Hm.includes(e))throw new RangeError(i)}function jm(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}function qm(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Gm(e){return!(!qm(e)&&typeof e!="number"||isNaN(+Ut(e)))}const Xm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Km=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zm=/^'([^]*?)'?$/,Qm=/''/g,Jm=/[a-zA-Z]/;function tp(e,t,n){const i=Jn(),s=n?.locale??i.locale??Sm,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=Ut(e,n?.in);if(!Gm(r))throw new RangeError("Invalid time value");let l=t.match(Km).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=Fm[h];return f(d,s.formatLong)}return d}).join("").match(Xm).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:ep(d)};if(Rr[h])return{isToken:!0,value:d};if(h.match(Jm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(l=s.localize.preprocessor(r,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!n?.useAdditionalWeekYearTokens&&Ym(h)||!n?.useAdditionalDayOfYearTokens&&$m(h))&&Wm(h,t,String(e));const f=Rr[h[0]];return f(r,h,s.localize,c)}).join("")}function ep(e){const t=e.match(Zm);return t?t[1].replace(Qm,"'"):e}function Xi(e,t,n){const i=Ut(e,n?.in);return isNaN(t)?ie(e,NaN):(i.setDate(i.getDate()+t),i)}function zr(e,t,n){const i=Ut(e,n?.in);if(isNaN(t))return ie(e,NaN);if(!t)return i;const s=i.getDate(),o=ie(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function np(e,t,n){return zr(e,t*3,n)}function xn(e,t){const n=Ut(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function wn(e,t){const n=Ut(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function ip(e,t){const n=Ut(e,t?.in),i=n.getFullYear(),s=n.getMonth(),o=ie(n,0);return o.setFullYear(i,s+1,0),o.setHours(0,0,0,0),o.getDate()}function sp(){return Object.assign({},Jn())}function Fr(e){return Math.trunc(e*Om)}function op(e){const t=e/Cm;return Math.trunc(t)}function Ur(e,t,n){return zr(e,-1,n)}function Vr(e,t,n){return np(e,-1,n)}function Hr(e,t,n){const i=sp(),s=lp(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?ap(s,t):rp(s,t)}function ap(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function rp(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function lp(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function cp(e,t){const n=mp(t);return"formatToParts"in n?dp(n,e):hp(n,e)}const up={year:0,month:1,day:2,hour:3,minute:4,second:5};function dp(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=up[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function hp(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const wo={},$r=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")),fp=$r==="06/25/2014, 00:00:00"||$r==="06/25/2014 00:00:00";function mp(e){return wo[e]||(wo[e]=fp?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),wo[e]}function ko(e,t,n,i,s,o,a){const r=new Date(0);return r.setUTCFullYear(e,t,n),r.setUTCHours(i,s,o,a),r}const Yr=36e5,pp=6e4,To={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function ti(e,t,n){if(!e)return 0;let i=To.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=To.timezoneHH.exec(e),i)return s=parseInt(i[1],10),Wr(s)?-(s*Yr):NaN;if(i=To.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return Wr(s,a)?(o=Math.abs(s)*Yr+a*pp,i[1]==="+"?-o:o):NaN}if(bp(e)){t=new Date(t||Date.now());const a=n?t:gp(t),r=vo(a,e);return-(n?r:yp(t,r,e))}return NaN}function gp(e){return ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function vo(e,t){const n=cp(e,t),i=ko(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function yp(e,t,n){let i=e.getTime()-t;const s=vo(new Date(i),n);if(t===s)return t;i-=s-t;const o=vo(new Date(i),n);return s===o?s:Math.max(s,o)}function Wr(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const jr={};function bp(e){if(jr[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),jr[e]=!0,!0}catch{return!1}}const _p=60*1e3,xp={X:function(e,t,n){const i=So(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return qr(i);case"XXXX":case"XX":return kn(i);default:return kn(i,":")}},x:function(e,t,n){const i=So(n.timeZone,e);switch(t){case"x":return qr(i);case"xxxx":case"xx":return kn(i);default:return kn(i,":")}},O:function(e,t,n){const i=So(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+wp(i,":");default:return"GMT"+kn(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Hr("short",e,n);default:return Hr("long",e,n)}}};function So(e,t){const n=e?ti(e,t,!0)/_p:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Ki(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function kn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Ki(Math.floor(i/60),2),o=Ki(Math.floor(i%60),2);return n+s+t+o}function qr(e,t){return e%60===0?(e>0?"-":"+")+Ki(Math.abs(e)/60,2):kn(e,t)}function wp(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Ki(o,2)}function Gr(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const Xr=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Mo=36e5,Kr=6e4,kp=2,jt={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:Xr};function Zi(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?kp:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=Tp(e),{year:s,restDateString:o}=vp(i.date,n),a=Sp(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const r=a.getTime();let l=0,c;if(i.time&&(l=Mp(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=ti(i.timeZone||t.timeZone,new Date(r+l)),isNaN(c))return new Date(NaN)}else c=Gr(new Date(r+l)),c=Gr(new Date(r+l+c));return new Date(r+l+c)}else return new Date(NaN)}function Tp(e){const t={};let n=jt.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=jt.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=jt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function vp(e,t){if(e){const n=jt.YYY[t],i=jt.YYYYY[t];let s=jt.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=jt.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function Sp(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=jt.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,Jr(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=jt.DDD.exec(e),o){n=new Date(0);const a=parseInt(o[1],10);return Op(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(o=jt.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return Jr(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(o=jt.Www.exec(e),o)return s=parseInt(o[1],10)-1,tl(s)?Zr(t,s):new Date(NaN);if(o=jt.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return tl(s,a)?Zr(t,s,a):new Date(NaN)}return null}function Mp(e){let t,n,i=jt.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Do(t)?t%24*Mo:NaN;if(i=jt.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Do(t,n)?t%24*Mo+n*Kr:NaN;if(i=jt.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Do(t,n,s)?t%24*Mo+n*Kr+s*1e3:NaN}return null}function Zr(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Dp=[31,28,31,30,31,30,31,31,30,31,30,31],Cp=[31,29,31,30,31,30,31,31,30,31,30,31];function Qr(e){return e%400===0||e%4===0&&e%100!==0}function Jr(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Qr(e);if(i&&n>Cp[t]||!i&&n>Dp[t])return!1}return!0}function Op(e,t){if(t<1)return!1;const n=Qr(e);return!(n&&t>366||!n&&t>365)}function tl(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Do(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const Ap=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Pp(e,t,n={}){t=String(t);const i=t.match(Ap);if(i){const s=Zi(n.originalDate||e,n);t=i.reduce(function(o,a){if(a[0]==="'")return o;const r=o.indexOf(a),l=o[r-1]==="'",c=o.replace(a,"'"+xp[a[0]](s,a,n)+"'");return l?c.substring(0,r-1)+c.substring(r+1):c},t)}return tp(e,t,n)}function el(e,t,n){e=Zi(e,n);const i=ti(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Ep(e,t,n,i){return i={...i,timeZone:t,originalDate:e},Pp(el(e,t,{timeZone:i.timeZone}),n,i)}function Rp(e,t,n){if(typeof e=="string"&&!e.match(Xr))return Zi(e,{...n,timeZone:t});e=Zi(e,n);const i=ko(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()).getTime(),s=ti(t,new Date(i));return new Date(i+s)}function Ip(e,t){return-ti(e,t)}function Lp(e,t={}){if(!e)return e;const n=t.tz||Intl.DateTimeFormat().resolvedOptions().timeZone;try{let i="MMM dd, yyy hh:mm a";t.short&&(i="MMM dd, yyy"),t.includeTZ&&(i+=" (z)");const s=new Date(e);return Ep(s,n,i)}catch{return console.error("Invalid value passed to formatTime",e),"(invalid date)"}}const Np={secondly:1e3,tenSecondly:10*1e3,thirtySecondly:30*1e3,minutely:60*1e3,fiveMinutely:300*1e3,tenMinutely:600*1e3,thirtyMinutely:1800*1e3,hourly:3600*1e3,twoHourly:7200*1e3,twelveHourly:720*60*1e3,daily:3600*24*1e3,weekly:3600*24*7*1e3,trend:0};function Qi(e){return e&&Ef.find(t=>e<=Np[t])||null}var Ji=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ts={exports:{}};ts.exports;var nl;function Bp(){return nl||(nl=1,(function(e,t){var n=200,i="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",a="[object Array]",r="[object Boolean]",l="[object Date]",c="[object Error]",d="[object Function]",h="[object GeneratorFunction]",f="[object Map]",m="[object Number]",p="[object Object]",g="[object Promise]",y="[object RegExp]",_="[object Set]",x="[object String]",T="[object Symbol]",k="[object WeakMap]",w="[object ArrayBuffer]",O="[object DataView]",S="[object Float32Array]",A="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",v="[object Int32Array]",C="[object Uint8Array]",I="[object Uint8ClampedArray]",U="[object Uint16Array]",H="[object Uint32Array]",V=/[\\^$.*+?()[\]{}|]/g,G=/\w*$/,rt=/^\[object .+?Constructor\]$/,ot=/^(?:0|[1-9]\d*)$/,X={};X[o]=X[a]=X[w]=X[O]=X[r]=X[l]=X[S]=X[A]=X[R]=X[D]=X[v]=X[f]=X[m]=X[p]=X[y]=X[_]=X[x]=X[T]=X[C]=X[I]=X[U]=X[H]=!0,X[c]=X[d]=X[k]=!1;var B=typeof Ji=="object"&&Ji&&Ji.Object===Object&&Ji,M=typeof self=="object"&&self&&self.Object===Object&&self,E=B||M||Function("return this")(),z=t&&!t.nodeType&&t,Y=z&&!0&&e&&!e.nodeType&&e,nt=Y&&Y.exports===z;function N(b,P){return b.set(P[0],P[1]),b}function $(b,P){return b.add(P),b}function pt(b,P){for(var L=-1,q=b?b.length:0;++L<q&&P(b[L],L,b)!==!1;);return b}function ct(b,P){for(var L=-1,q=P.length,Ft=b.length;++L<q;)b[Ft+L]=P[L];return b}function at(b,P,L,q){for(var Ft=-1,te=b?b.length:0;++Ft<te;)L=P(L,b[Ft],Ft,b);return L}function Ct(b,P){for(var L=-1,q=Array(b);++L<b;)q[L]=P(L);return q}function Bt(b,P){return b?.[P]}function Pt(b){var P=!1;if(b!=null&&typeof b.toString!="function")try{P=!!(b+"")}catch{}return P}function St(b){var P=-1,L=Array(b.size);return b.forEach(function(q,Ft){L[++P]=[Ft,q]}),L}function F(b,P){return function(L){return b(P(L))}}function j(b){var P=-1,L=Array(b.size);return b.forEach(function(q){L[++P]=q}),L}var st=Array.prototype,zt=Function.prototype,re=Object.prototype,Se=E["__core-js_shared__"],Wn=(function(){var b=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return b?"Symbol(src)_1."+b:""})(),ro=zt.toString,je=re.hasOwnProperty,lo=re.toString,XA=RegExp("^"+ro.call(je).replace(V,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uf=nt?E.Buffer:void 0,df=E.Symbol,hf=E.Uint8Array,KA=F(Object.getPrototypeOf,Object),ZA=Object.create,QA=re.propertyIsEnumerable,JA=st.splice,ff=Object.getOwnPropertySymbols,tP=uf?uf.isBuffer:void 0,eP=F(Object.keys,Object),pr=Gn(E,"DataView"),ji=Gn(E,"Map"),gr=Gn(E,"Promise"),yr=Gn(E,"Set"),br=Gn(E,"WeakMap"),qi=Gn(Object,"create"),nP=yn(pr),iP=yn(ji),sP=yn(gr),oP=yn(yr),aP=yn(br),mf=df?df.prototype:void 0,pf=mf?mf.valueOf:void 0;function pn(b){var P=-1,L=b?b.length:0;for(this.clear();++P<L;){var q=b[P];this.set(q[0],q[1])}}function rP(){this.__data__=qi?qi(null):{}}function lP(b){return this.has(b)&&delete this.__data__[b]}function cP(b){var P=this.__data__;if(qi){var L=P[b];return L===i?void 0:L}return je.call(P,b)?P[b]:void 0}function uP(b){var P=this.__data__;return qi?P[b]!==void 0:je.call(P,b)}function dP(b,P){var L=this.__data__;return L[b]=qi&&P===void 0?i:P,this}pn.prototype.clear=rP,pn.prototype.delete=lP,pn.prototype.get=cP,pn.prototype.has=uP,pn.prototype.set=dP;function Me(b){var P=-1,L=b?b.length:0;for(this.clear();++P<L;){var q=b[P];this.set(q[0],q[1])}}function hP(){this.__data__=[]}function fP(b){var P=this.__data__,L=co(P,b);if(L<0)return!1;var q=P.length-1;return L==q?P.pop():JA.call(P,L,1),!0}function mP(b){var P=this.__data__,L=co(P,b);return L<0?void 0:P[L][1]}function pP(b){return co(this.__data__,b)>-1}function gP(b,P){var L=this.__data__,q=co(L,b);return q<0?L.push([b,P]):L[q][1]=P,this}Me.prototype.clear=hP,Me.prototype.delete=fP,Me.prototype.get=mP,Me.prototype.has=pP,Me.prototype.set=gP;function jn(b){var P=-1,L=b?b.length:0;for(this.clear();++P<L;){var q=b[P];this.set(q[0],q[1])}}function yP(){this.__data__={hash:new pn,map:new(ji||Me),string:new pn}}function bP(b){return uo(this,b).delete(b)}function _P(b){return uo(this,b).get(b)}function xP(b){return uo(this,b).has(b)}function wP(b,P){return uo(this,b).set(b,P),this}jn.prototype.clear=yP,jn.prototype.delete=bP,jn.prototype.get=_P,jn.prototype.has=xP,jn.prototype.set=wP;function qn(b){this.__data__=new Me(b)}function kP(){this.__data__=new Me}function TP(b){return this.__data__.delete(b)}function vP(b){return this.__data__.get(b)}function SP(b){return this.__data__.has(b)}function MP(b,P){var L=this.__data__;if(L instanceof Me){var q=L.__data__;if(!ji||q.length<n-1)return q.push([b,P]),this;L=this.__data__=new jn(q)}return L.set(b,P),this}qn.prototype.clear=kP,qn.prototype.delete=TP,qn.prototype.get=vP,qn.prototype.has=SP,qn.prototype.set=MP;function DP(b,P){var L=wr(b)||ZP(b)?Ct(b.length,String):[],q=L.length,Ft=!!q;for(var te in b)je.call(b,te)&&!(Ft&&(te=="length"||qP(te,q)))&&L.push(te);return L}function gf(b,P,L){var q=b[P];(!(je.call(b,P)&&xf(q,L))||L===void 0&&!(P in b))&&(b[P]=L)}function co(b,P){for(var L=b.length;L--;)if(xf(b[L][0],P))return L;return-1}function CP(b,P){return b&&yf(P,kr(P),b)}function _r(b,P,L,q,Ft,te,De){var ee;if(q&&(ee=te?q(b,Ft,te,De):q(b)),ee!==void 0)return ee;if(!ho(b))return b;var Tf=wr(b);if(Tf){if(ee=YP(b),!P)return VP(b,ee)}else{var Xn=gn(b),vf=Xn==d||Xn==h;if(JP(b))return IP(b,P);if(Xn==p||Xn==o||vf&&!te){if(Pt(b))return te?b:{};if(ee=WP(vf?{}:b),!P)return HP(b,CP(ee,b))}else{if(!X[Xn])return te?b:{};ee=jP(b,Xn,_r,P)}}De||(De=new qn);var Sf=De.get(b);if(Sf)return Sf;if(De.set(b,ee),!Tf)var Mf=L?$P(b):kr(b);return pt(Mf||b,function(Tr,fo){Mf&&(fo=Tr,Tr=b[fo]),gf(ee,fo,_r(Tr,P,L,q,fo,b,De))}),ee}function OP(b){return ho(b)?ZA(b):{}}function AP(b,P,L){var q=P(b);return wr(b)?q:ct(q,L(b))}function PP(b){return lo.call(b)}function EP(b){if(!ho(b)||XP(b))return!1;var P=kf(b)||Pt(b)?XA:rt;return P.test(yn(b))}function RP(b){if(!_f(b))return eP(b);var P=[];for(var L in Object(b))je.call(b,L)&&L!="constructor"&&P.push(L);return P}function IP(b,P){if(P)return b.slice();var L=new b.constructor(b.length);return b.copy(L),L}function xr(b){var P=new b.constructor(b.byteLength);return new hf(P).set(new hf(b)),P}function LP(b,P){var L=P?xr(b.buffer):b.buffer;return new b.constructor(L,b.byteOffset,b.byteLength)}function NP(b,P,L){var q=P?L(St(b),!0):St(b);return at(q,N,new b.constructor)}function BP(b){var P=new b.constructor(b.source,G.exec(b));return P.lastIndex=b.lastIndex,P}function zP(b,P,L){var q=P?L(j(b),!0):j(b);return at(q,$,new b.constructor)}function FP(b){return pf?Object(pf.call(b)):{}}function UP(b,P){var L=P?xr(b.buffer):b.buffer;return new b.constructor(L,b.byteOffset,b.length)}function VP(b,P){var L=-1,q=b.length;for(P||(P=Array(q));++L<q;)P[L]=b[L];return P}function yf(b,P,L,q){L||(L={});for(var Ft=-1,te=P.length;++Ft<te;){var De=P[Ft],ee=void 0;gf(L,De,ee===void 0?b[De]:ee)}return L}function HP(b,P){return yf(b,bf(b),P)}function $P(b){return AP(b,kr,bf)}function uo(b,P){var L=b.__data__;return GP(P)?L[typeof P=="string"?"string":"hash"]:L.map}function Gn(b,P){var L=Bt(b,P);return EP(L)?L:void 0}var bf=ff?F(ff,Object):nE,gn=PP;(pr&&gn(new pr(new ArrayBuffer(1)))!=O||ji&&gn(new ji)!=f||gr&&gn(gr.resolve())!=g||yr&&gn(new yr)!=_||br&&gn(new br)!=k)&&(gn=function(b){var P=lo.call(b),L=P==p?b.constructor:void 0,q=L?yn(L):void 0;if(q)switch(q){case nP:return O;case iP:return f;case sP:return g;case oP:return _;case aP:return k}return P});function YP(b){var P=b.length,L=b.constructor(P);return P&&typeof b[0]=="string"&&je.call(b,"index")&&(L.index=b.index,L.input=b.input),L}function WP(b){return typeof b.constructor=="function"&&!_f(b)?OP(KA(b)):{}}function jP(b,P,L,q){var Ft=b.constructor;switch(P){case w:return xr(b);case r:case l:return new Ft(+b);case O:return LP(b,q);case S:case A:case R:case D:case v:case C:case I:case U:case H:return UP(b,q);case f:return NP(b,q,L);case m:case x:return new Ft(b);case y:return BP(b);case _:return zP(b,q,L);case T:return FP(b)}}function qP(b,P){return P=P??s,!!P&&(typeof b=="number"||ot.test(b))&&b>-1&&b%1==0&&b<P}function GP(b){var P=typeof b;return P=="string"||P=="number"||P=="symbol"||P=="boolean"?b!=="__proto__":b===null}function XP(b){return!!Wn&&Wn in b}function _f(b){var P=b&&b.constructor,L=typeof P=="function"&&P.prototype||re;return b===L}function yn(b){if(b!=null){try{return ro.call(b)}catch{}try{return b+""}catch{}}return""}function KP(b){return _r(b,!0,!0)}function xf(b,P){return b===P||b!==b&&P!==P}function ZP(b){return QP(b)&&je.call(b,"callee")&&(!QA.call(b,"callee")||lo.call(b)==o)}var wr=Array.isArray;function wf(b){return b!=null&&tE(b.length)&&!kf(b)}function QP(b){return eE(b)&&wf(b)}var JP=tP||iE;function kf(b){var P=ho(b)?lo.call(b):"";return P==d||P==h}function tE(b){return typeof b=="number"&&b>-1&&b%1==0&&b<=s}function ho(b){var P=typeof b;return!!b&&(P=="object"||P=="function")}function eE(b){return!!b&&typeof b=="object"}function kr(b){return wf(b)?DP(b):RP(b)}function nE(){return[]}function iE(){return!1}e.exports=KP})(ts,ts.exports)),ts.exports}Bp();const se=(e,t)=>new Date(e.getTime()-Ip(t,e));class Rt{timeframeText;key;display;timeframeLength;allowedTiers;defaultResponseGranularity;dataGranularity;isRelative;fineGrainedDefaultGranularity;_startCustom;_endCustom;_allowedGranularitiesOverride;constructor(t){this.display=t.display,this.timeframeText=t.timeframeText,this.key=t.key,this.timeframeLength=t.timeframeLength,this.allowedTiers=t.allowedTiers,this.defaultResponseGranularity=t.defaultResponseGranularity,this.dataGranularity=t.dataGranularity,this.isRelative=t.isRelative,this._startCustom=t.startCustom,this._endCustom=t.endCustom,this._allowedGranularitiesOverride=t.allowedGranularitiesOverride,this.fineGrainedDefaultGranularity=t.fineGrainedDefaultGranularity}rawEnd(t){return this._endCustom||new Date}rawStart(t){return this._startCustom||new Date(this.rawEnd().getTime()-this.timeframeLengthMs())}timeframeLengthMs(){return this.timeframeLength()*1e3}maximumTimeframeLength(){return this.timeframeLength()}allowedGranularities(t){if(this._allowedGranularitiesOverride&&t)return new Set(this._allowedGranularitiesOverride);const n=new Set,i=this.maximumTimeframeLength()/3600;return i<=6&&n.add("minutely"),i>=2&&i<=168&&n.add("hourly"),i>=48&&n.add("daily"),i>=672&&n.add("weekly"),n}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 n=Rp(new Date,new Intl.DateTimeFormat().resolvedOptions().timeZone);return el(n,t)}}class zp extends Rt{rawStart(t){let n=ge(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=se(n,t)),n}maximumTimeframeLength(){return 3600*24*7}}class Fp extends Rt{rawStart(t){let n=wn(this.tzAdjustedDate(t));return t&&(n=se(n,t)),n}maximumTimeframeLength(){return 3600*24*31}}class Up extends Rt{rawStart(t){let n=xn(this.tzAdjustedDate(t));return t&&(n=se(n,t)),n}maximumTimeframeLength(){return 3600*24*92}}class Vp extends Rt{rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=se(n,t)),n}maximumTimeframeLength(){return 3600*24*366}}class Hp extends Rt{rawEnd(t){let n=ge(this.tzAdjustedDate(t),{weekStartsOn:1});return t&&(n=se(n,t)),n}rawStart(t){const n=this.tzAdjustedDate(t);let i=ge(n.setDate(n.getDate()-7),{weekStartsOn:1});return t&&(i=se(i,t)),i}}class $p extends Rt{rawEnd(t){let n=xn(this.tzAdjustedDate(t));return t&&(n=se(n,t)),n}rawStart(t){let n=xn(Vr(this.tzAdjustedDate(t)));return t&&(n=se(n,t)),n}}class Yp extends Rt{rawEnd(t){let n=wn(this.tzAdjustedDate(t));return t&&(n=se(n,t)),n}rawStart(t){let n=wn(Ur(this.tzAdjustedDate(t)));return t&&(n=se(n,t)),n}}class Wp extends Rt{rawEnd(t){let n=new Date(this.tzAdjustedDate(t).getFullYear(),0,1);return t&&(n=se(n,t)),n}rawStart(t){let n=new Date(this.tzAdjustedDate(t).getFullYear()-1,0,1);return t&&(n=se(n,t)),n}}W.FIFTEEN_MIN,new Rt({key:W.FIFTEEN_MIN,display:"Last 15 minutes",timeframeText:"15 minutes",timeframeLength:()=>900,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"thirtySecondly",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely"]}),W.ONE_HOUR,new Rt({key:W.ONE_HOUR,display:"Last hour",timeframeText:"One hour",timeframeLength:()=>3600*1,defaultResponseGranularity:"minutely",dataGranularity:"minutely",isRelative:!0,fineGrainedDefaultGranularity:"minutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["tenSecondly","thirtySecondly","minutely","fiveMinutely","tenMinutely"]}),W.SIX_HOUR,new Rt({key:W.SIX_HOUR,display:"Last 6 hours",timeframeText:"6 hours",timeframeLength:()=>3600*6,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"fiveMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["thirtySecondly","minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),W.TWELVE_HOUR,new Rt({key:W.TWELVE_HOUR,display:"Last 12 hours",timeframeText:"12 hours",timeframeLength:()=>3600*12,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"tenMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["minutely","fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),W.ONE_DAY,new Rt({key:W.ONE_DAY,display:"Last 24 hours",timeframeText:"24 hours",timeframeLength:()=>3600*24,defaultResponseGranularity:"hourly",dataGranularity:"hourly",isRelative:!0,fineGrainedDefaultGranularity:"thirtyMinutely",allowedTiers:["free","trial","plus","enterprise"],allowedGranularitiesOverride:["fiveMinutely","tenMinutely","thirtyMinutely","hourly"]}),W.SEVEN_DAY,new Rt({key:W.SEVEN_DAY,display:"Last 7 days",timeframeText:"7 days",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),W.THIRTY_DAY,new Rt({key:W.THIRTY_DAY,display:"Last 30 days",timeframeText:"30 days",timeframeLength:()=>3600*24*30,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"twelveHourly",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),W.NINETY_DAY,new Rt({key:W.NINETY_DAY,display:"Last 90 days",timeframeText:"90 days",timeframeLength:()=>3600*24*90,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),W.ONE_HUNDRED_EIGHTY_DAY,new Rt({key:W.ONE_HUNDRED_EIGHTY_DAY,display:"Last 180 days",timeframeText:"180 days",timeframeLength:()=>3600*24*180,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),W.ONE_YEAR,new Rt({key:W.ONE_YEAR,display:"Last 365 days",timeframeText:"365 days",timeframeLength:()=>3600*24*365,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!0,fineGrainedDefaultGranularity:"daily",allowedTiers:["trial","plus","enterprise"],allowedGranularitiesOverride:["hourly","twoHourly","twelveHourly","daily","weekly"]}),W.CURRENT_WEEK,new zp({key:W.CURRENT_WEEK,display:"This week",timeframeText:"Week",timeframeLength:()=>{const e=ge(new Date,{weekStartsOn:1});return(bn(Xi(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),W.CURRENT_MONTH,new Fp({key:W.CURRENT_MONTH,display:"This month",timeframeText:"Month",timeframeLength:()=>{const e=wn(new Date);return(bn(Xi(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),W.CURRENT_QUARTER,new Up({key:W.CURRENT_QUARTER,display:"This quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=xn(new Date);return(bn(Xi(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),W.CURRENT_YEAR,new Vp({key:W.CURRENT_YEAR,display:"This year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1);return(bn(Xi(new Date,1)).getTime()-e.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),W.PREVIOUS_WEEK,new Hp({key:W.PREVIOUS_WEEK,display:"Previous week",timeframeText:"Week",timeframeLength:()=>3600*24*7,defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,fineGrainedDefaultGranularity:"twoHourly",allowedTiers:["plus","enterprise"],allowedGranularitiesOverride:["thirtyMinutely","hourly","twoHourly","twelveHourly","daily"]}),W.PREVIOUS_MONTH,new Yp({key:W.PREVIOUS_MONTH,display:"Previous month",timeframeText:"Month",timeframeLength:()=>{let e=0;const t=wn(new Date),n=wn(Ur(new Date));return t.getTimezoneOffset()!==n.getTimezoneOffset()&&(e=il(t,n)),3600*24*ip(new Date().setMonth(new Date().getMonth()-1))+Fr(e)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),W.PREVIOUS_QUARTER,new $p({key:W.PREVIOUS_QUARTER,display:"Previous quarter",timeframeText:"Quarter",timeframeLength:()=>{const e=xn(new Date),t=xn(Vr(new Date));return(e.getTime()-t.getTime())/1e3},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]}),W.PREVIOUS_YEAR,new Wp({key:W.PREVIOUS_YEAR,display:"Previous year",timeframeText:"Year",timeframeLength:()=>{const e=new Date(new Date().getFullYear(),0,1),t=new Date(new Date().getFullYear()-1,0,1);let n=0;return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(n=il(e,t)),3600*24*(365+(t.getFullYear()%4===0?1:0))+Fr(n)},defaultResponseGranularity:"daily",dataGranularity:"daily",isRelative:!1,allowedTiers:["plus","enterprise"]});function il(e,t){return op(e.getTimezoneOffset()-t.getTimezoneOffset())}W.FIFTEEN_MIN,W.ONE_HOUR,W.SIX_HOUR,W.TWELVE_HOUR,W.ONE_DAY,W.SEVEN_DAY,W.FIFTEEN_MIN,W.ONE_HOUR,W.SIX_HOUR,W.TWELVE_HOUR,W.ONE_DAY,W.SEVEN_DAY,W.THIRTY_DAY,W.NINETY_DAY,W.ONE_HUNDRED_EIGHTY_DAY,W.ONE_YEAR,W.CURRENT_WEEK,W.CURRENT_MONTH,W.CURRENT_QUARTER,W.CURRENT_YEAR,W.PREVIOUS_WEEK,W.PREVIOUS_MONTH,W.PREVIOUS_QUARTER,W.PREVIOUS_YEAR;const jp=new Map(Dr.map(e=>[e.code,{code:e.code,name:e.name}])),Co=e=>jp.get(e)?.name||e,sl=1e3,qp=1e4,ol=1e6,al=1e9,rl=1e12,es=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((s,o)=>{o&&o%3===0&&i.push(n),i.push(s)}),i.reverse().join("")},ei=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let a=o.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function ns(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?qp:sl;return e<s||t.precision&&t.precision>Math.log10(e)?n=es(ei(e,1,t),t):e<ol?n=`${ei(e,sl,t)}k`:e<al?n=`${ei(e,ol,t)}m`:e<rl?n=`${es(ei(e,al,t),t)}b`:n=`${es(ei(e,rl,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}ns.addCommas=es;const Gp=typeof document<"u"&&document.documentElement?.lang||"en-US",is=new Intl.NumberFormat(Gp),Xp=new Set(["%"]),Kp=e=>Xp.has(e)?"flush":"spaced";function le({i18n:e}){const t=(s,o)=>{if(isNaN(s))return"0 B";const a=o?Math.pow(2,50):1e15,r=o?Math.pow(2,40):1e12,l=o?Math.pow(2,30):1e9,c=o?Math.pow(2,20):1e6,d=o?Math.pow(2,10):1e3;let h;return s>=a?h=e.formatNumber(Number.parseFloat((s/a).toPrecision(3)),{style:"unit",unit:"petabyte",unitDisplay:"narrow"}):s>=r?h=e.formatNumber(Number.parseFloat((s/r).toPrecision(3)),{style:"unit",unit:"terabyte",unitDisplay:"narrow"}):s>=l?h=e.formatNumber(Number.parseFloat((s/l).toPrecision(3)),{style:"unit",unit:"gigabyte",unitDisplay:"narrow"}):s>=c?h=e.formatNumber(Number.parseFloat((s/c).toPrecision(3)),{style:"unit",unit:"megabyte",unitDisplay:"narrow"}):s>=d?h=e.formatNumber(Number.parseFloat((s/d).toPrecision(3)),{style:"unit",unit:"kilobyte",unitDisplay:"narrow"}):h=e.formatNumber(Number.parseFloat(s.toPrecision(3)),{style:"unit",unit:"byte",unitDisplay:"narrow"}),h.replace(/([a-zA-Z]*)$/," $1")},n=(s,o="USD")=>isNaN(s)?o==="USD"?"$0.00":`${s}`:s>=.01||o!=="USD"?e.formatNumber(s,{style:"currency",currency:o}):s<1e-4?"< $0.0001":`$${Number.parseFloat(s.toPrecision(4))}`,i=(s,o,a)=>{if(!a)return s;const r=Kp(o)==="flush"?"":" ";return`${s}${r}${a}`};return{formatUnit:(s,o,{isBytes1024:a=!1,currency:r="USD",approximate:l=!1,translateUnit:c=d=>d}={})=>{const d=c(o,s);switch(o){case"bytes":return t(s,a);case"usd":return n(s,r);default:return isNaN(s)?`${s}`:l?i(ns(s,{capital:!0}),o,d):s<.01?i(`${Number.parseFloat(s.toPrecision(4))}`,o,d):i(is.format(Number.parseFloat(s.toFixed(2))),o,d)}},formatBytes:t,formatCost:n,formatRange:(s,o,a,{isBytes1024:r=!1,currency:l="USD",approximate:c=!1,translateUnit:d=h=>h}={})=>{const h=d(a,o);switch(a){case"bytes":return`${t(s,r)} - ${t(o,r)}`;case"usd":return`${n(s,l)} - ${n(o,l)}`;default:if(isNaN(s)||isNaN(o))return`${s} - ${o}`;if(c)return i(`${ns(s,{capital:!0})} - ${ns(o,{capital:!0})}`,a,h)}const f=s>=.01?`${is.format(Number.parseFloat(s.toFixed(2)))}`:`${Number.parseFloat(s.toPrecision(4))}`,m=o>=.01?`${is.format(Number.parseFloat(o.toFixed(2)))}`:`${Number.parseFloat(o.toPrecision(4))}`;return i(`${f} - ${m}`,a,h)}}}const ll="#d60027",cl="#ffe5e5",Zp="#f1f0ff",Qp="#e0e4ea",ul="#0d0e14",Jp="#ad000e",dl="#6c7489",hl="#52596e",tg="#007d60",eg="#995c00",ng="'Inter', Roboto, Helvetica, sans-serif",Tn="16px",ig="20px",sg="#bee2ff",og="#8fc1ff",ag="#5f9aff",rg="#306fff",lg="#b5ffee",cg="#00fabe",ug="#00d6a4",dg="#00a17b",hg="#007d60",fg="#005944",mg="#b5ffee",pg="#00fabe",gg="#b5ffee",yg="#00a17b",bg="#fff296",_g="#ffe04b",xg="#ffc400",wg="#b37600",kg="#995c00",Tg="#804400",vg="#fff296",Sg="#ffe04b",Mg="#ffc2b3",Dg="#ff9877",Cg="#ff723c",Og="#f75008",Ag="#d13500",Pg="#a31f00",Eg="#ffc2b3",Rg="#ff9877",Ig="#ff723c",Lg="#f75008",Ng="#d13500",Bg="#a31f00",zg="#ffc2b3",Fg="#ff9877",Ug="#ff723c",Vg="#f75008",Hg="#d13500",$g="#a31f00",Yg="#ffc2b3",Wg="#ff9877",jg="#ff723c",qg="#f75008",Gg="#d13500",Xg="#a31f00",Kg="#ffc2b3",Zg="#ff9877",Qg="#ff723c",Jg="#f75008",ty="#d13500",ey="#ffabab",ny="#ff7272",iy="#ff3954",sy="#f50045",oy="#d60027",ay="#ad000e",ry="#ffabab",ly="#ff7272",cy="#ff3954",uy="#f50045",dy="#d60027",hy="#eefaff",fy="#ecfffb",my="#fffce0",py="#fff1ef",gy="#ffe5e5",yy="#5f9aff",by="#00d6a4",_y="#ffc400",xy="#ff723c",wy="#ff3954",fl=6048e5,ky=864e5,ni=6e4,vn=36e5,Ty=1e3,ml=Symbol.for("constructDateFrom");function Tt(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&ml in e?e[ml](t):e instanceof Date?new e.constructor(t):new Date(t)}function J(e,t){return Tt(t||e,e)}function ss(e,t,n){const i=J(e,n?.in);return isNaN(t)?Tt(n?.in||e,NaN):(t&&i.setDate(i.getDate()+t),i)}function Oo(e,t,n){const i=J(e,n?.in);if(isNaN(t))return Tt(e,NaN);if(!t)return i;const s=i.getDate(),o=Tt(e,i.getTime());o.setMonth(i.getMonth()+t+1,0);const a=o.getDate();return s>=a?o:(i.setFullYear(o.getFullYear(),o.getMonth(),s),i)}function Ao(e,t,n){return Tt(e,+J(e)+t)}function vy(e,t,n){return Ao(e,t*vn)}let Sy={};function Ke(){return Sy}function ce(e,t){const n=Ke(),i=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=J(e,t?.in),o=s.getDay(),a=(o<i?7:0)+o-i;return s.setDate(s.getDate()-a),s.setHours(0,0,0,0),s}function Sn(e,t){return ce(e,{...t,weekStartsOn:1})}function pl(e,t){const n=J(e,t?.in),i=n.getFullYear(),s=Tt(n,0);s.setFullYear(i+1,0,4),s.setHours(0,0,0,0);const o=Sn(s),a=Tt(n,0);a.setFullYear(i,0,4),a.setHours(0,0,0,0);const r=Sn(a);return n.getTime()>=o.getTime()?i+1:n.getTime()>=r.getTime()?i:i-1}function os(e){const t=J(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Ze(e,...t){const n=Tt.bind(null,t.find(i=>typeof i=="object"));return t.map(n)}function Po(e,t){const n=J(e,t?.in);return n.setHours(0,0,0,0),n}function gl(e,t,n){const[i,s]=Ze(n?.in,e,t),o=Po(i),a=Po(s),r=+o-os(o),l=+a-os(a);return Math.round((r-l)/ky)}function My(e,t){const n=pl(e,t),i=Tt(e,0);return i.setFullYear(n,0,4),i.setHours(0,0,0,0),Sn(i)}function Dy(e,t,n){const i=J(e,n?.in);return i.setTime(i.getTime()+t*ni),i}function Cy(e,t,n){return Oo(e,t*3,n)}function Oy(e,t,n){return Ao(e,t*1e3)}function Ay(e,t,n){return ss(e,t*7,n)}function Py(e,t,n){return Oo(e,t*12,n)}function ii(e,t){const n=+J(e)-+J(t);return n<0?-1:n>0?1:n}function Ey(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Eo(e){return!(!Ey(e)&&typeof e!="number"||isNaN(+J(e)))}function Ry(e,t,n){const[i,s]=Ze(n?.in,e,t),o=i.getFullYear()-s.getFullYear(),a=i.getMonth()-s.getMonth();return o*12+a}function Iy(e,t,n){const[i,s]=Ze(n?.in,e,t);return i.getFullYear()-s.getFullYear()}function yl(e,t,n){const[i,s]=Ze(n?.in,e,t),o=bl(i,s),a=Math.abs(gl(i,s));i.setDate(i.getDate()-o*a);const r=+(bl(i,s)===-o),l=o*(a-r);return l===0?0:l}function bl(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function si(e){return t=>{const i=(e?Math[e]:Math.trunc)(t);return i===0?0:i}}function Ly(e,t,n){const[i,s]=Ze(n?.in,e,t),o=(+i-+s)/vn;return si(n?.roundingMethod)(o)}function Ro(e,t){return+J(e)-+J(t)}function Ny(e,t,n){const i=Ro(e,t)/ni;return si(n?.roundingMethod)(i)}function _l(e,t){const n=J(e,t?.in);return n.setHours(23,59,59,999),n}function xl(e,t){const n=J(e,t?.in),i=n.getMonth();return n.setFullYear(n.getFullYear(),i+1,0),n.setHours(23,59,59,999),n}function By(e,t){const n=J(e,t?.in);return+_l(n,t)==+xl(n,t)}function wl(e,t,n){const[i,s,o]=Ze(n?.in,e,e,t),a=ii(s,o),r=Math.abs(Ry(s,o));if(r<1)return 0;s.getMonth()===1&&s.getDate()>27&&s.setDate(30),s.setMonth(s.getMonth()-a*r);let l=ii(s,o)===-a;By(i)&&r===1&&ii(i,o)===1&&(l=!1);const c=a*(r-+l);return c===0?0:c}function zy(e,t,n){const i=wl(e,t,n)/3;return si(n?.roundingMethod)(i)}function Fy(e,t,n){const i=Ro(e,t)/1e3;return si(n?.roundingMethod)(i)}function Uy(e,t,n){const i=yl(e,t,n)/7;return si(n?.roundingMethod)(i)}function Vy(e,t,n){const[i,s]=Ze(n?.in,e,t),o=ii(i,s),a=Math.abs(Iy(i,s));i.setFullYear(1584),s.setFullYear(1584);const r=ii(i,s)===-o,l=o*(a-+r);return l===0?0:l}function Hy(e,t){const n=J(e,t?.in),i=n.getMonth(),s=i-i%3;return n.setMonth(s,1),n.setHours(0,0,0,0),n}function $y(e,t){const n=J(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function Yy(e,t){const n=J(e,t?.in),i=n.getFullYear();return n.setFullYear(i+1,0,0),n.setHours(23,59,59,999),n}function kl(e,t){const n=J(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function Wy(e,t){const n=J(e,t?.in);return n.setMinutes(59,59,999),n}function jy(e,t){const n=Ke(),i=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=J(e,t?.in),o=s.getDay(),a=(o<i?-7:0)+6-(o-i);return s.setDate(s.getDate()+a),s.setHours(23,59,59,999),s}function qy(e,t){const n=J(e,t?.in);return n.setSeconds(59,999),n}function Gy(e,t){const n=J(e,t?.in),i=n.getMonth(),s=i-i%3+3;return n.setMonth(s,0),n.setHours(23,59,59,999),n}function Xy(e,t){const n=J(e,t?.in);return n.setMilliseconds(999),n}const Ky={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Zy=(e,t,n)=>{let i;const s=Ky[e];return typeof s=="string"?i=s:t===1?i=s.one:i=s.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Io(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Qy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Jy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},t0={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},e0={date:Io({formats:Qy,defaultWidth:"full"}),time:Io({formats:Jy,defaultWidth:"full"}),dateTime:Io({formats:t0,defaultWidth:"full"})},n0={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},i0=(e,t,n,i)=>n0[e];function oi(e){return(t,n)=>{const i=n?.context?String(n.context):"standalone";let s;if(i==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):a;s=e.formattingValues[r]||e.formattingValues[a]}else{const a=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;s=e.values[r]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const s0={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},o0={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},a0={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"]},r0={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"]},l0={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"}},c0={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"}},u0={ordinalNumber:(e,t)=>{const n=Number(e),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:oi({values:s0,defaultWidth:"wide"}),quarter:oi({values:o0,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oi({values:a0,defaultWidth:"wide"}),day:oi({values:r0,defaultWidth:"wide"}),dayPeriod:oi({values:l0,defaultWidth:"wide",formattingValues:c0,defaultFormattingWidth:"wide"})};function ai(e){return(t,n={})=>{const i=n.width,s=i&&e.matchPatterns[i]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],r=i&&e.parsePatterns[i]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(r)?h0(r,h=>h.test(a)):d0(r,h=>h.test(a));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function d0(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function h0(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function f0(e){return(t,n={})=>{const i=t.match(e.matchPattern);if(!i)return null;const s=i[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const r=t.slice(s.length);return{value:a,rest:r}}}const m0=/^(\d+)(th|st|nd|rd)?/i,p0=/\d+/i,g0={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},y0={any:[/^b/i,/^(a|c)/i]},b0={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},_0={any:[/1/i,/2/i,/3/i,/4/i]},x0={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},w0={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]},k0={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},T0={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]},v0={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},S0={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}},M0={ordinalNumber:f0({matchPattern:m0,parsePattern:p0,valueCallback:e=>parseInt(e,10)}),era:ai({matchPatterns:g0,defaultMatchWidth:"wide",parsePatterns:y0,defaultParseWidth:"any"}),quarter:ai({matchPatterns:b0,defaultMatchWidth:"wide",parsePatterns:_0,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ai({matchPatterns:x0,defaultMatchWidth:"wide",parsePatterns:w0,defaultParseWidth:"any"}),day:ai({matchPatterns:k0,defaultMatchWidth:"wide",parsePatterns:T0,defaultParseWidth:"any"}),dayPeriod:ai({matchPatterns:v0,defaultMatchWidth:"any",parsePatterns:S0,defaultParseWidth:"any"})},Tl={code:"en-US",formatDistance:Zy,formatLong:e0,formatRelative:i0,localize:u0,match:M0,options:{weekStartsOn:0,firstWeekContainsDate:1}};function D0(e,t){const n=J(e,t?.in);return gl(n,kl(n))+1}function vl(e,t){const n=J(e,t?.in),i=+Sn(n)-+My(n);return Math.round(i/fl)+1}function Lo(e,t){const n=J(e,t?.in),i=n.getFullYear(),s=Ke(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=Tt(t?.in||e,0);a.setFullYear(i+1,0,o),a.setHours(0,0,0,0);const r=ce(a,t),l=Tt(t?.in||e,0);l.setFullYear(i,0,o),l.setHours(0,0,0,0);const c=ce(l,t);return+n>=+r?i+1:+n>=+c?i:i-1}function C0(e,t){const n=Ke(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,s=Lo(e,t),o=Tt(t?.in||e,0);return o.setFullYear(s,0,i),o.setHours(0,0,0,0),ce(o,t)}function Sl(e,t){const n=J(e,t?.in),i=+ce(n,t)-+C0(n,t);return Math.round(i/fl)+1}function ht(e,t){const n=e<0?"-":"",i=Math.abs(e).toString().padStart(t,"0");return n+i}const Ae={y(e,t){const n=e.getFullYear(),i=n>0?n:1-n;return ht(t==="yy"?i%100:i,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):ht(n+1,2)},d(e,t){return ht(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return n==="am"?"a.m.":"p.m."}},h(e,t){return ht(e.getHours()%12||12,t.length)},H(e,t){return ht(e.getHours(),t.length)},m(e,t){return ht(e.getMinutes(),t.length)},s(e,t){return ht(e.getSeconds(),t.length)},S(e,t){const n=t.length,i=e.getMilliseconds(),s=Math.trunc(i*Math.pow(10,n-3));return ht(s,t.length)}},Mn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ml={G:function(e,t,n){const i=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});default:return n.era(i,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const i=e.getFullYear(),s=i>0?i:1-i;return n.ordinalNumber(s,{unit:"year"})}return Ae.y(e,t)},Y:function(e,t,n,i){const s=Lo(e,i),o=s>0?s:1-s;if(t==="YY"){const a=o%100;return ht(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):ht(o,t.length)},R:function(e,t){const n=pl(e);return ht(n,t.length)},u:function(e,t){const n=e.getFullYear();return ht(n,t.length)},Q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(i);case"QQ":return ht(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(e,t,n){const i=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(i);case"qq":return ht(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(e,t,n){const i=e.getMonth();switch(t){case"M":case"MM":return Ae.M(e,t);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(e,t,n){const i=e.getMonth();switch(t){case"L":return String(i+1);case"LL":return ht(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(e,t,n,i){const s=Sl(e,i);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):ht(s,t.length)},I:function(e,t,n){const i=vl(e);return t==="Io"?n.ordinalNumber(i,{unit:"week"}):ht(i,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ae.d(e,t)},D:function(e,t,n){const i=D0(e);return t==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):ht(i,t.length)},E:function(e,t,n){const i=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return ht(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,i){const s=e.getDay(),o=(s-i.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return ht(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const i=e.getDay(),s=i===0?7:i;switch(t){case"i":return String(s);case"ii":return ht(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const i=e.getHours();let s;switch(i===12?s=Mn.noon:i===0?s=Mn.midnight:s=i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const i=e.getHours();let s;switch(i>=17?s=Mn.evening:i>=12?s=Mn.afternoon:i>=4?s=Mn.morning:s=Mn.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let i=e.getHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return Ae.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ae.H(e,t)},K:function(e,t,n){const i=e.getHours()%12;return t==="Ko"?n.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},k:function(e,t,n){let i=e.getHours();return i===0&&(i=24),t==="ko"?n.ordinalNumber(i,{unit:"hour"}):ht(i,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ae.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ae.s(e,t)},S:function(e,t){return Ae.S(e,t)},X:function(e,t,n){const i=e.getTimezoneOffset();if(i===0)return"Z";switch(t){case"X":return Cl(i);case"XXXX":case"XX":return Qe(i);default:return Qe(i,":")}},x:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"x":return Cl(i);case"xxxx":case"xx":return Qe(i);default:return Qe(i,":")}},O:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Dl(i,":");default:return"GMT"+Qe(i,":")}},z:function(e,t,n){const i=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Dl(i,":");default:return"GMT"+Qe(i,":")}},t:function(e,t,n){const i=Math.trunc(+e/1e3);return ht(i,t.length)},T:function(e,t,n){return ht(+e,t.length)}};function Dl(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.trunc(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+ht(o,2)}function Cl(e,t){return e%60===0?(e>0?"-":"+")+ht(Math.abs(e)/60,2):Qe(e,t)}function Qe(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=ht(Math.trunc(i/60),2),o=ht(i%60,2);return n+s+t+o}const Ol=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Al=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},No={p:Al,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],i=n[1],s=n[2];if(!s)return Ol(e,t);let o;switch(i){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",Ol(i,t)).replace("{{time}}",Al(s,t))}},O0=/^D+$/,A0=/^Y+$/,P0=["D","DD","YY","YYYY"];function Pl(e){return O0.test(e)}function El(e){return A0.test(e)}function Bo(e,t,n){const i=E0(e,t,n);if(console.warn(i),P0.includes(e))throw new RangeError(i)}function E0(e,t,n){const i=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${i} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const R0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,I0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,L0=/^'([^]*?)'?$/,N0=/''/g,B0=/[a-zA-Z]/;function as(e,t,n){const i=Ke(),s=n?.locale??i.locale??Tl,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,a=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,r=J(e,n?.in);if(!Eo(r))throw new RangeError("Invalid time value");let l=t.match(I0).map(d=>{const h=d[0];if(h==="p"||h==="P"){const f=No[h];return f(d,s.formatLong)}return d}).join("").match(R0).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const h=d[0];if(h==="'")return{isToken:!1,value:z0(d)};if(Ml[h])return{isToken:!0,value:d};if(h.match(B0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+h+"`");return{isToken:!1,value:d}});s.localize.preprocessor&&(l=s.localize.preprocessor(r,l));const c={firstWeekContainsDate:o,weekStartsOn:a,locale:s};return l.map(d=>{if(!d.isToken)return d.value;const h=d.value;(!n?.useAdditionalWeekYearTokens&&El(h)||!n?.useAdditionalDayOfYearTokens&&Pl(h))&&Bo(h,t,String(e));const f=Ml[h[0]];return f(r,h,s.localize,c)}).join("")}function z0(e){const t=e.match(L0);return t?t[1].replace(N0,"'"):e}function Rl(){return Object.assign({},Ke())}function F0(e,t){const n=J(e,t?.in).getDay();return n===0?7:n}function U0(e,t){const n=V0(t)?new t(0):Tt(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function V0(e){return typeof e=="function"&&e.prototype?.constructor===e}const H0=10;class Il{subPriority=0;validate(t,n){return!0}}class $0 extends Il{constructor(t,n,i,s,o){super(),this.value=t,this.validateValue=n,this.setValue=i,this.priority=s,o&&(this.subPriority=o)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,i){return this.setValue(t,n,this.value,i)}}class Y0 extends Il{priority=H0;subPriority=-1;constructor(t,n){super(),this.context=t||(i=>Tt(n,i))}set(t,n){return n.timestampIsSet?t:Tt(t,U0(t,this.context))}}class lt{run(t,n,i,s){const o=this.parse(t,n,i,s);return o?{setter:new $0(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(t,n,i){return!0}}class W0 extends lt{priority=140;parse(t,n,i){switch(n){case"G":case"GG":case"GGG":return i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"});case"GGGGG":return i.era(t,{width:"narrow"});default:return i.era(t,{width:"wide"})||i.era(t,{width:"abbreviated"})||i.era(t,{width:"narrow"})}}set(t,n,i){return n.era=i,t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Mt={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 Dt(e,t){return e&&{value:t(e.value),rest:e.rest}}function wt(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function de(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const i=n[1]==="+"?1:-1,s=n[2]?parseInt(n[2],10):0,o=n[3]?parseInt(n[3],10):0,a=n[5]?parseInt(n[5],10):0;return{value:i*(s*vn+o*ni+a*Ty),rest:t.slice(n[0].length)}}function Ll(e){return wt(Mt.anyDigitsSigned,e)}function vt(e,t){switch(e){case 1:return wt(Mt.singleDigit,t);case 2:return wt(Mt.twoDigits,t);case 3:return wt(Mt.threeDigits,t);case 4:return wt(Mt.fourDigits,t);default:return wt(new RegExp("^\\d{1,"+e+"}"),t)}}function rs(e,t){switch(e){case 1:return wt(Mt.singleDigitSigned,t);case 2:return wt(Mt.twoDigitsSigned,t);case 3:return wt(Mt.threeDigitsSigned,t);case 4:return wt(Mt.fourDigitsSigned,t);default:return wt(new RegExp("^-?\\d{1,"+e+"}"),t)}}function zo(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function Nl(e,t){const n=t>0,i=n?t:1-t;let s;if(i<=50)s=e||100;else{const o=i+50,a=Math.trunc(o/100)*100,r=e>=o%100;s=e+a-(r?100:0)}return n?s:1-s}function Bl(e){return e%400===0||e%4===0&&e%100!==0}class j0 extends lt{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return Dt(vt(4,t),s);case"yo":return Dt(i.ordinalNumber(t,{unit:"year"}),s);default:return Dt(vt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i){const s=t.getFullYear();if(i.isTwoDigitYear){const a=Nl(i.year,s);return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}const o=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}}class q0 extends lt{priority=130;parse(t,n,i){const s=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return Dt(vt(4,t),s);case"Yo":return Dt(i.ordinalNumber(t,{unit:"year"}),s);default:return Dt(vt(n.length,t),s)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,i,s){const o=Lo(t,s);if(i.isTwoDigitYear){const r=Nl(i.year,o);return t.setFullYear(r,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ce(t,s)}const a=!("era"in n)||n.era===1?i.year:1-i.year;return t.setFullYear(a,0,s.firstWeekContainsDate),t.setHours(0,0,0,0),ce(t,s)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class G0 extends lt{priority=130;parse(t,n){return rs(n==="R"?4:n.length,t)}set(t,n,i){const s=Tt(t,0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),Sn(s)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class X0 extends lt{priority=130;parse(t,n){return rs(n==="u"?4:n.length,t)}set(t,n,i){return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class K0 extends lt{priority=120;parse(t,n,i){switch(n){case"Q":case"QQ":return vt(n.length,t);case"Qo":return i.ordinalNumber(t,{unit:"quarter"});case"QQQ":return i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(t,{width:"narrow",context:"formatting"});default:return i.quarter(t,{width:"wide",context:"formatting"})||i.quarter(t,{width:"abbreviated",context:"formatting"})||i.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Z0 extends lt{priority=120;parse(t,n,i){switch(n){case"q":case"qq":return vt(n.length,t);case"qo":return i.ordinalNumber(t,{unit:"quarter"});case"qqq":return i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(t,{width:"narrow",context:"standalone"});default:return i.quarter(t,{width:"wide",context:"standalone"})||i.quarter(t,{width:"abbreviated",context:"standalone"})||i.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,i){return t.setMonth((i-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Q0 extends lt{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"M":return Dt(wt(Mt.month,t),s);case"MM":return Dt(vt(2,t),s);case"Mo":return Dt(i.ordinalNumber(t,{unit:"month"}),s);case"MMM":return i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(t,{width:"narrow",context:"formatting"});default:return i.month(t,{width:"wide",context:"formatting"})||i.month(t,{width:"abbreviated",context:"formatting"})||i.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}}class J0 extends lt{priority=110;parse(t,n,i){const s=o=>o-1;switch(n){case"L":return Dt(wt(Mt.month,t),s);case"LL":return Dt(vt(2,t),s);case"Lo":return Dt(i.ordinalNumber(t,{unit:"month"}),s);case"LLL":return i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(t,{width:"narrow",context:"standalone"});default:return i.month(t,{width:"wide",context:"standalone"})||i.month(t,{width:"abbreviated",context:"standalone"})||i.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.setMonth(i,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function tb(e,t,n){const i=J(e,n?.in),s=Sl(i,n)-t;return i.setDate(i.getDate()-s*7),J(i,n?.in)}class eb extends lt{priority=100;parse(t,n,i){switch(n){case"w":return wt(Mt.week,t);case"wo":return i.ordinalNumber(t,{unit:"week"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i,s){return ce(tb(t,i,s),s)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function nb(e,t,n){const i=J(e,n?.in),s=vl(i,n)-t;return i.setDate(i.getDate()-s*7),i}class ib extends lt{priority=100;parse(t,n,i){switch(n){case"I":return wt(Mt.week,t);case"Io":return i.ordinalNumber(t,{unit:"week"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,i){return Sn(nb(t,i))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const sb=[31,28,31,30,31,30,31,31,30,31,30,31],ob=[31,29,31,30,31,30,31,31,30,31,30,31];class ab extends lt{priority=90;subPriority=1;parse(t,n,i){switch(n){case"d":return wt(Mt.date,t);case"do":return i.ordinalNumber(t,{unit:"date"});default:return vt(n.length,t)}}validate(t,n){const i=t.getFullYear(),s=Bl(i),o=t.getMonth();return s?n>=1&&n<=ob[o]:n>=1&&n<=sb[o]}set(t,n,i){return t.setDate(i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class rb extends lt{priority=90;subpriority=1;parse(t,n,i){switch(n){case"D":case"DD":return wt(Mt.dayOfYear,t);case"Do":return i.ordinalNumber(t,{unit:"date"});default:return vt(n.length,t)}}validate(t,n){const i=t.getFullYear();return Bl(i)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,i){return t.setMonth(0,i),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Fo(e,t,n){const i=Ke(),s=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,o=J(e,n?.in),a=o.getDay(),l=(t%7+7)%7,c=7-s,d=t<0||t>6?t-(a+c)%7:(l+c)%7-(a+c)%7;return ss(o,d,n)}class lb extends lt{priority=90;parse(t,n,i){switch(n){case"E":case"EE":case"EEE":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Fo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class cb extends lt{priority=90;parse(t,n,i,s){const o=a=>{const r=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+r};switch(n){case"e":case"ee":return Dt(vt(n.length,t),o);case"eo":return Dt(i.ordinalNumber(t,{unit:"day"}),o);case"eee":return i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});case"eeeee":return i.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"});default:return i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Fo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class ub extends lt{priority=90;parse(t,n,i,s){const o=a=>{const r=Math.floor((a-1)/7)*7;return(a+s.weekStartsOn+6)%7+r};switch(n){case"c":case"cc":return Dt(vt(n.length,t),o);case"co":return Dt(i.ordinalNumber(t,{unit:"day"}),o);case"ccc":return i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});case"ccccc":return i.day(t,{width:"narrow",context:"standalone"});case"cccccc":return i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"});default:return i.day(t,{width:"wide",context:"standalone"})||i.day(t,{width:"abbreviated",context:"standalone"})||i.day(t,{width:"short",context:"standalone"})||i.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,i,s){return t=Fo(t,i,s),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function db(e,t,n){const i=J(e,n?.in),s=F0(i,n),o=t-s;return ss(i,o,n)}class hb extends lt{priority=90;parse(t,n,i){const s=o=>o===0?7:o;switch(n){case"i":case"ii":return vt(n.length,t);case"io":return i.ordinalNumber(t,{unit:"day"});case"iii":return Dt(i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiii":return Dt(i.day(t,{width:"narrow",context:"formatting"}),s);case"iiiiii":return Dt(i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s);default:return Dt(i.day(t,{width:"wide",context:"formatting"})||i.day(t,{width:"abbreviated",context:"formatting"})||i.day(t,{width:"short",context:"formatting"})||i.day(t,{width:"narrow",context:"formatting"}),s)}}validate(t,n){return n>=1&&n<=7}set(t,n,i){return t=db(t,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class fb extends lt{priority=80;parse(t,n,i){switch(n){case"a":case"aa":case"aaa":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(zo(i),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class mb extends lt{priority=80;parse(t,n,i){switch(n){case"b":case"bb":case"bbb":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(zo(i),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class pb extends lt{priority=80;parse(t,n,i){switch(n){case"B":case"BB":case"BBB":return i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(t,{width:"narrow",context:"formatting"});default:return i.dayPeriod(t,{width:"wide",context:"formatting"})||i.dayPeriod(t,{width:"abbreviated",context:"formatting"})||i.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,i){return t.setHours(zo(i),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class gb extends lt{priority=70;parse(t,n,i){switch(n){case"h":return wt(Mt.hour12h,t);case"ho":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,i){const s=t.getHours()>=12;return s&&i<12?t.setHours(i+12,0,0,0):!s&&i===12?t.setHours(0,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class yb extends lt{priority=70;parse(t,n,i){switch(n){case"H":return wt(Mt.hour23h,t);case"Ho":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,i){return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class bb extends lt{priority=70;parse(t,n,i){switch(n){case"K":return wt(Mt.hour11h,t);case"Ko":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,i){return t.getHours()>=12&&i<12?t.setHours(i+12,0,0,0):t.setHours(i,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class _b extends lt{priority=70;parse(t,n,i){switch(n){case"k":return wt(Mt.hour24h,t);case"ko":return i.ordinalNumber(t,{unit:"hour"});default:return vt(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,i){const s=i<=24?i%24:i;return t.setHours(s,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class xb extends lt{priority=60;parse(t,n,i){switch(n){case"m":return wt(Mt.minute,t);case"mo":return i.ordinalNumber(t,{unit:"minute"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setMinutes(i,0,0),t}incompatibleTokens=["t","T"]}class wb extends lt{priority=50;parse(t,n,i){switch(n){case"s":return wt(Mt.second,t);case"so":return i.ordinalNumber(t,{unit:"second"});default:return vt(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,i){return t.setSeconds(i,0),t}incompatibleTokens=["t","T"]}class kb extends lt{priority=30;parse(t,n){const i=s=>Math.trunc(s*Math.pow(10,-n.length+3));return Dt(vt(n.length,t),i)}set(t,n,i){return t.setMilliseconds(i),t}incompatibleTokens=["t","T"]}class Tb extends lt{priority=10;parse(t,n){switch(n){case"X":return de(ue.basicOptionalMinutes,t);case"XX":return de(ue.basic,t);case"XXXX":return de(ue.basicOptionalSeconds,t);case"XXXXX":return de(ue.extendedOptionalSeconds,t);default:return de(ue.extended,t)}}set(t,n,i){return n.timestampIsSet?t:Tt(t,t.getTime()-os(t)-i)}incompatibleTokens=["t","T","x"]}class vb extends lt{priority=10;parse(t,n){switch(n){case"x":return de(ue.basicOptionalMinutes,t);case"xx":return de(ue.basic,t);case"xxxx":return de(ue.basicOptionalSeconds,t);case"xxxxx":return de(ue.extendedOptionalSeconds,t);default:return de(ue.extended,t)}}set(t,n,i){return n.timestampIsSet?t:Tt(t,t.getTime()-os(t)-i)}incompatibleTokens=["t","T","X"]}class Sb extends lt{priority=40;parse(t){return Ll(t)}set(t,n,i){return[Tt(t,i*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Mb extends lt{priority=20;parse(t){return Ll(t)}set(t,n,i){return[Tt(t,i),{timestampIsSet:!0}]}incompatibleTokens="*"}const Db={G:new W0,y:new j0,Y:new q0,R:new G0,u:new X0,Q:new K0,q:new Z0,M:new Q0,L:new J0,w:new eb,I:new ib,d:new ab,D:new rb,E:new lb,e:new cb,c:new ub,i:new hb,a:new fb,b:new mb,B:new pb,h:new gb,H:new yb,K:new bb,k:new _b,m:new xb,s:new wb,S:new kb,X:new Tb,x:new vb,t:new Sb,T:new Mb},Cb=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ob=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ab=/^'([^]*?)'?$/,Pb=/''/g,Eb=/\S/,Rb=/[a-zA-Z]/;function Ib(e,t,n,i){const s=()=>Tt(i?.in||n,NaN),o=Rl(),a=i?.locale??o.locale??Tl,r=i?.firstWeekContainsDate??i?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,l=i?.weekStartsOn??i?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0;if(!t)return e?s():J(n,i?.in);const c={firstWeekContainsDate:r,weekStartsOn:l,locale:a},d=[new Y0(i?.in,n)],h=t.match(Ob).map(y=>{const _=y[0];if(_ in No){const x=No[_];return x(y,a.formatLong)}return y}).join("").match(Cb),f=[];for(let y of h){!i?.useAdditionalWeekYearTokens&&El(y)&&Bo(y,t,e),!i?.useAdditionalDayOfYearTokens&&Pl(y)&&Bo(y,t,e);const _=y[0],x=Db[_];if(x){const{incompatibleTokens:T}=x;if(Array.isArray(T)){const w=f.find(O=>T.includes(O.token)||O.token===_);if(w)throw new RangeError(`The format string mustn't contain \`${w.fullToken}\` and \`${y}\` at the same time`)}else if(x.incompatibleTokens==="*"&&f.length>0)throw new RangeError(`The format string mustn't contain \`${y}\` and any other token at the same time`);f.push({token:_,fullToken:y});const k=x.run(e,y,a.match,c);if(!k)return s();d.push(k.setter),e=k.rest}else{if(_.match(Rb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(y==="''"?y="'":_==="'"&&(y=Lb(y)),e.indexOf(y)===0)e=e.slice(y.length);else return s()}}if(e.length>0&&Eb.test(e))return s();const m=d.map(y=>y.priority).sort((y,_)=>_-y).filter((y,_,x)=>x.indexOf(y)===_).map(y=>d.filter(_=>_.priority===y).sort((_,x)=>x.subPriority-_.subPriority)).map(y=>y[0]);let p=J(n,i?.in);if(isNaN(+p))return s();const g={};for(const y of m){if(!y.validate(p,c))return s();const _=y.set(p,g,c);Array.isArray(_)?(p=_[0],Object.assign(g,_[1])):p=_}return p}function Lb(e){return e.match(Ab)[1].replace(Pb,"'")}function Nb(e,t){const n=J(e,t?.in);return n.setMinutes(0,0,0),n}function Bb(e,t){const n=J(e,t?.in);return n.setSeconds(0,0),n}function zb(e,t){const n=J(e,t?.in);return n.setMilliseconds(0),n}function zl(e){const t=e/vn;return Math.trunc(t)}function Fl(e,t){const n=()=>Tt(t?.in,NaN),i=t?.additionalDigits??2,s=Hb(e);let o;if(s.date){const c=$b(s.date,i);o=Yb(c.restDateString,c.year)}if(!o||isNaN(+o))return n();const a=+o;let r=0,l;if(s.time&&(r=Wb(s.time),isNaN(r)))return n();if(s.timezone){if(l=jb(s.timezone),isNaN(l))return n()}else{const c=new Date(a+r),d=J(0,t?.in);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return J(a+r+l,t?.in)}const ls={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Fb=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ub=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Vb=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Hb(e){const t={},n=e.split(ls.dateTimeDelimiter);let i;if(n.length>2)return t;if(/:/.test(n[0])?i=n[0]:(t.date=n[0],i=n[1],ls.timeZoneDelimiter.test(t.date)&&(t.date=e.split(ls.timeZoneDelimiter)[0],i=e.substr(t.date.length,e.length))),i){const s=ls.timezone.exec(i);s?(t.time=i.replace(s[1],""),t.timezone=s[1]):t.time=i}return t}function $b(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),i=e.match(n);if(!i)return{year:NaN,restDateString:""};const s=i[1]?parseInt(i[1]):null,o=i[2]?parseInt(i[2]):null;return{year:o===null?s:o*100,restDateString:e.slice((i[1]||i[2]).length)}}function Yb(e,t){if(t===null)return new Date(NaN);const n=e.match(Fb);if(!n)return new Date(NaN);const i=!!n[4],s=ri(n[1]),o=ri(n[2])-1,a=ri(n[3]),r=ri(n[4]),l=ri(n[5])-1;if(i)return Zb(t,r,l)?qb(t,r,l):new Date(NaN);{const c=new Date(0);return!Xb(t,o,a)||!Kb(t,s)?new Date(NaN):(c.setUTCFullYear(t,o,Math.max(s,a)),c)}}function ri(e){return e?parseInt(e):1}function Wb(e){const t=e.match(Ub);if(!t)return NaN;const n=Uo(t[1]),i=Uo(t[2]),s=Uo(t[3]);return Qb(n,i,s)?n*vn+i*ni+s*1e3:NaN}function Uo(e){return e&&parseFloat(e.replace(",","."))||0}function jb(e){if(e==="Z")return 0;const t=e.match(Vb);if(!t)return 0;const n=t[1]==="+"?-1:1,i=parseInt(t[2]),s=t[3]&&parseInt(t[3])||0;return Jb(i,s)?n*(i*vn+s*ni):NaN}function qb(e,t,n){const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=(t-1)*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const Gb=[31,null,31,30,31,30,31,31,30,31,30,31];function Ul(e){return e%400===0||e%4===0&&e%100!==0}function Xb(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Gb[t]||(Ul(e)?29:28))}function Kb(e,t){return t>=1&&t<=(Ul(e)?366:365)}function Zb(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Qb(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Jb(e,t){return t>=0&&t<=59}const Vl={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",scatter:{median:"Median",percentile:"p{value}",outlier:"Outlier (> {label})"},chartUnits:{ms:"ms",bytes:"Byte{plural}",count:"request{plural}","count/minute":"rpm",requests:"request{plural}","token count":"token{plural}","tokens/minute":"tpm","%":"%","ops/minute":"ops/minute"},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."},canceled:{message:"Request canceled"},other:{message:"Bad request"}},legend:{datapointValueDisplay:"{value} {unit}"},chartLabels:{ai_count:"LLM request count",latencies_response_ms:"Response latency",latencies_upstream_ms:"Upstream latency",latencies_kong_gateway_ms:"Kong latency",latencies_kong_internal_ms:"Kong internal latency",request_body_size:"Request size",response_body_size:"Response size",response_header_content_length:"Content length",ai:{cost:"Cost",costCaching:"Caching cost",promptTokens:"Prompt tokens",completionTokens:"Completion tokens",totalTokens:"Total tokens",llmLatency:"LLM latency",fetchLatency:"Fetch latency",embeddingsLatency:"Embeddings latency"},mcp:{latency:"MCP latency",response_body_size:"MCP response size"},a2a:{latency:"A2A latency",response_body_size:"A2A response size"},ai_gateway:"AI gateway",ai_gateway_agent:"AI gateway agent",ai_gateway_consumer:"AI gateway consumer",ai_gateway_consumer_group:"AI gateway consumer group",ai_gateway_data_plane_node:"AI gateway data plane node",ai_gateway_mcp_server:"AI gateway MCP server",ai_gateway_model:"AI gateway model",ai_gateway_version:"AI gateway version",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",share_of_requests:"Share of requests",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)",kong_internal_latency_average:"Kong internal latency (avg)",kong_internal_latency_p99:"Kong internal latency (p99)",kong_internal_latency_p95:"Kong internal latency (p95)",kong_internal_latency_p50:"Kong internal 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",consumer_group:"Consumer group",oidc_credential:"OIDC credential",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)",total_tokens_per_minute:"Total tokens per minute",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",cost_per_request_average:"Request cost (avg per million)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)","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",active_agents:"Active agents",mcp_error:"MCP error",mcp_method:"MCP method",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",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","record_bytes:sum":"Record size (sum)","record_count:sum":"Record count (sum)","request_count:sum":"Request count (sum)",route_count:"Route count",consumer_count:"Consumer count",plugin_count:"Plugin count",node_count:"Data plane node count",principal:"Principal",virtual_cluster_id:"Virtual cluster",backend_cluster_id:"Backend cluster",listener_id:"Listener",principal_name:"Principal name",principal_type:"Principal type",request_type:"Request type",topic_name:"Topic name",partition_index:"Partition index",api_key:"API key",data_plane_group:"Data plane group",managed_cache:"Managed cache",network:"Network",provider:"Provider",provider_region:"Provider region",region:"Region",cache_eviction_rate:"Cache eviction rate",cache_expiration_rate:"Cache expiration rate",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max)",cache_status:"Cache status",cache_hit_rate:"Cache hit rate",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)"},metricAxisTitles:{cache_hit_rate:"Cache hit rate {unit}",error_rate:"Error rate in {unit}",request_count:"Request count",share_of_requests:"Share of requests",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}",kong_internal_latency_average:"Kong internal latency (avg) in {unit}",kong_internal_latency_p99:"Kong internal latency (p99) in {unit}",kong_internal_latency_p95:"Kong internal latency (p95) in {unit}",kong_internal_latency_p50:"Kong internal 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",cost_per_request_average:"Cost per request (avg)",share_of_cost:"Share of cost",llm_cache_embeddings_latency_average:"Embeddings latency (avg)",llm_cache_fetch_latency_average:"Fetch latency (avg)",llm_latency_average:"LLM latency (avg)",llm_latency_p50:"LLM latency (p50)",llm_latency_p95:"LLM latency (p95)",llm_latency_p99:"LLM latency (p99)",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",active_agents:"Active agents",mcp_latency_average:"MCP latency (avg)",mcp_latency_p99:"MCP latency (p99)",mcp_latency_p95:"MCP latency (p95)",mcp_latency_p50:"MCP latency (p50)",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",cache_eviction_rate:"Cache eviction rate in {unit}",cache_expiration_rate:"Cache expiration rate in {unit}",cache_items_average:"Cache items (avg)",cache_memory_utilization_max:"Cache memory utilization (max) in {unit}",cached_tokens:"Cached tokens",time_to_first_token_average:"Time to first token (avg)",time_to_first_token_p99:"Time to first token (p99)",time_to_first_token_p95:"Time to first token (p95)",time_to_first_token_p50:"Time to first token (p50)",time_per_token_average:"Time per token (avg)",time_per_token_p99:"Time per token (p99)",time_per_token_p95:"Time per token (p95)",time_per_token_p50:"Time per token (p50)",total_tokens_per_minute:"Total tokens per minute"},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"},timestampAxisTitles:{platform:"@timestamp created at"},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)"}},topTalkers:{total:"{value} total",defaultEmptyStateTitle:"No data to display",defaultErrorStateTitle:"Something went wrong"},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 Hl(){const e=vr.createI18n("en-us",Vl);return{i18n:e,i18nT:vr.i18nTComponent(e)}}function li(e){return e+.5|0}const Pe=(e,t,n)=>Math.max(Math.min(e,n),t);function ci(e){return Pe(li(e*2.55),0,255)}function Ee(e){return Pe(li(e*255),0,255)}function ye(e){return Pe(li(e/2.55)/100,0,1)}function $l(e){return Pe(li(e*100),0,100)}const oe={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Vo=[..."0123456789ABCDEF"],t_=e=>Vo[e&15],e_=e=>Vo[(e&240)>>4]+Vo[e&15],cs=e=>(e&240)>>4===(e&15),n_=e=>cs(e.r)&&cs(e.g)&&cs(e.b)&&cs(e.a);function i_(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&oe[e[1]]*17,g:255&oe[e[2]]*17,b:255&oe[e[3]]*17,a:t===5?oe[e[4]]*17:255}:(t===7||t===9)&&(n={r:oe[e[1]]<<4|oe[e[2]],g:oe[e[3]]<<4|oe[e[4]],b:oe[e[5]]<<4|oe[e[6]],a:t===9?oe[e[7]]<<4|oe[e[8]]:255})),n}const s_=(e,t)=>e<255?t(e):"";function o_(e){var t=n_(e)?t_:e_;return e?"#"+t(e.r)+t(e.g)+t(e.b)+s_(e.a,t):void 0}const a_=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Yl(e,t,n){const i=t*Math.min(n,1-n),s=(o,a=(o+e/30)%12)=>n-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function r_(e,t,n){const i=(s,o=(s+e/60)%6)=>n-n*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function l_(e,t,n){const i=Yl(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)i[s]*=1-t-n,i[s]+=t;return i}function c_(e,t,n,i,s){return e===s?(t-n)/i+(t<n?6:0):t===s?(n-e)/i+2:(e-t)/i+4}function Ho(e){const n=e.r/255,i=e.g/255,s=e.b/255,o=Math.max(n,i,s),a=Math.min(n,i,s),r=(o+a)/2;let l,c,d;return o!==a&&(d=o-a,c=r>.5?d/(2-o-a):d/(o+a),l=c_(n,i,s,d,o),l=l*60+.5),[l|0,c||0,r]}function $o(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(Ee)}function Yo(e,t,n){return $o(Yl,e,t,n)}function u_(e,t,n){return $o(l_,e,t,n)}function d_(e,t,n){return $o(r_,e,t,n)}function Wl(e){return(e%360+360)%360}function h_(e){const t=a_.exec(e);let n=255,i;if(!t)return;t[5]!==i&&(n=t[6]?ci(+t[5]):Ee(+t[5]));const s=Wl(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=u_(s,o,a):t[1]==="hsv"?i=d_(s,o,a):i=Yo(s,o,a),{r:i[0],g:i[1],b:i[2],a:n}}function f_(e,t){var n=Ho(e);n[0]=Wl(n[0]+t),n=Yo(n),e.r=n[0],e.g=n[1],e.b=n[2]}function m_(e){if(!e)return;const t=Ho(e),n=t[0],i=$l(t[1]),s=$l(t[2]);return e.a<255?`hsla(${n}, ${i}%, ${s}%, ${ye(e.a)})`:`hsl(${n}, ${i}%, ${s}%)`}const jl={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"},ql={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 p_(){const e={},t=Object.keys(ql),n=Object.keys(jl);let i,s,o,a,r;for(i=0;i<t.length;i++){for(a=r=t[i],s=0;s<n.length;s++)o=n[s],r=r.replace(o,jl[o]);o=parseInt(ql[a],16),e[r]=[o>>16&255,o>>8&255,o&255]}return e}let us;function g_(e){us||(us=p_(),us.transparent=[0,0,0,0]);const t=us[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const y_=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function b_(e){const t=y_.exec(e);let n=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];n=t[8]?ci(a):Pe(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?ci(i):Pe(i,0,255)),s=255&(t[4]?ci(s):Pe(s,0,255)),o=255&(t[6]?ci(o):Pe(o,0,255)),{r:i,g:s,b:o,a:n}}}function __(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${ye(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Wo=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Dn=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function x_(e,t,n){const i=Dn(ye(e.r)),s=Dn(ye(e.g)),o=Dn(ye(e.b));return{r:Ee(Wo(i+n*(Dn(ye(t.r))-i))),g:Ee(Wo(s+n*(Dn(ye(t.g))-s))),b:Ee(Wo(o+n*(Dn(ye(t.b))-o))),a:e.a+n*(t.a-e.a)}}function ds(e,t,n){if(e){let i=Ho(e);i[t]=Math.max(0,Math.min(i[t]+i[t]*n,t===0?360:1)),i=Yo(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Gl(e,t){return e&&Object.assign(t||{},e)}function Xl(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Ee(e[3]))):(t=Gl(e,{r:0,g:0,b:0,a:1}),t.a=Ee(t.a)),t}function w_(e){return e.charAt(0)==="r"?b_(e):h_(e)}class ui{constructor(t){if(t instanceof ui)return t;const n=typeof t;let i;n==="object"?i=Xl(t):n==="string"&&(i=i_(t)||g_(t)||w_(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Gl(this._rgb);return t&&(t.a=ye(t.a)),t}set rgb(t){this._rgb=Xl(t)}rgbString(){return this._valid?__(this._rgb):void 0}hexString(){return this._valid?o_(this._rgb):void 0}hslString(){return this._valid?m_(this._rgb):void 0}mix(t,n){if(t){const i=this.rgb,s=t.rgb;let o;const a=n===o?.5:n,r=2*a-1,l=i.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,n){return t&&(this._rgb=x_(this._rgb,t._rgb,n)),this}clone(){return new ui(this.rgb)}alpha(t){return this._rgb.a=Ee(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=li(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ds(this._rgb,2,t),this}darken(t){return ds(this._rgb,2,-t),this}saturate(t){return ds(this._rgb,1,t),this}desaturate(t){return ds(this._rgb,1,-t),this}rotate(t){return f_(this._rgb,t),this}}function be(){}const k_=(()=>{let e=0;return()=>e++})();function Z(e){return e==null}function ut(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function et(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function _t(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ne(e,t){return _t(e)?e:t}function Q(e,t){return typeof e>"u"?t:e}const T_=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Kl=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function ft(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function mt(e,t,n,i){let s,o,a;if(ut(e))for(o=e.length,s=0;s<o;s++)t.call(n,e[s],s);else if(et(e))for(a=Object.keys(e),o=a.length,s=0;s<o;s++)t.call(n,e[a[s]],a[s])}function hs(e,t){let n,i,s,o;if(!e||!t||e.length!==t.length)return!1;for(n=0,i=e.length;n<i;++n)if(s=e[n],o=t[n],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function fs(e){if(ut(e))return e.map(fs);if(et(e)){const t=Object.create(null),n=Object.keys(e),i=n.length;let s=0;for(;s<i;++s)t[n[s]]=fs(e[n[s]]);return t}return e}function Zl(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function v_(e,t,n,i){if(!Zl(e))return;const s=t[e],o=n[e];et(s)&&et(o)?di(s,o,i):t[e]=fs(o)}function di(e,t,n){const i=ut(t)?t:[t],s=i.length;if(!et(e))return e;n=n||{};const o=n.merger||v_;let a;for(let r=0;r<s;++r){if(a=i[r],!et(a))continue;const l=Object.keys(a);for(let c=0,d=l.length;c<d;++c)o(l[c],e,a,n)}return e}function hi(e,t){return di(e,t,{merger:S_})}function S_(e,t,n){if(!Zl(e))return;const i=t[e],s=n[e];et(i)&&et(s)?hi(i,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=fs(s))}const Ql={"":e=>e,x:e=>e.x,y:e=>e.y};function M_(e){const t=e.split("."),n=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(n.push(i),i="");return n}function D_(e){const t=M_(e);return n=>{for(const i of t){if(i==="")break;n=n&&n[i]}return n}}function Re(e,t){return(Ql[t]||(Ql[t]=D_(t)))(e)}function jo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Xt=e=>typeof e<"u",Kt=e=>typeof e=="function",Jl=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function C_(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const tt=Math.PI,gt=2*tt,O_=gt+tt,ms=Number.POSITIVE_INFINITY,qo=tt/180,yt=tt/2,ae=tt/4,ps=tt*2/3,Ie=Math.log10,he=Math.sign;function fi(e,t,n){return Math.abs(e-t)<n}function tc(e){const t=Math.round(e);e=fi(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(Ie(e))),i=e/n;return(i<=1?1:i<=2?2:i<=5?5:10)*n}function A_(e){const t=[],n=Math.sqrt(e);let i;for(i=1;i<n;i++)e%i===0&&(t.push(i),t.push(e/i));return n===(n|0)&&t.push(n),t.sort((s,o)=>s-o).pop(),t}function P_(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Le(e){return!P_(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function E_(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function ec(e,t,n){let i,s,o;for(i=0,s=e.length;i<s;i++)o=e[i][n],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function Ot(e){return e*(tt/180)}function gs(e){return e*(180/tt)}function nc(e){if(!_t(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function ys(e,t){const n=t.x-e.x,i=t.y-e.y,s=Math.sqrt(n*n+i*i);let o=Math.atan2(i,n);return o<-.5*tt&&(o+=gt),{angle:o,distance:s}}function Cn(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function R_(e,t){return(e-t+O_)%gt-tt}function Vt(e){return(e%gt+gt)%gt}function mi(e,t,n,i){const s=Vt(e),o=Vt(t),a=Vt(n),r=Vt(o-s),l=Vt(a-s),c=Vt(s-o),d=Vt(s-a);return s===o||s===a||i&&o===a||r>l&&c<d}function It(e,t,n){return Math.max(t,Math.min(n,e))}function I_(e){return It(e,-32768,32767)}function _e(e,t,n,i=1e-6){return e>=Math.min(t,n)-i&&e<=Math.max(t,n)+i}function Go(e,t,n){n=n||(a=>e[a]<t);let i=e.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,n(o)?s=o:i=o;return{lo:s,hi:i}}const xe=(e,t,n,i)=>Go(e,n,i?s=>{const o=e[s][t];return o<n||o===n&&e[s+1][t]===n}:s=>e[s][t]<n),L_=(e,t,n)=>Go(e,n,i=>e[i][t]>=n);function N_(e,t,n){let i=0,s=e.length;for(;i<s&&e[i]<t;)i++;for(;s>i&&e[s-1]>n;)s--;return i>0||s<e.length?e.slice(i,s):e}const ic=["push","pop","shift","splice","unshift"];function B_(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ic.forEach(n=>{const i="_onData"+jo(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return e._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...o)}),a}})})}function sc(e,t){const n=e._chartjs;if(!n)return;const i=n.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(ic.forEach(o=>{delete e[o]}),delete e._chartjs)}function oc(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const ac=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function rc(e,t){let n=[],i=!1;return function(...s){n=s,i||(i=!0,ac.call(window,()=>{i=!1,e.apply(t,n)}))}}function z_(e,t){let n;return function(...i){return t?(clearTimeout(n),n=setTimeout(e,t,i)):e.apply(this,i),t}}const Xo=e=>e==="start"?"left":e==="end"?"right":"center",Ht=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,F_=(e,t,n,i)=>e===(i?"left":"right")?n:e==="center"?(t+n)/2:t;function lc(e,t,n){const i=t.length;let s=0,o=i;if(e._sorted){const{iScale:a,vScale:r,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=a.axis,{min:h,max:f,minDefined:m,maxDefined:p}=a.getUserBounds();if(m){if(s=Math.min(xe(l,d,h).lo,n?i:xe(t,d,a.getPixelForValue(h)).lo),c){const g=l.slice(0,s+1).reverse().findIndex(y=>!Z(y[r.axis]));s-=Math.max(0,g)}s=It(s,0,i-1)}if(p){let g=Math.max(xe(l,a.axis,f,!0).hi+1,n?0:xe(t,d,a.getPixelForValue(f),!0).hi+1);if(c){const y=l.slice(g-1).findIndex(_=>!Z(_[r.axis]));g+=Math.max(0,y)}o=It(g,s,i)-s}else o=i-s}return{start:s,count:o}}function cc(e){const{xScale:t,yScale:n,_scaleRanges:i}=e,s={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!i)return e._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==n.min||i.ymax!==n.max;return Object.assign(i,s),o}const bs=e=>e===0||e===1,uc=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*gt/n)),dc=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*gt/n)+1,pi={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*yt)+1,easeOutSine:e=>Math.sin(e*yt),easeInOutSine:e=>-.5*(Math.cos(tt*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>bs(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>bs(e)?e:uc(e,.075,.3),easeOutElastic:e=>bs(e)?e:dc(e,.075,.3),easeInOutElastic(e){return bs(e)?e:e<.5?.5*uc(e*2,.1125,.45):.5+.5*dc(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-pi.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?pi.easeInBounce(e*2)*.5:pi.easeOutBounce(e*2-1)*.5+.5};function Ko(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function _s(e){return Ko(e)?e:new ui(e)}function Zo(e){return Ko(e)?e:new ui(e).saturate(.5).darken(.1).hexString()}const U_=["x","y","borderWidth","radius","tension"],V_=["color","borderColor","backgroundColor"];function H_(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:V_},numbers:{type:"number",properties:U_}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function $_(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const hc=new Map;function Y_(e,t){t=t||{};const n=e+JSON.stringify(t);let i=hc.get(n);return i||(i=new Intl.NumberFormat(e,t),hc.set(n,i)),i}function gi(e,t,n){return Y_(t,n).format(e)}const fc={values(e){return ut(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const i=this.chart.options.locale;let s,o=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=W_(e,n)}const a=Ie(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),gi(e,i,l)},logarithmic(e,t,n){if(e===0)return"0";const i=n[t].significand||e/Math.pow(10,Math.floor(Ie(e)));return[1,2,3,5,10,15].includes(i)||t>.8*n.length?fc.numeric.call(this,e,t,n):""}};function W_(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var xs={formatters:fc};function j_(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:xs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Je=Object.create(null),Qo=Object.create(null);function yi(e,t){if(!t)return e;const n=t.split(".");for(let i=0,s=n.length;i<s;++i){const o=n[i];e=e[o]||(e[o]=Object.create(null))}return e}function Jo(e,t,n){return typeof t=="string"?di(yi(e,t),n):di(yi(e,""),t)}class q_{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Zo(s.backgroundColor),this.hoverBorderColor=(i,s)=>Zo(s.borderColor),this.hoverColor=(i,s)=>Zo(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(n)}set(t,n){return Jo(this,t,n)}get(t){return yi(this,t)}describe(t,n){return Jo(Qo,t,n)}override(t,n){return Jo(Je,t,n)}route(t,n,i,s){const o=yi(this,t),a=yi(this,i),r="_"+n;Object.defineProperties(o,{[r]:{value:o[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[r],c=a[s];return et(l)?Object.assign({},c,l):Q(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(n=>n(this))}}var bt=new q_({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[H_,$_,j_]);function G_(e){return!e||Z(e.size)||Z(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ws(e,t,n,i,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,n.push(s)),o>i&&(i=o),i}function X_(e,t,n,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),e.save(),e.font=t;let a=0;const r=n.length;let l,c,d,h,f;for(l=0;l<r;l++)if(h=n[l],h!=null&&!ut(h))a=ws(e,s,o,a,h);else if(ut(h))for(c=0,d=h.length;c<d;c++)f=h[c],f!=null&&!ut(f)&&(a=ws(e,s,o,a,f));e.restore();const m=o.length/2;if(m>n.length){for(l=0;l<m;l++)delete s[o[l]];o.splice(0,m)}return a}function tn(e,t,n){const i=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*i)/i+s}function mc(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function ta(e,t,n,i){pc(e,t,n,i,null)}function pc(e,t,n,i,s){let o,a,r,l,c,d,h,f;const m=t.pointStyle,p=t.rotation,g=t.radius;let y=(p||0)*qo;if(m&&typeof m=="object"&&(o=m.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(n,i),e.rotate(y),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(g)||g<=0)){switch(e.beginPath(),m){default:s?e.ellipse(n,i,s/2,g,0,0,gt):e.arc(n,i,g,0,gt),e.closePath();break;case"triangle":d=s?s/2:g,e.moveTo(n+Math.sin(y)*d,i-Math.cos(y)*g),y+=ps,e.lineTo(n+Math.sin(y)*d,i-Math.cos(y)*g),y+=ps,e.lineTo(n+Math.sin(y)*d,i-Math.cos(y)*g),e.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(y+ae)*l,h=Math.cos(y+ae)*(s?s/2-c:l),r=Math.sin(y+ae)*l,f=Math.sin(y+ae)*(s?s/2-c:l),e.arc(n-h,i-r,c,y-tt,y-yt),e.arc(n+f,i-a,c,y-yt,y),e.arc(n+h,i+r,c,y,y+yt),e.arc(n-f,i+a,c,y+yt,y+tt),e.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,d=s?s/2:l,e.rect(n-d,i-l,2*d,2*l);break}y+=ae;case"rectRot":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+f,i-a),e.lineTo(n+h,i+r),e.lineTo(n-f,i+a),e.closePath();break;case"crossRot":y+=ae;case"cross":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"star":h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a),y+=ae,h=Math.cos(y)*(s?s/2:g),a=Math.cos(y)*g,r=Math.sin(y)*g,f=Math.sin(y)*(s?s/2:g),e.moveTo(n-h,i-r),e.lineTo(n+h,i+r),e.moveTo(n+f,i-a),e.lineTo(n-f,i+a);break;case"line":a=s?s/2:Math.cos(y)*g,r=Math.sin(y)*g,e.moveTo(n-a,i-r),e.lineTo(n+a,i+r);break;case"dash":e.moveTo(n,i),e.lineTo(n+Math.cos(y)*(s?s/2:g),i+Math.sin(y)*g);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function we(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function bi(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function _i(e){e.restore()}function K_(e,t,n,i,s){if(!t)return e.lineTo(n.x,n.y);if(s==="middle"){const o=(t.x+n.x)/2;e.lineTo(o,t.y),e.lineTo(o,n.y)}else s==="after"!=!!i?e.lineTo(t.x,n.y):e.lineTo(n.x,t.y);e.lineTo(n.x,n.y)}function Z_(e,t,n,i){if(!t)return e.lineTo(n.x,n.y);e.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?n.cp2x:n.cp1x,i?n.cp2y:n.cp1y,n.x,n.y)}function Q_(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),Z(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function J_(e,t,n,i,s){if(s.strikethrough||s.underline){const o=e.measureText(i),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=n-o.actualBoundingBoxAscent,c=n+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(a,d),e.lineTo(r,d),e.stroke()}}function tx(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function en(e,t,n,i,s,o={}){const a=ut(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,Q_(e,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&tx(e,o.backdrop),r&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),Z(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,n,i,o.maxWidth)),e.fillText(c,n,i,o.maxWidth),J_(e,n,i,c,o),i+=Number(s.lineHeight);e.restore()}function On(e,t){const{x:n,y:i,w:s,h:o,radius:a}=t;e.arc(n+a.topLeft,i+a.topLeft,a.topLeft,1.5*tt,tt,!0),e.lineTo(n,i+o-a.bottomLeft),e.arc(n+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,tt,yt,!0),e.lineTo(n+s-a.bottomRight,i+o),e.arc(n+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,yt,0,!0),e.lineTo(n+s,i+a.topRight),e.arc(n+s-a.topRight,i+a.topRight,a.topRight,0,-yt,!0),e.lineTo(n+a.topLeft,i)}const ex=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,nx=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ix(e,t){const n=(""+e).match(ex);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const sx=e=>+e||0;function ea(e,t){const n={},i=et(t),s=i?Object.keys(t):t,o=et(e)?i?a=>Q(e[a],e[t[a]]):a=>e[a]:()=>e;for(const a of s)n[a]=sx(o(a));return n}function gc(e){return ea(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Ne(e){return ea(e,["topLeft","topRight","bottomLeft","bottomRight"])}function At(e){const t=gc(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function xt(e,t){e=e||{},t=t||bt.font;let n=Q(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let i=Q(e.style,t.style);i&&!(""+i).match(nx)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:Q(e.family,t.family),lineHeight:ix(Q(e.lineHeight,t.lineHeight),n),size:n,style:i,weight:Q(e.weight,t.weight),string:""};return s.string=G_(s),s}function xi(e,t,n,i){let s,o,a;for(s=0,o=e.length;s<o;++s)if(a=e[s],a!==void 0&&a!==void 0)return a}function ox(e,t,n){const{min:i,max:s}=e,o=Kl(t,(s-i)/2),a=(r,l)=>n&&r===0?0:r+l;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function Be(e,t){return Object.assign(Object.create(e),t)}function na(e,t=[""],n,i,s=()=>e[0]){const o=n||e;typeof i>"u"&&(i=wc("_fallback",e));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>na([r,...e],t,o,i)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete e[0][l],!0},get(r,l){return bc(r,l,()=>fx(l,t,e,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(r,l){return kc(r).includes(l)},ownKeys(r){return kc(r)},set(r,l,c){const d=r._storage||(r._storage=s());return r[l]=d[l]=c,delete r._keys,!0}})}function An(e,t,n,i){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:yc(e,i),setContext:o=>An(e,o,n,i),override:o=>An(e.override(o),t,n,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete e[a],!0},get(o,a,r){return bc(o,a,()=>rx(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(e,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,a)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,a){return Reflect.has(e,a)},ownKeys(){return Reflect.ownKeys(e)},set(o,a,r){return e[a]=r,delete o[a],!0}})}function yc(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:i,isScriptable:Kt(n)?n:()=>n,isIndexable:Kt(i)?i:()=>i}}const ax=(e,t)=>e?e+jo(t):t,ia=(e,t)=>et(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bc(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const i=n();return e[t]=i,i}function rx(e,t,n){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=e;let r=i[t];return Kt(r)&&a.isScriptable(t)&&(r=lx(t,r,e,n)),ut(r)&&r.length&&(r=cx(t,r,e,a.isIndexable)),ia(t,r)&&(r=An(r,s,o&&o[t],a)),r}function lx(e,t,n,i){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=n;if(r.has(e))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+e);r.add(e);let l=t(o,a||i);return r.delete(e),ia(e,l)&&(l=sa(s._scopes,s,e,l)),l}function cx(e,t,n,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=n;if(typeof o.index<"u"&&i(e))return t[o.index%t.length];if(et(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const h=sa(c,s,e,d);t.push(An(h,o,a&&a[e],r))}}return t}function _c(e,t,n){return Kt(e)?e(t,n):e}const ux=(e,t)=>e===!0?t:typeof e=="string"?Re(t,e):void 0;function dx(e,t,n,i,s){for(const o of t){const a=ux(n,o);if(a){e.add(a);const r=_c(a._fallback,n,s);if(typeof r<"u"&&r!==n&&r!==i)return r}else if(a===!1&&typeof i<"u"&&n!==i)return null}return!1}function sa(e,t,n,i){const s=t._rootScopes,o=_c(t._fallback,n,i),a=[...e,...s],r=new Set;r.add(i);let l=xc(r,a,n,o||n,i);return l===null||typeof o<"u"&&o!==n&&(l=xc(r,a,o,l,i),l===null)?!1:na(Array.from(r),[""],s,o,()=>hx(t,n,i))}function xc(e,t,n,i,s){for(;n;)n=dx(e,t,n,i,s);return n}function hx(e,t,n){const i=e._getTarget();t in i||(i[t]={});const s=i[t];return ut(s)&&et(n)?n:s||{}}function fx(e,t,n,i){let s;for(const o of t)if(s=wc(ax(o,e),n),typeof s<"u")return ia(e,s)?sa(n,i,e,s):s}function wc(e,t){for(const n of t){if(!n)continue;const i=n[e];if(typeof i<"u")return i}}function kc(e){let t=e._keys;return t||(t=e._keys=mx(e._scopes)),t}function mx(e){const t=new Set;for(const n of e)for(const i of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function Tc(e,t,n,i){const{iScale:s}=e,{key:o="r"}=this._parsing,a=new Array(i);let r,l,c,d;for(r=0,l=i;r<l;++r)c=r+n,d=t[c],a[r]={r:s.parse(Re(d,o),c)};return a}const px=Number.EPSILON||1e-14,Pn=(e,t)=>t<e.length&&!e[t].skip&&e[t],vc=e=>e==="x"?"y":"x";function gx(e,t,n,i){const s=e.skip?t:e,o=t,a=n.skip?t:n,r=Cn(o,s),l=Cn(a,o);let c=r/(r+l),d=l/(r+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;const h=i*c,f=i*d;return{previous:{x:o.x-h*(a.x-s.x),y:o.y-h*(a.y-s.y)},next:{x:o.x+f*(a.x-s.x),y:o.y+f*(a.y-s.y)}}}function yx(e,t,n){const i=e.length;let s,o,a,r,l,c=Pn(e,0);for(let d=0;d<i-1;++d)if(l=c,c=Pn(e,d+1),!(!l||!c)){if(fi(t[d],0,px)){n[d]=n[d+1]=0;continue}s=n[d]/t[d],o=n[d+1]/t[d],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),n[d]=s*a*t[d],n[d+1]=o*a*t[d])}}function bx(e,t,n="x"){const i=vc(n),s=e.length;let o,a,r,l=Pn(e,0);for(let c=0;c<s;++c){if(a=r,r=l,l=Pn(e,c+1),!r)continue;const d=r[n],h=r[i];a&&(o=(d-a[n])/3,r[`cp1${n}`]=d-o,r[`cp1${i}`]=h-o*t[c]),l&&(o=(l[n]-d)/3,r[`cp2${n}`]=d+o,r[`cp2${i}`]=h+o*t[c])}}function _x(e,t="x"){const n=vc(t),i=e.length,s=Array(i).fill(0),o=Array(i);let a,r,l,c=Pn(e,0);for(a=0;a<i;++a)if(r=l,l=c,c=Pn(e,a+1),!!l){if(c){const d=c[t]-l[t];s[a]=d!==0?(c[n]-l[n])/d:0}o[a]=r?c?he(s[a-1])!==he(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}yx(e,s,o),bx(e,o,t)}function ks(e,t,n){return Math.max(Math.min(e,n),t)}function xx(e,t){let n,i,s,o,a,r=we(e[0],t);for(n=0,i=e.length;n<i;++n)a=o,o=r,r=n<i-1&&we(e[n+1],t),o&&(s=e[n],a&&(s.cp1x=ks(s.cp1x,t.left,t.right),s.cp1y=ks(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=ks(s.cp2x,t.left,t.right),s.cp2y=ks(s.cp2y,t.top,t.bottom)))}function wx(e,t,n,i,s){let o,a,r,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")_x(e,s);else{let c=i?e[e.length-1]:e[0];for(o=0,a=e.length;o<a;++o)r=e[o],l=gx(c,r,e[Math.min(o+1,a-(i?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&xx(e,n)}function oa(){return typeof window<"u"&&typeof document<"u"}function aa(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ts(e,t,n){let i;return typeof e=="string"?(i=parseInt(e,10),e.indexOf("%")!==-1&&(i=i/100*t.parentNode[n])):i=e,i}const vs=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function kx(e,t){return vs(e).getPropertyValue(t)}const Tx=["top","right","bottom","left"];function nn(e,t,n){const i={};n=n?"-"+n:"";for(let s=0;s<4;s++){const o=Tx[s];i[o]=parseFloat(e[t+"-"+o+n])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const vx=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Sx(e,t){const n=e.touches,i=n&&n.length?n[0]:e,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(vx(s,o,e.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function ze(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:i}=t,s=vs(n),o=s.boxSizing==="border-box",a=nn(s,"padding"),r=nn(s,"border","width"),{x:l,y:c,box:d}=Sx(e,n),h=a.left+(d&&r.left),f=a.top+(d&&r.top);let{width:m,height:p}=t;return o&&(m-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-h)/m*n.width/i),y:Math.round((c-f)/p*n.height/i)}}function Mx(e,t,n){let i,s;if(t===void 0||n===void 0){const o=e&&aa(e);if(!o)t=e.clientWidth,n=e.clientHeight;else{const a=o.getBoundingClientRect(),r=vs(o),l=nn(r,"border","width"),c=nn(r,"padding");t=a.width-c.width-l.width,n=a.height-c.height-l.height,i=Ts(r.maxWidth,o,"clientWidth"),s=Ts(r.maxHeight,o,"clientHeight")}}return{width:t,height:n,maxWidth:i||ms,maxHeight:s||ms}}const Fe=e=>Math.round(e*10)/10;function Dx(e,t,n,i){const s=vs(e),o=nn(s,"margin"),a=Ts(s.maxWidth,e,"clientWidth")||ms,r=Ts(s.maxHeight,e,"clientHeight")||ms,l=Mx(e,t,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const f=nn(s,"border","width"),m=nn(s,"padding");c-=m.width+f.width,d-=m.height+f.height}return c=Math.max(0,c-o.width),d=Math.max(0,i?c/i:d-o.height),c=Fe(Math.min(c,a,l.maxWidth)),d=Fe(Math.min(d,r,l.maxHeight)),c&&!d&&(d=Fe(c/2)),(t!==void 0||n!==void 0)&&i&&l.height&&d>l.height&&(d=l.height,c=Fe(Math.floor(d*i))),{width:c,height:d}}function Sc(e,t,n){const i=t||1,s=Fe(e.height*i),o=Fe(e.width*i);e.height=Fe(e.height),e.width=Fe(e.width);const a=e.canvas;return a.style&&(n||!a.style.height&&!a.style.width)&&(a.style.height=`${e.height}px`,a.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(e.currentDevicePixelRatio=i,a.height=s,a.width=o,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Cx=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};oa()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Mc(e,t){const n=kx(e,t),i=n&&n.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function sn(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function Ox(e,t,n,i){return{x:e.x+n*(t.x-e.x),y:i==="middle"?n<.5?e.y:t.y:i==="after"?n<1?e.y:t.y:n>0?t.y:e.y}}function Ax(e,t,n,i){const s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},a=sn(e,s,n),r=sn(s,o,n),l=sn(o,t,n),c=sn(a,r,n),d=sn(r,l,n);return sn(c,d,n)}const Px=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,i){return n-i},leftForLtr(n,i){return n-i}}},Ex=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function En(e,t,n){return e?Px(t,n):Ex()}function Dc(e,t){let n,i;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,i=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=i)}function Cc(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Oc(e){return e==="angle"?{between:mi,compare:R_,normalize:Vt}:{between:_e,compare:(t,n)=>t-n,normalize:t=>t}}function Ac({start:e,end:t,count:n,loop:i,style:s}){return{start:e%n,end:t%n,loop:i&&(t-e+1)%n===0,style:s}}function Rx(e,t,n){const{property:i,start:s,end:o}=n,{between:a,normalize:r}=Oc(i),l=t.length;let{start:c,end:d,loop:h}=e,f,m;if(h){for(c+=l,d+=l,f=0,m=l;f<m&&a(r(t[c%l][i]),s,o);++f)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:h,style:e.style}}function Pc(e,t,n){if(!n)return[e];const{property:i,start:s,end:o}=n,a=t.length,{compare:r,between:l,normalize:c}=Oc(i),{start:d,end:h,loop:f,style:m}=Rx(e,t,n),p=[];let g=!1,y=null,_,x,T;const k=()=>l(s,T,_)&&r(s,T)!==0,w=()=>r(o,_)===0||l(o,T,_),O=()=>g||k(),S=()=>!g||w();for(let A=d,R=d;A<=h;++A)x=t[A%a],!x.skip&&(_=c(x[i]),_!==T&&(g=l(_,s,o),y===null&&O()&&(y=r(_,s)===0?A:R),y!==null&&S()&&(p.push(Ac({start:y,end:A,loop:f,count:a,style:m})),y=null),R=A,T=_));return y!==null&&p.push(Ac({start:y,end:h,loop:f,count:a,style:m})),p}function Ec(e,t){const n=[],i=e.segments;for(let s=0;s<i.length;s++){const o=Pc(i[s],e.points,t);o.length&&n.push(...o)}return n}function Ix(e,t,n,i){let s=0,o=t-1;if(n&&!i)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,n&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Lx(e,t,n,i){const s=e.length,o=[];let a=t,r=e[t],l;for(l=t+1;l<=n;++l){const c=e[l%s];c.skip||c.stop?r.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function Nx(e,t){const n=e.points,i=e.options.spanGaps,s=n.length;if(!s)return[];const o=!!e._loop,{start:a,end:r}=Ix(n,s,o,i);if(i===!0)return Rc(e,[{start:a,end:r,loop:o}],n,t);const l=r<a?r+s:r,c=!!e._fullLoop&&a===0&&r===s-1;return Rc(e,Lx(n,a,l,c),n,t)}function Rc(e,t,n,i){return!i||!i.setContext||!n?t:Bx(e,t,n,i)}function Bx(e,t,n,i){const s=e._chart.getContext(),o=Ic(e.options),{_datasetIndex:a,options:{spanGaps:r}}=e,l=n.length,c=[];let d=o,h=t[0].start,f=h;function m(p,g,y,_){const x=r?-1:1;if(p!==g){for(p+=l;n[p%l].skip;)p-=x;for(;n[g%l].skip;)g+=x;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:y,style:_}),d=_,h=g%l)}}for(const p of t){h=r?h:p.start;let g=n[h%l],y;for(f=h+1;f<=p.end;f++){const _=n[f%l];y=Ic(i.setContext(Be(s,{type:"segment",p0:g,p1:_,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),zx(y,d)&&m(h,f-1,p.loop,d),g=_,d=y}h<f-1&&m(h,f-1,p.loop,d)}return c}function Ic(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function zx(e,t){if(!t)return!1;const n=[],i=function(s,o){return Ko(o)?(n.includes(o)||n.push(o),n.indexOf(o)):o};return JSON.stringify(e,i)!==JSON.stringify(t,i)}function Ss(e,t,n){return e.options.clip?e[n]:t[n]}function Fx(e,t){const{xScale:n,yScale:i}=e;return n&&i?{left:Ss(n,t,"left"),right:Ss(n,t,"right"),top:Ss(i,t,"top"),bottom:Ss(i,t,"bottom")}:t}function Lc(e,t){const n=t._clip;if(n.disabled)return!1;const i=Fx(t,e.chartArea);return{left:n.left===!1?0:i.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:i.right+(n.right===!0?0:n.right),top:n.top===!1?0:i.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:i.bottom+(n.bottom===!0?0:n.bottom)}}class Ux{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,i,s){const o=n.listeners[s],a=n.duration;o.forEach(r=>r({chart:t,initial:n.initial,numSteps:a,currentStep:Math.min(i-n.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=ac.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),n+=o.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let i=n.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,i)),i}listen(t,n,i){this._getAnims(t).listeners[n].push(i)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const i=n.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ke=new Ux;const Nc="transparent",Vx={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const i=_s(e||Nc),s=i.valid&&_s(t||Nc);return s&&s.valid?s.mix(i,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class Hx{constructor(t,n,i,s){const o=n[i];s=xi([t.to,s,o,t.from]);const a=xi([t.from,o,s]);this._active=!0,this._fn=t.fn||Vx[t.type||typeof a],this._easing=pi[t.easing]||pi.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=xi([t.to,n,s,t.from]),this._from=xi([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||n<i),!this._active){this._target[s]=r,this._notify(!0);return}if(n<0){this._target[s]=o;return}l=n/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,i)=>{t.push({res:n,rej:i})})}_notify(t){const n=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][n]()}}class ra{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!et(t))return;const n=Object.keys(bt.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!et(o))return;const a={};for(const r of n)a[r]=o[r];(ut(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,n){const i=n.options,s=Yx(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&$x(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,n){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(n),r=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,n));continue}const d=n[c];let h=o[c];const f=i.get(c);if(h)if(f&&h.active()){h.update(f,d,r);continue}else h.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=h=new Hx(f,t,c,d),s.push(h)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const i=this._createAnimations(t,n);if(i.length)return ke.add(this._chart,i),!0}}function $x(e,t){const n=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=e[i[s]];o&&o.active()&&n.push(o.wait())}return Promise.all(n)}function Yx(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function Bc(e,t){const n=e&&e.options||{},i=n.reverse,s=n.min===void 0?t:0,o=n.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function Wx(e,t,n){if(n===!1)return!1;const i=Bc(e,n),s=Bc(t,n);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function jx(e){let t,n,i,s;return et(e)?(t=e.top,n=e.right,i=e.bottom,s=e.left):t=n=i=s=e,{top:t,right:n,bottom:i,left:s,disabled:e===!1}}function zc(e,t){const n=[],i=e._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)n.push(i[s].index);return n}function Fc(e,t,n,i={}){const s=e.keys,o=i.mode==="single";let a,r,l,c;if(t===null)return;let d=!1;for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===n){if(d=!0,i.all)continue;break}c=e.values[l],_t(c)&&(o||t===0||he(t)===he(c))&&(t+=c)}return!d&&!i.all?0:t}function qx(e,t){const{iScale:n,vScale:i}=t,s=n.axis==="x"?"x":"y",o=i.axis==="x"?"x":"y",a=Object.keys(e),r=new Array(a.length);let l,c,d;for(l=0,c=a.length;l<c;++l)d=a[l],r[l]={[s]:d,[o]:e[d]};return r}function la(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function Gx(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function Xx(e){const{min:t,max:n,minDefined:i,maxDefined:s}=e.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Kx(e,t,n){const i=e[t]||(e[t]={});return i[n]||(i[n]={})}function Uc(e,t,n,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=e[s.index];if(n&&o>0||!n&&o<0)return s.index}return null}function Vc(e,t){const{chart:n,_cachedMeta:i}=e,s=n._stacks||(n._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,d=Gx(o,a,i),h=t.length;let f;for(let m=0;m<h;++m){const p=t[m],{[l]:g,[c]:y}=p,_=p._stacks||(p._stacks={});f=_[c]=Kx(s,d,g),f[r]=y,f._top=Uc(f,a,!0,i.type),f._bottom=Uc(f,a,!1,i.type);const x=f._visualValues||(f._visualValues={});x[r]=y}}function ca(e,t){const n=e.scales;return Object.keys(n).filter(i=>n[i].axis===t).shift()}function Zx(e,t){return Be(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Qx(e,t,n){return Be(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function wi(e,t){const n=e.controller.index,i=e.vScale&&e.vScale.axis;if(i){t=t||e._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][n]===void 0)return;delete o[i][n],o[i]._visualValues!==void 0&&o[i]._visualValues[n]!==void 0&&delete o[i]._visualValues[n]}}}const ua=e=>e==="reset"||e==="none",Hc=(e,t)=>t?e:Object.assign({},e),Jx=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:zc(n,!0),values:null};class Ue{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=la(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&wi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,i=this.getDataset(),s=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,o=n.xAxisID=Q(i.xAxisID,ca(t,"x")),a=n.yAxisID=Q(i.yAxisID,ca(t,"y")),r=n.rAxisID=Q(i.rAxisID,ca(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,o,a,r),d=n.vAxisID=s(l,a,o,r);n.xScale=this.getScaleForId(o),n.yScale=this.getScaleForId(a),n.rScale=this.getScaleForId(r),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&sc(this._data,this),t._stacked&&wi(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),i=this._data;if(et(n)){const s=this._cachedMeta;this._data=qx(n,s)}else if(i!==n){if(i){sc(i,this);const s=this._cachedMeta;wi(s),s._parsed=[]}n&&Object.isExtensible(n)&&B_(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,i=this.getDataset();let s=!1;this._dataCheck();const o=n._stacked;n._stacked=la(n.vScale,n),n.stack!==i.stack&&(s=!0,wi(n),n.stack=i.stack),this._resyncElements(t),(s||o!==n._stacked)&&(Vc(this,n._parsed),n._stacked=la(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l=t===0&&n===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],d,h,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{ut(s[t])?f=this.parseArrayData(i,s,t,n):et(s[t])?f=this.parseObjectData(i,s,t,n):f=this.parsePrimitiveData(i,s,t,n);const m=()=>h[r]===null||c&&h[r]<c[r];for(d=0;d<n;++d)i._parsed[d+t]=h=f[d],l&&(m()&&(l=!1),c=h);i._sorted=l}a&&Vc(this,f)}parsePrimitiveData(t,n,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),d=o===a,h=new Array(s);let f,m,p;for(f=0,m=s;f<m;++f)p=f+i,h[f]={[r]:d||o.parse(c[p],p),[l]:a.parse(n[p],p)};return h}parseArrayData(t,n,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,d,h;for(l=0,c=s;l<c;++l)d=l+i,h=n[d],r[l]={x:o.parse(h[0],d),y:a.parse(h[1],d)};return r}parseObjectData(t,n,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,h,f,m;for(d=0,h=s;d<h;++d)f=d+i,m=n[f],c[d]={x:o.parse(Re(m,r),f),y:a.parse(Re(m,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,i){const s=this.chart,o=this._cachedMeta,a=n[t.axis],r={keys:zc(s,!0),values:n._stacks[t.axis]._visualValues};return Fc(r,a,o.index,{mode:i})}updateRangeFromParsed(t,n,i,s){const o=i[n.axis];let a=o===null?NaN:o;const r=s&&i._stacks[n.axis];s&&r&&(s.values=r,a=Fc(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,n){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=Jx(n,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:h}=Xx(r);let f,m;function p(){m=s[f];const g=m[r.axis];return!_t(m[t.axis])||d>g||h<g}for(f=0;f<a&&!(!p()&&(this.updateRangeFromParsed(c,t,m,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(c,t,m,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=n.length;s<o;++s)a=n[s][t.axis],_t(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,i=n.iScale,s=n.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=jx(Q(this.options.clip,Wx(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,i=this._cachedMeta,s=i.data||[],o=n.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let d;for(i.dataset&&i.dataset.draw(t,o,r,l),d=r;d<r+l;++d){const h=s[d];h.hidden||(h.active&&c?a.push(h):h.draw(t,o))}for(d=0;d<a.length;++d)a[d].draw(t,o)}getStyle(t,n){const i=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,n,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Qx(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Zx(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!n,o.mode=i,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",i){const s=n==="active",o=this._cachedDataOpts,a=t+"-"+n,r=o[a],l=this.enableOptionSharing&&Xt(i);if(r)return Hc(r,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),h=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),d),m=Object.keys(bt.elements[t]),p=()=>this.getContext(i,s,n),g=c.resolveNamedOptions(f,m,p,h);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(Hc(g,l))),g}_resolveAnimations(t,n,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${n}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const d=this.chart.config,h=d.datasetAnimationScopeKeys(this._type,n),f=d.getOptionScopes(this.getDataset(),h);l=d.createResolver(f,this.getContext(t,i,n))}const c=new ra(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||ua(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const i=this.resolveDataElementOptions(t,n),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(n,o)||o!==s;return this.updateSharedOptions(o,n,i),{sharedOptions:o,includeOptions:a}}updateElement(t,n,i,s){ua(s)?Object.assign(t,i):this._resolveAnimations(n,s).update(t,i)}updateSharedOptions(t,n,i){t&&!ua(n)&&this._resolveAnimations(void 0,n).update(t,i)}_setStyle(t,n,i,s){t.active=s;const o=this.getStyle(n,s);this._resolveAnimations(n,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,n,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,n,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,i=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=i.length,o=n.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,n,i=!0){const s=this._cachedMeta,o=s.data,a=t+n;let r;const l=c=>{for(c.length+=n,r=c.length-1;r>=a;r--)c[r]=c[r-n]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),i&&this.updateElements(o,t,n,"reset")}updateElements(t,n,i,s){}_removeElements(t,n){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,n);i._stacked&&wi(i,s)}i.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,i,s]=t;this[n](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,n){n&&this._sync(["_removeElements",t,n]);const i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}function tw(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=n.length;s<o;s++)i=i.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=oc(i.sort((s,o)=>s-o))}return e._cache.$bar}function ew(e){const t=e.iScale,n=tw(t,e.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(Xt(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(s=0,o=n.length;s<o;++s)a=t.getPixelForValue(n[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return i}function nw(e,t,n,i){const s=n.barThickness;let o,a;return Z(s)?(o=t.min*n.categoryPercentage,a=n.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[e]-o/2}}function iw(e,t,n,i){const s=t.pixels,o=s[e];let a=e>0?s[e-1]:null,r=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:n.barPercentage,start:c}}function sw(e,t,n,i){const s=n.parse(e[0],i),o=n.parse(e[1],i),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function $c(e,t,n,i){return ut(e)?sw(e,t,n,i):t[n.axis]=n.parse(e,i),t}function Yc(e,t,n,i){const s=e.iScale,o=e.vScale,a=s.getLabels(),r=s===o,l=[];let c,d,h,f;for(c=n,d=n+i;c<d;++c)f=t[c],h={},h[s.axis]=r||s.parse(a[c],c),l.push($c(f,h,o,c));return l}function da(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function ow(e,t,n){return e!==0?he(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function aw(e){let t,n,i,s,o;return e.horizontal?(t=e.base>e.x,n="left",i="right"):(t=e.base<e.y,n="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:n,end:i,reverse:t,top:s,bottom:o}}function rw(e,t,n,i){let s=t.borderSkipped;const o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:d}=aw(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===i?s=c:(n._bottom||0)===i?s=d:(o[Wc(d,a,r,l)]=!0,s=c)),o[Wc(s,a,r,l)]=!0,e.borderSkipped=o}function Wc(e,t,n,i){return i?(e=lw(e,t,n),e=jc(e,n,t)):e=jc(e,t,n),e}function lw(e,t,n){return e===t?n:e===n?t:e}function jc(e,t,n){return e==="start"?t:e==="end"?n:e}function cw(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class qc extends Ue{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,n,i,s){return Yc(t,n,i,s)}parseArrayData(t,n,i,s){return Yc(t,n,i,s)}parseObjectData(t,n,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,d=a.axis==="x"?r:l,h=[];let f,m,p,g;for(f=i,m=i+s;f<m;++f)g=n[f],p={},p[o.axis]=o.parse(Re(g,c),f),h.push($c(Re(g,d),p,a,f));return h}updateRangeFromParsed(t,n,i,s){super.updateRangeFromParsed(t,n,i,s);const o=i._custom;o&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:i,vScale:s}=n,o=this.getParsed(t),a=o._custom,r=da(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),d=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(n,s);for(let m=n;m<n+i;m++){const p=this.getParsed(m),g=o||Z(p[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,d),_=(p._stacks||{})[r.axis],x={horizontal:c,base:g.base,enableBorderRadius:!_||da(p._custom)||a===_._top||a===_._bottom,x:c?g.head:y.center,y:c?y.center:g.head,height:c?y.size:Math.abs(g.size),width:c?Math.abs(g.size):y.size};f&&(x.options=h||this.resolveDataElementOptions(m,t[m].active?"active":s));const T=x.options||t[m].options;rw(x,T,_,a),cw(x,T,d.ratio),this.updateElement(t[m],m,x,s)}}_getStacks(t,n){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=i.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(n),l=r&&r[i.axis],c=d=>{const h=d._parsed.find(m=>m[i.axis]===l),f=h&&h[d.vScale.axis];if(Z(f)||isNaN(f))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((o===!1||a.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&a.push(d.stack),d.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(i=>t[i].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const i of this.chart.data.datasets)t[Q(this.chart.options.indexAxis==="x"?i.xAxisID:i.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,i){const s=this._getStacks(t,i),o=n!==void 0?s.indexOf(n):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,n=this._cachedMeta,i=n.iScale,s=[];let o,a;for(o=0,a=n.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||ew(n),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,d=da(c);let h=l[n.axis],f=0,m=i?this.applyStack(n,l,i):h,p,g;m!==h&&(f=m-h,m=h),d&&(h=c.barStart,m=c.barEnd-c.barStart,h!==0&&he(h)!==he(c.barEnd)&&(f=0),f+=h);const y=!Z(o)&&!d?o:f;let _=n.getPixelForValue(y);if(this.chart.getDataVisibility(t)?p=n.getPixelForValue(f+m):p=_,g=p-_,Math.abs(g)<a){g=ow(g,n,r)*a,h===r&&(_-=g/2);const x=n.getPixelForDecimal(0),T=n.getPixelForDecimal(1),k=Math.min(x,T),w=Math.max(x,T);_=Math.max(Math.min(_,w),k),p=_+g,i&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(p)-n.getValueForPixel(_))}if(_===n.getPixelForValue(r)){const x=he(g)*n.getLineWidthForValue(r)/2;_+=x,g-=x}return{size:g,base:_,head:p,center:p+g/2}}_calculateBarIndexPixels(t,n){const i=n.scale,s=this.options,o=s.skipNull,a=Q(s.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(n.grouped){const d=o?this._getStackCount(t):n.stackCount,h=s.barThickness==="flex"?iw(t,n,s,d*c):nw(t,n,s,d*c),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Q(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+m;r=h.start+h.chunk*p+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,n.min*n.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[n.axis]!==null&&!i[o].hidden&&i[o].draw(this._ctx)}}class uw extends Ue{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,n,i,s){const o=super.parsePrimitiveData(t,n,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(t,n,i,s){const o=super.parseArrayData(t,n,i,s);for(let a=0;a<o.length;a++){const r=n[i+a];o[a]._custom=Q(r[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(t,n,i,s){const o=super.parseObjectData(t,n,i,s);for(let a=0;a<o.length;a++){const r=n[i+a];o[a]._custom=Q(r&&r.r&&+r.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let n=0;for(let i=t.length-1;i>=0;--i)n=Math.max(n,t[i].size(this.resolveDataElementOptions(i))/2);return n>0&&n}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const n=this._cachedMeta.data;this.updateElements(n,0,n.length,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(n,s),d=a.axis,h=r.axis;for(let f=n;f<n+i;f++){const m=t[f],p=!o&&this.getParsed(f),g={},y=g[d]=o?a.getPixelForDecimal(.5):a.getPixelForValue(p[d]),_=g[h]=o?r.getBasePixel():r.getPixelForValue(p[h]);g.skip=isNaN(y)||isNaN(_),c&&(g.options=l||this.resolveDataElementOptions(f,m.active?"active":s),o&&(g.options.radius=0)),this.updateElement(m,f,g,s)}}resolveDataElementOptions(t,n){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,n);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return n!=="active"&&(s.radius=0),s.radius+=Q(i&&i._custom,o),s}}function dw(e,t,n){let i=1,s=1,o=0,a=0;if(t<gt){const r=e,l=r+t,c=Math.cos(r),d=Math.sin(r),h=Math.cos(l),f=Math.sin(l),m=(T,k,w)=>mi(T,r,l,!0)?1:Math.max(k,k*n,w,w*n),p=(T,k,w)=>mi(T,r,l,!0)?-1:Math.min(k,k*n,w,w*n),g=m(0,c,h),y=m(yt,d,f),_=p(tt,c,h),x=p(tt+yt,d,f);i=(g-_)/2,s=(y-x)/2,o=-(g+_)/2,a=-(y+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class ki extends Ue{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const h=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:h.backgroundColor,fontColor:o,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&&(r||h.borderRadius),index:c}}):[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}}};constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(et(i[t])){const{key:l="value"}=this._parsing;o=c=>+Re(i[c],l)}let a,r;for(a=t,r=t+n;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return Ot(this.options.rotation-90)}_getCircumference(){return Ot(this.options.circumference)}_getRotationExtents(){let t=gt,n=-gt;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,o=s._getRotation(),a=s._getCircumference();t=Math.min(t,o),n=Math.max(n,o+a)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:i}=n,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(T_(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:d,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:g}=dw(h,d,l),y=(i.width-a)/f,_=(i.height-a)/m,x=Math.max(Math.min(y,_)/2,0),T=Kl(this.options.radius,x),k=Math.max(T*l,0),w=(T-k)/this._getVisibleDatasetWeightTotal();this.offsetX=p*T,this.offsetY=g*T,s.total=this.calculateTotal(),this.outerRadius=T-w*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-w*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,n){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return n&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/gt)}updateElements(t,n,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,d=(r.left+r.right)/2,h=(r.top+r.bottom)/2,f=o&&c.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:g,includeOptions:y}=this._getSharedOptions(n,s);let _=this._getRotation(),x;for(x=0;x<n;++x)_+=this._circumference(x,o);for(x=n;x<n+i;++x){const T=this._circumference(x,o),k=t[x],w={x:d+this.offsetX,y:h+this.offsetY,startAngle:_,endAngle:_+T,circumference:T,outerRadius:p,innerRadius:m};y&&(w.options=g||this.resolveDataElementOptions(x,k.active?"active":s)),_+=T,this.updateElement(k,x,w,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let i=0,s;for(s=0;s<n.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?gt*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=gi(n._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let n=0;const i=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);n=Math.max(n,o.offset||0,o.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(n+=this._getRingWeight(i));return n}_getRingWeight(t){return Math.max(Q(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}class Gc extends Ue{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const n=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=n,a=this.chart._animationsDisabled;let{start:r,count:l}=lc(n,s,a);this._drawStart=r,this._drawCount=l,cc(n)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._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,r,l,t)}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:h}=this._getSharedOptions(n,s),f=a.axis,m=r.axis,{spanGaps:p,segment:g}=this.options,y=Le(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",x=n+i,T=t.length;let k=n>0&&this.getParsed(n-1);for(let w=0;w<T;++w){const O=t[w],S=_?O:{};if(w<n||w>=x){S.skip=!0;continue}const A=this.getParsed(w),R=Z(A[m]),D=S[f]=a.getPixelForValue(A[f],w),v=S[m]=o||R?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,A,l):A[m],w);S.skip=isNaN(D)||isNaN(v)||R,S.stop=w>0&&Math.abs(A[f]-k[f])>y,g&&(S.parsed=A,S.raw=c.data[w]),h&&(S.options=d||this.resolveDataElementOptions(w,O.active?"active":s)),_||this.updateElement(O,w,S,s),k=A}}getMaxOverflow(){const t=this._cachedMeta,n=t.dataset,i=n.options&&n.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class Xc extends Ue{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data;if(n.labels.length&&n.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return n.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,n,i){i.chart.toggleDataVisibility(n.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,n){super(t,n),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const n=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=gi(n._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,n,i,s){return Tc.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta.data;this._updateRadius(),this.updateElements(n,0,n.length,t)}getMinMax(){const t=this._cachedMeta,n={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<n.min&&(n.min=o),o>n.max&&(n.max=o))}),n}_updateRadius(){const t=this.chart,n=t.chartArea,i=t.options,s=Math.min(n.right-n.left,n.bottom-n.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,n,i,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,h=c.yCenter,f=c.getIndexAngle(0)-.5*tt;let m=f,p;const g=360/this.countVisibleElements();for(p=0;p<n;++p)m+=this._computeAngle(p,s,g);for(p=n;p<n+i;p++){const y=t[p];let _=m,x=m+this._computeAngle(p,s,g),T=a.getDataVisibility(p)?c.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=x,o&&(l.animateScale&&(T=0),l.animateRotate&&(_=x=f));const k={x:d,y:h,innerRadius:0,outerRadius:T,startAngle:_,endAngle:x,options:this.resolveDataElementOptions(p,y.active?"active":s)};this.updateElement(y,p,k,s)}}countVisibleElements(){const t=this._cachedMeta;let n=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&n++}),n}_computeAngle(t,n,i){return this.chart.getDataVisibility(t)?Ot(this.resolveDataElementOptions(t,n).angle||i):0}}class hw extends ki{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}class fw extends Ue{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){const n=this._cachedMeta.vScale,i=this.getParsed(t);return{label:n.getLabels()[t],value:""+n.getLabelForValue(i[n.axis])}}parseObjectData(t,n,i,s){return Tc.bind(this)(t,n,i,s)}update(t){const n=this._cachedMeta,i=n.dataset,s=n.data||[],o=n.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,n,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=n;r<n+i;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),d=o.getPointPositionForValue(r,this.getParsed(r).r),h=a?o.xCenter:d.x,f=a?o.yCenter:d.y,m={x:h,y:f,angle:d.angle,skip:isNaN(h)||isNaN(f),options:c};this.updateElement(l,r,m,s)}}}class Kc extends Ue{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const n=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=n,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+l+")"}}update(t){const n=this._cachedMeta,{data:i=[]}=n,s=this.chart._animationsDisabled;let{start:o,count:a}=lc(n,i,s);if(this._drawStart=o,this._drawCount=a,cc(n)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=n;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete n.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,n,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(n,s),h=this.getSharedOptions(d),f=this.includeOptions(s,h),m=a.axis,p=r.axis,{spanGaps:g,segment:y}=this.options,_=Le(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let T=n>0&&this.getParsed(n-1);for(let k=n;k<n+i;++k){const w=t[k],O=this.getParsed(k),S=x?w:{},A=Z(O[p]),R=S[m]=a.getPixelForValue(O[m],k),D=S[p]=o||A?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,O,l):O[p],k);S.skip=isNaN(R)||isNaN(D)||A,S.stop=k>0&&Math.abs(O[m]-T[m])>_,y&&(S.parsed=O,S.raw=c.data[k]),f&&(S.options=h||this.resolveDataElementOptions(k,w.active?"active":s)),x||this.updateElement(w,k,S,s),T=O}this.updateSharedOptions(h,s,d)}getMaxOverflow(){const t=this._cachedMeta,n=t.data||[];if(!this.options.showLine){let r=0;for(let l=n.length-1;l>=0;--l)r=Math.max(r,n[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}}var mw=Object.freeze({__proto__:null,BarController:qc,BubbleController:uw,DoughnutController:ki,LineController:Gc,PieController:hw,PolarAreaController:Xc,RadarController:fw,ScatterController:Kc});function on(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ha{static override(t){Object.assign(ha.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return on()}parse(){return on()}format(){return on()}add(){return on()}diff(){return on()}startOf(){return on()}endOf(){return on()}}var Zc={_date:ha};function pw(e,t,n,i){const{controller:s,data:o,_sorted:a}=e,r=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?L_:xe;if(i){if(s._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(o,t,n-h),m=c(o,t,n+h);return{lo:f.lo,hi:m.hi}}}}else{const d=c(o,t,n);if(l){const{vScale:h}=s._cachedMeta,{_parsed:f}=e,m=f.slice(0,d.lo+1).reverse().findIndex(g=>!Z(g[h.axis]));d.lo-=Math.max(0,m);const p=f.slice(d.hi).findIndex(g=>!Z(g[h.axis]));d.hi+=Math.max(0,p)}return d}}return{lo:0,hi:o.length-1}}function Ti(e,t,n,i,s){const o=e.getSortedVisibleDatasetMetas(),a=n[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:d}=o[r],{lo:h,hi:f}=pw(o[r],t,a,s);for(let m=h;m<=f;++m){const p=d[m];p.skip||i(p,c,m)}}}function gw(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,a=n?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function fa(e,t,n,i,s){const o=[];return!s&&!e.isPointInArea(t)||Ti(e,n,t,function(r,l,c){!s&&!we(r,e.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function yw(e,t,n,i){let s=[];function o(a,r,l){const{startAngle:c,endAngle:d}=a.getProps(["startAngle","endAngle"],i),{angle:h}=ys(a,{x:t.x,y:t.y});mi(h,c,d)&&s.push({element:a,datasetIndex:r,index:l})}return Ti(e,n,t,o),s}function bw(e,t,n,i,s,o){let a=[];const r=gw(n);let l=Number.POSITIVE_INFINITY;function c(d,h,f){const m=d.inRange(t.x,t.y,s);if(i&&!m)return;const p=d.getCenterPoint(s);if(!(!!o||e.isPointInArea(p))&&!m)return;const y=r(t,p);y<l?(a=[{element:d,datasetIndex:h,index:f}],l=y):y===l&&a.push({element:d,datasetIndex:h,index:f})}return Ti(e,n,t,c),a}function ma(e,t,n,i,s,o){return!o&&!e.isPointInArea(t)?[]:n==="r"&&!i?yw(e,t,n,s):bw(e,t,n,i,s,o)}function Qc(e,t,n,i,s){const o=[],a=n==="x"?"inXRange":"inYRange";let r=!1;return Ti(e,n,t,(l,c,d)=>{l[a]&&l[a](t[n],s)&&(o.push({element:l,datasetIndex:c,index:d}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var pa={evaluateInteractionItems:Ti,modes:{index(e,t,n,i){const s=ze(t,e),o=n.axis||"x",a=n.includeInvisible||!1,r=n.intersect?fa(e,s,o,i,a):ma(e,s,o,!1,i,a),l=[];return r.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=r[0].index,h=c.data[d];h&&!h.skip&&l.push({element:h,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,i){const s=ze(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;let r=n.intersect?fa(e,s,o,i,a):ma(e,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=e.getDatasetMeta(l).data;r=[];for(let d=0;d<c.length;++d)r.push({element:c[d],datasetIndex:l,index:d})}return r},point(e,t,n,i){const s=ze(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return fa(e,s,o,i,a)},nearest(e,t,n,i){const s=ze(t,e),o=n.axis||"xy",a=n.includeInvisible||!1;return ma(e,s,o,n.intersect,i,a)},x(e,t,n,i){const s=ze(t,e);return Qc(e,s,"x",n.intersect,i)},y(e,t,n,i){const s=ze(t,e);return Qc(e,s,"y",n.intersect,i)}}};const Jc=["left","top","right","bottom"];function vi(e,t){return e.filter(n=>n.pos===t)}function tu(e,t){return e.filter(n=>Jc.indexOf(n.pos)===-1&&n.box.axis===t)}function Si(e,t){return e.sort((n,i)=>{const s=t?i:n,o=t?n:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function _w(e){const t=[];let n,i,s,o,a,r;for(n=0,i=(e||[]).length;n<i;++n)s=e[n],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:n,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function xw(e){const t={};for(const n of e){const{stack:i,pos:s,stackWeight:o}=n;if(!i||!Jc.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function ww(e,t){const n=xw(e),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=e.length;o<a;++o){r=e[o];const{fullSize:l}=r.box,c=n[r.stack],d=c&&r.stackWeight/c.weight;r.horizontal?(r.width=d?d*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=d?d*s:l&&t.availableHeight)}return n}function kw(e){const t=_w(e),n=Si(t.filter(c=>c.box.fullSize),!0),i=Si(vi(t,"left"),!0),s=Si(vi(t,"right")),o=Si(vi(t,"top"),!0),a=Si(vi(t,"bottom")),r=tu(t,"x"),l=tu(t,"y");return{fullSize:n,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:vi(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function eu(e,t,n,i){return Math.max(e[n],t[n])+Math.max(e[i],t[i])}function nu(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Tw(e,t,n,i){const{pos:s,box:o}=n,a=e.maxPadding;if(!et(s)){n.size&&(e[s]-=n.size);const h=i[n.stack]||{size:0,count:1};h.size=Math.max(h.size,n.horizontal?o.height:o.width),n.size=h.size/h.count,e[s]+=n.size}o.getPadding&&nu(a,o.getPadding());const r=Math.max(0,t.outerWidth-eu(a,e,"left","right")),l=Math.max(0,t.outerHeight-eu(a,e,"top","bottom")),c=r!==e.w,d=l!==e.h;return e.w=r,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function vw(e){const t=e.maxPadding;function n(i){const s=Math.max(t[i]-e[i],0);return e[i]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function Sw(e,t){const n=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],n[a])}),o}return i(e?["left","right"]:["top","bottom"])}function Mi(e,t,n,i){const s=[];let o,a,r,l,c,d;for(o=0,a=e.length,c=0;o<a;++o){r=e[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Sw(r.horizontal,t));const{same:h,other:f}=Tw(t,n,r,i);c|=h&&s.length,d=d||f,l.fullSize||s.push(r)}return c&&Mi(s,t,n,i)||d}function Ms(e,t,n,i,s){e.top=n,e.left=t,e.right=t+i,e.bottom=n+s,e.width=i,e.height=s}function iu(e,t,n,i){const s=n.padding;let{x:o,y:a}=t;for(const r of e){const l=r.box,c=i[r.stack]||{placed:0,weight:1},d=r.stackWeight/c.weight||1;if(r.horizontal){const h=t.w*d,f=c.size||l.height;Xt(c.start)&&(a=c.start),l.fullSize?Ms(l,s.left,a,n.outerWidth-s.right-s.left,f):Ms(l,t.left+c.placed,a,h,f),c.start=a,c.placed+=h,a=l.bottom}else{const h=t.h*d,f=c.size||l.width;Xt(c.start)&&(o=c.start),l.fullSize?Ms(l,o,s.top,f,n.outerHeight-s.bottom-s.top):Ms(l,o,t.top+c.placed,f,h),c.start=o,c.placed+=h,o=l.right}}t.x=o,t.y=a}var $t={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,i){if(!e)return;const s=At(e.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(n-s.height,0),r=kw(e.boxes),l=r.vertical,c=r.horizontal;mt(e.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const d=l.reduce((g,y)=>y.box.options&&y.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),f=Object.assign({},s);nu(f,At(i));const m=Object.assign({maxPadding:f,w:o,h:a,x:s.left,y:s.top},s),p=ww(l.concat(c),h);Mi(r.fullSize,m,h,p),Mi(l,m,h,p),Mi(c,m,h,p)&&Mi(l,m,h,p),vw(m),iu(r.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,iu(r.rightAndBottom,m,h,p),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},mt(r.chartArea,g=>{const y=g.box;Object.assign(y,e.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class su{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,i){}removeEventListener(t,n,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,i,s){return n=Math.max(0,n||t.width),i=i||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Mw extends su{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ds="$chartjs",Dw={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ou=e=>e===null||e==="";function Cw(e,t){const n=e.style,i=e.getAttribute("height"),s=e.getAttribute("width");if(e[Ds]={initial:{height:i,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",ou(s)){const o=Mc(e,"width");o!==void 0&&(e.width=o)}if(ou(i))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Mc(e,"height");o!==void 0&&(e.height=o)}return e}const au=Cx?{passive:!0}:!1;function Ow(e,t,n){e&&e.addEventListener(t,n,au)}function Aw(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,au)}function Pw(e,t){const n=Dw[e.type]||e.type,{x:i,y:s}=ze(e,t);return{type:n,chart:t,native:e,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Cs(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function Ew(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Cs(r.addedNodes,i),a=a&&!Cs(r.removedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function Rw(e,t,n){const i=e.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Cs(r.removedNodes,i),a=a&&!Cs(r.addedNodes,i);a&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Di=new Map;let ru=0;function lu(){const e=window.devicePixelRatio;e!==ru&&(ru=e,Di.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function Iw(e,t){Di.size||window.addEventListener("resize",lu),Di.set(e,t)}function Lw(e){Di.delete(e),Di.size||window.removeEventListener("resize",lu)}function Nw(e,t,n){const i=e.canvas,s=i&&aa(i);if(!s)return;const o=rc((r,l)=>{const c=s.clientWidth;n(r,l),c<s.clientWidth&&n()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return a.observe(s),Iw(e,o),a}function ga(e,t,n){n&&n.disconnect(),t==="resize"&&Lw(e)}function Bw(e,t,n){const i=e.canvas,s=rc(o=>{e.ctx!==null&&n(Pw(o,e))},e);return Ow(i,t,s),s}class zw extends su{acquireContext(t,n){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Cw(t,n),i):null}releaseContext(t){const n=t.canvas;if(!n[Ds])return!1;const i=n[Ds].initial;["height","width"].forEach(o=>{const a=i[o];Z(a)?n.removeAttribute(o):n.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{n.style[o]=s[o]}),n.width=n.width,delete n[Ds],!0}addEventListener(t,n,i){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),a={attach:Ew,detach:Rw,resize:Nw}[n]||Bw;s[n]=a(t,n,i)}removeEventListener(t,n){const i=t.$proxies||(t.$proxies={}),s=i[n];if(!s)return;({attach:ga,detach:ga,resize:ga}[n]||Aw)(t,n,s),i[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,i,s){return Dx(t,n,i,s)}isAttached(t){const n=t&&aa(t);return!!(n&&n.isConnected)}}function Fw(e){return!oa()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Mw:zw}class Yt{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}hasValue(){return Le(this.x)&&Le(this.y)}getProps(t,n){const i=this.$animations;if(!n||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}function Uw(e,t){const n=e.options.ticks,i=Vw(e),s=Math.min(n.maxTicksLimit||i,i),o=n.major.enabled?$w(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return Yw(t,c,o,a/s),c;const d=Hw(o,t,s);if(a>0){let h,f;const m=a>1?Math.round((l-r)/(a-1)):null;for(Os(t,c,d,Z(m)?0:r-m,r),h=0,f=a-1;h<f;h++)Os(t,c,d,o[h],o[h+1]);return Os(t,c,d,l,Z(m)?t.length:l+m),c}return Os(t,c,d),c}function Vw(e){const t=e.options.offset,n=e._tickSize(),i=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(i,s))}function Hw(e,t,n){const i=Ww(e),s=t.length/n;if(!i)return Math.max(s,1);const o=A_(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function $w(e){const t=[];let n,i;for(n=0,i=e.length;n<i;n++)e[n].major&&t.push(n);return t}function Yw(e,t,n,i){let s=0,o=n[0],a;for(i=Math.ceil(i),a=0;a<e.length;a++)a===o&&(t.push(e[a]),s++,o=n[s*i])}function Os(e,t,n,i,s){const o=Q(i,0),a=Math.min(Q(s,e.length),e.length);let r=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-i,n=l/Math.floor(l/n)),d=o;d<0;)r++,d=Math.round(o+r*n);for(c=Math.max(o,0);c<a;c++)c===d&&(t.push(e[c]),r++,d=Math.round(o+r*n))}function Ww(e){const t=e.length;let n,i;if(t<2)return!1;for(i=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==i)return!1;return i}const jw=e=>e==="left"?"right":e==="right"?"left":e,cu=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,uu=(e,t)=>Math.min(t||e,e);function du(e,t){const n=[],i=e.length/t,s=e.length;let o=0;for(;o<s;o+=i)n.push(e[Math.floor(o)]);return n}function qw(e,t,n){const i=e.ticks.length,s=Math.min(t,i-1),o=e._startPixel,a=e._endPixel,r=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(i===1?c=Math.max(l-o,a-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function Gw(e,t){mt(e,n=>{const i=n.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete n.data[i[o]];i.splice(0,s)}})}function Ci(e){return e.drawTicks?e.tickLength:0}function hu(e,t){if(!e.display)return 0;const n=xt(e.font,t),i=At(e.padding);return(ut(e.text)?e.text.length:1)*n.lineHeight+i.height}function Xw(e,t){return Be(e,{scale:t,type:"scale"})}function Kw(e,t,n){return Be(e,{tick:n,index:t,type:"tick"})}function Zw(e,t,n){let i=Xo(e);return(n&&t!=="right"||!n&&t==="right")&&(i=jw(i)),i}function Qw(e,t,n,i){const{top:s,left:o,bottom:a,right:r,chart:l}=e,{chartArea:c,scales:d}=l;let h=0,f,m,p;const g=a-s,y=r-o;if(e.isHorizontal()){if(m=Ht(i,o,r),et(n)){const _=Object.keys(n)[0],x=n[_];p=d[_].getPixelForValue(x)+g-t}else n==="center"?p=(c.bottom+c.top)/2+g-t:p=cu(e,n,t);f=r-o}else{if(et(n)){const _=Object.keys(n)[0],x=n[_];m=d[_].getPixelForValue(x)-y+t}else n==="center"?m=(c.left+c.right)/2-y+t:m=cu(e,n,t);p=Ht(i,a,s),h=n==="left"?-yt:yt}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class an extends Yt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:i,_suggestedMax:s}=this;return t=ne(t,Number.POSITIVE_INFINITY),n=ne(n,Number.NEGATIVE_INFINITY),i=ne(i,Number.POSITIVE_INFINITY),s=ne(s,Number.NEGATIVE_INFINITY),{min:ne(t,i),max:ne(n,s),minDefined:_t(t),maxDefined:_t(n)}}getMinMax(t){let{min:n,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:n,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(n=Math.min(n,a.min)),o||(i=Math.max(i,a.max));return n=o&&n>i?i:n,i=s&&n>i?n:i,{min:ne(n,ne(i,n)),max:ne(i,ne(n,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ft(this.options.beforeUpdate,[this])}update(t,n,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ox(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?du(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Uw(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,i;this.isHorizontal()?(n=this.left,i=this.right):(n=this.top,i=this.bottom,t=!t),this._startPixel=n,this._endPixel=i,this._reversePixels=t,this._length=i-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ft(this.options.afterUpdate,[this])}beforeSetDimensions(){ft(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(){ft(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ft(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ft(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=ft(n.callback,[o.value,i,t],this)}afterTickToLabelConversion(){ft(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ft(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,i=uu(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,o=n.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!n.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),h=d.widest.width,f=d.highest.height,m=It(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/i:m/(i-1),h+6>r&&(r=m/(i-(t.offset?.5:1)),l=this.maxHeight-Ci(t.grid)-n.padding-hu(t.title,this.chart.options.font),c=Math.sqrt(h*h+f*f),a=gs(Math.min(Math.asin(It((d.highest.height+6)/r,-1,1)),Math.asin(It(l/c,-1,1))-Math.asin(It(f/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){ft(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ft(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=hu(s,n.options.font);if(r?(t.width=this.maxWidth,t.height=Ci(o)+l):(t.height=this.maxHeight,t.width=Ci(o)+l),i.display&&this.ticks.length){const{first:c,last:d,widest:h,highest:f}=this._getLabelSizes(),m=i.padding*2,p=Ot(this.labelRotation),g=Math.cos(p),y=Math.sin(p);if(r){const _=i.mirror?0:y*h.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+_+m)}else{const _=i.mirror?0:g*h.width+y*f.height;t.width=Math.min(this.maxWidth,t.width+_+m)}this._calculatePadding(c,d,y,g)}}this._handleMargins(),r?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,i,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=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*n.height):(f=i*t.height,m=s*n.width):o==="start"?m=n.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,m=n.width/2),this.paddingLeft=Math.max((f-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((m-h+a)*this.width/(this.width-h),0)}else{let d=n.height/2,h=t.height/2;o==="start"?(d=0,h=t.height):o==="end"&&(d=n.height,h=0),this.paddingTop=d+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(){ft(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,i;for(n=0,i=t.length;n<i;n++)Z(t[n].label)&&(t.splice(n,1),i--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let i=this.ticks;n<i.length&&(i=du(i,n)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(n/uu(n,i));let c=0,d=0,h,f,m,p,g,y,_,x,T,k,w;for(h=0;h<n;h+=l){if(p=t[h].label,g=this._resolveTickFontOptions(h),s.font=y=g.string,_=o[y]=o[y]||{data:{},gc:[]},x=g.lineHeight,T=k=0,!Z(p)&&!ut(p))T=ws(s,_.data,_.gc,T,p),k=x;else if(ut(p))for(f=0,m=p.length;f<m;++f)w=p[f],!Z(w)&&!ut(w)&&(T=ws(s,_.data,_.gc,T,w),k+=x);a.push(T),r.push(k),c=Math.max(T,c),d=Math.max(k,d)}Gw(o,n);const O=a.indexOf(c),S=r.indexOf(d),A=R=>({width:a[R]||0,height:r[R]||0});return{first:A(0),last:A(n-1),widest:A(O),highest:A(S),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return I_(this._alignToPixels?tn(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const i=n[t];return i.$context||(i.$context=Kw(this.getContext(),t,i))}return this.$context||(this.$context=Xw(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=Ot(this.labelRotation),i=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),h=this.ticks.length+(l?1:0),f=Ci(o),m=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,y=g/2,_=function(V){return tn(i,V,g)};let x,T,k,w,O,S,A,R,D,v,C,I;if(a==="top")x=_(this.bottom),S=this.bottom-f,R=x-y,v=_(t.top)+y,I=t.bottom;else if(a==="bottom")x=_(this.top),v=t.top,I=_(t.bottom)-y,S=x+y,R=this.top+f;else if(a==="left")x=_(this.right),O=this.right-f,A=x-y,D=_(t.left)+y,C=t.right;else if(a==="right")x=_(this.left),D=t.left,C=_(t.right)-y,O=x+y,A=this.left+f;else if(n==="x"){if(a==="center")x=_((t.top+t.bottom)/2+.5);else if(et(a)){const V=Object.keys(a)[0],G=a[V];x=_(this.chart.scales[V].getPixelForValue(G))}v=t.top,I=t.bottom,S=x+y,R=S+f}else if(n==="y"){if(a==="center")x=_((t.left+t.right)/2);else if(et(a)){const V=Object.keys(a)[0],G=a[V];x=_(this.chart.scales[V].getPixelForValue(G))}O=x-y,A=O-f,D=t.left,C=t.right}const U=Q(s.ticks.maxTicksLimit,h),H=Math.max(1,Math.ceil(h/U));for(T=0;T<h;T+=H){const V=this.getContext(T),G=o.setContext(V),rt=r.setContext(V),ot=G.lineWidth,X=G.color,B=rt.dash||[],M=rt.dashOffset,E=G.tickWidth,z=G.tickColor,Y=G.tickBorderDash||[],nt=G.tickBorderDashOffset;k=qw(this,T,l),k!==void 0&&(w=tn(i,k,ot),c?O=A=D=C=w:S=R=v=I=w,m.push({tx1:O,ty1:S,tx2:A,ty2:R,x1:D,y1:v,x2:C,y2:I,width:ot,color:X,borderDash:B,borderDashOffset:M,tickWidth:E,tickColor:z,tickBorderDash:Y,tickBorderDashOffset:nt}))}return this._ticksLength=h,this._borderValue=x,m}_computeLabelItems(t){const n=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:d,mirror:h}=o,f=Ci(i.grid),m=f+d,p=h?-d:m,g=-Ot(this.labelRotation),y=[];let _,x,T,k,w,O,S,A,R,D,v,C,I="middle";if(s==="top")O=this.bottom-p,S=this._getXAxisLabelAlignment();else if(s==="bottom")O=this.top+p,S=this._getXAxisLabelAlignment();else if(s==="left"){const H=this._getYAxisLabelAlignment(f);S=H.textAlign,w=H.x}else if(s==="right"){const H=this._getYAxisLabelAlignment(f);S=H.textAlign,w=H.x}else if(n==="x"){if(s==="center")O=(t.top+t.bottom)/2+m;else if(et(s)){const H=Object.keys(s)[0],V=s[H];O=this.chart.scales[H].getPixelForValue(V)+m}S=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")w=(t.left+t.right)/2-m;else if(et(s)){const H=Object.keys(s)[0],V=s[H];w=this.chart.scales[H].getPixelForValue(V)}S=this._getYAxisLabelAlignment(f).textAlign}n==="y"&&(l==="start"?I="top":l==="end"&&(I="bottom"));const U=this._getLabelSizes();for(_=0,x=r.length;_<x;++_){T=r[_],k=T.label;const H=o.setContext(this.getContext(_));A=this.getPixelForTick(_)+o.labelOffset,R=this._resolveTickFontOptions(_),D=R.lineHeight,v=ut(k)?k.length:1;const V=v/2,G=H.color,rt=H.textStrokeColor,ot=H.textStrokeWidth;let X=S;a?(w=A,S==="inner"&&(_===x-1?X=this.options.reverse?"left":"right":_===0?X=this.options.reverse?"right":"left":X="center"),s==="top"?c==="near"||g!==0?C=-v*D+D/2:c==="center"?C=-U.highest.height/2-V*D+D:C=-U.highest.height+D/2:c==="near"||g!==0?C=D/2:c==="center"?C=U.highest.height/2-V*D:C=U.highest.height-v*D,h&&(C*=-1),g!==0&&!H.showLabelBackdrop&&(w+=D/2*Math.sin(g))):(O=A,C=(1-v)*D/2);let B;if(H.showLabelBackdrop){const M=At(H.backdropPadding),E=U.heights[_],z=U.widths[_];let Y=C-M.top,nt=0-M.left;switch(I){case"middle":Y-=E/2;break;case"bottom":Y-=E;break}switch(S){case"center":nt-=z/2;break;case"right":nt-=z;break;case"inner":_===x-1?nt-=z:_>0&&(nt-=z/2);break}B={left:nt,top:Y,width:z+M.width,height:E+M.height,color:H.backdropColor}}y.push({label:k,font:R,textOffset:C,options:{rotation:g,color:G,strokeColor:rt,strokeWidth:ot,textAlign:X,textBaseline:I,translation:[w,O],backdrop:B}})}return y}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-Ot(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,d;return n==="left"?s?(d=this.right+o,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-r,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+o,i==="near"?c="right":i==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+r,i==="near"?c="left":i==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:i,top:s,width:o,height:a}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,d)=>{!d.width||!d.color||(i.save(),i.lineWidth=d.width,i.strokeStyle=d.color,i.setLineDash(d.borderDash||[]),i.lineDashOffset=d.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(n.display)for(o=0,a=s.length;o<a;++o){const l=s[o];n.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,h,f;this.isHorizontal()?(c=tn(t,this.left,a)-a/2,d=tn(t,this.right,r)+r/2,h=f=l):(h=tn(t,this.top,a)-a/2,f=tn(t,this.bottom,r)+r/2,c=d=l),n.save(),n.lineWidth=o.width,n.strokeStyle=o.color,n.beginPath(),n.moveTo(c,h),n.lineTo(d,f),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&bi(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,d=a.textOffset;en(i,c,0,d,l,r)}s&&_i(i)}drawTitle(){const{ctx:t,options:{position:n,title:i,reverse:s}}=this;if(!i.display)return;const o=xt(i.font),a=At(i.padding),r=i.align;let l=o.lineHeight/2;n==="bottom"||n==="center"||et(n)?(l+=a.bottom,ut(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:d,maxWidth:h,rotation:f}=Qw(this,l,n,r);en(t,i.text,0,0,o,{color:i.color,maxWidth:h,rotation:f,textAlign:Zw(r,n,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,i=Q(t.grid&&t.grid.z,-1),s=Q(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==an.prototype.draw?[{z:n,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=n.length;o<a;++o){const r=n[o];r[i]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return xt(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class As{constructor(t,n,i){this.type=t,this.scope=n,this.override=i,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let i;ek(n)&&(i=this.register(n));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Jw(t,a,i),this.override&&bt.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const n=this.items,i=t.id,s=this.scope;i in n&&delete n[i],s&&i in bt[s]&&(delete bt[s][i],this.override&&delete Je[i])}}function Jw(e,t,n){const i=di(Object.create(null),[n?bt.get(n):{},bt.get(t),e.defaults]);bt.set(t,i),e.defaultRoutes&&tk(t,e.defaultRoutes),e.descriptors&&bt.describe(t,e.descriptors)}function tk(e,t){Object.keys(t).forEach(n=>{const i=n.split("."),s=i.pop(),o=[e].concat(i).join("."),a=t[n].split("."),r=a.pop(),l=a.join(".");bt.route(o,s,l,r)})}function ek(e){return"id"in e&&"defaults"in e}class nk{constructor(){this.controllers=new As(Ue,"datasets",!0),this.elements=new As(Yt,"elements"),this.plugins=new As(Object,"plugins"),this.scales=new As(an,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,i){[...n].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):mt(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,n,i){const s=jo(t);ft(i["before"+s],[],i),n[t](i),ft(i["after"+s],[],i)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const i=this._typedRegistries[n];if(i.isForType(t))return i}return this.plugins}_get(t,n,i){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var fe=new nk;class ik{constructor(){this._init=void 0}notify(t,n,i,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,n,i);return n==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,n,i,s){s=s||{};for(const o of t){const a=o.plugin,r=a[i],l=[n,s,o.options];if(ft(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){Z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const i=t&&t.config,s=Q(i.options&&i.options.plugins,{}),o=sk(i);return s===!1&&!n?[]:ak(t,o,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(n,i),t,"stop"),this._notify(s(i,n),t,"start")}}function sk(e){const t={},n=[],i=Object.keys(fe.plugins.items);for(let o=0;o<i.length;o++)n.push(fe.getPlugin(i[o]));const s=e.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];n.indexOf(a)===-1&&(n.push(a),t[a.id]=!0)}return{plugins:n,localIds:t}}function ok(e,t){return!t&&e===!1?null:e===!0?{}:e}function ak(e,{plugins:t,localIds:n},i,s){const o=[],a=e.getContext();for(const r of t){const l=r.id,c=ok(i[l],s);c!==null&&o.push({plugin:r,options:rk(e.config,{plugin:r,local:n[l]},c,a)})}return o}function rk(e,{plugin:t,local:n},i,s){const o=e.pluginScopeKeys(t),a=e.getOptionScopes(i,o);return n&&t.defaults&&a.push(t.defaults),e.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ya(e,t){const n=bt.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function lk(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function ck(e,t){return e===t?"_index_":"_value_"}function fu(e){if(e==="x"||e==="y"||e==="r")return e}function uk(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function ba(e,...t){if(fu(e))return e;for(const n of t){const i=n.axis||uk(n.position)||e.length>1&&fu(e[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function mu(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function dk(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(i=>i.xAxisID===e||i.yAxisID===e);if(n.length)return mu(e,"x",n[0])||mu(e,"y",n[0])}return{}}function hk(e,t){const n=Je[e.type]||{scales:{}},i=t.scales||{},s=ya(e.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!et(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=ba(a,r,dk(a,e),bt.scales[r.type]),c=ck(l,s),d=n.scales||{};o[a]=hi(Object.create(null),[{axis:l},r,d[l],d[c]])}),e.data.datasets.forEach(a=>{const r=a.type||e.type,l=a.indexAxis||ya(r,t),d=(Je[r]||{}).scales||{};Object.keys(d).forEach(h=>{const f=lk(h,l),m=a[f+"AxisID"]||f;o[m]=o[m]||Object.create(null),hi(o[m],[{axis:f},i[m],d[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];hi(r,[bt.scales[r.type],bt.scale])}),o}function pu(e){const t=e.options||(e.options={});t.plugins=Q(t.plugins,{}),t.scales=hk(e,t)}function gu(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function fk(e){return e=e||{},e.data=gu(e.data),pu(e),e}const yu=new Map,bu=new Set;function Ps(e,t){let n=yu.get(e);return n||(n=t(),yu.set(e,n),bu.add(n)),n}const Oi=(e,t,n)=>{const i=Re(t,n);i!==void 0&&e.add(i)};class mk{constructor(t){this._config=fk(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=gu(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(),pu(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ps(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return Ps(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return Ps(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,i=this.type;return Ps(`${i}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const i=this._scopeCache;let s=i.get(t);return(!s||n)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,n,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(n);if(r)return r;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(h=>Oi(l,t,h))),d.forEach(h=>Oi(l,s,h)),d.forEach(h=>Oi(l,Je[o]||{},h)),d.forEach(h=>Oi(l,bt,h)),d.forEach(h=>Oi(l,Qo,h))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),bu.has(n)&&a.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,Je[n]||{},bt.datasets[n]||{},{type:n},bt,Qo]}resolveNamedOptions(t,n,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=_u(this._resolverCache,t,s);let l=a;if(gk(a,n)){o.$shared=!1,i=Kt(i)?i():i;const c=this.createResolver(t,i,r);l=An(a,i,c)}for(const c of n)o[c]=l[c];return o}createResolver(t,n,i=[""],s){const{resolver:o}=_u(this._resolverCache,t,i);return et(n)?An(o,n,void 0,s):o}}function _u(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));const s=n.join();let o=i.get(s);return o||(o={resolver:na(t,n),subPrefixes:n.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const pk=e=>et(e)&&Object.getOwnPropertyNames(e).some(t=>Kt(e[t]));function gk(e,t){const{isScriptable:n,isIndexable:i}=yc(e);for(const s of t){const o=n(s),a=i(s),r=(a||o)&&e[s];if(o&&(Kt(r)||pk(r))||a&&ut(r))return!0}return!1}var yk="4.5.1";const bk=["top","bottom","left","right","chartArea"];function xu(e,t){return e==="top"||e==="bottom"||bk.indexOf(e)===-1&&t==="x"}function wu(e,t){return function(n,i){return n[e]===i[e]?n[t]-i[t]:n[e]-i[e]}}function ku(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),ft(n&&n.onComplete,[e],t)}function _k(e){const t=e.chart,n=t.options.animation;ft(n&&n.onProgress,[e],t)}function Tu(e){return oa()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Es={},vu=e=>{const t=Tu(e);return Object.values(Es).filter(n=>n.canvas===t).pop()};function xk(e,t,n){const i=Object.keys(e);for(const s of i){const o=+s;if(o>=t){const a=e[s];delete e[s],(n>0||o>t)&&(e[o+n]=a)}}}function wk(e,t,n,i){return!n||e.type==="mouseout"?null:i?t:e}let Zt=class{static defaults=bt;static instances=Es;static overrides=Je;static registry=fe;static version=yk;static getChart=vu;static register(...t){fe.add(...t),Su()}static unregister(...t){fe.remove(...t),Su()}constructor(t,n){const i=this.config=new mk(n),s=Tu(t),o=vu(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||Fw(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,d=l&&l.width;if(this.id=k_(),this.ctx=r,this.canvas=l,this.width=d,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 ik,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=z_(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Es[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ke.listen(this,"complete",ku),ke.listen(this,"progress",_k),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:i,height:s,_aspectRatio:o}=this;return Z(t)?n&&o?o: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 fe}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Sc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return mc(this.canvas,this.ctx),this}stop(){return ke.stop(this),this}resize(t,n){ke.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,n,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Sc(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),ft(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};mt(n,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,i=this.scales,s=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];n&&(o=o.concat(Object.keys(n).map(a=>{const r=n[a],l=ba(a,r),c=l==="r",d=l==="x";return{options:r,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),mt(o,a=>{const r=a.options,l=r.id,c=ba(l,r),d=Q(r.type,a.dtype);(r.position===void 0||xu(r.position,c)!==xu(a.dposition))&&(r.position=a.dposition),s[l]=!0;let h=null;if(l in i&&i[l].type===d)h=i[l];else{const f=fe.getScale(d);h=new f({id:l,type:d,ctx:this.ctx,chart:this}),i[h.id]=h}h.init(r,t)}),mt(s,(a,r)=>{a||delete i[r]}),mt(i,a=>{$t.configure(this,a,a.options),$t.addBox(this,a)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>n){for(let s=n;s<i;++s)this._destroyDatasetMeta(s);t.splice(n,i-n)}this._sortedMetasets=t.slice(0).sort(wu("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((i,s)=>{n.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=n.length;i<s;i++){const o=n[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||ya(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=fe.getController(r),{datasetElementType:c,dataElementType:d}=bt.datasets[r];Object.assign(l,{dataElementType:fe.getElement(d),datasetElementType:c&&fe.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){mt(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const i=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),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 o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:h}=this.getDatasetMeta(c),f=!s&&o.indexOf(h)===-1;h.buildOrUpdateElements(f),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||mt(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(wu("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){mt(this.scales,t=>{$t.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Jl(n,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of n){const a=i==="_removeElements"?-o:o;xk(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<n;o++)if(!Jl(s,i(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;$t.update(this,this.width,this.height,t);const n=this.chartArea,i=n.width<=0||n.height<=0;this._layers=[],mt(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,i=this.data.datasets.length;n<i;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,i=this.data.datasets.length;n<i;++n)this._updateDataset(n,Kt(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ke.has(this)?this.attached&&!ke.running(this)&&ke.start(this):(this.draw(),ku({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 n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,i=[];let s,o;for(s=0,o=n.length;s<o;++s){const a=n[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 n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,i={meta:t,index:t.index,cancelable:!0},s=Lc(this,t);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(s&&bi(n,s),t.controller.draw(),s&&_i(n),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(t){return we(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,i,s){const o=pa.modes[n];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Be(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!n.hidden}setDatasetVisibility(t,n){const i=this.getDatasetMeta(t);i.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);Xt(n)?(o.data[n].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),ke.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),mc(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Es[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,i=(o,a)=>{n.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};mt(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,i=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",r)},n.isAttached(this.canvas)?r():a()}unbindEvents(){mt(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},mt(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,i){const s=i?"set":"remove";let o,a,r,l;for(n==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];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 n=this._active||[],i=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!hs(i,n)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,n))}notifyPlugins(t,n,i){return this._plugins.notify(this,t,n,i)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,i){const s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(h=>d.datasetIndex===h.datasetIndex&&d.index===h.index)),a=o(n,t),r=i?t:o(t,n);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,n){const i={event:t,replay:n,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 o=this._handleEvent(t,n,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,n,i){const{_active:s=[],options:o}=this,a=n,r=this._getActiveElements(t,s,i,a),l=C_(t),c=wk(t,this._lastEvent,i,l);i&&(this._lastEvent=null,ft(o.onHover,[t,r,this],this),l&&ft(o.onClick,[t,r,this],this));const d=!hs(r,s);return(d||n)&&(this._active=r,this._updateHoverStyles(r,s,n)),this._lastEvent=c,d}_getActiveElements(t,n,i,s){if(t.type==="mouseout")return[];if(!i)return n;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};function Su(){return mt(Zt.instances,e=>e._plugins.invalidate())}function kk(e,t,n){const{startAngle:i,x:s,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,h=Math.min(c/a,Vt(i-n));if(e.beginPath(),e.arc(s,o,a-c/2,i+h/2,n-h/2),r>0){const f=Math.min(c/r,Vt(i-n));e.arc(s,o,r+c/2,n-f/2,i+f/2,!0)}else{const f=Math.min(c/2,a*Vt(i-n));if(d==="round")e.arc(s,o,f,n-tt/2,i+tt/2,!0);else if(d==="bevel"){const m=2*f*f,p=-m*Math.cos(n+tt/2)+s,g=-m*Math.sin(n+tt/2)+o,y=m*Math.cos(i+tt/2)+s,_=m*Math.sin(i+tt/2)+o;e.lineTo(p,g),e.lineTo(y,_)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Tk(e,t,n){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;e.beginPath(),e.arc(o,a,r,i-c,n+c),l>s?(c=s/l,e.arc(o,a,l,n+c,i-c,!0)):e.arc(o,a,s,n+yt,i-yt),e.closePath(),e.clip()}function vk(e){return ea(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Sk(e,t,n,i){const s=vk(e.options.borderRadius),o=(n-t)/2,a=Math.min(o,i*t/2),r=l=>{const c=(n-Math.min(o,l))*i/2;return It(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:It(s.innerStart,0,a),innerEnd:It(s.innerEnd,0,a)}}function Rn(e,t,n,i){return{x:n+e*Math.cos(t),y:i+e*Math.sin(t)}}function Rs(e,t,n,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:d}=t,h=Math.max(t.outerRadius+i+n-c,0),f=d>0?d+i+n+c:0;let m=0;const p=s-l;if(i){const H=d>0?d-i:0,V=h>0?h-i:0,G=(H+V)/2,rt=G!==0?p*G/(G+i):p;m=(p-rt)/2}const g=Math.max(.001,p*h-n/tt)/h,y=(p-g)/2,_=l+y+m,x=s-y-m,{outerStart:T,outerEnd:k,innerStart:w,innerEnd:O}=Sk(t,f,h,x-_),S=h-T,A=h-k,R=_+T/S,D=x-k/A,v=f+w,C=f+O,I=_+w/v,U=x-O/C;if(e.beginPath(),o){const H=(R+D)/2;if(e.arc(a,r,h,R,H),e.arc(a,r,h,H,D),k>0){const ot=Rn(A,D,a,r);e.arc(ot.x,ot.y,k,D,x+yt)}const V=Rn(C,x,a,r);if(e.lineTo(V.x,V.y),O>0){const ot=Rn(C,U,a,r);e.arc(ot.x,ot.y,O,x+yt,U+Math.PI)}const G=(x-O/f+(_+w/f))/2;if(e.arc(a,r,f,x-O/f,G,!0),e.arc(a,r,f,G,_+w/f,!0),w>0){const ot=Rn(v,I,a,r);e.arc(ot.x,ot.y,w,I+Math.PI,_-yt)}const rt=Rn(S,_,a,r);if(e.lineTo(rt.x,rt.y),T>0){const ot=Rn(S,R,a,r);e.arc(ot.x,ot.y,T,_-yt,R)}}else{e.moveTo(a,r);const H=Math.cos(R)*h+a,V=Math.sin(R)*h+r;e.lineTo(H,V);const G=Math.cos(D)*h+a,rt=Math.sin(D)*h+r;e.lineTo(G,rt)}e.closePath()}function Mk(e,t,n,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Rs(e,t,n,i,l,s);for(let c=0;c<o;++c)e.fill();isNaN(r)||(l=a+(r%gt||gt))}return Rs(e,t,n,i,l,s),e.fill(),l}function Dk(e,t,n,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:h,borderDashOffset:f,borderRadius:m}=l,p=l.borderAlign==="inner";if(!c)return;e.setLineDash(h||[]),e.lineDashOffset=f,p?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let g=t.endAngle;if(o){Rs(e,t,n,i,g,s);for(let y=0;y<o;++y)e.stroke();isNaN(r)||(g=a+(r%gt||gt))}p&&Tk(e,t,g),l.selfJoin&&g-a>=tt&&m===0&&d!=="miter"&&kk(e,t,g),o||(Rs(e,t,n,i,g,s),e.stroke())}class Ck extends Yt{static id="arc";static 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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),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,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.getProps(["x","y"],i),{angle:o,distance:a}=ys(s,{x:t,y:n}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:d,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],i),f=(this.options.spacing+this.options.borderWidth)/2,m=Q(h,l-r),p=mi(o,r,l)&&r!==l,g=m>=gt||p,y=_e(a,c+f,d+f);return g&&y}getCenterPoint(t){const{x:n,y:i,startAngle:s,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,d=(s+o)/2,h=(a+r+c+l)/2;return{x:n+Math.cos(d)*h,y:i+Math.sin(d)*h}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:n,circumference:i}=this,s=(n.offset||0)/4,o=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=i>gt?Math.floor(i/gt):0,i===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const r=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(r)*s,Math.sin(r)*s);const l=1-Math.sin(Math.min(tt,i||0)),c=s*l;t.fillStyle=n.backgroundColor,t.strokeStyle=n.borderColor,Mk(t,this,c,o,a),Dk(t,this,c,o,a),t.restore()}}function Mu(e,t,n=t){e.lineCap=Q(n.borderCapStyle,t.borderCapStyle),e.setLineDash(Q(n.borderDash,t.borderDash)),e.lineDashOffset=Q(n.borderDashOffset,t.borderDashOffset),e.lineJoin=Q(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Q(n.borderWidth,t.borderWidth),e.strokeStyle=Q(n.borderColor,t.borderColor)}function Ok(e,t,n){e.lineTo(n.x,n.y)}function Ak(e){return e.stepped?K_:e.tension||e.cubicInterpolationMode==="monotone"?Z_:Ok}function Du(e,t,n={}){const i=e.length,{start:s=0,end:o=i-1}=n,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),d=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!d?i+c-l:c-l}}function Pk(e,t,n,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=Du(s,n,i),d=Ak(o);let{move:h=!0,reverse:f}=i||{},m,p,g;for(m=0;m<=c;++m)p=s[(r+(f?c-m:m))%a],!p.skip&&(h?(e.moveTo(p.x,p.y),h=!1):d(e,g,p,f,o.stepped),g=p);return l&&(p=s[(r+(f?c:0))%a],d(e,g,p,f,o.stepped)),!!l}function Ek(e,t,n,i){const s=t.points,{count:o,start:a,ilen:r}=Du(s,n,i),{move:l=!0,reverse:c}=i||{};let d=0,h=0,f,m,p,g,y,_;const x=k=>(a+(c?r-k:k))%o,T=()=>{g!==y&&(e.lineTo(d,y),e.lineTo(d,g),e.lineTo(d,_))};for(l&&(m=s[x(0)],e.moveTo(m.x,m.y)),f=0;f<=r;++f){if(m=s[x(f)],m.skip)continue;const k=m.x,w=m.y,O=k|0;O===p?(w<g?g=w:w>y&&(y=w),d=(h*d+k)/++h):(T(),e.lineTo(k,w),p=O,h=0,g=y=w),_=w}T()}function _a(e){const t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!n?Ek:Pk}function Rk(e){return e.stepped?Ox:e.tension||e.cubicInterpolationMode==="monotone"?Ax:sn}function Ik(e,t,n,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,n,i)&&s.closePath()),Mu(e,t.options),e.stroke(s)}function Lk(e,t,n,i){const{segments:s,options:o}=t,a=_a(t);for(const r of s)Mu(e,o,r.style),e.beginPath(),a(e,t,r,{start:n,end:n+i-1})&&e.closePath(),e.stroke()}const Nk=typeof Path2D=="function";function Bk(e,t,n,i){Nk&&!t.options.segment?Ik(e,t,n,i):Lk(e,t,n,i)}class Is extends Yt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,n){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;wx(this._points,i,t,s,n),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Nx(this,this.options.segment))}first(){const t=this.segments,n=this.points;return t.length&&n[t[0].start]}last(){const t=this.segments,n=this.points,i=t.length;return i&&n[t[i-1].end]}interpolate(t,n){const i=this.options,s=t[n],o=this.points,a=Ec(this,{property:n,start:s,end:s});if(!a.length)return;const r=[],l=Rk(i);let c,d;for(c=0,d=a.length;c<d;++c){const{start:h,end:f}=a[c],m=o[h],p=o[f];if(m===p){r.push(m);continue}const g=Math.abs((s-m[n])/(p[n]-m[n])),y=l(m,p,g,i.stepped);y[n]=t[n],r.push(y)}return r.length===1?r[0]:r}pathSegment(t,n,i){return _a(this)(t,this,n,i)}path(t,n,i){const s=this.segments,o=_a(this);let a=this._loop;n=n||0,i=i||this.points.length-n;for(const r of s)a&=o(t,this,r,{start:n,end:n+i-1});return!!a}draw(t,n,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Bk(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function Cu(e,t,n,i){const s=e.options,{[n]:o}=e.getProps([n],i);return Math.abs(t-o)<s.radius+s.hitRadius}class zk extends Yt{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,n,i){const s=this.options,{x:o,y:a}=this.getProps(["x","y"],i);return Math.pow(t-o,2)+Math.pow(n-a,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,n){return Cu(this,t,"x",n)}inYRange(t,n){return Cu(this,t,"y",n)}getCenterPoint(t){const{x:n,y:i}=this.getProps(["x","y"],t);return{x:n,y:i}}size(t){t=t||this.options||{};let n=t.radius||0;n=Math.max(n,n&&t.hoverRadius||0);const i=n&&t.borderWidth||0;return(n+i)*2}draw(t,n){const i=this.options;this.skip||i.radius<.1||!we(this,n,this.size(i)/2)||(t.strokeStyle=i.borderColor,t.lineWidth=i.borderWidth,t.fillStyle=i.backgroundColor,ta(t,i,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Ou(e,t){const{x:n,y:i,base:s,width:o,height:a}=e.getProps(["x","y","base","width","height"],t);let r,l,c,d,h;return e.horizontal?(h=a/2,r=Math.min(n,s),l=Math.max(n,s),c=i-h,d=i+h):(h=o/2,r=n-h,l=n+h,c=Math.min(i,s),d=Math.max(i,s)),{left:r,top:c,right:l,bottom:d}}function Ve(e,t,n,i){return e?0:It(t,n,i)}function Fk(e,t,n){const i=e.options.borderWidth,s=e.borderSkipped,o=gc(i);return{t:Ve(s.top,o.top,0,n),r:Ve(s.right,o.right,0,t),b:Ve(s.bottom,o.bottom,0,n),l:Ve(s.left,o.left,0,t)}}function Uk(e,t,n){const{enableBorderRadius:i}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Ne(s),a=Math.min(t,n),r=e.borderSkipped,l=i||et(s);return{topLeft:Ve(!l||r.top||r.left,o.topLeft,0,a),topRight:Ve(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ve(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ve(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Vk(e){const t=Ou(e),n=t.right-t.left,i=t.bottom-t.top,s=Fk(e,n/2,i/2),o=Uk(e,n/2,i/2);return{outer:{x:t.left,y:t.top,w:n,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function xa(e,t,n,i){const s=t===null,o=n===null,r=e&&!(s&&o)&&Ou(e,i);return r&&(s||_e(t,r.left,r.right))&&(o||_e(n,r.top,r.bottom))}function Hk(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function $k(e,t){e.rect(t.x,t.y,t.w,t.h)}function wa(e,t,n={}){const i=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,o=(e.x+e.w!==n.x+n.w?t:0)-i,a=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+i,y:e.y+s,w:e.w+o,h:e.h+a,radius:e.radius}}class Yk extends Yt{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:i,backgroundColor:s}}=this,{inner:o,outer:a}=Vk(this),r=Hk(a.radius)?On:$k;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,wa(a,n,o)),t.clip(),r(t,wa(o,-n,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,wa(o,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,i){return xa(this,t,n,i)}inXRange(t,n){return xa(this,t,null,n)}inYRange(t,n){return xa(this,null,t,n)}getCenterPoint(t){const{x:n,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(n+s)/2:n,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}var Wk=Object.freeze({__proto__:null,ArcElement:Ck,BarElement:Yk,LineElement:Is,PointElement:zk});const ka=["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)"],Au=ka.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function Pu(e){return ka[e%ka.length]}function Eu(e){return Au[e%Au.length]}function jk(e,t){return e.borderColor=Pu(t),e.backgroundColor=Eu(t),++t}function qk(e,t){return e.backgroundColor=e.data.map(()=>Pu(t++)),t}function Gk(e,t){return e.backgroundColor=e.data.map(()=>Eu(t++)),t}function Xk(e){let t=0;return(n,i)=>{const s=e.getDatasetMeta(i).controller;s instanceof ki?t=qk(n,t):s instanceof Xc?t=Gk(n,t):s&&(t=jk(n,t))}}function Ru(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function Kk(e){return e&&(e.borderColor||e.backgroundColor)}function Zk(){return bt.borderColor!=="rgba(0,0,0,0.1)"||bt.backgroundColor!=="rgba(0,0,0,0.1)"}var Qk={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,n){if(!n.enabled)return;const{data:{datasets:i},options:s}=e.config,{elements:o}=s,a=Ru(i)||Kk(s)||o&&Ru(o)||Zk();if(!n.forceOverride&&a)return;const r=Xk(e);i.forEach(r)}};function Jk(e,t,n,i,s){const o=s.samples||i;if(o>=n)return e.slice(t,t+n);const a=[],r=(n-2)/(o-2);let l=0;const c=t+n-1;let d=t,h,f,m,p,g;for(a[l++]=e[d],h=0;h<o-2;h++){let y=0,_=0,x;const T=Math.floor((h+1)*r)+1+t,k=Math.min(Math.floor((h+2)*r)+1,n)+t,w=k-T;for(x=T;x<k;x++)y+=e[x].x,_+=e[x].y;y/=w,_/=w;const O=Math.floor(h*r)+1+t,S=Math.min(Math.floor((h+1)*r)+1,n)+t,{x:A,y:R}=e[d];for(m=p=-1,x=O;x<S;x++)p=.5*Math.abs((A-y)*(e[x].y-R)-(A-e[x].x)*(_-R)),p>m&&(m=p,f=e[x],g=x);a[l++]=f,d=g}return a[l++]=e[c],a}function tT(e,t,n,i){let s=0,o=0,a,r,l,c,d,h,f,m,p,g;const y=[],_=t+n-1,x=e[t].x,k=e[_].x-x;for(a=t;a<t+n;++a){r=e[a],l=(r.x-x)/k*i,c=r.y;const w=l|0;if(w===d)c<p?(p=c,h=a):c>g&&(g=c,f=a),s=(o*s+r.x)/++o;else{const O=a-1;if(!Z(h)&&!Z(f)){const S=Math.min(h,f),A=Math.max(h,f);S!==m&&S!==O&&y.push({...e[S],x:s}),A!==m&&A!==O&&y.push({...e[A],x:s})}a>0&&O!==m&&y.push(e[O]),y.push(r),d=w,o=0,p=g=c,h=f=m=a}}return y}function Iu(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Lu(e){e.data.datasets.forEach(t=>{Iu(t)})}function eT(e,t){const n=t.length;let i=0,s;const{iScale:o}=e,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=It(xe(t,o.axis,a).lo,0,n-1)),c?s=It(xe(t,o.axis,r).hi+1,i,n)-i:s=n-i,{start:i,count:s}}var nT={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,n)=>{if(!n.enabled){Lu(e);return}const i=e.width;e.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=e.getDatasetMeta(o),c=a||s.data;if(xi([r,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:h,count:f}=eT(l,c);const m=n.threshold||4*i;if(f<=m){Iu(s);return}Z(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(n.algorithm){case"lttb":p=Jk(c,h,f,i,n);break;case"min-max":p=tT(c,h,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${n.algorithm}'`)}s._decimated=p})},destroy(e){Lu(e)}};function iT(e,t,n){const i=e.segments,s=e.points,o=t.points,a=[];for(const r of i){let{start:l,end:c}=r;c=Ls(l,c,s);const d=Ta(n,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:d,start:s[l],end:s[c]});continue}const h=Ec(t,d);for(const f of h){const m=Ta(n,o[f.start],o[f.end],f.loop),p=Pc(r,s,m);for(const g of p)a.push({source:g,target:f,start:{[n]:Nu(d,m,"start",Math.max)},end:{[n]:Nu(d,m,"end",Math.min)}})}}return a}function Ta(e,t,n,i){if(i)return;let s=t[e],o=n[e];return e==="angle"&&(s=Vt(s),o=Vt(o)),{property:e,start:s,end:o}}function sT(e,t){const{x:n=null,y:i=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Ls(a,r,s);const l=s[a],c=s[r];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):n!==null&&(o.push({x:n,y:l.y}),o.push({x:n,y:c.y}))}),o}function Ls(e,t,n){for(;t>e;t--){const i=n[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Nu(e,t,n,i){return e&&t?i(e[n],t[n]):e?e[n]:t?t[n]:0}function Bu(e,t){let n=[],i=!1;return ut(e)?(i=!0,n=e):n=sT(e,t),n.length?new Is({points:n,options:{tension:0},_loop:i,_fullLoop:i}):null}function zu(e){return e&&e.fill!==!1}function oT(e,t,n){let s=e[t].fill;const o=[t];let a;if(!n)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!_t(s))return s;if(a=e[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function aT(e,t,n){const i=uT(e);if(et(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return _t(s)&&Math.floor(s)===s?rT(i[0],t,s,n):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function rT(e,t,n,i){return(e==="-"||e==="+")&&(n=t+n),n===t||n<0||n>=i?!1:n}function lT(e,t){let n=null;return e==="start"?n=t.bottom:e==="end"?n=t.top:et(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function cT(e,t,n){let i;return e==="start"?i=n:e==="end"?i=t.options.reverse?t.min:t.max:et(e)?i=e.value:i=t.getBaseValue(),i}function uT(e){const t=e.options,n=t.fill;let i=Q(n&&n.target,n);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function dT(e){const{scale:t,index:n,line:i}=e,s=[],o=i.segments,a=i.points,r=hT(t,n);r.push(Bu({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let d=c.start;d<=c.end;d++)fT(s,a[d],r)}return new Is({points:s,options:{}})}function hT(e,t){const n=[],i=e.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||n.unshift(o.dataset)}return n}function fT(e,t,n){const i=[];for(let s=0;s<n.length;s++){const o=n[s],{first:a,last:r,point:l}=mT(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(e.push(l),!r)break}}e.push(...i)}function mT(e,t,n){const i=e.interpolate(t,n);if(!i)return{};const s=i[n],o=e.segments,a=e.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const d=o[c],h=a[d.start][n],f=a[d.end][n];if(_e(s,h,f)){r=s===h,l=s===f;break}}return{first:r,last:l,point:i}}class Fu{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,n,i){const{x:s,y:o,radius:a}=this;return n=n||{start:0,end:gt},t.arc(s,o,a,n.end,n.start,!0),!i.bounds}interpolate(t){const{x:n,y:i,radius:s}=this,o=t.angle;return{x:n+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function pT(e){const{chart:t,fill:n,line:i}=e;if(_t(n))return gT(t,n);if(n==="stack")return dT(e);if(n==="shape")return!0;const s=yT(e);return s instanceof Fu?s:Bu(s,i)}function gT(e,t){const n=e.getDatasetMeta(t);return n&&e.isDatasetVisible(t)?n.dataset:null}function yT(e){return(e.scale||{}).getPointPositionForValue?_T(e):bT(e)}function bT(e){const{scale:t={},fill:n}=e,i=lT(n,t);if(_t(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function _T(e){const{scale:t,fill:n}=e,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=cT(n,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Fu({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function va(e,t,n){const i=pT(t),{chart:s,index:o,line:a,scale:r,axis:l}=t,c=a.options,d=c.fill,h=c.backgroundColor,{above:f=h,below:m=h}=d||{},p=s.getDatasetMeta(o),g=Lc(s,p);i&&a.points.length&&(bi(e,n),xT(e,{line:a,target:i,above:f,below:m,area:n,scale:r,axis:l,clip:g}),_i(e))}function xT(e,t){const{line:n,target:i,above:s,below:o,area:a,scale:r,clip:l}=t,c=n._loop?"angle":t.axis;e.save();let d=o;o!==s&&(c==="x"?(Uu(e,i,a.top),Sa(e,{line:n,target:i,color:s,scale:r,property:c,clip:l}),e.restore(),e.save(),Uu(e,i,a.bottom)):c==="y"&&(Vu(e,i,a.left),Sa(e,{line:n,target:i,color:o,scale:r,property:c,clip:l}),e.restore(),e.save(),Vu(e,i,a.right),d=s)),Sa(e,{line:n,target:i,color:d,scale:r,property:c,clip:l}),e.restore()}function Uu(e,t,n){const{segments:i,points:s}=t;let o=!0,a=!1;e.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],h=s[Ls(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,n),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(h.x,n)}e.lineTo(t.first().x,n),e.closePath(),e.clip()}function Vu(e,t,n){const{segments:i,points:s}=t;let o=!0,a=!1;e.beginPath();for(const r of i){const{start:l,end:c}=r,d=s[l],h=s[Ls(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(n,d.y),e.lineTo(d.x,d.y)),a=!!t.pathSegment(e,r,{move:a}),a?e.closePath():e.lineTo(n,h.y)}e.lineTo(n,t.first().y),e.closePath(),e.clip()}function Sa(e,t){const{line:n,target:i,property:s,color:o,scale:a,clip:r}=t,l=iT(n,i,s);for(const{source:c,target:d,start:h,end:f}of l){const{style:{backgroundColor:m=o}={}}=c,p=i!==!0;e.save(),e.fillStyle=m,wT(e,a,r,p&&Ta(s,h,f)),e.beginPath();const g=!!n.pathSegment(e,c);let y;if(p){g?e.closePath():Hu(e,i,f,s);const _=!!i.pathSegment(e,d,{move:g,reverse:!0});y=g&&_,y||Hu(e,i,h,s)}e.closePath(),e.fill(y?"evenodd":"nonzero"),e.restore()}}function wT(e,t,n,i){const s=t.chart.chartArea,{property:o,start:a,end:r}=i||{};if(o==="x"||o==="y"){let l,c,d,h;o==="x"?(l=a,c=s.top,d=r,h=s.bottom):(l=s.left,c=a,d=s.right,h=r),e.beginPath(),n&&(l=Math.max(l,n.left),d=Math.min(d,n.right),c=Math.max(c,n.top),h=Math.min(h,n.bottom)),e.rect(l,c,d-l,h-c),e.clip()}}function Hu(e,t,n,i){const s=t.interpolate(n,i);s&&e.lineTo(s.x,s.y)}var kT={id:"filler",afterDatasetsUpdate(e,t,n){const i=(e.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<i;++a)o=e.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Is&&(l={visible:e.isDatasetVisible(a),index:a,fill:aT(r,a,i),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=oT(s,a,n.propagate))},beforeDraw(e,t,n){const i=n.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),i&&r.fill&&va(e.ctx,r,o))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!=="beforeDatasetsDraw")return;const i=e.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;zu(o)&&va(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,n){const i=t.meta.$filler;!zu(i)||n.drawTime!=="beforeDatasetDraw"||va(e.ctx,i,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const $u=(e,t)=>{let{boxHeight:n=t,boxWidth:i=t}=e;return e.usePointStyle&&(n=Math.min(n,t),i=e.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:n,itemHeight:Math.max(t,n)}},TT=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Yu extends Yt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,i){this.maxWidth=t,this.maxHeight=n,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=ft(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(i=>t.filter(i,this.chart.data))),t.sort&&(n=n.sort((i,s)=>t.sort(i,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,s=xt(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=$u(i,o);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+r;let h=t;o.textAlign="left",o.textBaseline="middle";let f=-1,m=-d;return this.legendItems.forEach((p,g)=>{const y=i+n/2+o.measureText(p.text).width;(g===0||c[c.length-1]+y+2*r>a)&&(h+=d,c[c.length-(g>0?0:1)]=0,m+=d,f++),l[g]={left:0,top:m,row:f,width:y,height:s},c[c.length-1]+=y+r}),h}_fitCols(t,n,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=a-t;let h=r,f=0,m=0,p=0,g=0;return this.legendItems.forEach((y,_)=>{const{itemWidth:x,itemHeight:T}=vT(i,n,o,y,s);_>0&&m+T+2*r>d&&(h+=f+r,c.push({width:f,height:m}),p+=f+r,g++,f=m=0),l[_]={left:p,top:m,col:g,width:x,height:T},f=Math.max(f,x),m+=T+r}),h+=f,c.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:i,labels:{padding:s},rtl:o}}=this,a=En(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=Ht(i,this.left+s,this.right-this.lineWidths[r]);for(const c of n)r!==c.row&&(r=c.row,l=Ht(i,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=Ht(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of n)c.col!==r&&(r=c.col,l=Ht(i,this.top+t+s,this.bottom-this.columnSizes[r].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;bi(t,this),this._draw(),_i(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=bt.color,l=En(t.rtl,this.left,this.width),c=xt(a.font),{padding:d}=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:g,itemHeight:y}=$u(a,h),_=function(O,S,A){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;s.save();const R=Q(A.lineWidth,1);if(s.fillStyle=Q(A.fillStyle,r),s.lineCap=Q(A.lineCap,"butt"),s.lineDashOffset=Q(A.lineDashOffset,0),s.lineJoin=Q(A.lineJoin,"miter"),s.lineWidth=R,s.strokeStyle=Q(A.strokeStyle,r),s.setLineDash(Q(A.lineDash,[])),a.usePointStyle){const D={radius:g*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:R},v=l.xPlus(O,p/2),C=S+f;pc(s,D,v,C,a.pointStyleWidth&&p)}else{const D=S+Math.max((h-g)/2,0),v=l.leftForLtr(O,p),C=Ne(A.borderRadius);s.beginPath(),Object.values(C).some(I=>I!==0)?On(s,{x:v,y:D,w:p,h:g,radius:C}):s.rect(v,D,p,g),s.fill(),R!==0&&s.stroke()}s.restore()},x=function(O,S,A){en(s,A.text,O,S+y/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},T=this.isHorizontal(),k=this._computeTitleHeight();T?m={x:Ht(o,this.left+d,this.right-i[0]),y:this.top+d+k,line:0}:m={x:this.left+d,y:Ht(o,this.top+k+d,this.bottom-n[0].height),line:0},Dc(this.ctx,t.textDirection);const w=y+d;this.legendItems.forEach((O,S)=>{s.strokeStyle=O.fontColor,s.fillStyle=O.fontColor;const A=s.measureText(O.text).width,R=l.textAlign(O.textAlign||(O.textAlign=a.textAlign)),D=p+f+A;let v=m.x,C=m.y;l.setWidth(this.width),T?S>0&&v+D+d>this.right&&(C=m.y+=w,m.line++,v=m.x=Ht(o,this.left+d,this.right-i[m.line])):S>0&&C+w>this.bottom&&(v=m.x=v+n[m.line].width+d,m.line++,C=m.y=Ht(o,this.top+k+d,this.bottom-n[m.line].height));const I=l.x(v);if(_(I,C,O),v=F_(R,v+p+f,T?v+D:this.right,t.rtl),x(l.x(v),C,O),T)m.x+=D+d;else if(typeof O.text!="string"){const U=c.lineHeight;m.y+=Wu(O,U)+d}else m.y+=w}),Cc(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,i=xt(n.font),s=At(n.padding);if(!n.display)return;const o=En(t.rtl,this.left,this.width),a=this.ctx,r=n.position,l=i.size/2,c=s.top+l;let d,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,h=Ht(t.align,h,this.right-f);else{const p=this.columnSizes.reduce((g,y)=>Math.max(g,y.height),0);d=c+Ht(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const m=Ht(r,h,h+f);a.textAlign=o.textAlign(Xo(r)),a.textBaseline="middle",a.strokeStyle=n.color,a.fillStyle=n.color,a.font=i.string,en(a,n.text,m,d,i)}_computeTitleHeight(){const t=this.options.title,n=xt(t.font),i=At(t.padding);return t.display?n.lineHeight+i.height:0}_getLegendItemAt(t,n){let i,s,o;if(_e(t,this.left,this.right)&&_e(n,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],_e(t,s.left,s.left+s.width)&&_e(n,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const n=this.options;if(!DT(t.type,n))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=TT(s,i);s&&!o&&ft(n.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&ft(n.onHover,[t,i,this],this)}else i&&ft(n.onClick,[t,i,this],this)}}function vT(e,t,n,i,s){const o=ST(i,e,t,n),a=MT(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function ST(e,t,n,i){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+n.size/2+i.measureText(s).width}function MT(e,t,n){let i=e;return typeof t.text!="string"&&(i=Wu(t,n)),i}function Wu(e,t){const n=e.text?e.text.length:0;return t*n}function DT(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var CT={id:"legend",_element:Yu,start(e,t,n){const i=e.legend=new Yu({ctx:e.ctx,options:n,chart:e});$t.configure(e,i,n),$t.addBox(e,i)},stop(e){$t.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const i=e.legend;$t.configure(e,i,n),i.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const i=t.datasetIndex,s=n.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=At(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Ma extends Yt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=n;const s=ut(i.text)?i.text.length:1;this._padding=At(i.padding);const o=s*xt(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:n,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,d,h;return this.isHorizontal()?(d=Ht(r,i,o),h=n+t,c=o-i):(a.position==="left"?(d=i+t,h=Ht(r,s,n),l=tt*-.5):(d=o-t,h=Ht(r,n,s),l=tt*.5),c=s-n),{titleX:d,titleY:h,maxWidth:c,rotation:l}}draw(){const t=this.ctx,n=this.options;if(!n.display)return;const i=xt(n.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);en(t,n.text,0,0,i,{color:n.color,maxWidth:l,rotation:c,textAlign:Xo(n.align),textBaseline:"middle",translation:[a,r]})}}function OT(e,t){const n=new Ma({ctx:e.ctx,options:t,chart:e});$t.configure(e,n,t),$t.addBox(e,n),e.titleBlock=n}var AT={id:"title",_element:Ma,start(e,t,n){OT(e,n)},stop(e){const t=e.titleBlock;$t.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){const i=e.titleBlock;$t.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ns=new WeakMap;var PT={id:"subtitle",start(e,t,n){const i=new Ma({ctx:e.ctx,options:n,chart:e});$t.configure(e,i,n),$t.addBox(e,i),Ns.set(e,i)},stop(e){$t.removeBox(e,Ns.get(e)),Ns.delete(e)},beforeUpdate(e,t,n){const i=Ns.get(e);$t.configure(e,i,n),i.options=n},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ai={average(e){if(!e.length)return!1;let t,n,i=new Set,s=0,o=0;for(t=0,n=e.length;t<n;++t){const r=e[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();i.add(l.x),s+=l.y,++o}}return o===0||i.size===0?!1:{x:[...i].reduce((r,l)=>r+l)/i.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let n=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=e.length;o<a;++o){const l=e[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Cn(t,c);d<s&&(s=d,r=l)}}if(r){const l=r.tooltipPosition();n=l.x,i=l.y}return{x:n,y:i}}};function me(e,t){return t&&(ut(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Te(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
2
2
|
`)>-1?e.split(`
|
|
3
|
-
`):e}function UT(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:e,label:a,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function Ju(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:a,boxHeight:r}=t,l=wt(t.bodyFont),c=wt(t.titleFont),d=wt(t.footerFont),h=o.length,f=s.length,m=i.length,p=At(t.padding);let g=p.height,y=0,_=i.reduce((v,w)=>v+w.before.length+w.lines.length+w.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,h&&(g+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),_){const v=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=m*v+(_-m)*l.lineHeight+(_-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let x=0;const T=function(v){y=Math.max(y,n.measureText(v).width+x)};return n.save(),n.font=c.string,pt(e.title,T),n.font=l.string,pt(e.beforeBody.concat(e.afterBody),T),x=t.displayColors?a+2+t.boxPadding:0,pt(i,v=>{pt(v.before,T),pt(v.lines,T),pt(v.after,T)}),x=0,n.font=d.string,pt(e.footer,T),n.restore(),y+=p.width,{width:y,height:g}}function VT(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function HT(e,t,n,i){const{x:s,width:o}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&s+o+a>t.width||e==="right"&&s-o-a<0)return!0}function $T(e,t,n,i){const{x:s,width:o}=n,{width:a,chartArea:{left:r,right:l}}=e;let c="center";return i==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),HT(c,e,t,n)&&(c="center"),c}function td(e,t,n){const i=n.yAlign||t.yAlign||VT(e,n);return{xAlign:n.xAlign||t.xAlign||$T(e,t,n,i),yAlign:i}}function YT(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function WT(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function ed(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=e,{xAlign:r,yAlign:l}=n,c=s+o,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:m}=Ie(a);let p=YT(t,r);const g=WT(t,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(d,f)+s:r==="right"&&(p+=Math.max(h,m)+s),{x:Rt(p,0,i.width-t.width),y:Rt(g,0,i.height-t.height)}}function Fs(e,t,n){const i=At(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function nd(e){return de([],we(e))}function jT(e,t,n){return Le(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function id(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const sd={beforeTitle:ge,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:ge,beforeBody:ge,beforeLabel:ge,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return G(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:ge,afterBody:ge,beforeFooter:ge,footer:ge,afterFooter:ge};function Kt(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?sd[t].call(n,i):s}class od extends Vt{static positioners=Ai;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new ra(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=jT(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=Kt(i,"beforeTitle",this,t),o=Kt(i,"title",this,t),a=Kt(i,"afterTitle",this,t);let r=[];return r=de(r,we(s)),r=de(r,we(o)),r=de(r,we(a)),r}getBeforeBody(t,n){return nd(Kt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return pt(t,o=>{const a={before:[],lines:[],after:[]},r=id(i,o);de(a.before,we(Kt(r,"beforeLabel",this,o))),de(a.lines,Kt(r,"label",this,o)),de(a.after,we(Kt(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,n){return nd(Kt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=Kt(i,"beforeFooter",this,t),o=Kt(i,"footer",this,t),a=Kt(i,"afterFooter",this,t);let r=[];return r=de(r,we(s)),r=de(r,we(o)),r=de(r,we(a)),r}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=n.length;l<c;++l)r.push(UT(this.chart,n[l]));return t.filter&&(r=r.filter((d,h,f)=>t.filter(d,h,f,i))),t.itemSort&&(r=r.sort((d,h)=>t.itemSort(d,h,i))),pt(r,d=>{const h=id(t.callbacks,d);s.push(Kt(h,"labelColor",this,d)),o.push(Kt(h,"labelPointStyle",this,d)),a.push(Kt(h,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=Ai[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=Ju(this,i),c=Object.assign({},r,l),d=td(this.chart,i,c),h=ed(i,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:h}=Ie(r),{x:f,y:m}=t,{width:p,height:g}=n;let y,_,x,T,v,w;return o==="center"?(v=m+g/2,s==="left"?(y=f,_=y-a,T=v+a,w=v-a):(y=f+p,_=y+a,T=v-a,w=v+a),x=y):(s==="left"?_=f+Math.max(l,d)+a:s==="right"?_=f+p-Math.max(c,h)-a:_=this.caretX,o==="top"?(T=m,v=T-a,y=_-a,x=_+a):(T=m+g,v=T+a,y=_+a,x=_-a),w=T),{x1:y,x2:_,x3:x,y1:T,y2:v,y3:w}}drawTitle(t,n,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=En(i.rtl,this.x,this.width);for(t.x=Fs(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",a=wt(i.titleFont),r=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,n,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,d=wt(o.bodyFont),h=Fs(this,"left",o),f=s.x(h),m=l<d.lineHeight?(d.lineHeight-l)/2:0,p=n.y+m;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ta(t,g,y,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ta(t,g,y,_)}else{t.lineWidth=st(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 g=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),_=Ie(a.borderRadius);Object.values(_).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,On(t,{x:g,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),On(t,{x:y,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:d}=i,h=wt(i.bodyFont);let f=h.lineHeight,m=0;const p=En(i.rtl,this.x,this.width),g=function(P){n.fillText(P,p.x(t.x+m),t.y+f/2),t.y+=f+o},y=p.textAlign(a);let _,x,T,v,w,M,D;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,t.x=Fs(this,y,i),n.fillStyle=i.bodyColor,pt(this.beforeBody,g),m=r&&y!=="right"?a==="center"?c/2+d:c+2+d:0,v=0,M=s.length;v<M;++v){for(_=s[v],x=this.labelTextColors[v],n.fillStyle=x,pt(_.before,g),T=_.lines,r&&T.length&&(this._drawColorBox(n,t,v,p,i),f=Math.max(h.lineHeight,l)),w=0,D=T.length;w<D;++w)g(T[w]),f=h.lineHeight;pt(_.after,g)}m=0,f=h.lineHeight,pt(this.afterBody,g),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let a,r;if(o){const l=En(i.rtl,this.x,this.width);for(t.x=Fs(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",a=wt(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,r=0;r<o;++r)n.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:d}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=Ie(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(r+h,l),a==="top"&&this.drawCaret(t,n,i,s),n.lineTo(r+c-f,l),n.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(r+c,l+d-p),n.quadraticCurveTo(r+c,l+d,r+c-p,l+d),a==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(r+m,l+d),n.quadraticCurveTo(r,l+d,r,l+d-m),a==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(r,l+h),n.quadraticCurveTo(r,l,r+h,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Ai[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Ju(this,t),l=Object.assign({},a,this._size),c=td(n,t,l),d=ed(t,l,c,n);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=At(n.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Ic(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Lc(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!fs(i,s),a=this._positionChanged(s,n);(o||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,i),r=this._positionChanged(a,t),l=n||!fs(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,a=Ai[o.position].call(this,t,n);return a!==!1&&(i!==a.x||s!==a.y)}}var Ht={id:"tooltip",_element:od,positioners:Ai,afterInit(e,t,n){n&&(e.tooltip=new od({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:sd},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},qT=Object.freeze({__proto__:null,Colors:aT,Decimation:uT,Filler:AT,Legend:NT,SubTitle:zT,Title:FT,Tooltip:Ht});const GT=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function XT(e,t,n,i){const s=e.indexOf(t);if(s===-1)return GT(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const KT=(e,t)=>e===null?null:Rt(Math.round(e),0,t);function ad(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class ZT extends sn{static id="category";static defaults={ticks:{callback:ad}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(G(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:XT(i,t,Q(n,t),this._addedLabels),KT(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)s.push({value:a});return s}getLabelForValue(t){return ad.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function QT(e,t){const n=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:h,includeBounds:f}=e,m=o||1,p=d-1,{min:g,max:y}=t,_=!G(a),x=!G(r),T=!G(c),v=(y-g)/(h+1);let w=rc((y-g)/p/m)*m,M,D,P,k;if(w<1e-14&&!_&&!x)return[{value:g},{value:y}];k=Math.ceil(y/w)-Math.floor(g/w),k>p&&(w=rc(k*w/p/m)*m),G(l)||(M=Math.pow(10,l),w=Math.ceil(w*M)/M),s==="ticks"?(D=Math.floor(g/w)*w,P=Math.ceil(y/w)*w):(D=g,P=y),_&&x&&o&&U_((r-a)/o,w/1e3)?(k=Math.round(Math.min((r-a)/w,d)),w=(r-a)/k,D=a,P=r):T?(D=_?a:D,P=x?r:P,k=c-1,w=(P-D)/k):(k=(P-D)/w,fi(k,Math.round(k),w/1e3)?k=Math.round(k):k=Math.ceil(k));const S=Math.max(cc(w),cc(D));M=Math.pow(10,G(l)?S:l),D=Math.round(D*M)/M,P=Math.round(P*M)/M;let A=0;for(_&&(f&&D!==a?(n.push({value:a}),D<a&&A++,fi(Math.round((D+A*w)*M)/M,a,rd(a,v,e))&&A++):D<a&&A++);A<k;++A){const L=Math.round((D+A*w)*M)/M;if(x&&L>r)break;n.push({value:L})}return x&&f&&P!==r?n.length&&fi(n[n.length-1].value,r,rd(r,v,e))?n[n.length-1].value=r:n.push({value:r}):(!x||P===r)&&n.push({value:P}),n}function rd(e,t,{horizontal:n,minRotation:i}){const s=Ot(i),o=(n?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class zs extends sn{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return G(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=n?s:l,r=l=>o=i?o:l;if(t){const l=ce(s),c=ce(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,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(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=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:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=QT(s,o);return t.bounds==="ticks"&&lc(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return gi(t,this.chart.options.locale,this.options.ticks.format)}}class JT extends zs{static id="linear";static defaults={ticks:{callback:ws.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?t:0,this.max=xt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Ot(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.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}}const Pi=e=>Math.floor(Ee(e)),on=(e,t)=>Math.pow(10,Pi(e)+t);function ld(e){return e/Math.pow(10,Pi(e))===1}function cd(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function tS(e,t){const n=t-e;let i=Pi(n);for(;cd(e,t,i)>10;)i++;for(;cd(e,t,i)<10;)i--;return Math.min(i,Pi(e))}function eS(e,{min:t,max:n}){t=te(e.min,t);const i=[],s=Pi(t);let o=tS(t,n),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,d=Math.floor((t-l)/r/10)*r*10;let h=Math.floor((c-d)/Math.pow(10,o)),f=te(e.min,Math.round((l+d+h*Math.pow(10,o))*a)/a);for(;f<n;)i.push({value:f,major:ld(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),f=Math.round((l+d+h*Math.pow(10,o))*a)/a;const m=te(e.max,f);return i.push({value:m,major:ld(m),significand:h}),i}class nS extends sn{static id="logarithmic";static defaults={ticks:{callback:ws.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=zs.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return xt(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=xt(t)?Math.max(0,t):null,this.max=xt(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!xt(this._userMin)&&(this.min=t===on(this.min,0)?on(this.min,-1):on(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=r=>i=t?i:r,a=r=>s=n?s:r;i===s&&(i<=0?(o(1),a(10)):(o(on(i,-1)),a(on(s,1)))),i<=0&&o(on(s,-1)),s<=0&&a(on(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=eS(n,this);return t.bounds==="ticks"&&lc(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":gi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ee(t),this._valueRange=Ee(this.max)-Ee(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ee(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Da(e){const t=e.ticks;if(t.display&&e.display){const n=At(t.backdropPadding);return Q(t.font&&t.font.size,_t.font.size)+n.height}return 0}function iS(e,t,n){return n=dt(n)?n:[n],{w:ix(e,t.string,n),h:n.length*t.lineHeight}}function ud(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function sS(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,a=e.options.pointLabels,r=a.centerPointLabels?it/o:0;for(let l=0;l<o;l++){const c=a.setContext(e.getPointLabelContext(l));s[l]=c.padding;const d=e.getPointPosition(l,e.drawingArea+s[l],r),h=wt(c.font),f=iS(e.ctx,h,e._pointLabels[l]);i[l]=f;const m=Ft(e.getIndexAngle(l)+r),p=Math.round(ys(m)),g=ud(p,d.x,f.w,0,180),y=ud(p,d.y,f.h,90,270);oS(n,t,m,g,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=lS(e,i,s)}function oS(e,t,n,i,s){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function aS(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=n,l=e.getPointPosition(t,i+s+a,o),c=Math.round(ys(Ft(l.angle+bt))),d=dS(l.y,r.h,c),h=cS(c),f=uS(l.x,r.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:f,top:d,right:f+r.w,bottom:d+r.h}}function rS(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:o}=e;return!(_e({x:n,y:i},t)||_e({x:n,y:o},t)||_e({x:s,y:i},t)||_e({x:s,y:o},t))}function lS(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Da(o)/2,additionalAngle:a?it/s:0};let c;for(let d=0;d<s;d++){l.padding=n[d],l.size=t[d];const h=aS(e,d,l);i.push(h),r==="auto"&&(h.visible=rS(h,c),h.visible&&(c=h))}return i}function cS(e){return e===0||e===180?"center":e<180?"left":"right"}function uS(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function dS(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function hS(e,t,n){const{left:i,top:s,right:o,bottom:a}=n,{backdropColor:r}=t;if(!G(r)){const l=Ie(t.borderRadius),c=At(t.backdropPadding);e.fillStyle=r;const d=i-c.left,h=s-c.top,f=o-i+c.width,m=a-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),On(e,{x:d,y:h,w:f,h:m,radius:l}),e.fill()):e.fillRect(d,h,f,m)}}function fS(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(e.getPointLabelContext(s));hS(n,a,o);const r=wt(a.font),{x:l,y:c,textAlign:d}=o;Je(n,e._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:d,textBaseline:"middle"})}}function dd(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,yt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=e.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function mS(e,t,n,i,s){const o=e.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!i||!r||!l||n<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),dd(e,n,a,i),o.closePath(),o.stroke(),o.restore())}function pS(e,t,n){return Le(e,{label:n,index:t,type:"pointLabel"})}class gS extends zs{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ws.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=At(Da(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=xt(t)&&!isNaN(t)?t:0,this.max=xt(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Da(this.options))}generateTickLabels(t){zs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const s=mt(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?sS(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=yt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Ft(t*n+Ot(i))}getDistanceFromCenterForValue(t){if(G(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(G(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return pS(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const s=this.getIndexAngle(t)-bt+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),dd(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,a=this._pointLabels.length;let r,l,c;if(n.pointLabels.display&&fS(this,a),s.display&&this.ticks.forEach((d,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);const f=this.getContext(h),m=s.setContext(f),p=o.setContext(f);mS(this,m,l,a,p)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const d=i.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:f}=d;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),d=wt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const h=At(c.backdropPadding);t.fillRect(-a/2-h.left,-o-d.size/2-h.top,a+h.width,d.size+h.height)}Je(t,r.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Us={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Zt=Object.keys(Us);function hd(e,t){return e-t}function fd(e,t){if(G(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),xt(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(Re(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,s)),+a)}function md(e,t,n,i){const s=Zt.length;for(let o=Zt.indexOf(e);o<s-1;++o){const a=Us[Zt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(r*a.size))<=i)return Zt[o]}return Zt[s-1]}function yS(e,t,n,i,s){for(let o=Zt.length-1;o>=Zt.indexOf(n);o--){const a=Zt[o];if(Us[a].common&&e._adapter.diff(s,i,a)>=t-1)return a}return Zt[n?Zt.indexOf(n):0]}function bS(e){for(let t=Zt.indexOf(e)+1,n=Zt.length;t<n;++t)if(Us[Zt[t]].common)return Zt[t]}function pd(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=Go(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function _S(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,i))l=n[r],l>=0&&(t[l].major=!0);return t}function gd(e,t,n){const i=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,i.push({value:r,major:!1});return o===0||!n?i:_S(e,i,s,n)}class Ca extends sn{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const i=t.time||(t.time={}),s=this._adapter=new su._date(t.adapters.date);s.init(n),hi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:fd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=xt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=xt(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,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 o=this.min,a=this.max,r=Y_(s,o,a);return this._unit=n.unit||(i.autoSkip?md(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):yS(this,r.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:bS(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),gd(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=Rt(n,0,a),i=Rt(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||md(o.minUnit,n,i,this._getLabelCapacity(n)),r=Q(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Re(l)||l===!0,d={};let h=n,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,n,a)>1e5*r)throw new Error(n+" and "+i+" are too far apart with stepSize of "+r+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,r,a),m++)pd(d,f,p);return(f===i||s.bounds==="ticks"||m===1)&&pd(d,f,p),Object.keys(d).sort(hd).map(g=>+g)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,a=n||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,s){const o=this.options,a=o.ticks.callback;if(a)return mt(a,[t,n,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],h=c&&r[c],f=i[n],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:d))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,s=Ot(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,gd(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],n,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(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(fd(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return hc(t.sort(hd))}}function Vs(e,t,n){let i=0,s=e.length-1,o,a,r,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=be(e,"pos",t)),{pos:o,time:r}=e[i],{pos:a,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=be(e,"time",t)),{time:o,pos:r}=e[i],{time:a,pos:l}=e[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class xS extends Ca{static id="timeseries";static defaults=Ca.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Vs(n,this.min),this._tableRange=Vs(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let a,r,l,c,d;for(a=0,r=t.length;a<r;++a)c=t[a],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)d=s[a+1],l=s[a-1],c=s[a],Math.round((d+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Vs(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Vs(this._table,i*this._tableRange+this._minPos,!0)}}var wS=Object.freeze({__proto__:null,CategoryScale:ZT,LinearScale:JT,LogarithmicScale:nS,RadialLinearScale:gS,TimeScale:Ca,TimeSeriesScale:xS});const kS=[kw,Jk,qT,wS];function TS(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Ht.positioners[n]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const d=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=d.width/2,m=js(c,h,f),p=c.y,g=c.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:p-e.tooltipState.offsetY,xAlign:g}},pa.modes.customInteractionMode=function(l,c){const d=Ne(c,l),h=[];return pa.evaluateInteractionItems(l,l.options.indexAxis||"x",d,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(d.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&d.x!==null&&f.inXRange(d.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=e.numLabels.value>25?Fd:zd,o=({chart:l,index:c})=>{const d=l.data;return{size:s,style:d?.isLabelEmpty?.[c]?"italic":"normal"}},a=(l,c,d)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(d),c&&c.length>qs?c.slice(0,qs)+"...":c):l.getLabelForValue(Number(c)),r=u.computed(()=>({indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:o,callback:function(l,c){return a(this,l,c)}},title:{display:e.indexAxis==="y"?!G(e.metricAxesTitle?.value):!G(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:o,callback:function(l,c){return a(this,l,c)}},title:{display:e.indexAxis==="x"?!G(e.metricAxesTitle?.value):!G(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:l=>{Ld(e.tooltipState,l)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.getCurrentInstance()&&u.onUnmounted(()=>{Ht.positioners[n]&&delete Ht.positioners[n]}),r}Xt.register(...kS);const SS=(e,t)=>{const n=t.datasets.map(s=>s.label),i=e.datasets.map(s=>s.label);return e.datasets.length===t.datasets.length&&n.every((s,o)=>s===i[o])};function vS(e,t,n,i,s){const o=u.shallowRef(null),a=(r,l)=>{if(t.value)return new Xt(t.value,{type:e,data:r,plugins:i,options:l})};return u.onMounted(()=>{o.value=a(n.value,s.value)}),u.onBeforeUnmount(()=>{G(o.value)||o.value.destroy()}),u.watch(n,(r,l)=>{if(SS(l,r)&&!G(o.value)){for(const[c,d]of r.datasets.entries())Object.assign(o.value.data.datasets[c],d);o.value.data.labels=r.labels,o.value.update()}else G(o.value)||o.value.destroy(),o.value=a(r,s.value)}),u.watch(t,()=>{G(o.value)||o.value.destroy(),o.value=a(n.value,s.value)}),u.watch(s,(r,l)=>{(r.indexAxis!==l.indexAxis||JSON.stringify(r.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(r.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(G(o.value)||o.value.destroy(),o.value=a(n.value,r))}),o}const yd=1e3,MS=1e4,bd=1e6,_d=1e9,xd=1e12,Ei=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((o,a)=>{a&&a%3===0&&i.push(n),i.push(o)}),i.reverse().join("")},In=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let a=o.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function Ri(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?MS:yd;return e<s||t.precision&&t.precision>Math.log10(e)?n=Ei(In(e,1,t),t):e<bd?n=`${In(e,yd,t)}k`:e<_d?n=`${In(e,bd,t)}m`:e<xd?n=`${Ei(In(e,_d,t),t)}b`:n=`${Ei(In(e,xd,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Ri.addCommas=Ei;function DS(e,t,n){const{i18n:i}=q.useI18n(),{formatBytes:s}=oe({i18n:i}),{translateUnit:o}=q.useTranslatedUnits();return{legendValues:u.computed(()=>e.value.datasets.reduce((r,l)=>{const c=l.total?l.total:l.data.reduce((f,m)=>f+(typeof m=="number"?Number(m)||0:Number(m&&m.y)||0),0);let d;const h=l.unit??n.value;if(h==="bytes")d=s(c);else{const f=o(h,c);d=i&&i.t("legend.datapointValueDisplay",{value:Ri(c,{capital:!0}),unit:f})||`${Ri(c,{capital:!0})} ${h}`}return{...r,[l.label]:{raw:c,formatted:d,isThreshold:l.isThreshold}}},{}))}}function CS(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Ht.positioners[n]=function(o,a){if(!o.length||a.x===null||a.y===null)return!1;const r=this.chart.canvas.getBoundingClientRect(),l=e.tooltipState.width||this.width,c=r.width/2,d=js(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:d-e.tooltipState.offsetX,y:h,xAlign:f}};const s=u.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:o=>{Ld(e.tooltipState,o)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return u.onUnmounted(()=>{Ht.positioners[n]&&delete Ht.positioners[n]}),{options:s}}function OS(e){const t=u.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:10,source:"auto",maxRotation:0,callback:d=>{const h=new Date(d);return Qa({tickValue:h,granularity:e.granularity.value,dayBoundaryCrossed:l.value})}},title:{display:!1},border:{display:!1},stacked:e.stacked.value})),n=u.computed(()=>!!e.rightYAxis?.value),i=u.computed(()=>({title:{display:!G(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,...e.leftYAxisGrid?.value===!1?{drawOnChartArea:!1}:{}},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value,...n.value?{display:"auto"}:{}})),s=u.computed(()=>{const d=e.rightYAxis?.value;if(d)return{display:"auto",position:"right",title:{display:!G(d.title),text:d.title,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,drawOnChartArea:d.showGrid??!1},beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),a=`lineChartTooltipPosition-${e.tooltipState.chartID}`,r={enabled:!1,position:a};Ht.positioners[a]=function(d,h){if(!d.length||e.tooltipState.interactionMode==="interactive"||h.x===null||h.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),m=e.tooltipState.width||this.width,p=e.tooltipState.height||this.height,g=f.width/2,y=f.height/2,_=js(h,m,g);let x=Nd(h,p,y);const T=h.y<y?"top":"bottom",v=h.x<g?"left":"center";return p>f.height&&(x=0),{x:_,y:x,xAlign:v,yAlign:T}};const l=u.computed(()=>{const d=Number(e.timeRangeMs.value),h=new Date,f=new Date(h.getTime()-d);return Wl(d)>24||f.getDate()!==h.getDate()}),c=u.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:i.value,...s.value?{[Na]:s.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:d=>{Ia(e.tooltipState,d,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.onUnmounted(()=>{Ht.positioners[a]&&delete Ht.positioners[a]}),{options:c}}const AS=["usd","bytes"],PS="usd";function ES(e){const{i18n:t}=q.useI18n(),{formatUnit:n}=oe({i18n:t}),i=(m,p)=>!p||!AS.includes(p)?m:m===0&&p===PS?t.formatNumber(0,{style:"currency",currency:"USD"}):n(m,p),s=u.computed(()=>{const m=Number(e.timeRangeMs.value),p=new Date,g=new Date(p.getTime()-m);return Wl(m)>24||g.getDate()!==p.getDate()}),o=u.computed(()=>({display:!G(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=u.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:m=>i(m,e.xMetricUnit?.value)},title:o.value,border:{display:!1}})),r=u.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:m=>Qa({tickValue:new Date(m),granularity:e.granularity.value,dayBoundaryCrossed:s.value})},title:{display:!1},border:{display:!1}})),l=u.computed(()=>({title:{display:!G(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:m=>i(m,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),c=(m,p,g)=>{const y=g?.timestamp;return y===void 0?"":zn({tickValue:new Date(y),granularity:p})},h=`scatterChartTooltipPosition-${e.tooltipState.chartID}`;Ht.positioners[h]=function(m,p){if(!m.length||e.tooltipState.interactionMode==="interactive"||p.x===null||p.y===null)return!1;const g=this.chart.canvas.getBoundingClientRect(),y=e.tooltipState.width||this.width,_=e.tooltipState.height||this.height,x=g.width/2,T=g.height/2,v=js(p,y,x);let w=Nd(p,_,T);const M=p.y<T?"top":"bottom",D=p.x<x?"left":"center";return _>g.height&&(w=0),{x:v,y:w,xAlign:D,yAlign:M}};const f=u.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"point",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.xMetric?.value?a.value:r.value,y:l.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:h,external:m=>{Ia(e.tooltipState,m,e.granularity.value,{...e.xMetric?.value?{contextFormatter:c}:{}})}},outlierBandPlugin:{value:e.outlierValue?.value,color:e.themeColors.value.outlierBand},referenceLinePlugin:{lines:e.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.onUnmounted(()=>{Ht.positioners[h]&&delete Ht.positioners[h]}),{options:f}}const RS=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},IS="#0044f4",wd="#6c7489",LS="#d60027",NS="#ffc400",BS="#bee2ff",FS="#8fc1ff",zS="#5f9aff",US="#306fff",VS="#b5ffee",HS="#00fabe",$S="#00d6a4",YS="#00a17b",WS="#007d60",jS="#005944",qS="#b5ffee",GS="#00fabe",XS="#b5ffee",KS="#00a17b",ZS="#fff296",QS="#ffe04b",JS="#ffc400",tv="#b37600",ev="#995c00",nv="#804400",iv="#fff296",sv="#ffe04b",ov="#ffc2b3",av="#ff9877",rv="#ff723c",lv="#f75008",cv="#d13500",uv="#a31f00",dv="#ffc2b3",hv="#ff9877",fv="#ff723c",mv="#f75008",pv="#d13500",gv="#a31f00",yv="#ffc2b3",bv="#ff9877",_v="#ff723c",xv="#f75008",wv="#d13500",kv="#a31f00",Tv="#ffc2b3",Sv="#ff9877",vv="#ff723c",Mv="#f75008",Dv="#d13500",Cv="#a31f00",Ov="#ffc2b3",Av="#ff9877",Pv="#ff723c",Ev="#f75008",Rv="#d13500",Iv="#ffabab",Lv="#ff7272",Nv="#ff3954",Bv="#f50045",Fv="#d60027",zv="#ad000e",Uv="#ffabab",Vv="#ff7272",Hv="#ff3954",$v="#f50045",Yv="#d60027",Wv="#eefaff",jv="#ecfffb",qv="#fffce0",Gv="#fff1ef",Xv="#ffe5e5",Kv="#5f9aff",Zv="#00d6a4",Qv="#ffc400",Jv="#ff723c",tM="#ff3954",eM={100:BS,101:FS,102:zS,103:US,200:VS,201:HS,202:$S,203:YS,204:WS,205:jS,206:qS,207:GS,208:XS,226:KS,300:ZS,301:QS,302:JS,303:tv,304:ev,305:nv,307:iv,308:sv,400:ov,401:av,402:rv,403:lv,404:cv,405:uv,406:dv,407:hv,408:fv,409:mv,410:pv,411:gv,412:yv,413:bv,414:_v,415:xv,416:wv,417:kv,418:Tv,421:Sv,422:vv,423:Mv,424:Dv,425:Cv,426:Ov,428:Av,429:Pv,431:Ev,451:Rv,500:Iv,501:Lv,502:Nv,503:Bv,504:Fv,505:zv,506:Uv,507:Vv,508:Hv,510:$v,511:Yv},nM={100:Wv,200:jv,300:qv,400:Gv,500:Xv},kd={"1XX":Kv,"2XX":Zv,"3XX":Qv,"4XX":Jv,"5XX":tM},iM={error:LS,warning:NS,empty:"#9DA99D",neutral:wd,____OTHER____:IS},Td=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],Sd=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],sM=e=>RS(e),vd=({discriminator:e,theme:t="light",customPalette:n=void 0})=>{const i=Math.abs(Math.floor(e));return n?n[i%n.length]:t==="dark"?Sd[i%Sd.length]:Td[i%Td.length]},Ii=({state:e})=>iM[e]??wd,oM=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return eM[n]??nM[i]??Ii({state:"neutral"})},aM=({group:e})=>kd[e]?kd[e]:Ii({state:"neutral"}),Li=({discriminator:e=void 0,state:t=void 0,dimension:n=void 0,dimensionValue:i=void 0,metric:s=void 0,customPalette:o=void 0})=>{let a="light";if(u.hasInjectionContext()&&(a=u.inject("app:konnectColorMode",u.computed(()=>"light")).value),e!==void 0)return vd({discriminator:e,theme:a,customPalette:o});if(t!==void 0)return Ii({state:t});if(i&&["empty","____OTHER____"].includes(i))return Ii({state:i});if(n!==void 0&&i!==void 0){if(n==="status_code")return oM({statusCode:i});if(n==="status_code_grouped")return aM({group:i})}return n||i||s?vd({discriminator:sM(`${n??""}${i??""}${s??""}`),theme:a,customPalette:o}):Ii({state:"neutral"})};function rM(e){const{isMultiMetric:t,hasDimensions:n,metricNames:i,barSegmentLabels:s,pivotRecords:o,rowLabels:a,colorPalette:r,seriesDimension:l}=e,{i18n:c}=q.useI18n(),{evaluateFeatureFlag:d}=q.useEvaluateFeatureFlag(),h=d("analytics-color-updates",!1);return t?i.map(f=>({label:c&&c.te(`chartLabels.${f}`)&&c.t(`chartLabels.${f}`)||f,backgroundColor:h?Li({metric:f}):Ba(i.indexOf(f),he),data:a.map((m,p)=>n?o[`${m.id},${f}`]||0:o[`${p},${f}`]||null)})):Array.from(s).flatMap((f,m)=>f?{dimension:l,dimensionValue:f.id,label:c&&c.te(`chartLabels.${f.name}`)&&c.t(`chartLabels.${f.name}`)||f.name,backgroundColor:h?Li({dimension:l,dimensionValue:f.id}):Fa(m,f.name,f.id==="empty",r??he),data:a.map(p=>o[`${p.id},${f.id}`]||null),isSegmentEmpty:f.id==="empty"}:[])}function lM(e,t){const{i18n:n}=q.useI18n();return u.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const s=t.value.data,{display:o,metric_names:a}=t.value.meta,r=o&&Object.keys(o),l=a&&a.length>1,c=o&&r&&r.length>0,d=c&&r.length>1;if(!s.length||!a)return{datasets:[],labels:[]};const h=c&&r||a,f=h[0],m=h.length>1?h[1]:h[0],p=Object.fromEntries(l?s.flatMap(k=>a.map((S,A)=>{const L=k.event[f],R=c?`${L},${S}`:`${A},${S}`,H=k.event[S];return[R,H]})):s.map(k=>{const S=c?`${k.event[f]},${k.event[m]}`:`${f},${m}`,A=k.event[a[0]];return[S,A]})),g=Object.keys(p).reduce((k,S)=>{const[A]=S.split(","),L=p[S];return k[A]?k[A]+=L:k[A]=L,k},{}),y=Object.entries(g).sort(([,k],[,S])=>Number(S)-Number(k)).map(([k])=>k),_=o[f],x=o[m];let T=c&&_&&Object.entries(_).map(([k,S])=>({id:k,name:S.name}))||a.map(k=>({id:k,name:k})),v=c&&x&&Object.entries(x).map(([k,S])=>({id:k,name:S.name}))||a.map(k=>({id:k,name:k}));if(c&&f==="country_code"&&(T=T.map(k=>({...k,name:Co(k.id)||k.name}))),c&&m==="country_code"&&(v=v.map(k=>({...k,name:Co(k.id)||k.name}))),f!=="status_code"&&f!=="status_code_grouped"&&(T.sort((k,S)=>y.indexOf(k.id)-y.indexOf(S.id)),v.sort((k,S)=>y.indexOf(k.id)-y.indexOf(S.id))),!T||!v)return{labels:[],datasets:[]};const w=rM({isMultiMetric:l,hasDimensions:c,metricNames:a,dimensionFieldNames:h,barSegmentLabels:v,pivotRecords:p,rowLabels:T,seriesDimension:m,colorPalette:e.colorPalette||he}),M=c?T.map(k=>n&&n.te(`chartLabels.${k.name}`)&&n.t(`chartLabels.${k.name}`)||k.name):a.map(k=>n&&n.te(`chartLabels.${k}`)&&n.t(`chartLabels.${k}`)||k),D=T.map(k=>k.id==="empty");return{labels:M,datasets:w,isLabelEmpty:D,isMultiDimension:d}}}catch(s){return console.error(s),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const cM=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,s)=>i+s*n),uM=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return jl(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},dM=(e,t,n,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),r=Math.floor((e-i)/n)*n+i,l=Math.floor((a-i)/n)*n+i+n;return cM(r,l,n)};function hM(e,t){const{i18n:n}=q.useI18n(),{evaluateFeatureFlag:i}=q.useEvaluateFeatureFlag(),s=i("analytics-color-updates",!1);return u.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:r,metric_names:l,metric_units:c,start:d,end:h}=t.value.meta,f=new Date(d).getTime(),m=new Date(h).getTime();if(!l)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const p=r&&Object.keys(r)||l,g=p&&p[0],y=r?.[g],_=!!y&&l.length>1;let x=r&&y&&Object.keys(y).map(k=>({id:k,name:y[k].name}))||l.map(k=>({id:k,name:k}));g==="country_code"&&(x=x.map(k=>({...k,name:Co(k.id)||k.name})));const T=t.value.meta.granularity_ms;if(typeof T!="number"||isNaN(T)||!isFinite(T)||T===0)return console.error("Invalid step value:",T),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const v=uM(f),w=dM(f,m,T,v,a),M=a?.length?a.reduce((k,S)=>{const A=new Date(S.timestamp).valueOf(),L=S.event;for(const R of l)A in k||(k[A]={}),R in k[A]||(k[A][R]={});for(const R of l)x.forEach(H=>{(y?L[g]===H.id:R===H.id)?(k[A][R]||(k[A][R]={}),k[A][R][H.id]=Math.round(Number(L[R])*1e3)/1e3):p.length||(k[A][R]||(k[A][R]={}),k[A][R][H.id]=Math.round(Number(L[H.id])*1e3)/1e3)});return k},{}):{},P=[...y||l.length===1?l.flatMap(k=>x.map(S=>[k,S.id,S.name,S.id==="empty"])):x.map(k=>[k.name,k.id,k.name,k.id==="empty"])].map(([k,S,A,L],R)=>{const H=w.map(C=>C in M&&k in M[C]?{x:C,y:M[C][k][S]||0}:{x:C,y:0});let{colorPalette:W,fill:$}=e;G(W)&&(W=he);const K=s?Li({dimension:g,dimensionValue:S}):Fa(R,A,L,W),lt=lh(A)?n.t(`chartLabels.${A}`):A,rt=lh(k)?n.t(`chartLabels.${k}`):k,X=l.findIndex(C=>C===k),z=e.metricAxisMap?.[k]==="right";return{dimension:g,dimensionValue:S,rawDimension:A,rawMetric:k,label:_?`${lt} — ${rt}`:lt,borderColor:K,backgroundColor:K,data:H,total:H.reduce((C,{y:E})=>C+Number(E),0),...e1,..._?{borderDash:X===0?[]:[X*4,2]}:{},...!_&&z?{borderDash:[4,2]}:{},...z?{yAxisID:Na}:{},...e.metricAxisMap?{unit:c?.[k]??""}:{},fill:$,borderWidth:$?i1:n1,isSegmentEmpty:L}});return g==="status_code"||g==="status_code_grouped"?P.sort((k,S)=>(k.label??"")<(S.label??"")?-1:1):P.sort((k,S)=>Number(k.total)<Number(S.total)?-1:1),{datasets:P}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const fM=3,mM=.6,Md=2,pM=2,Dd=50,gM=[6,4],yM=[2,3],bM=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function _M(e,t){const{i18n:n}=q.useI18n(),{evaluateFeatureFlag:i}=q.useEvaluateFeatureFlag(),s=i("analytics-color-updates",!1),o=(a,r)=>r||(a===Dd?n.t("scatter.median"):n.t("scatter.percentile",{value:a}));return u.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:r,dimension:l,display:c,xMetric:d,xMetricUnit:h}=a,f=d?n.te(`chartLabels.${d}`)&&n.t(`chartLabels.${d}`)||d:"",m=e.scatter||{},p=m.jitterMs??0,g=m.pointRadius??fM,y=m.pointOpacity??mM,_=new Map,x=[];a.points.forEach(R=>{const H=R.group??r,W=_.get(H)||[];let $,K;R.x!==void 0?($={x:R.x,timestamp:R.timestamp},K=[{label:f,value:R.x,...h?{unit:h}:{}},...R.extras??[]]):($={x:R.timestamp+bM(p,R.timestamp+R.value)},K=R.extras??[]),W.push({...$,y:R.value,...K.length?{extras:K}:{}}),_.set(H,W),x.push(R.value)});const T=m.percentileLines||[],v=[...T.map(R=>R.percentile),...m.outlierPercentile!==void 0?[m.outlierPercentile]:[]],w=v.length?q1(x,v):new Map,M=m.outlierPercentile!==void 0?w.get(m.outlierPercentile):void 0,D=M!==void 0&&Number.isFinite(M),P=G(e.colorPalette)?he:e.colorPalette,k=e.themeColors?.value??tr(),S=[],A=R=>{const H=R?.y;return D&&Number.isFinite(H)&&H>M};Array.from(_.entries()).forEach(([R,H],W)=>{const $=l&&c?.[R]?.name||R,K=R==="empty",lt=s?Li({dimension:l,dimensionValue:R}):Fa(W,$,K,P),rt=Ja(lt,y),X=n.te(`chartLabels.${$}`)&&n.t(`chartLabels.${$}`)||$;S.push({dimension:l,dimensionValue:R,type:"scatter",rawDimension:$,rawMetric:r,label:X,borderColor:z=>A(z.raw)?k.outlier:lt,backgroundColor:z=>A(z.raw)?k.outlier:rt,pointRadius:z=>A(z.raw)?g+Md:g,pointHoverRadius:z=>(A(z.raw)?g+Md:g)+pM,data:H,pointBorderWidth:0,showLine:!1,isSegmentEmpty:K})});const L=[];return T.forEach(R=>{const H=w.get(R.percentile);if(H===void 0||!Number.isFinite(H))return;const W=R.percentile===Dd;L.push({percentile:R.percentile,label:o(R.percentile,R.label),value:H,color:R.color||(W?k.medianLine:k.outlier),borderDash:R.borderDash||(W?gM:yM)})}),{datasets:S,...D?{outlier:{value:M,label:n.t("scatter.outlier",{label:o(m.outlierPercentile)}),color:k.outlier}}:{},...L.length?{referenceLines:L}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const xM=(e,t)=>{u.watch([e,t],(n,i,s)=>{const[o,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,o),s(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function wM(){const{i18n:e}=q.useI18n();return{translateUnit:(n,i)=>{const s=i===1,o=`chartUnits.${n}`;return zi(n)?"":e.te(o)?e.t(o,{plural:s?"":"s"}):n}}}const kM="analytics-query-provider",Oa="analytics-dashboard-coordinator",Cd=2,Aa="____OTHER____",TM="empty";function SM(){const e=u.inject(kM);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function Od(e,t){return u.getCurrentScope()?(u.onScopeDispose(e,t),!0):!1}const Ad=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const vM=e=>e!=null,MM=Object.prototype.toString,DM=e=>MM.call(e)==="[object Object]";function Hs(e){return Array.isArray(e)?e:[e]}function CM(e){return u.getCurrentInstance()}function OM(e,t={}){if(!u.isRef(e))return u.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=u.customRef(()=>({get(){return e.value[i]},set(s){var o;if(!((o=u.toValue(t.replaceRef))!==null&&o!==void 0)||o)if(Array.isArray(e.value)){const a=[...e.value];a[i]=s,e.value=a}else{const a={...e.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[i]=s}}));return n}function AM(e,t=!0,n){CM()?u.onMounted(e,n):t?e():u.nextTick(e)}function PM(e,t,n){return u.watch(e,t,{...n,immediate:!0})}const $s=Ad?window:void 0;function Ln(e){var t;const n=u.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Ni(...e){const t=(i,s,o,a)=>(i.addEventListener(s,o,a),()=>i.removeEventListener(s,o,a)),n=u.computed(()=>{const i=Hs(u.toValue(e[0])).filter(s=>s!=null);return i.every(s=>typeof s!="string")?i:void 0});return PM(()=>{var i,s;return[(i=(s=n.value)===null||s===void 0?void 0:s.map(o=>Ln(o)))!==null&&i!==void 0?i:[$s].filter(o=>o!=null),Hs(u.toValue(n.value?e[1]:e[0])),Hs(u.unref(n.value?e[2]:e[1])),u.toValue(n.value?e[3]:e[2])]},([i,s,o,a],r,l)=>{if(!i?.length||!s?.length||!o?.length)return;const c=DM(a)?{...a}:a,d=i.flatMap(h=>s.flatMap(f=>o.map(m=>t(h,f,m,c))));l(()=>{d.forEach(h=>h())})},{flush:"post"})}function EM(){const e=u.shallowRef(!1),t=u.getCurrentInstance();return t&&u.onMounted(()=>{e.value=!0},t),e}function Pd(e){const t=EM();return u.computed(()=>(t.value,!!e()))}function RM(e,t,n={}){const{window:i=$s,...s}=n;let o;const a=Pd(()=>i&&"MutationObserver"in i),r=()=>{o&&(o.disconnect(),o=void 0)},l=u.watch(u.computed(()=>{const h=Hs(u.toValue(e)).map(Ln).filter(vM);return new Set(h)}),h=>{r(),a.value&&h.size&&(o=new MutationObserver(t),h.forEach(f=>o.observe(f,s)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),d=()=>{l(),r()};return Od(d),{isSupported:a,stop:d,takeRecords:c}}const Ys={speed:2,margin:30,direction:"both"};function IM(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function LM(e,t={}){var n,i,s,o;const{pointerTypes:a,preventDefault:r,stopPropagation:l,exact:c,onMove:d,onEnd:h,onStart:f,initialValue:m,axis:p="both",draggingElement:g=$s,containerElement:y,handle:_=e,buttons:x=[0],restrictInView:T,autoScroll:v=!1}=t,w=u.ref((n=u.toValue(m))!==null&&n!==void 0?n:{x:0,y:0}),M=u.ref(),D=z=>a?a.includes(z.pointerType):!0,P=z=>{u.toValue(r)&&z.preventDefault(),u.toValue(l)&&z.stopPropagation()},k=u.toValue(v),S=typeof k=="object"?{speed:(i=u.toValue(k.speed))!==null&&i!==void 0?i:Ys.speed,margin:(s=u.toValue(k.margin))!==null&&s!==void 0?s:Ys.margin,direction:(o=k.direction)!==null&&o!==void 0?o:Ys.direction}:Ys,A=z=>typeof z=="number"?[z,z]:[z.x,z.y],L=(z,C,E)=>{const{clientWidth:N,clientHeight:V,scrollLeft:tt,scrollTop:Z,scrollWidth:F,scrollHeight:nt}=z,[gt,ct]=A(S.margin),[at,Ct]=A(S.speed);let B=0,U=0;(S.direction==="x"||S.direction==="both")&&(E.x<gt&&tt>0?B=-at:E.x+C.width>N-gt&&tt<F-N&&(B=at)),(S.direction==="y"||S.direction==="both")&&(E.y<ct&&Z>0?U=-Ct:E.y+C.height>V-ct&&Z<nt-V&&(U=Ct)),(B||U)&&z.scrollBy({left:B,top:U,behavior:"auto"})};let R=null;const H=()=>{const z=u.toValue(y);z&&!R&&(R=setInterval(()=>{const C=u.toValue(e).getBoundingClientRect(),{x:E,y:N}=w.value,V={x:E-z.scrollLeft,y:N-z.scrollTop};V.x>=0&&V.y>=0&&(L(z,C,V),V.x+=z.scrollLeft,V.y+=z.scrollTop,w.value=V)},1e3/60))},W=()=>{R&&(clearInterval(R),R=null)},$=(z,C,E,N)=>{const[V,tt]=typeof E=="number"?[E,E]:[E.x,E.y],{clientWidth:Z,clientHeight:F}=C;return z.x<V||z.x+N.width>Z-V||z.y<tt||z.y+N.height>F-tt},K=()=>{if(u.toValue(t.disabled)||!M.value)return;const z=u.toValue(y);if(!z)return;const C=u.toValue(e).getBoundingClientRect(),{x:E,y:N}=w.value,V={x:E-z.scrollLeft,y:N-z.scrollTop};$(V,z,S.margin,C)?H():W()};u.toValue(v)&&u.watch(w,K);const lt=z=>{var C;if(!u.toValue(x).includes(z.button)||u.toValue(t.disabled)||!D(z)||u.toValue(c)&&z.target!==u.toValue(e))return;const E=u.toValue(y),N=E==null||(C=E.getBoundingClientRect)===null||C===void 0?void 0:C.call(E),V=u.toValue(e).getBoundingClientRect(),tt={x:z.clientX-(E?V.left-N.left+(v?0:E.scrollLeft):V.left),y:z.clientY-(E?V.top-N.top+(v?0:E.scrollTop):V.top)};f?.(tt,z)!==!1&&(M.value=tt,P(z))},rt=z=>{if(u.toValue(t.disabled)||!D(z)||!M.value)return;const C=u.toValue(y);C instanceof HTMLElement&&IM(C);const E=u.toValue(e).getBoundingClientRect();let{x:N,y:V}=w.value;if((p==="x"||p==="both")&&(N=z.clientX-M.value.x,C&&(N=Math.min(Math.max(0,N),C.scrollWidth-E.width))),(p==="y"||p==="both")&&(V=z.clientY-M.value.y,C&&(V=Math.min(Math.max(0,V),C.scrollHeight-E.height))),u.toValue(v)&&C&&(R===null&&L(C,E,{x:N,y:V}),N+=C.scrollLeft,V+=C.scrollTop),C&&(T||v)){if(p!=="y"){const tt=N-C.scrollLeft;tt<0?N=C.scrollLeft:tt>C.clientWidth-E.width&&(N=C.clientWidth-E.width+C.scrollLeft)}if(p!=="x"){const tt=V-C.scrollTop;tt<0?V=C.scrollTop:tt>C.clientHeight-E.height&&(V=C.clientHeight-E.height+C.scrollTop)}}w.value={x:N,y:V},d?.(w.value,z),P(z)},X=z=>{u.toValue(t.disabled)||!D(z)||M.value&&(M.value=void 0,v&&W(),h?.(w.value,z),P(z))};if(Ad){const z=()=>{var C;return{capture:(C=t.capture)!==null&&C!==void 0?C:!0,passive:!u.toValue(r)}};Ni(_,"pointerdown",lt,z),Ni(g,"pointermove",rt,z),Ni(g,["pointerup","pointercancel"],X,z)}return{...OM(w),position:w,isDragging:u.computed(()=>!!M.value),style:u.computed(()=>`
|
|
3
|
+
`):e}function ET(e,t){const{element:n,datasetIndex:i,index:s}=t,o=e.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:e,label:a,parsed:o.getParsed(s),raw:e.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:n}}function ju(e,t){const n=e.chart.ctx,{body:i,footer:s,title:o}=e,{boxWidth:a,boxHeight:r}=t,l=xt(t.bodyFont),c=xt(t.titleFont),d=xt(t.footerFont),h=o.length,f=s.length,m=i.length,p=At(t.padding);let g=p.height,y=0,_=i.reduce((k,w)=>k+w.before.length+w.lines.length+w.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,h&&(g+=h*c.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),_){const k=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=m*k+(_-m)*l.lineHeight+(_-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let x=0;const T=function(k){y=Math.max(y,n.measureText(k).width+x)};return n.save(),n.font=c.string,mt(e.title,T),n.font=l.string,mt(e.beforeBody.concat(e.afterBody),T),x=t.displayColors?a+2+t.boxPadding:0,mt(i,k=>{mt(k.before,T),mt(k.lines,T),mt(k.after,T)}),x=0,n.font=d.string,mt(e.footer,T),n.restore(),y+=p.width,{width:y,height:g}}function RT(e,t){const{y:n,height:i}=t;return n<i/2?"top":n>e.height-i/2?"bottom":"center"}function IT(e,t,n,i){const{x:s,width:o}=i,a=n.caretSize+n.caretPadding;if(e==="left"&&s+o+a>t.width||e==="right"&&s-o-a<0)return!0}function LT(e,t,n,i){const{x:s,width:o}=n,{width:a,chartArea:{left:r,right:l}}=e;let c="center";return i==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),IT(c,e,t,n)&&(c="center"),c}function qu(e,t,n){const i=n.yAlign||t.yAlign||RT(e,n);return{xAlign:n.xAlign||t.xAlign||LT(e,t,n,i),yAlign:i}}function NT(e,t){let{x:n,width:i}=e;return t==="right"?n-=i:t==="center"&&(n-=i/2),n}function BT(e,t,n){let{y:i,height:s}=e;return t==="top"?i+=n:t==="bottom"?i-=s+n:i-=s/2,i}function Gu(e,t,n,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=e,{xAlign:r,yAlign:l}=n,c=s+o,{topLeft:d,topRight:h,bottomLeft:f,bottomRight:m}=Ne(a);let p=NT(t,r);const g=BT(t,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(d,f)+s:r==="right"&&(p+=Math.max(h,m)+s),{x:It(p,0,i.width-t.width),y:It(g,0,i.height-t.height)}}function Bs(e,t,n){const i=At(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-i.right:e.x+i.left}function Xu(e){return me([],Te(e))}function zT(e,t,n){return Be(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function Ku(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Zu={beforeTitle:be,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,i=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return n[t.dataIndex]}return""},afterTitle:be,beforeBody:be,beforeLabel:be,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return Z(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:be,afterBody:be,beforeFooter:be,footer:be,afterFooter:be};function Qt(e,t,n,i){const s=e[t].call(n,i);return typeof s>"u"?Zu[t].call(n,i):s}class Qu extends Yt{static positioners=Ai;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&n.options.animation&&i.animations,o=new ra(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=zT(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:i}=n,s=Qt(i,"beforeTitle",this,t),o=Qt(i,"title",this,t),a=Qt(i,"afterTitle",this,t);let r=[];return r=me(r,Te(s)),r=me(r,Te(o)),r=me(r,Te(a)),r}getBeforeBody(t,n){return Xu(Qt(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:i}=n,s=[];return mt(t,o=>{const a={before:[],lines:[],after:[]},r=Ku(i,o);me(a.before,Te(Qt(r,"beforeLabel",this,o))),me(a.lines,Qt(r,"label",this,o)),me(a.after,Te(Qt(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,n){return Xu(Qt(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:i}=n,s=Qt(i,"beforeFooter",this,t),o=Qt(i,"footer",this,t),a=Qt(i,"afterFooter",this,t);let r=[];return r=me(r,Te(s)),r=me(r,Te(o)),r=me(r,Te(a)),r}_createItems(t){const n=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=n.length;l<c;++l)r.push(ET(this.chart,n[l]));return t.filter&&(r=r.filter((d,h,f)=>t.filter(d,h,f,i))),t.itemSort&&(r=r.sort((d,h)=>t.itemSort(d,h,i))),mt(r,d=>{const h=Ku(t.callbacks,d);s.push(Qt(h,"labelColor",this,d)),o.push(Qt(h,"labelPointStyle",this,d)),a.push(Qt(h,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,n){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=Ai[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=ju(this,i),c=Object.assign({},r,l),d=qu(this.chart,i,c),h=Gu(i,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:h.x,y:h.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,i,s){const o=this.getCaretPosition(t,i,s);n.lineTo(o.x1,o.y1),n.lineTo(o.x2,o.y2),n.lineTo(o.x3,o.y3)}getCaretPosition(t,n,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:h}=Ne(r),{x:f,y:m}=t,{width:p,height:g}=n;let y,_,x,T,k,w;return o==="center"?(k=m+g/2,s==="left"?(y=f,_=y-a,T=k+a,w=k-a):(y=f+p,_=y+a,T=k-a,w=k+a),x=y):(s==="left"?_=f+Math.max(l,d)+a:s==="right"?_=f+p-Math.max(c,h)-a:_=this.caretX,o==="top"?(T=m,k=T-a,y=_-a,x=_+a):(T=m+g,k=T+a,y=_+a,x=_-a),w=T),{x1:y,x2:_,x3:x,y1:T,y2:k,y3:w}}drawTitle(t,n,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=En(i.rtl,this.x,this.width);for(t.x=Bs(this,i.titleAlign,i),n.textAlign=c.textAlign(i.titleAlign),n.textBaseline="middle",a=xt(i.titleFont),r=i.titleSpacing,n.fillStyle=i.titleColor,n.font=a.string,l=0;l<o;++l)n.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,n,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,d=xt(o.bodyFont),h=Bs(this,"left",o),f=s.x(h),m=l<d.lineHeight?(d.lineHeight-l)/2:0,p=n.y+m;if(o.usePointStyle){const g={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(f,c)+c/2,_=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ta(t,g,y,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ta(t,g,y,_)}else{t.lineWidth=et(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 g=s.leftForLtr(f,c),y=s.leftForLtr(s.xPlus(f,1),c-2),_=Ne(a.borderRadius);Object.values(_).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,On(t,{x:g,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),On(t,{x:y,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(y,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,n,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:d}=i,h=xt(i.bodyFont);let f=h.lineHeight,m=0;const p=En(i.rtl,this.x,this.width),g=function(A){n.fillText(A,p.x(t.x+m),t.y+f/2),t.y+=f+o},y=p.textAlign(a);let _,x,T,k,w,O,S;for(n.textAlign=a,n.textBaseline="middle",n.font=h.string,t.x=Bs(this,y,i),n.fillStyle=i.bodyColor,mt(this.beforeBody,g),m=r&&y!=="right"?a==="center"?c/2+d:c+2+d:0,k=0,O=s.length;k<O;++k){for(_=s[k],x=this.labelTextColors[k],n.fillStyle=x,mt(_.before,g),T=_.lines,r&&T.length&&(this._drawColorBox(n,t,k,p,i),f=Math.max(h.lineHeight,l)),w=0,S=T.length;w<S;++w)g(T[w]),f=h.lineHeight;mt(_.after,g)}m=0,f=h.lineHeight,mt(this.afterBody,g),t.y-=o}drawFooter(t,n,i){const s=this.footer,o=s.length;let a,r;if(o){const l=En(i.rtl,this.x,this.width);for(t.x=Bs(this,i.footerAlign,i),t.y+=i.footerMarginTop,n.textAlign=l.textAlign(i.footerAlign),n.textBaseline="middle",a=xt(i.footerFont),n.fillStyle=i.footerColor,n.font=a.string,r=0;r<o;++r)n.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,n,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:d}=i,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=Ne(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(r+h,l),a==="top"&&this.drawCaret(t,n,i,s),n.lineTo(r+c-f,l),n.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,n,i,s),n.lineTo(r+c,l+d-p),n.quadraticCurveTo(r+c,l+d,r+c-p,l+d),a==="bottom"&&this.drawCaret(t,n,i,s),n.lineTo(r+m,l+d),n.quadraticCurveTo(r,l+d,r,l+d-m),a==="center"&&o==="left"&&this.drawCaret(t,n,i,s),n.lineTo(r,l+h),n.quadraticCurveTo(r,l,r+h,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Ai[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=ju(this,t),l=Object.assign({},a,this._size),c=qu(n,t,l),d=Gu(t,l,c,n);(s._to!==d.x||o._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=At(n.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&r&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,s,n),Dc(t,n.textDirection),o.y+=a.top,this.drawTitle(o,t,n),this.drawBody(o,t,n),this.drawFooter(o,t,n),Cc(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!hs(i,s),a=this._positionChanged(s,n);(o||a)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,i=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,n,i),r=this._positionChanged(a,t),l=n||!hs(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,n){const{caretX:i,caretY:s,options:o}=this,a=Ai[o.position].call(this,t,n);return a!==!1&&(i!==a.x||s!==a.y)}}var Wt={id:"tooltip",_element:Qu,positioners:Ai,afterInit(e,t,n){n&&(e.tooltip=new Qu({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Zu},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},FT=Object.freeze({__proto__:null,Colors:Qk,Decimation:nT,Filler:kT,Legend:CT,SubTitle:PT,Title:AT,Tooltip:Wt});const UT=(e,t,n,i)=>(typeof t=="string"?(n=e.push(t)-1,i.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function VT(e,t,n,i){const s=e.indexOf(t);if(s===-1)return UT(e,t,n,i);const o=e.lastIndexOf(t);return s!==o?n:s}const HT=(e,t)=>e===null?null:It(Math.round(e),0,t);function Ju(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class $T extends an{static id="category";static defaults={ticks:{callback:Ju}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const i=this.getLabels();for(const{index:s,label:o}of n)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(Z(t))return null;const i=this.getLabels();return n=isFinite(n)&&i[n]===t?n:VT(i,t,Q(n,t),this._addedLabels),HT(n,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),n||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,n=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&n===o.length-1?o:o.slice(t,n+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=n;a++)s.push({value:a});return s}getLabelForValue(t){return Ju.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function YT(e,t){const n=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:d,maxDigits:h,includeBounds:f}=e,m=o||1,p=d-1,{min:g,max:y}=t,_=!Z(a),x=!Z(r),T=!Z(c),k=(y-g)/(h+1);let w=tc((y-g)/p/m)*m,O,S,A,R;if(w<1e-14&&!_&&!x)return[{value:g},{value:y}];R=Math.ceil(y/w)-Math.floor(g/w),R>p&&(w=tc(R*w/p/m)*m),Z(l)||(O=Math.pow(10,l),w=Math.ceil(w*O)/O),s==="ticks"?(S=Math.floor(g/w)*w,A=Math.ceil(y/w)*w):(S=g,A=y),_&&x&&o&&E_((r-a)/o,w/1e3)?(R=Math.round(Math.min((r-a)/w,d)),w=(r-a)/R,S=a,A=r):T?(S=_?a:S,A=x?r:A,R=c-1,w=(A-S)/R):(R=(A-S)/w,fi(R,Math.round(R),w/1e3)?R=Math.round(R):R=Math.ceil(R));const D=Math.max(nc(w),nc(S));O=Math.pow(10,Z(l)?D:l),S=Math.round(S*O)/O,A=Math.round(A*O)/O;let v=0;for(_&&(f&&S!==a?(n.push({value:a}),S<a&&v++,fi(Math.round((S+v*w)*O)/O,a,td(a,k,e))&&v++):S<a&&v++);v<R;++v){const C=Math.round((S+v*w)*O)/O;if(x&&C>r)break;n.push({value:C})}return x&&f&&A!==r?n.length&&fi(n[n.length-1].value,r,td(r,k,e))?n[n.length-1].value=r:n.push({value:r}):(!x||A===r)&&n.push({value:A}),n}function td(e,t,{horizontal:n,minRotation:i}){const s=Ot(i),o=(n?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+e).length;return Math.min(t/o,a)}class zs extends an{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return Z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=n?s:l,r=l=>o=i?o:l;if(t){const l=he(s),c=he(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,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(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=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:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},o=this._range||this,a=YT(s,o);return t.bounds==="ticks"&&ec(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let n=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-n)/Math.max(t.length-1,1)/2;n-=s,i+=s}this._startValue=n,this._endValue=i,this._valueRange=i-n}getLabelForValue(t){return gi(t,this.chart.options.locale,this.options.ticks.format)}}class WT extends zs{static id="linear";static defaults={ticks:{callback:xs.formatters.numeric}};determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=_t(t)?t:0,this.max=_t(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,i=Ot(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,o.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}}const Pi=e=>Math.floor(Ie(e)),rn=(e,t)=>Math.pow(10,Pi(e)+t);function ed(e){return e/Math.pow(10,Pi(e))===1}function nd(e,t,n){const i=Math.pow(10,n),s=Math.floor(e/i);return Math.ceil(t/i)-s}function jT(e,t){const n=t-e;let i=Pi(n);for(;nd(e,t,i)>10;)i++;for(;nd(e,t,i)<10;)i--;return Math.min(i,Pi(e))}function qT(e,{min:t,max:n}){t=ne(e.min,t);const i=[],s=Pi(t);let o=jT(t,n),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,d=Math.floor((t-l)/r/10)*r*10;let h=Math.floor((c-d)/Math.pow(10,o)),f=ne(e.min,Math.round((l+d+h*Math.pow(10,o))*a)/a);for(;f<n;)i.push({value:f,major:ed(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),f=Math.round((l+d+h*Math.pow(10,o))*a)/a;const m=ne(e.max,f);return i.push({value:m,major:ed(m),significand:h}),i}class GT extends an{static id="logarithmic";static defaults={ticks:{callback:xs.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,n){const i=zs.prototype.parse.apply(this,[t,n]);if(i===0){this._zero=!0;return}return _t(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=_t(t)?Math.max(0,t):null,this.max=_t(n)?Math.max(0,n):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!_t(this._userMin)&&(this.min=t===rn(this.min,0)?rn(this.min,-1):rn(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let i=this.min,s=this.max;const o=r=>i=t?i:r,a=r=>s=n?s:r;i===s&&(i<=0?(o(1),a(10)):(o(rn(i,-1)),a(rn(s,1)))),i<=0&&o(rn(s,-1)),s<=0&&a(rn(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,n={min:this._userMin,max:this._userMax},i=qT(n,this);return t.bounds==="ticks"&&ec(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":gi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ie(t),this._valueRange=Ie(this.max)-Ie(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ie(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const n=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+n*this._valueRange)}}function Da(e){const t=e.ticks;if(t.display&&e.display){const n=At(t.backdropPadding);return Q(t.font&&t.font.size,bt.font.size)+n.height}return 0}function XT(e,t,n){return n=ut(n)?n:[n],{w:X_(e,t.string,n),h:n.length*t.lineHeight}}function id(e,t,n,i,s){return e===i||e===s?{start:t-n/2,end:t+n/2}:e<i||e>s?{start:t-n,end:t}:{start:t,end:t+n}}function KT(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),i=[],s=[],o=e._pointLabels.length,a=e.options.pointLabels,r=a.centerPointLabels?tt/o:0;for(let l=0;l<o;l++){const c=a.setContext(e.getPointLabelContext(l));s[l]=c.padding;const d=e.getPointPosition(l,e.drawingArea+s[l],r),h=xt(c.font),f=XT(e.ctx,h,e._pointLabels[l]);i[l]=f;const m=Vt(e.getIndexAngle(l)+r),p=Math.round(gs(m)),g=id(p,d.x,f.w,0,180),y=id(p,d.y,f.h,90,270);ZT(n,t,m,g,y)}e.setCenterPoint(t.l-n.l,n.r-t.r,t.t-n.t,n.b-t.b),e._pointLabelItems=tv(e,i,s)}function ZT(e,t,n,i,s){const o=Math.abs(Math.sin(n)),a=Math.abs(Math.cos(n));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,e.l=Math.min(e.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,e.r=Math.max(e.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,e.b=Math.max(e.b,t.b+l))}function QT(e,t,n){const i=e.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=n,l=e.getPointPosition(t,i+s+a,o),c=Math.round(gs(Vt(l.angle+yt))),d=iv(l.y,r.h,c),h=ev(c),f=nv(l.x,r.w,h);return{visible:!0,x:l.x,y:d,textAlign:h,left:f,top:d,right:f+r.w,bottom:d+r.h}}function JT(e,t){if(!t)return!0;const{left:n,top:i,right:s,bottom:o}=e;return!(we({x:n,y:i},t)||we({x:n,y:o},t)||we({x:s,y:i},t)||we({x:s,y:o},t))}function tv(e,t,n){const i=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Da(o)/2,additionalAngle:a?tt/s:0};let c;for(let d=0;d<s;d++){l.padding=n[d],l.size=t[d];const h=QT(e,d,l);i.push(h),r==="auto"&&(h.visible=JT(h,c),h.visible&&(c=h))}return i}function ev(e){return e===0||e===180?"center":e<180?"left":"right"}function nv(e,t,n){return n==="right"?e-=t:n==="center"&&(e-=t/2),e}function iv(e,t,n){return n===90||n===270?e-=t/2:(n>270||n<90)&&(e-=t),e}function sv(e,t,n){const{left:i,top:s,right:o,bottom:a}=n,{backdropColor:r}=t;if(!Z(r)){const l=Ne(t.borderRadius),c=At(t.backdropPadding);e.fillStyle=r;const d=i-c.left,h=s-c.top,f=o-i+c.width,m=a-s+c.height;Object.values(l).some(p=>p!==0)?(e.beginPath(),On(e,{x:d,y:h,w:f,h:m,radius:l}),e.fill()):e.fillRect(d,h,f,m)}}function ov(e,t){const{ctx:n,options:{pointLabels:i}}=e;for(let s=t-1;s>=0;s--){const o=e._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(e.getPointLabelContext(s));sv(n,a,o);const r=xt(a.font),{x:l,y:c,textAlign:d}=o;en(n,e._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:d,textBaseline:"middle"})}}function sd(e,t,n,i){const{ctx:s}=e;if(n)s.arc(e.xCenter,e.yCenter,t,0,gt);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=e.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function av(e,t,n,i,s){const o=e.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!i||!r||!l||n<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),sd(e,n,a,i),o.closePath(),o.stroke(),o.restore())}function rv(e,t,n){return Be(e,{label:n,index:t,type:"pointLabel"})}class lv extends zs{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:xs.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};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=At(Da(this.options)/2),n=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+n/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(n,i)/2)}determineDataLimits(){const{min:t,max:n}=this.getMinMax(!1);this.min=_t(t)&&!isNaN(t)?t:0,this.max=_t(n)&&!isNaN(n)?n:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Da(this.options))}generateTickLabels(t){zs.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((n,i)=>{const s=ft(this.options.pointLabels.callback,[n,i],this);return s||s===0?s:""}).filter((n,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?KT(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,n,i,s){this.xCenter+=Math.floor((t-n)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,n,i,s))}getIndexAngle(t){const n=gt/(this._pointLabels.length||1),i=this.options.startAngle||0;return Vt(t*n+Ot(i))}getDistanceFromCenterForValue(t){if(Z(t))return NaN;const n=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*n:(t-this.min)*n}getValueForDistanceFromCenter(t){if(Z(t))return NaN;const n=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-n:this.min+n}getPointLabelContext(t){const n=this._pointLabels||[];if(t>=0&&t<n.length){const i=n[t];return rv(this.getContext(),t,i)}}getPointPosition(t,n,i=0){const s=this.getIndexAngle(t)-yt+i;return{x:Math.cos(s)*n+this.xCenter,y:Math.sin(s)*n+this.yCenter,angle:s}}getPointPositionForValue(t,n){return this.getPointPosition(t,this.getDistanceFromCenterForValue(n))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:n,top:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:n,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:n}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),sd(this,this.getDistanceFromCenterForValue(this._endValue),n,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,n=this.options,{angleLines:i,grid:s,border:o}=n,a=this._pointLabels.length;let r,l,c;if(n.pointLabels.display&&ov(this,a),s.display&&this.ticks.forEach((d,h)=>{if(h!==0||h===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);const f=this.getContext(h),m=s.setContext(f),p=o.setContext(f);av(this,m,l,a,p)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const d=i.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:f}=d;!f||!h||(t.lineWidth=f,t.strokeStyle=h,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(n.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,n=this.options,i=n.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!n.reverse)return;const c=i.setContext(this.getContext(l)),d=xt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const h=At(c.backdropPadding);t.fillRect(-a/2-h.left,-o-d.size/2-h.top,a+h.width,d.size+h.height)}en(t,r.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}const Fs={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}},Jt=Object.keys(Fs);function od(e,t){return e-t}function ad(e,t){if(Z(t))return null;const n=e._adapter,{parser:i,round:s,isoWeekday:o}=e._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),_t(a)||(a=typeof i=="string"?n.parse(a,i):n.parse(a)),a===null?null:(s&&(a=s==="week"&&(Le(o)||o===!0)?n.startOf(a,"isoWeek",o):n.startOf(a,s)),+a)}function rd(e,t,n,i){const s=Jt.length;for(let o=Jt.indexOf(e);o<s-1;++o){const a=Fs[Jt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((n-t)/(r*a.size))<=i)return Jt[o]}return Jt[s-1]}function cv(e,t,n,i,s){for(let o=Jt.length-1;o>=Jt.indexOf(n);o--){const a=Jt[o];if(Fs[a].common&&e._adapter.diff(s,i,a)>=t-1)return a}return Jt[n?Jt.indexOf(n):0]}function uv(e){for(let t=Jt.indexOf(e)+1,n=Jt.length;t<n;++t)if(Fs[Jt[t]].common)return Jt[t]}function ld(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:i,hi:s}=Go(n,t),o=n[i]>=t?n[i]:n[s];e[o]=!0}}function dv(e,t,n,i){const s=e._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,i))l=n[r],l>=0&&(t[l].major=!0);return t}function cd(e,t,n){const i=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,i.push({value:r,major:!1});return o===0||!n?i:dv(e,i,s,n)}class Ca extends an{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const i=t.time||(t.time={}),s=this._adapter=new Zc._date(t.adapters.date);s.init(n),hi(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:ad(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=_t(s)&&!isNaN(s)?s:+n.startOf(Date.now(),i),o=_t(o)&&!isNaN(o)?o:+n.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],i=t[t.length-1]),{min:n,max:i}}buildTicks(){const t=this.options,n=t.time,i=t.ticks,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 o=this.min,a=this.max,r=N_(s,o,a);return this._unit=n.unit||(i.autoSkip?rd(n.minUnit,this.min,this.max,this._getLabelCapacity(o)):cv(this,r.length,n.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:uv(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),cd(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;n=It(n,0,a),i=It(i,0,a),this._offsets={start:n,end:i,factor:1/(n+1+i)}}_generate(){const t=this._adapter,n=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||rd(o.minUnit,n,i,this._getLabelCapacity(n)),r=Q(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=Le(l)||l===!0,d={};let h=n,f,m;if(c&&(h=+t.startOf(h,"isoWeek",l)),h=+t.startOf(h,c?"day":a),t.diff(i,n,a)>1e5*r)throw new Error(n+" and "+i+" are too far apart with stepSize of "+r+" "+a);const p=s.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<i;f=+t.add(f,r,a),m++)ld(d,f,p);return(f===i||s.bounds==="ticks"||m===1)&&ld(d,f,p),Object.keys(d).sort(od).map(g=>+g)}getLabelForValue(t){const n=this._adapter,i=this.options.time;return i.tooltipFormat?n.format(t,i.tooltipFormat):n.format(t,i.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,o=this._unit,a=n||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,n,i,s){const o=this.options,a=o.ticks.callback;if(a)return ft(a,[t,n,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&r[l],h=c&&r[c],f=i[n],m=c&&h&&f&&f.major;return this._adapter.format(t,s||(m?h:d))}generateTickLabels(t){let n,i,s;for(n=0,i=t.length;n<i;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+i)*n.factor)}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,i=this.ctx.measureText(t).width,s=Ot(this.isHorizontal()?n.maxRotation:n.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const n=this.options.time,i=n.displayFormats,s=i[n.unit]||i.millisecond,o=this._tickFormatFunction(t,0,cd(this,[t],this._majorUnit),s),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],n,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(n=0,i=s.length;n<i;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,i;if(t.length)return t;const s=this.getLabels();for(n=0,i=s.length;n<i;++n)t.push(ad(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return oc(t.sort(od))}}function Us(e,t,n){let i=0,s=e.length-1,o,a,r,l;n?(t>=e[i].pos&&t<=e[s].pos&&({lo:i,hi:s}=xe(e,"pos",t)),{pos:o,time:r}=e[i],{pos:a,time:l}=e[s]):(t>=e[i].time&&t<=e[s].time&&({lo:i,hi:s}=xe(e,"time",t)),{time:o,pos:r}=e[i],{time:a,pos:l}=e[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class hv extends Ca{static id="timeseries";static defaults=Ca.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=Us(n,this.min),this._tableRange=Us(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:i}=this,s=[],o=[];let a,r,l,c,d;for(a=0,r=t.length;a<r;++a)c=t[a],c>=n&&c<=i&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)d=s[a+1],l=s[a-1],c=s[a],Math.round((d+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,n=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(n)||i.length===1)&&i.push(n),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),i=this.getLabelTimestamps();return n.length&&i.length?t=this.normalize(n.concat(i)):t=n.length?n:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Us(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,i=this.getDecimalForPixel(t)/n.factor-n.end;return Us(this._table,i*this._tableRange+this._minPos,!0)}}var fv=Object.freeze({__proto__:null,CategoryScale:$T,LinearScale:WT,LogarithmicScale:GT,RadialLinearScale:lv,TimeScale:Ca,TimeSeriesScale:hv});const mv=[mw,Wk,FT,fv];function pv(e){const n=`barChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:l=>({label:l.dataset.label,value:l.label})}};Wt.positioners[n]=function(l,c){if(!l.length||e.tooltipState.interactionMode==="interactive"||c.x===null||c.y===null)return!1;const d=this.chart.canvas.getBoundingClientRect(),h=e.tooltipState.width||this.width,f=d.width/2,m=Ws(c,h,f),p=c.y,g=c.x<f?"left":"center";return{x:m-e.tooltipState.offsetX,y:p-e.tooltipState.offsetY,xAlign:g}},pa.modes.customInteractionMode=function(l,c){const d=ze(c,l),h=[];return pa.evaluateInteractionItems(l,l.options.indexAxis||"x",d,(f,m,p)=>{l.options.indexAxis==="y"&&f.inYRange(d.y,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p}),l.options.indexAxis==="x"&&d.x!==null&&f.inXRange(d.x,!0)&&l.data.datasets[m].data[p]&&h.push({element:f,datasetIndex:m,index:p})}),h};const s=e.numLabels.value>25?Ad:Pd,o=({chart:l,index:c})=>{const d=l.data;return{size:s,style:d?.isLabelEmpty?.[c]?"italic":"normal"}},a=(l,c,d)=>l.chart.options.indexAxis===l.axis?(c=l.getLabelForValue(d),c&&c.length>js?c.slice(0,js)+"...":c):l.getLabelForValue(Number(c)),r=u.computed(()=>({indexAxis:e.indexAxis,skipNull:!0,scales:{x:{stacked:e.stacked.value,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{maxRotation:90,autoSkip:!1,font:o,callback:function(l,c){return a(this,l,c)}},title:{display:e.indexAxis==="y"?!Z(e.metricAxesTitle?.value):!Z(e.dimensionAxesTitle?.value),text:e.indexAxis==="y"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{top:3,bottom:0,left:0,right:0},font:{weight:"bold"}}},y:{stacked:e.stacked.value,beginAtZero:!0,grid:{offset:!1,drawOnChartArea:!1,drawBorder:!1,drawTicks:!0},ticks:{padding:0,font:o,callback:function(l,c){return a(this,l,c)}},title:{display:e.indexAxis==="x"?!Z(e.metricAxesTitle?.value):!Z(e.dimensionAxesTitle?.value),text:e.indexAxis==="x"?e.metricAxesTitle?.value:e.dimensionAxesTitle?.value,padding:{bottom:3,top:0,left:0,right:0},font:{weight:"bold"}}}},plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:l=>{Dd(e.tooltipState,l)}}},interaction:{mode:"customInteractionMode",intersect:!0},maxBarThickness:60,maintainAspectRatio:!1,layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.getCurrentInstance()&&u.onUnmounted(()=>{Wt.positioners[n]&&delete Wt.positioners[n]}),r}Zt.register(...mv);const gv=(e,t)=>{const n=t.datasets.map(s=>s.label),i=e.datasets.map(s=>s.label);return e.datasets.length===t.datasets.length&&n.every((s,o)=>s===i[o])};function yv(e,t,n,i,s){const o=u.shallowRef(null),a=(r,l)=>{if(t.value)return new Zt(t.value,{type:e,data:r,plugins:i,options:l})};return u.onMounted(()=>{o.value=a(n.value,s.value)}),u.onBeforeUnmount(()=>{Z(o.value)||o.value.destroy()}),u.watch(n,(r,l)=>{if(gv(l,r)&&!Z(o.value)){for(const[c,d]of r.datasets.entries())Object.assign(o.value.data.datasets[c],d);o.value.data.labels=r.labels,o.value.update()}else Z(o.value)||o.value.destroy(),o.value=a(r,s.value)}),u.watch(t,()=>{Z(o.value)||o.value.destroy(),o.value=a(n.value,s.value)}),u.watch(s,(r,l)=>{(r.indexAxis!==l.indexAxis||JSON.stringify(r.scales.x.title)!==JSON.stringify(l.scales.x.title)||JSON.stringify(r.scales.y.title)!==JSON.stringify(l.scales.y.title))&&(Z(o.value)||o.value.destroy(),o.value=a(n.value,r))}),o}const ud=1e3,bv=1e4,dd=1e6,hd=1e9,fd=1e12,Ei=(e,t)=>{if(t.separator===!1||e<1e3)return e.toString();const n=typeof t.separator=="string"?t.separator:",",i=[];return Math.round(e).toString().split("").reverse().forEach((o,a)=>{a&&a%3===0&&i.push(n),i.push(o)}),i.reverse().join("")},In=(e,t,n)=>{const i=e/t,s=n.round?"round":"floor";if(n.decimal===!1)return Math[s](i).toString();let o;n.precision?o=i:o=i<10?Math[s](i*10)/10:Math[s](i);let a=o.toString();return typeof n.decimal=="string"&&(a=a.replace(".",n.decimal)),a};function Ri(e,t={}){let n;const i=e<0;i&&(e=Math.abs(e)),t.precision&&(e=parseFloat(e.toPrecision(t.precision)));const s=t.min10k?bv:ud;return e<s||t.precision&&t.precision>Math.log10(e)?n=Ei(In(e,1,t),t):e<dd?n=`${In(e,ud,t)}k`:e<hd?n=`${In(e,dd,t)}m`:e<fd?n=`${Ei(In(e,hd,t),t)}b`:n=`${Ei(In(e,fd,t),t)}t`,i&&(n=`-${n}`),t.capital&&(n=n.toUpperCase()),t.prefix&&(n=`${t.prefix}${n}`),t.suffix&&(n=`${n}${t.suffix}`),n}Ri.addCommas=Ei;function _v(e,t,n){const{i18n:i}=K.useI18n(),{formatBytes:s}=le({i18n:i}),{translateUnit:o}=K.useTranslatedUnits();return{legendValues:u.computed(()=>e.value.datasets.reduce((r,l)=>{const c=l.total?l.total:l.data.reduce((f,m)=>f+(typeof m=="number"?Number(m)||0:Number(m&&m.y)||0),0);let d;const h=l.unit??n.value;if(h==="bytes")d=s(c);else{const f=o(h,c);d=i&&i.t("legend.datapointValueDisplay",{value:Ri(c,{capital:!0}),unit:f})||`${Ri(c,{capital:!0})} ${h}`}return{...r,[l.label]:{raw:c,formatted:d,isThreshold:l.isThreshold}}},{}))}}function xv(e){const n=`donutChartTooltipPosition-${e.tooltipState.chartID}`,i={enabled:!1,position:n,callbacks:{label:o=>({label:o.dataset.label,value:o.label})}};Wt.positioners[n]=function(o,a){if(!o.length||a.x===null||a.y===null)return!1;const r=this.chart.canvas.getBoundingClientRect(),l=e.tooltipState.width||this.width,c=r.width/2,d=Ws(a,l,c),h=a.y,f=a.x<c?"left":"center";return{x:d-e.tooltipState.offsetX,y:h,xAlign:f}};const s=u.computed(()=>({cutout:"65%",responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},tooltip:{...i,external:o=>{Dd(e.tooltipState,o)}}},layout:{padding:{left:0,right:0,top:5,bottom:0}}}));return u.onUnmounted(()=>{Wt.positioners[n]&&delete Wt.positioners[n]}),{options:s}}function wv(e){const t=u.computed(()=>({type:"timeseries",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:10,source:"auto",maxRotation:0,callback:d=>{const h=new Date(d);return ja({tickValue:h,granularity:e.granularity.value,dayBoundaryCrossed:l.value})}},title:{display:!1},border:{display:!1},stacked:e.stacked.value})),n=u.computed(()=>!!e.rightYAxis?.value),i=u.computed(()=>({title:{display:!Z(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,...e.leftYAxisGrid?.value===!1?{drawOnChartArea:!1}:{}},id:"main-y-axis",beginAtZero:!0,border:{display:!1},stacked:e.stacked.value,...n.value?{display:"auto"}:{}})),s=u.computed(()=>{const d=e.rightYAxis?.value;if(d)return{display:"auto",position:"right",title:{display:!Z(d.title),text:d.title,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5},grid:{drawBorder:!1,drawOnChartArea:d.showGrid??!1},beginAtZero:!0,border:{display:!1},stacked:e.stacked.value}}),a=`lineChartTooltipPosition-${e.tooltipState.chartID}`,r={enabled:!1,position:a};Wt.positioners[a]=function(d,h){if(!d.length||e.tooltipState.interactionMode==="interactive"||h.x===null||h.y===null)return!1;const f=this.chart.canvas.getBoundingClientRect(),m=e.tooltipState.width||this.width,p=e.tooltipState.height||this.height,g=f.width/2,y=f.height/2,_=Ws(h,m,g);let x=Cd(h,p,y);const T=h.y<y?"top":"bottom",k=h.x<g?"left":"center";return p>f.height&&(x=0),{x:_,y:x,xAlign:k,yAlign:T}};const l=u.computed(()=>{const d=Number(e.timeRangeMs.value),h=new Date,f=new Date(h.getTime()-d);return zl(d)>24||f.getDate()!==h.getDate()}),c=u.computed(()=>({hover:{mode:"index",intersect:!1},elements:{point:{radius:e.pointsWithoutHover?.value?3:0,hitRadius:4,hoverRadius:4}},animation:{duration:250,easing:"linear"},scales:{x:t.value,y:i.value,...s.value?{[Ia]:s.value}:{}},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{...r,external:d=>{Ea(e.tooltipState,d,e.granularity.value)}},thresholdPlugin:{threshold:e.threshold?.value}},interaction:{mode:"index",intersect:!1},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.onUnmounted(()=>{Wt.positioners[a]&&delete Wt.positioners[a]}),{options:c}}const kv=["usd","bytes"],Tv="usd";function vv(e){const{i18n:t}=K.useI18n(),{formatUnit:n}=le({i18n:t}),i=(m,p)=>!p||!kv.includes(p)?m:m===0&&p===Tv?t.formatNumber(0,{style:"currency",currency:"USD"}):n(m,p),s=u.computed(()=>{const m=Number(e.timeRangeMs.value),p=new Date,g=new Date(p.getTime()-m);return zl(m)>24||g.getDate()!==p.getDate()}),o=u.computed(()=>({display:!Z(e.dimensionAxesTitle?.value),text:e.dimensionAxesTitle?.value,padding:{top:3},font:{weight:"bold"}})),a=u.computed(()=>({type:"linear",display:!0,beginAtZero:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{maxRotation:0,maxTicksLimit:7,callback:m=>i(m,e.xMetricUnit?.value)},title:o.value,border:{display:!1}})),r=u.computed(()=>({type:"time",display:!0,grid:{display:!0,drawOnChartArea:!1,drawTicks:!0,drawBorder:!1},ticks:{padding:0,autoSkipPadding:100,source:"auto",maxRotation:0,callback:m=>ja({tickValue:new Date(m),granularity:e.granularity.value,dayBoundaryCrossed:s.value})},title:{display:!1},border:{display:!1}})),l=u.computed(()=>({title:{display:!Z(e.metricAxesTitle?.value),text:e.metricAxesTitle?.value,padding:{bottom:3},font:{weight:"bold"}},ticks:{maxTicksLimit:5,callback:m=>i(m,e.metricUnit?.value)},grid:{drawBorder:!1},id:"main-y-axis",beginAtZero:!0,border:{display:!1}})),c=(m,p,g)=>{const y=g?.timestamp;return y===void 0?"":Fn({tickValue:new Date(y),granularity:p})},h=`scatterChartTooltipPosition-${e.tooltipState.chartID}`;Wt.positioners[h]=function(m,p){if(!m.length||e.tooltipState.interactionMode==="interactive"||p.x===null||p.y===null)return!1;const g=this.chart.canvas.getBoundingClientRect(),y=e.tooltipState.width||this.width,_=e.tooltipState.height||this.height,x=g.width/2,T=g.height/2,k=Ws(p,y,x);let w=Cd(p,_,T);const O=p.y<T?"top":"bottom",S=p.x<x?"left":"center";return _>g.height&&(w=0),{x:k,y:w,xAlign:S,yAlign:O}};const f=u.computed(()=>({hover:{mode:"nearest",intersect:!1},interaction:{mode:"point",intersect:!1},animation:{duration:250,easing:"linear"},scales:{x:e.xMetric?.value?a.value:r.value,y:l.value},responsive:!0,maintainAspectRatio:!1,plugins:{htmlLegend:{containerID:e.legendID},legend:{display:!1},streaming:!1,tooltip:{enabled:!1,position:h,external:m=>{Ea(e.tooltipState,m,e.granularity.value,{...e.xMetric?.value?{contextFormatter:c}:{}})}},outlierBandPlugin:{value:e.outlierValue?.value,color:e.themeColors.value.outlierBand},referenceLinePlugin:{lines:e.referenceLines?.value}},layout:{padding:{left:0,right:0,top:0,bottom:0}}}));return u.onUnmounted(()=>{Wt.positioners[h]&&delete Wt.positioners[h]}),{options:f}}const Sv=e=>{const t=e.length;let n=5381;for(let i=0;i<t;i++)n=n*33^e.charCodeAt(i);return n>>>0},Mv="#0044f4",md="#6c7489",Dv="#d60027",Cv="#ffc400",Ov="#bee2ff",Av="#8fc1ff",Pv="#5f9aff",Ev="#306fff",Rv="#b5ffee",Iv="#00fabe",Lv="#00d6a4",Nv="#00a17b",Bv="#007d60",zv="#005944",Fv="#b5ffee",Uv="#00fabe",Vv="#b5ffee",Hv="#00a17b",$v="#fff296",Yv="#ffe04b",Wv="#ffc400",jv="#b37600",qv="#995c00",Gv="#804400",Xv="#fff296",Kv="#ffe04b",Zv="#ffc2b3",Qv="#ff9877",Jv="#ff723c",tS="#f75008",eS="#d13500",nS="#a31f00",iS="#ffc2b3",sS="#ff9877",oS="#ff723c",aS="#f75008",rS="#d13500",lS="#a31f00",cS="#ffc2b3",uS="#ff9877",dS="#ff723c",hS="#f75008",fS="#d13500",mS="#a31f00",pS="#ffc2b3",gS="#ff9877",yS="#ff723c",bS="#f75008",_S="#d13500",xS="#a31f00",wS="#ffc2b3",kS="#ff9877",TS="#ff723c",vS="#f75008",SS="#d13500",MS="#ffabab",DS="#ff7272",CS="#ff3954",OS="#f50045",AS="#d60027",PS="#ad000e",ES="#ffabab",RS="#ff7272",IS="#ff3954",LS="#f50045",NS="#d60027",BS="#eefaff",zS="#ecfffb",FS="#fffce0",US="#fff1ef",VS="#ffe5e5",HS="#5f9aff",$S="#00d6a4",YS="#ffc400",WS="#ff723c",jS="#ff3954",qS={100:Ov,101:Av,102:Pv,103:Ev,200:Rv,201:Iv,202:Lv,203:Nv,204:Bv,205:zv,206:Fv,207:Uv,208:Vv,226:Hv,300:$v,301:Yv,302:Wv,303:jv,304:qv,305:Gv,307:Xv,308:Kv,400:Zv,401:Qv,402:Jv,403:tS,404:eS,405:nS,406:iS,407:sS,408:oS,409:aS,410:rS,411:lS,412:cS,413:uS,414:dS,415:hS,416:fS,417:mS,418:pS,421:gS,422:yS,423:bS,424:_S,425:xS,426:wS,428:kS,429:TS,431:vS,451:SS,500:MS,501:DS,502:CS,503:OS,504:AS,505:PS,506:ES,507:RS,508:IS,510:LS,511:NS},GS={100:BS,200:zS,300:FS,400:US,500:VS},pd={"1XX":HS,"2XX":$S,"3XX":YS,"4XX":WS,"5XX":jS},XS={error:Dv,warning:Cv,empty:"#9DA99D",neutral:md,____OTHER____:Mv},gd=["#0076F4","#00819D","#00A17B","#8A50FF","#FF3C99","#FF6D3C","#B3A100"],yd=["#5485BA","#087D96","#3D8776","#7654BA","#A1406F","#BF5430","#B5A72C"],KS=e=>Sv(e),bd=({discriminator:e,theme:t="light"})=>{const n=Math.abs(Math.floor(e));return t==="dark"?yd[n%yd.length]:gd[n%gd.length]},Ii=({state:e})=>XS[e]??md,ZS=({statusCode:e})=>{const t=typeof e=="number"?e:Number.parseInt(e,10),n=`${t}`,i=`${Math.floor(t/100)*100}`;return qS[n]??GS[i]??Ii({state:"neutral"})},QS=({group:e})=>pd[e]?pd[e]:Ii({state:"neutral"}),pe=({discriminator:e=void 0,state:t=void 0,dimension:n=void 0,dimensionValue:i=void 0,metric:s=void 0,coordinator:o=void 0,order:a=void 0,chartUuid:r=void 0,customDimensionColors:l=void 0})=>{let c="light";if(u.hasInjectionContext()&&(c=u.inject("app:konnectColorMode",u.computed(()=>"light")).value),t!==void 0)return Ii({state:t});if(i!==void 0&&l!==void 0&&l[i])return l[i];if(i&&["empty","____OTHER____"].includes(i))return Ii({state:i});if(n!==void 0&&i!==void 0){if(n==="status_code")return ZS({statusCode:i});if(n==="status_code_grouped")return QS({group:i})}if(e!==void 0)return bd({discriminator:e,theme:c});if(n||i||s){const d=`${n??""}${i??""}${s??""}`,h=o?o.resolveDiscriminator({name:d,order:a,chartUuid:r,theme:c}):KS(d);return bd({discriminator:h,theme:c})}return Ii({state:"neutral"})};function JS({barSegmentLabels:e,coordinator:t=void 0,customColors:n=void 0,hasDimensions:i=void 0,isMultiMetric:s=void 0,metricNames:o,pivotRecords:a,rowLabels:r,seriesDimension:l=void 0,uuid:c}){const{i18n:d}=K.useI18n();if(s)return o.map((f,m)=>({label:d&&d.te(`chartLabels.${f}`)&&d.t(`chartLabels.${f}`)||f,backgroundColor:pe({discriminator:m}),data:r.map((p,g)=>i?a[`${p.id},${f}`]||0:a[`${g},${f}`]||null)}));const h=n&&!Array.isArray(n)?n:void 0;return Array.from(e).flatMap((f,m)=>f?{dimension:l,dimensionValue:f.id,label:d&&d.te(`chartLabels.${f.name}`)&&d.t(`chartLabels.${f.name}`)||f.name,backgroundColor:pe({...!t?.color&&{discriminator:m},dimension:l,dimensionValue:f.id,coordinator:t?.color,order:m,chartUuid:c,customDimensionColors:h}),data:r.map(p=>a[`${p.id},${f.id}`]||null),isSegmentEmpty:f.id==="empty"}:[])}function t1(e,t,n,i){const{i18n:s}=K.useI18n();return u.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:r,metric_names:l}=t.value.meta,c=r&&Object.keys(r),d=l&&l.length>1,h=r&&c&&c.length>0,f=h&&c.length>1;if(!a.length||!l)return{datasets:[],labels:[]};const m=h&&c||l,p=m[0],g=m.length>1?m[1]:m[0],y=Object.fromEntries(d?a.flatMap(v=>l.map((C,I)=>{const U=v.event[p],H=h?`${U},${C}`:`${I},${C}`,V=v.event[C];return[H,V]})):a.map(v=>{const C=h?`${v.event[p]},${v.event[g]}`:`${p},${g}`,I=v.event[l[0]];return[C,I]})),_=Object.keys(y).reduce((v,C)=>{const[I]=C.split(","),U=y[C];return v[I]?v[I]+=U:v[I]=U,v},{}),x=Object.entries(_).sort(([,v],[,C])=>Number(C)-Number(v)).map(([v])=>v),T=r[p],k=r[g];let w=h&&T&&Object.entries(T).map(([v,C])=>({id:v,name:C.name}))||l.map(v=>({id:v,name:v})),O=h&&k&&Object.entries(k).map(([v,C])=>({id:v,name:C.name}))||l.map(v=>({id:v,name:v}));if(h&&p==="country_code"&&(w=w.map(v=>({...v,name:Co(v.id)||v.name}))),h&&g==="country_code"&&(O=O.map(v=>({...v,name:Co(v.id)||v.name}))),p!=="status_code"&&p!=="status_code_grouped"&&(w.sort((v,C)=>x.indexOf(v.id)-x.indexOf(C.id)),O.sort((v,C)=>x.indexOf(v.id)-x.indexOf(C.id))),!w||!O)return{labels:[],datasets:[]};const S=JS({barSegmentLabels:O,coordinator:i,customColors:e.colorPalette,hasDimensions:h,isMultiMetric:d,metricNames:l,pivotRecords:y,rowLabels:w,seriesDimension:g,uuid:n}),A=h?w.map(v=>s&&s.te(`chartLabels.${v.name}`)&&s.t(`chartLabels.${v.name}`)||v.name):l.map(v=>s&&s.te(`chartLabels.${v}`)&&s.t(`chartLabels.${v}`)||v),R=w.map(v=>v.id==="empty");return{labels:A,datasets:S,isLabelEmpty:R,isMultiDimension:f}}}catch(a){return console.error(a),{datasets:[],labels:[]}}return{labels:[],datasets:[]}})}const e1=(e,t,n=1)=>Array(Math.ceil((t-e)/n)).fill(e).map((i,s)=>i+s*n),n1=e=>{if(typeof e=="string"){const t=+e;if(t)return t;try{return Fl(e).getTime()}catch(n){if(n instanceof RangeError)return 0;throw n}}return e},i1=(e,t,n,i,s)=>{const a=Math.max(t-6e4,Math.max(...(s||[]).map(c=>new Date(c.timestamp).valueOf()))),r=Math.floor((e-i)/n)*n+i,l=Math.floor((a-i)/n)*n+i+n;return e1(r,l,n)};function s1(e,t,n,i){const{i18n:s}=K.useI18n();return u.computed(()=>{try{if(t.value&&"meta"in t.value&&"data"in t.value){const a=t.value.data,{display:r,metric_names:l,metric_units:c,start:d,end:h}=t.value.meta,f=new Date(d).getTime(),m=new Date(h).getTime();if(!l)return console.error("Cannot build chart data from this explore result. Missing metric names."),{datasets:[]};const p=r&&Object.keys(r)||l,g=p&&p[0],y=r?.[g],_=!!y&&l.length>1;let x=r&&y&&Object.keys(y).map(C=>({id:C,name:y[C].name}))||l.map(C=>({id:C,name:C}));g==="country_code"&&(x=x.map(C=>({...C,name:Co(C.id)||C.name})));const T=t.value.meta.granularity_ms;if(typeof T!="number"||isNaN(T)||!isFinite(T)||T===0)return console.error("Invalid step value:",T),{datasets:[],labels:[]};if(!a.length)return{datasets:[],labels:[]};const k=n1(f),w=i1(f,m,T,k,a),O=!p.length,S=a?.length?a.reduce((C,I)=>{const U=new Date(I.timestamp).valueOf(),H=I.event;for(const V of l)U in C||(C[U]={}),V in C[U]||(C[U][V]={});for(const V of l)x.forEach(G=>{(y?H[g]===G.id:V===G.id)?(C[U][V]||(C[U][V]={}),C[U][V][G.id]=Math.round(Number(H[V])*1e3)/1e3):O&&(C[U][V]||(C[U][V]={}),C[U][V][G.id]=Math.round(Number(H[G.id])*1e3)/1e3)});return C},{}):{},A=y||l.length===1?l.flatMap(C=>x.map(I=>[C,I.id,I.name,I.id==="empty"])):x.map(C=>[C.name,C.id,C.name,C.id==="empty"]),R=e.colorPalette&&!Array.isArray(e.colorPalette)?e.colorPalette:void 0,D=O||!i?.color,v=[...A].map(([C,I,U,H],V)=>{const G=w.map(E=>E in S&&C in S[E]?{x:E,y:S[E][C][I]||0}:{x:E,y:0}),rt=pe({...D===!0&&{discriminator:V},dimension:g,dimensionValue:I,coordinator:i?.color,order:V,chartUuid:n,customDimensionColors:R}),ot=th(U)?s.t(`chartLabels.${U}`):U,X=th(C)?s.t(`chartLabels.${C}`):C,B=l.findIndex(E=>E===C),M=e.metricAxisMap?.[C]==="right";return{dimension:g,dimensionValue:I,rawDimension:U,rawMetric:C,label:_?`${ot} — ${X}`:ot,borderColor:rt,backgroundColor:rt,data:G,total:G.reduce((E,{y:z})=>E+Number(z),0),...V1,..._?{borderDash:B===0?[]:[B*4,2]}:{},...!_&&M?{borderDash:[4,2]}:{},...M?{yAxisID:Ia}:{},...e.metricAxisMap?{unit:c?.[C]??""}:{},fill:e.fill,borderWidth:e.fill?$1:H1,isSegmentEmpty:H}});return g==="status_code"||g==="status_code_grouped"?v.sort((C,I)=>(C.label??"")<(I.label??"")?-1:1):v.sort((C,I)=>Number(C.total)<Number(I.total)?-1:1),{datasets:v}}}catch(a){return console.error(a),{labels:[],datasets:[]}}return{labels:[],datasets:[]}})}const o1=3,a1=.6,_d=2,r1=2,xd=50,l1=[6,4],c1=[2,3],u1=(e,t)=>{const n=Math.sin(t)*1e4;return(n-Math.floor(n))*e};function d1(e,t,n,i){const{i18n:s}=K.useI18n(),o=(a,r)=>r||(a===xd?s.t("scatter.median"):s.t("scatter.percentile",{value:a}));return u.computed(()=>{try{const a=t.value;if(!a?.points?.length)return{datasets:[]};const{metric:r,dimension:l,display:c,xMetric:d,xMetricUnit:h}=a,f=d?s.te(`chartLabels.${d}`)&&s.t(`chartLabels.${d}`)||d:"",m=e.scatter||{},p=m.jitterMs??0,g=m.pointRadius??o1,y=m.pointOpacity??a1,_=new Map,x=[];a.points.forEach(I=>{const U=I.group??r,H=_.get(U)||[];let V,G;I.x!==void 0?(V={x:I.x,timestamp:I.timestamp},G=[{label:f,value:I.x,...h?{unit:h}:{}},...I.extras??[]]):(V={x:I.timestamp+u1(p,I.timestamp+I.value)},G=I.extras??[]),H.push({...V,y:I.value,...G.length?{extras:G}:{}}),_.set(U,H),x.push(I.value)});const T=m.percentileLines||[],k=[...T.map(I=>I.percentile),...m.outlierPercentile!==void 0?[m.outlierPercentile]:[]],w=k.length?IM(x,k):new Map,O=m.outlierPercentile!==void 0?w.get(m.outlierPercentile):void 0,S=O!==void 0&&Number.isFinite(O),A=e.themeColors?.value??Ga(),R=[],D=I=>{const U=I?.y;return S&&Number.isFinite(U)&&U>O},v=e.colorPalette&&!Array.isArray(e.colorPalette)?e.colorPalette:void 0;Array.from(_.entries()).forEach(([I,U],H)=>{const V=l&&c?.[I]?.name||I,G=I==="empty",rt=pe({...!i?.color&&{discriminator:H},dimension:l,dimensionValue:I,coordinator:i?.color,order:H,chartUuid:n,customDimensionColors:v}),ot=qa(rt,y),X=s.te(`chartLabels.${V}`)&&s.t(`chartLabels.${V}`)||V;R.push({dimension:l,dimensionValue:I,type:"scatter",rawDimension:V,rawMetric:r,label:X,borderColor:B=>D(B.raw)?A.outlier:rt,backgroundColor:B=>D(B.raw)?A.outlier:ot,pointRadius:B=>D(B.raw)?g+_d:g,pointHoverRadius:B=>(D(B.raw)?g+_d:g)+r1,data:U,pointBorderWidth:0,showLine:!1,isSegmentEmpty:G})});const C=[];return T.forEach(I=>{const U=w.get(I.percentile);if(U===void 0||!Number.isFinite(U))return;const H=I.percentile===xd;C.push({percentile:I.percentile,label:o(I.percentile,I.label),value:U,color:I.color||(H?A.medianLine:A.outlier),borderDash:I.borderDash||(H?l1:c1)})}),{datasets:R,...S?{outlier:{value:O,label:s.t("scatter.outlier",{label:o(m.outlierPercentile)}),color:A.outlier}}:{},...C.length?{referenceLines:C}:{}}}catch(a){return console.warn(a),{datasets:[]}}})}const h1=(e,t)=>{u.watch([e,t],(n,i,s)=>{const[o,a]=n;!a||!window||(window._AnalyticsChartDataInternal||(window._AnalyticsChartDataInternal=new Map),window._AnalyticsChartDataInternal.set(a,o),s(()=>{window._AnalyticsChartDataInternal?.delete(a)}))},{immediate:!0})};function f1(){const{i18n:e}=K.useI18n();return{translateUnit:(n,i)=>{const s=i===1,o=`chartUnits.${n}`;return zi(n)?"":e.te(o)?e.t(o,{plural:s?"":"s"}):n}}}function m1(){const e=u.inject(Df);return{evaluateFeatureFlag:(n,i)=>typeof e?.evaluateFeatureFlagFn!="function"?i:e.evaluateFeatureFlagFn(n,i)}}function wd(e,t){return u.getCurrentScope()?(u.onScopeDispose(e,t),!0):!1}const kd=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const p1=e=>e!=null,g1=Object.prototype.toString,y1=e=>g1.call(e)==="[object Object]";function Vs(e){return Array.isArray(e)?e:[e]}function b1(e){return u.getCurrentInstance()}function _1(e,t={}){if(!u.isRef(e))return u.toRefs(e);const n=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)n[i]=u.customRef(()=>({get(){return e.value[i]},set(s){var o;if(!((o=u.toValue(t.replaceRef))!==null&&o!==void 0)||o)if(Array.isArray(e.value)){const a=[...e.value];a[i]=s,e.value=a}else{const a={...e.value,[i]:s};Object.setPrototypeOf(a,Object.getPrototypeOf(e.value)),e.value=a}else e.value[i]=s}}));return n}function x1(e,t=!0,n){b1()?u.onMounted(e,n):t?e():u.nextTick(e)}function w1(e,t,n){return u.watch(e,t,{...n,immediate:!0})}const Hs=kd?window:void 0;function Ln(e){var t;const n=u.toValue(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Li(...e){const t=(i,s,o,a)=>(i.addEventListener(s,o,a),()=>i.removeEventListener(s,o,a)),n=u.computed(()=>{const i=Vs(u.toValue(e[0])).filter(s=>s!=null);return i.every(s=>typeof s!="string")?i:void 0});return w1(()=>{var i,s;return[(i=(s=n.value)===null||s===void 0?void 0:s.map(o=>Ln(o)))!==null&&i!==void 0?i:[Hs].filter(o=>o!=null),Vs(u.toValue(n.value?e[1]:e[0])),Vs(u.unref(n.value?e[2]:e[1])),u.toValue(n.value?e[3]:e[2])]},([i,s,o,a],r,l)=>{if(!i?.length||!s?.length||!o?.length)return;const c=y1(a)?{...a}:a,d=i.flatMap(h=>s.flatMap(f=>o.map(m=>t(h,f,m,c))));l(()=>{d.forEach(h=>h())})},{flush:"post"})}function k1(){const e=u.shallowRef(!1),t=u.getCurrentInstance();return t&&u.onMounted(()=>{e.value=!0},t),e}function Td(e){const t=k1();return u.computed(()=>(t.value,!!e()))}function T1(e,t,n={}){const{window:i=Hs,...s}=n;let o;const a=Td(()=>i&&"MutationObserver"in i),r=()=>{o&&(o.disconnect(),o=void 0)},l=u.watch(u.computed(()=>{const h=Vs(u.toValue(e)).map(Ln).filter(p1);return new Set(h)}),h=>{r(),a.value&&h.size&&(o=new MutationObserver(t),h.forEach(f=>o.observe(f,s)))},{immediate:!0,flush:"post"}),c=()=>o?.takeRecords(),d=()=>{l(),r()};return wd(d),{isSupported:a,stop:d,takeRecords:c}}const $s={speed:2,margin:30,direction:"both"};function v1(e){e.scrollLeft>e.scrollWidth-e.clientWidth&&(e.scrollLeft=Math.max(0,e.scrollWidth-e.clientWidth)),e.scrollTop>e.scrollHeight-e.clientHeight&&(e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight))}function S1(e,t={}){var n,i,s,o;const{pointerTypes:a,preventDefault:r,stopPropagation:l,exact:c,onMove:d,onEnd:h,onStart:f,initialValue:m,axis:p="both",draggingElement:g=Hs,containerElement:y,handle:_=e,buttons:x=[0],restrictInView:T,autoScroll:k=!1}=t,w=u.ref((n=u.toValue(m))!==null&&n!==void 0?n:{x:0,y:0}),O=u.ref(),S=B=>a?a.includes(B.pointerType):!0,A=B=>{u.toValue(r)&&B.preventDefault(),u.toValue(l)&&B.stopPropagation()},R=u.toValue(k),D=typeof R=="object"?{speed:(i=u.toValue(R.speed))!==null&&i!==void 0?i:$s.speed,margin:(s=u.toValue(R.margin))!==null&&s!==void 0?s:$s.margin,direction:(o=R.direction)!==null&&o!==void 0?o:$s.direction}:$s,v=B=>typeof B=="number"?[B,B]:[B.x,B.y],C=(B,M,E)=>{const{clientWidth:z,clientHeight:Y,scrollLeft:nt,scrollTop:N,scrollWidth:$,scrollHeight:pt}=B,[ct,at]=v(D.margin),[Ct,Bt]=v(D.speed);let Pt=0,St=0;(D.direction==="x"||D.direction==="both")&&(E.x<ct&&nt>0?Pt=-Ct:E.x+M.width>z-ct&&nt<$-z&&(Pt=Ct)),(D.direction==="y"||D.direction==="both")&&(E.y<at&&N>0?St=-Bt:E.y+M.height>Y-at&&N<pt-Y&&(St=Bt)),(Pt||St)&&B.scrollBy({left:Pt,top:St,behavior:"auto"})};let I=null;const U=()=>{const B=u.toValue(y);B&&!I&&(I=setInterval(()=>{const M=u.toValue(e).getBoundingClientRect(),{x:E,y:z}=w.value,Y={x:E-B.scrollLeft,y:z-B.scrollTop};Y.x>=0&&Y.y>=0&&(C(B,M,Y),Y.x+=B.scrollLeft,Y.y+=B.scrollTop,w.value=Y)},1e3/60))},H=()=>{I&&(clearInterval(I),I=null)},V=(B,M,E,z)=>{const[Y,nt]=typeof E=="number"?[E,E]:[E.x,E.y],{clientWidth:N,clientHeight:$}=M;return B.x<Y||B.x+z.width>N-Y||B.y<nt||B.y+z.height>$-nt},G=()=>{if(u.toValue(t.disabled)||!O.value)return;const B=u.toValue(y);if(!B)return;const M=u.toValue(e).getBoundingClientRect(),{x:E,y:z}=w.value,Y={x:E-B.scrollLeft,y:z-B.scrollTop};V(Y,B,D.margin,M)?U():H()};u.toValue(k)&&u.watch(w,G);const rt=B=>{var M;if(!u.toValue(x).includes(B.button)||u.toValue(t.disabled)||!S(B)||u.toValue(c)&&B.target!==u.toValue(e))return;const E=u.toValue(y),z=E==null||(M=E.getBoundingClientRect)===null||M===void 0?void 0:M.call(E),Y=u.toValue(e).getBoundingClientRect(),nt={x:B.clientX-(E?Y.left-z.left+(k?0:E.scrollLeft):Y.left),y:B.clientY-(E?Y.top-z.top+(k?0:E.scrollTop):Y.top)};f?.(nt,B)!==!1&&(O.value=nt,A(B))},ot=B=>{if(u.toValue(t.disabled)||!S(B)||!O.value)return;const M=u.toValue(y);M instanceof HTMLElement&&v1(M);const E=u.toValue(e).getBoundingClientRect();let{x:z,y:Y}=w.value;if((p==="x"||p==="both")&&(z=B.clientX-O.value.x,M&&(z=Math.min(Math.max(0,z),M.scrollWidth-E.width))),(p==="y"||p==="both")&&(Y=B.clientY-O.value.y,M&&(Y=Math.min(Math.max(0,Y),M.scrollHeight-E.height))),u.toValue(k)&&M&&(I===null&&C(M,E,{x:z,y:Y}),z+=M.scrollLeft,Y+=M.scrollTop),M&&(T||k)){if(p!=="y"){const nt=z-M.scrollLeft;nt<0?z=M.scrollLeft:nt>M.clientWidth-E.width&&(z=M.clientWidth-E.width+M.scrollLeft)}if(p!=="x"){const nt=Y-M.scrollTop;nt<0?Y=M.scrollTop:nt>M.clientHeight-E.height&&(Y=M.clientHeight-E.height+M.scrollTop)}}w.value={x:z,y:Y},d?.(w.value,B),A(B)},X=B=>{u.toValue(t.disabled)||!S(B)||O.value&&(O.value=void 0,k&&H(),h?.(w.value,B),A(B))};if(kd){const B=()=>{var M;return{capture:(M=t.capture)!==null&&M!==void 0?M:!0,passive:!u.toValue(r)}};Li(_,"pointerdown",rt,B),Li(g,"pointermove",ot,B),Li(g,["pointerup","pointercancel"],X,B)}return{..._1(w),position:w,isDragging:u.computed(()=>!!O.value),style:u.computed(()=>`
|
|
4
4
|
left: ${w.value.x}px;
|
|
5
5
|
top: ${w.value.y}px;
|
|
6
|
-
${
|
|
7
|
-
`)}}function NM(e,t,n={}){const{window:i=$s,...s}=n;let o;const a=Pd(()=>i&&"ResizeObserver"in i),r=()=>{o&&(o.disconnect(),o=void 0)},l=u.watch(u.computed(()=>{const d=u.toValue(e);return Array.isArray(d)?d.map(h=>Ln(h)):[Ln(d)]}),d=>{if(r(),a.value&&i){o=new ResizeObserver(t);for(const h of d)h&&o.observe(h,s)}},{immediate:!0,flush:"post"}),c=()=>{r(),l()};return Od(c),{isSupported:a,stop:c}}function BM(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:s=!0,immediate:o=!0,updateTiming:a="sync"}=t,r=u.shallowRef(0),l=u.shallowRef(0),c=u.shallowRef(0),d=u.shallowRef(0),h=u.shallowRef(0),f=u.shallowRef(0),m=u.shallowRef(0),p=u.shallowRef(0);function g(){const _=Ln(e);if(!_){n&&(r.value=0,l.value=0,c.value=0,d.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const x=_.getBoundingClientRect();r.value=x.height,l.value=x.bottom,c.value=x.left,d.value=x.right,h.value=x.top,f.value=x.width,m.value=x.x,p.value=x.y}function y(){a==="sync"?g():a==="next-frame"&&requestAnimationFrame(()=>g())}return NM(e,y),u.watch(()=>Ln(e),_=>!_&&y()),RM(e,y,{attributeFilter:["style","class"]}),s&&Ni("scroll",y,{capture:!0,passive:!0}),i&&Ni("resize",y,{passive:!0}),AM(()=>{o&&y()}),{height:r,bottom:l,left:c,right:d,top:h,width:f,x:m,y:p,update:y}}function FM(e,t){const{top:n,left:i}=BM(e),s=u.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),o=u.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:o}}const zM=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=n).sort((l,c)=>l-c),o=[];if(n-t<e-2)return[];const a=(n-t)/e;let r=0;for(let l=0;l<e;l++){const c=t+l*a,d=t+(l+1)*a;let h=0;for(;r<s.length&&s[r]>=c&&s[r]<=d;)h++,r++;o.push([Math.ceil(c),h])}return o},Ed=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Bi=u.ref({}),UM=e=>(Bi.value[e]||(Bi.value[e]=Ed()),Bi.value[e]),VM=(e,t)=>{const n=Bi.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete Bi.value[t])};function HM({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:s=void 0,minCount:o=void 0,maxCount:a=void 0,renderPoints:r=void 0,type:l}){const d=n!==void 0&&e!==void 0?UM(n):Ed(),h=e!==void 0?e:"static-chart-key",f=u.computed(()=>t.reduce((S,{timestamps:A})=>[...S,...A],[])),m=u.computed(()=>i||f.value.reduce((S,A)=>S===0?A:Math.min(S,A),0)),p=u.computed(()=>s||f.value.reduce((S,A)=>Math.max(S,A),0));u.watchEffect(()=>{d.minStamps[h]=m.value,d.maxStamps[h]=p.value,r!==void 0&&(d.renderPoints[h]=r)});const g=u.computed(()=>Object.values(d.minStamps).reduce((S,A)=>S===0?A:Math.min(S,A),0)),y=u.computed(()=>Object.values(d.maxStamps).reduce((S,A)=>Math.max(S,A),0)),_=u.computed(()=>{const S=Object.values(d.renderPoints);return S.length===0?24:S.reduce((A,L)=>Math.max(A,L),2)}),x=u.computed(()=>{const S=y.value-g.value;return Math.ceil(S/_.value)}),T=u.computed(()=>t.length>1),v=u.computed(()=>t.map(({timestamps:S,color:A,label:L})=>({data:zM({bucketCount:_.value,minStamp:g.value,maxStamp:y.value,timestamps:S}).map(([W,$])=>({x:W,y:$})),label:L,...(l==="sparkline_bar"||T.value)&&A&&{backgroundColor:A},...l!=="sparkline_bar"&&A&&{borderColor:A},...T.value&&l!=="sparkline_bar"&&{fill:!0}}))),w=u.computed(()=>{const S=v.value[0]?.data?.length??0,A=[];for(let L=0;L<S;L++){let R=0;for(let H=0;H<v.value.length;H++)R+=v.value[H].data[L].y;A.push(R)}return A}),M=u.computed(()=>{const S=w.value.reduce((A,L)=>Math.max(A,L),0);return Math.max(S,a??0)}),D=u.computed(()=>{const S=v.value.reduce((R,{data:H})=>[...R,...H.map(({y:W})=>W)],[]),A=S.length?S[0]:0,L=S.reduce((R,H)=>Math.min(R,H),A);return o===void 0?L:Math.min(L,o)});u.watchEffect(()=>{d.maxCounts[h]=M.value,d.minCounts[h]=D.value});const P=u.computed(()=>{const S=Object.values(d.minCounts),A=S.length?S[0]:0;return S.reduce((L,R)=>Math.min(L,R),A)}),k=u.computed(()=>Object.values(d.maxCounts).reduce((S,A)=>Math.max(S,A),0));return u.onUnmounted(()=>{e!==void 0&&n!==void 0&&VM(e,n)}),{syncedMinStamp:g,syncedMaxStamp:y,syncedRenderPoints:_,syncedChartDatasets:v,syncedGroupSizeMs:x,syncedMinCount:P,syncedMaxCount:k}}const an=(e,t)=>{if(!e||!t)return;const n=t.toLowerCase();return e[t]??Object.entries(e).find(([i])=>i.toLowerCase()===n)?.[1]},Nn=e=>{if(e==null||e==="")return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},Pa=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Ea=(e,t)=>t.sum>0?e/t.sum:null,Rd=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},Ra=(e,t)=>{const n=(t??[]).filter(o=>e>=o.value);if(!n.length)return;const i=Math.max(...n.map(o=>o.value));return n.filter(o=>o.value===i).some(o=>o.type==="error")?"error":"warning"},Id=18,$M=85;function YM(e,t,n,i){const{i18n:s}=Xl(),{formatUnit:o}=oe({i18n:s}),a=w=>w.map(M=>{const D=Math.min(M.ratio,.5)/.5;return{...M,color:Li({metric:n.value}),tint:`${Id+D*($M-Id)}%`}}),r=u.computed(()=>e.value?.data??[]),l=u.computed(()=>e.value?.meta?.metric_names??[]),c=u.computed(()=>{const w=n.value;return w&&l.value.includes(w)?w:l.value[0]}),d=u.computed(()=>l.value.filter(w=>w!==c.value)),h=u.computed(()=>e.value?.meta?.display?.[t.value]??{}),f=(w,M)=>{if(zi(w)||w==="count"||w==="requests")return"";const D=M===1?"":"s";return s.te(`chartUnits.${w}`)?s.t(`chartUnits.${w}`,{plural:D}):w},m=w=>{const M=D=>o(D,"%",{translateUnit:P=>f(P,D)});return w>0&&w<.01?`< ${M(.01)}`:M(w)},p=(w,M)=>{if(w===null)return"–";const D=e.value?.meta?.metric_units?.[M]||"count";return D==="%"?m(w):o(w,D,{isBytes1024:!0,translateUnit:P=>f(P,w)})},g=w=>s.te(`chartLabels.${w}`)?s.t(`chartLabels.${w}`):w,y=w=>an(i.value,w)?.label||g(w),_=u.computed(()=>Pa(r.value.map(w=>c.value?Nn(w.event[c.value]):null))),x=w=>d.value.flatMap(M=>{const D=Nn(w[M]);if(D===null)return[];const P=Ra(D,an(i.value,M)?.thresholds);return[{key:M,label:y(M),value:p(D,M),threshold:P}]}),T=u.computed(()=>{if(!c.value)return[];const w=r.value.map(M=>{const D=M.event,P=String(D[t.value]),k=Nn(D[c.value])??0,S=Ea(k,_.value),A=S??0,L=P===Aa;return{id:P,name:L?g(Aa):h.value[P]?.name||P,deleted:!!h.value[P]?.deleted,isOther:L,isEmpty:P===TM,value:k,ratio:A,display:p(k,c.value),relative:S===null?"":m(S*100),tooltipRows:x(D)}}).sort((M,D)=>Number(M.isOther)-Number(D.isOther)||D.value-M.value);return a(w)});return{column:u.computed(()=>({dimension:t.value,label:y(t.value),total:p(_.value.sum,c.value??"count"),cells:T.value})),cells:T,sizeKey:c}}const q={useBarChartOptions:TS,useChartJSCommon:vS,useChartLegendValues:DS,useExploreResultToDatasets:lM,useExploreResultToTimeDataset:hM,useScatterDatasets:_M,useDonutChartOptions:CS,useLineChartOptions:OS,useScatterChartOptions:ES,useI18n:Xl,useReportChartDataForSynthetics:xM,useTranslatedUnits:wM,useEvaluateFeatureFlag:SM,useTooltipAbsolutePosition:FM,useSparklineSync:HM,useTopTalkersData:YM},Ws=e=>["interactive","zoom-interactive"].includes(e),Ia=(e,t,n,i)=>{const{tooltip:s}=t;if(s.opacity===0&&!Ws(e.interactionMode)){e.showTooltip=!1;return}const{i18n:o}=q.useI18n(),{formatUnit:a}=oe({i18n:o}),r=e.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!Ws(e.interactionMode)){const l=s.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",d=s.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(d,n,s.dataPoints[0].raw):zn({tickValue:new Date(d),granularity:n}),e.tooltipSeries=s.dataPoints.map((f,m)=>{const p=f.parsed[c],g=f.dataset.unit??e.units,y=a(p??0,g,{translateUnit:e.translateUnit}),_=f.raw?.tooltipLabel||f.dataset.label;return{backgroundColor:l[m].backgroundColor,borderColor:l[m].borderColor,label:_,value:y,rawValue:p,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(r);const h=s.dataPoints[0]?.raw?.extras??[];for(const f of h)e.tooltipSeries.push({label:f.label,value:f.unit?a(Number(f.value)||0,f.unit,{translateUnit:e.translateUnit}):String(f.value),rawValue:Number(f.value)||0,isExtra:!0});e.left=`${s.x}px`,e.top=`${s.y}px`,e.showTooltip=!0}},Ld=(e,t)=>{const{tooltip:n}=t,{i18n:i}=q.useI18n(),{formatUnit:s}=oe({i18n:i});if(n.opacity===0&&!Ws(e.interactionMode)){e.showTooltip=!1;return}const o=e.chartTooltipSortFn||((a,r)=>r.rawValue-a.rawValue);if(n.body&&!Ws(e.interactionMode)){const a=n.labelColors,r=t.chart.config?.options?.indexAxis==="y"?"x":"y",l=["gauge","donut"].includes(e.chartType);l?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((c,d)=>{const h=l?c.parsed:c.parsed[r],f=s(h??0,e.units,{translateUnit:e.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:a[d].backgroundColor,borderColor:a[d].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(o),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},WM=e=>e&&e.datasets&&e.datasets.length,jM=e=>WM(e)&&e.datasets.some(t=>t.data.length),qM=e=>e.datasets.some(t=>t.data[0]&&Eo(t.data[0].x)),GM=e=>!!jM(e)&&e.datasets.some(t=>t.data.length==1),XM=e=>qM(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),js=(e,t,n)=>{const s=Math.min(t/1150,1),o=.15,a=1.15,r=e.x??0;return r<n?r+t*o*(1-s):r-t*a*(1-s)},Nd=(e,t,n)=>{const o=e.y??0;return o<n?o+t*.15:o-t*.5};function Bd(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const La=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(s=>!t?.[s.text]?.isThreshold).map(((s,o)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[o].isSegmentEmpty}))).sort(n)},KM=2,Fd=10,zd=12,qs=10,Gs="y",Na="y1",he=["#a86cd5","#6a86d2","#00bbf9","#00c4b0","#ffdf15"],Ba=(e,t)=>(t||he)[e%he.length],ZM="#6f7787",QM={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"}},JM=e=>{const t=Math.floor(parseInt(e,10)/100)*100;return QM[t]?.background||"#fafafa"},t1=sg,Fa=(e,t,n,i)=>{let s;return n?s=t1:Array.isArray(i)?s=Ba(e,i):s=i[t],s||Ba(e)},za=e=>{switch(e){case"error":return og;case"warning":return cg;case"neutral":return gl;default:return gl}},e1={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},n1=2,i1=0,Ua=new Map,Ud=(e,t)=>{const{i18n:n}=q.useI18n(),{formatBytes:i}=oe({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):ss.format(e)},s1=e=>{const n=document.createElement("canvas").getContext("2d"),i=wt({});return n.font=i.string,n.measureText(e).width},o1=()=>{const e="label_height";if(!Ua.has(e)){const t=wt({});Ua.set(e,t.lineHeight)}return Ua.get(e)},a1=(e,t)=>t.datasets.reduce((n,i,s)=>e.isDatasetVisible(s)?n+i.data.reduce((o,a)=>isNaN(a)?o:o+a,0):n,0),r1=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,l1=ig,c1={100:hg,101:fg,102:mg,103:pg,200:gg,201:yg,202:bg,203:_g,204:xg,205:wg,206:kg,207:Tg,208:Sg,226:vg,300:Mg,301:Dg,302:Cg,303:Og,304:Ag,305:Pg,307:Eg,308:Rg,400:Ig,401:Lg,402:Ng,403:Bg,404:Fg,405:zg,406:Ug,407:Vg,408:Hg,409:$g,410:Yg,411:Wg,412:jg,413:qg,414:Gg,415:Xg,416:Kg,417:Zg,418:Qg,421:Jg,422:ty,423:ey,424:ny,425:iy,426:sy,428:oy,429:ay,431:ry,451:ly,500:cy,501:uy,502:dy,503:hy,504:fy,505:my,506:py,507:gy,508:yy,510:by,511:_y},u1={100:xy,200:wy,300:ky,400:Ty,500:Sy},d1={"1XX":vy,"2XX":My,"3XX":Dy,"4XX":Cy,"5XX":Oy},Vd=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return c1[t]??u1[n]??l1},Va={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=Vd(`${t}`),e),{}),____OTHER____:ng,...d1};function Hd(e,t,n){const i=Ul(),s=m1(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?h1(s,t):f1(s,t)}function h1(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function f1(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function m1(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function p1(e,t){const n=x1(t);return"formatToParts"in n?y1(n,e):b1(n,e)}const g1={year:0,month:1,day:2,hour:3,minute:4,second:5};function y1(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=g1[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function b1(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Ha={},$d=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")),_1=$d==="06/25/2014, 00:00:00"||$d==="06/25/2014 00:00:00";function x1(e){return Ha[e]||(Ha[e]=_1?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Ha[e]}function Yd(e,t,n,i,s,o,a){const r=new Date(0);return r.setUTCFullYear(e,t,n),r.setUTCHours(i,s,o,a),r}const Wd=36e5,w1=6e4,$a={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function Ya(e,t,n){if(!e)return 0;let i=$a.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=$a.timezoneHH.exec(e),i)return s=parseInt(i[1],10),jd(s)?-(s*Wd):NaN;if(i=$a.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return jd(s,a)?(o=Math.abs(s)*Wd+a*w1,i[1]==="+"?-o:o):NaN}if(S1(e)){t=new Date(t||Date.now());const a=n?t:k1(t),r=Wa(a,e);return-(n?r:T1(t,r,e))}return NaN}function k1(e){return Yd(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Wa(e,t){const n=p1(e,t),i=Yd(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function T1(e,t,n){let s=e.getTime()-t;const o=Wa(new Date(s),n);if(t===o)return t;s-=o-t;const a=Wa(new Date(s),n);return o===a?o:Math.max(o,a)}function jd(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const qd={};function S1(e){if(qd[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),qd[e]=!0,!0}catch{return!1}}const v1=60*1e3,M1={X:function(e,t,n){const i=ja(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Gd(i);case"XXXX":case"XX":return Bn(i);default:return Bn(i,":")}},x:function(e,t,n){const i=ja(n.timeZone,e);switch(t){case"x":return Gd(i);case"xxxx":case"xx":return Bn(i);default:return Bn(i,":")}},O:function(e,t,n){const i=ja(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+D1(i,":");default:return"GMT"+Bn(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Hd("short",e,n);default:return Hd("long",e,n)}}};function ja(e,t){const n=e?Ya(e,t,!0)/v1:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Xs(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Bn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Xs(Math.floor(i/60),2),o=Xs(Math.floor(i%60),2);return n+s+t+o}function Gd(e,t){return e%60===0?(e>0?"-":"+")+Xs(Math.abs(e)/60,2):Bn(e,t)}function D1(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Xs(o,2)}function Xd(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const C1=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,qa=36e5,Kd=6e4,O1=2,Wt={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:C1};function Zd(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?O1:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=A1(e),{year:s,restDateString:o}=P1(i.date,n),a=E1(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const r=a.getTime();let l=0,c;if(i.time&&(l=R1(i.time),l===null||isNaN(l)))return new Date(NaN);if(i.timeZone||t.timeZone){if(c=Ya(i.timeZone||t.timeZone,new Date(r+l)),isNaN(c))return new Date(NaN)}else c=Xd(new Date(r+l)),c=Xd(new Date(r+l+c));return new Date(r+l+c)}else return new Date(NaN)}function A1(e){const t={};let n=Wt.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=Wt.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=Wt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function P1(e,t){if(e){const n=Wt.YYY[t],i=Wt.YYYYY[t];let s=Wt.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=Wt.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function E1(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=Wt.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,th(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=Wt.DDD.exec(e),o){n=new Date(0);const a=parseInt(o[1],10);return N1(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(o=Wt.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return th(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(o=Wt.Www.exec(e),o)return s=parseInt(o[1],10)-1,eh(s)?Qd(t,s):new Date(NaN);if(o=Wt.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return eh(s,a)?Qd(t,s,a):new Date(NaN)}return null}function R1(e){let t,n,i=Wt.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Ga(t)?t%24*qa:NaN;if(i=Wt.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Ga(t,n)?t%24*qa+n*Kd:NaN;if(i=Wt.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ga(t,n,s)?t%24*qa+n*Kd+s*1e3:NaN}return null}function Qd(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const I1=[31,28,31,30,31,30,31,31,30,31,30,31],L1=[31,29,31,30,31,30,31,31,30,31,30,31];function Jd(e){return e%400===0||e%4===0&&e%100!==0}function th(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Jd(e);if(i&&n>L1[t]||!i&&n>I1[t])return!1}return!0}function N1(e,t){if(t<1)return!1;const n=Jd(e);return!(n&&t>366||!n&&t>365)}function eh(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ga(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const B1=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function F1(e,t,n={}){t=String(t);const i=t.match(B1);if(i){const s=Zd(n.originalDate||e,n);t=i.reduce(function(o,a){if(a[0]==="'")return o;const r=o.indexOf(a),l=o[r-1]==="'",c=o.replace(a,"'"+M1[a[0]](s,a,n)+"'");return l?c.substring(0,r-1)+c.substring(r+1):c},t)}return rs(e,t,n)}function z1(e,t,n){e=Zd(e,n);const i=Ya(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Fi(e,t,n,i){return i={...i,timeZone:t,originalDate:e},F1(z1(e,t,{timeZone:i.timeZone}),n,i)}const U1=(e,t)=>`${Fi(e,t,"yyyy")} W${Fi(e,t,"II")}`,Xa="MMM dd, h:mm:ss a",Ka="h:mm:ss a",rn="MMM dd, h:mm a",Fn="h:mm a",V1="MMM dd",Za="MMM dd, h:mm:ss a",Ue="MMM dd, h:mm a",H1={secondly:e=>e?Xa:Ka,tenSecondly:e=>e?Xa:Ka,thirtySecondly:e=>e?Xa:Ka,minutely:e=>e?rn:Fn,fiveMinutely:e=>e?rn:Fn,tenMinutely:e=>e?rn:Fn,thirtyMinutely:e=>e?rn:Fn,hourly:e=>e?rn:Fn,twoHourly:e=>e?rn:Fn,twelveHourly:()=>rn,daily:()=>V1},$1={secondly:()=>Za,tenSecondly:()=>Za,thirtySecondly:()=>Za,minutely:()=>Ue,fiveMinutely:()=>Ue,tenMinutely:()=>Ue,thirtyMinutely:()=>Ue,hourly:()=>Ue,twoHourly:()=>Ue,twelveHourly:()=>Ue,daily:()=>Ue};function nh({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:o,defaultFormat:a}){const r=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return U1(e,r);if(s&&s[t]){const l=s[t](i);return Fi(e,r,l)}if(o&&o[t]){const l=o[t]();return Fi(e,r,l)}return Fi(e,r,a)}const Qa=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>nh({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:H1,defaultFormat:"MMM dd, h:mm:ss a"}),zn=({tickValue:e,granularity:t,timezone:n})=>nh({tickValue:e,granularity:t,timezone:n,tooltipMap:$1,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),ih=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",Y1=e=>{const{i18n:t}=q.useI18n();return ih(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.message==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},zi=e=>e.toLocaleLowerCase().endsWith("count"),W1=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},j1=(e,t)=>{if(!e.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(e.length-1),s=Math.floor(i),o=Math.ceil(i);return s===o?e[s]:e[s]+(e[o]-e[s])*(i-s)},q1=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,s)=>i-s);return new Map(t.map(i=>[i,j1(n,i)]))},sh=.7,Ja=(e,t)=>{const n=xs(e.trim());return n.valid?n.alpha(t).rgbString():e},tr=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:yl,outlier:ml,outlierBand:Ja(pl,sh)};const n=window.getComputedStyle(t),i=(s,o)=>n.getPropertyValue(s).trim()||o;return{medianLine:i("--kui-color-text",yl),outlier:i("--kui-color-background-danger",ml),outlierBand:Ja(i("--kui-color-background-danger-weakest",pl),sh)}},G1="empty",oh=e=>{if(!e||!("meta"in e)||!("data"in e))return;const{display:t,metric_names:n,metric_units:i,start:s,end:o,truncated:a,limit:r,datasource:l}=e.meta;if(!n?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const c=n.length>1?n[0]:void 0,d=c?n[1]:n[0],h=t&&Object.keys(t)[0]||void 0,f=e.data??[],m=[];for(const p of f){const g=rh(p.timestamp,p.event[d],h?p.event[h]:void 0);if(g){if(c){const y=ah(p.event[c]);if(y===void 0)continue;g.x=y}m.push(g)}}return{points:m,metric:d,metricUnit:i?.[d],...c?{xMetric:c,xMetricUnit:i?.[c]}:{},dimension:h,display:h?t?.[h]:void 0,start:s,end:o,truncated:a,limit:r,datasource:l}},ah=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},rh=(e,t,n,i)=>{const s=new Date(e).valueOf(),o=ah(t);if(!Number.isFinite(s)||o===void 0)return;const a=i?.length?{extras:i}:{};return n===void 0?{timestamp:s,value:o,...a}:{timestamp:s,value:o,group:n!==null&&n!==""?String(n):G1,...a}},X1=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:s,label:o,unit:a}of n){const r=ln(e,s)??ln(t,s);r==null||r===""||i.push({label:o??s,value:r,...a?{unit:a}:{}})}return i.length?i:void 0},K1=(e,t)=>{if(!e||!("meta"in e))return;const{metric:n,dimension:i,unroll:s,display:o,extraFields:a,metricUnit:r}=t,l=t.timestamp??"request_start";if(!n){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const c=[];for(const d of e.results??[]){const h=ln(d,l);for(const f of Z1(d,s)){const m=ln(f,n),p=i?ln(f,i)??ln(d,i):void 0,g=rh(h,m,i?p??null:void 0,X1(f,d,a));g&&c.push(g)}}return{points:c,metric:n,metricUnit:r,dimension:i,display:o,start:e.meta?.time_range?.start,end:e.meta?.time_range?.end,truncated:e.truncated,limit:e.limit,datasource:"requests"}},Z1=(e,t)=>{if(!t)return[e];const n=ln(e,t);return Array.isArray(n)?n:[]},ln=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},lh=e=>Object.hasOwn(Gl.chartLabels,e),Q1=["hidden","single","full"],J1=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],tD=["gauge","top_n","single_value"],er=e=>e===null||typeof e!="object"||!("points"in e)?!1:Array.isArray(e.points);var It=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(It||{});const ch={modes:{point(e,t){return Ks(e,t,{intersect:!0})},nearest(e,t,n){return iD(e,t,n)},x(e,t,n){return Ks(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return Ks(e,t,{intersect:n.intersect,axis:"y"})}}};function nr(e,t,n){return(ch.modes[n.mode]||ch.modes.nearest)(e,t,n)}function eD(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function nD(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function Ks(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):eD(i,t,n.axis))}function iD(e,t,n){let i=Number.POSITIVE_INFINITY;return Ks(e,t,n).reduce((s,o)=>{const a=o.getCenterPoint(),r=nD(t,a,n.axis),l=Cn(t,r);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function cn(e,t,n){const i=Math.cos(n),s=Math.sin(n),o=t.x,a=t.y;return{x:o+i*(e.x-o)-s*(e.y-a),y:a+s*(e.x-o)+i*(e.y-a)}}const sD=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,un=.001,Zs=(e,t,n)=>Math.min(n,Math.max(t,e)),uh=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function oD(e,t,n){for(const i of Object.keys(e))e[i]=Zs(e[i],t,n);return e}function aD(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function dh(e,{x:t,y:n,x2:i,y2:s},o,{borderWidth:a,hitTolerance:r}){const l=(a+r)/2,c=e.x>=t-l-un&&e.x<=i+l+un,d=e.y>=n-l-un&&e.y<=s+l+un;return o==="x"?c:(o==="y"||c)&&d}function hh(e,{rect:t,center:n},i,{rotation:s,borderWidth:o,hitTolerance:a}){const r=cn(e,n,Ot(-s));return dh(r,t,i,{borderWidth:o,hitTolerance:a})}function dn(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function rD(e,t,n,i=!0){const s=n.split(".");let o=0;for(const a of t.split(".")){const r=s[o++];if(parseInt(a,10)<parseInt(r,10))break;if(sD(r,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const fh=e=>typeof e=="string"&&e.endsWith("%"),mh=e=>parseFloat(e)/100,ph=e=>Zs(mh(e),0,1),Ui=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),lD={box:e=>Ui(e.centerX,e.centerY),doughnutLabel:e=>Ui(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Ui(e.centerX,e.centerY),line:e=>Ui(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Ui(e.centerX,e.centerY)};function ir(e,t){return t==="start"?0:t==="end"?e:fh(t)?ph(t)*e:e/2}function Ve(e,t,n=!0){return typeof t=="number"?t:fh(t)?(n?ph(t):mh(t))*e:e}function cD(e,t){const{x:n,width:i}=e,s=t.textAlign;return s==="center"?n+i/2:s==="end"||s==="right"?n+i:n}function gh(e,t,{borderWidth:n,position:i,xAdjust:s,yAdjust:o},a){const r=st(a),l=t.width+(r?a.width:0)+n,c=t.height+(r?a.height:0)+n,d=sr(i),h=xh(e.x,l,s,d.x),f=xh(e.y,c,o,d.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 sr(e,t="center"){return st(e)?{x:Q(e.x,t),y:Q(e.y,t)}:(e=Q(e,t),{x:e,y:e})}const yh=(e,t)=>e&&e.autoFit&&t<1;function bh(e,t){const n=e.font,i=dt(n)?n:[n];return yh(e,t)?i.map(function(s){const o=wt(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,wt(o)}):i.map(s=>wt(s))}function _h(e){return e&&(qt(e.xValue)||qt(e.yValue))}function xh(e,t,n=0,i){return e-ir(t,i)+n}function Un(e,t,n){const i=n.init;if(i){if(i===!0)return kh(t,n)}else return;return uD(e,t,n)}function wh(e,t,n){let i=!1;return t.forEach(s=>{Gt(e[s])?(i=!0,n[s]=e[s]):qt(n[s])&&delete n[s]}),i}function kh(e,t){const n=t.type||"line";return lD[n](e)}function uD(e,t,n){const i=mt(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return kh(t,n);if(st(i))return i}const or=new Map,dD=e=>isNaN(e)||e<=0,hD=e=>e.reduce(function(t,n){return t+=n.string,t},"");function Qs(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Js(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(Ot(i)),e.translate(-t,-n))}function ke(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function Vn(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function to(e,t){const n=t.content;if(Qs(n))return{width:Ve(n.width,t.width),height:Ve(n.height,t.height)};const i=bh(t),s=t.textStrokeWidth,o=dt(n)?n:[n],a=o.join()+hD(i)+s+(e._measureText?"-spriting":"");return or.has(a)||or.set(a,gD(e,o,i,s)),or.get(a)}function Th(e,t,n){const{x:i,y:s,width:o,height:a}=t;e.save(),Vn(e,n);const r=ke(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),On(e,{x:i,y:s,w:o,h:a,radius:oD(Ie(n.borderRadius),0,Math.min(o,a)/2)}),e.closePath(),e.fill(),r&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function Sh(e,t,n,i){const s=n.content;if(Qs(s)){e.save(),e.globalAlpha=_D(n.opacity,s.style.opacity),e.drawImage(s,t.x,t.y,t.width,t.height),e.restore();return}const o=dt(s)?s:[s],a=bh(n,i),r=n.color,l=dt(r)?r:[r],c=cD(t,n),d=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,fD(e,n)&&yD(e,{x:c,y:d},o,a),bD(e,{x:c,y:d},o,{fonts:a,colors:l}),e.restore()}function fD(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function mD(e,t,n,i){const{radius:s,options:o}=t,a=o.pointStyle,r=o.rotation;let l=(r||0)*qo;if(Qs(a)){e.save(),e.translate(n,i),e.rotate(l),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}dD(s)||pD(e,{x:n,y:i,radius:s,rotation:r,style:a,rad:l})}function pD(e,{x:t,y:n,radius:i,rotation:s,style:o,rad:a}){let r,l,c,d;switch(e.beginPath(),o){default:e.arc(t,n,i,0,yt),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=gs,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":d=i*.516,c=i-d,r=Math.cos(a+se)*c,l=Math.sin(a+se)*c,e.arc(t-r,n-l,d,a-it,a-bt),e.arc(t+l,n-r,d,a-bt,a),e.arc(t+r,n+l,d,a,a+bt),e.arc(t-l,n+r,d,a+bt,a+it),e.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,e.rect(t-c,n-c,2*c,2*c);break}a+=se;case"rectRot":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+l,n-r),e.lineTo(t+r,n+l),e.lineTo(t-l,n+r),e.closePath();break;case"crossRot":a+=se;case"cross":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r);break;case"star":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r),a+=se,r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r);break;case"line":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function gD(e,t,n,i){e.save();const s=t.length;let o=0,a=i;for(let r=0;r<s;r++){const l=n[Math.min(r,n.length-1)];e.font=l.string;const c=t[r];o=Math.max(o,e.measureText(c).width+i),a+=l.lineHeight}return e.restore(),{width:o,height:a}}function yD(e,{x:t,y:n},i,s){e.beginPath();let o=0;i.forEach(function(a,r){const l=s[Math.min(r,s.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(a,t,n+c/2+o),o+=c}),e.stroke()}function bD(e,{x:t,y:n},i,{fonts:s,colors:o}){let a=0;i.forEach(function(r,l){const c=o[Math.min(l,o.length-1)],d=s[Math.min(l,s.length-1)],h=d.lineHeight;e.beginPath(),e.font=d.string,e.fillStyle=c,e.fillText(r,t,n+h/2+a),a+=h,e.fill()})}function _D(e,t){const n=Re(e)?e:t;return Re(n)?Zs(n,0,1):1}const vh=["left","bottom","top","right"];function xD(e,t){const{pointX:n,pointY:i,options:s}=t,o=s.callout,a=o&&o.display&&vD(t,o);if(!a||DD(t,o,a))return;if(e.save(),e.beginPath(),!ke(e,o))return e.restore();const{separatorStart:l,separatorEnd:c}=wD(t,a),{sideStart:d,sideEnd:h}=TD(t,a,l);(o.margin>0||s.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(d.x,d.y),e.lineTo(h.x,h.y);const f=cn({x:n,y:i},t.getCenterPoint(),Ot(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function wD(e,t){const{x:n,y:i,x2:s,y2:o}=e,a=kD(e,t);let r,l;return t==="left"||t==="right"?(r={x:n+a,y:i},l={x:r.x,y:o}):(r={x:n,y:i+a},l={x:s,y:r.y}),{separatorStart:r,separatorEnd:l}}function kD(e,t){const{width:n,height:i,options:s}=e,o=s.callout.margin+s.borderWidth/2;return t==="right"?n+o:t==="bottom"?i+o:-o}function TD(e,t,n){const{y:i,width:s,height:o,options:a}=e,r=a.callout.start,l=SD(t,a.callout);let c,d;return t==="left"||t==="right"?(c={x:n.x,y:i+Ve(o,r)},d={x:c.x+l,y:c.y}):(c={x:n.x+Ve(s,r),y:n.y},d={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:d}}function SD(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function vD(e,t){const n=t.position;return vh.includes(n)?n:MD(e,t)}function MD(e,t){const{x:n,y:i,x2:s,y2:o,width:a,height:r,pointX:l,pointY:c,centerX:d,centerY:h,rotation:f}=e,m={x:d,y:h},p=t.start,g=Ve(a,p),y=Ve(r,p),_=[n,n+g,n+g,s],x=[i+y,o,i,o],T=[];for(let v=0;v<4;v++){const w=cn({x:_[v],y:x[v]},m,Ot(f));T.push({position:vh[v],distance:Cn(w,{x:l,y:c})})}return T.sort((v,w)=>v.distance-w.distance)[0].position}function DD(e,t,n){const{pointX:i,pointY:s}=e,o=t.margin;let a=i,r=s;return n==="left"?a+=o:n==="right"?a-=o:n==="top"?r+=o:n==="bottom"&&(r-=o),e.inRange(a,r)}const Mh={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 Hn(e,t,n){return t=typeof t=="number"?t:e.parse(t),xt(t)?e.getPixelForValue(t):n}function hn(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const s=n.charAt(0),o=Object.values(e).filter(a=>a.axis&&a.axis===s);return o.length?o[0].id:s}function Dh(e,t){if(e){const n=e.options.reverse,i=Hn(e,t.min,n?t.end:t.start),s=Hn(e,t.max,n?t.start:t.end);return{start:i,end:s}}}function Ch(e,t){const{chartArea:n,scales:i}=e,s=i[hn(i,t,"xScaleID")],o=i[hn(i,t,"yScaleID")];let a=n.width/2,r=n.height/2;return s&&(a=Hn(s,t.xValue,s.left+s.width/2)),o&&(r=Hn(o,t.yValue,o.top+o.height/2)),{x:a,y:r}}function ar(e,t){const n=e.scales,i=n[hn(n,t,"xScaleID")],s=n[hn(n,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:a}=i||e.chartArea,{top:r,bottom:l}=s||e.chartArea;const c=Ph(i,{min:t.xMin,max:t.xMax,start:o,end:a});o=c.start,a=c.end;const d=Ph(s,{min:t.yMin,max:t.yMax,start:l,end:r});return r=d.start,l=d.end,{x:o,y:r,x2:a,y2:l,width:a-o,height:l-r,centerX:o+(a-o)/2,centerY:r+(l-r)/2}}function Oh(e,t){if(!_h(t)){const n=ar(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const s=i*2,o=n.centerX+t.xAdjust,a=n.centerY+t.yAdjust;return{x:o-i,y:a-i,x2:o+i,y2:a+i,centerX:o,centerY:a,width:s,height:s,radius:i}}return OD(e,t)}function CD(e,t){const{scales:n,chartArea:i}=e,s=n[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?AD(s,o,t):PD(n,o,t),o}function Ah(e,t){const n=ar(e,t);return n.initProperties=Un(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:ID(e,n,t),initProperties:n.initProperties}],n}function OD(e,t){const n=Ch(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Ph(e,t){const n=Dh(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function AD(e,t,n){const i=Hn(e,n.value,NaN),s=Hn(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function PD(e,t,n){for(const i of Object.keys(Mh)){const s=e[hn(e,n,i)];if(s){const{min:o,max:a,start:r,end:l,startProp:c,endProp:d}=Mh[i],h=Dh(s,{min:n[o],max:n[a],start:s[r],end:s[l]});t[c]=h.start,t[d]=h.end}}}function ED({properties:e,options:t},n,i,s){const{x:o,x2:a,width:r}=e;return Eh({start:o,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:n.width})}function RD({properties:e,options:t},n,i,s){const{y:o,y2:a,height:r}=e;return Eh({start:o,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:n.height})}function Eh(e,t){const{start:n,end:i,borderWidth:s}=e,{position:o,padding:{start:a,end:r},adjust:l}=t,c=i-s-n-a-r-t.size;return n+s/2+l+ir(c,o)}function ID(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const s=sr(i.position),o=At(i.padding),a=to(e.ctx,i),r=ED({properties:t,options:n},a,s,o),l=RD({properties:t,options:n},a,s,o),c=a.width+o.width,d=a.height+o.height;return{x:r,y:l,x2:r+c,y2:l+d,width:c,height:d,centerX:r+c/2,centerY:l+d/2,rotation:i.rotation}}const rr=["enter","leave"],lr=rr.concat("click");function LD(e,t,n){t.listened=wh(n,lr,t.listeners),t.moveListened=!1,rr.forEach(i=>{Gt(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Gt(i.click)&&(t.listened=!0),t.moveListened||rr.forEach(s=>{Gt(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function ND(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return BD(e,t,n);case"click":return FD(e,t,n)}}function BD(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=nr(e.visibleElements,t,n.interaction):i=[];const s=e.hovered;e.hovered=i;const o={state:e,event:t};let a=Rh(o,"leave",s,i);return Rh(o,"enter",i,s)||a}function Rh({state:e,event:t},n,i,s){let o;for(const a of i)s.indexOf(a)<0&&(o=Ih(a.options[n]||e.listeners[n],a,t)||o);return o}function FD(e,t,n){const i=e.listeners,s=nr(e.visibleElements,t,n.interaction);let o;for(const a of s)o=Ih(a.options.click||i.click,a,t)||o;return o}function Ih(e,t,n){return mt(e,[t.$context,n])===!0}const eo=["afterDraw","beforeDraw"];function zD(e,t,n){const i=t.visibleElements;t.hooked=wh(n,eo,t.hooks),t.hooked||i.forEach(s=>{t.hooked||eo.forEach(o=>{Gt(s.options[o])&&(t.hooked=!0)})})}function Lh(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return mt(i,[t.$context])}}function UD(e,t,n){const i=WD(e.scales,t,n);let s=Nh(t,i,"min","suggestedMin");s=Nh(t,i,"max","suggestedMax")||s,s&&Gt(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function VD(e,t){for(const n of e)$D(n,t)}function Nh(e,t,n,i){if(xt(t[n])&&!HD(e.options,n,i)){const s=e[n]!==t[n];return e[n]=t[n],s}}function HD(e,t,n){return qt(e[t])||qt(e[n])}function $D(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=hn(t,e,n);i&&!t[i]&&YD(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function YD(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(qt(e[n+i]))return!0;return!1}function WD(e,t,n){const i=t.axis,s=t.id,o=i+"ScaleID",a={min:Q(t.min,Number.NEGATIVE_INFINITY),max:Q(t.max,Number.POSITIVE_INFINITY)};for(const r of n)r.scaleID===s?Bh(r,t,["value","endValue"],a):hn(e,r,o)===s&&Bh(r,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Bh(e,t,n,i){for(const s of n){const o=e[s];if(qt(o)){const a=t.parse(o);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class $n extends Vt{inRange(t,n,i,s){const{x:o,y:a}=cn({x:t,y:n},this.getCenterPoint(s),Ot(-this.options.rotation));return dh({x:o,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return dn(this,t)}draw(t){t.save(),Js(t,this.getCenterPoint(),this.options.rotation),Th(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return Ah(t,n)}}$n.id="boxAnnotation",$n.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},$n.defaultRoutes={borderColor:"color",backgroundColor:"color"},$n.descriptors={label:{_fallback:!0}};class no extends Vt{inRange(t,n,i,s){return hh({x:t,y:n},{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 dn(this,t)}draw(t){const n=this.options;!n.display||!n.content||(ZD(t,this),t.save(),Js(t,this.getCenterPoint(),this.rotation),Sh(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=jD(t,n);if(!i)return{};const{controllerMeta:s,point:o,radius:a}=GD(t,n,i);let r=to(t.ctx,n);const l=XD(r,a);yh(n,l)&&(r={width:r.width*l,height:r.height*l});const{position:c,xAdjust:d,yAdjust:h}=n,f=gh(o,r,{borderWidth:0,position:c,xAdjust:d,yAdjust:h});return{initProperties:Un(t,f,n),...f,...s,rotation:n.rotation,_fitRatio:l}}}no.id="doughnutLabelAnnotation",no.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},no.defaultRoutes={};function jD(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const s=i.controller;return s instanceof ki&&qD(e,t,i.data)&&(!n||s.innerRadius<n.controller.innerRadius)&&s.options.circumference>=90?i:n},void 0)}function qD(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function GD({chartArea:e},t,n){const{left:i,top:s,right:o,bottom:a}=e,{innerRadius:r,offsetX:l,offsetY:c}=n.controller,d=(i+o)/2+l,h=(s+a)/2+c,f={left:Math.max(d-r,i),right:Math.min(d+r,o),top:Math.max(h-r,s),bottom:Math.min(h+r,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,g=r-p,y=m.y>h,_=y?s+p:a-p,x=KD(_,d,h,g);return{controllerMeta:{_centerX:d,_centerY:h,_radius:g,_counterclockwise:y,...x},point:m,radius:Math.min(r,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function XD({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function KD(e,t,n,i){const s=Math.pow(n-e,2),o=Math.pow(i,2),a=t*-2,r=Math.pow(t,2)+s-o,l=Math.pow(a,2)-4*r;if(l<=0)return{_startAngle:0,_endAngle:yt};const c=(-a-Math.sqrt(l))/2,d=(-a+Math.sqrt(l))/2;return{_startAngle:bs({x:t,y:n},{x:c,y:e}).angle,_endAngle:bs({x:t,y:n},{x:d,y:e}).angle}}function ZD(e,t){const{_centerX:n,_centerY:i,_radius:s,_startAngle:o,_endAngle:a,_counterclockwise:r,options:l}=t;e.save();const c=ke(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,i,s,o,a,r),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class Vi extends Vt{inRange(t,n,i,s){return hh({x:t,y:n},{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 dn(this,t)}draw(t){const n=this.options,i=!qt(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),Js(t,this.getCenterPoint(),this.rotation),xD(t,this),Th(t,this,n),Sh(t,QD(this),n),t.restore())}resolveElementProperties(t,n){let i;if(_h(n))i=Ch(t,n);else{const{centerX:r,centerY:l}=ar(t,n);i={x:r,y:l}}const s=At(n.padding),o=to(t.ctx,n),a=gh(i,o,n,s);return{initProperties:Un(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}Vi.id="labelAnnotation",Vi.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},Vi.defaultRoutes={borderColor:"color"};function QD({x:e,y:t,width:n,height:i,options:s}){const o=s.borderWidth/2,a=At(s.padding);return{x:e+a.left+o,y:t+a.top+o,width:n-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const cr=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),ur=(e,t,n)=>cr(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Fh=(e,t,n)=>cr(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Hi=e=>e*e,JD=(e,t,{x:n,y:i,x2:s,y2:o},a)=>a==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(n,s),end:Math.max(n,s),value:e},zh=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,dr=(e,t,n,i)=>({x:zh(e.x,t.x,n.x,i),y:zh(e.y,t.y,n.y,i)}),Uh=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),Vh=(e,t,n,i)=>-Math.atan2(Uh(e.x,t.x,n.x,i),Uh(e.y,t.y,n.y,i))+.5*it;class $i extends Vt{inRange(t,n,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:r,ctx:l}=this;if(r){ke(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:d}=this.$context,h=t*d.currentDevicePixelRatio,f=n*d.currentDevicePixelRatio,m=l.isPointInStroke(r,h,f)||hr(this,a,s);return l.restore(),m}const c=Hi(o);return iC(this,a,c,s)||hr(this,a,s)}return tC(this,{mouseX:t,mouseY:n},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return dn(this,t)}draw(t){const{x:n,y:i,x2:s,y2:o,cp:a,options:r}=this;if(t.save(),!ke(t,r))return t.restore();Vn(t,r);const l=Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2));if(r.curve&&a)return dC(t,this,a,l),t.restore();const{startOpts:c,endOpts:d,startAdjust:h,endAdjust:f}=jh(this),m=Math.atan2(o-i,s-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=r.borderShadowColor,t.stroke(),fr(t,0,h,c),fr(t,l,-f,d),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=CD(t,n),{x:s,y:o,x2:a,y2:r}=i,l=eC(i,t.chartArea),c=l?nC({x:s,y:o},{x:a,y:r},t.chartArea):{x:s,y:o,x2:a,y2:r,width:Math.abs(a-s),height:Math.abs(r-o)};if(c.centerX=(a+s)/2,c.centerY=(r+o)/2,c.initProperties=Un(t,c,n),n.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=uC(c,n,Cn(h,f))}const d=sC(t,c,n.label);return d._visible=l,c.elements=[{type:"label",optionScope:"label",properties:d,initProperties:c.initProperties}],c}}$i.id="lineAnnotation";const Hh={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};$i.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Hh),fill:!1,length:12,start:Object.assign({},Hh),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({},Vi.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},$i.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},$i.defaultRoutes={borderColor:"color"};function tC(e,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:o}){const a=JD(t,n,e.getProps(["x","y","x2","y2"],o),i);return uh(a,s)||hr(e,{mouseX:t,mouseY:n},o,i)}function eC({x:e,y:t,x2:n,y2:i},{top:s,right:o,bottom:a,left:r}){return!(e<r&&n<r||e>o&&n>o||t<s&&i<s||t>a&&i>a)}function $h({x:e,y:t},n,{top:i,right:s,bottom:o,left:a}){return e<a&&(t=Fh(a,{x:e,y:t},n),e=a),e>s&&(t=Fh(s,{x:e,y:t},n),e=s),t<i&&(e=ur(i,{x:e,y:t},n),t=i),t>o&&(e=ur(o,{x:e,y:t},n),t=o),{x:e,y:t}}function nC(e,t,n){const{x:i,y:s}=$h(e,t,n),{x:o,y:a}=$h(t,e,n);return{x:i,y:s,x2:o,y2:a,width:Math.abs(o-i),height:Math.abs(a-s)}}function iC(e,{mouseX:t,mouseY:n},i=un,s){const{x:o,y:a,x2:r,y2:l}=e.getProps(["x","y","x2","y2"],s),c=r-o,d=l-a,h=Hi(c)+Hi(d),f=h===0?-1:((t-o)*c+(n-a)*d)/h;let m,p;return f<0?(m=o,p=a):f>1?(m=r,p=l):(m=o+f*c,p=a+f*d),Hi(t-m)+Hi(n-p)<=i}function hr(e,{mouseX:t,mouseY:n},i,s){const o=e.label;return o.options.display&&o.inRange(t,n,s,i)}function sC(e,t,n){const i=n.borderWidth,s=At(n.padding),o=to(e.ctx,n),a=o.width+s.width+i,r=o.height+s.height+i;return aC(t,n,{width:a,height:r,padding:s},e.chartArea)}function oC(e){const{x:t,y:n,x2:i,y2:s}=e,o=Math.atan2(s-n,i-t);return o>it/2?o-it:o<it/-2?o+it:o}function aC(e,t,n,i){const{width:s,height:o,padding:a}=n,{xAdjust:r,yAdjust:l}=t,c={x:e.x,y:e.y},d={x:e.x2,y:e.y2},h=t.rotation==="auto"?oC(e):Ot(t.rotation),f=rC(s,o,h),m=lC(e,t,{labelSize:f,padding:a},i),p=e.cp?dr(c,e.cp,d,m):cr(c,d,m),g={size:f.w,min:i.left,max:i.right,padding:a.left},y={size:f.h,min:i.top,max:i.bottom,padding:a.top},_=Wh(p.x,g)+r,x=Wh(p.y,y)+l;return{x:_-s/2,y:x-o/2,x2:_+s/2,y2:x+o/2,centerX:_,centerY:x,pointX:p.x,pointY:p.y,width:s,height:o,rotation:ys(h)}}function rC(e,t,n){const i=Math.cos(n),s=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*s),h:Math.abs(e*s)+Math.abs(t*i)}}function lC(e,t,n,i){let s;const o=cC(e,i);return t.position==="start"?s=Yh({w:e.x2-e.x,h:e.y2-e.y},n,t,o):t.position==="end"?s=1-Yh({w:e.x-e.x2,h:e.y-e.y2},n,t,o):s=ir(1,t.position),s}function Yh(e,t,n,i){const{labelSize:s,padding:o}=t,a=e.w*i.dx,r=e.h*i.dy,l=a>0&&(s.w/2+o.left-i.x)/a,c=r>0&&(s.h/2+o.top-i.y)/r;return Zs(Math.max(l,c),0,.25)}function cC(e,t){const{x:n,x2:i,y:s,y2:o}=e,a=Math.min(s,o)-t.top,r=Math.min(n,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(n,i);return{x:Math.min(r,c),y:Math.min(a,l),dx:r<=c?1:-1,dy:a<=l?1:-1}}function Wh(e,t){const{size:n,min:i,max:s,padding:o}=t,a=n/2;return n>s-i?(s+i)/2:(i>=e-o-a&&(e=i+o+a),s<=e+o+a&&(e=s-o-a),e)}function jh(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:qh(e,n),endAdjust:qh(e,i)}}function qh(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,s=e.options.borderWidth/2,o={x:n,y:i+s};return Math.abs(ur(0,o,{x:0,y:s}))}function fr(e,t,n,i){if(!i||!i.display)return;const{length:s,width:o,fill:a,backgroundColor:r,borderColor:l}=i,c=Math.abs(t-s)+n;e.beginPath(),Vn(e,i),ke(e,i),e.moveTo(c,-o),e.lineTo(t+n,0),e.lineTo(c,o),a===!0?(e.fillStyle=r||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function uC(e,t,n){const{x:i,y:s,x2:o,y2:a,centerX:r,centerY:l}=e,c=Math.atan2(a-s,o-i),d=sr(t.controlPoint,0),h={x:r+Ve(n,d.x,!1),y:l+Ve(n,d.y,!1)};return cn(h,{x:r,y:l},c)}function Gh(e,{x:t,y:n},{angle:i,adjust:s},o){!o||!o.display||(e.save(),e.translate(t,n),e.rotate(i),fr(e,0,-s,o),e.restore())}function dC(e,t,n,i){const{x:s,y:o,x2:a,y2:r,options:l}=t,{startOpts:c,endOpts:d,startAdjust:h,endAdjust:f}=jh(t),m={x:s,y:o},p={x:a,y:r},g=Vh(m,n,p,0),y=Vh(m,n,p,1)-it,_=dr(m,n,p,h/i),x=dr(m,n,p,1-f/i),T=new Path2D;e.beginPath(),T.moveTo(_.x,_.y),T.quadraticCurveTo(n.x,n.y,x.x,x.y),e.shadowColor=l.borderShadowColor,e.stroke(T),t.path=T,t.ctx=e,Gh(e,_,{angle:g,adjust:h},c),Gh(e,x,{angle:y,adjust:f},d)}class Yi extends Vt{inRange(t,n,i,s){const o=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return hC({x:t,y:n},this.getProps(["width","height","centerX","centerY"],s),o,a);const{x:r,y:l,x2:c,y2:d}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:d}:{start:r,end:c},f=cn({x:t,y:n},this.getCenterPoint(s),Ot(-o));return f[i]>=h.start-a-un&&f[i]<=h.end+a+un}getCenterPoint(t){return dn(this,t)}draw(t){const{width:n,height:i,centerX:s,centerY:o,options:a}=this;t.save(),Js(t,this.getCenterPoint(),a.rotation),Vn(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const r=ke(t,a);t.ellipse(s,o,i/2,n/2,it/2,0,2*it),t.fill(),r&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return Ah(t,n)}}Yi.id="ellipseAnnotation",Yi.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},$n.defaults.label),rotation:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,xMax:void 0,xMin:void 0,xScaleID:void 0,yMax:void 0,yMin:void 0,yScaleID:void 0,z:0},Yi.defaultRoutes={borderColor:"color",backgroundColor:"color"},Yi.descriptors={label:{_fallback:!0}};function hC(e,t,n,i){const{width:s,height:o,centerX:a,centerY:r}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const d=Ot(n||0),h=Math.cos(d),f=Math.sin(d),m=Math.pow(h*(e.x-a)+f*(e.y-r),2),p=Math.pow(f*(e.x-a)-h*(e.y-r),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class io extends Vt{inRange(t,n,i,s){const{x:o,y:a,x2:r,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),d=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?aD({x:t,y:n},this.getCenterPoint(s),c/2,d):uh(i==="y"?{start:a,end:l,value:n}:{start:o,end:r,value:t},d)}getCenterPoint(t){return dn(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Vn(t,n);const s=ke(t,n);mD(t,this,this.centerX,this.centerY),s&&!Qs(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=Oh(t,n);return i.initProperties=Un(t,i,n),i}}io.id="pointAnnotation",io.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},io.defaultRoutes={borderColor:"color",backgroundColor:"color"};class so extends Vt{inRange(t,n,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&mC(this.elements,t,n,s);const o=cn({x:t,y:n},this.getCenterPoint(s),Ot(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),r=Math.min(...a),l=Math.max(...a);return o[i]>=r&&o[i]<=l}getCenterPoint(t){return dn(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Vn(t,i);const s=ke(t,i);let o=!0;for(const a of n)o?(t.moveTo(a.x,a.y),o=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=Oh(t,n),{sides:s,rotation:o}=n,a=[],r=2*it/s;let l=o*qo;for(let c=0;c<s;c++,l+=r){const d=fC(i,n,l);d.initProperties=Un(t,i,n),a.push(d)}return i.elements=a,i}}so.id="polygonAnnotation",so.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},so.defaultRoutes={borderColor:"color",backgroundColor:"color"};function fC({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:s},o){const a=(i+s)/2,r=Math.sin(o),l=Math.cos(o),c={x:e+r*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+r*(n+a),bY:t-l*(n+a)}}}function mC(e,t,n,i){let s=!1,o=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const r=a.getProps(["bX","bY"],i);r.bY>n!=o.bY>n&&t<(o.bX-r.bX)*(n-r.bY)/(o.bY-r.bY)+r.bX&&(s=!s),o=r}return s}const He={box:$n,doughnutLabel:no,ellipse:Yi,label:Vi,line:$i,point:io,polygon:so};Object.keys(He).forEach(e=>{_t.describe(`elements.${He[e].id}`,{_fallback:"plugins.annotation.common"})});const pC={update:Object.assign},gC=lr.concat(eo),Xh=(e,t)=>st(t)?gr(e,t):e,mr=e=>e==="color"||e==="font";function pr(e="line"){return He[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function yC(e,t,n,i){const s=_C(e,n.animations,i),o=t.annotations,a=kC(t.elements,o);for(let r=0;r<o.length;r++){const l=o[r],c=Kh(a,r,l.type),d=l.setContext(wC(e,c,a,l)),h=c.resolveElementProperties(e,d);h.skip=bC(h),"elements"in h&&(xC(c,h.elements,d,s),delete h.elements),qt(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=Zh(d),s.update(c,h)}}function bC(e){return isNaN(e.x)||isNaN(e.y)}function _C(e,t,n){return n==="reset"||n==="none"||n==="resize"?pC:new ra(e,t)}function xC(e,t,n,i){const s=e.elements||(e.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const a=t[o],r=a.properties,l=Kh(s,o,a.type,a.initProperties),c=n[a.optionScope].override(a);r.options=Zh(c),i.update(l,r)}}function Kh(e,t,n,i){const s=He[pr(n)];let o=e[t];return(!o||!(o instanceof s))&&(o=e[t]=new s,Object.assign(o,i)),o}function Zh(e){const t=He[pr(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,gr(e,t.defaults),gr(e,t.defaultRoutes));for(const i of gC)n[i]=e[i];return n}function gr(e,t){const n={};for(const i of Object.keys(t)){const s=t[i],o=e[i];mr(i)&&dt(o)?n[i]=o.map(a=>Xh(a,s)):n[i]=Xh(o,s)}return n}function wC(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function kC(e,t){const n=t.length,i=e.length;if(i<n){const s=n-i;e.splice(i,0,...new Array(s))}else i>n&&e.splice(n,i-n);return e}var TC="3.1.0";const $e=new Map,Qh=e=>e.type!=="doughnutLabel",SC=lr.concat(eo);var Jh={id:"annotation",version:TC,beforeRegister(){rD("chart.js","4.0",Xt.version)},afterRegister(){Xt.register(He)},afterUnregister(){Xt.unregister(He)},beforeInit(e){$e.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=$e.get(e),s=i.annotations=[];let o=n.annotations;st(o)?Object.keys(o).forEach(a=>{const r=o[a];st(r)&&(r.id=a,s.push(r))}):dt(o)&&s.push(...o),VD(s.filter(Qh),e.scales)},afterDataLimits(e,t){const n=$e.get(e);UD(e,t.scale,n.annotations.filter(Qh).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=$e.get(e);LD(e,i,n),yC(e,i,n,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),zD(e,i,n)},beforeDatasetsDraw(e,t,n){Wi(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Wi(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Wi(e,t.index,n.clip)},beforeDraw(e,t,n){Wi(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Wi(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=$e.get(e);ND(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){$e.delete(e)},getAnnotations(e){const t=$e.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return nr(e,t,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:e=>!SC.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${He[pr(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:mr,_fallback:!0},_indexable:mr}},additionalOptionScopes:[""]};function Wi(e,t,n){const{ctx:i,chartArea:s}=e,o=$e.get(e);n&&bi(i,s);const a=vC(o.visibleElements,t).sort((r,l)=>r.element.options.z-l.element.options.z);for(const r of a)MC(i,s,o,r);n&&_i(i)}function vC(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&n.push({element:s});return n}function MC(e,t,n,i){const s=i.element;i.main?(Lh(n,s,"beforeDraw"),s.draw(e,t),Lh(n,s,"afterDraw")):s.draw(e,t)}const DC={class:"zoom-timerange-container"},CC={class:"zoom-timerange-details"},OC={class:"label","data-testid":"zoom-timerange-from"},AC={class:"label","data-testid":"zoom-timerange-to"},PC=u.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.ref(zn({tickValue:t.start,granularity:t.granularity})),s=u.ref(zn({tickValue:t.end,granularity:t.granularity})),o=(a,r)=>{Bd(()=>{i.value=zn({tickValue:a,granularity:t.granularity}),s.value=zn({tickValue:r,granularity:t.granularity})},100)()};return u.watch(()=>[t.start,t.end],([a,r])=>{o(a,r)},{immediate:!0}),(a,r)=>(u.openBlock(),u.createElementBlock("div",DC,[u.createElementVNode("div",CC,[u.createElementVNode("div",OC,u.toDisplayString(u.unref(n).t("zoom_time_range.from")),1),u.createElementVNode("div",null,u.toDisplayString(i.value),1),u.createElementVNode("div",AC,u.toDisplayString(u.unref(n).t("zoom_time_range.to")),1),u.createElementVNode("div",null,u.toDisplayString(s.value),1)])]))}}),Pt=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},tf=Pt(PC,[["__scopeId","data-v-4fa681cf"]]),EC={class:"zoom-actions-container"},RC={class:"zoom-actions-heading"},IC={class:"zoom-action-select"},LC=["data-testid"],NC=["aria-disabled","href"],BC=["onClick"],FC=Pt(u.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,s=o=>{o.action&&(o.action(n.newTimeRange),i("onAction"))};return(o,a)=>(u.openBlock(),u.createElementBlock("div",EC,[u.createElementVNode("div",RC,[u.createVNode(tf,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),u.createVNode(u.unref(Tt.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${u.unref(bl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`,onClick:a[0]||(a[0]=r=>o.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=u.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),u.createElementVNode("div",IC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.zoomActionItems,r=>(u.openBlock(),u.createElementBlock("div",{key:r.key,class:u.normalizeClass(["zoom-action-item",{disabled:r.disabled}]),"data-testid":`zoom-action-item-${r.key}`},[r.href?(u.openBlock(),u.createElementBlock("a",{key:0,"aria-disabled":r.disabled,class:"zoom-action-link",href:r.href,onClick:a[1]||(a[1]=l=>o.$emit("onAction"))},u.toDisplayString(r.label),9,NC)):(u.openBlock(),u.createElementBlock("div",{key:1,onClick:l=>s(r)},u.toDisplayString(r.label),9,BC))],10,LC))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),zC={key:2},UC={class:"tooltip-title"},VC={class:"title"},HC={key:0,class:"subtitle"},$C={class:"context"},YC={class:"metric"},WC={class:"tooltip"},jC={key:0,class:"square-marker marker-placeholder"},qC={class:"display-value"},ji=Pt(u.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(e,{emit:t}){const n=t,i=e,s=u.ref(null),{x:o,y:a,isDragging:r}=LM(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=u.computed(()=>`${a.value}px`),c=u.computed(()=>`${o.value}px`),d=u.computed(()=>i.state.tooltipContext),h=u.computed(()=>i.state.metricDisplay),f=u.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return u.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,p])=>{r.value||(o.value=parseFloat(m),a.value=parseFloat(p))}),u.watch(r,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),u.watch(s,m=>{if(m){const{width:p,height:g}=m.getBoundingClientRect();n("dimensions",{width:p,height:g})}}),(m,p)=>e.state.showTooltip?(u.openBlock(),u.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:u.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:u.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(u.openBlock(),u.createBlock(tf,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(u.openBlock(),u.createBlock(FC,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:p[0]||(p[0]=g=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(u.openBlock(),u.createElementBlock("div",zC,[u.createElementVNode("div",UC,[u.createElementVNode("div",VC,[u.createElementVNode("div",null,u.toDisplayString(e.tooltipTitle),1),f.value?(u.openBlock(),u.createBlock(u.unref(Tt.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${u.unref(bl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])):u.createCommentVNode("",!0)]),d.value||h.value?(u.openBlock(),u.createElementBlock("div",HC,[u.createElementVNode("div",$C,u.toDisplayString(d.value),1),u.createElementVNode("div",YC,u.toDisplayString(h.value),1)])):u.createCommentVNode("",!0)]),u.createElementVNode("ul",WC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.state.tooltipSeries,({backgroundColor:g,borderColor:y,label:_,value:x,isSegmentEmpty:T,isExtra:v},w)=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:_+w},[e.state.tooltipSeries.length?(u.openBlock(),u.createElementBlock("li",{key:0,class:u.normalizeClass({"extra-row":v})},[v?(u.openBlock(),u.createElementBlock("div",jC)):(u.openBlock(),u.createElementBlock("div",{key:1,class:"square-marker",style:u.normalizeStyle({background:String(g),borderColor:String(y)})},null,4)),u.createElementVNode("span",{class:u.normalizeClass(["display-label",{empty:T}])},u.toDisplayString(_),3),u.createElementVNode("span",qC,u.toDisplayString(x),1)],2)):u.createCommentVNode("",!0)],64))),128))])]))],6)):u.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),GC={key:0,class:"legend-container","data-testid":"legend"},XC=["onClick"],KC={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},ZC=["stroke","stroke-dasharray"],QC=["title"],JC={class:"label truncate-label"},tO={key:0,class:"sub-label"},eO={key:0},nO={class:"tooltip-content"},oo=Pt(u.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.inject("showLegendValues",!1),s=u.inject("legendPosition",u.ref(It.Bottom)),o=({datasetIndex:l,index:c,isKey:d},h)=>d?`key-${h}`:`dataset-${l??0}-${c??0}`,a=(l=0,c)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart,h=r(l,c);!d.getDatasetMeta(l).dataset&&c!==void 0?d.toggleDataVisibility(c):h?d.hide(l,c):d.show(l,c),d.update()},r=(l=0,c)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof Xt?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||c===void 0?d.isDatasetVisible(l):d.getDataVisibility(c)};return(l,c)=>{const d=u.resolveComponent("KTooltip");return u.unref(s)!==u.unref(It).Hidden?(u.openBlock(),u.createElementBlock("ul",GC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.items,({fillStyle:h,strokeStyle:f,text:m,datasetIndex:p,index:g,value:y,isSegmentEmpty:_,isKey:x,lineDash:T},v)=>(u.openBlock(),u.createElementBlock("li",{key:o({datasetIndex:p,index:g,isKey:x},v),class:u.normalizeClass({"legend-key":x}),onClick:w=>x?void 0:a(p,g)},[T?.length?(u.openBlock(),u.createElementBlock("svg",KC,[u.createElementVNode("line",{stroke:f,"stroke-dasharray":T.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,ZC)])):(u.openBlock(),u.createElementBlock("div",{key:1,class:"square-marker",style:u.normalizeStyle({background:h,"border-color":f})},null,4)),u.createVNode(d,null,u.createSlots({default:u.withCtx(()=>[u.createElementVNode("div",{class:u.normalizeClass(["label-container",{"strike-through":!x&&!r(p,g),"inline-value":x}]),title:y&&(u.unref(i)||x)?`${m}: ${y.formatted}`:m},[u.createElementVNode("div",JC,u.toDisplayString(m),1),y&&(u.unref(i)||x)?(u.openBlock(),u.createElementBlock("div",tO,[x?(u.openBlock(),u.createElementBlock("span",eO,"-")):u.createCommentVNode("",!0),u.createTextVNode(" "+u.toDisplayString(y.formatted),1)])):u.createCommentVNode("",!0)],10,QC)]),_:2},[_?{name:"content",fn:u.withCtx(()=>[u.createElementVNode("div",nO,u.toDisplayString(u.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,XC))),128))])):u.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Lt=[];for(let e=0;e<256;++e)Lt.push((e+256).toString(16).slice(1));function iO(e,t=0){return(Lt[e[t+0]]+Lt[e[t+1]]+Lt[e[t+2]]+Lt[e[t+3]]+"-"+Lt[e[t+4]]+Lt[e[t+5]]+"-"+Lt[e[t+6]]+Lt[e[t+7]]+"-"+Lt[e[t+8]]+Lt[e[t+9]]+"-"+Lt[e[t+10]]+Lt[e[t+11]]+Lt[e[t+12]]+Lt[e[t+13]]+Lt[e[t+14]]+Lt[e[t+15]]).toLowerCase()}const sO=new Uint8Array(16);function oO(){return crypto.getRandomValues(sO)}function yr(e,t,n){return crypto.randomUUID?crypto.randomUUID():aO(e)}function aO(e,t,n){e=e||{};const i=e.random??e.rng?.()??oO();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,iO(i)}const ef=(e,t)=>{const n=e.ctx,i=e.scales.y,s=e.scales.x,o=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(o.x-o.width/2,o.y,o.width,i.bottom-o.y):n.strokeRect(s.left,o.y-o.height/2,o.x-s.left,o.height),n.restore()};class nf{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&ef(t,this._clickedElements)}afterEvent(t,{event:n}){if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",s=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,ef(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 rO=(e,t,n,i,s="#0275d8")=>{e&&(e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore())};class ao{id="coordinator";coordinator=null;instanceId="";stopWatcher=void 0;activeDimension=null;activeDimensionValue=null;requiresUpdate=!1;triggerOnSelf=!1;watchTimestamp=!1;watchDimension=!1;lastMouseBrushEvent=0;constructor({coordinator:t,requiresUpdate:n=!1,triggerOnSelf:i=!1,watchTimestamp:s=!1,watchDimension:o=!1}){this.instanceId=crypto.randomUUID(),this.coordinator=t,this.requiresUpdate=n,this.triggerOnSelf=i,this.watchTimestamp=s,this.watchDimension=o}afterInit(t){if(!this.coordinator)return;const n=this.requiresUpdate?()=>t.update("none"):()=>t.draw(),i=this._watchTimestamp(n),s=this._watchDimension(n);this.stopWatcher=()=>{i&&i(),s&&s()}}afterEvent(t,{event:n}){this.coordinator&&(n.type==="mousemove"||n.type==="mouseout")&&requestAnimationFrame(i=>this._onMouseBrush(n.native,t,i))}beforeDatasetDraw(t,n){if(!this.coordinator||!this.watchDimension||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;t.config.type==="doughnut"?this._highlightDimensionDonut(t):this._highlightDimensionDefault(t,n)}afterDatasetsDraw(t){if(t.ctx.globalAlpha=1,!this.coordinator||!this.watchTimestamp||!this.coordinator.activeTimestamp.value||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;const i=t.scales.x.getPixelForValue(this.coordinator.activeTimestamp.value),s=t.ctx;rO(s,i,t.scales.y.top,t.scales.y.bottom)}beforeDestroy(){this.stopWatcher&&this.stopWatcher()}_watchTimestamp(t){if(!this.coordinator)return;let n;return this.watchTimestamp&&(n=u.watch([this.coordinator.activeChart,this.coordinator.activeTimestamp],([i])=>{(i!==this.instanceId||this.triggerOnSelf)&&t()})),n}_watchDimension(t){if(!this.coordinator)return;let n;if(this.watchDimension){let i;n=u.watch([this.coordinator.activeChart,this.coordinator.activeDimension,this.coordinator.activeDimensionValue],([s,o,a])=>{clearTimeout(i),o===null&&(this.activeDimension=null),a===null&&(this.activeDimensionValue=null),i=setTimeout(()=>{this.activeDimension=o,this.activeDimensionValue=a,(s!==this.instanceId||this.triggerOnSelf)&&t()},this.coordinator?.DIMENSION_DEBOUNCE_MS??400),u.onWatcherCleanup(()=>{clearTimeout(i)})})}return n}_onMouseBrush(t,n,i){if(!this.coordinator)return;const s=t.type,o=Math.min(this.coordinator.TIMESTAMP_DEBOUNCE_MS,this.coordinator.DIMENSION_DEBOUNCE_MS);if(!(s==="mousemove"&&i-this.lastMouseBrushEvent<o)){if(s==="mousemove"){if(!n.canvas)return;const a=this._getTimestamp(n,t),[r,l]=this._getDatasetDimension(n,t)??[];this.coordinator.activate({chartUuid:this.instanceId,timestamp:a,dimension:r,dimensionValue:l})}else s==="mouseout"&&this.coordinator.deactivate({chartUuid:this.instanceId});this.lastMouseBrushEvent=i}}_highlightDimensionDefault(t,n){if(this.activeDimension&&this.activeDimensionValue){const i=t.data.datasets.map((s,o)=>s?.dimension===this.activeDimension&&s?.dimensionValue===this.activeDimensionValue?o:-1).filter(s=>s>=0);i.length&&(t.ctx.globalAlpha=i.includes(n.index)?1:.3)}else t.ctx.globalAlpha=1}_highlightDimensionDonut(t){if(this.activeDimension&&this.activeDimensionValue){const{dimension:n,dimensionValue:i}=t.data.datasets[0];if(n===this.activeDimension){const s=i.findIndex(o=>o===this.activeDimensionValue);s>=0?t.setActiveElements([{datasetIndex:0,index:s}]):t.setActiveElements([])}else t.setActiveElements([])}else t.setActiveElements([])}_getDatasetDimension(t,n){const i=t.config.type,s=i!=="line",o=["doughnut","scatter"].includes(i)?"point":"dataset",a=t.getElementsAtEventForMode(n,o,{intersect:s},!1),[r]=a;if(!r)return;const{datasetIndex:l,index:c}=r,{dimension:d,dimensionValue:h}=t.data.datasets[l];return i==="doughnut"?[d,h[c]]:[d,h]}_getTimestamp(t,n){const[i]=t.getElementsAtEventForMode(n,"index",{intersect:!1},!1);if(i&&this.watchTimestamp){const{datasetIndex:s,index:o}=i,{x:a}=t.data.datasets[s].data[o];return a}}}const lO=["id"],cO=["id"],uO={class:"axis-tooltip-content"},dO="100%",hO="100%",fO=20,mO=20,sf=6,pO=0,gO=10,yO=10,bO=1,_O=Pt(u.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""}},setup(e){const t=e,{i18n:n}=q.useI18n(),{translateUnit:i}=q.useTranslatedUnits(),s=crypto.randomUUID(),o=crypto.randomUUID(),a=new nf,r=u.inject("analytics-dashboard-coordinator",null),l=new ao({coordinator:r,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),c=u.useTemplateRef("chartContainer"),d=u.useTemplateRef("chartParent"),h=({chart:F},nt)=>{const gt=F.data,ct=gt.labels?.indexOf(nt);return gt.datasets.reduce((at,Ct,B)=>{if(F.isDatasetVisible(B)){const U=Ct.data[ct];return isNaN(U)?at:at+U}else return at},0)},f=(F,nt,gt,ct)=>{const at=ct==="horizontal";nt===null&&(nt=n.t("entityNoName"));const Ct={type:"label",yValue:J=>at?nt:h(J,nt),xValue:J=>at?h(J,nt):nt},B={...Ct,position:at?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>at?0:-Math.abs(o1()),content:J=>Ud(h(J,nt),gt)},U={...Ct,content:J=>r1(h(J,nt),a1(J.chart,F)),position:at?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:J=>at?s1(Ud(h(J,nt),gt)):0,color:ZM};return{[`${nt}-value`]:B,[`${nt}-percent`]:U}},m=u.useTemplateRef("canvas"),p=u.useTemplateRef("axis"),g=yr(),y=yr(),_=u.ref([]),x=u.inject("legendPosition",It.Bottom),T=u.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),v=u.toRef(t,"metricUnit"),w=u.computed(()=>t.orientation==="horizontal"),M=u.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:u.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:u.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:w.value?"horizontal_bar":"vertical_bar",chartID:o,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:D,tooltipAbsoluteTop:P}=q.useTooltipAbsolutePosition(d,M),k=u.ref(0),S=()=>t.annotations&&t.chartData.labels?.reduce((F,nt)=>Object.assign(F,f(t.chartData,nt,v.value,t.orientation)),{}),A={id:g,afterUpdate(F){k.value+=1,_.value=La(F,t.legendValues,t.chartLegendSortFn)}},L={id:y,afterUpdate(F){F.options.plugins.annotation.annotations=t.annotations?S():{}}},H=[A,{id:"axisHover",afterEvent(F,nt){if(T.show=!1,nt.event.type==="mousemove"){const gt=nt.event,ct=F.options.indexAxis,at=F.scales,Ct=F.scales[ct].getLabelForValue(Number(F.scales[ct].getValueForPixel(gt[ct]))),U=F.scales[ct].getLabels().indexOf(Ct),J=t.chartData.isLabelEmpty?.[U];if((fe=>fe==="x"?gt.y>at.x.top:gt.x<at.y.right)(ct)){M.interactionMode!=="interactive"&&(M.showTooltip=!1);const fn=F.canvas.getContext("2d").measureText(Ct).width,Te=Math.abs(Math.round(gt.x-fn*.5)),mn=Math.round(gt.x+fn*.5),Wn=F.canvas.getBoundingClientRect(),lo=40;T.left=ct==="x"?`${(Te>0?Te:mn)-T.offset+Wn.left}px`:`${gt.x-fn*.5-T.offset+Wn.left}px`,T.top=`${gt.y-lo+Wn.top}px`,Ct.length>qs?(T.show=!0,T.text=Ct):J?(T.text=n.t("emptyEntityInfo"),T.show=!0):T.show=!1}else T.show=!1}}},a,l,...t.annotations?[L]:[]],W=u.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),$=u.ref(0),K=u.ref(0),lt=new ResizeObserver(Bd(F=>{$.value=F[0].contentRect.width,K.value=F[0].contentRect.height},100)),rt=u.computed(()=>{const F=t.chartData?.labels?.length;return m.value&&F&&!w.value?`${Math.max(F*(fO+sf),$.value)}px`:dO}),X=u.computed(()=>{const F=t.chartData?.labels?.length;return m.value&&F&&w.value?`${Math.max(F*(mO+sf),K.value)}px`:hO});q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey")),u.onMounted(()=>{t.annotations&&Xt.register(Jh),c.value&&($.value=c.value.offsetWidth,K.value=c.value.offsetHeight,lt.observe(c.value))}),u.onUnmounted(()=>{c.value&<.unobserve(c.value)});const z=u.computed(()=>{const F=q.useBarChartOptions({tooltipState:M,legendID:g,stacked:u.toRef(t,"stacked"),metricAxesTitle:u.toRef(t,"metricAxesTitle"),dimensionAxesTitle:u.toRef(t,"dimensionAxesTitle"),indexAxis:w.value?"y":"x",numLabels:W});return{...F.value,plugins:{...F.value.plugins,annotation:{annotations:S(),clip:!1}}}}),C=q.useChartJSCommon("bar",m,u.toRef(t,"chartData"),H,z);u.onBeforeUnmount(()=>{Xt.unregister(Jh)});const E={[It.Bottom]:"column"},N=u.computed(()=>{if(p.value&&C.value){const F=window.devicePixelRatio,nt=C.value,gt=nt.scales.y.width*F+bO,ct=(nt.scales.y.height+nt.scales.y.top+nt.scales.x.height)*F,at=p.value.getContext("2d");return at.scale(F,F),at.canvas.width=gt,at.canvas.height=ct,at.canvas.style.width=`${gt/F}px`,at.canvas.style.height=`${ct/F}px`,{scale:F,width:gt*F,height:ct*F,targetCtx:at}}return null}),V=F=>{const nt=F.target;if(N.value&&C.value&&!w.value){const gt=N.value.scale,ct=N.value.targetCtx,at=N.value.width,Ct=N.value.height,B=C.value,U=B.canvas;ct.fillStyle="white",nt.scrollLeft>=pO&&nt.scrollLeft<=gO?(ct.globalCompositeOperation="source-over",ct.clearRect(0,0,at,Ct),ct.drawImage(U,0,0,at,Ct,0,0,at,Ct),ct.globalCompositeOperation="destination-over",ct.fillRect(0,0,at,Ct)):(ct.globalCompositeOperation="source-over",ct.fillRect(0,(B.scales.y.height+B.scales.y.top+yO)*gt,at,B.scales.x.height*gt))}M.offsetY=nt.scrollTop,M.offsetX=nt.scrollLeft,T.offset=nt.scrollLeft},tt=({width:F,height:nt})=>{M.width=F,M.height=nt};u.watch(()=>t.orientation,()=>{if(p.value&&N.value){const F=N.value.width,nt=N.value.height;(p.value?.getContext("2d")).clearRect(0,0,F,nt)}M.showTooltip=!1,M.interactionMode="idle"}),u.watch(()=>t.annotations,F=>{C.value&&(F?C.value.options.plugins.annotation.annotations=S(t.chartData):delete C.value.options.plugins.annotation.annotations)});const Z=()=>{M.showTooltip&&(M.interactionMode!=="idle"?M.interactionMode="idle":M.interactionMode="interactive")};return(F,nt)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",E[u.unref(x)]])},[u.createElementVNode("canvas",{id:u.unref(s),ref:"axis",class:"axis"},null,8,lO),u.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:nt[0]||(nt[0]=gt=>Z()),onScroll:V},[u.createElementVNode("div",{class:"chart-body",style:u.normalizeStyle({width:rt.value,height:X.value})},[u.createElementVNode("canvas",{id:u.unref(o),ref:"canvas",class:"chart-canvas"},null,8,cO)],4)],544),(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[T.show?(u.openBlock(),u.createElementBlock("div",{key:0,class:"axis-tooltip",style:u.normalizeStyle({top:T.top,left:T.left}),width:"auto"},[u.createElementVNode("div",uO,u.toDisplayString(T.text),1)],4)):u.createCommentVNode("",!0),u.createVNode(ji,{"absolute-left":u.unref(D),"absolute-top":u.unref(P),"chart-parent-ref":d.value,state:M,"tooltip-title":e.tooltipTitle,onDimensions:tt},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),u.createVNode(oo,{id:u.unref(g),"chart-instance":u.unref(C),items:_.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-6994dd8d"]]);const xO={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"};su._date.override({_id:"date-fns",formats:function(){return xO},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=et(e):n==="string"&&(typeof t=="string"?e=Hb(e,t,new Date,this.options):e=jl(e,this.options)),Eo(e)?e.getTime():null},format:function(e,t){return rs(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Ao(e,t);case"second":return By(e,t);case"minute":return Ly(e,t);case"hour":return Ey(e,t);case"day":return os(e,t);case"week":return Fy(e,t);case"month":return Oo(e,t);case"quarter":return Ny(e,t);case"year":return zy(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Ro(e,t);case"second":return qy(e,t);case"minute":return Yy(e,t);case"hour":return $y(e,t);case"day":return Sl(e,t);case"week":return Gy(e,t);case"month":return Cl(e,t);case"quarter":return jy(e,t);case"year":return Xy(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return jb(e);case"minute":return Wb(e);case"hour":return Yb(e);case"day":return Po(e);case"week":return ae(e);case"isoWeek":return ae(e,{weekStartsOn:+n});case"month":return Zy(e);case"quarter":return Ky(e);case"year":return Ol(e);default:return e}},endOf:function(e,t){switch(t){case"second":return i0(e);case"minute":return e0(e);case"hour":return Jy(e);case"day":return Ml(e);case"week":return t0(e);case"month":return Dl(e);case"quarter":return n0(e);case"year":return Qy(e);default:return e}}});const of={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},wO={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...of,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},kO=u.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Yn(e){return u.isProxy(e)?u.toRaw(e):e}function TO(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return u.isProxy(t)?new Proxy(e,{}):e}function SO(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function af(e,t){e.labels=t}function rf(e,t,n){const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(a=>a[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function vO(e,t){const n={labels:[],datasets:[]};return af(n,e.labels),rf(n,e.datasets,t),n}const MO=u.defineComponent({props:wO,setup(e,t){let{expose:n,slots:i}=t;const s=u.ref(null),o=u.shallowRef(null);n({chart:o});const a=()=>{if(!s.value)return;const{type:c,data:d,options:h,plugins:f,datasetIdKey:m}=e,p=vO(d,m),g=TO(p,d);o.value=new Xt(s.value,{type:c,data:g,options:{...h},plugins:f})},r=()=>{const c=u.toRaw(o.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},e.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(e.updateMode)};return u.onMounted(a),u.onUnmounted(r),u.watch([()=>e.options,()=>e.data],(c,d)=>{let[h,f]=c,[m,p]=d;const g=u.toRaw(o.value);if(!g)return;let y=!1;if(h){const _=Yn(h),x=Yn(m);_&&_!==x&&(SO(g,_),y=!0)}if(f){const _=Yn(f.labels),x=Yn(p.labels),T=Yn(f.datasets),v=Yn(p.datasets);_!==x&&(af(g.config.data,_),y=!0),T&&T!==v&&(rf(g.config.data,T,e.datasetIdKey),y=!0)}y&&u.nextTick(()=>{l(g)})},{deep:!0}),()=>u.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:s},[u.h("p",{},[i.default?i.default():""])])}});function ro(e,t){return Xt.register(t),u.defineComponent({props:of,setup(n,i){let{expose:s}=i;const o=u.shallowRef(null),a=u.shallowRef(null);u.watch(()=>a.value?.chart??null,l=>{o.value=l},{flush:"sync"}),s({chart:o});const r=l=>{a.value=l};return()=>u.h(MO,kO({ref:r},{type:e,...n}))}})}const lf=ro("bar",tu),cf=ro("doughnut",ki),uf=ro("line",eu),DO=ro("scatter",iu),CO={class:"chart-container"},OO={key:0,class:"chart-center-metric"},AO={class:"chart-center-total"},PO={key:0,class:"chart-center-unit"},EO=u.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:It.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0}},setup(e){const t=e,{translateUnit:n}=q.useTranslatedUnits(),{i18n:i}=q.useI18n(),s=crypto.randomUUID(),o=crypto.randomUUID(),a=u.ref([]),r=u.useTemplateRef("chartParent"),l=u.inject(Oa,null),c=new ao({coordinator:l,requiresUpdate:!0,triggerOnSelf:!1,watchTimestamp:!1,watchDimension:!0}),d=u.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:u.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:u.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:o,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:h,tooltipAbsoluteTop:f}=q.useTooltipAbsolutePosition(r,d),m={id:s,afterUpdate(k){a.value=k.options.plugins.legend.labels.generateLabels(k).map(S=>({...S,value:t.legendValues&&t.legendValues[S.text],hidden:!1}))}},p=u.computed(()=>[c,m]),g=u.computed(()=>[t.chartData.datasets.reduce((S,A)=>(S.dimension=A.dimension,S.dimensionValue.push(A.dimensionValue),S.labels.push(A.label),S.backgroundColor.push(A.backgroundColor),S.hoverBorderColor.push(xs(A.backgroundColor).saturate(.5).darken(.15).hexString()),S.data.push(A.data.reduce((L,R)=>L+R,0)),S),{dimension:"",dimensionValue:[],labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:y}=oe({i18n:i}),_=u.computed(()=>W1(t.metricName??"")),x=u.computed(()=>{const k=g.value[0]?.data.reduce((S,A)=>S+A,0)??0;return y(k,t.metricUnit,{approximate:!0,translateUnit:(S,A)=>n(S,A)}).trim()}),T=u.computed(()=>t.tooltipMetricDisplay||""),v=u.computed(()=>({...t.chartData,datasets:g.value}));q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const{options:w}=q.useDonutChartOptions({tooltipState:d,legendID:s}),M=u.ref(),D=k=>({[It.Bottom]:"column",[It.Hidden]:"hidden"})[k],P=({width:k,height:S})=>{d.width=k,d.height=S};return(k,S)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",D(e.legendPosition)]),"data-testid":"donut-chart-parent"},[u.createElementVNode("div",CO,[u.createVNode(u.unref(cf),{ref_key:"chartInstance",ref:M,"chart-id":u.unref(o),data:v.value,options:u.unref(w),plugins:p.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&_.value?(u.openBlock(),u.createElementBlock("div",OO,[u.createElementVNode("span",AO,u.toDisplayString(x.value),1),T.value?(u.openBlock(),u.createElementBlock("span",PO,u.toDisplayString(T.value),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0),(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[u.createVNode(ji,{"absolute-left":u.unref(h),"absolute-top":u.unref(f),state:d,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:P},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),u.createVNode(oo,{id:u.unref(s),"chart-instance":M.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),RO=Pt(EO,[["__scopeId","data-v-db23aff8"]]);class IO{id="outlierBandPlugin";beforeDatasetsDraw(t,n,i){const s=i?.value;if(s===void 0||!Number.isFinite(s)||!i?.color)return;const o=t.scales.y;if(!o||!t.chartArea)return;const{top:a,bottom:r,left:l,right:c}=t.chartArea,d=Math.min(Math.max(o.getPixelForValue(s),a),r);if(d<=a)return;const h=t.ctx;h.save(),h.fillStyle=i.color,h.fillRect(l,a,c-l,d-a),h.restore()}}const LO=1.5;class NO{id="referenceLinePlugin";afterDatasetsDraw(t,n,i){const s=i?.lines;if(!s?.length)return;const o=t.scales.y;if(!o||!t.chartArea)return;const{top:a,bottom:r,left:l,right:c}=t.chartArea,d=t.ctx;d.save(),d.lineWidth=LO;for(const{value:h,color:f,borderDash:m}of s){if(!Number.isFinite(h))continue;const p=o.getPixelForValue(h);p<a||p>r||(d.beginPath(),d.setLineDash(m),d.strokeStyle=f,d.moveTo(l,p),d.lineTo(c,p),d.stroke())}d.restore()}}const BO={class:"chart-container"},FO=Pt(u.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},xMetric:{default:void 0},xMetricUnit:{default:void 0},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>tr()}},setup(e){const t=e,n=u.inject("legendPosition",It.Bottom),{i18n:i}=q.useI18n(),{formatUnit:s}=oe({i18n:i}),{translateUnit:o}=q.useTranslatedUnits(),a=u.useTemplateRef("chartParent"),r=new IO,l=new NO,c=crypto.randomUUID(),d=crypto.randomUUID(),h=u.inject(Oa,null),f=new ao({coordinator:h,requiresUpdate:!0,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),m=u.ref(),p=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:u.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:o,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:d,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:g,tooltipAbsoluteTop:y}=q.useTooltipAbsolutePosition(a,p);q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const _=u.computed(()=>t.chartData?.outlier),x=u.computed(()=>t.chartData?.referenceLines??[]),T=u.ref([]),v={id:c,afterUpdate(L){T.value=La(L,void 0,t.chartLegendSortFn)}},w=u.computed(()=>{const L=[];_.value&&L.push({text:_.value.label,fillStyle:_.value.color,strokeStyle:_.value.color,isKey:!0});for(const R of x.value)L.push({text:R.label,fillStyle:R.color,strokeStyle:R.color,lineDash:R.borderDash,isKey:!0,value:{raw:R.value,formatted:s(R.value,t.metricUnit,{translateUnit:o})}});return L}),M=u.computed(()=>[...T.value,...w.value]),D=u.computed(()=>t.shadeOutlierRegion?_.value?.value:void 0),P=u.computed(()=>[f,v,...D.value!==void 0?[r]:[],...x.value.length?[l]:[]]),k=u.computed(()=>`scatter-${P.value.map(L=>L.id).join("-")}`),{options:S}=q.useScatterChartOptions({tooltipState:p,legendID:c,granularity:u.toRef(t,"granularity"),timeRangeMs:u.toRef(t,"timeRangeMs"),metricAxesTitle:u.toRef(t,"metricAxesTitle"),dimensionAxesTitle:u.toRef(t,"dimensionAxesTitle"),metricUnit:u.toRef(t,"metricUnit"),xMetric:u.toRef(t,"xMetric"),xMetricUnit:u.toRef(t,"xMetricUnit"),outlierValue:D,referenceLines:x,themeColors:u.toRef(t,"themeColors")}),A=L=>({[It.Bottom]:"column",[It.Hidden]:"hidden"})[L];return(L,R)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",A(u.unref(n))]),"data-testid":"scatter-chart-parent"},[u.createElementVNode("div",BO,[(u.openBlock(),u.createBlock(u.unref(DO),{key:k.value,ref_key:"chartInstance",ref:m,"chart-id":u.unref(d),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:u.unref(S),plugins:P.value},null,8,["chart-id","data","options","plugins"]))]),u.createVNode(ji,{"absolute-left":u.unref(g),"absolute-top":u.unref(y),"data-testid":"tooltip",granularity:e.granularity,state:p,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),u.createVNode(oo,{id:u.unref(c),"chart-instance":m.value,"data-testid":"legend",items:M.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-a001076d"]]),br=(e,t,n,i,s="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore()},jt={},zO=()=>{jt.x=void 0,jt.chart=void 0,jt.strategy=void 0,jt.group=void 0},UO=10;class df{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let s=!1;n==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<UO)return;const s=()=>{jt.chart=n,jt.strategy=this._brushStrategy,jt.group=this._brushGroup;for(const o of Object.values(Xt.instances))o!==n&&o.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(jt.x=n.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(jt.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;br(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:s}=t.tooltip.dataPoints[0].element;br(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(jt.x===void 0)return;const n=jt.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&jt.group===this._brushGroup&&br(t.ctx,jt.x,t.scales.y.top,t.scales.y.bottom,n)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&jt.chart===t){const n=jt.x!==void 0;if(zO(),n)for(const i of Object.values(Xt.instances))i!==t&&i.update("none")}}}const VO=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},HO=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},hf=(e,t)=>{const n=e.scales.x.getValueForPixel(t.startX),i=e.scales.x.getValueForPixel(t.endX);if(!(n===void 0||i===void 0))return{xStart:Math.min(n,i),xEnd:Math.max(n,i)}},ff=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class $O{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const s=r=>{this._dragTimeout=window.setTimeout(()=>{const l=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=r.clientX-l.left,this._endX=this._startX},150)},o=r=>{const l=n.getBoundingClientRect();if(i&&this._isDragging){this._endX=r.clientX-l.left;const c=hf(t,this);c&&ff("dragSelectMove",t,c)}},a=r=>{const l=n.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=r.clientX-l.left,i=!1,this._isDragging=!1;const c=hf(t,this);c?ff("dragSelect",t,c):this.clearSelectionArea()}};n.addEventListener("mousedown",s),n.addEventListener("mousemove",o),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:o,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:o}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",s),n.removeEventListener("mouseup",o)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(HO(t,this._startX,this._endX),VO(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const YO=20,WO="rgba(255, 171, 171, 0.4)",jO="rgba(255, 196, 0, 0.2)",mf=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const s=(n-e.y)/i;return e.x+s*(t.x-e.x)},pf=e=>"yAxisID"in e&&e.yAxisID||Gs,gf=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?pf(n):Gs},qO=(e,t,n=Gs)=>{const i=[];return e.data.datasets.forEach(s=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(s)).visible||pf(s)!==n)return;const a=s.data;a?.length&&t.filter(r=>r.highlightIntersections).forEach(r=>{const l=a.map(d=>({ts:d.x,aboveThreshold:d.y>=r.value}));let c=l[0].aboveThreshold?a[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?c=mf(a[d-1],a[d],r.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&c!==void 0&&(i.push({start:c,end:mf(a[d-1],a[d],r.value),type:r.type}),c=void 0);c!==void 0&&i.push({start:c,end:l[l.length-1].ts,type:r.type})})}),i},GO=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:s})=>s===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class XO{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(s=>({...s,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const s=t.canvas;this._syncThresholds(i);const o=a=>{if(t){const r=a.clientY,l=s.getBoundingClientRect();for(const c of Object.keys(this._thresholds||{})){const h=(t.scales[gf(t,c)]??t.scales.y).getValueForPixel(r-l.top);if(h){const f=this._thresholds?.[c];f&&f.forEach(m=>{m.hovered=Math.abs(m.value-h)<YO})}}}};s.addEventListener("mousemove",o),this._mouseMoveHandler=o}afterDatasetsDraw(t,n){const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const o=this._thresholds?.[s];if(o){const a=gf(t,s),r=t.scales[a]??t.scales.y;o.forEach(d=>{const h=r.getPixelForValue(d.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=za(d.type),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";d.label?f=`${d.label}: ${d.value}`:d.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:d.value}):d.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:d.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:d.value}),d.hovered&&(i.save(),i.fillStyle=za(d.type),i.font=ug,i.fillText(f,t.chartArea.left,h-4),i.restore())});const l=qO(t,o,a);GO(l).forEach(d=>{const h=t.scales.x.getPixelForValue(d.start),f=t.scales.x.getPixelForValue(d.end);i.save(),i.fillStyle=d.type==="error"?WO:jO,i.fillRect(h,t.chartArea.top,f-h,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(h,t.chartArea.bottom),i.lineTo(f,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=za(d.type),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const KO=Pt(u.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0},leftYAxisGrid:{type:Boolean,default:void 0},rightYAxis:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:s}=q.useI18n(),o=new df,a=new nf,r=new $O,l=new XO(s),{translateUnit:c}=q.useTranslatedUnits(),d=u.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=u.ref([]),p=u.inject("legendPosition",It.Bottom),g=u.useTemplateRef("chartParent"),y=u.ref(void 0),_=u.ref(!1),x=u.inject(Oa,null),T=new ao({coordinator:x,triggerOnSelf:!0,watchTimestamp:!0,watchDimension:!0}),v=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:u.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(n,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:w,tooltipAbsoluteTop:M}=q.useTooltipAbsolutePosition(g,v),D={id:h,afterUpdate(E){m.value=La(E,n.legendValues,n.chartLegendSortFn)}},P=u.computed(()=>[T,D,a,...n.brush?[r]:[],...n.type==="timeseries_line"?[o]:[],...n.threshold?[l]:[]]),k=u.computed(()=>`line-${P.value.map(E=>E.id).join("-")}`),S=u.computed(()=>`bar-${P.value.map(E=>E.id).join("-")}`),A=u.computed(()=>n.chartData&&GM(n.chartData)),{options:L}=q.useLineChartOptions({tooltipState:v,timeRangeMs:u.toRef(n,"timeRangeMs"),granularity:u.toRef(n,"granularity"),legendID:h,stacked:u.toRef(n,"stacked"),metricAxesTitle:u.toRef(n,"metricAxesTitle"),dimensionAxesTitle:u.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:A,threshold:u.toRef(n,"threshold"),leftYAxisGrid:u.toRef(n,"leftYAxisGrid"),rightYAxis:u.toRef(n,"rightYAxis")});q.useReportChartDataForSynthetics(u.toRef(n,"chartData"),u.toRef(n,"syntheticsDataKey"));const R=E=>E?E.end.getTime()>E.start.getTime():!1,H=E=>({[It.Bottom]:"column",[It.Hidden]:"hidden"})[E],W=({width:E,height:N})=>{v.width=E,v.height=N},$=(E=!0)=>{v.interactionMode="idle",v.showTooltip=!1,r.clearSelectionArea(),a.isPaused&&a.resume(E),o.isPaused&&o.resume()},K=()=>{v.interactionMode="interactive"},lt=()=>{!d.value||!d.value.chart.tooltip?.dataPoints?.length||(v.interactionMode==="interactive"?o.clickedSegment=d.value.chart.tooltip.dataPoints[0]:o.destroyClickedSegment())},rt=()=>{if(_.value){_.value=!1;return}v.interactionMode!=="idle"?$():K(),lt()};u.watch(()=>n.type,()=>{v.interactionMode="idle",v.showTooltip=!1,o.destroyClickedSegment()});const X=E=>{E.preventDefault(),E.stopPropagation();const{xStart:N,xEnd:V}=E.detail,tt={start:new Date(N),end:new Date(V),type:"absolute"};if(!R(tt)){y.value=void 0,$(!1);return}y.value=tt,v.interactionMode="zoom-interactive",tt&&i("select-chart-range",tt)},z=E=>{v.interactionMode="selecting-chart-area",_.value=!0,o.pause(),a.pause();const{xStart:N,xEnd:V}=E.detail;y.value={start:new Date(N),end:new Date(V),type:"absolute"}},C=E=>{if(!g.value||v.interactionMode==="idle")return;const N=E.target;N&&g.value.contains(N)||_.value||$(!1)};return u.watch(()=>d.value?.chart,()=>{d.value?.chart&&(d.value.chart.canvas.removeEventListener("dragSelect",X),d.value.chart.canvas.removeEventListener("dragSelectMove",z),d.value.chart.canvas.addEventListener("dragSelect",X),d.value.chart.canvas.addEventListener("dragSelectMove",z))}),u.onMounted(()=>{document.addEventListener("click",C,!0)}),u.onUnmounted(()=>{d.value?.chart&&(d.value.chart.canvas.removeEventListener("dragSelect",X),d.value.chart.canvas.removeEventListener("dragSelectMove",z)),document.removeEventListener("click",C,!0)}),(E,N)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",H(u.unref(p))]),"data-testid":"line-chart-parent"},[u.createElementVNode("div",{class:"chart-container",onClick:N[0]||(N[0]=V=>rt())},[e.type==="timeseries_line"?(u.openBlock(),u.createBlock(u.unref(uf),{key:k.value,ref_key:"chartInstance",ref:d,"chart-id":u.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:u.unref(L),plugins:P.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(u.openBlock(),u.createBlock(u.unref(lf),{key:S.value,ref_key:"chartInstance",ref:d,"chart-id":u.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:u.unref(L),plugins:P.value},null,8,["chart-id","data","options","plugins"])):u.createCommentVNode("",!0)]),u.createVNode(ji,{"absolute-left":u.unref(w),"absolute-top":u.unref(M),"data-testid":"tooltip",granularity:e.granularity,state:v,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":y.value,onDimensions:W,onOnAction:N[1]||(N[1]=()=>$(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),u.createVNode(oo,{id:u.unref(h),"chart-instance":d.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-344d87c4"]]),ZO={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},QO={class:"tooltip-content"},JO={key:2,class:"analytics-chart-parent"},tA=u.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:It.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(e,{emit:t}){const n=t,i=e,{i18n:s}=q.useI18n(),o=u.computed(()=>er(i.chartData)?void 0:i.chartData),a=u.computed(()=>{const B=i.chartOptions.metricAxisMap,U=o.value?.meta?.metric_names??[];if(!(i.chartOptions.type!=="timeseries_line"||!B||!U.some(J=>B[J]==="right")))return B}),r=u.computed(()=>!!a.value),l=(B,U)=>a.value?B.filter(J=>(a.value?.[J]??"left")===U):B,c=u.computed(()=>{const B=o.value?.meta,U=B?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(i.chartOptions.type)&&!r.value&&U.length>1&&Object.keys(B?.display??{}).length>0?U:[]}),d=u.computed(()=>c.value.length>1),h=u.computed(()=>i.activeMetric&&c.value.includes(i.activeMetric)?i.activeMetric:c.value[0]),f=u.computed(()=>{const B=o.value;return!B||!d.value||!h.value?B:{...B,meta:{...B.meta,metric_names:[h.value]}}}),m=u.computed(()=>{const B=i.chartOptions.threshold;return!d.value||!B?B:{...B,...Object.fromEntries(Object.keys(B).filter(U=>U!==h.value).map(U=>[U,[]]))}}),p=u.computed(()=>{if($.value)return er(i.chartData)?i.chartData:oh(i.chartData)}),g=u.inject("app:konnectColorMode",u.computed(()=>"light")),y=u.useTemplateRef("chartShell"),_=u.computed(()=>(g.value,tr(y.value))),x=u.computed(()=>{if(p.value){const{start:U,end:J,metric:$t,metricUnit:fe,truncated:fn,limit:Te,datasource:mn}=p.value;return{start:U,end:J,metricNames:[$t],metricUnits:{[$t]:fe??""},truncated:fn,limit:Te,datasource:mn}}const B=f.value?.meta;return{start:B?.start,end:B?.end,metricNames:B?.metric_names,metricUnits:B?.metric_units,truncated:B?.truncated,limit:B?.limit,datasource:B?.datasource}}),T=u.computed(()=>$.value?q.useScatterDatasets({colorPalette:i.chartOptions.chartDatasetColors,scatter:i.chartOptions.scatter,themeColors:_},p).value:o.value?H.value?q.useExploreResultToTimeDataset({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Va,metricAxisMap:a.value},f).value:q.useExploreResultToDatasets({fill:i.chartOptions.stacked,colorPalette:i.chartOptions.chartDatasetColors||Va},o).value:{datasets:[]}),v=u.computed(()=>i.timeseriesZoom||!!i.exploreLink||!!i.requestsLink),w=u.computed(()=>{if(!i.chartData||o.value&&!o.value.meta)return 0;const{start:B,end:U}=x.value;if(B&&U)return new Date(U).getTime()-new Date(B).getTime()}),M=u.computed(()=>x.value.metricUnits?d.value&&h.value?x.value.metricUnits[h.value]??"":Object.values(x.value.metricUnits)[0]??"":""),D=u.computed(()=>x.value.metricUnits?d.value&&h.value?h.value:Object.keys(x.value.metricUnits)[0]??"":""),P=u.computed(()=>i.showLegendValues&&i.legendPosition!==It.Hidden),{legendValues:k}=q.useChartLegendValues(T,i.chartOptions.type,M),S=u.computed(()=>x.value.limit?.toString()||null),A=u.computed(()=>i.chartOptions.hideTruncationWarning?!1:x.value.truncated||!1),L=u.computed(()=>s.t("limitedResultsShown",{maxReturned:S.value})),R=u.computed(()=>["vertical_bar","horizontal_bar"].includes(i.chartOptions.type)),H=u.computed(()=>["timeseries_bar","timeseries_line"].some(B=>B===i.chartOptions.type)),W=u.computed(()=>i.chartOptions.type==="donut"),$=u.computed(()=>i.chartOptions.type==="scatter"),K=u.computed(()=>i.chartOptions.type.includes("vertical")?"vertical":"horizontal"),lt=u.computed(()=>{const{metricNames:B,metricUnits:U}=x.value;if(r.value||!B||!U)return;const J=B[0],$t=U[J]||"";if(B.length>1){if(J.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})});if(J.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})})}if(J)return zi($t)&&s.te(`metricAxisTitles.${J}`)?s.t(`metricAxisTitles.${J}`)||void 0:s.te(`chartLabels.${J}`)?s.t(`chartLabels.${J}`):J}),rt=u.computed(()=>{const B=i.chartOptions.yAxes?.left?.title??i.chartOptions?.metricAxesTitle;if(B)return B;const{metricNames:U,metricUnits:J}=x.value;if(!(!U||!J))return z(l(U,"left"),J)}),X=u.computed(()=>{if(!r.value)return;const{metricNames:B,metricUnits:U}=x.value,J=B&&U?z(l(B,"right"),U):void 0;return{title:i.chartOptions.yAxes?.right?.title??J,showGrid:i.chartOptions.yAxes?.right?.showGrid}}),z=(B,U)=>{const J=B[0];if(!J)return;const $t=U[J]||"";if(B.length>1){if(J.includes("latency"))return s.t("metricAxisTitles.latency_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})});if(J.includes("size"))return s.t("metricAxisTitles.size_in",{unit:s.t(`chartUnits.${$t}`,{plural:"s"})})}return C(J,$t)},C=(B,U)=>{if(s.te(`metricAxisTitles.${B}`)){if(zi(U))return s.t(`metricAxisTitles.${B}`)||void 0;const J=s.te(`chartUnits.${U}`)?s.t(`chartUnits.${U}`,{plural:"s"}):U;return s.t(`metricAxisTitles.${B}`,{unit:J})||void 0}return B||void 0},E=u.computed(()=>{if(i.chartOptions?.dimensionAxesTitle)return i.chartOptions.dimensionAxesTitle;const B=o.value?.meta,U=H.value?"Time":Object.keys(B?.display||B?.metric_names||{})[0];if(U)return s.te(`chartLabels.${U}`)?s.t(`chartLabels.${U}`):U}),N=u.computed(()=>{if(Gf(x.value.datasource))return s.t("timestampAxisTitles.platform");const B=Ji(o.value?.meta?.granularity_ms);if(B)return s.te(`granularityAxisTitles.${B}`)?s.t(`granularityAxisTitles.${B}`):B}),V=u.computed(()=>{const B=p.value?.xMetric;return B?C(B,p.value?.xMetricUnit??""):N.value}),tt=u.computed(()=>i.emptyStateTitle||s.t("noDataAvailableTitle")),Z=u.computed(()=>i.emptyStateDescription||s.t("noDataAvailableDescription")),F=u.computed(()=>$.value?!!p.value?.points.length:H.value?XM(T.value):!!(o.value&&o.value.meta&&o.value.data.length)),nt=u.computed(()=>{const B=o.value;return B?B.meta.granularity_ms?Ji(B.meta.granularity_ms)||"hourly":Ji(new Date(B.data[1].timestamp).getTime()-new Date(B.data[0].timestamp).getTime())||"hourly":"hourly"}),gt=u.computed(()=>Ji(o.value?.meta?.granularity_ms)||"secondly"),ct=u.computed(()=>i.chartOptions.chartLegendSortFn?i.chartOptions.chartLegendSortFn:(B,U)=>B.text===s.t("chartLabels.____OTHER____")?1:U.text===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(B.text,10))&&!isNaN(parseInt(U.text,10))?B.text<U.text?-1:1:B.value&&U.value?U.value.raw-B.value.raw:0),at=u.computed(()=>i.chartOptions.chartTooltipSortFn?i.chartOptions.chartTooltipSortFn:(B,U)=>B.label===s.t("chartLabels.____OTHER____")?1:U.label===s.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(B.label,10))&&!isNaN(parseInt(U.label,10))?B.label<U.label?-1:1:B.value&&U.value?U.rawValue-B.rawValue:0),Ct=u.computed(()=>[...i.timeseriesZoom?[{label:s.t("zoom_action_items.zoom"),key:"zoom-in",action:B=>n("zoom-time-range",B)}]:[],...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 u.provide("showLegendValues",P),u.provide("legendPosition",u.toRef(i,"legendPosition")),(B,U)=>{const J=u.resolveComponent("KTooltip"),$t=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",{ref:"chartShell",class:u.normalizeClass(["analytics-chart-shell",{"show-values":P.value}])},[F.value&&A.value&&S.value?(u.openBlock(),u.createElementBlock("div",ZO,[u.createVNode(J,{class:"tooltip","max-width":"500",placement:"right"},{content:u.withCtx(()=>[u.createElementVNode("div",QO,u.toDisplayString(L.value),1)]),default:u.withCtx(()=>[u.createVNode(u.unref(Tt.WarningIcon),{color:`var(--kui-color-text-warning, ${u.unref(lg)})`,size:`var(--kui-icon-size-40, ${u.unref(dg)})`},null,8,["color","size"])]),_:1})])):u.createCommentVNode("",!0),F.value?(u.openBlock(),u.createElementBlock("div",JO,[H.value?(u.openBlock(),u.createBlock(KO,{key:0,brush:v.value,"chart-data":T.value,"chart-legend-sort-fn":ct.value,"chart-tooltip-sort-fn":at.value,"dimension-axes-title":N.value,fill:e.chartOptions.stacked,granularity:nt.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":u.unref(k),"metric-axes-title":rt.value,"metric-unit":M.value,"right-y-axis":X.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:m.value,"time-range-ms":w.value,"tooltip-metric-display":lt.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":Ct.value,onSelectChartRange:U[0]||(U[0]=fe=>n("select-chart-range",fe)),onZoomTimeRange:U[1]||(U[1]=fe=>n("zoom-time-range",fe))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","fill","granularity","left-y-axis-grid","legend-values","metric-axes-title","metric-unit","right-y-axis","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):R.value?(u.openBlock(),u.createBlock(_O,{key:1,annotations:e.showAnnotations,"chart-data":T.value,"chart-legend-sort-fn":ct.value,"chart-tooltip-sort-fn":at.value,"data-testid":"bar-chart-container","dimension-axes-title":E.value,"legend-values":u.unref(k),"metric-axes-title":rt.value,"metric-unit":M.value,orientation:K.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":lt.value,"tooltip-title":e.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):W.value?(u.openBlock(),u.createBlock(RO,{key:2,"chart-data":T.value,"dataset-colors":e.chartOptions.chartDatasetColors||u.unref(Va),"legend-position":e.legendPosition,"legend-values":u.unref(k),"metric-name":D.value,"metric-unit":M.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":E.value,"tooltip-metric-display":lt.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):$.value?(u.openBlock(),u.createBlock(FO,{key:3,"chart-data":T.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":at.value,"data-testid":"scatter-chart-container","dimension-axes-title":V.value,granularity:gt.value,"metric-axes-title":rt.value,"metric-unit":M.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":_.value,"time-range-ms":w.value,"tooltip-metric-display":lt.value,"tooltip-title":e.tooltipTitle,"x-metric":p.value?.xMetric,"x-metric-unit":p.value?.xMetricUnit},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","dimension-axes-title","granularity","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","theme-colors","time-range-ms","tooltip-metric-display","tooltip-title","x-metric","x-metric-unit"])):u.createCommentVNode("",!0)])):(u.openBlock(),u.createBlock($t,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(tt.value),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(Z.value),1)]),_:1}))],2)}}}),eA=Pt(tA,[["__scopeId","data-v-c5c250ba"]]),nA={class:"chart-parent","data-testid":"gauge-chart-parent"},iA={class:"chart-totals-flex"},sA={key:1,class:"metric-small","data-testid":"gauge-chart-total"},oA=Pt(u.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:he},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.ref(yr()),s=u.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((g,y)=>g+y,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),o=u.computed(()=>({...t.chartData,datasets:s.value}));q.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},r=u.computed(()=>Ri(s?.value[0]?.data[t.numerator],{capital:!0})),l=u.computed(()=>Ri(s?.value[0]?.data[0]+s?.value[0]?.data[1],{capital:!0})),c=u.computed(()=>`color: ${s?.value[0]?.backgroundColor[t.numerator]}`),d=u.computed(()=>["full","single"].includes(t.metricDisplay)),h=u.computed(()=>t.metricDisplay==="full");return(f,m)=>(u.openBlock(),u.createElementBlock("div",nA,[u.createElementVNode("div",iA,[d.value?(u.openBlock(),u.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:u.normalizeStyle(c.value)},u.toDisplayString(r.value),5)):u.createCommentVNode("",!0),h.value?(u.openBlock(),u.createElementBlock("div",sA,u.toDisplayString(u.unref(n).t("total"))+": "+u.toDisplayString(l.value),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",{class:"chart-container",style:u.normalizeStyle({height:e.height,width:e.width})},[u.createVNode(u.unref(cf),{"chart-id":i.value,data:o.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-c461b83f"]]),aA={key:1,class:"single-value-wrapper"},rA={class:"single-value-metric"},lA={class:"name-unit-alignment"},cA={class:"single-value","data-testid":"single-value-chart"},uA={key:0,class:"single-value-unit"},dA={class:"single-value-metric-name"},hA={key:0,class:"single-value-trend"},fA={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},_r="t1",xr="t2",mA=Pt(u.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:Cd},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(e){const{i18n:t}=q.useI18n(),{formatBytes:n,formatCost:i}=oe({i18n:t}),s=e,o=u.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),a=u.computed(()=>We.buildDeltaMapping(s.data,s.showTrend,{topLevelKey:_r,secondLevelKey:xr})),r=u.computed(()=>a.value?.previous?.[_r]?.[xr]),l=u.computed(()=>a.value?.current?.[_r]?.[xr]),c=u.computed(()=>s.data.data),d=u.computed(()=>s.data.meta?.metric_names?.[0]),h=u.computed(()=>t.te(`chartLabels.${d.value}`)?t.t(`chartLabels.${d.value}`):""),f=u.computed(()=>{const S=d.value?s.data.meta?.metric_units?.[d.value]:void 0;if(S){const A=`chartUnits.${S}`;return t.te(A)?t.t(A,{plural:""}):""}}),m=u.computed(()=>!!d.value&&(d.value.includes("_per_minute")||d.value.includes("_latency_")||d.value==="error_rate")),p=u.computed(()=>s.showTrend&&r.value!==void 0?r.value:null),g=u.computed(()=>{if(s.showTrend)return l.value??null;if(c.value.length<1||!d.value)return null;const S=c.value[0].event[d.value];return typeof S!="number"||isNaN(S)?null:S}),y=u.computed(()=>s.data?.data?.length===void 0||s.data?.data?.length===0||!s.showTrend&&g.value===null||s.showTrend&&p.value===null&&g.value===null),_=u.computed(()=>{const S=g.value;if(S===null)return"-";const A=d.value?s.data.meta?.metric_units?.[d.value]:void 0;if(A==="usd")return i(S);if(A==="bytes")return n(S);if(S>=1e9){const R=(S/1e9).toFixed(1);return R.endsWith(".0")?`${Math.floor(S/1e9)}B`:`${R}B`}if(S>=1e7){const R=(S/1e6).toFixed(1);return R.endsWith(".0")?`${Math.floor(S/1e6)}M`:`${R}M`}const L=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:Cd;return S.toLocaleString("en-US",{maximumFractionDigits:L})}),x=u.computed(()=>s.showTrend&&s.data?.data?.length<2),T=u.computed(()=>We.calculateChange(g.value??0,p.value??0)||0),v=u.computed(()=>{if(!s.showTrend)return 0;if(s.data?.data?.length<2){if(r.value===void 0)return 0;if(l.value===void 0)return s.increaseIsBad?1:-1}return We.changePolarity(T.value,!0,s.increaseIsBad)}),w=u.computed(()=>We.defineIcon(v.value,s.increaseIsBad)),M=u.computed(()=>{if(s.showTrend&&s.data?.data?.length<2){if(r.value===void 0)return t.t("singleValue.trend.not_available");if(l.value===void 0)return We.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return We.metricChange(T.value,s.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),D=We.useTrendRange(u.computed(()=>s.showTrend),void 0,u.computed(()=>s.data.meta)),P=S=>S>0?"positive":S<0?"negative":"neutral",k=S=>S>0?rg:S<0?ag:_l;return u.onMounted(()=>{!s.showTrend&&s.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&s.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",s.data.data.length)}),(S,A)=>{const L=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["chart-parent",o.value]),"data-testid":"single-value-parent"},[y.value?(u.openBlock(),u.createBlock(L,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:u.unref(t).t("singleValue.valueError")},null,8,["title"])):(u.openBlock(),u.createElementBlock("div",aA,[u.createElementVNode("div",rA,[u.createElementVNode("div",lA,[u.createElementVNode("span",cA,u.toDisplayString(_.value),1),m.value&&f.value?(u.openBlock(),u.createElementBlock("span",uA," "+u.toDisplayString(f.value),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",dA,u.toDisplayString(h.value),1)]),e.showTrend?(u.openBlock(),u.createElementBlock("div",hA,[u.createElementVNode("div",{class:u.normalizeClass(["trend-change",P(v.value)]),"data-testid":"single-value-trend"},[x.value||v.value!==0?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(w.value),{key:0,color:k(v.value),size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])):(u.openBlock(),u.createBlock(u.unref(Tt.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${u.unref(_l)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])),u.createElementVNode("div",null,u.toDisplayString(M.value),1)],2),u.unref(D)?(u.openBlock(),u.createElementBlock("div",fA,u.toDisplayString(u.unref(D)),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),pA={class:"simple-chart-shell"},gA={key:1,class:"analytics-chart-parent"},yA=Pt(u.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.computed(()=>{const c=q.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors||he},u.toRef(t,"chartData")).value;return t.chartOptions?.reverseDataset&&c?.datasets.reverse(),c}),s=u.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),o=u.computed(()=>t.chartOptions.type==="gauge"),a=u.computed(()=>t.chartOptions.type==="single_value"),r=u.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),l=u.computed(()=>{const c=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(a.value){const d=t.chartData.meta?.metric_names?.[0];return c&&t.chartData.data[0].event[d]!==null}return c});return(c,d)=>{const h=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",pA,[l.value?(u.openBlock(),u.createElementBlock("div",gA,[o.value?(u.openBlock(),u.createBlock(oA,{key:0,"chart-data":i.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":s.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):u.createCommentVNode("",!0),a.value?(u.openBlock(),u.createBlock(mA,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):u.createCommentVNode("",!0)])):(u.openBlock(),u.createBlock(h,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(r.value),1)]),_:1}))])}}}),[["__scopeId","data-v-23ca8c84"]]),bA={class:"container"},_A={key:0,class:"no-data","data-testid":"sparkline-empty"},xA=["title"],wA=Pt(u.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(e){const t=crypto.randomUUID(),{i18n:n}=q.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:o,syncedMinCount:a,syncedMaxCount:r,syncedRenderPoints:l,syncedChartDatasets:c}=q.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),d=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:D,height:P})=>{d.width=D,d.height=P},f=u.computed(()=>e.disableTooltip?[]:[new df({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=u.computed(()=>c.value.reduce((D,{data:P,label:k})=>({...D,[k]:P.reduce((S,{y:A})=>S+A,0)}),{})),p=u.computed(()=>c.value.map(({label:D})=>[m.value[D],`${D}: ${m.value[D]}`]).sort(([D],[P])=>P-D).map(([,D])=>D).join(", ")),g=u.computed(()=>Object.keys(m.value).map(D=>m.value[D]).reduce((D,P)=>D+P,0)),y=u.computed(()=>g.value>0),_=u.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),x=u.computed(()=>e.datasets.length>1),T=`SparklineTooltipPosition-${t}`,v=u.computed(()=>{const D=e.type==="sparkline_bar",P=D?s.value-1:s.value,k=D?o.value:o.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:D?0:2,right:D?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:T,external:S=>{Ia(d,S,"minutely",{contextFormatter:A=>{const L=A+i.value;let R="";return i.value>1440*60*1e3?R=rs(new Date(L),"MMM dd, yyy hh:mm a"):R=rs(new Date(L),"hh:mm a"),`${Up(A)} - ${R}`}})}}},scales:{x:{min:P,max:k,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:x.value},y:{min:Math.max(a.value-1,0),max:r.value,grid:{display:!1},display:!1,stacked:x.value}}}}),w=u.ref("0"),M=u.ref("0");return u.onMounted(()=>{Ht.positioners[T]=function(D,P){if(!D.length||d.interactionMode==="interactive"||P.x===null)return!1;const k=10,S=this.chart.canvas.getBoundingClientRect(),A=d.width||this.width,L=d.height||this.height,R=S.top-L>0,H=R?S.top-L-k:S.top+S.height+k,W=S.left>A/2-P.x,$=Math.max(k,window.innerWidth-k-A),K=Math.min($,W?Math.floor(S.left-A/2)+P.x:0+k);return w.value=`${H}px`,M.value=`${K}px`,{x:K,y:H,xAlign:"center",yAlign:R?"top":"bottom"}}}),u.onUnmounted(()=>{Ht.positioners[T]&&delete Ht.positioners[T]}),(D,P)=>(u.openBlock(),u.createElementBlock("div",bA,[y.value?e.type==="sparkline_bar"?(u.openBlock(),u.createBlock(u.unref(lf),{key:1,"chart-id":u.unref(t),data:_.value,"data-testid":"sparkline-bar",options:v.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(u.openBlock(),u.createBlock(u.unref(uf),{key:2,"chart-id":u.unref(t),data:_.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:v.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):u.createCommentVNode("",!0):(u.openBlock(),u.createElementBlock("div",_A,[u.renderSlot(D.$slots,"empty",{},()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?u.createCommentVNode("",!0):(u.openBlock(),u.createBlock(ji,{key:3,"absolute-left":M.value,"absolute-top":w.value,class:"tooltip","data-testid":"sparkline-tooltip",state:d,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),y.value&&e.showLabel?(u.openBlock(),u.createElementBlock("div",{key:4,class:"label",title:D.$slots.label?"":p.value},[u.renderSlot(D.$slots,"label",{total:g.value,totalByDataset:m.value},()=>[u.createTextVNode(u.toDisplayString(p.value),1)],!0)],8,xA)):u.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),kA=["data-value"],TA=["title"],SA={class:"top-talkers-cell-metric"},vA={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},MA={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},DA={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},CA={class:"top-talkers-tooltip-title"},OA={class:"top-talkers-tooltip-rows"},AA={class:"top-talkers-tooltip-label"},PA=["data-threshold"],EA=Pt(u.defineComponent({__name:"TopTalkersCell",props:{cell:{}},setup(e){return u.useCssVars(t=>({cecbd9f0:t.cell.color,v0d35e6b6:t.cell.tint})),(t,n)=>(u.openBlock(),u.createBlock(u.unref(Kn.KPop),{class:"top-talkers-cell-wrapper",disabled:!e.cell.tooltipRows.length,"hide-caret":"","hide-close-icon":"",placement:"right","popover-timeout":0,style:u.normalizeStyle({flexGrow:e.cell.ratio}),trigger:"hover"},{content:u.withCtx(()=>[u.createElementVNode("div",DA,[u.createElementVNode("div",CA,u.toDisplayString(e.cell.name),1),u.createElementVNode("dl",OA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.cell.tooltipRows,i=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:i.key},[u.createElementVNode("dt",AA,u.toDisplayString(i.label),1),u.createElementVNode("dd",{class:u.normalizeClass(["top-talkers-tooltip-value",i.threshold&&`top-talkers-tooltip-value--${i.threshold}`]),"data-threshold":i.threshold},u.toDisplayString(i.value),11,PA)],64))),128))])])]),default:u.withCtx(()=>[u.createElementVNode("div",{class:u.normalizeClass(["top-talkers-cell",{"top-talkers-cell--other":e.cell.isOther,"top-talkers-cell--empty":e.cell.isEmpty,"top-talkers-cell--deleted":e.cell.deleted}]),"data-testid":"top-talkers-cell","data-value":e.cell.id},[u.createElementVNode("span",{class:"top-talkers-cell-name","data-testid":"top-talkers-cell-name",title:e.cell.name},u.toDisplayString(e.cell.name),9,TA),u.createElementVNode("span",SA,[u.createElementVNode("span",vA,u.toDisplayString(e.cell.display),1),e.cell.relative?(u.openBlock(),u.createElementBlock("span",MA,"("+u.toDisplayString(e.cell.relative)+")",1)):u.createCommentVNode("",!0)])],10,kA)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),RA=["data-dimension"],IA={class:"top-talkers-column-header"},LA={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},NA={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},BA={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},FA={key:2,class:"top-talkers-column-cells"},yf=Pt(u.defineComponent({__name:"TopTalkersColumn",props:{dimension:{},label:{},data:{},sizeMetric:{},columnOptions:{},isLoading:{type:Boolean}},setup(e){const{i18n:t}=q.useI18n(),{column:n}=q.useTopTalkersData(u.toRef(()=>e.data),u.toRef(()=>e.dimension),u.toRef(()=>e.sizeMetric),u.toRef(()=>e.columnOptions)),i=u.computed(()=>e.label||n.value.label),s=u.computed(()=>t.t("topTalkers.total",{value:n.value.total}));return(o,a)=>(u.openBlock(),u.createElementBlock("div",{class:"top-talkers-column","data-dimension":e.dimension,"data-testid":"top-talkers-column"},[u.createElementVNode("div",IA,[u.createElementVNode("span",LA,u.toDisplayString(i.value),1),!e.isLoading&&u.unref(n).cells.length?(u.openBlock(),u.createElementBlock("span",NA,u.toDisplayString(s.value),1)):u.createCommentVNode("",!0)]),e.isLoading?(u.openBlock(),u.createBlock(u.unref(Kn.KSkeleton),{key:0,"delay-milliseconds":0,"table-columns":1,type:"table"})):u.unref(n).cells.length?(u.openBlock(),u.createElementBlock("div",FA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(u.unref(n).cells,r=>(u.openBlock(),u.createBlock(EA,{key:r.id,cell:r},null,8,["cell"]))),128))])):(u.openBlock(),u.createElementBlock("div",BA,u.toDisplayString(u.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,RA))}}),[["__scopeId","data-v-e1b08041"]]),zA={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},UA={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},VA=Pt(u.defineComponent({__name:"TopTalkersGrid",props:{title:{default:""},columns:{},sizeMetric:{default:void 0},columnOptions:{default:void 0},emptyStateTitle:{default:""},errorMessage:{default:""},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=q.useI18n(),i=u.useSlots(),s=u.computed(()=>!!i.column),o=u.computed(()=>s.value||t.columns.some(a=>!!a.data?.data?.length||a.isLoading));return(a,r)=>(u.openBlock(),u.createBlock(u.unref(Kn.KCard),{class:"kong-ui-public-top-talkers","title-tag":e.titleTag},u.createSlots({default:u.withCtx(()=>[e.errorMessage?(u.openBlock(),u.createBlock(u.unref(Kn.KEmptyState),{key:0,"action-button-visible":!1,"data-testid":"top-talkers-error-state","icon-variant":"error"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("topTalkers.defaultErrorStateTitle")),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.errorMessage),1)]),_:1})):o.value?(u.openBlock(),u.createElementBlock("div",UA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.columns,(l,c)=>u.renderSlot(a.$slots,"column",{key:`${l.dimension}-${c}`,column:l},()=>[u.createVNode(yf,{"column-options":e.columnOptions,data:l.data,dimension:l.dimension,"is-loading":l.isLoading,label:l.label,"size-metric":e.sizeMetric},null,8,["column-options","data","dimension","is-loading","label","size-metric"])],!0)),128))])):(u.openBlock(),u.createBlock(u.unref(Kn.KEmptyState),{key:1,"action-button-visible":!1,"data-testid":"top-talkers-empty-state"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.emptyStateTitle||u.unref(n).t("topTalkers.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:u.withCtx(()=>[u.createElementVNode("span",zA,u.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]),HA={ai_provider:{anthropic:Tt.AnthropicIcon,azure:Tt.AzureIcon,bedrock:Tt.AmazonBedrockIcon,cerebras:Tt.CerebrasIcon,cohere:Tt.CohereIcon,databricks:Tt.DatabricksIcon,deepseek:Tt.DeepseekIcon,gemini:Tt.GeminiIcon,huggingface:Tt.HuggingFaceIcon,llama2:Tt.MetaLlamaIcon,mistral:Tt.MistralIcon,moonshot:Tt.KimiIcon,nvidia:Tt.NvidiaIcon,ollama:Tt.OllamaIcon,openai:Tt.OpenAiIcon,vertex:Tt.GoogleVertexIcon,vllm:Tt.VllmIcon,xai:Tt.GrokIcon}},$A=(e,t)=>{if(!(!e||!t))return HA[e]?.[t.toLowerCase()]},YA=["data-threshold"],WA=Pt(u.defineComponent({__name:"TopNMetricBar",props:{ratio:{},threshold:{}},setup(e){u.useCssVars(n=>({v0394367e:u.unref(t)}));const t=he[1];return(n,i)=>(u.openBlock(),u.createElementBlock("span",{class:u.normalizeClass(["top-n-metric-cell-bar",{[`top-n-metric-cell--bar-${e.threshold}`]:!!e.threshold}]),"data-testid":"top-n-metric-cell-bar","data-threshold":e.threshold},[u.createElementVNode("span",{class:"top-n-metric-cell-bar-fill",style:u.normalizeStyle({width:`${e.ratio*100}%`})},null,4)],10,YA))}}),[["__scopeId","data-v-24eb60ef"]]),jA=["data-threshold"],qA={class:"top-n-metric-cell-value"},GA={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},XA=Pt(u.defineComponent({__name:"TopNMetricCell",props:{display:{},relative:{},threshold:{},hasBar:{type:Boolean}},setup(e){return(t,n)=>(u.openBlock(),u.createElementBlock("span",{class:u.normalizeClass(["top-n-metric-cell",{"top-n-metric-cell--bar":e.hasBar,[`top-n-metric-cell--text-${e.threshold}`]:!e.hasBar&&!!e.threshold}]),"data-threshold":e.threshold},[u.createElementVNode("span",qA,u.toDisplayString(e.display),1),e.relative?(u.openBlock(),u.createElementBlock("span",GA,"("+u.toDisplayString(e.relative)+")",1)):u.createCommentVNode("",!0)],10,jA))}}),[["__scopeId","data-v-17e7f860"]]),KA={class:"top-n-card-title","data-testid":"top-n-card-title"},ZA={class:"top-n-card-description","data-testid":"top-n-card-description"},QA={key:3,class:"top-n-table","data-testid":"top-n-table"},JA={"data-testid":"top-n-table-header"},tP={class:"top-n-table-header-row"},eP=["colspan"],nP={class:"table-header-label"},iP=["data-testid"],sP={class:"top-n-table-cell-label"},oP={key:0,class:"top-n-table-cell top-n-table-cell-bar"},aP=3,rP=Pt(u.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"},columnOptions:{default:void 0}},setup(e){const t=e,{i18n:n}=q.useI18n(),{formatUnit:i}=oe({i18n:n}),s=u.computed(()=>t.data.data),o=u.computed(()=>!!s.value?.length),a=u.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,aP):[]),r=u.computed(()=>a.value[0]||""),l=u.computed(()=>a.value.length>1),c=u.computed(()=>a.value[a.value.length-1]||""),d=u.computed(()=>r.value?t.data.meta.display[r.value]:{}),h=u.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),f=u.computed(()=>h.value[0]),m=u.computed(()=>f.value?X(f.value):""),p=u.computed(()=>{const C=a.value.map(E=>({key:E,columnKey:E,label:K(E,l.value?X(E):n.t("topNTable.nameLabel")),type:"dimension"}));return f.value&&C.push({key:"value",columnKey:f.value,label:K(f.value,m.value),type:"metric"}),h.value.forEach((E,N)=>{N!==0&&C.push({key:E,columnKey:E,label:K(E,X(E)),type:"metric"})}),C}),g=u.computed(()=>p.value.filter(C=>C.type==="metric")),y=u.computed(()=>p.value.filter(C=>C.type==="dimension").slice(1)),_=C=>C.type==="dimension"&&C.key===c.value,x=C=>C.type==="metric"&&!!an(t.columnOptions,C.columnKey)?.bar,T=C=>l.value&&C.type==="dimension"&&!_(C),v=C=>{const E=C.event;return String(E[r.value])},w=(C,E)=>{const N=String(C.event[E]),V=t.data.meta?.display?.[E]?.[N];return{dimension:E,id:N,name:V?.name||"-",deleted:!!V?.deleted}},M=C=>{const E=v(C),N=d.value&&d.value[E];return N?N.name:"-"},D=C=>{const E=v(C),N=d.value&&d.value[E];return N?!!N.deleted:!1},P=C=>{const E=N=>i(N,"%",{translateUnit:V=>z(V,N)});return C>0&&C<.01?`< ${E(.01)}`:E(C)},k=(C,E)=>{const N=C.event[E];if(N==null)return"–";const V=typeof N=="number"?N:Number(N);if(Number.isNaN(V))return"–";const tt=t.data.meta?.metric_units?.[E]||"count";if(tt==="%")return P(V);const Z=["count","count/minute","token count"].includes(tt);return i(V,tt,{approximate:Z,isBytes1024:!0,translateUnit:F=>z(F,V)})},S=u.computed(()=>Object.fromEntries(h.value.map(C=>[C,Pa(s.value.map(E=>Nn(E.event[C])))]))),A=(C,E)=>{const N=an(t.columnOptions,E),V=Nn(C.event[E]);if(!N||V===null)return{display:k(C,E)};const tt=S.value[E],Z=N.value==="relative"?Ea(V,tt):null;return{display:k(C,E),relative:Z===null?void 0:P(Z*100),barRatio:N.bar?Rd(V,tt,N.bar):void 0,threshold:Ra(V,N.thresholds)}},L=u.computed(()=>s.value?.length?s.value.map(C=>{const E=a.value.map(Z=>w(C,Z)),N=E[0],V=N?.id||v(C),tt={id:V,rowKey:E.map(Z=>`${Z.dimension}:${Z.id}`).join("|")||V,name:N?.name||M(C),deleted:D(C),dimensions:E,metrics:{},original:C};return h.value.forEach((Z,F)=>{tt.metrics[F===0?"value":Z]=A(C,Z)}),tt}):[]),R=u.computed(()=>{if(!o.value)return"";if(t.data.meta){if(a.value.some(C=>!Object.keys(t.data.meta.display[C]||{}).length))return n.t("topNTable.errors.display");if(!f.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),H=(C,E)=>C.metrics[E]??{display:"–"},W=(C,E)=>C.dimensions.find(N=>N.dimension===E)?.id||"",$=(C,E)=>$A(an(t.columnOptions,C)?.icon_set,E),K=(C,E)=>C&&an(t.columnOptions,C)?.label||E,lt=(C,E)=>C.dimensions.find(N=>N.dimension===E)?.name||"–",rt=(C,E)=>{const N=C.dimensions.find(V=>V.dimension===E);return{id:N?.id||"",name:N?.name||"–",deleted:N?.deleted||!1,dimension:E,dimensions:C.dimensions,isEmpty:N?.id==="empty"}},X=C=>n.te(`chartLabels.${C}`)?n.t(`chartLabels.${C}`):C,z=(C,E)=>{if(zi(C)||C==="count"||C==="requests")return"";const N=E===1?"":"s";return n.te(`chartUnits.${C}`)?n.t(`chartUnits.${C}`,{plural:N}):C};return(C,E)=>{const N=u.resolveComponent("KEmptyState"),V=u.resolveComponent("KSkeleton"),tt=u.resolveComponent("KCard");return u.openBlock(),u.createBlock(tt,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},u.createSlots({default:u.withCtx(()=>[R.value?(u.openBlock(),u.createBlock(N,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(R.value),1)]),_:1})):e.isLoading?(u.openBlock(),u.createBlock(V,{key:1,"table-columns":2,type:"table"})):o.value?(u.openBlock(),u.createElementBlock("div",QA,[u.createElementVNode("table",{class:u.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":l.value}])},[u.createElementVNode("thead",JA,[u.createElementVNode("tr",tP,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(p.value,Z=>(u.openBlock(),u.createElementBlock("th",{key:Z.key,class:u.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":Z.type==="metric","top-n-table-header-cell-dimension-compact":T(Z)}]),colspan:x(Z)?2:void 0,"data-testid":"top-n-table-header-column"},[u.createElementVNode("span",nP,u.toDisplayString(Z.label),1),E[0]||(E[0]=u.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,eP))),128))])]),u.createElementVNode("tbody",null,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(L.value,Z=>(u.openBlock(),u.createElementBlock("tr",{key:Z.rowKey,class:"top-n-table-row"},[a.value.length?(u.openBlock(),u.createElementBlock("td",{key:0,class:u.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":l.value}])},[u.createElementVNode("span",{class:"top-n-table-cell-label","data-testid":`row-${Z.id}`},[$(r.value,Z.id)?(u.openBlock(),u.createBlock(u.resolveDynamicComponent($(r.value,Z.id)),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["size"])):u.createCommentVNode("",!0),u.renderSlot(C.$slots,"name",{record:{id:Z.id,name:Z.name,deleted:Z.deleted,dimension:r.value,dimensions:Z.dimensions,isEmpty:Z.id==="empty"}},()=>[u.createTextVNode(u.toDisplayString(Z.name),1)],!0)],8,iP)],2)):u.createCommentVNode("",!0),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(y.value,F=>(u.openBlock(),u.createElementBlock("td",{key:F.key,class:u.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!_(F)}])},[u.createElementVNode("span",sP,[$(F.key,W(Z,F.key))?(u.openBlock(),u.createBlock(u.resolveDynamicComponent($(F.key,W(Z,F.key))),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["size"])):u.createCommentVNode("",!0),u.renderSlot(C.$slots,"name",{record:rt(Z,F.key)},()=>[u.createTextVNode(u.toDisplayString(lt(Z,F.key)),1)],!0)])],2))),128)),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(g.value,F=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:F.key},[u.createElementVNode("td",{class:u.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":x(F)}])},[u.createVNode(XA,{"data-testid":F.key==="value"?`row-${Z.id}`:`row-${Z.id}-${F.key}`,display:H(Z,F.key).display,"has-bar":x(F),relative:H(Z,F.key).relative,threshold:H(Z,F.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),x(F)?(u.openBlock(),u.createElementBlock("td",oP,[u.createVNode(WA,{ratio:H(Z,F.key).barRatio??0,threshold:H(Z,F.key).threshold},null,8,["ratio","threshold"])])):u.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(u.openBlock(),u.createBlock(N,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.emptyStateTitle||u.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:u.withCtx(()=>[u.createElementVNode("span",KA,u.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:u.withCtx(()=>[u.createElementVNode("div",ZA,u.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]);ot.AnalyticsChart=eA,ot.ChartLegendPosition=It,ot.DECIMAL_DISPLAY=KM,ot.FONT_SIZE_REGULAR=zd,ot.FONT_SIZE_SMALL=Fd,ot.LEFT_Y_AXIS_ID=Gs,ot.MAX_LABEL_LENGTH=qs,ot.OTHER_DIMENSION_ID=Aa,ot.RIGHT_Y_AXIS_ID=Na,ot.SimpleChart=yA,ot.SparklineChart=wA,ot.TopNTable=rP,ot.TopTalkersColumn=yf,ot.TopTalkersGrid=VA,ot.chartTypes=J1,ot.exploreResultToScatterData=oh,ot.formatChartTicksByGranularity=Qa,ot.getBarRatio=Rd,ot.getColumnOptions=an,ot.getColumnStats=Pa,ot.getRelativeValue=Ea,ot.getThresholdType=Ra,ot.handleQueryError=Y1,ot.isCancellationError=ih,ot.isScatterChartData=er,ot.lookupStatusCodeColor=Vd,ot.requestsToScatterData=K1,ot.simpleChartMetricDisplay=Q1,ot.simpleChartTypes=tD,ot.statusCodeBadgeBackgroundColor=JM,ot.toNumber=Nn,Object.defineProperty(ot,Symbol.toStringTag,{value:"Module"})}));
|
|
6
|
+
${k?"text-wrap: nowrap;":""}
|
|
7
|
+
`)}}function M1(e,t,n={}){const{window:i=Hs,...s}=n;let o;const a=Td(()=>i&&"ResizeObserver"in i),r=()=>{o&&(o.disconnect(),o=void 0)},l=u.watch(u.computed(()=>{const d=u.toValue(e);return Array.isArray(d)?d.map(h=>Ln(h)):[Ln(d)]}),d=>{if(r(),a.value&&i){o=new ResizeObserver(t);for(const h of d)h&&o.observe(h,s)}},{immediate:!0,flush:"post"}),c=()=>{r(),l()};return wd(c),{isSupported:a,stop:c}}function D1(e,t={}){const{reset:n=!0,windowResize:i=!0,windowScroll:s=!0,immediate:o=!0,updateTiming:a="sync"}=t,r=u.shallowRef(0),l=u.shallowRef(0),c=u.shallowRef(0),d=u.shallowRef(0),h=u.shallowRef(0),f=u.shallowRef(0),m=u.shallowRef(0),p=u.shallowRef(0);function g(){const _=Ln(e);if(!_){n&&(r.value=0,l.value=0,c.value=0,d.value=0,h.value=0,f.value=0,m.value=0,p.value=0);return}const x=_.getBoundingClientRect();r.value=x.height,l.value=x.bottom,c.value=x.left,d.value=x.right,h.value=x.top,f.value=x.width,m.value=x.x,p.value=x.y}function y(){a==="sync"?g():a==="next-frame"&&requestAnimationFrame(()=>g())}return M1(e,y),u.watch(()=>Ln(e),_=>!_&&y()),T1(e,y,{attributeFilter:["style","class"]}),s&&Li("scroll",y,{capture:!0,passive:!0}),i&&Li("resize",y,{passive:!0}),x1(()=>{o&&y()}),{height:r,bottom:l,left:c,right:d,top:h,width:f,x:m,y:p,update:y}}function C1(e,t){const{top:n,left:i}=D1(e),s=u.computed(()=>e.value?`${parseFloat(t.left)+i.value}px`:t.left),o=u.computed(()=>e.value?`${parseFloat(t.top)+n.value}px`:t.top);return{tooltipAbsoluteLeft:s,tooltipAbsoluteTop:o}}const O1=({bucketCount:e,minStamp:t,maxStamp:n,timestamps:i})=>{const s=[...i].filter(l=>l>=t&&l<=n).sort((l,c)=>l-c),o=[];if(n-t<e-2)return[];const a=(n-t)/e;let r=0;for(let l=0;l<e;l++){const c=t+l*a,d=t+(l+1)*a;let h=0;for(;r<s.length&&s[r]>=c&&s[r]<=d;)h++,r++;o.push([Math.ceil(c),h])}return o},vd=()=>({minCounts:{},maxCounts:{},minStamps:{},maxStamps:{},renderPoints:{}}),Ni=u.ref({}),A1=e=>(Ni.value[e]||(Ni.value[e]=vd()),Ni.value[e]),P1=(e,t)=>{const n=Ni.value[t];if(!n)return;const i=n.minCounts[e]!==void 0||n.maxCounts[e]!==void 0||n.minStamps[e]!==void 0||n.maxStamps[e]!==void 0||n.renderPoints[e]!==void 0;n&&i&&(delete n.minCounts[e],delete n.maxCounts[e],delete n.minStamps[e],delete n.maxStamps[e],delete n.renderPoints[e],Object.keys(n.minCounts).length||Object.keys(n.maxCounts).length||Object.keys(n.minStamps).length||Object.keys(n.maxStamps).length||Object.keys(n.renderPoints).length||delete Ni.value[t])};function E1({chartKey:e,datasets:t,groupKey:n,minStamp:i=void 0,maxStamp:s=void 0,minCount:o=void 0,maxCount:a=void 0,renderPoints:r=void 0,type:l}){const d=n!==void 0&&e!==void 0?A1(n):vd(),h=e!==void 0?e:"static-chart-key",f=u.computed(()=>t.reduce((D,{timestamps:v})=>[...D,...v],[])),m=u.computed(()=>i||f.value.reduce((D,v)=>D===0?v:Math.min(D,v),0)),p=u.computed(()=>s||f.value.reduce((D,v)=>Math.max(D,v),0));u.watchEffect(()=>{d.minStamps[h]=m.value,d.maxStamps[h]=p.value,r!==void 0&&(d.renderPoints[h]=r)});const g=u.computed(()=>Object.values(d.minStamps).reduce((D,v)=>D===0?v:Math.min(D,v),0)),y=u.computed(()=>Object.values(d.maxStamps).reduce((D,v)=>Math.max(D,v),0)),_=u.computed(()=>{const D=Object.values(d.renderPoints);return D.length===0?24:D.reduce((v,C)=>Math.max(v,C),2)}),x=u.computed(()=>{const D=y.value-g.value;return Math.ceil(D/_.value)}),T=u.computed(()=>t.length>1),k=u.computed(()=>t.map(({timestamps:D,color:v,label:C})=>({data:O1({bucketCount:_.value,minStamp:g.value,maxStamp:y.value,timestamps:D}).map(([H,V])=>({x:H,y:V})),label:C,...(l==="sparkline_bar"||T.value)&&v&&{backgroundColor:v},...l!=="sparkline_bar"&&v&&{borderColor:v},...T.value&&l!=="sparkline_bar"&&{fill:!0}}))),w=u.computed(()=>{const D=k.value[0]?.data?.length??0,v=[];for(let C=0;C<D;C++){let I=0;for(let U=0;U<k.value.length;U++)I+=k.value[U].data[C].y;v.push(I)}return v}),O=u.computed(()=>{const D=w.value.reduce((v,C)=>Math.max(v,C),0);return Math.max(D,a??0)}),S=u.computed(()=>{const D=k.value.reduce((I,{data:U})=>[...I,...U.map(({y:H})=>H)],[]),v=D.length?D[0]:0,C=D.reduce((I,U)=>Math.min(I,U),v);return o===void 0?C:Math.min(C,o)});u.watchEffect(()=>{d.maxCounts[h]=O.value,d.minCounts[h]=S.value});const A=u.computed(()=>{const D=Object.values(d.minCounts),v=D.length?D[0]:0;return D.reduce((C,I)=>Math.min(C,I),v)}),R=u.computed(()=>Object.values(d.maxCounts).reduce((D,v)=>Math.max(D,v),0));return u.onUnmounted(()=>{e!==void 0&&n!==void 0&&P1(e,n)}),{syncedMinStamp:g,syncedMaxStamp:y,syncedRenderPoints:_,syncedChartDatasets:k,syncedGroupSizeMs:x,syncedMinCount:A,syncedMaxCount:R}}const ln=(e,t)=>{if(!e||!t)return;const n=t.toLowerCase();return e[t]??Object.entries(e).find(([i])=>i.toLowerCase()===n)?.[1]},Nn=e=>{if(e==null||e==="")return null;const t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},Oa=e=>e.reduce((t,n)=>n===null?t:{sum:t.sum+n,max:Math.max(t.max,n)},{sum:0,max:0}),Aa=(e,t)=>t.sum>0?e/t.sum:null,Sd=(e,t,n)=>{const i=n==="relative"?t.sum:t.max;return i<=0?0:Math.min(Math.max(e/i,0),1)},Pa=(e,t)=>{const n=(t??[]).filter(o=>e>=o.value);if(!n.length)return;const i=Math.max(...n.map(o=>o.value));return n.filter(o=>o.value===i).some(o=>o.type==="error")?"error":"warning"},Md=18,R1=85;function I1(e,t,n,i){const{i18n:s}=Hl(),{formatUnit:o}=le({i18n:s}),a=w=>w.map(O=>{const S=Math.min(O.ratio,.5)/.5;return{...O,color:pe({discriminator:0}),tint:`${Md+S*(R1-Md)}%`}}),r=u.computed(()=>e.value?.data??[]),l=u.computed(()=>e.value?.meta?.metric_names??[]),c=u.computed(()=>{const w=n.value;return w&&l.value.includes(w)?w:l.value[0]}),d=u.computed(()=>l.value.filter(w=>w!==c.value)),h=u.computed(()=>e.value?.meta?.display?.[t.value]??{}),f=(w,O)=>{if(zi(w)||w==="count"||w==="requests")return"";const S=O===1?"":"s";return s.te(`chartUnits.${w}`)?s.t(`chartUnits.${w}`,{plural:S}):w},m=w=>{const O=S=>o(S,"%",{translateUnit:A=>f(A,S)});return w>0&&w<.01?`< ${O(.01)}`:O(w)},p=(w,O)=>{if(w===null)return"–";const S=e.value?.meta?.metric_units?.[O]||"count";return S==="%"?m(w):o(w,S,{isBytes1024:!0,translateUnit:A=>f(A,w)})},g=w=>s.te(`chartLabels.${w}`)?s.t(`chartLabels.${w}`):w,y=w=>ln(i.value,w)?.label||g(w),_=u.computed(()=>Oa(r.value.map(w=>c.value?Nn(w.event[c.value]):null))),x=w=>d.value.flatMap(O=>{const S=Nn(w[O]);if(S===null)return[];const A=Pa(S,ln(i.value,O)?.thresholds);return[{key:O,label:y(O),value:p(S,O),threshold:A}]}),T=u.computed(()=>{if(!c.value)return[];const w=r.value.map(O=>{const S=O.event,A=String(S[t.value]),R=Nn(S[c.value])??0,D=Aa(R,_.value),v=D??0,C=A===mo;return{id:A,name:C?g(mo):h.value[A]?.name||A,deleted:!!h.value[A]?.deleted,isOther:C,isEmpty:A===Of,value:R,ratio:v,display:p(R,c.value),relative:D===null?"":m(D*100),tooltipRows:x(S)}}).sort((O,S)=>Number(O.isOther)-Number(S.isOther)||S.value-O.value);return a(w)});return{column:u.computed(()=>({dimension:t.value,label:y(t.value),total:p(_.value.sum,c.value??"count"),cells:T.value})),cells:T,sizeKey:c}}const K={useBarChartOptions:pv,useChartJSCommon:yv,useChartLegendValues:_v,useExploreResultToDatasets:t1,useExploreResultToTimeDataset:s1,useScatterDatasets:d1,useDonutChartOptions:xv,useLineChartOptions:wv,useScatterChartOptions:vv,useI18n:Hl,useReportChartDataForSynthetics:h1,useTranslatedUnits:f1,useEvaluateFeatureFlag:m1,useTooltipAbsolutePosition:C1,useSparklineSync:E1,useTopTalkersData:I1},Ys=e=>["interactive","zoom-interactive"].includes(e),Ea=(e,t,n,i)=>{const{tooltip:s}=t;if(s.opacity===0&&!Ys(e.interactionMode)){e.showTooltip=!1;return}const{i18n:o}=K.useI18n(),{formatUnit:a}=le({i18n:o}),r=e.chartTooltipSortFn||((l,c)=>c.rawValue-l.rawValue);if(s.body&&!Ys(e.interactionMode)){const l=s.labelColors,c=t.chart.config?.options?.indexAxis==="y"?"x":"y",d=s.dataPoints[0].parsed.x??0;e.tooltipContext=i?.contextFormatter?i.contextFormatter(d,n,s.dataPoints[0].raw):Fn({tickValue:new Date(d),granularity:n}),e.tooltipSeries=s.dataPoints.map((f,m)=>{const p=f.parsed[c],g=f.dataset.unit??e.units,y=a(p??0,g,{translateUnit:e.translateUnit}),_=f.raw?.tooltipLabel||f.dataset.label;return{backgroundColor:l[m].backgroundColor,borderColor:l[m].borderColor,label:_,value:y,rawValue:p,isSegmentEmpty:f.dataset.isSegmentEmpty}}).sort(r);const h=s.dataPoints[0]?.raw?.extras??[];for(const f of h)e.tooltipSeries.push({label:f.label,value:f.unit?a(Number(f.value)||0,f.unit,{translateUnit:e.translateUnit}):String(f.value),rawValue:Number(f.value)||0,isExtra:!0});e.left=`${s.x}px`,e.top=`${s.y}px`,e.showTooltip=!0}},Dd=(e,t)=>{const{tooltip:n}=t,{i18n:i}=K.useI18n(),{formatUnit:s}=le({i18n:i});if(n.opacity===0&&!Ys(e.interactionMode)){e.showTooltip=!1;return}const o=e.chartTooltipSortFn||((a,r)=>r.rawValue-a.rawValue);if(n.body&&!Ys(e.interactionMode)){const a=n.labelColors,r=t.chart.config?.options?.indexAxis==="y"?"x":"y",l=["gauge","donut"].includes(e.chartType);l?e.tooltipContext=e.dimensionDisplay||n.dataPoints[0].label:n.chart.data.isMultiDimension?e.tooltipContext=n.dataPoints[0].label:e.tooltipContext=e.dimensionDisplay||"",e.tooltipSeries=n.dataPoints.map((c,d)=>{const h=l?c.parsed:c.parsed[r],f=s(h??0,e.units,{translateUnit:e.translateUnit});let m;return l?m=c.dataset.labels[c.dataIndex]:m=c.dataset.label,{backgroundColor:a[d].backgroundColor,borderColor:a[d].borderColor,label:m,value:f,rawValue:h,isSegmentEmpty:c.dataset.isSegmentEmpty}}).sort(o),e.left=`${n.x}px`,e.top=`${n.y}px`,e.showTooltip=!0}},L1=e=>e&&e.datasets&&e.datasets.length,N1=e=>L1(e)&&e.datasets.some(t=>t.data.length),B1=e=>e.datasets.some(t=>t.data[0]&&Eo(t.data[0].x)),z1=e=>!!N1(e)&&e.datasets.some(t=>t.data.length==1),F1=e=>B1(e)&&e.datasets.some(t=>t.data[0]&&(t.data[0].x??0).toString().length>=13),Ws=(e,t,n)=>{const s=Math.min(t/1150,1),o=.15,a=1.15,r=e.x??0;return r<n?r+t*o*(1-s):r-t*a*(1-s)},Cd=(e,t,n)=>{const o=e.y??0;return o<n?o+t*.15:o-t*.5};function Od(e,t){let n;return(...i)=>{clearTimeout(n),n=window.setTimeout(()=>{e(...i)},t)}}const Ra=(e,t,n)=>{const i=e.data;return e.options.plugins.legend.labels.generateLabels(e).filter(s=>!t?.[s.text]?.isThreshold).map(((s,o)=>({...s,value:t&&t[s.text],isSegmentEmpty:i.datasets[o].isSegmentEmpty}))).sort(n)},U1=2,Ad=10,Pd=12,js=10,qs="y",Ia="y1",V1={lineTension:0,pointBorderWidth:1.2,borderJoinStyle:"round",fill:!0},H1=2,$1=0,La=new Map,Ed=(e,t)=>{const{i18n:n}=K.useI18n(),{formatBytes:i}=le({i18n:n});return t==="bytes"?i(e):t==="count/minute"?e.toFixed(2):is.format(e)},Y1=e=>{const n=document.createElement("canvas").getContext("2d"),i=xt({});return n.font=i.string,n.measureText(e).width},W1=()=>{const e="label_height";if(!La.has(e)){const t=xt({});La.set(e,t.lineHeight)}return La.get(e)},j1=(e,t)=>t.datasets.reduce((n,i,s)=>e.isDatasetVisible(s)?n+i.data.reduce((o,a)=>isNaN(a)?o:o+a,0):n,0),q1=(e,t)=>t===0?" (0.0%)":` (${(e/t*100).toFixed(1)}%)`,G1=Qp,X1={100:sg,101:og,102:ag,103:rg,200:lg,201:cg,202:ug,203:dg,204:hg,205:fg,206:mg,207:pg,208:gg,226:yg,300:bg,301:_g,302:xg,303:wg,304:kg,305:Tg,307:vg,308:Sg,400:Mg,401:Dg,402:Cg,403:Og,404:Ag,405:Pg,406:Eg,407:Rg,408:Ig,409:Lg,410:Ng,411:Bg,412:zg,413:Fg,414:Ug,415:Vg,416:Hg,417:$g,418:Yg,421:Wg,422:jg,423:qg,424:Gg,425:Xg,426:Kg,428:Zg,429:Qg,431:Jg,451:ty,500:ey,501:ny,502:iy,503:sy,504:oy,505:ay,506:ry,507:ly,508:cy,510:uy,511:dy},K1={100:hy,200:fy,300:my,400:py,500:gy},Z1={"1XX":yy,"2XX":by,"3XX":_y,"4XX":xy,"5XX":wy},Rd=e=>{const t=parseInt(e,10),n=Math.floor(t/100)*100;return X1[t]??K1[n]??G1},Q1={...Array.from({length:500},(e,t)=>100+t).reduce((e,t)=>(e[`${t}`]=Rd(`${t}`),e),{}),____OTHER____:Zp,...Z1};function Id(e,t,n){const i=Rl(),s=eM(e,n.timeZone,n.locale??i.locale);return"formatToParts"in s?J1(s,t):tM(s,t)}function J1(e,t){const n=e.formatToParts(t);for(let i=n.length-1;i>=0;--i)if(n[i].type==="timeZoneName")return n[i].value}function tM(e,t){const n=e.format(t).replace(/\u200E/g,""),i=/ [\w-+ ]+$/.exec(n);return i?i[0].substr(1):""}function eM(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function nM(e,t){const n=rM(t);return"formatToParts"in n?sM(n,e):oM(n,e)}const iM={year:0,month:1,day:2,hour:3,minute:4,second:5};function sM(e,t){try{const n=e.formatToParts(t),i=[];for(let s=0;s<n.length;s++){const o=iM[n[s].type];o!==void 0&&(i[o]=parseInt(n[s].value,10))}return i}catch(n){if(n instanceof RangeError)return[NaN];throw n}}function oM(e,t){const n=e.format(t),i=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[parseInt(i[3],10),parseInt(i[1],10),parseInt(i[2],10),parseInt(i[4],10),parseInt(i[5],10),parseInt(i[6],10)]}const Na={},Ld=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")),aM=Ld==="06/25/2014, 00:00:00"||Ld==="06/25/2014 00:00:00";function rM(e){return Na[e]||(Na[e]=aM?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Na[e]}function Nd(e,t,n,i,s,o,a){const r=new Date(0);return r.setUTCFullYear(e,t,n),r.setUTCHours(i,s,o,a),r}const Bd=36e5,lM=6e4,Ba={timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function za(e,t,n){if(!e)return 0;let i=Ba.timezoneZ.exec(e);if(i)return 0;let s,o;if(i=Ba.timezoneHH.exec(e),i)return s=parseInt(i[1],10),zd(s)?-(s*Bd):NaN;if(i=Ba.timezoneHHMM.exec(e),i){s=parseInt(i[2],10);const a=parseInt(i[3],10);return zd(s,a)?(o=Math.abs(s)*Bd+a*lM,i[1]==="+"?-o:o):NaN}if(dM(e)){t=new Date(t||Date.now());const a=n?t:cM(t),r=Fa(a,e);return-(n?r:uM(t,r,e))}return NaN}function cM(e){return Nd(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function Fa(e,t){const n=nM(e,t),i=Nd(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5],0).getTime();let s=e.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,i-s}function uM(e,t,n){let s=e.getTime()-t;const o=Fa(new Date(s),n);if(t===o)return t;s-=o-t;const a=Fa(new Date(s),n);return o===a?o:Math.max(o,a)}function zd(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Fd={};function dM(e){if(Fd[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Fd[e]=!0,!0}catch{return!1}}const hM=60*1e3,fM={X:function(e,t,n){const i=Ua(n.timeZone,e);if(i===0)return"Z";switch(t){case"X":return Ud(i);case"XXXX":case"XX":return Bn(i);default:return Bn(i,":")}},x:function(e,t,n){const i=Ua(n.timeZone,e);switch(t){case"x":return Ud(i);case"xxxx":case"xx":return Bn(i);default:return Bn(i,":")}},O:function(e,t,n){const i=Ua(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+mM(i,":");default:return"GMT"+Bn(i,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return Id("short",e,n);default:return Id("long",e,n)}}};function Ua(e,t){const n=e?za(e,t,!0)/hM:t?.getTimezoneOffset()??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function Gs(e,t){const n=e<0?"-":"";let i=Math.abs(e).toString();for(;i.length<t;)i="0"+i;return n+i}function Bn(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Gs(Math.floor(i/60),2),o=Gs(Math.floor(i%60),2);return n+s+t+o}function Ud(e,t){return e%60===0?(e>0?"-":"+")+Gs(Math.abs(e)/60,2):Bn(e,t)}function mM(e,t=""){const n=e>0?"-":"+",i=Math.abs(e),s=Math.floor(i/60),o=i%60;return o===0?n+String(s):n+String(s)+t+Gs(o,2)}function Vd(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const pM=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,Va=36e5,Hd=6e4,gM=2,qt={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:pM};function $d(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?gM:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const i=yM(e),{year:s,restDateString:o}=bM(i.date,n),a=_M(o,s);if(a===null||isNaN(a.getTime()))return new Date(NaN);if(a){const r=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=za(i.timeZone||t.timeZone,new Date(r+l)),isNaN(c))return new Date(NaN)}else c=Vd(new Date(r+l)),c=Vd(new Date(r+l+c));return new Date(r+l+c)}else return new Date(NaN)}function yM(e){const t={};let n=qt.dateTimePattern.exec(e),i;if(n?(t.date=n[1],i=n[3]):(n=qt.datePattern.exec(e),n?(t.date=n[1],i=n[2]):(t.date=null,i=e)),i){const s=qt.timeZone.exec(i);s?(t.time=i.replace(s[1],""),t.timeZone=s[1].trim()):t.time=i}return t}function bM(e,t){if(e){const n=qt.YYY[t],i=qt.YYYYY[t];let s=qt.YYYY.exec(e)||i.exec(e);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:e.slice(o.length)}}if(s=qt.YY.exec(e)||n.exec(e),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:e.slice(o.length)}}}return{year:null}}function _M(e,t){if(t===null)return null;let n,i,s;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let o=qt.MM.exec(e);if(o)return n=new Date(0),i=parseInt(o[1],10)-1,jd(t,i)?(n.setUTCFullYear(t,i),n):new Date(NaN);if(o=qt.DDD.exec(e),o){n=new Date(0);const a=parseInt(o[1],10);return TM(t,a)?(n.setUTCFullYear(t,0,a),n):new Date(NaN)}if(o=qt.MMDD.exec(e),o){n=new Date(0),i=parseInt(o[1],10)-1;const a=parseInt(o[2],10);return jd(t,i,a)?(n.setUTCFullYear(t,i,a),n):new Date(NaN)}if(o=qt.Www.exec(e),o)return s=parseInt(o[1],10)-1,qd(s)?Yd(t,s):new Date(NaN);if(o=qt.WwwD.exec(e),o){s=parseInt(o[1],10)-1;const a=parseInt(o[2],10)-1;return qd(s,a)?Yd(t,s,a):new Date(NaN)}return null}function xM(e){let t,n,i=qt.HH.exec(e);if(i)return t=parseFloat(i[1].replace(",",".")),Ha(t)?t%24*Va:NaN;if(i=qt.HHMM.exec(e),i)return t=parseInt(i[1],10),n=parseFloat(i[2].replace(",",".")),Ha(t,n)?t%24*Va+n*Hd:NaN;if(i=qt.HHMMSS.exec(e),i){t=parseInt(i[1],10),n=parseInt(i[2],10);const s=parseFloat(i[3].replace(",","."));return Ha(t,n,s)?t%24*Va+n*Hd+s*1e3:NaN}return null}function Yd(e,t,n){t=t||0,n=n||0;const i=new Date(0);i.setUTCFullYear(e,0,4);const s=i.getUTCDay()||7,o=t*7+n+1-s;return i.setUTCDate(i.getUTCDate()+o),i}const wM=[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 Wd(e){return e%400===0||e%4===0&&e%100!==0}function jd(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const i=Wd(e);if(i&&n>kM[t]||!i&&n>wM[t])return!1}return!0}function TM(e,t){if(t<1)return!1;const n=Wd(e);return!(n&&t>366||!n&&t>365)}function qd(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function Ha(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const vM=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function SM(e,t,n={}){t=String(t);const i=t.match(vM);if(i){const s=$d(n.originalDate||e,n);t=i.reduce(function(o,a){if(a[0]==="'")return o;const r=o.indexOf(a),l=o[r-1]==="'",c=o.replace(a,"'"+fM[a[0]](s,a,n)+"'");return l?c.substring(0,r-1)+c.substring(r+1):c},t)}return as(e,t,n)}function MM(e,t,n){e=$d(e,n);const i=za(t,e,!0),s=new Date(e.getTime()-i),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function Bi(e,t,n,i){return i={...i,timeZone:t,originalDate:e},SM(MM(e,t,{timeZone:i.timeZone}),n,i)}const DM=(e,t)=>`${Bi(e,t,"yyyy")} W${Bi(e,t,"II")}`,$a="MMM dd, h:mm:ss a",Ya="h:mm:ss a",cn="MMM dd, h:mm a",zn="h:mm a",CM="MMM dd",Wa="MMM dd, h:mm:ss a",He="MMM dd, h:mm a",OM={secondly:e=>e?$a:Ya,tenSecondly:e=>e?$a:Ya,thirtySecondly:e=>e?$a:Ya,minutely:e=>e?cn:zn,fiveMinutely:e=>e?cn:zn,tenMinutely:e=>e?cn:zn,thirtyMinutely:e=>e?cn:zn,hourly:e=>e?cn:zn,twoHourly:e=>e?cn:zn,twelveHourly:()=>cn,daily:()=>CM},AM={secondly:()=>Wa,tenSecondly:()=>Wa,thirtySecondly:()=>Wa,minutely:()=>He,fiveMinutely:()=>He,tenMinutely:()=>He,thirtyMinutely:()=>He,hourly:()=>He,twoHourly:()=>He,twelveHourly:()=>He,daily:()=>He};function Gd({tickValue:e,granularity:t,timezone:n,dayBoundaryCrossed:i=!1,tickMap:s,tooltipMap:o,defaultFormat:a}){const r=n||Intl.DateTimeFormat().resolvedOptions().timeZone;if(t==="weekly")return DM(e,r);if(s&&s[t]){const l=s[t](i);return Bi(e,r,l)}if(o&&o[t]){const l=o[t]();return Bi(e,r,l)}return Bi(e,r,a)}const ja=({tickValue:e,granularity:t,dayBoundaryCrossed:n,timezone:i})=>Gd({tickValue:e,granularity:t,timezone:i,dayBoundaryCrossed:n,tickMap:OM,defaultFormat:"MMM dd, h:mm:ss a"}),Fn=({tickValue:e,granularity:t,timezone:n})=>Gd({tickValue:e,granularity:t,timezone:n,tooltipMap:AM,defaultFormat:"MMM dd, yyyy h:mm:ss a"}),Xd=e=>e?.code==="ERR_CANCELED"||e?.name==="CanceledError"||e?.name==="AbortError",PM=e=>{const{i18n:t}=K.useI18n();return Xd(e)?{type:"canceled",message:t.t("query_errors.canceled.message")}:e?.status===403?{status:e.status,type:"forbidden",message:t.t("query_errors.forbidden.message"),details:t.t("query_errors.forbidden.details")}:e?.status===408||e?.message?.includes("timeout")?{status:e.status,type:"timeout",message:t.t("query_errors.timeout.message"),details:t.t("query_errors.timeout.details")}:e?.response?.data?.message==="Range not allowed for this tier"?{status:e.status,type:"range_exceeded",message:t.t("query_errors.time_range_exceeded.message"),details:t.t("query_errors.time_range_exceeded.details")}:{status:e.status,type:"other",message:t.t("query_errors.other.message"),details:e.response?.data?.invalid_parameters?.map(n=>n.reason).join(", ")||e?.message}},zi=e=>e.toLocaleLowerCase().endsWith("count"),EM=e=>{const t=e.toLocaleLowerCase();return["sum","count","cost","tokens"].some(n=>t.endsWith(n))},RM=(e,t)=>{if(!e.length)return NaN;const i=Math.min(100,Math.max(0,t))/100*(e.length-1),s=Math.floor(i),o=Math.ceil(i);return s===o?e[s]:e[s]+(e[o]-e[s])*(i-s)},IM=(e,t)=>{const n=e.filter(i=>Number.isFinite(i)).sort((i,s)=>i-s);return new Map(t.map(i=>[i,RM(n,i)]))},Kd=.7,qa=(e,t)=>{const n=_s(e.trim());return n.valid?n.alpha(t).rgbString():e},Ga=e=>{const t=e??(typeof document>"u"?null:document.documentElement);if(typeof window>"u"||!t)return{medianLine:ul,outlier:ll,outlierBand:qa(cl,Kd)};const n=window.getComputedStyle(t),i=(s,o)=>n.getPropertyValue(s).trim()||o;return{medianLine:i("--kui-color-text",ul),outlier:i("--kui-color-background-danger",ll),outlierBand:qa(i("--kui-color-background-danger-weakest",cl),Kd)}},LM="empty",Zd=e=>{if(!e||!("meta"in e)||!("data"in e))return;const{display:t,metric_names:n,metric_units:i,start:s,end:o,truncated:a,limit:r,datasource:l}=e.meta;if(!n?.length){console.error("Cannot build scatter chart data from this explore result. Missing metric names.");return}const c=n.length>1?n[0]:void 0,d=c?n[1]:n[0],h=t&&Object.keys(t)[0]||void 0,f=e.data??[],m=[];for(const p of f){const g=Jd(p.timestamp,p.event[d],h?p.event[h]:void 0);if(g){if(c){const y=Qd(p.event[c]);if(y===void 0)continue;g.x=y}m.push(g)}}return{points:m,metric:d,metricUnit:i?.[d],...c?{xMetric:c,xMetricUnit:i?.[c]}:{},dimension:h,display:h?t?.[h]:void 0,start:s,end:o,truncated:a,limit:r,datasource:l}},Qd=e=>{if(e==null||e==="")return;const t=Number(e);return Number.isFinite(t)?t:void 0},Jd=(e,t,n,i)=>{const s=new Date(e).valueOf(),o=Qd(t);if(!Number.isFinite(s)||o===void 0)return;const a=i?.length?{extras:i}:{};return n===void 0?{timestamp:s,value:o,...a}:{timestamp:s,value:o,group:n!==null&&n!==""?String(n):LM,...a}},NM=(e,t,n)=>{if(!n?.length)return;const i=[];for(const{field:s,label:o,unit:a}of n){const r=un(e,s)??un(t,s);r==null||r===""||i.push({label:o??s,value:r,...a?{unit:a}:{}})}return i.length?i:void 0},BM=(e,t)=>{if(!e||!("meta"in e))return;const{metric:n,dimension:i,unroll:s,display:o,extraFields:a,metricUnit:r}=t,l=t.timestamp??"request_start";if(!n){console.error("Cannot build scatter chart data from these request records. Missing metric.");return}const c=[];for(const d of e.results??[]){const h=un(d,l);for(const f of zM(d,s)){const m=un(f,n),p=i?un(f,i)??un(d,i):void 0,g=Jd(h,m,i?p??null:void 0,NM(f,d,a));g&&c.push(g)}}return{points:c,metric:n,metricUnit:r,dimension:i,display:o,start:e.meta?.time_range?.start,end:e.meta?.time_range?.end,truncated:e.truncated,limit:e.limit,datasource:"requests"}},zM=(e,t)=>{if(!t)return[e];const n=un(e,t);return Array.isArray(n)?n:[]},un=(e,t)=>{let n=e;for(const i of t.split(".")){if(n===null||typeof n!="object")return;n=n[i]}return n},th=e=>Object.hasOwn(Vl.chartLabels,e),FM=["hidden","single","full"],UM=["donut","horizontal_bar","vertical_bar","timeseries_line","timeseries_bar","scatter"],VM=["gauge","top_n","single_value"],Xa=e=>e===null||typeof e!="object"||!("points"in e)?!1:Array.isArray(e.points);var Lt=(e=>(e.Hidden="hidden",e.Bottom="bottom",e))(Lt||{});const eh={modes:{point(e,t){return Xs(e,t,{intersect:!0})},nearest(e,t,n){return YM(e,t,n)},x(e,t,n){return Xs(e,t,{intersect:n.intersect,axis:"x"})},y(e,t,n){return Xs(e,t,{intersect:n.intersect,axis:"y"})}}};function Ka(e,t,n){return(eh.modes[n.mode]||eh.modes.nearest)(e,t,n)}function HM(e,t,n){return n!=="x"&&n!=="y"?e.inRange(t.x,t.y,"x",!0)||e.inRange(t.x,t.y,"y",!0):e.inRange(t.x,t.y,n,!0)}function $M(e,t,n){return n==="x"?{x:e.x,y:t.y}:n==="y"?{x:t.x,y:e.y}:t}function Xs(e,t,n){return e.filter(i=>n.intersect?i.inRange(t.x,t.y):HM(i,t,n.axis))}function YM(e,t,n){let i=Number.POSITIVE_INFINITY;return Xs(e,t,n).reduce((s,o)=>{const a=o.getCenterPoint(),r=$M(t,a,n.axis),l=Cn(t,r);return l<i?(s=[o],i=l):l===i&&s.push(o),s},[]).sort((s,o)=>s._index-o._index).slice(0,1)}function dn(e,t,n){const i=Math.cos(n),s=Math.sin(n),o=t.x,a=t.y;return{x:o+i*(e.x-o)-s*(e.y-a),y:a+s*(e.x-o)+i*(e.y-a)}}const WM=(e,t)=>t>e||e.length>t.length&&e.slice(0,t.length)===t,hn=.001,Ks=(e,t,n)=>Math.min(n,Math.max(t,e)),nh=(e,t)=>e.value>=e.start-t&&e.value<=e.end+t;function jM(e,t,n){for(const i of Object.keys(e))e[i]=Ks(e[i],t,n);return e}function qM(e,t,n,i){return!e||!t||n<=0?!1:Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<=Math.pow(n+i,2)}function ih(e,{x:t,y:n,x2:i,y2:s},o,{borderWidth:a,hitTolerance:r}){const l=(a+r)/2,c=e.x>=t-l-hn&&e.x<=i+l+hn,d=e.y>=n-l-hn&&e.y<=s+l+hn;return o==="x"?c:(o==="y"||c)&&d}function sh(e,{rect:t,center:n},i,{rotation:s,borderWidth:o,hitTolerance:a}){const r=dn(e,n,Ot(-s));return ih(r,t,i,{borderWidth:o,hitTolerance:a})}function fn(e,t){const{centerX:n,centerY:i}=e.getProps(["centerX","centerY"],t);return{x:n,y:i}}function GM(e,t,n,i=!0){const s=n.split(".");let o=0;for(const a of t.split(".")){const r=s[o++];if(parseInt(a,10)<parseInt(r,10))break;if(WM(r,a)){if(i)throw new Error(`${e} v${n} is not supported. v${t} or newer is required.`);return!1}}return!0}const oh=e=>typeof e=="string"&&e.endsWith("%"),ah=e=>parseFloat(e)/100,rh=e=>Ks(ah(e),0,1),Fi=(e,t)=>({x:e,y:t,x2:e,y2:t,width:0,height:0}),XM={box:e=>Fi(e.centerX,e.centerY),doughnutLabel:e=>Fi(e.centerX,e.centerY),ellipse:e=>({centerX:e.centerX,centerY:e.centerX,radius:0,width:0,height:0}),label:e=>Fi(e.centerX,e.centerY),line:e=>Fi(e.x,e.y),point:e=>({centerX:e.centerX,centerY:e.centerY,radius:0,width:0,height:0}),polygon:e=>Fi(e.centerX,e.centerY)};function Za(e,t){return t==="start"?0:t==="end"?e:oh(t)?rh(t)*e:e/2}function $e(e,t,n=!0){return typeof t=="number"?t:oh(t)?(n?rh(t):ah(t))*e:e}function KM(e,t){const{x:n,width:i}=e,s=t.textAlign;return s==="center"?n+i/2:s==="end"||s==="right"?n+i:n}function lh(e,t,{borderWidth:n,position:i,xAdjust:s,yAdjust:o},a){const r=et(a),l=t.width+(r?a.width:0)+n,c=t.height+(r?a.height:0)+n,d=Qa(i),h=hh(e.x,l,s,d.x),f=hh(e.y,c,o,d.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 Qa(e,t="center"){return et(e)?{x:Q(e.x,t),y:Q(e.y,t)}:(e=Q(e,t),{x:e,y:e})}const ch=(e,t)=>e&&e.autoFit&&t<1;function uh(e,t){const n=e.font,i=ut(n)?n:[n];return ch(e,t)?i.map(function(s){const o=xt(s);return o.size=Math.floor(s.size*t),o.lineHeight=s.lineHeight,xt(o)}):i.map(s=>xt(s))}function dh(e){return e&&(Xt(e.xValue)||Xt(e.yValue))}function hh(e,t,n=0,i){return e-Za(t,i)+n}function Un(e,t,n){const i=n.init;if(i){if(i===!0)return mh(t,n)}else return;return ZM(e,t,n)}function fh(e,t,n){let i=!1;return t.forEach(s=>{Kt(e[s])?(i=!0,n[s]=e[s]):Xt(n[s])&&delete n[s]}),i}function mh(e,t){const n=t.type||"line";return XM[n](e)}function ZM(e,t,n){const i=ft(n.init,[{chart:e,properties:t,options:n}]);if(i===!0)return mh(t,n);if(et(i))return i}const Ja=new Map,QM=e=>isNaN(e)||e<=0,JM=e=>e.reduce(function(t,n){return t+=n.string,t},"");function Zs(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object HTMLImageElement]"||t==="[object HTMLCanvasElement]"}}function Qs(e,{x:t,y:n},i){i&&(e.translate(t,n),e.rotate(Ot(i)),e.translate(-t,-n))}function ve(e,t){if(t&&t.borderWidth)return e.lineCap=t.borderCapStyle||"butt",e.setLineDash(t.borderDash),e.lineDashOffset=t.borderDashOffset,e.lineJoin=t.borderJoinStyle||"miter",e.lineWidth=t.borderWidth,e.strokeStyle=t.borderColor,!0}function Vn(e,t){e.shadowColor=t.backgroundShadowColor,e.shadowBlur=t.shadowBlur,e.shadowOffsetX=t.shadowOffsetX,e.shadowOffsetY=t.shadowOffsetY}function Js(e,t){const n=t.content;if(Zs(n))return{width:$e(n.width,t.width),height:$e(n.height,t.height)};const i=uh(t),s=t.textStrokeWidth,o=ut(n)?n:[n],a=o.join()+JM(i)+s+(e._measureText?"-spriting":"");return Ja.has(a)||Ja.set(a,iD(e,o,i,s)),Ja.get(a)}function ph(e,t,n){const{x:i,y:s,width:o,height:a}=t;e.save(),Vn(e,n);const r=ve(e,n);e.fillStyle=n.backgroundColor,e.beginPath(),On(e,{x:i,y:s,w:o,h:a,radius:jM(Ne(n.borderRadius),0,Math.min(o,a)/2)}),e.closePath(),e.fill(),r&&(e.shadowColor=n.borderShadowColor,e.stroke()),e.restore()}function gh(e,t,n,i){const s=n.content;if(Zs(s)){e.save(),e.globalAlpha=aD(n.opacity,s.style.opacity),e.drawImage(s,t.x,t.y,t.width,t.height),e.restore();return}const o=ut(s)?s:[s],a=uh(n,i),r=n.color,l=ut(r)?r:[r],c=KM(t,n),d=t.y+n.textStrokeWidth/2;e.save(),e.textBaseline="middle",e.textAlign=n.textAlign,tD(e,n)&&sD(e,{x:c,y:d},o,a),oD(e,{x:c,y:d},o,{fonts:a,colors:l}),e.restore()}function tD(e,t){if(t.textStrokeWidth>0)return e.lineJoin="round",e.miterLimit=2,e.lineWidth=t.textStrokeWidth,e.strokeStyle=t.textStrokeColor,!0}function eD(e,t,n,i){const{radius:s,options:o}=t,a=o.pointStyle,r=o.rotation;let l=(r||0)*qo;if(Zs(a)){e.save(),e.translate(n,i),e.rotate(l),e.drawImage(a,-a.width/2,-a.height/2,a.width,a.height),e.restore();return}QM(s)||nD(e,{x:n,y:i,radius:s,rotation:r,style:a,rad:l})}function nD(e,{x:t,y:n,radius:i,rotation:s,style:o,rad:a}){let r,l,c,d;switch(e.beginPath(),o){default:e.arc(t,n,i,0,gt),e.closePath();break;case"triangle":e.moveTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=ps,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),a+=ps,e.lineTo(t+Math.sin(a)*i,n-Math.cos(a)*i),e.closePath();break;case"rectRounded":d=i*.516,c=i-d,r=Math.cos(a+ae)*c,l=Math.sin(a+ae)*c,e.arc(t-r,n-l,d,a-tt,a-yt),e.arc(t+l,n-r,d,a-yt,a),e.arc(t+r,n+l,d,a,a+yt),e.arc(t-l,n+r,d,a+yt,a+tt),e.closePath();break;case"rect":if(!s){c=Math.SQRT1_2*i,e.rect(t-c,n-c,2*c,2*c);break}a+=ae;case"rectRot":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+l,n-r),e.lineTo(t+r,n+l),e.lineTo(t-l,n+r),e.closePath();break;case"crossRot":a+=ae;case"cross":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r);break;case"star":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r),a+=ae,r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l),e.moveTo(t+l,n-r),e.lineTo(t-l,n+r);break;case"line":r=Math.cos(a)*i,l=Math.sin(a)*i,e.moveTo(t-r,n-l),e.lineTo(t+r,n+l);break;case"dash":e.moveTo(t,n),e.lineTo(t+Math.cos(a)*i,n+Math.sin(a)*i);break}e.fill()}function iD(e,t,n,i){e.save();const s=t.length;let o=0,a=i;for(let r=0;r<s;r++){const l=n[Math.min(r,n.length-1)];e.font=l.string;const c=t[r];o=Math.max(o,e.measureText(c).width+i),a+=l.lineHeight}return e.restore(),{width:o,height:a}}function sD(e,{x:t,y:n},i,s){e.beginPath();let o=0;i.forEach(function(a,r){const l=s[Math.min(r,s.length-1)],c=l.lineHeight;e.font=l.string,e.strokeText(a,t,n+c/2+o),o+=c}),e.stroke()}function oD(e,{x:t,y:n},i,{fonts:s,colors:o}){let a=0;i.forEach(function(r,l){const c=o[Math.min(l,o.length-1)],d=s[Math.min(l,s.length-1)],h=d.lineHeight;e.beginPath(),e.font=d.string,e.fillStyle=c,e.fillText(r,t,n+h/2+a),a+=h,e.fill()})}function aD(e,t){const n=Le(e)?e:t;return Le(n)?Ks(n,0,1):1}const yh=["left","bottom","top","right"];function rD(e,t){const{pointX:n,pointY:i,options:s}=t,o=s.callout,a=o&&o.display&&hD(t,o);if(!a||mD(t,o,a))return;if(e.save(),e.beginPath(),!ve(e,o))return e.restore();const{separatorStart:l,separatorEnd:c}=lD(t,a),{sideStart:d,sideEnd:h}=uD(t,a,l);(o.margin>0||s.borderWidth===0)&&(e.moveTo(l.x,l.y),e.lineTo(c.x,c.y)),e.moveTo(d.x,d.y),e.lineTo(h.x,h.y);const f=dn({x:n,y:i},t.getCenterPoint(),Ot(-t.rotation));e.lineTo(f.x,f.y),e.stroke(),e.restore()}function lD(e,t){const{x:n,y:i,x2:s,y2:o}=e,a=cD(e,t);let r,l;return t==="left"||t==="right"?(r={x:n+a,y:i},l={x:r.x,y:o}):(r={x:n,y:i+a},l={x:s,y:r.y}),{separatorStart:r,separatorEnd:l}}function cD(e,t){const{width:n,height:i,options:s}=e,o=s.callout.margin+s.borderWidth/2;return t==="right"?n+o:t==="bottom"?i+o:-o}function uD(e,t,n){const{y:i,width:s,height:o,options:a}=e,r=a.callout.start,l=dD(t,a.callout);let c,d;return t==="left"||t==="right"?(c={x:n.x,y:i+$e(o,r)},d={x:c.x+l,y:c.y}):(c={x:n.x+$e(s,r),y:n.y},d={x:c.x,y:c.y+l}),{sideStart:c,sideEnd:d}}function dD(e,t){const n=t.side;return e==="left"||e==="top"?-n:n}function hD(e,t){const n=t.position;return yh.includes(n)?n:fD(e,t)}function fD(e,t){const{x:n,y:i,x2:s,y2:o,width:a,height:r,pointX:l,pointY:c,centerX:d,centerY:h,rotation:f}=e,m={x:d,y:h},p=t.start,g=$e(a,p),y=$e(r,p),_=[n,n+g,n+g,s],x=[i+y,o,i,o],T=[];for(let k=0;k<4;k++){const w=dn({x:_[k],y:x[k]},m,Ot(f));T.push({position:yh[k],distance:Cn(w,{x:l,y:c})})}return T.sort((k,w)=>k.distance-w.distance)[0].position}function mD(e,t,n){const{pointX:i,pointY:s}=e,o=t.margin;let a=i,r=s;return n==="left"?a+=o:n==="right"?a-=o:n==="top"?r+=o:n==="bottom"&&(r-=o),e.inRange(a,r)}const bh={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 Hn(e,t,n){return t=typeof t=="number"?t:e.parse(t),_t(t)?e.getPixelForValue(t):n}function mn(e,t,n){const i=t[n];if(i||n==="scaleID")return i;const s=n.charAt(0),o=Object.values(e).filter(a=>a.axis&&a.axis===s);return o.length?o[0].id:s}function _h(e,t){if(e){const n=e.options.reverse,i=Hn(e,t.min,n?t.end:t.start),s=Hn(e,t.max,n?t.start:t.end);return{start:i,end:s}}}function xh(e,t){const{chartArea:n,scales:i}=e,s=i[mn(i,t,"xScaleID")],o=i[mn(i,t,"yScaleID")];let a=n.width/2,r=n.height/2;return s&&(a=Hn(s,t.xValue,s.left+s.width/2)),o&&(r=Hn(o,t.yValue,o.top+o.height/2)),{x:a,y:r}}function tr(e,t){const n=e.scales,i=n[mn(n,t,"xScaleID")],s=n[mn(n,t,"yScaleID")];if(!i&&!s)return{};let{left:o,right:a}=i||e.chartArea,{top:r,bottom:l}=s||e.chartArea;const c=Th(i,{min:t.xMin,max:t.xMax,start:o,end:a});o=c.start,a=c.end;const d=Th(s,{min:t.yMin,max:t.yMax,start:l,end:r});return r=d.start,l=d.end,{x:o,y:r,x2:a,y2:l,width:a-o,height:l-r,centerX:o+(a-o)/2,centerY:r+(l-r)/2}}function wh(e,t){if(!dh(t)){const n=tr(e,t);let i=t.radius;(!i||isNaN(i))&&(i=Math.min(n.width,n.height)/2,t.radius=i);const s=i*2,o=n.centerX+t.xAdjust,a=n.centerY+t.yAdjust;return{x:o-i,y:a-i,x2:o+i,y2:a+i,centerX:o,centerY:a,width:s,height:s,radius:i}}return gD(e,t)}function pD(e,t){const{scales:n,chartArea:i}=e,s=n[t.scaleID],o={x:i.left,y:i.top,x2:i.right,y2:i.bottom};return s?yD(s,o,t):bD(n,o,t),o}function kh(e,t){const n=tr(e,t);return n.initProperties=Un(e,n,t),n.elements=[{type:"label",optionScope:"label",properties:wD(e,n,t),initProperties:n.initProperties}],n}function gD(e,t){const n=xh(e,t),i=t.radius*2;return{x:n.x-t.radius+t.xAdjust,y:n.y-t.radius+t.yAdjust,x2:n.x+t.radius+t.xAdjust,y2:n.y+t.radius+t.yAdjust,centerX:n.x+t.xAdjust,centerY:n.y+t.yAdjust,radius:t.radius,width:i,height:i}}function Th(e,t){const n=_h(e,t)||t;return{start:Math.min(n.start,n.end),end:Math.max(n.start,n.end)}}function yD(e,t,n){const i=Hn(e,n.value,NaN),s=Hn(e,n.endValue,i);e.isHorizontal()?(t.x=i,t.x2=s):(t.y=i,t.y2=s)}function bD(e,t,n){for(const i of Object.keys(bh)){const s=e[mn(e,n,i)];if(s){const{min:o,max:a,start:r,end:l,startProp:c,endProp:d}=bh[i],h=_h(s,{min:n[o],max:n[a],start:s[r],end:s[l]});t[c]=h.start,t[d]=h.end}}}function _D({properties:e,options:t},n,i,s){const{x:o,x2:a,width:r}=e;return vh({start:o,end:a,borderWidth:t.borderWidth},{position:i.x,padding:{start:s.left,end:s.right},adjust:t.label.xAdjust,size:n.width})}function xD({properties:e,options:t},n,i,s){const{y:o,y2:a,height:r}=e;return vh({start:o,end:a,borderWidth:t.borderWidth},{position:i.y,padding:{start:s.top,end:s.bottom},adjust:t.label.yAdjust,size:n.height})}function vh(e,t){const{start:n,end:i,borderWidth:s}=e,{position:o,padding:{start:a,end:r},adjust:l}=t,c=i-s-n-a-r-t.size;return n+s/2+l+Za(c,o)}function wD(e,t,n){const i=n.label;i.backgroundColor="transparent",i.callout.display=!1;const s=Qa(i.position),o=At(i.padding),a=Js(e.ctx,i),r=_D({properties:t,options:n},a,s,o),l=xD({properties:t,options:n},a,s,o),c=a.width+o.width,d=a.height+o.height;return{x:r,y:l,x2:r+c,y2:l+d,width:c,height:d,centerX:r+c/2,centerY:l+d/2,rotation:i.rotation}}const er=["enter","leave"],nr=er.concat("click");function kD(e,t,n){t.listened=fh(n,nr,t.listeners),t.moveListened=!1,er.forEach(i=>{Kt(n[i])&&(t.moveListened=!0)}),(!t.listened||!t.moveListened)&&t.annotations.forEach(i=>{!t.listened&&Kt(i.click)&&(t.listened=!0),t.moveListened||er.forEach(s=>{Kt(i[s])&&(t.listened=!0,t.moveListened=!0)})})}function TD(e,t,n){if(e.listened)switch(t.type){case"mousemove":case"mouseout":return vD(e,t,n);case"click":return SD(e,t,n)}}function vD(e,t,n){if(!e.moveListened)return;let i;t.type==="mousemove"?i=Ka(e.visibleElements,t,n.interaction):i=[];const s=e.hovered;e.hovered=i;const o={state:e,event:t};let a=Sh(o,"leave",s,i);return Sh(o,"enter",i,s)||a}function Sh({state:e,event:t},n,i,s){let o;for(const a of i)s.indexOf(a)<0&&(o=Mh(a.options[n]||e.listeners[n],a,t)||o);return o}function SD(e,t,n){const i=e.listeners,s=Ka(e.visibleElements,t,n.interaction);let o;for(const a of s)o=Mh(a.options.click||i.click,a,t)||o;return o}function Mh(e,t,n){return ft(e,[t.$context,n])===!0}const to=["afterDraw","beforeDraw"];function MD(e,t,n){const i=t.visibleElements;t.hooked=fh(n,to,t.hooks),t.hooked||i.forEach(s=>{t.hooked||to.forEach(o=>{Kt(s.options[o])&&(t.hooked=!0)})})}function Dh(e,t,n){if(e.hooked){const i=t.options[n]||e.hooks[n];return ft(i,[t.$context])}}function DD(e,t,n){const i=ED(e.scales,t,n);let s=Ch(t,i,"min","suggestedMin");s=Ch(t,i,"max","suggestedMax")||s,s&&Kt(t.handleTickRangeOptions)&&t.handleTickRangeOptions()}function CD(e,t){for(const n of e)AD(n,t)}function Ch(e,t,n,i){if(_t(t[n])&&!OD(e.options,n,i)){const s=e[n]!==t[n];return e[n]=t[n],s}}function OD(e,t,n){return Xt(e[t])||Xt(e[n])}function AD(e,t){for(const n of["scaleID","xScaleID","yScaleID"]){const i=mn(t,e,n);i&&!t[i]&&PD(e,n)&&console.warn(`No scale found with id '${i}' for annotation '${e.id}'`)}}function PD(e,t){if(t==="scaleID")return!0;const n=t.charAt(0);for(const i of["Min","Max","Value"])if(Xt(e[n+i]))return!0;return!1}function ED(e,t,n){const i=t.axis,s=t.id,o=i+"ScaleID",a={min:Q(t.min,Number.NEGATIVE_INFINITY),max:Q(t.max,Number.POSITIVE_INFINITY)};for(const r of n)r.scaleID===s?Oh(r,t,["value","endValue"],a):mn(e,r,o)===s&&Oh(r,t,[i+"Min",i+"Max",i+"Value"],a);return a}function Oh(e,t,n,i){for(const s of n){const o=e[s];if(Xt(o)){const a=t.parse(o);i.min=Math.min(i.min,a),i.max=Math.max(i.max,a)}}}class $n extends Yt{inRange(t,n,i,s){const{x:o,y:a}=dn({x:t,y:n},this.getCenterPoint(s),Ot(-this.options.rotation));return ih({x:o,y:a},this.getProps(["x","y","x2","y2"],s),i,this.options)}getCenterPoint(t){return fn(this,t)}draw(t){t.save(),Qs(t,this.getCenterPoint(),this.options.rotation),ph(t,this,this.options),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return kh(t,n)}}$n.id="boxAnnotation",$n.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},$n.defaultRoutes={borderColor:"color",backgroundColor:"color"},$n.descriptors={label:{_fallback:!0}};class eo extends Yt{inRange(t,n,i,s){return sh({x:t,y:n},{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 fn(this,t)}draw(t){const n=this.options;!n.display||!n.content||(zD(t,this),t.save(),Qs(t,this.getCenterPoint(),this.rotation),gh(t,this,n,this._fitRatio),t.restore())}resolveElementProperties(t,n){const i=RD(t,n);if(!i)return{};const{controllerMeta:s,point:o,radius:a}=LD(t,n,i);let r=Js(t.ctx,n);const l=ND(r,a);ch(n,l)&&(r={width:r.width*l,height:r.height*l});const{position:c,xAdjust:d,yAdjust:h}=n,f=lh(o,r,{borderWidth:0,position:c,xAdjust:d,yAdjust:h});return{initProperties:Un(t,f,n),...f,...s,rotation:n.rotation,_fitRatio:l}}}eo.id="doughnutLabelAnnotation",eo.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},eo.defaultRoutes={};function RD(e,t){return e.getSortedVisibleDatasetMetas().reduce(function(n,i){const s=i.controller;return s instanceof ki&&ID(e,t,i.data)&&(!n||s.innerRadius<n.controller.innerRadius)&&s.options.circumference>=90?i:n},void 0)}function ID(e,t,n){if(!t.autoHide)return!0;for(let i=0;i<n.length;i++)if(!n[i].hidden&&e.getDataVisibility(i))return!0}function LD({chartArea:e},t,n){const{left:i,top:s,right:o,bottom:a}=e,{innerRadius:r,offsetX:l,offsetY:c}=n.controller,d=(i+o)/2+l,h=(s+a)/2+c,f={left:Math.max(d-r,i),right:Math.min(d+r,o),top:Math.max(h-r,s),bottom:Math.min(h+r,a)},m={x:(f.left+f.right)/2,y:(f.top+f.bottom)/2},p=t.spacing+t.borderWidth/2,g=r-p,y=m.y>h,_=y?s+p:a-p,x=BD(_,d,h,g);return{controllerMeta:{_centerX:d,_centerY:h,_radius:g,_counterclockwise:y,...x},point:m,radius:Math.min(r,Math.min(f.right-f.left,f.bottom-f.top)/2)}}function ND({width:e,height:t},n){const i=Math.sqrt(Math.pow(e,2)+Math.pow(t,2));return n*2/i}function BD(e,t,n,i){const s=Math.pow(n-e,2),o=Math.pow(i,2),a=t*-2,r=Math.pow(t,2)+s-o,l=Math.pow(a,2)-4*r;if(l<=0)return{_startAngle:0,_endAngle:gt};const c=(-a-Math.sqrt(l))/2,d=(-a+Math.sqrt(l))/2;return{_startAngle:ys({x:t,y:n},{x:c,y:e}).angle,_endAngle:ys({x:t,y:n},{x:d,y:e}).angle}}function zD(e,t){const{_centerX:n,_centerY:i,_radius:s,_startAngle:o,_endAngle:a,_counterclockwise:r,options:l}=t;e.save();const c=ve(e,l);e.fillStyle=l.backgroundColor,e.beginPath(),e.arc(n,i,s,o,a,r),e.closePath(),e.fill(),c&&e.stroke(),e.restore()}class Ui extends Yt{inRange(t,n,i,s){return sh({x:t,y:n},{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 fn(this,t)}draw(t){const n=this.options,i=!Xt(this._visible)||this._visible;!n.display||!n.content||!i||(t.save(),Qs(t,this.getCenterPoint(),this.rotation),rD(t,this),ph(t,this,n),gh(t,FD(this),n),t.restore())}resolveElementProperties(t,n){let i;if(dh(n))i=xh(t,n);else{const{centerX:r,centerY:l}=tr(t,n);i={x:r,y:l}}const s=At(n.padding),o=Js(t.ctx,n),a=lh(i,o,n,s);return{initProperties:Un(t,a,n),pointX:i.x,pointY:i.y,...a,rotation:n.rotation}}}Ui.id="labelAnnotation",Ui.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},Ui.defaultRoutes={borderColor:"color"};function FD({x:e,y:t,width:n,height:i,options:s}){const o=s.borderWidth/2,a=At(s.padding);return{x:e+a.left+o,y:t+a.top+o,width:n-a.left-a.right-s.borderWidth,height:i-a.top-a.bottom-s.borderWidth}}const ir=(e,t,n)=>({x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}),sr=(e,t,n)=>ir(t,n,Math.abs((e-t.y)/(n.y-t.y))).x,Ah=(e,t,n)=>ir(t,n,Math.abs((e-t.x)/(n.x-t.x))).y,Vi=e=>e*e,UD=(e,t,{x:n,y:i,x2:s,y2:o},a)=>a==="y"?{start:Math.min(i,o),end:Math.max(i,o),value:t}:{start:Math.min(n,s),end:Math.max(n,s),value:e},Ph=(e,t,n,i)=>(1-i)*(1-i)*e+2*(1-i)*i*t+i*i*n,or=(e,t,n,i)=>({x:Ph(e.x,t.x,n.x,i),y:Ph(e.y,t.y,n.y,i)}),Eh=(e,t,n,i)=>2*(1-i)*(t-e)+2*i*(n-t),Rh=(e,t,n,i)=>-Math.atan2(Eh(e.x,t.x,n.x,i),Eh(e.y,t.y,n.y,i))+.5*tt;class Hi extends Yt{inRange(t,n,i,s){const o=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y"){const a={mouseX:t,mouseY:n},{path:r,ctx:l}=this;if(r){ve(l,this.options),l.lineWidth+=this.options.hitTolerance;const{chart:d}=this.$context,h=t*d.currentDevicePixelRatio,f=n*d.currentDevicePixelRatio,m=l.isPointInStroke(r,h,f)||ar(this,a,s);return l.restore(),m}const c=Vi(o);return YD(this,a,c,s)||ar(this,a,s)}return VD(this,{mouseX:t,mouseY:n},i,{hitSize:o,useFinalPosition:s})}getCenterPoint(t){return fn(this,t)}draw(t){const{x:n,y:i,x2:s,y2:o,cp:a,options:r}=this;if(t.save(),!ve(t,r))return t.restore();Vn(t,r);const l=Math.sqrt(Math.pow(s-n,2)+Math.pow(o-i,2));if(r.curve&&a)return QD(t,this,a,l),t.restore();const{startOpts:c,endOpts:d,startAdjust:h,endAdjust:f}=zh(this),m=Math.atan2(o-i,s-n);t.translate(n,i),t.rotate(m),t.beginPath(),t.moveTo(0+h,0),t.lineTo(l-f,0),t.shadowColor=r.borderShadowColor,t.stroke(),rr(t,0,h,c),rr(t,l,-f,d),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){const i=pD(t,n),{x:s,y:o,x2:a,y2:r}=i,l=HD(i,t.chartArea),c=l?$D({x:s,y:o},{x:a,y:r},t.chartArea):{x:s,y:o,x2:a,y2:r,width:Math.abs(a-s),height:Math.abs(r-o)};if(c.centerX=(a+s)/2,c.centerY=(r+o)/2,c.initProperties=Un(t,c,n),n.curve){const h={x:c.x,y:c.y},f={x:c.x2,y:c.y2};c.cp=ZD(c,n,Cn(h,f))}const d=WD(t,c,n.label);return d._visible=l,c.elements=[{type:"label",optionScope:"label",properties:d,initProperties:c.initProperties}],c}}Hi.id="lineAnnotation";const Ih={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};Hi.defaults={adjustScaleRange:!0,arrowHeads:{display:!1,end:Object.assign({},Ih),fill:!1,length:12,start:Object.assign({},Ih),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({},Ui.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},Hi.descriptors={arrowHeads:{start:{_fallback:!0},end:{_fallback:!0},_fallback:!0}},Hi.defaultRoutes={borderColor:"color"};function VD(e,{mouseX:t,mouseY:n},i,{hitSize:s,useFinalPosition:o}){const a=UD(t,n,e.getProps(["x","y","x2","y2"],o),i);return nh(a,s)||ar(e,{mouseX:t,mouseY:n},o,i)}function HD({x:e,y:t,x2:n,y2:i},{top:s,right:o,bottom:a,left:r}){return!(e<r&&n<r||e>o&&n>o||t<s&&i<s||t>a&&i>a)}function Lh({x:e,y:t},n,{top:i,right:s,bottom:o,left:a}){return e<a&&(t=Ah(a,{x:e,y:t},n),e=a),e>s&&(t=Ah(s,{x:e,y:t},n),e=s),t<i&&(e=sr(i,{x:e,y:t},n),t=i),t>o&&(e=sr(o,{x:e,y:t},n),t=o),{x:e,y:t}}function $D(e,t,n){const{x:i,y:s}=Lh(e,t,n),{x:o,y:a}=Lh(t,e,n);return{x:i,y:s,x2:o,y2:a,width:Math.abs(o-i),height:Math.abs(a-s)}}function YD(e,{mouseX:t,mouseY:n},i=hn,s){const{x:o,y:a,x2:r,y2:l}=e.getProps(["x","y","x2","y2"],s),c=r-o,d=l-a,h=Vi(c)+Vi(d),f=h===0?-1:((t-o)*c+(n-a)*d)/h;let m,p;return f<0?(m=o,p=a):f>1?(m=r,p=l):(m=o+f*c,p=a+f*d),Vi(t-m)+Vi(n-p)<=i}function ar(e,{mouseX:t,mouseY:n},i,s){const o=e.label;return o.options.display&&o.inRange(t,n,s,i)}function WD(e,t,n){const i=n.borderWidth,s=At(n.padding),o=Js(e.ctx,n),a=o.width+s.width+i,r=o.height+s.height+i;return qD(t,n,{width:a,height:r,padding:s},e.chartArea)}function jD(e){const{x:t,y:n,x2:i,y2:s}=e,o=Math.atan2(s-n,i-t);return o>tt/2?o-tt:o<tt/-2?o+tt:o}function qD(e,t,n,i){const{width:s,height:o,padding:a}=n,{xAdjust:r,yAdjust:l}=t,c={x:e.x,y:e.y},d={x:e.x2,y:e.y2},h=t.rotation==="auto"?jD(e):Ot(t.rotation),f=GD(s,o,h),m=XD(e,t,{labelSize:f,padding:a},i),p=e.cp?or(c,e.cp,d,m):ir(c,d,m),g={size:f.w,min:i.left,max:i.right,padding:a.left},y={size:f.h,min:i.top,max:i.bottom,padding:a.top},_=Bh(p.x,g)+r,x=Bh(p.y,y)+l;return{x:_-s/2,y:x-o/2,x2:_+s/2,y2:x+o/2,centerX:_,centerY:x,pointX:p.x,pointY:p.y,width:s,height:o,rotation:gs(h)}}function GD(e,t,n){const i=Math.cos(n),s=Math.sin(n);return{w:Math.abs(e*i)+Math.abs(t*s),h:Math.abs(e*s)+Math.abs(t*i)}}function XD(e,t,n,i){let s;const o=KD(e,i);return t.position==="start"?s=Nh({w:e.x2-e.x,h:e.y2-e.y},n,t,o):t.position==="end"?s=1-Nh({w:e.x-e.x2,h:e.y-e.y2},n,t,o):s=Za(1,t.position),s}function Nh(e,t,n,i){const{labelSize:s,padding:o}=t,a=e.w*i.dx,r=e.h*i.dy,l=a>0&&(s.w/2+o.left-i.x)/a,c=r>0&&(s.h/2+o.top-i.y)/r;return Ks(Math.max(l,c),0,.25)}function KD(e,t){const{x:n,x2:i,y:s,y2:o}=e,a=Math.min(s,o)-t.top,r=Math.min(n,i)-t.left,l=t.bottom-Math.max(s,o),c=t.right-Math.max(n,i);return{x:Math.min(r,c),y:Math.min(a,l),dx:r<=c?1:-1,dy:a<=l?1:-1}}function Bh(e,t){const{size:n,min:i,max:s,padding:o}=t,a=n/2;return n>s-i?(s+i)/2:(i>=e-o-a&&(e=i+o+a),s<=e+o+a&&(e=s-o-a),e)}function zh(e){const t=e.options,n=t.arrowHeads&&t.arrowHeads.start,i=t.arrowHeads&&t.arrowHeads.end;return{startOpts:n,endOpts:i,startAdjust:Fh(e,n),endAdjust:Fh(e,i)}}function Fh(e,t){if(!t||!t.display)return 0;const{length:n,width:i}=t,s=e.options.borderWidth/2,o={x:n,y:i+s};return Math.abs(sr(0,o,{x:0,y:s}))}function rr(e,t,n,i){if(!i||!i.display)return;const{length:s,width:o,fill:a,backgroundColor:r,borderColor:l}=i,c=Math.abs(t-s)+n;e.beginPath(),Vn(e,i),ve(e,i),e.moveTo(c,-o),e.lineTo(t+n,0),e.lineTo(c,o),a===!0?(e.fillStyle=r||l,e.closePath(),e.fill(),e.shadowColor="transparent"):e.shadowColor=i.borderShadowColor,e.stroke()}function ZD(e,t,n){const{x:i,y:s,x2:o,y2:a,centerX:r,centerY:l}=e,c=Math.atan2(a-s,o-i),d=Qa(t.controlPoint,0),h={x:r+$e(n,d.x,!1),y:l+$e(n,d.y,!1)};return dn(h,{x:r,y:l},c)}function Uh(e,{x:t,y:n},{angle:i,adjust:s},o){!o||!o.display||(e.save(),e.translate(t,n),e.rotate(i),rr(e,0,-s,o),e.restore())}function QD(e,t,n,i){const{x:s,y:o,x2:a,y2:r,options:l}=t,{startOpts:c,endOpts:d,startAdjust:h,endAdjust:f}=zh(t),m={x:s,y:o},p={x:a,y:r},g=Rh(m,n,p,0),y=Rh(m,n,p,1)-tt,_=or(m,n,p,h/i),x=or(m,n,p,1-f/i),T=new Path2D;e.beginPath(),T.moveTo(_.x,_.y),T.quadraticCurveTo(n.x,n.y,x.x,x.y),e.shadowColor=l.borderShadowColor,e.stroke(T),t.path=T,t.ctx=e,Uh(e,_,{angle:g,adjust:h},c),Uh(e,x,{angle:y,adjust:f},d)}class $i extends Yt{inRange(t,n,i,s){const o=this.options.rotation,a=(this.options.borderWidth+this.options.hitTolerance)/2;if(i!=="x"&&i!=="y")return JD({x:t,y:n},this.getProps(["width","height","centerX","centerY"],s),o,a);const{x:r,y:l,x2:c,y2:d}=this.getProps(["x","y","x2","y2"],s),h=i==="y"?{start:l,end:d}:{start:r,end:c},f=dn({x:t,y:n},this.getCenterPoint(s),Ot(-o));return f[i]>=h.start-a-hn&&f[i]<=h.end+a+hn}getCenterPoint(t){return fn(this,t)}draw(t){const{width:n,height:i,centerX:s,centerY:o,options:a}=this;t.save(),Qs(t,this.getCenterPoint(),a.rotation),Vn(t,this.options),t.beginPath(),t.fillStyle=a.backgroundColor;const r=ve(t,a);t.ellipse(s,o,i/2,n/2,tt/2,0,2*tt),t.fill(),r&&(t.shadowColor=a.borderShadowColor,t.stroke()),t.restore()}get label(){return this.elements&&this.elements[0]}resolveElementProperties(t,n){return kh(t,n)}}$i.id="ellipseAnnotation",$i.defaults={adjustScaleRange:!0,backgroundShadowColor:"transparent",borderDash:[],borderDashOffset:0,borderShadowColor:"transparent",borderWidth:1,display:!0,hitTolerance:0,init:void 0,label:Object.assign({},$n.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},$i.defaultRoutes={borderColor:"color",backgroundColor:"color"},$i.descriptors={label:{_fallback:!0}};function JD(e,t,n,i){const{width:s,height:o,centerX:a,centerY:r}=t,l=s/2,c=o/2;if(l<=0||c<=0)return!1;const d=Ot(n||0),h=Math.cos(d),f=Math.sin(d),m=Math.pow(h*(e.x-a)+f*(e.y-r),2),p=Math.pow(f*(e.x-a)-h*(e.y-r),2);return m/Math.pow(l+i,2)+p/Math.pow(c+i,2)<=1.0001}class no extends Yt{inRange(t,n,i,s){const{x:o,y:a,x2:r,y2:l,width:c}=this.getProps(["x","y","x2","y2","width"],s),d=(this.options.borderWidth+this.options.hitTolerance)/2;return i!=="x"&&i!=="y"?qM({x:t,y:n},this.getCenterPoint(s),c/2,d):nh(i==="y"?{start:a,end:l,value:n}:{start:o,end:r,value:t},d)}getCenterPoint(t){return fn(this,t)}draw(t){const n=this.options,i=n.borderWidth;if(n.radius<.1)return;t.save(),t.fillStyle=n.backgroundColor,Vn(t,n);const s=ve(t,n);eD(t,this,this.centerX,this.centerY),s&&!Zs(n.pointStyle)&&(t.shadowColor=n.borderShadowColor,t.stroke()),t.restore(),n.borderWidth=i}resolveElementProperties(t,n){const i=wh(t,n);return i.initProperties=Un(t,i,n),i}}no.id="pointAnnotation",no.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},no.defaultRoutes={borderColor:"color",backgroundColor:"color"};class io extends Yt{inRange(t,n,i,s){if(i!=="x"&&i!=="y")return this.options.radius>=.1&&this.elements.length>1&&eC(this.elements,t,n,s);const o=dn({x:t,y:n},this.getCenterPoint(s),Ot(-this.options.rotation)),a=this.elements.map(c=>i==="y"?c.bY:c.bX),r=Math.min(...a),l=Math.max(...a);return o[i]>=r&&o[i]<=l}getCenterPoint(t){return fn(this,t)}draw(t){const{elements:n,options:i}=this;t.save(),t.beginPath(),t.fillStyle=i.backgroundColor,Vn(t,i);const s=ve(t,i);let o=!0;for(const a of n)o?(t.moveTo(a.x,a.y),o=!1):t.lineTo(a.x,a.y);t.closePath(),t.fill(),s&&(t.shadowColor=i.borderShadowColor,t.stroke()),t.restore()}resolveElementProperties(t,n){const i=wh(t,n),{sides:s,rotation:o}=n,a=[],r=2*tt/s;let l=o*qo;for(let c=0;c<s;c++,l+=r){const d=tC(i,n,l);d.initProperties=Un(t,i,n),a.push(d)}return i.elements=a,i}}io.id="polygonAnnotation",io.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},io.defaultRoutes={borderColor:"color",backgroundColor:"color"};function tC({centerX:e,centerY:t},{radius:n,borderWidth:i,hitTolerance:s},o){const a=(i+s)/2,r=Math.sin(o),l=Math.cos(o),c={x:e+r*n,y:t-l*n};return{type:"point",optionScope:"point",properties:{x:c.x,y:c.y,centerX:c.x,centerY:c.y,bX:e+r*(n+a),bY:t-l*(n+a)}}}function eC(e,t,n,i){let s=!1,o=e[e.length-1].getProps(["bX","bY"],i);for(const a of e){const r=a.getProps(["bX","bY"],i);r.bY>n!=o.bY>n&&t<(o.bX-r.bX)*(n-r.bY)/(o.bY-r.bY)+r.bX&&(s=!s),o=r}return s}const Ye={box:$n,doughnutLabel:eo,ellipse:$i,label:Ui,line:Hi,point:no,polygon:io};Object.keys(Ye).forEach(e=>{bt.describe(`elements.${Ye[e].id}`,{_fallback:"plugins.annotation.common"})});const nC={update:Object.assign},iC=nr.concat(to),Vh=(e,t)=>et(t)?ur(e,t):e,lr=e=>e==="color"||e==="font";function cr(e="line"){return Ye[e]?e:(console.warn(`Unknown annotation type: '${e}', defaulting to 'line'`),"line")}function sC(e,t,n,i){const s=aC(e,n.animations,i),o=t.annotations,a=cC(t.elements,o);for(let r=0;r<o.length;r++){const l=o[r],c=Hh(a,r,l.type),d=l.setContext(lC(e,c,a,l)),h=c.resolveElementProperties(e,d);h.skip=oC(h),"elements"in h&&(rC(c,h.elements,d,s),delete h.elements),Xt(c.x)||Object.assign(c,h),Object.assign(c,h.initProperties),h.options=$h(d),s.update(c,h)}}function oC(e){return isNaN(e.x)||isNaN(e.y)}function aC(e,t,n){return n==="reset"||n==="none"||n==="resize"?nC:new ra(e,t)}function rC(e,t,n,i){const s=e.elements||(e.elements=[]);s.length=t.length;for(let o=0;o<t.length;o++){const a=t[o],r=a.properties,l=Hh(s,o,a.type,a.initProperties),c=n[a.optionScope].override(a);r.options=$h(c),i.update(l,r)}}function Hh(e,t,n,i){const s=Ye[cr(n)];let o=e[t];return(!o||!(o instanceof s))&&(o=e[t]=new s,Object.assign(o,i)),o}function $h(e){const t=Ye[cr(e.type)],n={};n.id=e.id,n.type=e.type,n.drawTime=e.drawTime,Object.assign(n,ur(e,t.defaults),ur(e,t.defaultRoutes));for(const i of iC)n[i]=e[i];return n}function ur(e,t){const n={};for(const i of Object.keys(t)){const s=t[i],o=e[i];lr(i)&&ut(o)?n[i]=o.map(a=>Vh(a,s)):n[i]=Vh(o,s)}return n}function lC(e,t,n,i){return t.$context||(t.$context=Object.assign(Object.create(e.getContext()),{element:t,get elements(){return n.filter(s=>s&&s.options)},id:i.id,type:"annotation"}))}function cC(e,t){const n=t.length,i=e.length;if(i<n){const s=n-i;e.splice(i,0,...new Array(s))}else i>n&&e.splice(n,i-n);return e}var uC="3.1.0";const We=new Map,Yh=e=>e.type!=="doughnutLabel",dC=nr.concat(to);var Wh={id:"annotation",version:uC,beforeRegister(){GM("chart.js","4.0",Zt.version)},afterRegister(){Zt.register(Ye)},afterUnregister(){Zt.unregister(Ye)},beforeInit(e){We.set(e,{annotations:[],elements:[],visibleElements:[],listeners:{},listened:!1,moveListened:!1,hooks:{},hooked:!1,hovered:[]})},beforeUpdate(e,t,n){const i=We.get(e),s=i.annotations=[];let o=n.annotations;et(o)?Object.keys(o).forEach(a=>{const r=o[a];et(r)&&(r.id=a,s.push(r))}):ut(o)&&s.push(...o),CD(s.filter(Yh),e.scales)},afterDataLimits(e,t){const n=We.get(e);DD(e,t.scale,n.annotations.filter(Yh).filter(i=>i.display&&i.adjustScaleRange))},afterUpdate(e,t,n){const i=We.get(e);kD(e,i,n),sC(e,i,n,t.mode),i.visibleElements=i.elements.filter(s=>!s.skip&&s.options.display),MD(e,i,n)},beforeDatasetsDraw(e,t,n){Yi(e,"beforeDatasetsDraw",n.clip)},afterDatasetsDraw(e,t,n){Yi(e,"afterDatasetsDraw",n.clip)},beforeDatasetDraw(e,t,n){Yi(e,t.index,n.clip)},beforeDraw(e,t,n){Yi(e,"beforeDraw",n.clip)},afterDraw(e,t,n){Yi(e,"afterDraw",n.clip)},beforeEvent(e,t,n){const i=We.get(e);TD(i,t.event,n)&&(t.changed=!0)},afterDestroy(e){We.delete(e)},getAnnotations(e){const t=We.get(e);return t?t.elements:[]},_getAnnotationElementsAtEventForMode(e,t,n){return Ka(e,t,n)},defaults:{animations:{numbers:{properties:["x","y","x2","y2","width","height","centerX","centerY","pointX","pointY","radius"],type:"number"},colors:{properties:["backgroundColor","borderColor"],type:"color"}},clip:!0,interaction:{mode:void 0,axis:void 0,intersect:void 0},common:{drawTime:"afterDatasetsDraw",init:!1,label:{}}},descriptors:{_indexable:!1,_scriptable:e=>!dC.includes(e)&&e!=="init",annotations:{_allKeys:!1,_fallback:(e,t)=>`elements.${Ye[cr(t.type)].id}`},interaction:{_fallback:!0},common:{label:{_indexable:lr,_fallback:!0},_indexable:lr}},additionalOptionScopes:[""]};function Yi(e,t,n){const{ctx:i,chartArea:s}=e,o=We.get(e);n&&bi(i,s);const a=hC(o.visibleElements,t).sort((r,l)=>r.element.options.z-l.element.options.z);for(const r of a)fC(i,s,o,r);n&&_i(i)}function hC(e,t){const n=[];for(const i of e)if(i.options.drawTime===t&&n.push({element:i,main:!0}),i.elements&&i.elements.length)for(const s of i.elements)s.options.display&&s.options.drawTime===t&&n.push({element:s});return n}function fC(e,t,n,i){const s=i.element;i.main?(Dh(n,s,"beforeDraw"),s.draw(e,t),Dh(n,s,"afterDraw")):s.draw(e,t)}const mC={class:"zoom-timerange-container"},pC={class:"zoom-timerange-details"},gC={class:"label","data-testid":"zoom-timerange-from"},yC={class:"label","data-testid":"zoom-timerange-to"},bC=u.defineComponent({__name:"ZoomTimerange",props:{start:{},end:{},granularity:{}},setup(e){const t=e,{i18n:n}=K.useI18n(),i=u.ref(Fn({tickValue:t.start,granularity:t.granularity})),s=u.ref(Fn({tickValue:t.end,granularity:t.granularity})),o=(a,r)=>{Od(()=>{i.value=Fn({tickValue:a,granularity:t.granularity}),s.value=Fn({tickValue:r,granularity:t.granularity})},100)()};return u.watch(()=>[t.start,t.end],([a,r])=>{o(a,r)},{immediate:!0}),(a,r)=>(u.openBlock(),u.createElementBlock("div",mC,[u.createElementVNode("div",pC,[u.createElementVNode("div",gC,u.toDisplayString(u.unref(n).t("zoom_time_range.from")),1),u.createElementVNode("div",null,u.toDisplayString(i.value),1),u.createElementVNode("div",yC,u.toDisplayString(u.unref(n).t("zoom_time_range.to")),1),u.createElementVNode("div",null,u.toDisplayString(s.value),1)])]))}}),Et=(e,t)=>{const n=e.__vccOpts||e;for(const[i,s]of t)n[i]=s;return n},jh=Et(bC,[["__scopeId","data-v-4fa681cf"]]),_C={class:"zoom-actions-container"},xC={class:"zoom-actions-heading"},wC={class:"zoom-action-select"},kC=["data-testid"],TC=["aria-disabled","href"],vC=["onClick"],SC=Et(u.defineComponent({__name:"ZoomActions",props:{zoomActionItems:{},newTimeRange:{},granularity:{}},emits:["onAction"],setup(e,{emit:t}){const n=e,i=t,s=o=>{o.action&&(o.action(n.newTimeRange),i("onAction"))};return(o,a)=>(u.openBlock(),u.createElementBlock("div",_C,[u.createElementVNode("div",xC,[u.createVNode(jh,{end:e.newTimeRange.end,granularity:e.granularity,start:e.newTimeRange.start},null,8,["end","granularity","start"]),u.createVNode(u.unref(kt.CloseIcon),{class:"zoom-actions-close-icon",color:`var(--kui-color-text-neutral, ${u.unref(dl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`,onClick:a[0]||(a[0]=r=>o.$emit("onAction"))},null,8,["color","size"])]),a[2]||(a[2]=u.createElementVNode("div",{class:"zoom-actions-heading-divider"},null,-1)),u.createElementVNode("div",wC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.zoomActionItems,r=>(u.openBlock(),u.createElementBlock("div",{key:r.key,class:u.normalizeClass(["zoom-action-item",{disabled:r.disabled}]),"data-testid":`zoom-action-item-${r.key}`},[r.href?(u.openBlock(),u.createElementBlock("a",{key:0,"aria-disabled":r.disabled,class:"zoom-action-link",href:r.href,onClick:a[1]||(a[1]=l=>o.$emit("onAction"))},u.toDisplayString(r.label),9,TC)):(u.openBlock(),u.createElementBlock("div",{key:1,onClick:l=>s(r)},u.toDisplayString(r.label),9,vC))],10,kC))),128))])]))}}),[["__scopeId","data-v-79ba72f8"]]),MC={key:2},DC={class:"tooltip-title"},CC={class:"title"},OC={key:0,class:"subtitle"},AC={class:"context"},PC={class:"metric"},EC={class:"tooltip"},RC={key:0,class:"square-marker marker-placeholder"},IC={class:"display-value"},Wi=Et(u.defineComponent({__name:"ChartTooltip",props:{state:{},tooltipTitle:{default:""},absoluteLeft:{default:"0px"},absoluteTop:{default:"0px"},zoomTimeRange:{default:void 0},zoomActionItems:{default:void 0},granularity:{default:void 0}},emits:["dimensions","onAction"],setup(e,{emit:t}){const n=t,i=e,s=u.ref(null),{x:o,y:a,isDragging:r}=S1(s,{initialValue:{x:parseFloat(i.absoluteLeft),y:parseFloat(i.absoluteTop)}}),l=u.computed(()=>`${a.value}px`),c=u.computed(()=>`${o.value}px`),d=u.computed(()=>i.state.tooltipContext),h=u.computed(()=>i.state.metricDisplay),f=u.computed(()=>["interactive","zoom-interactive"].includes(i.state.interactionMode));return u.watch(()=>[i.absoluteLeft,i.absoluteTop],([m,p])=>{r.value||(o.value=parseFloat(m),a.value=parseFloat(p))}),u.watch(r,m=>{m?document.body.classList.add("no-select"):document.body.classList.remove("no-select")}),u.watch(s,m=>{if(m){const{width:p,height:g}=m.getBoundingClientRect();n("dimensions",{width:p,height:g})}}),(m,p)=>e.state.showTooltip?(u.openBlock(),u.createElementBlock("div",{key:0,ref_key:"tooltipEl",ref:s,class:u.normalizeClass(["tooltip-container",{locked:e.state.interactionMode==="interactive"}]),style:u.normalizeStyle({transform:f.value?`translate(${c.value}, ${l.value})`:`translate(${e.absoluteLeft}, ${e.absoluteTop})`,left:"0",top:"0",pointerEvents:f.value?"all":"none"})},[e.state.interactionMode==="selecting-chart-area"&&e.granularity&&e.zoomTimeRange&&e.zoomTimeRange.end&&e.zoomTimeRange.start?(u.openBlock(),u.createBlock(jh,{key:0,end:e.zoomTimeRange?.end,granularity:e.granularity,start:e.zoomTimeRange?.start},null,8,["end","granularity","start"])):e.state.interactionMode==="zoom-interactive"&&e.zoomTimeRange&&e.zoomActionItems&&e.granularity?(u.openBlock(),u.createBlock(SC,{key:1,granularity:e.granularity,"new-time-range":e.zoomTimeRange,"zoom-action-items":e.zoomActionItems,onOnAction:p[0]||(p[0]=g=>n("onAction"))},null,8,["granularity","new-time-range","zoom-action-items"])):(u.openBlock(),u.createElementBlock("div",MC,[u.createElementVNode("div",DC,[u.createElementVNode("div",CC,[u.createElementVNode("div",null,u.toDisplayString(e.tooltipTitle),1),f.value?(u.openBlock(),u.createBlock(u.unref(kt.DragIcon),{key:0,class:"drag-icon",color:`var(--kui-color-text-neutral, ${u.unref(dl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])):u.createCommentVNode("",!0)]),d.value||h.value?(u.openBlock(),u.createElementBlock("div",OC,[u.createElementVNode("div",AC,u.toDisplayString(d.value),1),u.createElementVNode("div",PC,u.toDisplayString(h.value),1)])):u.createCommentVNode("",!0)]),u.createElementVNode("ul",EC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.state.tooltipSeries,({backgroundColor:g,borderColor:y,label:_,value:x,isSegmentEmpty:T,isExtra:k},w)=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:_+w},[e.state.tooltipSeries.length?(u.openBlock(),u.createElementBlock("li",{key:0,class:u.normalizeClass({"extra-row":k})},[k?(u.openBlock(),u.createElementBlock("div",RC)):(u.openBlock(),u.createElementBlock("div",{key:1,class:"square-marker",style:u.normalizeStyle({background:String(g),borderColor:String(y)})},null,4)),u.createElementVNode("span",{class:u.normalizeClass(["display-label",{empty:T}])},u.toDisplayString(_),3),u.createElementVNode("span",IC,u.toDisplayString(x),1)],2)):u.createCommentVNode("",!0)],64))),128))])]))],6)):u.createCommentVNode("",!0)}}),[["__scopeId","data-v-fb2f2a72"]]),LC={key:0,class:"legend-container","data-testid":"legend"},NC=["onClick"],BC={key:0,"aria-hidden":"true",class:"line-marker",height:"2",width:"16"},zC=["stroke","stroke-dasharray"],FC=["title"],UC={class:"label truncate-label"},VC={key:0,class:"sub-label"},HC={key:0},$C={class:"tooltip-content"},so=Et(u.defineComponent({__name:"ChartLegend",props:{id:{type:String,required:!0},items:{type:Object,required:!0},chartInstance:{type:Object,required:!1,default:()=>null}},setup(e){const t=e,{i18n:n}=K.useI18n(),i=u.inject("showLegendValues",!1),s=u.inject("legendPosition",u.ref(Lt.Bottom)),o=({datasetIndex:l,index:c,isKey:d},h)=>d?`key-${h}`:`dataset-${l??0}-${c??0}`,a=(l=0,c)=>{if(t.chartInstance===null)return;const d=t.chartInstance instanceof Zt?t.chartInstance:t.chartInstance.chart,h=r(l,c);!d.getDatasetMeta(l).dataset&&c!==void 0?d.toggleDataVisibility(c):h?d.hide(l,c):d.show(l,c),d.update()},r=(l=0,c)=>{if(t.chartInstance===null||t.chartInstance.chart===null)return!0;const d=t.chartInstance instanceof Zt?t.chartInstance:t.chartInstance.chart;return d.getDatasetMeta(l).dataset||c===void 0?d.isDatasetVisible(l):d.getDataVisibility(c)};return(l,c)=>{const d=u.resolveComponent("KTooltip");return u.unref(s)!==u.unref(Lt).Hidden?(u.openBlock(),u.createElementBlock("ul",LC,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.items,({fillStyle:h,strokeStyle:f,text:m,datasetIndex:p,index:g,value:y,isSegmentEmpty:_,isKey:x,lineDash:T},k)=>(u.openBlock(),u.createElementBlock("li",{key:o({datasetIndex:p,index:g,isKey:x},k),class:u.normalizeClass({"legend-key":x}),onClick:w=>x?void 0:a(p,g)},[T?.length?(u.openBlock(),u.createElementBlock("svg",BC,[u.createElementVNode("line",{stroke:f,"stroke-dasharray":T.join(" "),"stroke-width":"2",x1:"0",x2:"16",y1:"1",y2:"1"},null,8,zC)])):(u.openBlock(),u.createElementBlock("div",{key:1,class:"square-marker",style:u.normalizeStyle({background:h,"border-color":f})},null,4)),u.createVNode(d,null,u.createSlots({default:u.withCtx(()=>[u.createElementVNode("div",{class:u.normalizeClass(["label-container",{"strike-through":!x&&!r(p,g),"inline-value":x}]),title:y&&(u.unref(i)||x)?`${m}: ${y.formatted}`:m},[u.createElementVNode("div",UC,u.toDisplayString(m),1),y&&(u.unref(i)||x)?(u.openBlock(),u.createElementBlock("div",VC,[x?(u.openBlock(),u.createElementBlock("span",HC,"-")):u.createCommentVNode("",!0),u.createTextVNode(" "+u.toDisplayString(y.formatted),1)])):u.createCommentVNode("",!0)],10,FC)]),_:2},[_?{name:"content",fn:u.withCtx(()=>[u.createElementVNode("div",$C,u.toDisplayString(u.unref(n).t("emptyEntityInfo")),1)]),key:"0"}:void 0]),1024)],10,NC))),128))])):u.createCommentVNode("",!0)}}}),[["__scopeId","data-v-90ef4d12"]]),Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function YC(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}const WC=new Uint8Array(16);function jC(){return crypto.getRandomValues(WC)}function dr(e,t,n){return crypto.randomUUID?crypto.randomUUID():qC(e)}function qC(e,t,n){e=e||{};const i=e.random??e.rng?.()??jC();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,YC(i)}const qh=(e,t)=>{const n=e.ctx,i=e.scales.y,s=e.scales.x,o=t[t.length-1].element;n.save(),n.strokeStyle="rgba(100, 100, 100, 1)",n.lineWidth=3,e.options.indexAxis==="x"?n.strokeRect(o.x-o.width/2,o.y,o.width,i.bottom-o.y):n.strokeRect(s.left,o.y-o.height/2,o.x-s.left,o.height),n.restore()};class Gh{id="highlightPlugin";_clickedElements;_previousHoverOption;_clicked=!1;_pause=!1;_suppressNextClick=!1;afterDatasetsDraw(t){this._clickedElements&&this._clickedElements.length&&!this._pause&&qh(t,this._clickedElements)}afterEvent(t,{event:n}){if(n.type==="click"&&this._suppressNextClick){this._suppressNextClick=!1;return}if(n.type!=="click"||!n.native||this._pause)return;this._clicked=!this._clicked;const i=t.options.interaction?.mode||"index",s=t.getElementsAtEventForMode(n.native,i,{intersect:!1},!0);s.length&&this._clicked?(this._clickedElements=s,qh(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 GC=(e,t,n,i,s="#0275d8")=>{e&&(e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore())};class oo{id="coordinator";coordinator=void 0;instanceId="";stopWatcher=void 0;activeDimension=null;activeDimensionValue=null;requiresUpdate=!1;triggerOnSelf=!1;watchTimestamp=!1;watchDimension=!1;lastMouseBrushEvent=0;constructor({coordinator:t,requiresUpdate:n=!1,triggerOnSelf:i=!1,watchTimestamp:s=!1,watchDimension:o=!1}){this.instanceId=crypto.randomUUID(),this.coordinator=t,this.requiresUpdate=n,this.triggerOnSelf=i,this.watchTimestamp=s,this.watchDimension=o}afterInit(t){if(!this.coordinator)return;const n=this.requiresUpdate?()=>t.update("none"):()=>t.draw(),i=this._watchTimestamp(n),s=this._watchDimension(n);this.stopWatcher=()=>{i&&i(),s&&s()}}afterEvent(t,{event:n}){this.coordinator&&(n.type==="mousemove"||n.type==="mouseout")&&requestAnimationFrame(i=>this._onMouseBrush(n.native,t,i))}beforeDatasetDraw(t,n){if(!this.coordinator||!this.watchDimension||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;t.config.type==="doughnut"?this._highlightDimensionDonut(t):this._highlightDimensionDefault(t,n)}afterDatasetsDraw(t){if(t.ctx.globalAlpha=1,!this.coordinator||!this.watchTimestamp||!this.coordinator.activeTimestamp.value||this.coordinator.activeChart.value===this.instanceId&&!this.triggerOnSelf)return;const i=t.scales.x.getPixelForValue(this.coordinator.activeTimestamp.value),s=t.ctx;GC(s,i,t.scales.y.top,t.scales.y.bottom)}beforeDestroy(){this.stopWatcher&&this.stopWatcher()}_watchTimestamp(t){if(!this.coordinator)return;let n;return this.watchTimestamp&&(n=u.watch([this.coordinator.activeChart,this.coordinator.activeTimestamp],([i])=>{(i!==this.instanceId||this.triggerOnSelf)&&t()})),n}_watchDimension(t){if(!this.coordinator)return;let n;if(this.watchDimension){let i;n=u.watch([this.coordinator.activeChart,this.coordinator.activeDimension,this.coordinator.activeDimensionValue],([s,o,a])=>{clearTimeout(i),o===null&&(this.activeDimension=null),a===null&&(this.activeDimensionValue=null),i=setTimeout(()=>{this.activeDimension=o,this.activeDimensionValue=a,(s!==this.instanceId||this.triggerOnSelf)&&t()},this.coordinator?.DIMENSION_DEBOUNCE_MS??400),u.onWatcherCleanup(()=>{clearTimeout(i)})})}return n}_onMouseBrush(t,n,i){if(!this.coordinator)return;const s=t.type,o=Math.min(this.coordinator.TIMESTAMP_DEBOUNCE_MS,this.coordinator.DIMENSION_DEBOUNCE_MS);if(!(s==="mousemove"&&i-this.lastMouseBrushEvent<o)){if(s==="mousemove"){if(!n.canvas)return;const a=this._getTimestamp(n,t),[r,l]=this._getDatasetDimension(n,t)??[];this.coordinator.activate({chartUuid:this.instanceId,timestamp:a,dimension:r,dimensionValue:l})}else s==="mouseout"&&this.coordinator.deactivate({chartUuid:this.instanceId});this.lastMouseBrushEvent=i}}_highlightDimensionDefault(t,n){if(this.activeDimension&&this.activeDimensionValue){const i=t.data.datasets.map((s,o)=>s?.dimension===this.activeDimension&&s?.dimensionValue===this.activeDimensionValue?o:-1).filter(s=>s>=0);i.length&&(t.ctx.globalAlpha=i.includes(n.index)?1:.3)}else t.ctx.globalAlpha=1}_highlightDimensionDonut(t){if(this.activeDimension&&this.activeDimensionValue){const{dimension:n,dimensionValue:i}=t.data.datasets[0];if(n===this.activeDimension){const s=i.findIndex(o=>o===this.activeDimensionValue);s>=0?t.setActiveElements([{datasetIndex:0,index:s}]):t.setActiveElements([])}else t.setActiveElements([])}else t.setActiveElements([])}_getDatasetDimension(t,n){const i=t.config.type,s=i!=="line",o=["doughnut","scatter"].includes(i)?"point":"dataset",a=t.getElementsAtEventForMode(n,o,{intersect:s},!1),[r]=a;if(!r)return;const{datasetIndex:l,index:c}=r,{dimension:d,dimensionValue:h}=t.data.datasets[l];return i==="doughnut"?[d,h[c]]:[d,h]}_getTimestamp(t,n){const[i]=t.getElementsAtEventForMode(n,"index",{intersect:!1},!1);if(i&&this.watchTimestamp){const{datasetIndex:s,index:o}=i,{x:a}=t.data.datasets[s].data[o];return a}}}const XC=["id"],KC=["id"],ZC={class:"axis-tooltip-content"},QC="100%",JC="100%",tO=20,eO=20,Xh=6,nO=0,iO=10,sO=10,oO=1,aO=Et(u.defineComponent({__name:"StackedBarChart",props:{chartData:{},tooltipTitle:{default:""},legendValues:{default:void 0},metricUnit:{default:""},orientation:{default:"horizontal"},annotations:{type:Boolean,default:!0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},stacked:{type:Boolean,default:!0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""},coordinator:{default:void 0}},setup(e){const t=e,{i18n:n}=K.useI18n(),{translateUnit:i}=K.useTranslatedUnits(),s=crypto.randomUUID(),o=crypto.randomUUID(),a=new Gh,r=new oo({coordinator:t.coordinator,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),l=u.useTemplateRef("chartContainer"),c=u.useTemplateRef("chartParent"),d=({chart:N},$)=>{const pt=N.data,ct=pt.labels?.indexOf($);return pt.datasets.reduce((at,Ct,Bt)=>{if(N.isDatasetVisible(Bt)){const Pt=Ct.data[ct];return isNaN(Pt)?at:at+Pt}else return at},0)},h=(N,$,pt,ct)=>{const at=ct==="horizontal";$===null&&($=n.t("entityNoName"));const Ct={type:"label",yValue:St=>at?$:d(St,$),xValue:St=>at?d(St,$):$},Bt={...Ct,position:at?{x:"start",y:"center"}:{x:"center",y:"end"},yAdjust:()=>at?0:-Math.abs(W1()),content:St=>Ed(d(St,$),pt)},Pt={...Ct,content:St=>q1(d(St,$),j1(St.chart,N)),position:at?{x:"start",y:"center"}:{x:"center",y:"end"},xAdjust:St=>at?Y1(Ed(d(St,$),pt)):0,color:pe({state:"neutral"})};return{[`${$}-value`]:Bt,[`${$}-percent`]:Pt}},f=u.useTemplateRef("canvas"),m=u.useTemplateRef("axis"),p=dr(),g=dr(),y=u.ref([]),_=u.inject("legendPosition",Lt.Bottom),x=u.reactive({show:!1,top:"0px",left:"0px",text:"",offset:-50}),T=u.toRef(t,"metricUnit"),k=u.computed(()=>t.orientation==="horizontal"),w=u.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:u.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:u.toRef(t,"dimensionAxesTitle"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:i,offsetX:0,offsetY:0,width:0,height:0,interactionMode:"idle",chartType:k.value?"horizontal_bar":"vertical_bar",chartID:o,chartTooltipSortFn:t.chartTooltipSortFn}),{tooltipAbsoluteLeft:O,tooltipAbsoluteTop:S}=K.useTooltipAbsolutePosition(c,w),A=u.ref(0),R=()=>t.annotations&&t.chartData.labels?.reduce((N,$)=>Object.assign(N,h(t.chartData,$,T.value,t.orientation)),{}),D={id:p,afterUpdate(N){A.value+=1,y.value=Ra(N,t.legendValues,t.chartLegendSortFn)}},v={id:g,afterUpdate(N){N.options.plugins.annotation.annotations=t.annotations?R():{}}},I=[D,{id:"axisHover",afterEvent(N,$){if(x.show=!1,$.event.type==="mousemove"){const pt=$.event,ct=N.options.indexAxis,at=N.scales,Ct=N.scales[ct].getLabelForValue(Number(N.scales[ct].getValueForPixel(pt[ct]))),Pt=N.scales[ct].getLabels().indexOf(Ct),St=t.chartData.isLabelEmpty?.[Pt];if((j=>j==="x"?pt.y>at.x.top:pt.x<at.y.right)(ct)){w.interactionMode!=="interactive"&&(w.showTooltip=!1);const st=N.canvas.getContext("2d").measureText(Ct).width,zt=Math.abs(Math.round(pt.x-st*.5)),re=Math.round(pt.x+st*.5),Se=N.canvas.getBoundingClientRect(),Wn=40;x.left=ct==="x"?`${(zt>0?zt:re)-x.offset+Se.left}px`:`${pt.x-st*.5-x.offset+Se.left}px`,x.top=`${pt.y-Wn+Se.top}px`,Ct.length>js?(x.show=!0,x.text=Ct):St?(x.text=n.t("emptyEntityInfo"),x.show=!0):x.show=!1}else x.show=!1}}},a,r,...t.annotations?[v]:[]],U=u.computed(()=>t.chartData.labels&&t.chartData.labels.length||0),H=u.ref(0),V=u.ref(0),G=new ResizeObserver(Od(N=>{H.value=N[0].contentRect.width,V.value=N[0].contentRect.height},100)),rt=u.computed(()=>{const N=t.chartData?.labels?.length;return f.value&&N&&!k.value?`${Math.max(N*(tO+Xh),H.value)}px`:QC}),ot=u.computed(()=>{const N=t.chartData?.labels?.length;return f.value&&N&&k.value?`${Math.max(N*(eO+Xh),V.value)}px`:JC});K.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey")),u.onMounted(()=>{t.annotations&&Zt.register(Wh),l.value&&(H.value=l.value.offsetWidth,V.value=l.value.offsetHeight,G.observe(l.value))}),u.onUnmounted(()=>{l.value&&G.unobserve(l.value)});const X=u.computed(()=>{const N=K.useBarChartOptions({tooltipState:w,legendID:p,stacked:u.toRef(t,"stacked"),metricAxesTitle:u.toRef(t,"metricAxesTitle"),dimensionAxesTitle:u.toRef(t,"dimensionAxesTitle"),indexAxis:k.value?"y":"x",numLabels:U});return{...N.value,plugins:{...N.value.plugins,annotation:{annotations:R(),clip:!1}}}}),B=K.useChartJSCommon("bar",f,u.toRef(t,"chartData"),I,X);u.onBeforeUnmount(()=>{Zt.unregister(Wh)});const M={[Lt.Bottom]:"column"},E=u.computed(()=>{if(m.value&&B.value){const N=window.devicePixelRatio,$=B.value,pt=$.scales.y.width*N+oO,ct=($.scales.y.height+$.scales.y.top+$.scales.x.height)*N,at=m.value.getContext("2d");return at.scale(N,N),at.canvas.width=pt,at.canvas.height=ct,at.canvas.style.width=`${pt/N}px`,at.canvas.style.height=`${ct/N}px`,{scale:N,width:pt*N,height:ct*N,targetCtx:at}}return null}),z=N=>{const $=N.target;if(E.value&&B.value&&!k.value){const pt=E.value.scale,ct=E.value.targetCtx,at=E.value.width,Ct=E.value.height,Bt=B.value,Pt=Bt.canvas;ct.fillStyle="white",$.scrollLeft>=nO&&$.scrollLeft<=iO?(ct.globalCompositeOperation="source-over",ct.clearRect(0,0,at,Ct),ct.drawImage(Pt,0,0,at,Ct,0,0,at,Ct),ct.globalCompositeOperation="destination-over",ct.fillRect(0,0,at,Ct)):(ct.globalCompositeOperation="source-over",ct.fillRect(0,(Bt.scales.y.height+Bt.scales.y.top+sO)*pt,at,Bt.scales.x.height*pt))}w.offsetY=$.scrollTop,w.offsetX=$.scrollLeft,x.offset=$.scrollLeft},Y=({width:N,height:$})=>{w.width=N,w.height=$};u.watch(()=>t.orientation,()=>{if(m.value&&E.value){const N=E.value.width,$=E.value.height;(m.value?.getContext("2d")).clearRect(0,0,N,$)}w.showTooltip=!1,w.interactionMode="idle"}),u.watch(()=>t.annotations,N=>{B.value&&(N?B.value.options.plugins.annotation.annotations=R(t.chartData):delete B.value.options.plugins.annotation.annotations)});const nt=()=>{w.showTooltip&&(w.interactionMode!=="idle"?w.interactionMode="idle":w.interactionMode="interactive")};return(N,$)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",M[u.unref(_)]])},[u.createElementVNode("canvas",{id:u.unref(s),ref:"axis",class:"axis"},null,8,XC),u.createElementVNode("div",{ref:"chartContainer",class:"chart-container",onClick:$[0]||($[0]=pt=>nt()),onScroll:z},[u.createElementVNode("div",{class:"chart-body",style:u.normalizeStyle({width:rt.value,height:ot.value})},[u.createElementVNode("canvas",{id:u.unref(o),ref:"canvas",class:"chart-canvas"},null,8,KC)],4)],544),(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[x.show?(u.openBlock(),u.createElementBlock("div",{key:0,class:"axis-tooltip",style:u.normalizeStyle({top:x.top,left:x.left}),width:"auto"},[u.createElementVNode("div",ZC,u.toDisplayString(x.text),1)],4)):u.createCommentVNode("",!0),u.createVNode(Wi,{"absolute-left":u.unref(O),"absolute-top":u.unref(S),"chart-parent-ref":c.value,state:w,"tooltip-title":e.tooltipTitle,onDimensions:Y},null,8,["absolute-left","absolute-top","chart-parent-ref","state","tooltip-title"])])),u.createVNode(so,{id:u.unref(p),"chart-instance":u.unref(B),items:y.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-641d9623"]]);const rO={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"};Zc._date.override({_id:"date-fns",formats:function(){return rO},parse:function(e,t){if(e===null||typeof e>"u")return null;const n=typeof e;return n==="number"||e instanceof Date?e=J(e):n==="string"&&(typeof t=="string"?e=Ib(e,t,new Date,this.options):e=Fl(e,this.options)),Eo(e)?e.getTime():null},format:function(e,t){return as(e,t,this.options)},add:function(e,t,n){switch(n){case"millisecond":return Ao(e,t);case"second":return Oy(e,t);case"minute":return Dy(e,t);case"hour":return vy(e,t);case"day":return ss(e,t);case"week":return Ay(e,t);case"month":return Oo(e,t);case"quarter":return Cy(e,t);case"year":return Py(e,t);default:return e}},diff:function(e,t,n){switch(n){case"millisecond":return Ro(e,t);case"second":return Fy(e,t);case"minute":return Ny(e,t);case"hour":return Ly(e,t);case"day":return yl(e,t);case"week":return Uy(e,t);case"month":return wl(e,t);case"quarter":return zy(e,t);case"year":return Vy(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case"second":return zb(e);case"minute":return Bb(e);case"hour":return Nb(e);case"day":return Po(e);case"week":return ce(e);case"isoWeek":return ce(e,{weekStartsOn:+n});case"month":return $y(e);case"quarter":return Hy(e);case"year":return kl(e);default:return e}},endOf:function(e,t){switch(t){case"second":return Xy(e);case"minute":return qy(e);case"hour":return Wy(e);case"day":return _l(e);case"week":return jy(e);case"month":return xl(e);case"quarter":return Gy(e);case"year":return Yy(e);default:return e}}});const Kh={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},lO={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Kh,...{ariaLabel:{type:String},ariaDescribedby:{type:String}}},cO=u.version[0]==="2"?(e,t)=>Object.assign(e,{attrs:t}):(e,t)=>Object.assign(e,t);function Yn(e){return u.isProxy(e)?u.toRaw(e):e}function uO(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:e;return u.isProxy(t)?new Proxy(e,{}):e}function dO(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Zh(e,t){e.labels=t}function Qh(e,t,n){const i=[];e.datasets=t.map(s=>{const o=e.datasets.find(a=>a[n]===s[n]);return!o||!s.data||i.includes(o)?{...s}:(i.push(o),Object.assign(o,s),o)})}function hO(e,t){const n={labels:[],datasets:[]};return Zh(n,e.labels),Qh(n,e.datasets,t),n}const fO=u.defineComponent({props:lO,setup(e,t){let{expose:n,slots:i}=t;const s=u.ref(null),o=u.shallowRef(null);n({chart:o});const a=()=>{if(!s.value)return;const{type:c,data:d,options:h,plugins:f,datasetIdKey:m}=e,p=hO(d,m),g=uO(p,d);o.value=new Zt(s.value,{type:c,data:g,options:{...h},plugins:f})},r=()=>{const c=u.toRaw(o.value);c&&(e.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},e.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(e.updateMode)};return u.onMounted(a),u.onUnmounted(r),u.watch([()=>e.options,()=>e.data],(c,d)=>{let[h,f]=c,[m,p]=d;const g=u.toRaw(o.value);if(!g)return;let y=!1;if(h){const _=Yn(h),x=Yn(m);_&&_!==x&&(dO(g,_),y=!0)}if(f){const _=Yn(f.labels),x=Yn(p.labels),T=Yn(f.datasets),k=Yn(p.datasets);_!==x&&(Zh(g.config.data,_),y=!0),T&&T!==k&&(Qh(g.config.data,T,e.datasetIdKey),y=!0)}y&&u.nextTick(()=>{l(g)})},{deep:!0}),()=>u.h("canvas",{role:"img","aria-label":e.ariaLabel,"aria-describedby":e.ariaDescribedby,ref:s},[u.h("p",{},[i.default?i.default():""])])}});function ao(e,t){return Zt.register(t),u.defineComponent({props:Kh,setup(n,i){let{expose:s}=i;const o=u.shallowRef(null),a=u.shallowRef(null);u.watch(()=>a.value?.chart??null,l=>{o.value=l},{flush:"sync"}),s({chart:o});const r=l=>{a.value=l};return()=>u.h(fO,cO({ref:r},{type:e,...n}))}})}const Jh=ao("bar",qc),tf=ao("doughnut",ki),ef=ao("line",Gc),mO=ao("scatter",Kc),pO={class:"chart-container"},gO={key:0,class:"chart-center-metric"},yO={class:"chart-center-total"},bO={key:0,class:"chart-center-unit"},_O=u.defineComponent({__name:"DonutChart",props:{chartData:{},tooltipTitle:{},metricUnit:{default:""},metricName:{default:""},legendPosition:{default:Lt.Bottom},legendValues:{default:void 0},syntheticsDataKey:{default:""},tooltipDimensionDisplay:{default:""},tooltipMetricDisplay:{default:""},showCenterMetric:{type:Boolean,default:!0},coordinator:{default:void 0}},setup(e){const t=e,{translateUnit:n}=K.useTranslatedUnits(),{i18n:i}=K.useI18n(),s=crypto.randomUUID(),o=crypto.randomUUID(),a=u.ref([]),r=u.useTemplateRef("chartParent"),l=new oo({coordinator:t.coordinator,requiresUpdate:!0,triggerOnSelf:!1,watchTimestamp:!1,watchDimension:!0}),c=u.reactive({showTooltip:!1,tooltipContext:"",metricDisplay:u.toRef(t,"tooltipMetricDisplay"),dimensionDisplay:u.toRef(t,"tooltipDimensionDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:n,offsetX:0,offsetY:0,width:0,height:0,chartID:o,chartType:"donut",interactionMode:"idle"}),{tooltipAbsoluteLeft:d,tooltipAbsoluteTop:h}=K.useTooltipAbsolutePosition(r,c),f={id:s,afterUpdate(A){a.value=A.options.plugins.legend.labels.generateLabels(A).map(R=>({...R,value:t.legendValues&&t.legendValues[R.text],hidden:!1}))}},m=u.computed(()=>[l,f]),p=u.computed(()=>[t.chartData.datasets.reduce((R,D)=>(R.dimension=D.dimension,R.dimensionValue.push(D.dimensionValue),R.labels.push(D.label),R.backgroundColor.push(D.backgroundColor),R.hoverBorderColor.push(_s(D.backgroundColor).saturate(.5).darken(.15).hexString()),R.data.push(D.data.reduce((v,C)=>v+C,0)),R),{dimension:"",dimensionValue:[],labels:[],backgroundColor:[],borderColor:"#ffffff",borderWidth:1,hoverBorderColor:[],hoverBorderWidth:1,data:[],hoverOffset:10})]),{formatUnit:g}=le({i18n:i}),y=u.computed(()=>EM(t.metricName??"")),_=u.computed(()=>{const A=p.value[0]?.data.reduce((R,D)=>R+D,0)??0;return g(A,t.metricUnit,{approximate:!0,translateUnit:(R,D)=>n(R,D)}).trim()}),x=u.computed(()=>t.tooltipMetricDisplay||""),T=u.computed(()=>({...t.chartData,datasets:p.value}));K.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const{options:k}=K.useDonutChartOptions({tooltipState:c,legendID:s}),w=u.ref(),O=A=>({[Lt.Bottom]:"column",[Lt.Hidden]:"hidden"})[A],S=({width:A,height:R})=>{c.width=A,c.height=R};return(A,R)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",O(e.legendPosition)]),"data-testid":"donut-chart-parent"},[u.createElementVNode("div",pO,[u.createVNode(u.unref(tf),{ref_key:"chartInstance",ref:w,"chart-id":u.unref(o),data:T.value,options:u.unref(k),plugins:m.value},null,8,["chart-id","data","options","plugins"]),e.showCenterMetric&&y.value?(u.openBlock(),u.createElementBlock("div",gO,[u.createElementVNode("span",yO,u.toDisplayString(_.value),1),x.value?(u.openBlock(),u.createElementBlock("span",bO,u.toDisplayString(x.value),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0),(u.openBlock(),u.createBlock(u.Teleport,{to:"body"},[u.createVNode(Wi,{"absolute-left":u.unref(d),"absolute-top":u.unref(h),state:c,"tooltip-title":e.tooltipTitle,unit:e.metricUnit,onDimensions:S},null,8,["absolute-left","absolute-top","state","tooltip-title","unit"])]))]),u.createVNode(so,{id:u.unref(s),"chart-instance":w.value,items:a.value,position:e.legendPosition},null,8,["id","chart-instance","items","position"])],2))}}),xO=Et(_O,[["__scopeId","data-v-9e8646c1"]]);class wO{id="outlierBandPlugin";beforeDatasetsDraw(t,n,i){const s=i?.value;if(s===void 0||!Number.isFinite(s)||!i?.color)return;const o=t.scales.y;if(!o||!t.chartArea)return;const{top:a,bottom:r,left:l,right:c}=t.chartArea,d=Math.min(Math.max(o.getPixelForValue(s),a),r);if(d<=a)return;const h=t.ctx;h.save(),h.fillStyle=i.color,h.fillRect(l,a,c-l,d-a),h.restore()}}const kO=1.5;class TO{id="referenceLinePlugin";afterDatasetsDraw(t,n,i){const s=i?.lines;if(!s?.length)return;const o=t.scales.y;if(!o||!t.chartArea)return;const{top:a,bottom:r,left:l,right:c}=t.chartArea,d=t.ctx;d.save(),d.lineWidth=kO;for(const{value:h,color:f,borderDash:m}of s){if(!Number.isFinite(h))continue;const p=o.getPixelForValue(h);p<a||p>r||(d.beginPath(),d.setLineDash(m),d.strokeStyle=f,d.moveTo(l,p),d.lineTo(c,p),d.stroke())}d.restore()}}const vO={class:"chart-container"},SO=Et(u.defineComponent({__name:"ScatterChart",props:{chartData:{default:void 0},tooltipTitle:{},metricUnit:{default:""},xMetric:{default:void 0},xMetricUnit:{default:void 0},granularity:{},timeRangeMs:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:()=>0},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},tooltipMetricDisplay:{default:""},shadeOutlierRegion:{type:Boolean,default:!1},themeColors:{default:()=>Ga()},coordinator:{default:void 0}},setup(e){const t=e,n=u.inject("legendPosition",Lt.Bottom),{i18n:i}=K.useI18n(),{formatUnit:s}=le({i18n:i}),{translateUnit:o}=K.useTranslatedUnits(),a=u.useTemplateRef("chartParent"),r=new wO,l=new TO,c=crypto.randomUUID(),d=crypto.randomUUID(),h=new oo({coordinator:t.coordinator,requiresUpdate:!0,triggerOnSelf:!0,watchTimestamp:!1,watchDimension:!0}),f=u.ref(),m=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:u.toRef(t,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(t,"metricUnit"),translateUnit:o,offsetX:0,offsetY:0,width:0,height:0,chartType:"scatter",chartID:d,chartTooltipSortFn:t.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:p,tooltipAbsoluteTop:g}=K.useTooltipAbsolutePosition(a,m);K.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const y=u.computed(()=>t.chartData?.outlier),_=u.computed(()=>t.chartData?.referenceLines??[]),x=u.ref([]),T={id:c,afterUpdate(v){x.value=Ra(v,void 0,t.chartLegendSortFn)}},k=u.computed(()=>{const v=[];y.value&&v.push({text:y.value.label,fillStyle:y.value.color,strokeStyle:y.value.color,isKey:!0});for(const C of _.value)v.push({text:C.label,fillStyle:C.color,strokeStyle:C.color,lineDash:C.borderDash,isKey:!0,value:{raw:C.value,formatted:s(C.value,t.metricUnit,{translateUnit:o})}});return v}),w=u.computed(()=>[...x.value,...k.value]),O=u.computed(()=>t.shadeOutlierRegion?y.value?.value:void 0),S=u.computed(()=>[h,T,...O.value!==void 0?[r]:[],..._.value.length?[l]:[]]),A=u.computed(()=>`scatter-${S.value.map(v=>v.id).join("-")}`),{options:R}=K.useScatterChartOptions({tooltipState:m,legendID:c,granularity:u.toRef(t,"granularity"),timeRangeMs:u.toRef(t,"timeRangeMs"),metricAxesTitle:u.toRef(t,"metricAxesTitle"),dimensionAxesTitle:u.toRef(t,"dimensionAxesTitle"),metricUnit:u.toRef(t,"metricUnit"),xMetric:u.toRef(t,"xMetric"),xMetricUnit:u.toRef(t,"xMetricUnit"),outlierValue:O,referenceLines:_,themeColors:u.toRef(t,"themeColors")}),D=v=>({[Lt.Bottom]:"column",[Lt.Hidden]:"hidden"})[v];return(v,C)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",D(u.unref(n))]),"data-testid":"scatter-chart-parent"},[u.createElementVNode("div",vO,[(u.openBlock(),u.createBlock(u.unref(mO),{key:A.value,ref_key:"chartInstance",ref:f,"chart-id":u.unref(d),class:"chart-canvas",data:e.chartData,"data-testid":"scatter-chart",options:u.unref(R),plugins:S.value},null,8,["chart-id","data","options","plugins"]))]),u.createVNode(Wi,{"absolute-left":u.unref(p),"absolute-top":u.unref(g),"data-testid":"tooltip",granularity:e.granularity,state:m,"tooltip-title":e.tooltipTitle},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title"]),u.createVNode(so,{id:u.unref(c),"chart-instance":f.value,"data-testid":"legend",items:w.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-34d55736"]]),hr=(e,t,n,i,s="#0275d8")=>{e.save(),e.beginPath(),e.moveTo(t,n),e.lineTo(t,i),e.lineWidth=1,e.strokeStyle=s,e.stroke(),e.restore()},Gt={},MO=()=>{Gt.x=void 0,Gt.chart=void 0,Gt.strategy=void 0,Gt.group=void 0},DO=10;class nf{id="verticalLinePlugin";_clickedSegment;_pause=!1;_useBrushingState=!1;_brushStrategy;_brushGroup;constructor({brushGroup:t=void 0,brushStrategy:n=void 0,enableBrushing:i=!1}={}){let s=!1;n==="group"&&(s=t!==void 0),this._useBrushingState=i&&s,this._brushStrategy=n,this._brushGroup=t}afterEvent(t,n){if(!this._useBrushingState)return;const{event:i}=n;(i.type==="mousemove"||i.type==="mouseout")&&requestAnimationFrame(s=>this.onMouseBrush(i.type,t,s))}_lastMouseBrushEvent=0;onMouseBrush(t,n,i){if(t==="mousemove"&&i-this._lastMouseBrushEvent<DO)return;const s=()=>{Gt.chart=n,Gt.strategy=this._brushStrategy,Gt.group=this._brushGroup;for(const o of Object.values(Zt.instances))o!==n&&o.update("none")};t==="mousemove"?n.tooltip&&n.tooltip.getActiveElements()&&n.tooltip.getActiveElements().length&&(Gt.x=n.tooltip.dataPoints[0].element.x,s()):t==="mouseout"&&(Gt.x=void 0,s()),this._lastMouseBrushEvent=i}afterDatasetsDraw(t){if(this.isPaused)return;const n=t.tooltip&&t.tooltip.getActiveElements()&&t.tooltip.getActiveElements().length,i=t.ctx;if(this._clickedSegment){const{x:s}=this._clickedSegment.element;hr(i,s,t.scales.y.top,t.scales.y.bottom)}else if(this._useBrushingState)this.drawByBrush(t);else if(n){const{x:s}=t.tooltip.dataPoints[0].element;hr(i,s,t.scales.y.top,t.scales.y.bottom)}}drawByBrush(t){if(Gt.x===void 0)return;const n=Gt.chart===t?"#0275d8":"rgba(2, 117, 216, 0.3)";this._brushStrategy==="group"&&Gt.group===this._brushGroup&&hr(t.ctx,Gt.x,t.scales.y.top,t.scales.y.bottom,n)}pause(){this._pause=!0}resume(){this._pause=!1}get isPaused(){return this._pause}set clickedSegment(t){this._clickedSegment=t}get clickedSegment(){return this._clickedSegment}destroyClickedSegment(){delete this._clickedSegment}beforeDestroy(t){if(this._clickedSegment&&this.destroyClickedSegment(),this._useBrushingState&&Gt.chart===t){const n=Gt.x!==void 0;if(MO(),n)for(const i of Object.values(Zt.instances))i!==t&&i.update("none")}}}const CO=(e,t,n)=>{const i=e.ctx;i.save(),i.strokeStyle="rgba(95, 154, 255, 1)",i.lineWidth=2,i.beginPath(),i.moveTo(t,e.chartArea.top),i.lineTo(t,e.chartArea.bottom),i.moveTo(n,e.chartArea.top),i.lineTo(n,e.chartArea.bottom),i.stroke(),i.restore()},OO=(e,t,n)=>{const i=e.ctx;i.save(),i.fillStyle="rgba(143, 193, 255, 0.3)",i.fillRect(t,e.chartArea.top,n-t,e.chartArea.bottom-e.chartArea.top),i.restore()},sf=(e,t)=>{const n=e.scales.x.getValueForPixel(t.startX),i=e.scales.x.getValueForPixel(t.endX);if(!(n===void 0||i===void 0))return{xStart:Math.min(n,i),xEnd:Math.max(n,i)}},of=(e,t,n)=>{t.canvas.dispatchEvent(new CustomEvent(e,{detail:n}))};class AO{id="dragSelectPlugin";_isDragging=!1;_startX=0;_endX=0;_dragTimeout;_clearSelectionArea=!0;_chart=null;_dragSelectHandlers;get startX(){return this._startX}get endX(){return this._endX}beforeInit(t){this._chart=t;const n=t.canvas;let i=!1;const s=r=>{this._dragTimeout=window.setTimeout(()=>{const l=n.getBoundingClientRect();this._isDragging=!0,this._clearSelectionArea=!1,i=!0,this._startX=r.clientX-l.left,this._endX=this._startX},150)},o=r=>{const l=n.getBoundingClientRect();if(i&&this._isDragging){this._endX=r.clientX-l.left;const c=sf(t,this);c&&of("dragSelectMove",t,c)}},a=r=>{const l=n.getBoundingClientRect();if(clearTimeout(this._dragTimeout),i&&this._isDragging){this._endX=r.clientX-l.left,i=!1,this._isDragging=!1;const c=sf(t,this);c?of("dragSelect",t,c):this.clearSelectionArea()}};n.addEventListener("mousedown",s),n.addEventListener("mousemove",o),n.addEventListener("mouseup",a),this._dragSelectHandlers={onMouseDown:s,onMouseMove:o,onMouseUp:a}}beforeDestroy(t){const n=t.canvas;if(this._dragSelectHandlers){const{onMouseDown:i,onMouseMove:s,onMouseUp:o}=this._dragSelectHandlers;n.removeEventListener("mousedown",i),n.removeEventListener("mousemove",s),n.removeEventListener("mouseup",o)}this._isDragging=!1,this._dragTimeout&&clearTimeout(this._dragTimeout)}afterDatasetsDraw(t){(this._isDragging||!this._clearSelectionArea)&&(OO(t,this._startX,this._endX),CO(t,this._startX,this._endX))}clearSelectionArea(){this._clearSelectionArea=!0,this._chart&&this._chart.update()}}const PO=20,EO="rgba(255, 171, 171, 0.4)",RO="rgba(255, 196, 0, 0.2)",af=(e,t,n)=>{const i=t.y-e.y;if(i===0)return t.x;const s=(n-e.y)/i;return e.x+s*(t.x-e.x)},rf=e=>"yAxisID"in e&&e.yAxisID||qs,lf=(e,t)=>{const n=e.data.datasets.find(i=>i.rawMetric===t);return n?rf(n):qs},IO=(e,t,n=qs)=>{const i=[];return e.data.datasets.forEach(s=>{if(!e.getDatasetMeta(e.data.datasets.indexOf(s)).visible||rf(s)!==n)return;const a=s.data;a?.length&&t.filter(r=>r.highlightIntersections).forEach(r=>{const l=a.map(d=>({ts:d.x,aboveThreshold:d.y>=r.value}));let c=l[0].aboveThreshold?a[0].x:void 0;for(let d=1;d<l.length;d++)!l[d-1].aboveThreshold&&l[d].aboveThreshold?c=af(a[d-1],a[d],r.value):l[d-1].aboveThreshold&&!l[d].aboveThreshold&&c!==void 0&&(i.push({start:c,end:af(a[d-1],a[d],r.value),type:r.type}),c=void 0);c!==void 0&&i.push({start:c,end:l[l.length-1].ts,type:r.type})})}),i},LO=e=>{if(!e.length)return[];e.sort((n,i)=>n.type.localeCompare(i.type)||n.start-i.start);const t=[];for(const n of e){const i=t.findLast(({type:s})=>s===n.type);i&&n.start<=i.end?i.end=Math.max(i.end,n.end):t.push({...n})}return t};class NO{constructor(t){this.i18n=t}i18n;id="thresholdPlugin";_thresholds;_mouseMoveHandler;_syncThresholds(t){for(const n of Object.keys(t.threshold||{})){const i=t.threshold?.[n];i&&(this._thresholds={...this._thresholds,[n]:i.map(s=>({...s,hovered:!1}))})}if(this._thresholds)for(const n of Object.keys(this._thresholds))t.threshold?.[n]||delete this._thresholds[n]}get thresholds(){return this._thresholds}beforeUpdate(t,n,i){this._syncThresholds(i)}beforeInit(t,n,i){const s=t.canvas;this._syncThresholds(i);const o=a=>{if(t){const r=a.clientY,l=s.getBoundingClientRect();for(const c of Object.keys(this._thresholds||{})){const h=(t.scales[lf(t,c)]??t.scales.y).getValueForPixel(r-l.top);if(h){const f=this._thresholds?.[c];f&&f.forEach(m=>{m.hovered=Math.abs(m.value-h)<PO})}}}};s.addEventListener("mousemove",o),this._mouseMoveHandler=o}afterDatasetsDraw(t,n){const i=t.ctx;for(const s of Object.keys(this._thresholds||{})){const o=this._thresholds?.[s];if(o){const a=lf(t,s),r=t.scales[a]??t.scales.y;o.forEach(d=>{const h=r.getPixelForValue(d.value);i.save(),i.beginPath(),i.moveTo(t.chartArea.left,h),i.lineTo(t.chartArea.right,h),i.lineWidth=1,i.strokeStyle=pe({state:d.type}),i.setLineDash([5,5]),i.stroke(),i.restore();let f="";d.label?f=`${d.label}: ${d.value}`:d.type==="warning"?f=this.i18n.t("chartLabels.threshold-warning",{value:d.value}):d.type==="error"?f=this.i18n.t("chartLabels.threshold-error",{value:d.value}):f=this.i18n.t("chartLabels.thatreshold-neutral",{value:d.value}),d.hovered&&(i.save(),i.fillStyle=pe({state:d.type}),i.font=ng,i.fillText(f,t.chartArea.left,h-4),i.restore())});const l=IO(t,o,a);LO(l).forEach(d=>{const h=t.scales.x.getPixelForValue(d.start),f=t.scales.x.getPixelForValue(d.end);i.save(),i.fillStyle=d.type==="error"?EO:RO,i.fillRect(h,t.chartArea.top,f-h,t.chartArea.bottom-t.chartArea.top),i.restore(),i.save(),i.beginPath(),i.moveTo(h,t.chartArea.bottom),i.lineTo(f,t.chartArea.bottom),i.lineWidth=2,i.strokeStyle=pe({state:d.type}),i.stroke(),i.restore()})}}}beforeDestroy(t){this._mouseMoveHandler&&t.canvas.removeEventListener("mousemove",this._mouseMoveHandler)}}const BO=Et(u.defineComponent({__name:"TimeSeriesChart",props:{chartData:{default:void 0},type:{default:"timeseries_line"},fill:{type:Boolean,default:!1},tooltipTitle:{},metricUnit:{default:""},timeRangeMs:{default:void 0},granularity:{},stacked:{type:Boolean,default:!0},legendValues:{default:void 0},metricAxesTitle:{default:void 0},dimensionAxesTitle:{default:void 0},syntheticsDataKey:{default:""},chartLegendSortFn:{type:Function,default:(e,t)=>e.value&&t.value&&t.value.raw-e.value.raw},chartTooltipSortFn:{type:Function,default:(e,t)=>t.rawValue-e.rawValue},brush:{type:Boolean,default:!1},zoomActionItems:{default:void 0},tooltipMetricDisplay:{default:""},threshold:{default:void 0},leftYAxisGrid:{type:Boolean,default:void 0},rightYAxis:{default:void 0},coordinator:{default:void 0}},emits:["zoom-time-range","select-chart-range"],setup(e,{emit:t}){const n=e,i=t,{i18n:s}=K.useI18n(),o=new nf,a=new Gh,r=new AO,l=new NO(s),{translateUnit:c}=K.useTranslatedUnits(),d=u.ref(),h=crypto.randomUUID(),f=crypto.randomUUID(),m=u.ref([]),p=u.inject("legendPosition",Lt.Bottom),g=u.useTemplateRef("chartParent"),y=u.ref(void 0),_=u.ref(!1),x=new oo({coordinator:n.coordinator,triggerOnSelf:!0,watchTimestamp:!0,watchDimension:!0}),T=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:u.toRef(n,"tooltipMetricDisplay"),tooltipSeries:[],left:"",top:"",units:u.toRef(n,"metricUnit"),translateUnit:c,offsetX:0,offsetY:0,width:0,height:0,chartType:n.type,chartID:f,chartTooltipSortFn:n.chartTooltipSortFn,interactionMode:"idle"}),{tooltipAbsoluteLeft:k,tooltipAbsoluteTop:w}=K.useTooltipAbsolutePosition(g,T),O={id:h,afterUpdate(M){m.value=Ra(M,n.legendValues,n.chartLegendSortFn)}},S=u.computed(()=>[x,O,a,...n.brush?[r]:[],...n.type==="timeseries_line"?[o]:[],...n.threshold?[l]:[]]),A=u.computed(()=>`line-${S.value.map(M=>M.id).join("-")}`),R=u.computed(()=>`bar-${S.value.map(M=>M.id).join("-")}`),D=u.computed(()=>n.chartData&&z1(n.chartData)),{options:v}=K.useLineChartOptions({tooltipState:T,timeRangeMs:u.toRef(n,"timeRangeMs"),granularity:u.toRef(n,"granularity"),legendID:h,stacked:u.toRef(n,"stacked"),metricAxesTitle:u.toRef(n,"metricAxesTitle"),dimensionAxesTitle:u.toRef(n,"dimensionAxesTitle"),pointsWithoutHover:D,threshold:u.toRef(n,"threshold"),leftYAxisGrid:u.toRef(n,"leftYAxisGrid"),rightYAxis:u.toRef(n,"rightYAxis")});K.useReportChartDataForSynthetics(u.toRef(n,"chartData"),u.toRef(n,"syntheticsDataKey"));const C=M=>M?M.end.getTime()>M.start.getTime():!1,I=M=>({[Lt.Bottom]:"column",[Lt.Hidden]:"hidden"})[M],U=({width:M,height:E})=>{T.width=M,T.height=E},H=(M=!0)=>{T.interactionMode="idle",T.showTooltip=!1,r.clearSelectionArea(),a.isPaused&&a.resume(M),o.isPaused&&o.resume()},V=()=>{T.interactionMode="interactive"},G=()=>{!d.value||!d.value.chart.tooltip?.dataPoints?.length||(T.interactionMode==="interactive"?o.clickedSegment=d.value.chart.tooltip.dataPoints[0]:o.destroyClickedSegment())},rt=()=>{if(_.value){_.value=!1;return}T.interactionMode!=="idle"?H():V(),G()};u.watch(()=>n.type,()=>{T.interactionMode="idle",T.showTooltip=!1,o.destroyClickedSegment()});const ot=M=>{M.preventDefault(),M.stopPropagation();const{xStart:E,xEnd:z}=M.detail,Y={start:new Date(E),end:new Date(z),type:"absolute"};if(!C(Y)){y.value=void 0,H(!1);return}y.value=Y,T.interactionMode="zoom-interactive",Y&&i("select-chart-range",Y)},X=M=>{T.interactionMode="selecting-chart-area",_.value=!0,o.pause(),a.pause();const{xStart:E,xEnd:z}=M.detail;y.value={start:new Date(E),end:new Date(z),type:"absolute"}},B=M=>{if(!g.value||T.interactionMode==="idle")return;const E=M.target;E&&g.value.contains(E)||_.value||H(!1)};return u.watch(()=>d.value?.chart,()=>{d.value?.chart&&(d.value.chart.canvas.removeEventListener("dragSelect",ot),d.value.chart.canvas.removeEventListener("dragSelectMove",X),d.value.chart.canvas.addEventListener("dragSelect",ot),d.value.chart.canvas.addEventListener("dragSelectMove",X))}),u.onMounted(()=>{document.addEventListener("click",B,!0)}),u.onUnmounted(()=>{d.value?.chart&&(d.value.chart.canvas.removeEventListener("dragSelect",ot),d.value.chart.canvas.removeEventListener("dragSelectMove",X)),document.removeEventListener("click",B,!0)}),(M,E)=>(u.openBlock(),u.createElementBlock("div",{ref:"chartParent",class:u.normalizeClass(["chart-parent",I(u.unref(p))]),"data-testid":"line-chart-parent"},[u.createElementVNode("div",{class:"chart-container",onClick:E[0]||(E[0]=z=>rt())},[e.type==="timeseries_line"?(u.openBlock(),u.createBlock(u.unref(ef),{key:A.value,ref_key:"chartInstance",ref:d,"chart-id":u.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-line-chart",options:u.unref(v),plugins:S.value},null,8,["chart-id","data","options","plugins"])):e.type==="timeseries_bar"?(u.openBlock(),u.createBlock(u.unref(Jh),{key:R.value,ref_key:"chartInstance",ref:d,"chart-id":u.unref(f),class:"chart-canvas",data:e.chartData,"data-testid":"time-series-bar-chart",options:u.unref(v),plugins:S.value},null,8,["chart-id","data","options","plugins"])):u.createCommentVNode("",!0)]),u.createVNode(Wi,{"absolute-left":u.unref(k),"absolute-top":u.unref(w),"data-testid":"tooltip",granularity:e.granularity,state:T,"tooltip-title":e.tooltipTitle,"zoom-action-items":e.zoomActionItems,"zoom-time-range":y.value,onDimensions:U,onOnAction:E[1]||(E[1]=()=>H(!1))},null,8,["absolute-left","absolute-top","granularity","state","tooltip-title","zoom-action-items","zoom-time-range"]),u.createVNode(so,{id:u.unref(h),"chart-instance":d.value,"data-testid":"legend",items:m.value},null,8,["id","chart-instance","items"])],2))}}),[["__scopeId","data-v-d7ce85b0"]]),zO={key:0,class:"chart-truncation-warning","data-testid":"truncation-warning"},FO={class:"tooltip-content"},UO={key:2,class:"analytics-chart-parent"},VO=u.defineComponent({__name:"AnalyticsChart",props:{chartData:{},chartOptions:{},activeMetric:{default:void 0},tooltipTitle:{default:""},emptyStateTitle:{default:""},emptyStateDescription:{default:""},legendPosition:{default:Lt.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(e,{emit:t}){const n=u.inject(Cf),i=t,s=e,{i18n:o}=K.useI18n(),a=u.ref(crypto.randomUUID());u.watch(()=>s.chartOptions.type,()=>{a.value=crypto.randomUUID()},{immediate:!0});const r=u.computed(()=>Xa(s.chartData)?void 0:s.chartData),l=u.computed(()=>{const F=s.chartOptions.metricAxisMap,j=r.value?.meta?.metric_names??[];if(!(s.chartOptions.type!=="timeseries_line"||!F||!j.some(st=>F[st]==="right")))return F}),c=u.computed(()=>!!l.value),d=(F,j)=>l.value?F.filter(st=>(l.value?.[st]??"left")===j):F,h=u.computed(()=>{const F=r.value?.meta,j=F?.metric_names??[];return["timeseries_line","timeseries_bar"].includes(s.chartOptions.type)&&!c.value&&j.length>1&&Object.keys(F?.display??{}).length>0?j:[]}),f=u.computed(()=>h.value.length>1),m=u.computed(()=>s.activeMetric&&h.value.includes(s.activeMetric)?s.activeMetric:h.value[0]),p=u.computed(()=>{const F=r.value;return!F||!f.value||!m.value?F:{...F,meta:{...F.meta,metric_names:[m.value]}}}),g=u.computed(()=>{const F=s.chartOptions.threshold;return!f.value||!F?F:{...F,...Object.fromEntries(Object.keys(F).filter(j=>j!==m.value).map(j=>[j,[]]))}}),y=u.computed(()=>{if(rt.value)return Xa(s.chartData)?s.chartData:Zd(s.chartData)}),_=u.inject("app:konnectColorMode",u.computed(()=>"light")),x=u.useTemplateRef("chartShell"),T=u.computed(()=>(_.value,Ga(x.value))),k=u.computed(()=>{if(y.value){const{start:j,end:st,metric:zt,metricUnit:re,truncated:Se,limit:Wn,datasource:ro}=y.value;return{start:j,end:st,metricNames:[zt],metricUnits:{[zt]:re??""},truncated:Se,limit:Wn,datasource:ro}}const F=p.value?.meta;return{start:F?.start,end:F?.end,metricNames:F?.metric_names,metricUnits:F?.metric_units,truncated:F?.truncated,limit:F?.limit,datasource:F?.datasource}}),w=u.computed(()=>rt.value?K.useScatterDatasets({colorPalette:s.chartOptions.chartDatasetColors,scatter:s.chartOptions.scatter,themeColors:T},y,a.value,n).value:r.value?V.value?K.useExploreResultToTimeDataset({fill:s.chartOptions.stacked,colorPalette:s.chartOptions.chartDatasetColors,metricAxisMap:l.value},p,a.value,n).value:K.useExploreResultToDatasets({fill:s.chartOptions.stacked,colorPalette:s.chartOptions.chartDatasetColors},r,a.value,n).value:{datasets:[]}),O=u.computed(()=>s.timeseriesZoom||!!s.exploreLink||!!s.requestsLink),S=u.computed(()=>{if(!s.chartData||r.value&&!r.value.meta)return 0;const{start:F,end:j}=k.value;if(F&&j)return new Date(j).getTime()-new Date(F).getTime()}),A=u.computed(()=>k.value.metricUnits?f.value&&m.value?k.value.metricUnits[m.value]??"":Object.values(k.value.metricUnits)[0]??"":""),R=u.computed(()=>k.value.metricUnits?f.value&&m.value?m.value:Object.keys(k.value.metricUnits)[0]??"":""),D=u.computed(()=>s.showLegendValues&&s.legendPosition!==Lt.Hidden),{legendValues:v}=K.useChartLegendValues(w,s.chartOptions.type,A),C=u.computed(()=>k.value.limit?.toString()||null),I=u.computed(()=>s.chartOptions.hideTruncationWarning?!1:k.value.truncated||!1),U=u.computed(()=>o.t("limitedResultsShown",{maxReturned:C.value})),H=u.computed(()=>["vertical_bar","horizontal_bar"].includes(s.chartOptions.type)),V=u.computed(()=>["timeseries_bar","timeseries_line"].some(F=>F===s.chartOptions.type)),G=u.computed(()=>s.chartOptions.type==="donut"),rt=u.computed(()=>s.chartOptions.type==="scatter"),ot=u.computed(()=>s.chartOptions.type.includes("vertical")?"vertical":"horizontal"),X=u.computed(()=>{const{metricNames:F,metricUnits:j}=k.value;if(c.value||!F||!j)return;const st=F[0],zt=j[st]||"";if(F.length>1){if(st.includes("latency"))return o.t("metricAxisTitles.latency_in",{unit:o.t(`chartUnits.${zt}`,{plural:"s"})});if(st.includes("size"))return o.t("metricAxisTitles.size_in",{unit:o.t(`chartUnits.${zt}`,{plural:"s"})})}if(st)return zi(zt)&&o.te(`metricAxisTitles.${st}`)?o.t(`metricAxisTitles.${st}`)||void 0:o.te(`chartLabels.${st}`)?o.t(`chartLabels.${st}`):st}),B=u.computed(()=>{const F=s.chartOptions.yAxes?.left?.title??s.chartOptions?.metricAxesTitle;if(F)return F;const{metricNames:j,metricUnits:st}=k.value;if(!(!j||!st))return E(d(j,"left"),st)}),M=u.computed(()=>{if(!c.value)return;const{metricNames:F,metricUnits:j}=k.value,st=F&&j?E(d(F,"right"),j):void 0;return{title:s.chartOptions.yAxes?.right?.title??st,showGrid:s.chartOptions.yAxes?.right?.showGrid}}),E=(F,j)=>{const st=F[0];if(!st)return;const zt=j[st]||"";if(F.length>1){if(st.includes("latency"))return o.t("metricAxisTitles.latency_in",{unit:o.t(`chartUnits.${zt}`,{plural:"s"})});if(st.includes("size"))return o.t("metricAxisTitles.size_in",{unit:o.t(`chartUnits.${zt}`,{plural:"s"})})}return z(st,zt)},z=(F,j)=>{if(o.te(`metricAxisTitles.${F}`)){if(zi(j))return o.t(`metricAxisTitles.${F}`)||void 0;const st=o.te(`chartUnits.${j}`)?o.t(`chartUnits.${j}`,{plural:"s"}):j;return o.t(`metricAxisTitles.${F}`,{unit:st})||void 0}return F||void 0},Y=u.computed(()=>{if(s.chartOptions?.dimensionAxesTitle)return s.chartOptions.dimensionAxesTitle;const F=r.value?.meta,j=V.value?"Time":Object.keys(F?.display||F?.metric_names||{})[0];if(j)return o.te(`chartLabels.${j}`)?o.t(`chartLabels.${j}`):j}),nt=u.computed(()=>{if($f(k.value.datasource))return o.t("timestampAxisTitles.platform");const F=Qi(r.value?.meta?.granularity_ms);if(F)return o.te(`granularityAxisTitles.${F}`)?o.t(`granularityAxisTitles.${F}`):F}),N=u.computed(()=>{const F=y.value?.xMetric;return F?z(F,y.value?.xMetricUnit??""):nt.value}),$=u.computed(()=>s.emptyStateTitle||o.t("noDataAvailableTitle")),pt=u.computed(()=>s.emptyStateDescription||o.t("noDataAvailableDescription")),ct=u.computed(()=>rt.value?!!y.value?.points.length:V.value?F1(w.value):!!(r.value&&r.value.meta&&r.value.data.length)),at=u.computed(()=>{const F=r.value;return F?F.meta.granularity_ms?Qi(F.meta.granularity_ms)||"hourly":Qi(new Date(F.data[1].timestamp).getTime()-new Date(F.data[0].timestamp).getTime())||"hourly":"hourly"}),Ct=u.computed(()=>Qi(r.value?.meta?.granularity_ms)||"secondly"),Bt=u.computed(()=>s.chartOptions.chartLegendSortFn?s.chartOptions.chartLegendSortFn:(F,j)=>F.text===o.t("chartLabels.____OTHER____")?1:j.text===o.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(F.text,10))&&!isNaN(parseInt(j.text,10))?F.text<j.text?-1:1:F.value&&j.value?j.value.raw-F.value.raw:0),Pt=u.computed(()=>s.chartOptions.chartTooltipSortFn?s.chartOptions.chartTooltipSortFn:(F,j)=>F.label===o.t("chartLabels.____OTHER____")?1:j.label===o.t("chartLabels.____OTHER____")?-1:!isNaN(parseInt(F.label,10))&&!isNaN(parseInt(j.label,10))?F.label<j.label?-1:1:F.value&&j.value?j.rawValue-F.rawValue:0),St=u.computed(()=>[...s.timeseriesZoom?[{label:o.t("zoom_action_items.zoom"),key:"zoom-in",action:F=>i("zoom-time-range",F)}]:[],...s.exploreLink?[{label:o.t("zoom_action_items.explore"),key:"explore",href:s.exploreLink.href}]:[],...s.requestsLink?[{label:o.t("zoom_action_items.view_requests"),key:"view-requests",href:s.requestsLink.href}]:[]]);return u.provide("showLegendValues",D),u.provide("legendPosition",u.toRef(s,"legendPosition")),(F,j)=>{const st=u.resolveComponent("KTooltip"),zt=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",{ref:"chartShell",class:u.normalizeClass(["analytics-chart-shell",{"show-values":D.value}])},[ct.value&&I.value&&C.value?(u.openBlock(),u.createElementBlock("div",zO,[u.createVNode(st,{class:"tooltip","max-width":"500",placement:"right"},{content:u.withCtx(()=>[u.createElementVNode("div",FO,u.toDisplayString(U.value),1)]),default:u.withCtx(()=>[u.createVNode(u.unref(kt.WarningIcon),{color:`var(--kui-color-text-warning, ${u.unref(eg)})`,size:`var(--kui-icon-size-40, ${u.unref(ig)})`},null,8,["color","size"])]),_:1})])):u.createCommentVNode("",!0),ct.value?(u.openBlock(),u.createElementBlock("div",UO,[V.value?(u.openBlock(),u.createBlock(BO,{key:0,brush:O.value,"chart-data":w.value,"chart-legend-sort-fn":Bt.value,"chart-tooltip-sort-fn":Pt.value,coordinator:u.unref(n),"dimension-axes-title":nt.value,fill:e.chartOptions.stacked,granularity:at.value,"left-y-axis-grid":e.chartOptions.yAxes?.left?.showGrid,"legend-values":u.unref(v),"metric-axes-title":B.value,"metric-unit":A.value,"right-y-axis":M.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,threshold:g.value,"time-range-ms":S.value,"tooltip-metric-display":X.value,"tooltip-title":e.tooltipTitle,type:e.chartOptions.type,"zoom-action-items":St.value,onSelectChartRange:j[0]||(j[0]=re=>i("select-chart-range",re)),onZoomTimeRange:j[1]||(j[1]=re=>i("zoom-time-range",re))},null,8,["brush","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","coordinator","dimension-axes-title","fill","granularity","left-y-axis-grid","legend-values","metric-axes-title","metric-unit","right-y-axis","stacked","synthetics-data-key","threshold","time-range-ms","tooltip-metric-display","tooltip-title","type","zoom-action-items"])):H.value?(u.openBlock(),u.createBlock(aO,{key:1,annotations:e.showAnnotations,"chart-data":w.value,"chart-legend-sort-fn":Bt.value,"chart-tooltip-sort-fn":Pt.value,coordinator:u.unref(n),"data-testid":"bar-chart-container","dimension-axes-title":Y.value,"legend-values":u.unref(v),"metric-axes-title":B.value,"metric-unit":A.value,orientation:ot.value,stacked:e.chartOptions.stacked,"synthetics-data-key":e.syntheticsDataKey,"tooltip-metric-display":X.value,"tooltip-title":e.tooltipTitle},null,8,["annotations","chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","coordinator","dimension-axes-title","legend-values","metric-axes-title","metric-unit","orientation","stacked","synthetics-data-key","tooltip-metric-display","tooltip-title"])):G.value?(u.openBlock(),u.createBlock(xO,{key:2,"chart-data":w.value,coordinator:u.unref(n),"dataset-colors":e.chartOptions.chartDatasetColors||u.unref(Q1),"legend-position":e.legendPosition,"legend-values":u.unref(v),"metric-name":R.value,"metric-unit":A.value,"show-center-metric":e.chartOptions.showCenterMetric,"synthetics-data-key":e.syntheticsDataKey,"tooltip-dimension-display":Y.value,"tooltip-metric-display":X.value,"tooltip-title":e.tooltipTitle},null,8,["chart-data","coordinator","dataset-colors","legend-position","legend-values","metric-name","metric-unit","show-center-metric","synthetics-data-key","tooltip-dimension-display","tooltip-metric-display","tooltip-title"])):rt.value?(u.openBlock(),u.createBlock(SO,{key:3,"chart-data":w.value,"chart-legend-sort-fn":e.chartOptions.chartLegendSortFn,"chart-tooltip-sort-fn":Pt.value,coordinator:u.unref(n),"data-testid":"scatter-chart-container","dimension-axes-title":N.value,granularity:Ct.value,"metric-axes-title":B.value,"metric-unit":A.value,"shade-outlier-region":e.chartOptions.scatter?.shadeOutlierRegion,"synthetics-data-key":e.syntheticsDataKey,"theme-colors":T.value,"time-range-ms":S.value,"tooltip-metric-display":X.value,"tooltip-title":e.tooltipTitle,"x-metric":y.value?.xMetric,"x-metric-unit":y.value?.xMetricUnit},null,8,["chart-data","chart-legend-sort-fn","chart-tooltip-sort-fn","coordinator","dimension-axes-title","granularity","metric-axes-title","metric-unit","shade-outlier-region","synthetics-data-key","theme-colors","time-range-ms","tooltip-metric-display","tooltip-title","x-metric","x-metric-unit"])):u.createCommentVNode("",!0)])):(u.openBlock(),u.createBlock(zt,{key:1,"action-button-visible":!1,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString($.value),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(pt.value),1)]),_:1}))],2)}}}),HO=Et(VO,[["__scopeId","data-v-a7b84b8b"]]),$O={class:"chart-parent","data-testid":"gauge-chart-parent"},YO={class:"chart-totals-flex"},WO={key:1,class:"metric-small","data-testid":"gauge-chart-total"},jO=Et(u.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:()=>[]},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=K.useI18n(),i=u.ref(dr()),s=u.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((g,y)=>g+y,0)),m),{labels:[],backgroundColor:[],borderColor:[],data:[]})]),o=u.computed(()=>({...t.chartData,datasets:s.value}));K.useReportChartDataForSynthetics(u.toRef(t,"chartData"),u.toRef(t,"syntheticsDataKey"));const a={responsive:!0,maintainAspectRatio:!0,cutout:"78%",circumference:"200",rotation:"260",plugins:{legend:{display:!1}}},r=u.computed(()=>Ri(s?.value[0]?.data[t.numerator],{capital:!0})),l=u.computed(()=>Ri(s?.value[0]?.data[0]+s?.value[0]?.data[1],{capital:!0})),c=u.computed(()=>`color: ${s?.value[0]?.backgroundColor[t.numerator]}`),d=u.computed(()=>["full","single"].includes(t.metricDisplay)),h=u.computed(()=>t.metricDisplay==="full");return(f,m)=>(u.openBlock(),u.createElementBlock("div",$O,[u.createElementVNode("div",YO,[d.value?(u.openBlock(),u.createElementBlock("div",{key:0,class:"metric-large","data-testid":"gauge-chart-metric",style:u.normalizeStyle(c.value)},u.toDisplayString(r.value),5)):u.createCommentVNode("",!0),h.value?(u.openBlock(),u.createElementBlock("div",WO,u.toDisplayString(u.unref(n).t("total"))+": "+u.toDisplayString(l.value),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",{class:"chart-container",style:u.normalizeStyle({height:e.height,width:e.width})},[u.createVNode(u.unref(tf),{"chart-id":i.value,data:o.value,options:a},null,8,["chart-id","data","options"])],4)]))}}),[["__scopeId","data-v-6e452d92"]]),qO={key:1,class:"single-value-wrapper"},GO={class:"single-value-metric"},XO={class:"name-unit-alignment"},KO={class:"single-value","data-testid":"single-value-chart"},ZO={key:0,class:"single-value-unit"},QO={class:"single-value-metric-name"},JO={key:0,class:"single-value-trend"},tA={key:0,class:"single-value-trend-range","data-testid":"single-value-trend-range"},fr="t1",mr="t2",eA=Et(u.defineComponent({__name:"SingleValue",props:{data:{type:Object,required:!0},decimalPoints:{type:Number,default:2},leftAlign:{type:Boolean,default:!1},showTrend:{type:Boolean,default:!1},increaseIsBad:{type:Boolean,default:!1},alignX:{type:String,default:"left"}},setup(e){const{i18n:t}=K.useI18n(),{formatBytes:n,formatCost:i}=le({i18n:t}),s=e,o=u.computed(()=>`align-${s.leftAlign?"left":s.alignX}`),a=u.computed(()=>qe.buildDeltaMapping(s.data,s.showTrend,{topLevelKey:fr,secondLevelKey:mr})),r=u.computed(()=>a.value?.previous?.[fr]?.[mr]),l=u.computed(()=>a.value?.current?.[fr]?.[mr]),c=u.computed(()=>s.data.data),d=u.computed(()=>s.data.meta?.metric_names?.[0]),h=u.computed(()=>t.te(`chartLabels.${d.value}`)?t.t(`chartLabels.${d.value}`):""),f=u.computed(()=>{const D=d.value?s.data.meta?.metric_units?.[d.value]:void 0;if(D){const v=`chartUnits.${D}`;return t.te(v)?t.t(v,{plural:""}):""}}),m=u.computed(()=>!!d.value&&(d.value.includes("_per_minute")||d.value.includes("_latency_")||d.value==="error_rate")),p=u.computed(()=>s.showTrend&&r.value!==void 0?r.value:null),g=u.computed(()=>{if(s.showTrend)return l.value??null;if(c.value.length<1||!d.value)return null;const D=c.value[0].event[d.value];return typeof D!="number"||isNaN(D)?null:D}),y=u.computed(()=>s.data?.data?.length===void 0||s.data?.data?.length===0||!s.showTrend&&g.value===null||s.showTrend&&p.value===null&&g.value===null),_=u.computed(()=>{const D=g.value;if(D===null)return"-";const v=d.value?s.data.meta?.metric_units?.[d.value]:void 0;if(v==="usd")return i(D);if(v==="bytes")return n(D);if(D>=1e9){const I=(D/1e9).toFixed(1);return I.endsWith(".0")?`${Math.floor(D/1e9)}B`:`${I}B`}if(D>=1e7){const I=(D/1e6).toFixed(1);return I.endsWith(".0")?`${Math.floor(D/1e6)}M`:`${I}M`}const C=s.decimalPoints&&typeof s.decimalPoints=="number"?s.decimalPoints:2;return D.toLocaleString("en-US",{maximumFractionDigits:C})}),x=u.computed(()=>s.showTrend&&s.data?.data?.length<2),T=u.computed(()=>qe.calculateChange(g.value??0,p.value??0)||0),k=u.computed(()=>{if(!s.showTrend)return 0;if(s.data?.data?.length<2){if(r.value===void 0)return 0;if(l.value===void 0)return s.increaseIsBad?1:-1}return qe.changePolarity(T.value,!0,s.increaseIsBad)}),w=u.computed(()=>qe.defineIcon(k.value,s.increaseIsBad)),O=u.computed(()=>{if(s.showTrend&&s.data?.data?.length<2){if(r.value===void 0)return t.t("singleValue.trend.not_available");if(l.value===void 0)return qe.metricChange(-1,!0,t.t("singleValue.trend.not_available"))}return qe.metricChange(T.value,s.data?.data?.length===2,t.t("singleValue.trend.not_available"))}),S=qe.useTrendRange(u.computed(()=>s.showTrend),void 0,u.computed(()=>s.data.meta)),A=D=>D>0?"positive":D<0?"negative":"neutral",R=D=>D>0?tg:D<0?Jp:hl;return u.onMounted(()=>{!s.showTrend&&s.data?.data?.length>1?console.warn("SingleValue chart should only be used with a single data point. Data length:",s.data.data.length):s.showTrend&&s.data?.data?.length>2&&console.warn("SingleValue with trend expects 2 or fewer data points. Instead got:",s.data.data.length)}),(D,v)=>{const C=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",{class:u.normalizeClass(["chart-parent",o.value]),"data-testid":"single-value-parent"},[y.value?(u.openBlock(),u.createBlock(C,{key:0,class:"single-value-error","data-testid":"single-value-error","icon-variant":"error",title:u.unref(t).t("singleValue.valueError")},null,8,["title"])):(u.openBlock(),u.createElementBlock("div",qO,[u.createElementVNode("div",GO,[u.createElementVNode("div",XO,[u.createElementVNode("span",KO,u.toDisplayString(_.value),1),m.value&&f.value?(u.openBlock(),u.createElementBlock("span",ZO," "+u.toDisplayString(f.value),1)):u.createCommentVNode("",!0)]),u.createElementVNode("div",QO,u.toDisplayString(h.value),1)]),e.showTrend?(u.openBlock(),u.createElementBlock("div",JO,[u.createElementVNode("div",{class:u.normalizeClass(["trend-change",A(k.value)]),"data-testid":"single-value-trend"},[x.value||k.value!==0?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(w.value),{key:0,color:R(k.value),size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])):(u.openBlock(),u.createBlock(u.unref(kt.EqualIcon),{key:1,color:`var(--kui-color-text-neutral-strong, ${u.unref(hl)})`,size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["color","size"])),u.createElementVNode("div",null,u.toDisplayString(O.value),1)],2),u.unref(S)?(u.openBlock(),u.createElementBlock("div",tA,u.toDisplayString(u.unref(S)),1)):u.createCommentVNode("",!0)])):u.createCommentVNode("",!0)]))],2)}}}),[["__scopeId","data-v-640d8a8c"]]),nA={class:"simple-chart-shell"},iA={key:1,class:"analytics-chart-parent"},sA=Et(u.defineComponent({__name:"SimpleChart",props:{chartData:{type:Object,required:!0},chartOptions:{type:Object,required:!0},emptyStateTitle:{type:String,required:!1,default:""},syntheticsDataKey:{type:String,required:!1,default:""},height:{type:String,required:!1,default:"400px",validator:e=>/(\d *)(px|%)/.test(e)},width:{type:String,required:!1,default:"100%",validator:e=>/(\d *)(px|%)/.test(e)}},setup(e){const t=e,{i18n:n}=K.useI18n(),i=u.ref(crypto.randomUUID());u.watch(()=>t.chartOptions.type,()=>{i.value=crypto.randomUUID()},{immediate:!0});const s=u.computed(()=>{const d=K.useExploreResultToDatasets({colorPalette:t.chartOptions.chartDatasetColors},u.toRef(t,"chartData"),i.value).value;return t.chartOptions?.reverseDataset&&d?.datasets.reverse(),d}),o=u.computed(()=>t.chartData.meta?.metric_units?Object.values(t.chartData.meta.metric_units)[0]:""),a=u.computed(()=>t.chartOptions.type==="gauge"),r=u.computed(()=>t.chartOptions.type==="single_value"),l=u.computed(()=>t.emptyStateTitle||n.t("noDataAvailableTitle")),c=u.computed(()=>{const d=t.chartData&&t.chartData.meta&&t.chartData.data.length;if(r.value){const h=t.chartData.meta?.metric_names?.[0];return d&&t.chartData.data[0].event[h]!==null}return d});return(d,h)=>{const f=u.resolveComponent("KEmptyState");return u.openBlock(),u.createElementBlock("div",nA,[c.value?(u.openBlock(),u.createElementBlock("div",iA,[a.value?(u.openBlock(),u.createBlock(jO,{key:0,"chart-data":s.value,"dataset-colors":e.chartOptions.chartDatasetColors,"is-simple":"","metric-display":e.chartOptions.metricDisplay,"metric-unit":o.value,numerator:e.chartOptions.numerator,"synthetics-data-key":e.syntheticsDataKey,width:e.width},null,8,["chart-data","dataset-colors","metric-display","metric-unit","numerator","synthetics-data-key","width"])):u.createCommentVNode("",!0),r.value?(u.openBlock(),u.createBlock(eA,{key:1,"align-x":e.chartOptions.alignX,data:e.chartData,"decimal-points":e.chartOptions.decimalPoints,"increase-is-bad":e.chartOptions.increaseIsBad,"show-trend":e.chartOptions.showTrend},null,8,["align-x","data","decimal-points","increase-is-bad","show-trend"])):u.createCommentVNode("",!0)])):(u.openBlock(),u.createBlock(f,{key:0,"action-button-visible":!0,class:"chart-empty-state","data-testid":"no-data-in-report"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(l.value),1)]),_:1}))])}}}),[["__scopeId","data-v-871f41ff"]]),oA={class:"container"},aA={key:0,class:"no-data","data-testid":"sparkline-empty"},rA=["title"],lA=Et(u.defineComponent({__name:"SparklineChart",props:{chartKey:{default:()=>{}},datasets:{},disableTooltip:{type:Boolean,default:!1},enableBrushing:{type:Boolean,default:!1},groupKey:{default:()=>{}},maxCount:{default:()=>{}},maxStamp:{default:()=>{}},minCount:{default:()=>{}},minStamp:{default:()=>{}},pointRenderCount:{default:24},showLabel:{type:Boolean,default:!1},tooltipTitle:{default:()=>{}},type:{default:"sparkline_bar"}},setup(e){const t=crypto.randomUUID(),{i18n:n}=K.useI18n(),{syncedGroupSizeMs:i,syncedMinStamp:s,syncedMaxStamp:o,syncedMinCount:a,syncedMaxCount:r,syncedRenderPoints:l,syncedChartDatasets:c}=K.useSparklineSync({chartKey:e.chartKey,datasets:e.datasets,groupKey:e.groupKey,minStamp:e.minStamp,maxStamp:e.maxStamp,minCount:e.minCount,maxCount:e.maxCount,renderPoints:e.pointRenderCount,type:e.type}),d=u.reactive({showTooltip:!1,tooltipContext:0,metricDisplay:"",tooltipSeries:[],left:"",top:"",units:"count",translateUnit:()=>"",offsetX:0,offsetY:0,width:0,height:0,chartType:e.type==="sparkline_bar"?"timeseries_bar":"timeseries_line",chartID:t,interactionMode:"idle"}),h=({width:S,height:A})=>{d.width=S,d.height=A},f=u.computed(()=>e.disableTooltip?[]:[new nf({enableBrushing:e.groupKey!==void 0&&e.chartKey!==void 0&&e.enableBrushing,brushStrategy:"group",brushGroup:e.groupKey})]),m=u.computed(()=>c.value.reduce((S,{data:A,label:R})=>({...S,[R]:A.reduce((D,{y:v})=>D+v,0)}),{})),p=u.computed(()=>c.value.map(({label:S})=>[m.value[S],`${S}: ${m.value[S]}`]).sort(([S],[A])=>A-S).map(([,S])=>S).join(", ")),g=u.computed(()=>Object.keys(m.value).map(S=>m.value[S]).reduce((S,A)=>S+A,0)),y=u.computed(()=>g.value>0),_=u.computed(()=>({labels:new Array(l.value).fill(""),datasets:c.value})),x=u.computed(()=>e.datasets.length>1),T=`SparklineTooltipPosition-${t}`,k=u.computed(()=>{const S=e.type==="sparkline_bar",A=S?s.value-1:s.value,R=S?o.value:o.value-i.value;return{maintainAspectRatio:!1,elements:{categoryPercentage:1,barPercentage:1,line:{tension:0,stepped:e.type==="sparkline_step",borderWidth:1},point:{radius:0,pointHitRadius:11,pointHoverRadius:0}},interaction:{intersect:!1,mode:"index"},layout:{padding:{left:S?0:2,right:S?0:2,top:2}},plugins:{legend:{display:!1},tooltip:{enabled:!1,position:T,external:D=>{Ea(d,D,"minutely",{contextFormatter:v=>{const C=v+i.value;let I="";return i.value>1440*60*1e3?I=as(new Date(C),"MMM dd, yyy hh:mm a"):I=as(new Date(C),"hh:mm a"),`${Lp(v)} - ${I}`}})}}},scales:{x:{min:A,max:R,type:"timeseries",offset:!1,grid:{display:!1},display:!1,stacked:x.value},y:{min:Math.max(a.value-1,0),max:r.value,grid:{display:!1},display:!1,stacked:x.value}}}}),w=u.ref("0"),O=u.ref("0");return u.onMounted(()=>{Wt.positioners[T]=function(S,A){if(!S.length||d.interactionMode==="interactive"||A.x===null)return!1;const R=10,D=this.chart.canvas.getBoundingClientRect(),v=d.width||this.width,C=d.height||this.height,I=D.top-C>0,U=I?D.top-C-R:D.top+D.height+R,H=D.left>v/2-A.x,V=Math.max(R,window.innerWidth-R-v),G=Math.min(V,H?Math.floor(D.left-v/2)+A.x:0+R);return w.value=`${U}px`,O.value=`${G}px`,{x:G,y:U,xAlign:"center",yAlign:I?"top":"bottom"}}}),u.onUnmounted(()=>{Wt.positioners[T]&&delete Wt.positioners[T]}),(S,A)=>(u.openBlock(),u.createElementBlock("div",oA,[y.value?e.type==="sparkline_bar"?(u.openBlock(),u.createBlock(u.unref(Jh),{key:1,"chart-id":u.unref(t),data:_.value,"data-testid":"sparkline-bar",options:k.value,plugins:f.value},null,8,["chart-id","data","options","plugins"])):e.type==="sparkline_line"||e.type==="sparkline_step"?(u.openBlock(),u.createBlock(u.unref(ef),{key:2,"chart-id":u.unref(t),data:_.value,"data-testid":e.type==="sparkline_line"?"sparkline-line":"sparkline-step",options:k.value,plugins:f.value},null,8,["chart-id","data","data-testid","options","plugins"])):u.createCommentVNode("",!0):(u.openBlock(),u.createElementBlock("div",aA,[u.renderSlot(S.$slots,"empty",{},()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("sparkline_no_data")),1)],!0)])),e.disableTooltip?u.createCommentVNode("",!0):(u.openBlock(),u.createBlock(Wi,{key:3,"absolute-left":O.value,"absolute-top":w.value,class:"tooltip","data-testid":"sparkline-tooltip",state:d,"tooltip-title":e.tooltipTitle,onDimensions:h},null,8,["absolute-left","absolute-top","state","tooltip-title"])),y.value&&e.showLabel?(u.openBlock(),u.createElementBlock("div",{key:4,class:"label",title:S.$slots.label?"":p.value},[u.renderSlot(S.$slots,"label",{total:g.value,totalByDataset:m.value},()=>[u.createTextVNode(u.toDisplayString(p.value),1)],!0)],8,rA)):u.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-ae8259b6"]]),cA=["data-value"],uA=["title"],dA={class:"top-talkers-cell-metric"},hA={class:"top-talkers-cell-value","data-testid":"top-talkers-cell-value"},fA={key:0,class:"top-talkers-cell-relative","data-testid":"top-talkers-cell-relative"},mA={class:"top-talkers-tooltip","data-testid":"top-talkers-tooltip"},pA={class:"top-talkers-tooltip-title"},gA={class:"top-talkers-tooltip-rows"},yA={class:"top-talkers-tooltip-label"},bA=["data-threshold"],_A=Et(u.defineComponent({__name:"TopTalkersCell",props:{cell:{}},setup(e){return u.useCssVars(t=>({cecbd9f0:t.cell.color,v0d35e6b6:t.cell.tint})),(t,n)=>(u.openBlock(),u.createBlock(u.unref(Kn.KPop),{class:"top-talkers-cell-wrapper",disabled:!e.cell.tooltipRows.length,"hide-caret":"","hide-close-icon":"",placement:"right","popover-timeout":0,style:u.normalizeStyle({flexGrow:e.cell.ratio}),trigger:"hover"},{content:u.withCtx(()=>[u.createElementVNode("div",mA,[u.createElementVNode("div",pA,u.toDisplayString(e.cell.name),1),u.createElementVNode("dl",gA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.cell.tooltipRows,i=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:i.key},[u.createElementVNode("dt",yA,u.toDisplayString(i.label),1),u.createElementVNode("dd",{class:u.normalizeClass(["top-talkers-tooltip-value",i.threshold&&`top-talkers-tooltip-value--${i.threshold}`]),"data-threshold":i.threshold},u.toDisplayString(i.value),11,bA)],64))),128))])])]),default:u.withCtx(()=>[u.createElementVNode("div",{class:u.normalizeClass(["top-talkers-cell",{"top-talkers-cell--other":e.cell.isOther,"top-talkers-cell--empty":e.cell.isEmpty,"top-talkers-cell--deleted":e.cell.deleted}]),"data-testid":"top-talkers-cell","data-value":e.cell.id},[u.createElementVNode("span",{class:"top-talkers-cell-name","data-testid":"top-talkers-cell-name",title:e.cell.name},u.toDisplayString(e.cell.name),9,uA),u.createElementVNode("span",dA,[u.createElementVNode("span",hA,u.toDisplayString(e.cell.display),1),e.cell.relative?(u.openBlock(),u.createElementBlock("span",fA,"("+u.toDisplayString(e.cell.relative)+")",1)):u.createCommentVNode("",!0)])],10,cA)]),_:1},8,["disabled","style"]))}}),[["__scopeId","data-v-73764587"]]),xA=["data-dimension"],wA={class:"top-talkers-column-header"},kA={class:"top-talkers-column-label","data-testid":"top-talkers-column-label"},TA={key:0,class:"top-talkers-column-total","data-testid":"top-talkers-column-total"},vA={key:1,class:"top-talkers-column-empty","data-testid":"top-talkers-column-empty"},SA={key:2,class:"top-talkers-column-cells"},cf=Et(u.defineComponent({__name:"TopTalkersColumn",props:{dimension:{},label:{},data:{},sizeMetric:{},columnOptions:{},isLoading:{type:Boolean}},setup(e){const{i18n:t}=K.useI18n(),{column:n}=K.useTopTalkersData(u.toRef(()=>e.data),u.toRef(()=>e.dimension),u.toRef(()=>e.sizeMetric),u.toRef(()=>e.columnOptions)),i=u.computed(()=>e.label||n.value.label),s=u.computed(()=>t.t("topTalkers.total",{value:n.value.total}));return(o,a)=>(u.openBlock(),u.createElementBlock("div",{class:"top-talkers-column","data-dimension":e.dimension,"data-testid":"top-talkers-column"},[u.createElementVNode("div",wA,[u.createElementVNode("span",kA,u.toDisplayString(i.value),1),!e.isLoading&&u.unref(n).cells.length?(u.openBlock(),u.createElementBlock("span",TA,u.toDisplayString(s.value),1)):u.createCommentVNode("",!0)]),e.isLoading?(u.openBlock(),u.createBlock(u.unref(Kn.KSkeleton),{key:0,"delay-milliseconds":0,"table-columns":1,type:"table"})):u.unref(n).cells.length?(u.openBlock(),u.createElementBlock("div",SA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(u.unref(n).cells,r=>(u.openBlock(),u.createBlock(_A,{key:r.id,cell:r},null,8,["cell"]))),128))])):(u.openBlock(),u.createElementBlock("div",vA,u.toDisplayString(u.unref(t).t("topTalkers.defaultEmptyStateTitle")),1))],8,xA))}}),[["__scopeId","data-v-e1b08041"]]),MA={class:"top-talkers-card-title","data-testid":"top-talkers-card-title"},DA={key:2,class:"top-talkers-grid","data-testid":"top-talkers-grid"},CA=Et(u.defineComponent({__name:"TopTalkersGrid",props:{title:{default:""},columns:{},sizeMetric:{default:void 0},columnOptions:{default:void 0},emptyStateTitle:{default:""},errorMessage:{default:""},titleTag:{default:"h2"}},setup(e){const t=e,{i18n:n}=K.useI18n(),i=u.useSlots(),s=u.computed(()=>!!i.column),o=u.computed(()=>s.value||t.columns.some(a=>!!a.data?.data?.length||a.isLoading));return(a,r)=>(u.openBlock(),u.createBlock(u.unref(Kn.KCard),{class:"kong-ui-public-top-talkers","title-tag":e.titleTag},u.createSlots({default:u.withCtx(()=>[e.errorMessage?(u.openBlock(),u.createBlock(u.unref(Kn.KEmptyState),{key:0,"action-button-visible":!1,"data-testid":"top-talkers-error-state","icon-variant":"error"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("topTalkers.defaultErrorStateTitle")),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.errorMessage),1)]),_:1})):o.value?(u.openBlock(),u.createElementBlock("div",DA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(e.columns,(l,c)=>u.renderSlot(a.$slots,"column",{key:`${l.dimension}-${c}`,column:l},()=>[u.createVNode(cf,{"column-options":e.columnOptions,data:l.data,dimension:l.dimension,"is-loading":l.isLoading,label:l.label,"size-metric":e.sizeMetric},null,8,["column-options","data","dimension","is-loading","label","size-metric"])],!0)),128))])):(u.openBlock(),u.createBlock(u.unref(Kn.KEmptyState),{key:1,"action-button-visible":!1,"data-testid":"top-talkers-empty-state"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.emptyStateTitle||u.unref(n).t("topTalkers.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:u.withCtx(()=>[u.createElementVNode("span",MA,u.toDisplayString(e.title),1)]),key:"0"}:void 0]),1032,["title-tag"]))}}),[["__scopeId","data-v-d5bb8abd"]]),OA={ai_provider:{anthropic:kt.AnthropicIcon,azure:kt.AzureIcon,bedrock:kt.AmazonBedrockIcon,cerebras:kt.CerebrasIcon,cohere:kt.CohereIcon,databricks:kt.DatabricksIcon,deepseek:kt.DeepseekIcon,gemini:kt.GeminiIcon,huggingface:kt.HuggingFaceIcon,llama2:kt.MetaLlamaIcon,mistral:kt.MistralIcon,moonshot:kt.KimiIcon,nvidia:kt.NvidiaIcon,ollama:kt.OllamaIcon,openai:kt.OpenAiIcon,vertex:kt.GoogleVertexIcon,vllm:kt.VllmIcon,xai:kt.GrokIcon}},AA=(e,t)=>{if(!(!e||!t))return OA[e]?.[t.toLowerCase()]},PA=["data-threshold"],EA=Et(u.defineComponent({__name:"TopNMetricBar",props:{ratio:{},threshold:{}},setup(e){u.useCssVars(n=>({v114553bb:u.unref(t)}));const t=pe({discriminator:0});return(n,i)=>(u.openBlock(),u.createElementBlock("span",{class:u.normalizeClass(["top-n-metric-cell-bar",{[`top-n-metric-cell--bar-${e.threshold}`]:!!e.threshold}]),"data-testid":"top-n-metric-cell-bar","data-threshold":e.threshold},[u.createElementVNode("span",{class:"top-n-metric-cell-bar-fill",style:u.normalizeStyle({width:`${e.ratio*100}%`})},null,4)],10,PA))}}),[["__scopeId","data-v-b5b1edfe"]]),RA=["data-threshold"],IA={class:"top-n-metric-cell-value"},LA={key:0,class:"top-n-metric-cell-relative","data-testid":"top-n-metric-cell-relative"},NA=Et(u.defineComponent({__name:"TopNMetricCell",props:{display:{},relative:{},threshold:{},hasBar:{type:Boolean}},setup(e){return(t,n)=>(u.openBlock(),u.createElementBlock("span",{class:u.normalizeClass(["top-n-metric-cell",{"top-n-metric-cell--bar":e.hasBar,[`top-n-metric-cell--text-${e.threshold}`]:!e.hasBar&&!!e.threshold}]),"data-threshold":e.threshold},[u.createElementVNode("span",IA,u.toDisplayString(e.display),1),e.relative?(u.openBlock(),u.createElementBlock("span",LA,"("+u.toDisplayString(e.relative)+")",1)):u.createCommentVNode("",!0)],10,RA))}}),[["__scopeId","data-v-17e7f860"]]),BA={class:"top-n-card-title","data-testid":"top-n-card-title"},zA={class:"top-n-card-description","data-testid":"top-n-card-description"},FA={key:3,class:"top-n-table","data-testid":"top-n-table"},UA={"data-testid":"top-n-table-header"},VA={class:"top-n-table-header-row"},HA=["colspan"],$A={class:"table-header-label"},YA=["data-testid"],WA={class:"top-n-table-cell-label"},jA={key:0,class:"top-n-table-cell top-n-table-cell-bar"},qA=3,GA=Et(u.defineComponent({__name:"TopNTable",props:{title:{default:""},description:{default:""},data:{},emptyStateTitle:{default:""},isLoading:{type:Boolean,default:!1},titleTag:{default:"h2"},columnOptions:{default:void 0}},setup(e){const t=e,{i18n:n}=K.useI18n(),{formatUnit:i}=le({i18n:n}),s=u.computed(()=>t.data.data),o=u.computed(()=>!!s.value?.length),a=u.computed(()=>t.data.meta?.display?Object.keys(t.data.meta.display).slice(0,qA):[]),r=u.computed(()=>a.value[0]||""),l=u.computed(()=>a.value.length>1),c=u.computed(()=>a.value[a.value.length-1]||""),d=u.computed(()=>r.value?t.data.meta.display[r.value]:{}),h=u.computed(()=>t.data.meta?.metric_names?.length?t.data.meta.metric_names:[]),f=u.computed(()=>h.value[0]),m=u.computed(()=>f.value?X(f.value):""),p=u.computed(()=>{const M=a.value.map(E=>({key:E,columnKey:E,label:G(E,l.value?X(E):n.t("topNTable.nameLabel")),type:"dimension"}));return f.value&&M.push({key:"value",columnKey:f.value,label:G(f.value,m.value),type:"metric"}),h.value.forEach((E,z)=>{z!==0&&M.push({key:E,columnKey:E,label:G(E,X(E)),type:"metric"})}),M}),g=u.computed(()=>p.value.filter(M=>M.type==="metric")),y=u.computed(()=>p.value.filter(M=>M.type==="dimension").slice(1)),_=M=>M.type==="dimension"&&M.key===c.value,x=M=>M.type==="metric"&&!!ln(t.columnOptions,M.columnKey)?.bar,T=M=>l.value&&M.type==="dimension"&&!_(M),k=M=>{const E=M.event;return String(E[r.value])},w=(M,E)=>{const z=String(M.event[E]),Y=t.data.meta?.display?.[E]?.[z];return{dimension:E,id:z,name:Y?.name||"-",deleted:!!Y?.deleted}},O=M=>{const E=k(M),z=d.value&&d.value[E];return z?z.name:"-"},S=M=>{const E=k(M),z=d.value&&d.value[E];return z?!!z.deleted:!1},A=M=>{const E=z=>i(z,"%",{translateUnit:Y=>B(Y,z)});return M>0&&M<.01?`< ${E(.01)}`:E(M)},R=(M,E)=>{const z=M.event[E];if(z==null)return"–";const Y=typeof z=="number"?z:Number(z);if(Number.isNaN(Y))return"–";const nt=t.data.meta?.metric_units?.[E]||"count";if(nt==="%")return A(Y);const N=["count","count/minute","token count"].includes(nt);return i(Y,nt,{approximate:N,isBytes1024:!0,translateUnit:$=>B($,Y)})},D=u.computed(()=>Object.fromEntries(h.value.map(M=>[M,Oa(s.value.map(E=>Nn(E.event[M])))]))),v=(M,E)=>{const z=ln(t.columnOptions,E),Y=Nn(M.event[E]);if(!z||Y===null)return{display:R(M,E)};const nt=D.value[E],N=z.value==="relative"?Aa(Y,nt):null;return{display:R(M,E),relative:N===null?void 0:A(N*100),barRatio:z.bar?Sd(Y,nt,z.bar):void 0,threshold:Pa(Y,z.thresholds)}},C=u.computed(()=>s.value?.length?s.value.map(M=>{const E=a.value.map(N=>w(M,N)),z=E[0],Y=z?.id||k(M),nt={id:Y,rowKey:E.map(N=>`${N.dimension}:${N.id}`).join("|")||Y,name:z?.name||O(M),deleted:S(M),dimensions:E,metrics:{},original:M};return h.value.forEach((N,$)=>{nt.metrics[$===0?"value":N]=v(M,N)}),nt}):[]),I=u.computed(()=>{if(!o.value)return"";if(t.data.meta){if(a.value.some(M=>!Object.keys(t.data.meta.display[M]||{}).length))return n.t("topNTable.errors.display");if(!f.value)return n.t("topNTable.errors.metricNames")}else return n.t("topNTable.errors.meta");return""}),U=(M,E)=>M.metrics[E]??{display:"–"},H=(M,E)=>M.dimensions.find(z=>z.dimension===E)?.id||"",V=(M,E)=>AA(ln(t.columnOptions,M)?.icon_set,E),G=(M,E)=>M&&ln(t.columnOptions,M)?.label||E,rt=(M,E)=>M.dimensions.find(z=>z.dimension===E)?.name||"–",ot=(M,E)=>{const z=M.dimensions.find(Y=>Y.dimension===E);return{id:z?.id||"",name:z?.name||"–",deleted:z?.deleted||!1,dimension:E,dimensions:M.dimensions,isEmpty:z?.id==="empty"}},X=M=>n.te(`chartLabels.${M}`)?n.t(`chartLabels.${M}`):M,B=(M,E)=>{if(zi(M)||M==="count"||M==="requests")return"";const z=E===1?"":"s";return n.te(`chartUnits.${M}`)?n.t(`chartUnits.${M}`,{plural:z}):M};return(M,E)=>{const z=u.resolveComponent("KEmptyState"),Y=u.resolveComponent("KSkeleton"),nt=u.resolveComponent("KCard");return u.openBlock(),u.createBlock(nt,{class:"kong-ui-public-top-n-table","title-tag":e.titleTag},u.createSlots({default:u.withCtx(()=>[I.value?(u.openBlock(),u.createBlock(z,{key:0,"action-button-visible":!1,"data-testid":"top-n-error-state","icon-variant":"error"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(u.unref(n).t("topNTable.defaultErrorStateTitle")),1)]),default:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(I.value),1)]),_:1})):e.isLoading?(u.openBlock(),u.createBlock(Y,{key:1,"table-columns":2,type:"table"})):o.value?(u.openBlock(),u.createElementBlock("div",FA,[u.createElementVNode("table",{class:u.normalizeClass(["top-n-table-table",{"top-n-table-table--multi-dimension":l.value}])},[u.createElementVNode("thead",UA,[u.createElementVNode("tr",VA,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(p.value,N=>(u.openBlock(),u.createElementBlock("th",{key:N.key,class:u.normalizeClass(["top-n-table-header-cell",{"top-n-table-header-cell-metric":N.type==="metric","top-n-table-header-cell-dimension-compact":T(N)}]),colspan:x(N)?2:void 0,"data-testid":"top-n-table-header-column"},[u.createElementVNode("span",$A,u.toDisplayString(N.label),1),E[0]||(E[0]=u.createElementVNode("div",{class:"top-n-table-header-cell-border"},null,-1))],10,HA))),128))])]),u.createElementVNode("tbody",null,[(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(C.value,N=>(u.openBlock(),u.createElementBlock("tr",{key:N.rowKey,class:"top-n-table-row"},[a.value.length?(u.openBlock(),u.createElementBlock("td",{key:0,class:u.normalizeClass(["top-n-table-cell top-n-table-cell--name",{"top-n-table-cell-dimension-compact":l.value}])},[u.createElementVNode("span",{class:"top-n-table-cell-label","data-testid":`row-${N.id}`},[V(r.value,N.id)?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(V(r.value,N.id)),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["size"])):u.createCommentVNode("",!0),u.renderSlot(M.$slots,"name",{record:{id:N.id,name:N.name,deleted:N.deleted,dimension:r.value,dimensions:N.dimensions,isEmpty:N.id==="empty"}},()=>[u.createTextVNode(u.toDisplayString(N.name),1)],!0)],8,YA)],2)):u.createCommentVNode("",!0),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(y.value,$=>(u.openBlock(),u.createElementBlock("td",{key:$.key,class:u.normalizeClass(["top-n-table-cell top-n-table-cell--dimension",{"top-n-table-cell-dimension-compact":!_($)}])},[u.createElementVNode("span",WA,[V($.key,H(N,$.key))?(u.openBlock(),u.createBlock(u.resolveDynamicComponent(V($.key,H(N,$.key))),{key:0,class:"top-n-table-cell-icon","data-testid":"top-n-table-cell-icon",decorative:"",size:`var(--kui-icon-size-30, ${u.unref(Tn)})`},null,8,["size"])):u.createCommentVNode("",!0),u.renderSlot(M.$slots,"name",{record:ot(N,$.key)},()=>[u.createTextVNode(u.toDisplayString(rt(N,$.key)),1)],!0)])],2))),128)),(u.openBlock(!0),u.createElementBlock(u.Fragment,null,u.renderList(g.value,$=>(u.openBlock(),u.createElementBlock(u.Fragment,{key:$.key},[u.createElementVNode("td",{class:u.normalizeClass(["top-n-table-cell top-n-table-cell-metric",{"top-n-table-cell-metric--has-bar":x($)}])},[u.createVNode(NA,{"data-testid":$.key==="value"?`row-${N.id}`:`row-${N.id}-${$.key}`,display:U(N,$.key).display,"has-bar":x($),relative:U(N,$.key).relative,threshold:U(N,$.key).threshold},null,8,["data-testid","display","has-bar","relative","threshold"])],2),x($)?(u.openBlock(),u.createElementBlock("td",jA,[u.createVNode(EA,{ratio:U(N,$.key).barRatio??0,threshold:U(N,$.key).threshold},null,8,["ratio","threshold"])])):u.createCommentVNode("",!0)],64))),128))]))),128))])],2)])):(u.openBlock(),u.createBlock(z,{key:2,"action-button-visible":!1,"data-testid":"top-n-empty-state"},{title:u.withCtx(()=>[u.createTextVNode(u.toDisplayString(e.emptyStateTitle||u.unref(n).t("topNTable.defaultEmptyStateTitle")),1)]),_:1}))]),_:2},[e.title?{name:"title",fn:u.withCtx(()=>[u.createElementVNode("span",BA,u.toDisplayString(e.title),1)]),key:"0"}:void 0,e.description?{name:"actions",fn:u.withCtx(()=>[u.createElementVNode("div",zA,u.toDisplayString(e.description),1)]),key:"1"}:void 0]),1032,["title-tag"])}}}),[["__scopeId","data-v-9111e441"]]);it.AnalyticsChart=HO,it.ChartLegendPosition=Lt,it.DECIMAL_DISPLAY=U1,it.FONT_SIZE_REGULAR=Pd,it.FONT_SIZE_SMALL=Ad,it.LEFT_Y_AXIS_ID=qs,it.MAX_LABEL_LENGTH=js,it.OTHER_DIMENSION_ID=mo,it.RIGHT_Y_AXIS_ID=Ia,it.SimpleChart=sA,it.SparklineChart=lA,it.TopNTable=GA,it.TopTalkersColumn=cf,it.TopTalkersGrid=CA,it.chartTypes=UM,it.exploreResultToScatterData=Zd,it.formatChartTicksByGranularity=ja,it.getBarRatio=Sd,it.getColumnOptions=ln,it.getColumnStats=Oa,it.getRelativeValue=Aa,it.getThresholdType=Pa,it.handleQueryError=PM,it.isCancellationError=Xd,it.isScatterChartData=Xa,it.lookupStatusCodeColor=Rd,it.requestsToScatterData=BM,it.simpleChartMetricDisplay=FM,it.simpleChartTypes=VM,it.toNumber=Nn,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})}));
|